:root {
    --bg: #07151a;
    --bg-soft: #10242a;
    --panel: rgba(10, 29, 35, 0.78);
    --panel-strong: rgba(7, 22, 28, 0.92);
    --line: rgba(164, 220, 205, 0.16);
    --text: #ecf6f3;
    --muted: #9fc0b8;
    --accent: #52d6a2;
    --accent-strong: #16b173;
    --accent-warm: #ffd166;
    --chart-bar: #52d6a2;
    --chart-bar-border: #16b173;
    --chart-text: #ecf6f3;
    --chart-grid: rgba(164, 220, 205, 0.16);
    --shadow: 0 28px 60px rgba(19, 18, 18, 0.28);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --content-width: 1120px;
}

* {
    box-sizing: border-box;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
}

.navbar {
    width: min(calc(100% - 32px), var(--content-width));
    margin: 12px auto 0;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(4, 27, 36, 0.589);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    z-index: 20;
}

body {
    margin: 0;
    min-height: 100vh;
    padding-top: 0;
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 85%, rgba(255, 209, 102, 0.08), transparent 20%),
        linear-gradient(180deg, #06141b 0%, #0d2531 48%, #1b4959 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 0, 0, 0) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 85%);
}

.page {
    position: relative;
    z-index: 1;
}



@keyframes move-forever {
    0% { transform: translate(-2px, 0); }
    100% { transform: translate(0px, 0); }
}

.logo {
    margin: 0;
    font-size: 1.05rem;
    letter-spacing: 0.08em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 999px;
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text);
    background: rgba(82, 214, 162, 0.14);
    transform: translateY(-1px);
}

.page {
    display: none;
    width: min(calc(100% - 32px), var(--content-width));
    margin: 28px auto 48px;
    animation: rise 0.45s ease;
}

.page.active {
    display: block;
}

.panel {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgb(17, 46, 59), rgba(24, 72, 102, 0.767));
    box-shadow: var(--shadow);
}

.panel::after {
    content: "";
    position: absolute;
    inset: auto -80px -80px auto;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(1, 0, 15, 0.007), transparent 70%);
    pointer-events: none;
}

.home-panel,
.upload-panel,
.about-panel,
.admin-panel,
.archive-panel,
.form-panel,
.results-list-panel,
.wastes-list-panel,
.results-panel {
    padding: 42px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent-warm);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
    font-weight: 700;
}

.about-panel {
    max-width: 960px;
    margin: 0 auto;
}

.about-panel h1 {
    max-width: none;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1;
    margin-bottom: 28px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--line);
}

.about-copy {
    max-width: 760px;
}

.about-copy p {
    margin-bottom: 24px;
    font-size: 1.06rem;
}

.about-copy p:first-child {
    color: var(--text);
    font-size: clamp(1.08rem, 2vw, 1.25rem);
    line-height: 1.65;
}

.about-copy p:last-child {
    margin-bottom: 0;
}

.about-link-text {
    color: var(--accent-warm);
    font-weight: 700;
}

.admin-panel {
    min-height: 180px;
}

#admin-nav-link:hover,
#admin-nav-link:focus-visible {
    border-color: var(--accent-warm);
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    max-width: 15ch;
    font-size: clamp(2.8rem, 7vw, 5.8rem);
    line-height: 0.94;
    letter-spacing: -0.04em;
    margin-bottom: 18px;
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

p {
    color: var(--muted);
    line-height: 1.7;
}

h4 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 14px;
    font-family: "Sora", "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.hero-copy {
    max-width: 640px;
    font-size: 1.08rem;
    margin-bottom: 28px;
}

.upload-card {
    width: min(100%, 1024px);
    min-height: 120px;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0);
    background: linear-gradient(180deg, rgba(3, 59, 33, 0), rgba(2, 54, 19, 0));
    display: grid;
    align-content: start;
    gap: 14px;
}

.results-card {
    width: min(100%, 1024px);
    min-height: 320px;
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0);
    background: linear-gradient(180deg, rgba(3, 59, 33, 0), rgba(2, 54, 19, 0));
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#results-back-button {
    margin-top: auto;
    align-self: flex-start;
}


.upload-actions-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.global-confidence-controls {
    display: grid;
    gap: 12px;
    margin: 4px 0 8px;
    padding: 16px;
    border: 1px solid rgba(120, 180, 200, 0.2);
    border-radius: 14px;
    background: rgba(4, 30, 42, 0.42);
}

.global-confidence-controls[hidden] {
    display: none;
}

.global-confidence-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-confidence-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.global-confidence-info-button {
    display: inline-grid;
    place-items: center;
    width: 22px;
    min-height: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(130, 212, 220, 0.5);
    border-radius: 50%;
    color: #d9f7f7;
    background: rgba(18, 100, 120, 0.48);
    box-shadow: none;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.feedback-info-icon {
    display: block;
    width: 14px;
    height: 17px;
    object-fit: contain;
}

.global-confidence-info-button .feedback-info-icon {
    width: 10px;
    height: 13px;
}

.global-confidence-info-button:hover,
.global-confidence-info-button:focus-visible {
    color: #fff;
    background: rgba(39, 184, 189, 0.78);
    box-shadow: none;
}

.global-confidence-description {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.global-confidence-form {
    display: grid;
    gap: 7px;
}

.global-confidence-form label {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 700;
}

.global-confidence-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-confidence-input-row input {
    width: min(100%, 210px);
}

#set-global-confidence-button {
    min-height: 40px;
    padding: 8px 18px;
}

html[data-theme="light"] .global-confidence-controls {
    border-color: rgba(9, 83, 130, 0.16);
    background: rgba(255, 255, 255, 0.68);
}

html[data-theme="light"] .global-confidence-info-button {
    border-color: rgba(0, 116, 181, 0.42);
    color: #0074b5;
    background: rgba(0, 143, 208, 0.1);
}

html[data-theme="dark"] .feedback-info-icon {
    filter: brightness(0);
}

html[data-theme="light"] .home-upload-selection {
    scrollbar-color: rgba(0, 143, 208, 0.72) transparent;
}

html[data-theme="light"] .home-upload-selection::-webkit-scrollbar-thumb {
    background: rgba(0, 143, 208, 0.72);
}

html[data-theme="light"] .confidence-threshold-error {
    color: #b4233c;
}

.image-input {
    display: none;
}

.file-picker-button,
button,
input[type="submit"] {
    width: fit-content;
    border: 0;
    border-radius: 999px;
    padding: 14px 22px;
    font: inherit;
    font-weight: 700;
    color: #062019;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent));
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(29, 182, 122, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.file-picker-button:hover,
.file-picker-button:focus-visible,
button:hover,
button:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(29, 182, 122, 0.28);
}

#analyze-button.is-loading,
#analyze-button.is-loading:hover,
#analyze-button.is-loading:focus-visible {
    cursor: wait;
    transform: none;
}

#analyze-button.is-loading::before {
    content: "";
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.5em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: analyze-button-spin 0.75s linear infinite;
}

@keyframes analyze-button-spin {
    to { transform: rotate(360deg); }
}

.selected-file-name {
    margin: 0;
    min-height: 28px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(159, 192, 184, 0.548);
    background: rgba(4, 15, 19, 0.46);
    color: var(--text);
}

.selected-images-list {
    display: grid;
    gap: 16px;
    margin: 12px 0 18px;
}

.selected-image-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(120, 180, 200, 0.14);
    background: linear-gradient(180deg, rgba(9, 20, 35, 0.94), rgba(17, 37, 58, 0.88));
}

.selected-image-thumbnail {
    width: 100%;
    max-width: 1000px;
    height: 400px;
    object-fit: contain;
    border-radius: 14px;
}

.selected-image-details {
    display: grid;
    gap: 10px;
}

.selected-image-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.selected-image-name {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
    flex: 1;
    min-width: 0;
}

.confidence-threshold-field {
    display: grid;
    gap: 6px;
}

.confidence-threshold-label {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
}

.confidence-threshold-input {
    max-width: 260px;
}

.confidence-threshold-error {
    margin: 0;
    color: #ff8792;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
}

.selected-image-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.remove-image-button,
.edit-image-button,
.done-image-button {
    width: fit-content;
    padding: 8px 14px;
    font-size: 0.9rem;
    min-width: auto;
    box-shadow: 0 8px 18px rgba(6, 27, 6, 0.466);
}


.user-form {
    max-width: 520px;
    display: grid;
    gap: 12px;
}

label {
    color: var(--text);
    font-weight: 600;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 15px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(159, 192, 184, 0.18);
    background: rgba(4, 15, 19, 0.72);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input::placeholder {
    color: rgba(159, 192, 184, 0.72);
}

input:focus {
    border-color: rgba(82, 214, 162, 0.65);
    box-shadow: 0 0 0 4px rgba(82, 214, 162, 0.12);
    background: rgba(6, 22, 28, 0.92);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.password-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.password-field input {
    flex: 1;
}

.password-toggle {
    width: 42px;
    min-height: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    flex: 0 0 auto;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}


.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 22px;
}

.archive-card {
    padding: 22px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(159, 192, 184, 0.12);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--accent-warm);
    background: rgba(255, 209, 102, 0.12);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-switch-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.auth-tab {
    width: fit-content;
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 700;
    color: #062019;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent));
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(29, 182, 122, 0.22);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.auth-tab:hover,
.auth-tab:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(29, 182, 122, 0.28);
}

#show-forgot-password {
    min-height: 0;
    padding: 0;
    border-radius: 0;
    color: #ffd166;
    background: transparent;
    box-shadow: none;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

#show-forgot-password:hover,
#show-forgot-password:focus-visible {
    color: #ffe29a;
    background: transparent;
    box-shadow: none;
    transform: none;
}

html[data-theme="light"] #show-forgot-password {
    color: #0074b5;
}

html[data-theme="light"] #show-forgot-password:hover,
html[data-theme="light"] #show-forgot-password:focus-visible {
    color: #008fd0;
}

.auth-view {
    display: none;
}

.active-auth-view {
    display: block;
}

.auth-forms-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    align-items: start;
}

.auth-forms-grid[hidden] {
    display: none;
}

.auth-forms-grid .auth-view {
    min-width: 0;
    box-sizing: border-box;
}

.auth-forms-grid .auth-view:first-child {
    padding-right: clamp(34px, 6vw, 96px);
}

.auth-forms-grid .auth-view + .auth-view {
    padding-left: clamp(34px, 6vw, 96px);
    border-left: 1px solid rgba(159, 192, 184, 0.24);
}

@media (max-width: 760px) {
    .auth-forms-grid {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .auth-forms-grid .auth-view:first-child {
        padding-right: 0;
    }

    .auth-forms-grid .auth-view + .auth-view {
        padding-top: 38px;
        padding-left: 0;
        border-top: 1px solid rgba(159, 192, 184, 0.24);
        border-left: 0;
    }
}


@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 760px) {
    body {
        padding-top: 0;
    }

    .navbar {
        border-radius: 26px;
        padding: 18px;
    }

    .navbar,
    .nav-links {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links a {
        text-align: center;
    }

    .hero-panel,
    .about-panel,
    .archive-panel,
    .form-panel {
        padding: 28px 22px;
    }

    h1 {
        max-width: none;
    }

    .file-picker-button,
    button,
    input[type="submit"] {
        width: 100%;
        justify-content: center;
    }
}






:root {
    color-scheme: dark;
}

.theme-toggle {
    width: 62px;
    height: 34px;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid rgba(159, 220, 215, 0.28);
    border-radius: 999px;
    color: inherit;
    background: #123b45;
    box-shadow: none;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    transform: none;
    box-shadow: 0 0 0 4px rgba(82, 214, 162, 0.18);
}

.theme-toggle-track {
    position: relative;
    display: block;
    width: 54px;
    height: 26px;
}

.theme-toggle-sun,
.theme-toggle-moon {
    position: absolute;
    top: 50%;
    z-index: 1;
    color: #d8f1ea;
    font-size: 0.82rem;
    line-height: 1;
    transform: translateY(-50%);
}

img.theme-toggle-sun,
img.theme-toggle-moon {
    width: 15px;
    height: 15px;
    object-fit: contain;
}

.theme-toggle-sun {
    left: 5px;
}

.theme-toggle-moon {
    right: 6px;
    font-size: 1rem;
}

.theme-toggle-thumb {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f4f8f7;
    box-shadow: 0 2px 6px rgba(10, 40, 44, 0.24);
    transition: transform 0.2s ease;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(28px);
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #fafafa;
    --bg-soft: #d8edf0;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.94);
    --line: rgba(19, 83, 91, 0.18);
    --text: #12383d;
    --muted: #4d686c;
    --accent: #20a87d;
    --accent-strong: #087a58;
    --accent-warm: #9c6800;
    --chart-bar: #20a87d;
    --chart-bar-border: #087a58;
    --chart-text: #12383d;
    --chart-grid: rgba(19, 83, 91, 0.18);
    --shadow: 0 24px 52px rgba(31, 75, 86, 0.16);
}

html[data-theme="light"] body {
    background: radial-gradient(circle at 50% 85%, rgba(255, 190, 78, 0.14), transparent 20%), linear-gradient(180deg, #0e7e7e79 0%, #e6f4f5 48%, #b8dbe2 100%);
}

html[data-theme="light"] body::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0) 1px, transparent 1px), linear-gradient(90deg, rgba(20, 91, 102, 0.06) 1px, transparent 1px);
}

html[data-theme="light"] .navbar {
    background: rgba(44, 90, 88, 0.027);
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a:focus-visible {
    background: rgba(32, 168, 125, 0.13);
}

html[data-theme="light"] .panel {
    background: linear-gradient(180deg, rgba(252, 251, 251, 0.95), rgba(211, 236, 241, 0.92));
}

html[data-theme="light"] .panel::after {
    background: radial-gradient(circle, rgba(32, 168, 125, 0.08), transparent 70%);
}

html[data-theme="light"] .upload-card,
html[data-theme="light"] .results-card {
    border-color: rgba(23, 101, 106, 0);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.021), rgba(230, 245, 244, 0));
}

html[data-theme="light"] .selected-file-name {
    border-color: rgba(31, 105, 107, 0.28);
    background: rgba(255, 255, 255, 0.72);
}

html[data-theme="light"] .selected-image-card {
    border-color: rgba(27, 100, 110, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(222, 241, 244, 0.86));
}

html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"] {
    border-color: rgba(31, 105, 107, 0.2);
    background: rgba(175, 192, 199, 0.486);
}

html[data-theme="light"] input::placeholder {
    color: rgba(60, 97, 101, 0.72);
}

html[data-theme="light"] input:focus {
    border-color: rgba(21, 80, 148, 0.877);
    box-shadow: 0 0 0 4px rgba(18, 81, 168, 0.226);
    background: rgba(175, 192, 199, 0.486);
}

html[data-theme="light"] .archive-card {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(31, 105, 107, 0.14);
}

html[data-theme="light"] .status-pill {
    background: rgba(156, 104, 0, 0.12);
}

html[data-theme="light"] .file-picker-button,
html[data-theme="light"] button:not(.theme-toggle),
html[data-theme="light"] input[type="submit"] {
    background: linear-gradient(
        135deg,
        #0c4e7a,
        #107796ab
    );
    color: #f1f1f1;
    box-shadow: 0 12px 24px rgba(18, 115, 128, 0.247);
}


html[data-theme="light"] .file-picker-button:hover,
html[data-theme="light"] .file-picker-button:focus-visible,
html[data-theme="light"] button:not(.theme-toggle):hover,
html[data-theme="light"] button:not(.theme-toggle):focus-visible,
html[data-theme="light"] input[type="submit"]:hover,
html[data-theme="light"] input[type="submit"]:focus-visible {
    box-shadow: 0 16px 30px rgba(19, 123, 127, 0.507);
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(21, 99, 105, 0.24);
    background: #d6edf0;
    box-shadow: 0 12px 24px rgba(18, 93, 128, 0.397);
}

html[data-theme="light"] .theme-toggle-sun,
html[data-theme="light"] .theme-toggle-moon {
    color: #477175;
}

html[data-theme="light"] .theme-toggle-thumb {
    background: #ffffff;
}

@media (max-width: 760px) {
    .theme-toggle {
        width: 62px;
        align-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 760px) {
    .nav-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .nav-actions .theme-toggle {
        align-self: center;
    }

    .user-nav-link {
        margin-left: 0;
    }
}

#results-message {
    margin: 0;
    white-space: pre-line;
}

.results-workspace {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
}

.results-list-panel,
.wastes-list-panel,
.results-panel {
    min-width: 0;
}

.results-panel {
    width: 100%;
}

.results-panel .results-card {
    width: 100%;
    padding: 0;
}

.results-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.results-summary-header .eyebrow {
    margin: 0;
}

#download-upload-report-button,
#download-upload-report-csv-button,
.run-again-button,
#download-image-report-button,
#download-image-report-csv-button {
    width: 260px;
    min-height: 40px;
    height: 40px;
    padding: 8px 16px;
    white-space: nowrap;
}

.report-download-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

#download-upload-report-button[hidden],
#download-upload-report-csv-button[hidden] {
    display: none !important;
}

.run-again-button {
    width: 128px;
}

.result-detail-panel {
    min-width: 0;
    border: 1px solid rgba(159, 192, 184, 0.14);
    border-radius: var(--radius-lg);
    background: rgba(2, 12, 18, 0.42);
}

.results-list-panel,
.wastes-list-panel {
    width: min(100%, 280px);
    display: flex;
    flex-direction: column;
    align-self: start;
    padding: 32px 24px;
}

.wastes-list-panel {
    justify-self: end;
}

.wastes-list-panel[hidden] {
    display: none;
}

.results-sidebar-header,
.wastes-sidebar-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.results-sidebar-header h2 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
}

#results-count,
#wastes-count {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.result-image-list,
.waste-object-list {
    display: grid;
    flex: 1;
    align-content: start;
    gap: 8px;
    max-height: 620px;
    min-height: 0;
    margin: 0;
    padding: 0 4px 0 0;
    overflow-y: auto;
    list-style: none;
    scrollbar-color: rgba(82, 214, 162, 0.45) transparent;
    scrollbar-width: thin;
}

.wastes-message {
    margin: 0;
    font-size: 0.9rem;
}

.wastes-message[hidden] {
    display: none;
}

.waste-object-list-entry {
    min-width: 0;
}

button.waste-object-list-item,
button.waste-object-list-item:hover,
button.waste-object-list-item:focus-visible {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    display: grid;
    align-items: start;
    justify-content: stretch;
    gap: 5px;
    padding: 11px 12px;
    border: 1px solid rgba(159, 192, 184, 0.12);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
    overflow-wrap: anywhere;
    transform: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

button.waste-object-list-item:hover {
    border-color: rgba(82, 214, 162, 0.46);
    background: rgba(82, 214, 162, 0.09);
}

button.waste-object-list-item:focus-visible {
    outline: 3px solid rgba(82, 214, 162, 0.42);
    outline-offset: 2px;
}

button.waste-object-list-item.selected-waste {
    border-color: rgba(82, 214, 162, 0.72);
    background: rgba(82, 214, 162, 0.14);
    box-shadow: inset 3px 0 0 var(--accent);
}

.waste-object-name {
    min-width: 0;
    color: inherit;
}

.waste-object-code,
.waste-object-confidence {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}

.result-list-entry {
    min-width: 0;
}

button.result-list-item,
button.result-list-item:hover,
button.result-list-item:focus-visible {
    width: 100%;
    min-height: 54px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: center;
    justify-content: normal;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid rgba(159, 192, 184, 0.12);
    border-radius: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
    text-align: left;
    transform: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

button.result-list-item:not(:disabled):hover {
    border-color: rgba(82, 214, 162, 0.46);
    background: rgba(82, 214, 162, 0.09);
    box-shadow: none;
    transform: none;
}

button.result-list-item:focus-visible {
    outline: 3px solid rgba(82, 214, 162, 0.42);
    outline-offset: 2px;
}

button.result-list-item:disabled,
button.result-list-item:disabled:hover {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.018);
    box-shadow: none;
    cursor: default;
    opacity: 1;
    transform: none;
}

button.result-list-item.selected-result {
    border-color: rgba(82, 214, 162, 0.72);
    background: rgba(82, 214, 162, 0.14);
    box-shadow: inset 3px 0 0 var(--accent);
}

.result-list-name {
    min-width: 0;
    overflow: hidden;
    color: inherit;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-list-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-warm);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.result-list-status::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: currentColor;
}

.result-list-status[data-status="waiting"],
.result-list-status[data-status="unknown"] {
    color: var(--muted);
}

.result-list-status[data-status="completed"] {
    color: #52d6a2;
}

.result-list-status[data-status="failed"] {
    color: #ff7777;
}

.result-list-status[data-status="processing"]::before,
.result-list-status[data-status="processed"]::before,
.result-list-status[data-status="analyzing_results"]::before,
.result-list-status[data-status="analyzed_results"]::before,
.result-list-status[data-status="rendering_image"]::before {
    animation: result-status-pulse 1.35s ease-in-out infinite;
}

@keyframes result-status-pulse {
    0%,
    100% {
        opacity: 0.38;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.result-detail-panel {
    min-height: 480px;
    display: grid;
    overflow: hidden;
}

.result-detail-empty {
    width: 100%;
    place-self: stretch;
    padding: 28px;
    text-align: left;
}

.result-detail-empty p {
    margin-bottom: 0;
}

.upload-statistics {
    width: 100%;
    text-align: left;
}

.upload-statistics h2 {
    margin-bottom: 20px;
}

.upload-statistics h4 {
    margin: 26px 0 -8px;
}

.upload-statistics .material-chart-wrapper {
    max-width: none;
}

.upload-use-function-chart-wrapper {
    height: clamp(360px, 56vw, 520px);
}

.specific-types-table-wrapper {
    max-height: 520px;
    margin-top: 1rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-strong);
}

.specific-types-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    color: var(--text);
    font-size: 0.86rem;
    text-align: left;
}

.specific-types-table th,
.specific-types-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.specific-types-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: var(--text);
    background: var(--bg-soft);
    font-weight: 700;
}

.specific-types-table th:last-child,
.specific-types-table td:last-child {
    width: 76px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.specific-types-table tbody tr:last-child td {
    border-bottom: 0;
}

.specific-types-table tbody tr:hover {
    background: rgba(82, 214, 162, 0.08);
}

#upload-specific-types-message {
    margin: 0;
    padding: 22px;
    color: var(--muted);
    text-align: center;
}

.result-detail-content {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    padding: 18px;
}

.result-detail-content[hidden],
.result-detail-empty[hidden],
.result-image-wrapper[hidden],
.result-detail-image[hidden],
.result-detail-image-message[hidden] {
    display: none;
}

.result-detail-header {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.result-detail-header > div {
    min-width: 0;
}

.result-detail-position {
    margin: 0 0 5px;
    color: var(--accent-warm);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

#result-detail-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.25rem, 2.6vw, 1.85rem);
    overflow-wrap: anywhere;
}

.result-detail-header .status-pill {
    flex-shrink: 0;
    margin: 0;
}

.result-detail-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.run-again-button,
#download-image-report-button,
#download-image-report-csv-button {
    flex-shrink: 0;
}

#download-image-report-button[hidden],
#download-image-report-csv-button[hidden] {
    display: none !important;
}

.result-image-stage {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: min(600px, 65dvh);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(159, 192, 184, 0.1);
    border-radius: 16px;
    background: rgba(1, 8, 12, 0.68);
}

.result-image-wrapper {
    position: relative;
    display: inline-block;
    justify-self: center;
    align-self: center;
    max-width: 100%;
    max-height: min(600px, 65dvh);
    line-height: 0;
}

.result-detail-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(600px, 65dvh);
    display: block;
    object-fit: contain;
}

.waste-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.waste-overlay-shape {
    fill: var(--waste-color, #52d6a2);
    fill-opacity: 0;
    stroke: var(--waste-color, #52d6a2);
    stroke-width: 2;
    stroke-opacity: 0;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
    cursor: pointer;
    pointer-events: all;
    transition:
        fill-opacity 0.18s ease,
        stroke-opacity 0.18s ease;
}

.waste-overlay-shape:hover {
    fill-opacity: 0.2;
    stroke-opacity: 0.85;
}

.waste-overlay-shape:focus-visible {
    fill-opacity: 0.2;
    stroke: var(--accent-warm);
    stroke-opacity: 1;
    outline: none;
}

.waste-overlay-shape.selected-waste-shape {
    fill-opacity: 0.6;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-opacity: 1;
    filter: drop-shadow(
        0 0 8px var(--waste-color, #52d6a2)
    );
}

.result-detail-image-message {
    max-width: 320px;
    margin: 0;
    padding: 24px;
    text-align: center;
}

.status-pill[data-status="completed"] {
    color: #52d6a2;
    background: rgba(82, 214, 162, 0.16);
}

.status-pill[data-status="failed"] {
    color: #ff7777;
    background: rgba(255, 80, 80, 0.16);
}

.status-pill[data-status="rendering_image"] {
    color: var(--accent-warm);
    background: rgba(255, 209, 102, 0.16);
}

html[data-theme="light"] .result-detail-panel {
    border-color: rgba(31, 105, 107, 0.16);
    background: rgba(255, 255, 255, 0.46);
}

html[data-theme="light"] button.waste-object-list-item,
html[data-theme="light"] button.result-list-item,
html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover {
    border-color: rgba(31, 105, 107, 0.14);
    color: var(--text);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    transform: none;
}

html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] button.result-list-item:not(:disabled):hover,
html[data-theme="light"] button.result-list-item.selected-result,
html[data-theme="light"] button.waste-object-list-item:hover,
html[data-theme="light"] button.waste-object-list-item.selected-waste {
    border-color: rgba(32, 168, 125, 0.52);
    background: rgba(32, 168, 125, 0.12);
    box-shadow: none;
    transform: none;
}

html[data-theme="light"] .result-list-status[data-status="completed"] {
    color: #087a58;
}

html[data-theme="light"] .result-list-status[data-status="failed"] {
    color: #b33b3b;
}

html[data-theme="light"] .result-image-stage {
    border-color: rgba(31, 105, 107, 0.14);
    background: rgba(225, 240, 242, 0.72);
}

@media (min-width: 1749px) {
    .results-workspace {
        display: block;
        min-height: 480px;
    }

    .results-list-panel,
    .wastes-list-panel {
        position: absolute;
        top: 0;
        width: 280px;
    }

    .results-list-panel {
        right: calc(100% + 18px);
    }

    .wastes-list-panel {
        left: calc(100% + 18px);
    }
}

@media (max-width: 760px) {
    .results-list-panel,
    .wastes-list-panel,
    .results-panel {
        padding: 28px 22px;
    }

    .results-card {
        padding: 0;
    }

    .results-list-panel,
    .wastes-list-panel {
        width: 100%;
        justify-self: stretch;
        padding: 22px 14px;
    }

    .results-workspace {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "images wastes"
            "review review";
        align-items: start;
        min-height: 0;
    }

    .results-panel {
        grid-area: review;
    }

    .results-list-panel {
        grid-area: images;
    }

    .wastes-list-panel {
        grid-area: wastes;
    }

    .result-image-list,
    .waste-object-list {
        max-height: 220px;
    }

    .result-detail-panel {
        min-height: 400px;
    }

    .result-image-stage {
        min-height: 0;
    }
}

@media (max-width: 560px) {
    .result-detail-header {
        flex-direction: column;
        gap: 10px;
    }

    .result-detail-content {
        padding: 14px;
    }

    .result-image-stage {
        min-height: 0;
    }
}

.uploads-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.archive-upload-entry {
    min-width: 0;
}

button.archive-upload-item {
    width: 100%;
    display: grid;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid rgba(159, 192, 184, 0.16);
    border-radius: var(--radius-md);
    color: var(--text);
    text-align: left;
    background: rgba(2, 12, 18, 0.32);
    box-shadow: none;
}

button.archive-upload-item strong {
    font-size: 0.98rem;
}

button.archive-upload-item span {
    color: var(--muted);
    font-size: 0.86rem;
}

button.archive-upload-item:hover,
button.archive-upload-item:focus-visible {
    border-color: rgba(82, 214, 162, 0.52);
    background: rgba(82, 214, 162, 0.12);
    box-shadow: none;
    transform: translateY(-1px);
}

html[data-theme="light"] button.archive-upload-item {
    border-color: rgba(31, 105, 107, 0.14);
    background: rgba(255, 255, 255, 0.5);
    box-shadow: none;
    color:#06141b
}


.material-chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 680px;
    min-width: 0;
    height: clamp(220px, 42vw, 280px);
    min-height: 0;
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-strong);
    overflow: hidden;
}

.material-chart-wrapper canvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

.material-chart-wrapper canvas[hidden] {
    display: none !important;
}

.material-chart-wrapper p[hidden] {
    display: none !important;
}

.material-chart-wrapper canvas[hidden] + p:not([hidden]) {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
}

#profile-material-chart {
    width: 100% !important;
    height: 100% !important;
}

#profile-material-chart-message,
#upload-material-chart-message,
#upload-use-function-chart-message,
#image-use-function-chart-message {
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.result-detail-content > h4 {
    margin: 0 0 -8px;
}

.admin-users-list,
.admin-record-list {
    display: grid;
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.admin-user-card,
.admin-record-list li {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(2, 12, 18, 0.24);
}

.admin-user-card {
    padding: 20px;
}

.admin-user-card h3,
.admin-user-card p {
    margin-bottom: 6px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.admin-action {
    padding: 9px 14px;
    font-size: 0.88rem;
}

.admin-details {
    margin-top: 16px;
    color: var(--muted);
}

.admin-record-list {
    margin-top: 0;
}

.admin-record-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
}

html[data-theme="light"] .admin-user-card,
html[data-theme="light"] .admin-record-list li {
    background: rgba(255, 255, 255, 0.45);
}

.admin-view {
    display: none;
}

.admin-view.active-admin-view {
    display: block;
}

.admin-sessions-list {
    display: grid;
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}
/* In-app feedback */
.toast-region {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: grid;
    width: min(390px, calc(100vw - 32px));
    gap: 12px;
    pointer-events: none;
}

.app-toast {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(164, 220, 205, 0.22);
    border-radius: 18px;
    color: var(--text);
    background: rgba(7, 22, 28, 0.92);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(18px);
    opacity: 0;
    pointer-events: auto;
    transform: translateY(-12px) scale(0.98);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.app-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast-icon,
.app-dialog-icon {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #062019;
    background: var(--accent);
    font-size: 0.95rem;
    font-weight: 900;
    line-height: 1;
}

.app-toast-copy {
    min-width: 0;
    padding-top: 1px;
}

.app-toast-copy strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.94rem;
}

.app-toast-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.app-toast-close {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
}

.app-toast-close:hover,
.app-toast-close:focus-visible {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    transform: none;
}

.app-toast--warning {
    border-color: rgba(255, 209, 102, 0.42);
}

.app-toast--warning .app-toast-icon,
.app-dialog--warning .app-dialog-icon {
    color: #4a3000;
    background: var(--accent-warm);
}

.app-toast--danger {
    border-color: rgba(255, 125, 125, 0.48);
}

.app-toast--danger .app-toast-icon,
.app-dialog--danger .app-dialog-icon {
    color: #fff;
    background: #d85d67;
}

.dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 12, 18, 0.64);
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.dialog-layer[hidden] {
    display: none;
}

.dialog-layer.is-open {
    opacity: 1;
}

body.dialog-open {
    overflow: hidden;
}

.app-dialog {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 18px;
    width: min(100%, 540px);
    padding: 26px;
    border: 1px solid rgba(164, 220, 205, 0.26);
    border-radius: 24px;
    color: var(--text);
    background: linear-gradient(160deg, rgba(16, 48, 59, 0.98), rgba(7, 22, 28, 0.98));
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
    transform: translateY(10px) scale(0.98);
    transition: transform 0.18s ease;
}

.dialog-layer.is-open .app-dialog {
    transform: translateY(0) scale(1);
}

.app-dialog-icon {
    width: 42px;
    height: 42px;
    font-size: 1.1rem;
}

.app-dialog-copy h2 {
    margin: 0 0 8px;
    font-size: clamp(1.45rem, 3vw, 1.85rem);
    line-height: 1.1;
}

.dialog-eyebrow {
    margin: 0 0 7px;
    color: var(--accent-warm);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1.2;
    text-transform: uppercase;
}

#dialog-message {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    white-space: pre-line;
}

.dialog-input-field {
    margin-top: 16px;
}

.dialog-input-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-weight: 700;
}

.dialog-input-field input {
    width: 100%;
}

.dialog-input-error {
    margin: 7px 0 0;
    color: #d85d67;
    font-size: 0.9rem;
}

.app-dialog-actions {
    display: flex;
    grid-column: 2;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.app-dialog-actions button[hidden] {
    display: none;
}

.dialog-button {
    min-height: 44px;
    padding: 11px 18px;
}



.app-dialog--danger #dialog-confirm {
    color: #fff;
    background: linear-gradient(135deg, #b4233c, #d30e0e);
    box-shadow: 0 12px 26px rgba(109, 16, 35, 0.38);
}

.app-dialog--danger #dialog-confirm:hover,
.app-dialog--danger #dialog-confirm:focus-visible {
    box-shadow: 0 16px 30px rgba(109, 16, 35, 0.56);
}

.app-dialog--danger {
    border-color: rgba(204, 25, 25, 0.72);
}

html[data-theme="dark"] .app-dialog--danger {
    border-color: transparent;
}

.app-dialog--danger .app-dialog-icon {
    background: #c51111;
}

html[data-theme="light"] .app-toast {
    border-color: rgba(31, 105, 107, 0.2);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 46px rgba(31, 75, 86, 0.2);
}

html[data-theme="light"] .app-toast-close:hover,
html[data-theme="light"] .app-toast-close:focus-visible {
    background: rgba(19, 83, 91, 0.1);
}

html[data-theme="light"] .app-dialog {
    border-color: rgba(31, 105, 107, 0.22);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.99), rgba(225, 242, 244, 0.98));
    box-shadow: 0 30px 80px rgba(31, 75, 86, 0.28);
}

html[data-theme="light"] .dialog-layer {
    background: rgba(17, 59, 68, 0.3);
}



@media (max-width: 760px) {
    .toast-region {
        top: 16px;
        right: 16px;
    }

    .app-dialog {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 22px;
    }

    .app-dialog-icon {
        width: 38px;
        height: 38px;
    }

    .app-dialog-actions {
        grid-column: 1;
        flex-direction: column-reverse;
        margin-top: 6px;
    }

    .dialog-button {
        width: 100%;
    }
}
html[data-theme="light"] button.app-toast-close {
    color: var(--muted);
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] button.app-toast-close:hover,
html[data-theme="light"] button.app-toast-close:focus-visible {
    color: var(--text);
    background: rgba(19, 83, 91, 0.1);
    box-shadow: none;
}

/* Front-page visual refresh - preserves the existing application markup and flows. */
:root {
    --lask-navy: #073c50;
    --lask-blue: #126ba5;
    --lask-aqua: #47c5ca;
    --lask-mist: #edf7f7;
    --lask-ink: #082c49;
}

body {
    font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 76% 9%, rgba(51, 137, 182, 0.22), transparent 25%),
        linear-gradient(165deg, #061822 0%, #093c52 46%, #092735 100%);
}

.navbar {
    width: 100%;
    min-height: 82px;
    margin: 0;
    padding: 18px clamp(24px, 5vw, 80px);
    border: 0;
    border-radius: 0;
    background: rgba(5, 30, 42, 0.91);
    box-shadow: 0 8px 24px rgba(0, 20, 31, 0.18);
    backdrop-filter: blur(14px);
}

.logo {
    max-width: 360px;
    color: #f7fcff;
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

.nav-links {
    gap: 4px;
}

.nav-links a {
    color: rgba(240, 250, 252, 0.84);
    font-size: 1.02rem;
    font-weight: 700;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: #fff;
    background: rgba(72, 197, 202, 0.18);
}

.user-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 7px;
    color: #fff;
    background: #08718a;
    box-shadow: 0 6px 16px rgba(0, 27, 38, 0.2);
    font-size: 1.02rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.user-nav-link:hover,
.user-nav-link:focus-visible {
    color: #fff;
    background: #0b8da8;
    box-shadow: 0 9px 20px rgba(0, 27, 38, 0.28);
    transform: translateY(-1px);
}

html[data-theme="dark"] .user-nav-link {
    color: #062019;
    background: linear-gradient(135deg, #ffd166, #52d6a2);
    box-shadow: 0 14px 30px rgba(29, 182, 122, 0.22);
}

html[data-theme="dark"] .user-nav-link:hover,
html[data-theme="dark"] .user-nav-link:focus-visible {
    color: #062019;
    background: linear-gradient(135deg, #ffd166, #52d6a2);
    box-shadow: 0 16px 32px rgba(29, 182, 122, 0.3);
}

.page {
    width: min(calc(100% - 48px), 1280px);
    margin: 32px auto 56px;
}

.home_page.active {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 82px);
    margin: 0;
    padding: clamp(52px, 9vw, 130px) clamp(24px, 8vw, 140px) 0;
    isolation: isolate;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(1, 17, 24, 0.82) 0%, rgba(4, 35, 49, 0.67) 44%, rgba(9, 84, 128, 0.29) 100%),
        radial-gradient(ellipse at 85% 7%, #88cff2 0%, #4388ba 30%, transparent 56%),
        linear-gradient(150deg, #213e46 0%, #0c435f 44%, #4f97c2 100%);
}

.home_page .upload-panel {
    width: 100%;
    min-height: 410px;
    padding: 0;
    overflow: visible;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.home-upload-layout {
    display: grid;
    grid-template-columns: minmax(310px, 0.85fr) minmax(0, 1.35fr);
    gap: clamp(36px, 6vw, 108px);
    align-items: start;
}

.home-upload-intro,
.home-upload-selection {
    min-width: 0;
}

.home-upload-selection {
    padding-top: clamp(12px, 3vw, 48px);
    max-height: clamp(750px, calc(100vh - 80px), 920px);
    overflow-y: auto;
    padding-right: 10px;
    scroll-behavior: smooth;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-color: rgba(114, 219, 215, 0.68) transparent;
    scrollbar-width: thin;
}

.home-upload-selection::-webkit-scrollbar {
    width: 8px;
}

.home-upload-selection::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(114, 219, 215, 0.68);
}

.home-upload-selection::-webkit-scrollbar-track {
    background: transparent;
}

.home_page .upload-panel::after {
    display: none;
}

.home_page .eyebrow {
    margin-bottom: 18px;
    color: #79e2df;
    font-size: 0.78rem;
}

.home_page .home-title {
    display: block;
    max-width: 12ch;
    margin: 0 0 22px;
    color: #fff;
    font-size: clamp(2.45rem, 5.4vw, 4.8rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.98;
    text-shadow: 0 3px 18px rgba(0, 17, 27, 0.35);
}

.home_page .upload-card {
    width: min(100%, 570px);
    min-height: 0;
    padding: 22px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.home_page .selected-images-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.home_page .selected-image-card {
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    content-visibility: auto;
    contain-intrinsic-size: auto 260px;
}

.home_page .selected-image-thumbnail {
    height: 130px;
    max-width: none;
    border-radius: 9px;
    object-fit: cover;
}

.home_page .selected-image-name {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.9rem;
    line-height: 1.35;
}

.home_page .selected-image-details {
    gap: 8px;
}

.home_page .selected-image-actions {
    gap: 6px;
    flex-wrap: wrap;
}

@media (max-width: 1100px) {
    .home-upload-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .home-upload-selection {
        padding-top: 0;
    }
}

@media (max-width: 760px) {
    .home_page .selected-images-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home_page .selected-image-thumbnail {
        height: 112px;
    }
}

.home_page .home-description {
    display: block;
    max-width: 53ch;
    margin: 0 0 25px;
    color: rgba(255, 255, 255, 0.94);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    font-weight: 500;
    line-height: 1.62;
    text-shadow: 0 2px 12px rgba(0, 17, 27, 0.42);
}

.home-workflow {
    width: min(92vw, 1560px);
    margin: clamp(32px, 5vw, 64px) auto clamp(28px, 4vw, 52px);
    color: #f6fcff;
}

.home-workflow-title {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25em;
    margin: 0 0 clamp(22px, 3vw, 38px);
    color: inherit;
    font-size: clamp(1.5rem, 2.2vw, 2.35rem);
    line-height: 1;
}

.home-workflow-brand {
    display: block;
    width: clamp(136px, 13vw, 198px);
    height: clamp(42px, 3.9vw, 58px);
    margin-inline: 0.18em;
}

.home-workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-workflow-steps li {
    position: relative;
    display: grid;
    grid-template-columns: clamp(66px, 5.4vw, 102px) minmax(0, 1fr);
    gap: clamp(10px, 1.2vw, 18px);
    align-items: center;
    min-width: 0;
}

.home-workflow-arrow {
    position: absolute;
    top: 36%;
    left: calc(50% + 34px);
    width: clamp(72px, 8vw, 140px);
    pointer-events: none;
    transform: translateY(-50%);
}

.home-workflow-arrow > img {
    width: 100%;
    height: auto !important;
}

.home-workflow-icon {
    display: block;
    width: 100%;
    aspect-ratio: 1;
}

.home-workflow-copy { min-width: 0; }

.home-workflow-copy > span {
    display: block;
    margin-bottom: 3px;
    color: #f6fcff;
    font-size: clamp(1.1rem, 1.8vw, 1.6rem);
    font-weight: 800;
    line-height: 1;
}

.home-workflow-copy h3 {
    margin: 0 0 6px;
    color: inherit;
    font-size: clamp(0.94rem, 1.3vw, 1.18rem);
    line-height: 1.1;
}

.home-workflow-copy p {
    margin: 0;
    color: rgba(240, 250, 252, 0.82);
    font-size: clamp(0.7rem, 0.9vw, 0.84rem);
    line-height: 1.4;
}

html[data-theme="light"] .home-workflow { color: #082c49; }
html[data-theme="light"] .home-workflow-copy > span { color: #082c49; }
html[data-theme="light"] .home-workflow-copy p { color: #496877; }

/* Contact page */
.contact_page.active {
    width: min(calc(100% - 48px), 1280px);
    min-height: 0;
    margin: 32px auto 56px;
    padding: 0;
}

.contact-panel {
    width: 100%;
    max-width: none;
    padding: 0;
}

.contact-layout {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
    overflow: hidden;
    color: var(--text);
    background: transparent;
}

.contact-partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: clamp(42px, 5vw, 74px) clamp(28px, 5vw, 70px);
    text-align: center;
}

.contact-partner-card + .contact-partner-card {
    border-left: 1px solid rgba(159, 192, 184, 0.24);
}

.contact-logo {
    display: block;
    width: min(100%, 390px);
    height: 125px;
}

.contact-logo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.contact-scidrones-logo { width: min(100%, 330px); }

.contact-intro {
    max-width: 36ch;
    margin: 22px 0 34px;
    color: rgba(243, 250, 253, 0.9);
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.48;
}

.contact-details {
    display: grid;
    width: min(100%, 430px);
    gap: 20px;
    margin: 0;
    text-align: left;
    font-style: normal;
}

/* Match each detail list to its logo so its icons share the same left edge. */
.contact-scidrones .contact-details { width: min(100%, 330px); }
.contact-foundation .contact-details { width: min(100%, 390px); }

.contact-details p {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    margin: 0;
}

.contact-details p > span {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
}

.contact-detail-icon > img {
    width: 28px !important;
    height: 28px !important;
    object-fit: contain;
}

.contact-details a {
    color: rgba(243, 250, 253, 0.84);
    font-size: 0.94rem;
    line-height: 1.45;
    text-decoration: none;
}

.contact-details a:hover,
.contact-details a:focus-visible { color: #aeeeff; text-decoration: underline; }

html[data-theme="dark"] .contact-details a:hover,
html[data-theme="dark"] .contact-details a:focus-visible {
    color: #ffd166;
}

.contact-social-links {
    display: flex;
    width: min(100%, 430px);
    gap: 16px;
    margin-top: 30px;
}

/* Align each social row with the left edge of its company logo. */
.contact-scidrones .contact-social-links { width: min(100%, 330px); }
.contact-foundation .contact-social-links { width: min(100%, 390px); }

.contact-social-links a {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    text-decoration: none;
}

.contact-social-links a:hover,
.contact-social-links a:focus-visible {
    background: rgba(174, 238, 255, 0.12);
    transform: none;
}

.contact-social-icon {
    display: block;
    width: 28px;
    height: 28px;
}

.contact-social-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }

.contact-callout {
    width: min(100%, 510px);
    margin-top: auto;
    padding: 24px 28px;
    border: 1px solid rgba(188, 231, 242, 0.2);
    border-radius: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.07);
}

.contact-callout h2 { margin: 0; color: inherit; font-size: clamp(1.1rem, 1.6vw, 1.45rem); }
.contact-callout p { margin: 10px 0 18px; color: rgba(243, 250, 253, 0.86); line-height: 1.45; }

.contact-callout a {
    display: inline-flex;
    gap: 18px;
    align-items: center;
    min-height: 44px;
    padding: 9px 17px;
    border-radius: 6px;
    color: #093656;
    background: #fff;
    font-weight: 800;
    text-decoration: none;
}

.contact-callout a:hover,
.contact-callout a:focus-visible { color: #052944; background: #c9f0f1; transform: none; }

html[data-theme="light"] .contact-layout {
    color: #082c49;
}

html[data-theme="light"] .contact-logo {
    background: #082c49;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
}

html[data-theme="light"] .contact-logo img { display: none; }
html[data-theme="light"] .contact-scidrones-logo { -webkit-mask-image: url("assets/Scidrones.png"); mask-image: url("assets/Scidrones.png"); }
html[data-theme="light"] .contact-foundation-logo { -webkit-mask-image: url("assets/Laskaridis.png"); mask-image: url("assets/Laskaridis.png"); }
html[data-theme="light"] .contact-intro,
html[data-theme="light"] .contact-details a,
html[data-theme="light"] .contact-callout p { color: #496877; }
html[data-theme="light"] .contact-details a:hover,
html[data-theme="light"] .contact-details a:focus-visible { color: #0074b5; }
html[data-theme="light"] .contact-social-links a:hover,
html[data-theme="light"] .contact-social-links a:focus-visible { background: rgba(8, 44, 73, 0.1); }
html[data-theme="light"] .contact-social-icon { background: #082c49; }
html[data-theme="light"] .contact-social-icon img { display: none; }
html[data-theme="light"] .social-facebook { -webkit-mask: url("assets/facebook-dark.png") center / contain no-repeat; mask: url("assets/facebook-dark.png") center / contain no-repeat; }
html[data-theme="light"] .social-instagram { -webkit-mask: url("assets/instagram-dark.png") center / contain no-repeat; mask: url("assets/instagram-dark.png") center / contain no-repeat; }
html[data-theme="light"] .social-linkedin { -webkit-mask: url("assets/linkedin-dark.png") center / contain no-repeat; mask: url("assets/linkedin-dark.png") center / contain no-repeat; }
html[data-theme="light"] .social-youtube { -webkit-mask: url("assets/youtube-dark.png") center / contain no-repeat; mask: url("assets/youtube-dark.png") center / contain no-repeat; }
html[data-theme="light"] .contact-callout { border-color: rgba(8, 65, 82, 0.16); background: rgba(255, 255, 255, 0.68); }
html[data-theme="light"] .contact-callout a { color: #fff; background: #0074b5; }

html[data-theme="light"] .contact-detail-icon .theme-image-light { display: none !important; }
html[data-theme="light"] .contact-detail-icon .theme-image-dark { display: block !important; }
html[data-theme="light"] .contact-detail-icon > img {
    filter: brightness(0) saturate(100%) invert(13%) sepia(43%) saturate(1166%) hue-rotate(163deg) brightness(94%) contrast(100%);
}

@media (max-width: 860px) {
    .contact_page.active,
    .contact-layout { min-height: 0; }
    .contact-layout { grid-template-columns: 1fr; }
    .contact-partner-card { min-height: 640px; }
    .contact-partner-card + .contact-partner-card {
        border-top: 1px solid rgba(159, 192, 184, 0.24);
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .contact-partner-card { min-height: 0; padding: 48px 24px; }
    .contact-logo { height: 88px; }
    .contact-details { gap: 16px; }
    .contact-callout { margin-top: 38px; }
}

@media (max-width: 1080px) {
    .home-workflow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
    .home-workflow-arrow { display: none; }
}

@media (max-width: 600px) {
    .home-workflow-title { justify-content: flex-start; }
    .home-workflow-steps { grid-template-columns: 1fr; }
}

.file-picker-button,
button,
input[type="submit"] {
    min-height: 48px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 13px 22px;
    color: #fff;
    background: linear-gradient(135deg, #32b7c0, #08718a);
    box-shadow: 0 10px 24px rgba(1, 43, 59, 0.26);
}

.file-picker-button:hover,
.file-picker-button:focus-visible,
button:hover,
button:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
    box-shadow: 0 14px 30px rgba(1, 43, 59, 0.38);
}

.home_page .file-picker-button {
    min-width: 190px;
    padding: 16px 24px;
    font-size: 1rem;
}

.panel {
    border: 1px solid rgba(134, 213, 223, 0.16);
    background: linear-gradient(145deg, rgba(13, 56, 72, 0.97), rgba(8, 37, 54, 0.96));
    box-shadow: 0 24px 52px rgba(0, 16, 27, 0.28);
}

.upload-panel,
.about-panel,
.admin-panel,
.archive-panel,
.form-panel,
.results-list-panel,
.wastes-list-panel,
.results-panel {
    padding: clamp(26px, 4vw, 46px);
}

.eyebrow {
    color: #72dbd7;
}

.result-detail-panel,
.selected-image-card,
.archive-card,
.material-chart-wrapper,
.admin-user-card,
.admin-record-list li {
    border-color: rgba(130, 212, 220, 0.17);
    background: rgba(2, 26, 37, 0.48);
}

.theme-toggle {
    border-color: rgba(114, 219, 215, 0.38);
    background: #0b5365;
}

html[data-theme="light"] {
    --bg: #f7fbfb;
    --bg-soft: #e7f3f4;
    --panel: rgba(255, 255, 255, 0.95);
    --panel-strong: #ffffff;
    --line: rgba(8, 65, 82, 0.16);
    --text: #082c49;
    --muted: #496877;
    --accent: #27b8bd;
    --accent-strong: #08718a;
    --accent-warm: #08718a;
    --chart-bar: #1687b7;
    --chart-bar-border: #08718a;
    --chart-text: #082c49;
    --chart-grid: rgba(8, 65, 82, 0.14);
    --shadow: 0 18px 42px rgba(14, 71, 86, 0.14);
}

html[data-theme="light"] body {
    background: linear-gradient(180deg, #eff7f8 0%, #d7eaed 100%);
}

html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 0 rgba(8, 65, 82, 0.1), 0 8px 24px rgba(14, 71, 86, 0.08);
}

html[data-theme="light"] .logo,
html[data-theme="light"] .nav-links a {
    color: #082c49;
}

html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a:focus-visible {
    color: #08718a;
    background: rgba(39, 184, 189, 0.12);
}

html[data-theme="light"] .user-nav-link {
    color: #fff;
    background: #0074b5;
    box-shadow: 0 6px 16px rgba(0, 79, 124, 0.18);
}

html[data-theme="light"] .user-nav-link:hover,
html[data-theme="light"] .user-nav-link:focus-visible {
    color: #fff;
    background: #008fd0;
}

html[data-theme="light"] .home_page.active {
    background:
        radial-gradient(circle at 82% 12%, rgba(67, 184, 192, 0.14), transparent 25%),
        radial-gradient(circle at 7% 88%, rgba(74, 153, 191, 0.1), transparent 28%),
        linear-gradient(145deg, #ffffff 0%, #f5fbfb 48%, #e4f1f3 100%);
}

html[data-theme="dark"] .home_page.active {
    background: transparent;
}

.navbar-brand {
    width: clamp(132px, 15vw, 205px);
    height: 48px;
    flex: 0 0 auto;
}

.navbar .logo {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: 0;
    background: transparent;
    object-fit: contain;
}

.navbar .logo-light {
    display: none;
}

html[data-theme="light"] .navbar .logo-dark {
    display: none;
}

html[data-theme="light"] .navbar .logo-light {
    display: block;
}

html[data-theme="light"] .home_page .upload-panel {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] .home_page .home-title {
    color: #082c49;
    text-shadow: none;
}

html[data-theme="light"] .home_page .home-description {
    color: #496877;
    text-shadow: none;
}

html[data-theme="light"] .panel {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(232, 245, 246, 0.95));
    box-shadow: 0 18px 42px rgba(14, 71, 86, 0.14);
}

html[data-theme="light"] .result-detail-panel,
html[data-theme="light"] .selected-image-card,
html[data-theme="light"] .archive-card,
html[data-theme="light"] .material-chart-wrapper,
html[data-theme="light"] .admin-user-card,
html[data-theme="light"] .admin-record-list li {
    border-color: rgba(8, 65, 82, 0.12);
    background: rgba(255, 255, 255, 0.73);
}

html[data-theme="light"] .file-picker-button,
html[data-theme="light"] button:not(.theme-toggle),
html[data-theme="light"] input[type="submit"] {
    color: #fff;
    background: linear-gradient(135deg, #1198aa, #075169);
    box-shadow: 0 10px 24px rgba(8, 79, 105, 0.2);
}

html[data-theme="light"] .theme-toggle {
    border-color: rgba(8, 65, 82, 0.18);
    background: #d9eef0;
    box-shadow: none;
}

@media (max-width: 760px) {
    .navbar {
        min-height: 0;
        padding: 18px 24px;
    }

    .home_page.active {
        min-height: calc(100vh - 184px);
        padding: 58px 26px 0;
    }

    .home_page .home-title {
        font-size: clamp(2.35rem, 12vw, 3.4rem);
    }

    .home_page .upload-panel {
        width: 100%;
    }

    .home_page .home-description {
        font-size: 1rem;
    }
}

/* Keep the application's original button colours in both themes. */
.file-picker-button,
button:not(.theme-toggle),
input[type="submit"] {
    color: #062019;
    background: linear-gradient(135deg, #ffd166, #52d6a2);
    box-shadow: 0 14px 30px rgba(29, 182, 122, 0.22);
}

html[data-theme="light"] .file-picker-button,
html[data-theme="light"] button:not(.theme-toggle),
html[data-theme="light"] input[type="submit"] {
    color: #f1f1f1;
    background: linear-gradient(135deg, #0c4e7a, #107796ab);
    box-shadow: 0 12px 24px rgba(18, 115, 128, 0.247);
}

/* List entries remain part of their panel rather than using primary-action colours. */
button.archive-upload-item,
button.result-list-item,
button.waste-object-list-item {
    color: var(--text);
    background: transparent;
    box-shadow: none;
}

button.archive-upload-item:hover,
button.archive-upload-item:focus-visible,
button.result-list-item:not(:disabled):hover,
button.waste-object-list-item:hover {
    background: rgba(82, 214, 162, 0.09);
    box-shadow: none;
}

button.result-list-item.selected-result,
button.waste-object-list-item.selected-waste {
    background: rgba(82, 214, 162, 0.14);
    box-shadow: inset 3px 0 0 var(--accent);
}

button.result-list-item:disabled,
button.result-list-item:disabled:hover {
    color: var(--muted);
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] button.archive-upload-item,
html[data-theme="light"] button.result-list-item,
html[data-theme="light"] button.waste-object-list-item,
html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover {
    color: var(--text);
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] button.archive-upload-item:hover,
html[data-theme="light"] button.archive-upload-item:focus-visible,
html[data-theme="light"] button.result-list-item:not(:disabled):hover,
html[data-theme="light"] button.waste-object-list-item:hover,
html[data-theme="light"] button.result-list-item.selected-result,
html[data-theme="light"] button.waste-object-list-item.selected-waste {
    color: var(--text);
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover {
    color: var(--muted);
}

/* Give the existing theme toggle a roomier, more balanced track. */
.theme-toggle {
    width: 76px;
    height: 38px;
    min-height: 38px;
    padding: 3px;
}

.theme-toggle-track {
    width: 68px;
    height: 30px;
}

.theme-toggle-sun {
    left: 7px;
}

.theme-toggle-moon {
    right: 8px;
}

.theme-toggle-thumb {
    width: 30px;
    height: 30px;
}

html[data-theme="dark"] .theme-toggle-thumb {
    transform: translateX(38px);
}

/* Restore the original amber eyebrow colour in each theme. */
.eyebrow,
.home_page .eyebrow {
    color: #ffd166;
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .home_page .eyebrow {
    color: #9c6800;
}

/* Shared developer and funder panel. Replace each slot's content with the final logo/details. */
.site-footer {
    position: relative;
    z-index: 1;
    margin-top: 56px;
    color: #f6fcfd;
    background: linear-gradient(115deg, #042b3b 0%, #063d50 54%, #042937 100%);
}

body {
    display: flex;
    flex-direction: column;
}

html[data-theme="dark"] .site-footer {
    background: rgba(5, 30, 42, 0.91);
}

.navbar,
.site-footer {
    flex: 0 0 auto;
}

.page.active {
    flex: 1 0 auto;
}

/* Let the home page fill remaining viewport space so the footer stays at the bottom. */
.home_page.active {
    min-height: 0;
    flex: 1 0 auto;
}

body:has(.home_page.active) .site-footer {
    margin-top: 0;
}

/* Keep Contact consistent with the other flexible page layouts. */
body:has(.contact_page.active) .site-footer {
    margin-top: 0;
}

.site-footer-content {
    width: min(calc(100% - 48px), 1280px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-credit {
    position: absolute;
    bottom: 14px;
    right: clamp(24px, 5vw, 68px);
    margin: 0;
    color: rgba(246, 252, 253, 0.68);
    font-size: 1rem;
    line-height: 1.2;
    text-align: right;
}

.footer-credit-link {
    color: inherit;
    text-decoration: none;
}

.footer-credit-link:hover,
.footer-credit-link:focus-visible {
    color: #ffd166;
    text-decoration: underline;
    text-decoration-color: currentColor;
    text-underline-offset: 0.16em;
}

.footer-partner {
    min-width: 0;
    padding: 44px clamp(24px, 5vw, 68px) 48px;
}

.footer-sponsor {
    border-left: 0;
}

.footer-partner-label {
    margin: 0 0 20px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.2;
}

.footer-logo-slot {
    height: 82px;
    display: grid;
    align-items: center;
    justify-items: start;
    padding: 0;
    color: #496877;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.footer-logo-slot span {
    max-width: 22ch;
}

.site-footer a {
    color: #ffd166;
    text-decoration-color: rgba(255, 209, 102, 0.62);
    text-underline-offset: 0.16em;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #ffe29a;
    text-decoration-color: currentColor;
}

html[data-theme="light"] .site-footer a {
    color: #ffd166;
    text-decoration-color: rgba(255, 209, 102, 0.62);
}

html[data-theme="light"] .site-footer a:hover,
html[data-theme="light"] .site-footer a:focus-visible {
    color: #ffe29a;
}

@media (max-width: 760px) {
    .site-footer {
        margin-top: 36px;
    }

    .site-footer-content {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .footer-partner {
        padding: 32px 26px;
    }

    .footer-sponsor {
        border-left: 0;
    }
}

.footer-logo-slot img {
    display: block;
    width: auto;
    height: 68%;
    max-width: 68%;
    max-height: 68%;
    object-fit: contain;
}

/* Light-mode palette based on the supplied white and ocean-blue reference. */
html[data-theme="light"] {
    --bg: #f7fbfe;
    --bg-soft: #e8f4fa;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --line: rgba(9, 83, 130, 0.16);
    --text: #062b50;
    --muted: #4d6988;
    --accent: #008fd0;
    --accent-strong: #00649f;
    --accent-warm: #0074b5;
    --chart-bar: #008fd0;
    --chart-bar-border: #00649f;
    --chart-text: #062b50;
    --chart-grid: rgba(9, 83, 130, 0.14);
    --shadow: 0 18px 42px rgba(28, 87, 125, 0.13);
}

html[data-theme="light"] body {
    background:
        radial-gradient(ellipse 68% 58% at 48% 7%, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.58) 48%, transparent 78%),
        radial-gradient(circle at 14% 88%, rgba(48, 167, 211, 0.1), transparent 27%),
        linear-gradient(145deg, #fafdff 0%, #f3f9fd 53%, #ddecf6 100%);
}

html[data-theme="light"] body::before {
    background-image: none;
}

html[data-theme="light"] .home_page.active {
    background: transparent;
}

html[data-theme="light"] .panel {
    border-color: rgba(9, 83, 130, 0.13);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 253, 0.9));
    box-shadow: 0 18px 42px rgba(28, 87, 125, 0.13);
}

html[data-theme="light"] .result-detail-panel,
html[data-theme="light"] .selected-image-card,
html[data-theme="light"] .archive-card,
html[data-theme="light"] .material-chart-wrapper,
html[data-theme="light"] .admin-user-card,
html[data-theme="light"] .admin-record-list li {
    border-color: rgba(9, 83, 130, 0.12);
    background: rgba(255, 255, 255, 0.76);
}

html[data-theme="light"] input[type="email"],
html[data-theme="light"] input[type="password"],
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"] {
    border-color: rgba(9, 83, 130, 0.18);
    background: rgba(255, 255, 255, 0.9);
}

html[data-theme="light"] input:focus {
    border-color: rgba(0, 143, 208, 0.72);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 143, 208, 0.13);
}

html[data-theme="light"] .file-picker-button,
html[data-theme="light"] button:not(.theme-toggle),
html[data-theme="light"] input[type="submit"] {
    color: #fff;
    background: linear-gradient(135deg, #00629b, #008fd0);
    box-shadow: 0 12px 24px rgba(0, 99, 157, 0.22);
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .home_page .eyebrow {
    color: #0074b5;
}

html[data-theme="light"] .site-footer a {
    color: #008fd0;
    text-decoration-color: rgba(0, 143, 208, 0.62);
}

html[data-theme="light"] .site-footer a:hover,
html[data-theme="light"] .site-footer a:focus-visible {
    color: #57c9ef;
}

/* Keep non-primary list controls transparent in light mode. */
html[data-theme="light"] button.archive-upload-item,
html[data-theme="light"] button.archive-upload-item:hover,
html[data-theme="light"] button.archive-upload-item:focus-visible,
html[data-theme="light"] button.result-list-item,
html[data-theme="light"] button.result-list-item:not(:disabled):hover,
html[data-theme="light"] button.result-list-item.selected-result,
html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover,
html[data-theme="light"] button.waste-object-list-item,
html[data-theme="light"] button.waste-object-list-item:hover,
html[data-theme="light"] button.waste-object-list-item.selected-waste {
    background: transparent;
    box-shadow: none;
}

html[data-theme="light"] button.archive-upload-item,
html[data-theme="light"] button.archive-upload-item:hover,
html[data-theme="light"] button.archive-upload-item:focus-visible,
html[data-theme="light"] button.result-list-item,
html[data-theme="light"] button.result-list-item:not(:disabled):hover,
html[data-theme="light"] button.result-list-item.selected-result,
html[data-theme="light"] button.waste-object-list-item,
html[data-theme="light"] button.waste-object-list-item:hover,
html[data-theme="light"] button.waste-object-list-item.selected-waste {
    color: var(--text) !important;
}

html[data-theme="light"] button.result-list-item:disabled,
html[data-theme="light"] button.result-list-item:disabled:hover {
    color: var(--muted) !important;
}

/* How It Works page */
.how-it-works-page.active {
    width: min(calc(100% - 48px), 1440px);
    margin: 0 auto;
    padding: clamp(30px, 4vw, 60px) 0 clamp(28px, 3vw, 48px);
}

body:has(.how-it-works-page.active) .site-footer {
    margin-top: 24px;
}

.how-it-works-header {
    max-width: 760px;
    margin-bottom: clamp(36px, 5vw, 72px);
}

.how-it-works-header h1 {
    display: flex;
    align-items: center;
    gap: 0.18em;
    margin: 0 0 12px;
    color: #f7fcff;
    font-size: clamp(2.35rem, 5vw, 4.5rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.how-it-works-brand {
    display: block;
    width: 4.9em;
    height: 1.5em;
    flex: 0 0 auto;
    margin-inline: 0.14em;
}

.how-it-works-header p {
    max-width: 62ch;
    margin: 0;
    color: rgba(240, 250, 252, 0.84);
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    line-height: 1.55;
}

.how-it-works-process {
    width: min(100%, 1360px);
    margin: 0 auto;
}

.how-it-works-process img {
    display: block;
    width: 100%;
    height: auto;
}


.how-it-works-process-light {
    display: none !important;
}

html[data-theme="light"] .how-it-works-process-dark {
    display: none;
}

html[data-theme="light"] .how-it-works-process-light {
    display: block !important;
}

html[data-theme="light"] .how-it-works-header h1 {
    color: #082c49;
}

html[data-theme="light"] .how-it-works-header p {
    color: #496877;
}

.process-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 2.8vw, 48px);
    align-items: start;
}

.process-step {
    position: relative;
    min-width: 0;
}

.process-step-header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-height: 104px;
    margin-bottom: 8px;
}

.process-step-number {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.theme-image > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.theme-image-light { display: none !important; }

html[data-theme="light"] .theme-image-dark { display: none !important; }
html[data-theme="light"] .theme-image-light { display: block !important; }

.process-step-header h2 {
    margin: 7px 0 7px;
    color: #f7fcff;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    line-height: 1.05;
}

.process-step-header p {
    margin: 0;
    color: rgba(240, 250, 252, 0.82);
    font-size: 0.9rem;
    line-height: 1.45;
}

.process-step-arrow {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: calc(50% + 18px);
    width: clamp(64px, 8vw, 140px);
    pointer-events: none;
    transform: translateY(-50%);
}

.process-step-arrow > img {
    width: 100%;
    height: auto !important;
}

.process-card {
    min-height: 432px;
    overflow: hidden;
    padding: 14px;
    border: 1px solid rgba(120, 210, 233, 0.35);
    border-radius: 16px;
    color: #f4fcff;
    background: linear-gradient(160deg, rgba(3, 24, 35, 0.96), rgba(3, 15, 24, 0.9));
    box-shadow: 0 16px 32px rgba(0, 12, 20, 0.18);
}

.process-example-image {
    display: block;
    width: 100%;
    aspect-ratio: 1.6;
    object-fit: cover;
    border: 1px solid rgba(121, 214, 238, 0.42);
    border-radius: 10px;
}

.process-feature-list,
.classification-list,
.report-legend { padding: 0; list-style: none; }

.process-feature-list {
    display: grid;
    gap: 13px;
    margin: 18px 4px 0;
}

.process-feature-list li {
    display: flex;
    gap: 12px;
    align-items: center;
    color: rgba(240, 250, 252, 0.9);
    font-size: 0.9rem;
    line-height: 1.42;
}

.process-feature-icon {
    display: block;
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
}

.process-classification-card { padding: 10px 13px; }

.classification-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.classification-list li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 9px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid rgba(130, 212, 220, 0.2);
    color: #f4fcff;
    font-size: 0.78rem;
}

.classification-list small {
    display: block;
    margin-top: 2px;
    color: rgba(222, 240, 246, 0.66);
    font-size: 0.67rem;
}

.classification-list strong { font-size: 0.75rem; }

.classification-thumb {
    width: 42px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
}

.classification-dot,
.report-legend li > span {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-red { background: #ff3d45; }
.dot-orange { background: #ff9d1e; }
.dot-purple { background: #7e4ce0; }
.dot-blue { background: #1473ed; }
.dot-green { background: #0ab88f; }

.process-classification-features { margin-top: 14px; gap: 10px; }
.process-classification-features li { font-size: 0.82rem; }

.process-report-card h3 { margin: 0 0 12px; font-size: 1.1rem; }

.report-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.report-metrics span {
    display: grid;
    gap: 6px;
    min-height: 57px;
    padding: 8px;
    border: 1px solid rgba(94, 177, 211, 0.32);
    border-radius: 7px;
}

.report-metrics small { color: rgba(230, 246, 250, 0.7); font-size: 0.58rem; line-height: 1.15; }
.report-metrics strong { color: #fff; font-size: 0.96rem; }
.report-material-title { margin: 14px 0 8px; font-size: 0.84rem; font-weight: 700; }

.report-chart-row {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 124px;
    padding: 10px;
    border: 1px solid rgba(94, 177, 211, 0.25);
    border-radius: 8px;
}

.report-donut {
    display: block;
    width: 112px;
    aspect-ratio: 1;
    flex: 0 0 auto;
}

.report-legend { display: grid; gap: 7px; width: 100%; margin: 0; }

.report-legend li {
    display: grid;
    grid-template-columns: 11px minmax(0, 1fr) max-content;
    gap: 7px;
    align-items: center;
    font-size: 0.72rem;
}

.report-legend strong { font-size: 0.7rem; }

.how-it-works-page .process-report-button {
    width: 100%;
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 10px;
    border: 1px solid #147cf5;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(135deg, #168af8, #0757e3);
    box-shadow: none;
    font-size: 0.84rem;
}

.how-it-works-page .process-report-button:disabled,
.how-it-works-page .process-report-button:disabled:hover,
.how-it-works-page .process-report-button:disabled:focus-visible {
    cursor: default;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

html[data-theme="dark"] .how-it-works-page .process-report-button {
    border: 0;
    border-radius: 7px;
    color: #062019;
    background: linear-gradient(135deg, var(--accent-warm), var(--accent));
    box-shadow: 0 14px 30px rgba(29, 182, 122, 0.22);
}

.how-it-works-page .process-report-button-secondary {
    margin-top: 8px;
    border-color: #1bbfe6;
    color: #dff9ff;
    background: transparent;
}

html[data-theme="light"] .process-step-header h2,
html[data-theme="light"] .process-card,
html[data-theme="light"] .classification-list li { color: #082c49; }
html[data-theme="light"] .process-step-header p { color: #496877; }

html[data-theme="light"] .process-card {
    border-color: rgba(0, 113, 163, 0.26);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(235, 247, 251, 0.92));
    box-shadow: 0 16px 32px rgba(8, 65, 82, 0.1);
}

html[data-theme="light"] .process-feature-list li,
html[data-theme="light"] .classification-list small,
html[data-theme="light"] .report-metrics small { color: #496877; }
html[data-theme="light"] .classification-list li,
html[data-theme="light"] .report-chart-row,
html[data-theme="light"] .report-metrics span { border-color: rgba(8, 65, 82, 0.16); }
html[data-theme="light"] .report-metrics strong { color: #082c49; }
html[data-theme="light"] .how-it-works-page .process-report-button-secondary { color: #006fae; background: transparent; }

/* Marine litter taxonomy overview */
.taxonomy-board {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(28px, 4vw, 62px);
    margin-top: clamp(32px, 4vw, 56px);
    padding: clamp(24px, 3.2vw, 40px);
    border: 1px solid rgba(120, 210, 233, 0.32);
    border-radius: 16px;
    color: #f4fcff;
    background: linear-gradient(145deg, rgba(3, 24, 35, 0.95), rgba(3, 15, 24, 0.9));
    box-shadow: 0 16px 32px rgba(0, 12, 20, 0.16);
}

.taxonomy-board h2 {
    margin: 0;
    color: inherit;
    font-size: clamp(1.2rem, 1.8vw, 1.55rem);
}

.taxonomy-overview > header p {
    max-width: 48ch;
    margin: 8px 0 20px;
    color: rgba(240, 250, 252, 0.82);
    font-size: 0.9rem;
    line-height: 1.45;
}

.taxonomy-overview-content {
    display: grid;
    grid-template-columns: minmax(165px, 0.9fr) minmax(190px, 1.1fr);
    gap: 22px;
    align-items: center;
}

.taxonomy-pyramid-slot {
    display: grid;
    place-items: center;
    min-height: 188px;
}

.taxonomy-pyramid-image {
    display: block;
    width: 100%;
    max-width: 240px;
    max-height: 250px;
    object-fit: contain;
}

.taxonomy-download-link {
    display: block;
    width: fit-content;
    margin: 16px auto 0;
    color: #ffd166;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: underline;
    text-decoration-color: rgba(255, 209, 102, 0.62);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.taxonomy-download-link:hover,
.taxonomy-download-link:focus-visible {
    color: #ffe29a;
    text-decoration-color: currentColor;
}

.taxonomy-definitions {
    padding: 0;
    list-style: none;
}

.taxonomy-definitions { display: grid; gap: 14px; margin: 0; }

.taxonomy-definitions li {
    display: block;
}

.taxonomy-definitions p { margin: 0; }
.taxonomy-definitions strong { display: block; font-size: 0.86rem; }
.taxonomy-definitions small { display: block; margin-top: 4px; color: rgba(222, 240, 246, 0.72); font-size: 0.76rem; line-height: 1.35; }

.taxonomy-link {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #ffd166;
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(255, 209, 102, 0.62);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
    cursor: pointer;
}

.taxonomy-link:hover,
.taxonomy-link:focus-visible {
    color: #ffe29a;
    text-decoration-color: currentColor;
    transform: none;
}

.taxonomy-link,
.taxonomy-link:hover,
.taxonomy-link:focus-visible,
html[data-theme="light"] .taxonomy-link,
html[data-theme="light"] .taxonomy-link:hover,
html[data-theme="light"] .taxonomy-link:focus-visible {
    background: transparent !important;
    box-shadow: none !important;
}

.taxonomy-examples {
    min-width: 0;
    padding-left: clamp(24px, 3vw, 46px);
    border-left: 1px dashed rgba(135, 213, 232, 0.58);
}

.taxonomy-examples > h2 { margin-bottom: 12px; font-size: 1rem; }
.taxonomy-table { display: grid; gap: 0; }

.taxonomy-table-header,
.taxonomy-table-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
}

.taxonomy-table-header {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 5px;
}

.taxonomy-table-header span {
    grid-column: auto !important;
    display: grid;
    place-items: center;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 5px;
    color: #f7fcff;
    background: linear-gradient(135deg, #147cf5, #287dea);
    font-size: 0.64rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
}

.taxonomy-table-header span:first-child {
    justify-self: stretch;
    text-align: center;
}

html[data-theme="dark"] .taxonomy-table-header span {
    color: #062b41;
    background: linear-gradient(135deg, #a6e8f7, #62cee8);
    box-shadow: 0 8px 16px rgba(61, 190, 221, 0.18);
}

.taxonomy-table-row {
    min-height: 62px;
    border-bottom: 1px solid rgba(130, 212, 220, 0.17);
    font-size: 0.74rem;
    line-height: 1.28;
}

.taxonomy-table-row > span { min-width: 0; }

.taxonomy-table-row > span:first-child {
    justify-self: center;
    text-align: center;
}

.taxonomy-table-row img {
    justify-self: center;
    width: auto;
    max-width: 100%;
    height: 52px;
    border-radius: 4px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.24);
}

.taxonomy-note { margin: 14px 0 0; color: rgba(225, 244, 249, 0.8); font-size: 0.75rem; }

html[data-theme="light"] .taxonomy-board {
    border-color: rgba(0, 113, 163, 0.26);
    color: #082c49;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(235, 247, 251, 0.92));
    box-shadow: 0 16px 32px rgba(8, 65, 82, 0.1);
}

html[data-theme="light"] .taxonomy-overview > header p,
html[data-theme="light"] .taxonomy-definitions small,
html[data-theme="light"] .taxonomy-note { color: #496877; }
html[data-theme="light"] .taxonomy-download-link { color: #008fd0; text-decoration-color: rgba(0, 143, 208, 0.62); }
html[data-theme="light"] .taxonomy-download-link:hover,
html[data-theme="light"] .taxonomy-download-link:focus-visible { color: #57c9ef; text-decoration-color: currentColor; }
html[data-theme="light"] .taxonomy-examples { border-color: rgba(8, 65, 82, 0.35); }
html[data-theme="light"] .taxonomy-table-row { border-color: rgba(8, 65, 82, 0.16); }
html[data-theme="light"] .taxonomy-link { color: #008fd0; text-decoration-color: rgba(0, 143, 208, 0.62); }
html[data-theme="light"] .taxonomy-link:hover,
html[data-theme="light"] .taxonomy-link:focus-visible { color: #57c9ef; text-decoration-color: currentColor; }

/* Override the general button palette: taxonomy links always use footer-link colours. */
button.taxonomy-link {
    color: #ffd166 !important;
    text-decoration-color: rgba(255, 209, 102, 0.62) !important;
}

button.taxonomy-link:hover,
button.taxonomy-link:focus-visible {
    color: #ffe29a !important;
    text-decoration-color: currentColor !important;
}

html[data-theme="light"] button.taxonomy-link {
    color: #008fd0 !important;
    text-decoration-color: rgba(0, 143, 208, 0.62) !important;
}

html[data-theme="light"] button.taxonomy-link:hover,
html[data-theme="light"] button.taxonomy-link:focus-visible {
    color: #57c9ef !important;
    text-decoration-color: currentColor !important;
}

.taxonomy-dialog {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(calc(100% - 40px), 820px);
    max-height: min(78vh, 720px);
    overflow: hidden;
    border: 1px solid rgba(120, 210, 233, 0.38);
    border-radius: 16px;
    color: #f4fcff;
    background: linear-gradient(145deg, #082738, #03131f);
    box-shadow: 0 28px 80px rgba(0, 10, 18, 0.48);
    transform: translateY(14px) scale(0.98);
    transition: transform 0.18s ease;
}

.dialog-layer.is-open .taxonomy-dialog { transform: translateY(0) scale(1); }

.taxonomy-dialog-header {
    display: flex;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(120, 210, 233, 0.2);
}

.taxonomy-dialog-header h2 { margin: 2px 0 0; font-size: 1.35rem; }

.taxonomy-dialog-actions {
    display: flex;
    justify-content: flex-end;
    padding: 14px 24px 20px;
    border-top: 1px solid rgba(120, 210, 233, 0.2);
}

.taxonomy-dialog-close {
    min-width: 96px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid rgba(120, 210, 233, 0.35);
    border-radius: 7px;
    color: inherit;
    background: rgba(114, 221, 251, 0.08);
    box-shadow: none;
    font-size: 0.86rem;
}

.taxonomy-dialog-close:hover,
.taxonomy-dialog-close:focus-visible {
    transform: none;
    color: #fff;
    background: rgba(114, 221, 251, 0.2);
    box-shadow: none;
}

.taxonomy-dialog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    align-content: start;
    overflow-y: auto;
    margin: 0;
    padding: 20px 24px 26px;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(114, 221, 251, 0.7) transparent;
}

.taxonomy-dialog-list li {
    display: grid;
    gap: 5px;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid rgba(120, 210, 233, 0.18);
    border-radius: 8px;
    color: rgba(244, 252, 255, 0.92);
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.84rem;
    line-height: 1.35;
}

.taxonomy-dialog-list code {
    color: #72ddfb;
    font-size: 0.74rem;
}

html[data-theme="light"] .taxonomy-dialog {
    border-color: rgba(0, 113, 163, 0.3);
    color: #082c49;
    background: linear-gradient(145deg, #ffffff, #eaf6fa);
    box-shadow: 0 28px 80px rgba(8, 65, 82, 0.24);
}

html[data-theme="light"] .taxonomy-dialog-header,
html[data-theme="light"] .taxonomy-dialog-actions,
html[data-theme="light"] .taxonomy-dialog-list li { border-color: rgba(8, 65, 82, 0.16); }
html[data-theme="light"] .taxonomy-dialog-close { color: #082c49; border-color: rgba(8, 65, 82, 0.24); background: rgba(0, 143, 208, 0.08); }
html[data-theme="light"] .taxonomy-dialog-list li { color: #082c49; background: rgba(255, 255, 255, 0.58); }
html[data-theme="light"] .taxonomy-dialog-list code { color: #0074b5; }

@media (max-width: 1080px) {
    .taxonomy-board { grid-template-columns: 1fr; }
    .taxonomy-examples { padding: 28px 0 0; border-top: 1px dashed rgba(135, 213, 232, 0.58); border-left: 0; }
}

@media (max-width: 760px) {
    .how-it-works-page.active {
        width: min(calc(100% - 40px), 1440px);
        padding-top: 26px;
    }

    .how-it-works-header {
        margin-bottom: 30px;
    }

    .process-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 34px 24px;
    }

    .process-card {
        min-height: 0;
    }

    .process-step-arrow {
        display: none;
    }

    .taxonomy-board {
        padding: 22px 18px;
    }

    .taxonomy-overview-content {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .taxonomy-examples {
        overflow-x: auto;
    }

    .taxonomy-table {
        min-width: 650px;
    }
}

@media (max-width: 520px) {
    .process-board {
        grid-template-columns: 1fr;
    }

    .taxonomy-dialog {
        width: min(calc(100% - 28px), 820px);
        max-height: 84vh;
    }

    .taxonomy-dialog-header,
    .taxonomy-dialog-list {
        padding-inline: 18px;
    }

    .taxonomy-dialog-list {
        grid-template-columns: 1fr;
    }

}


html[data-theme="light"] button.archive-upload-item:hover,
html[data-theme="light"] button.archive-upload-item:focus-visible,
html[data-theme="light"] button.result-list-item:not(:disabled):hover,
html[data-theme="light"] button.result-list-item:focus-visible,
html[data-theme="light"] button.waste-object-list-item:hover,
html[data-theme="light"] button.waste-object-list-item:focus-visible {
    border-color: rgba(0, 143, 208, 0.52);
    background: rgba(0, 143, 208, 0.1);
}

/* Make code-request submission clearly inert while the backend sends the email. */
.user-form input[type="submit"]:disabled,
.user-form input[type="submit"]:disabled:hover,
.user-form input[type="submit"]:disabled:focus-visible {
    cursor: wait;
    opacity: 0.72;
    transform: none;
    box-shadow: none;
}

html[data-theme="light"] button.result-list-item.selected-result,
html[data-theme="light"] button.waste-object-list-item.selected-waste {
    border-color: rgba(0, 143, 208, 0.72);
    background: rgba(0, 143, 208, 0.15);
    box-shadow: inset 3px 0 0 #008fd0;
}

html[data-theme="light"] .result-image-list,
html[data-theme="light"] .waste-object-list {
    scrollbar-color: rgba(0, 143, 208, 0.68) transparent;
}

html[data-theme="light"] .result-image-list::-webkit-scrollbar,
html[data-theme="light"] .waste-object-list::-webkit-scrollbar {
    width: 8px;
}

html[data-theme="light"] .result-image-list::-webkit-scrollbar-thumb,
html[data-theme="light"] .waste-object-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 143, 208, 0.68);
}
