@font-face {
    font-family: "Nunito";
    src: url("fonts/Nunito-Variable.ttf") format("truetype");
    font-style: normal;
    font-weight: 200 1000;
    font-display: swap;
}

:root {
    --font-text: "Nunito", "Segoe UI", system-ui, sans-serif;
    --font-display: "Nunito", "Arial Rounded MT Bold", sans-serif;
    --paper: #f1efe8;
    --surface: #ffffff;
    --ink: #202622;
    --muted: #737a74;
    --line: #dfe2dc;
    --line-strong: #c8cdc5;
    --accent: #26735b;
    --accent-dark: #1d5846;
    --accent-soft: #dff0e8;
    --gold: #e2a83b;
    --gold-soft: #f8ebca;
    --danger: #b74b4b;
    --shadow: 0 24px 70px rgba(37, 47, 40, 0.09);
    --radius-lg: 32px;
    --radius-md: 24px;
    --radius-sm: 16px;
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-text);
    font-weight: 480;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

[hidden] {
    display: none !important;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
    transform: translateY(-1px);
}

.button:focus-visible,
.star-button:focus-visible,
.step:focus-visible,
.gallery-card:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible {
    outline: 3px solid rgba(38, 115, 91, 0.22);
    outline-offset: 3px;
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.button-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 20px rgba(38, 115, 91, 0.19);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-dark);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.button-danger {
    border-color: #e3b8b8;
    background: #fff5f5;
    color: var(--danger);
}

.button-danger:hover:not(:disabled) {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.home-shell {
    width: min(1140px, calc(100% - 40px));
    margin: 0 auto;
    padding: 80px 0 100px;
}

.home-hero {
    display: grid;
    max-width: 900px;
    gap: 20px;
    padding: 50px 0 72px;
}

.home-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 6.6rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.95;
}

.home-hero p {
    max-width: 620px;
    margin: 0;
    color: var(--muted);
    font-size: 1.18rem;
}

.project-section {
    border-top: 1px solid var(--line-strong);
    padding-top: 30px;
}

.section-heading,
.admin-section-heading,
.gallery-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2,
.admin-section-heading h2,
.gallery-heading h2 {
    margin: 0;
    font-size: 1.45rem;
}

.section-heading > span,
.count-badge {
    display: inline-grid;
    min-width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.project-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    min-height: 128px;
    align-items: center;
    gap: 22px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.project-card.is-preparing {
    opacity: 0.68;
}

.project-number {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.project-card h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.project-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.project-arrow {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.25rem;
}

.empty-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 70px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    text-align: center;
}

.empty-card h1,
.empty-card h3,
.empty-card p {
    margin: 0;
}

.empty-card p {
    max-width: 470px;
    color: var(--muted);
}

.empty-mark {
    display: grid;
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.8rem;
}

.centered-shell {
    display: grid;
    width: min(680px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    place-items: center;
    padding: 40px 0;
}

.error-card {
    width: 100%;
}

.error-card h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 3.7rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.error-card .button {
    margin-top: 18px;
}

/* Voting */

.vote-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 0, rgba(226, 168, 59, 0.08), transparent 28%),
        var(--paper);
}

.vote-shell {
    width: min(1060px, calc(100% - 40px));
    margin: 0 auto;
    padding: 24px 0 70px;
}

.vote-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 10px;
    font-weight: 850;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.25rem;
}

.project-title {
    display: grid;
    justify-items: center;
    line-height: 1.25;
}

.project-title span {
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.project-title strong {
    max-width: 430px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.counter {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 5px;
    color: var(--muted);
}

.counter strong {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.6rem;
}

.preview-mode-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 8px 12px;
    border: 1px solid #dfc77f;
    border-radius: 999px;
    background: #fff8df;
    color: #72551c;
    font-size: 0.72rem;
}

.preview-mode-note strong {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.preview-mode-note span {
    color: #846b37;
}

.stepper-wrap {
    padding: 22px 0 18px;
}

.stepper-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.stepper {
    display: flex;
    overflow-x: auto;
    align-items: center;
    padding: 3px;
    scrollbar-width: none;
}

.stepper::-webkit-scrollbar {
    display: none;
}

.step {
    position: relative;
    display: grid;
    flex: 1 0 35px;
    min-width: 35px;
    height: 35px;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.step::before {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: 50%;
    left: -50%;
    height: 2px;
    background: var(--line);
    content: "";
}

.step:first-child::before {
    display: none;
}

.step span {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--paper);
    font-size: 0.68rem;
    font-weight: 800;
}

.step.complete::before,
.step.complete span {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.step.current span {
    border-color: var(--accent);
    box-shadow: 0 0 0 5px var(--accent-soft);
    color: var(--accent);
}

.step.complete.current span {
    color: #fff;
}

.step:disabled {
    cursor: default;
}

.vote-panel,
.final-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-enter {
    animation: panel-enter 260ms ease both;
}

@keyframes panel-enter {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.image-stage {
    position: relative;
    display: grid;
    min-height: 400px;
    max-height: 55vh;
    overflow: hidden;
    place-items: center;
    border-bottom: 1px solid var(--line);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background:
        linear-gradient(45deg, #f2f3f0 25%, transparent 25%),
        linear-gradient(-45deg, #f2f3f0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f2f3f0 75%),
        linear-gradient(-45deg, transparent 75%, #f2f3f0 75%),
        #fafbf9;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.image-stage::after {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 40%, rgba(32, 38, 34, 0.025));
    content: "";
    pointer-events: none;
}

.image-stage img {
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    max-height: 55vh;
    padding: 36px;
    object-fit: contain;
    opacity: 0;
    transition: opacity 180ms ease;
}

.image-stage img.is-loaded {
    opacity: 1;
}

.image-loader {
    position: absolute;
    width: 42px;
    height: 42px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.rating-block {
    padding: 28px 34px 12px;
}

.rating-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.rating-heading h1 {
    max-width: 600px;
    margin: 5px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.4rem);
    font-weight: 720;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.rating-value {
    display: flex;
    min-width: 84px;
    align-items: baseline;
    justify-content: flex-end;
    gap: 5px;
}

.rating-value strong {
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 2.5rem;
    line-height: 1;
}

.rating-value span {
    color: var(--muted);
    font-size: 0.75rem;
}

.stars {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 7px;
}

.star-button {
    display: grid;
    min-width: 0;
    min-height: 62px;
    place-items: center;
    gap: 0;
    padding: 5px 2px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fbfcfa;
    color: #bdc2bc;
    cursor: pointer;
    transition: color 120ms ease, transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.star-button span {
    font-size: clamp(1.3rem, 2.8vw, 2rem);
    line-height: 1;
}

.star-button small {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 800;
}

.star-button:hover,
.star-button.selected {
    border-color: #e7c878;
    background: var(--gold-soft);
    color: var(--gold);
}

.star-button:hover {
    transform: translateY(-2px);
}

.rating-input[hidden],
.rating-value[hidden],
.rating-confirmation[hidden] {
    display: none;
}

.rating-hint,
.save-message {
    margin: 11px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.save-message {
    min-height: 21px;
    font-weight: 700;
}

.save-message.is-error {
    color: var(--danger);
}

.rating-confirmation {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 82px;
    padding: 16px 18px;
    border: 1px solid rgba(38, 104, 84, 0.2);
    border-radius: 14px;
    background: #edf6f1;
    color: var(--ink);
}

.rating-confirmation-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.rating-confirmation p {
    margin: 0;
    font-size: 0.92rem;
}

.rating-confirmation p strong {
    color: var(--accent);
    font-size: 1.15rem;
}

.rating-confirmation-next {
    min-height: 42px;
    justify-self: end;
    padding: 0 18px;
}

.vote-actions {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 34px 30px;
}

.vote-actions .button {
    min-width: 180px;
}

.text-button {
    display: block;
    margin: -14px auto 25px;
    padding: 6px 12px;
    border: 0;
    background: none;
    color: var(--accent);
    cursor: pointer;
    font-weight: 700;
}

.rating-change-button {
    display: inline-flex;
    margin: 5px 0 0;
    padding: 2px 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.rating-change-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.final-panel {
    padding: clamp(28px, 6vw, 66px);
}

.final-intro {
    display: grid;
    max-width: 700px;
    justify-items: start;
}

.final-mark {
    display: grid;
    width: 58px;
    height: 58px;
    margin-bottom: 24px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.45rem;
    font-weight: 900;
}

.final-intro h1 {
    margin: 8px 0 12px;
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.final-intro p {
    max-width: 600px;
    margin: 0;
    color: var(--muted);
    font-size: 1.03rem;
}

.finish-form {
    margin: 36px 0 58px;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #fafbf9;
}

.finish-form label {
    display: block;
    margin-bottom: 10px;
    font-weight: 750;
}

.finish-form label span {
    margin-left: 5px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.finish-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.finish-row input,
.admin-dialog input[type="text"] {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink);
    outline: 0;
}

.finish-row input:focus,
.admin-dialog input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(38, 115, 91, 0.11);
}

.finish-form > p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
}

.thank-you {
    margin: 30px 0 56px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-weight: 650;
}

.gallery-heading {
    margin-bottom: 17px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.gallery-heading > span {
    color: var(--muted);
    font-size: 0.82rem;
}

.result-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.gallery-card {
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(37, 47, 40, 0.1);
}

.gallery-image {
    position: relative;
    display: grid;
    height: 140px;
    min-height: 0;
    overflow: hidden;
    place-items: center;
    border-bottom: 1px solid var(--line);
    background: #f7f8f5;
}

.gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    padding: 14px;
    object-fit: contain;
}

.gallery-info {
    position: relative;
    z-index: 1;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 14px;
    background: var(--surface);
}

.gallery-info > strong {
    font-size: 0.8rem;
}

.gallery-info > span {
    color: var(--muted);
    font-size: 0.72rem;
}

.gallery-info b {
    color: var(--accent);
    font-size: 1rem;
}

/* Admin */

.admin-body {
    --radius-lg: 26px;
    --radius-md: 18px;
    --radius-sm: 12px;
    background: #f3f2ed;
}

.admin-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 25px 18px;
    border-right: 1px solid var(--line);
    background: #fbfaf7;
}

.admin-sidebar .brand {
    padding: 0 8px 24px;
}

.admin-sidebar .brand small {
    margin-left: 4px;
    color: var(--muted);
    font-size: 0.63rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.sidebar-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 10px 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sidebar-heading strong {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
}

.project-nav {
    display: grid;
    overflow-y: auto;
    gap: 4px;
}

.project-nav a {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 11px;
    padding: 10px;
    border-radius: 12px;
    text-decoration: none;
}

.project-nav a:hover,
.project-nav a.active {
    background: var(--accent-soft);
}

.nav-project-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--accent);
    font-family: var(--font-display);
}

.project-nav a > span:last-child {
    min-width: 0;
}

.project-nav strong,
.project-nav small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-nav strong {
    font-size: 0.84rem;
}

.project-nav small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.65rem;
}

.sidebar-create {
    width: 100%;
    margin-top: auto;
}

.admin-main {
    width: 100%;
    max-width: 1420px;
    min-width: 0;
    margin: 0 auto;
    padding: 26px clamp(22px, 4vw, 58px) 70px;
}

.admin-topbar {
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}

.admin-topbar h1 {
    margin: 2px 0 0;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 740;
    letter-spacing: -0.025em;
    line-height: 1;
}

.mobile-menu {
    display: none;
}

.flash {
    margin-bottom: 20px;
    padding: 14px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-weight: 650;
}

.flash-success {
    border-color: #b8d9cd;
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.flash-warning {
    border-color: #ead294;
    background: #fff5dc;
}

.flash-error {
    border-color: #e6b5b5;
    background: #fff0f0;
    color: #8b3030;
}

.admin-welcome {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    padding: clamp(32px, 6vw, 70px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.admin-welcome h2 {
    max-width: 520px;
    margin: 10px 0 15px;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    font-weight: 760;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.admin-welcome > div:first-child p {
    max-width: 520px;
    margin: 0 0 28px;
    color: var(--muted);
}

.welcome-steps {
    display: grid;
    gap: 10px;
}

.welcome-steps > div {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fafbf9;
}

.welcome-steps span {
    grid-row: 1 / 3;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.welcome-steps p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.project-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.public-link {
    min-width: 0;
}

.public-link > span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.public-link > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.public-link a {
    overflow: hidden;
    color: var(--accent);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-link button {
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 800;
}

.project-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.project-toolbar-actions form {
    margin: 0;
}

.preview-button {
    min-height: 38px;
    padding: 0 14px;
    font-size: 0.72rem;
}

.preview-button span {
    font-size: 0.85rem;
}

.icon-button {
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
}

.icon-button.archive:hover {
    color: var(--gold);
}

.icon-button.restore:hover {
    color: var(--accent);
}

.icon-button.danger:hover {
    color: var(--danger);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.metric-grid article {
    display: grid;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.metric-grid span,
.metric-grid small {
    color: var(--muted);
    font-size: 0.7rem;
}

.metric-grid span {
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.metric-grid strong {
    margin: 6px 0 2px;
    font-family: var(--font-display);
    font-size: 2.1rem;
    font-weight: 720;
}

.visibility-settings,
.theme-settings {
    display: grid;
    grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
    align-items: start;
    gap: 28px;
}

.visibility-settings .admin-section-heading,
.theme-settings .admin-section-heading {
    margin-bottom: 0;
}

.visibility-form {
    display: grid;
    justify-items: start;
    gap: 16px;
}

.visibility-options {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.visibility-option {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 12px;
    min-height: 104px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfa;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.visibility-option:hover {
    border-color: var(--line-strong);
}

.visibility-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 2px rgba(38, 115, 91, 0.08);
}

.visibility-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.radio-mark {
    display: grid;
    width: 20px;
    height: 20px;
    margin-top: 2px;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
}

.visibility-option input:checked + .radio-mark {
    border-color: var(--accent);
}

.visibility-option input:checked + .radio-mark::after {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

.visibility-option input:focus-visible + .radio-mark {
    outline: 3px solid rgba(38, 115, 91, 0.22);
    outline-offset: 3px;
}

.visibility-option strong,
.visibility-option small {
    display: block;
}

.visibility-option strong {
    margin-bottom: 4px;
    font-size: 0.88rem;
}

.visibility-option small {
    color: var(--muted);
    font-size: 0.72rem;
    line-height: 1.45;
}

.theme-option-light {
    background:
        radial-gradient(circle at 88% 12%, rgba(218, 177, 92, 0.18), transparent 42%),
        #fbfcfa;
}

.theme-option-dark {
    border-color: #35483f;
    background:
        radial-gradient(circle at 88% 12%, rgba(111, 197, 164, 0.14), transparent 42%),
        #15231d;
    color: #edf4ef;
}

.theme-option-dark:hover {
    border-color: #5f766b;
}

.theme-option-dark small {
    color: #aebbb4;
}

.theme-option-dark .radio-mark {
    border-color: #5b6e65;
    background: #101a16;
}

.theme-option-dark:has(input:checked) {
    border-color: #56b792;
    background:
        radial-gradient(circle at 88% 12%, rgba(111, 197, 164, 0.2), transparent 42%),
        #183329;
    box-shadow: 0 0 0 2px rgba(38, 115, 91, 0.12);
}

.theme-option-dark input:checked + .radio-mark {
    border-color: #73c9a8;
}

.theme-option-dark input:checked + .radio-mark::after {
    background: #73c9a8;
}

.dialog-theme-fieldset {
    margin: 8px 0 0;
    padding: 0;
    border: 0;
}

.dialog-theme-fieldset legend {
    margin-bottom: 8px;
    font-size: 0.78rem;
    font-weight: 750;
}

.dialog-theme-fieldset .visibility-option {
    min-height: 82px;
    padding: 13px;
}

.reset-statistics {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
}

.reset-statistics h2 {
    margin: 3px 0 7px;
    font-size: 1.35rem;
}

.reset-statistics p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.reset-statistics form {
    display: grid;
    min-width: 220px;
    justify-items: stretch;
    gap: 7px;
}

.reset-statistics form small {
    color: var(--muted);
    font-size: 0.66rem;
    text-align: center;
}

.maintenance-delete {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    margin-top: 4px;
    padding-top: 24px;
    border-top: 1px solid rgba(190, 62, 62, 0.2);
}

.maintenance-delete h3 {
    margin: 0 0 7px;
    color: var(--danger);
    font-size: 1rem;
}

.maintenance-delete form {
    min-width: 220px;
}

.maintenance-delete .button-danger {
    border-color: #d99b9b;
    background: #fff2f2;
}

.maintenance-delete .button-danger:hover {
    border-color: var(--danger);
    background: #fce4e4;
}

.admin-section {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.admin-section.admin-maintenance {
    margin-top: clamp(40px, 5vw, 64px);
}

.admin-section-heading {
    margin-bottom: 20px;
}

.admin-section-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 2px;
}

.voting-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border: 1px solid #c7ded5;
    border-radius: 999px;
    background: #edf6f2;
    color: var(--accent-dark);
    font-size: 0.62rem;
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.voting-status-badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

.admin-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.archive-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-decoration: none;
}

.archive-link:hover {
    border-color: var(--line-strong);
    color: var(--ink);
}

.archive-link span {
    display: grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #f1efe9;
    color: var(--ink);
    font-size: 0.66rem;
}

.image-ranking {
    display: grid;
    gap: 8px;
}

.ranking-card {
    display: grid;
    grid-template-columns: 42px 92px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 102px;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfa;
}

.rank-number {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

.ranking-preview-button {
    display: block;
    width: 92px;
    height: 78px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: zoom-in;
}

.ranking-preview-button:focus-visible {
    outline: 3px solid rgba(38, 115, 91, 0.25);
    outline-offset: 3px;
}

.ranking-preview-button img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    object-fit: contain;
    transition: border-color 160ms ease, transform 160ms ease;
}

.ranking-preview-button:hover img {
    border-color: rgba(38, 115, 91, 0.42);
    transform: scale(1.025);
}

.rank-content {
    min-width: 0;
}

.rank-content strong,
.rank-content span {
    display: block;
}

.rank-content strong {
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-content span,
.rank-score span {
    color: var(--muted);
    font-size: 0.7rem;
}

.rank-score {
    min-width: 75px;
    text-align: right;
}

.rank-score strong {
    display: block;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 720;
}

.ranking-card .icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: #f5f3ee;
    font-size: 1.2rem;
}

.ranking-card .icon-button.archive {
    display: grid;
    border: 1px solid #e5d39b;
    background: #fff8e4;
    color: #80611d;
    place-items: center;
}

.ranking-card .icon-button.archive:hover {
    border-color: #d8bc6b;
    background: var(--gold-soft);
    color: #6d5114;
}

.ranking-card .icon-button.restore {
    border: 1px solid #c7ddd4;
    background: #edf6f2;
    color: var(--accent);
}

.archive-box-icon {
    position: relative;
    display: block;
    width: 16px;
    height: 12px;
    margin: 3px auto 0;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.archive-box-icon::before {
    position: absolute;
    top: -5px;
    left: -4px;
    width: 20px;
    height: 5px;
    border: 2px solid currentColor;
    border-radius: 2px;
    background: #fff8e4;
    content: "";
}

.ranking-card .icon-button.archive:hover .archive-box-icon::before {
    background: var(--gold-soft);
}

.archive-box-icon::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    border-top: 2px solid currentColor;
    content: "";
}

.image-votes {
    grid-column: 1 / -1;
    margin: 2px -4px -2px;
    border-top: 1px solid var(--line);
}

.image-votes summary {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 8px 4px 0;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    list-style: none;
}

.image-votes summary::-webkit-details-marker {
    display: none;
}

.image-votes summary::after {
    margin-left: 2px;
    color: var(--muted);
    content: "⌄";
    font-size: 1rem;
    transition: transform 150ms ease;
}

.image-votes[open] summary::after {
    transform: rotate(180deg);
}

.image-votes summary strong {
    display: grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.65rem;
}

.image-voter-list {
    display: grid;
    max-height: 360px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 7px;
    margin-top: 7px;
    padding: 10px;
    overflow-y: auto;
    border-radius: 10px;
    background: #f4f5f1;
}

.image-voter-row {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}

.voter-person {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.voter-person > span:last-child {
    min-width: 0;
}

.voter-person strong,
.voter-person small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voter-person strong {
    font-size: 0.76rem;
}

.voter-person small {
    color: var(--muted);
    font-size: 0.62rem;
}

.voter-avatar {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: #eceee9;
    color: var(--ink);
    font-size: 0.68rem;
    font-weight: 800;
}

.voter-score {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    font-size: 0.88rem;
}

.voter-score.is-low {
    background: #f8e0e0;
    color: var(--danger);
}

.voter-score.is-middle {
    background: var(--gold-soft);
    color: #916517;
}

.voter-score.is-high {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.image-archive {
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.image-archive summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 2px 0;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 800;
    list-style: none;
}

.image-archive summary::-webkit-details-marker {
    display: none;
}

.image-archive summary::before {
    content: "＋";
}

.image-archive[open] summary::before {
    content: "−";
}

.image-archive summary > span:first-child {
    margin-right: auto;
}

.image-archive .image-ranking,
.image-archive .empty-admin {
    margin-top: 14px;
}

.archived-card {
    background: #f7f5f0;
    filter: saturate(0.72);
}

.archived-card .rank-number {
    color: var(--gold);
}

.archived-card img {
    opacity: 0.72;
}

.empty-admin {
    display: grid;
    justify-items: center;
    gap: 7px;
    padding: 48px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    text-align: center;
}

.empty-admin > span {
    color: var(--accent);
    font-size: 2rem;
}

.empty-admin h3,
.empty-admin p {
    margin: 0;
}

.empty-admin p {
    color: var(--muted);
    font-size: 0.82rem;
}

.empty-admin .button {
    margin-top: 12px;
}

.empty-admin.compact {
    padding: 32px 20px;
}

.participants-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.participants-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    white-space: nowrap;
}

.participants-table th,
.participants-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.participants-table th {
    background: #f7f7f3;
    color: var(--muted);
    font-size: 0.65rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.participants-table tbody tr:last-child td {
    border-bottom: 0;
}

.participants-table tbody tr {
    transition: opacity 160ms ease, background-color 160ms ease;
}

.participants-table tbody tr.participant-incomplete {
    background: rgba(247, 247, 243, 0.62);
    opacity: 0.55;
}

.participants-table tbody tr.participant-incomplete:hover,
.participants-table tbody tr.participant-incomplete:focus-within {
    opacity: 0.82;
}

.participants-table td > strong,
.participants-table td > small {
    display: block;
}

.participants-table td > small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.63rem;
}

.status-pill {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1efe9;
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 750;
}

.status-pill.complete {
    background: var(--accent-soft);
    color: var(--accent);
}

.score-cell,
.average-cell {
    font-weight: 800;
    text-align: center !important;
}

.average-cell {
    color: var(--accent);
}

.participant-actions {
    text-align: right !important;
}

.participant-actions form {
    margin: 0;
}

.participant-delete-button {
    padding: 6px 9px;
    border: 1px solid #e3b8b8;
    border-radius: 8px;
    background: #fff5f5;
    color: var(--danger);
    font-size: 0.68rem;
    white-space: nowrap;
}

.admin-dialog {
    width: min(500px, calc(100% - 28px));
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    box-shadow: 0 30px 100px rgba(23, 33, 27, 0.24);
}

.admin-dialog::backdrop {
    background: rgba(31, 40, 34, 0.46);
    backdrop-filter: blur(3px);
}

.admin-dialog form {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 30px;
}

.admin-dialog h2,
.admin-dialog p {
    margin: 0;
}

.admin-dialog h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 740;
}

.admin-dialog p {
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-dialog label:not(.upload-drop) {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 750;
}

.admin-dialog .button {
    margin-top: 8px;
}

.image-preview-dialog {
    position: fixed;
    width: min(960px, calc(100% - 28px));
    max-width: none;
    max-height: calc(100vh - 28px);
    padding: 0;
    border: 0;
    border-radius: var(--radius-md);
    background: #fbfaf7;
    box-shadow: 0 30px 100px rgba(23, 33, 27, 0.3);
    color: var(--ink);
    overflow: hidden;
}

.image-preview-dialog::backdrop {
    background: rgba(20, 29, 24, 0.72);
    backdrop-filter: blur(4px);
}

.image-preview-dialog figure {
    margin: 0;
}

.image-preview-stage {
    display: grid;
    min-height: min(68vh, 680px);
    max-height: calc(100vh - 96px);
    place-items: center;
    padding: clamp(18px, 4vw, 46px);
    background-color: #eef1ed;
    background-image:
        linear-gradient(45deg, rgba(38, 115, 91, 0.055) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(38, 115, 91, 0.055) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(38, 115, 91, 0.055) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(38, 115, 91, 0.055) 75%);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
}

.image-preview-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    object-fit: contain;
}

.image-preview-dialog figcaption {
    min-height: 54px;
    padding: 17px 64px 17px 20px;
    overflow: hidden;
    font-size: 0.78rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-preview-dialog .dialog-close {
    z-index: 2;
    top: 12px;
    right: 12px;
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(20, 29, 24, 0.72);
    color: #fff;
    backdrop-filter: blur(6px);
}

.dialog-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1efe9;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.3rem;
}

.upload-drop {
    display: grid;
    min-height: 170px;
    margin-top: 8px;
    place-items: center;
    align-content: center;
    gap: 5px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fafbf9;
    cursor: pointer;
    text-align: center;
}

.upload-drop:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.upload-drop > span {
    color: var(--accent);
    font-size: 2rem;
}

.upload-drop small {
    color: var(--muted);
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.toast {
    position: fixed;
    z-index: 20;
    right: 24px;
    bottom: 24px;
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Shared soft visual theme */
.vote-body,
.admin-body {
    background:
        radial-gradient(circle at 9% 4%, rgba(218, 177, 92, 0.16), transparent 25rem),
        radial-gradient(circle at 92% 18%, rgba(38, 115, 91, 0.12), transparent 28rem),
        var(--paper);
}

.vote-body::before,
.admin-body::before {
    position: fixed;
    z-index: -1;
    inset: 0;
    background-image:
        linear-gradient(rgba(31, 54, 45, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(31, 54, 45, 0.035) 1px, transparent 1px);
    background-size: 64px 64px;
    content: "";
    -webkit-mask-image: linear-gradient(to bottom, #000, transparent 72%);
    mask-image: linear-gradient(to bottom, #000, transparent 72%);
    pointer-events: none;
}

.vote-panel,
.final-panel {
    border-color: rgba(42, 68, 58, 0.16);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 30px 80px rgba(35, 54, 46, 0.11);
}

.vote-header {
    border-color: rgba(42, 68, 58, 0.18);
}

.admin-sidebar {
    border-color: rgba(42, 68, 58, 0.14);
    background: rgba(251, 250, 247, 0.88);
    backdrop-filter: blur(16px);
}

.admin-welcome,
.project-toolbar,
.metric-grid article,
.admin-section {
    border-color: rgba(42, 68, 58, 0.14);
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 14px 42px rgba(35, 54, 46, 0.055);
}

.metric-grid article:nth-child(2) {
    background: rgba(244, 237, 222, 0.84);
}

.metric-grid article:nth-child(3) {
    background: rgba(229, 238, 232, 0.86);
}

.admin-dialog {
    border-radius: var(--radius-md);
    background: #fbfaf7;
}

/* Dark voting theme selected in project settings */
.vote-body.theme-dark {
    --paper: #0d1512;
    --surface: #15231d;
    --ink: #edf4ef;
    --muted: #a8b4ad;
    --line: #2d4037;
    --line-strong: #465b50;
    --accent: #73c9a8;
    --accent-dark: #58b894;
    --accent-soft: #19382d;
    --gold: #e5bb63;
    --gold-soft: #3a301d;
    --danger: #ee8e8e;
    --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
    color-scheme: dark;
    background:
        radial-gradient(circle at 9% 4%, rgba(218, 177, 92, 0.11), transparent 25rem),
        radial-gradient(circle at 92% 18%, rgba(69, 177, 137, 0.15), transparent 28rem),
        var(--paper);
}

.vote-body.theme-dark::before {
    background-image:
        linear-gradient(rgba(191, 216, 203, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(191, 216, 203, 0.035) 1px, transparent 1px);
}

.vote-body.theme-dark .vote-panel,
.vote-body.theme-dark .final-panel {
    border-color: rgba(164, 197, 181, 0.16);
    background: rgba(20, 34, 28, 0.92);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.32);
}

.vote-body.theme-dark .vote-header {
    border-color: rgba(164, 197, 181, 0.18);
}

.vote-body.theme-dark .brand-mark,
.vote-body.theme-dark .button-primary,
.vote-body.theme-dark .step.complete span,
.vote-body.theme-dark .rating-confirmation-mark {
    color: #102019;
}

.vote-body.theme-dark .image-stage {
    background:
        linear-gradient(45deg, #1a2822 25%, transparent 25%),
        linear-gradient(-45deg, #1a2822 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a2822 75%),
        linear-gradient(-45deg, transparent 75%, #1a2822 75%),
        #111b17;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.vote-body.theme-dark .image-stage::after {
    background: radial-gradient(circle, transparent 38%, rgba(0, 0, 0, 0.13));
}

.vote-body.theme-dark .star-button {
    border-color: #30443a;
    background: #17251f;
    color: #687970;
}

.vote-body.theme-dark .star-button:hover,
.vote-body.theme-dark .star-button.selected {
    border-color: #9f844b;
    background: var(--gold-soft);
    color: var(--gold);
}

.vote-body.theme-dark .rating-confirmation {
    border-color: rgba(115, 201, 168, 0.24);
    background: #183329;
}

.vote-body.theme-dark .finish-form,
.vote-body.theme-dark .gallery-image {
    background: #111c17;
}

.vote-body.theme-dark .button-secondary {
    background: #17251f;
}

.vote-body.theme-dark .preview-mode-note {
    border-color: #6e5b31;
    background: #342b19;
    color: #edca79;
}

.vote-body.theme-dark .preview-mode-note span {
    color: #cdb679;
}

.vote-body.theme-dark .gallery-card:hover {
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.vote-body.theme-dark .thank-you {
    color: var(--accent);
}

@media (max-width: 900px) {
    .project-grid,
    .admin-welcome {
        grid-template-columns: 1fr;
    }

    .admin-layout {
        display: block;
    }

    .admin-sidebar {
        position: fixed;
        z-index: 30;
        top: 0;
        bottom: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        box-shadow: 20px 0 50px rgba(30, 40, 33, 0.16);
        transform: translateX(-105%);
        transition: transform 200ms ease;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu {
        display: grid;
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
        cursor: pointer;
    }

    .admin-topbar > div {
        margin-right: auto;
    }
}

@media (max-width: 680px) {
    .home-shell,
    .vote-shell {
        width: min(100% - 24px, 1060px);
    }

    .home-shell {
        padding-top: 30px;
    }

    .home-hero {
        padding: 35px 0 50px;
    }

    .home-hero h1 {
        font-size: clamp(2.7rem, 14vw, 4.6rem);
    }

    .project-card {
        min-height: 106px;
        gap: 14px;
        padding: 18px;
    }

    .project-number {
        display: none;
    }

    .vote-shell {
        padding-top: 12px;
    }

    .vote-header {
        grid-template-columns: auto 1fr auto;
        gap: 12px;
        padding-bottom: 13px;
    }

    .brand > span:last-child {
        display: none;
    }

    .project-title {
        min-width: 0;
        justify-items: start;
    }

    .project-title strong {
        width: 100%;
        font-size: 0.85rem;
    }

    .stepper-wrap {
        padding: 14px 0 11px;
    }

    .step {
        flex-basis: 31px;
        min-width: 31px;
        height: 31px;
    }

    .step span {
        width: 23px;
        height: 23px;
    }

    .vote-panel,
    .final-panel {
        border-radius: 20px;
    }

    .image-stage {
        min-height: 300px;
        max-height: 44vh;
        border-radius: 20px 20px 0 0;
    }

    .image-stage img {
        max-height: 44vh;
        padding: 20px;
    }

    .rating-block {
        padding: 21px 18px 8px;
    }

    .rating-heading {
        align-items: center;
        margin-bottom: 16px;
    }

    .rating-heading h1 {
        font-size: 1.45rem;
    }

    .rating-value strong {
        font-size: 2rem;
    }

    .stars {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 7px;
    }

    .star-button {
        min-height: 53px;
    }

    .star-button span {
        font-size: 1.55rem;
    }

    .rating-hint {
        display: none;
    }

    .rating-confirmation {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .rating-confirmation-next {
        grid-column: 2;
        justify-self: start;
    }

    .rating-confirmation {
        min-height: 76px;
        padding: 14px;
    }

    .vote-actions {
        padding: 14px 18px 22px;
    }

    .vote-actions .button {
        min-width: 0;
        padding: 0 16px;
    }

    .final-panel {
        padding: 28px 20px;
    }

    .finish-form {
        margin: 28px 0 42px;
        padding: 17px;
    }

    .finish-row {
        grid-template-columns: 1fr;
    }

    .result-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-image {
        height: 110px;
    }

    .gallery-info {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-main {
        padding: 15px 12px 50px;
    }

    .admin-topbar {
        gap: 12px;
        margin-bottom: 18px;
    }

    .admin-topbar .button {
        width: 42px;
        min-height: 42px;
        overflow: hidden;
        padding: 0;
        font-size: 0;
    }

    .admin-topbar .button span {
        font-size: 1rem;
    }

    .project-toolbar {
        align-items: center;
    }

    .public-link > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .project-toolbar-actions {
        align-items: flex-end;
        flex-direction: column;
        gap: 5px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .metric-grid .metric-variants {
        display: none;
    }

    .metric-grid article {
        min-width: 0;
        padding: 14px 12px;
    }

    .metric-grid span,
    .metric-grid small {
        font-size: 0.62rem;
        line-height: 1.3;
    }

    .metric-grid strong {
        margin-top: 4px;
        font-size: 1.65rem;
    }

    .visibility-settings,
    .theme-settings,
    .visibility-options,
    .reset-statistics {
        grid-template-columns: 1fr;
    }

    .visibility-settings,
    .theme-settings {
        gap: 14px;
    }

    .reset-statistics {
        gap: 18px;
    }

    .maintenance-delete {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-top: 20px;
    }

    .reset-statistics form {
        min-width: 0;
    }

    .admin-section {
        padding: 17px 12px;
    }

    .admin-section-heading {
        align-items: center;
    }

    .admin-section-actions {
        align-items: flex-end;
        flex-direction: column-reverse;
        gap: 7px;
    }

    .admin-section-heading .button {
        min-height: 42px;
        padding: 0 13px;
        font-size: 0.72rem;
    }

    .ranking-card {
        position: relative;
        grid-template-columns: 96px minmax(0, 1fr) 40px;
        grid-template-areas:
            "preview content action"
            "preview score action"
            "votes votes votes";
        column-gap: 12px;
        row-gap: 5px;
        min-height: 110px;
        padding: 12px;
    }

    .ranking-preview-button {
        width: 96px;
        height: 86px;
        grid-area: preview;
    }

    .ranking-preview-button img {
        width: 100%;
        height: 100%;
        padding: 7px;
        border-radius: 10px;
    }

    .rank-number {
        position: absolute;
        z-index: 2;
        top: 7px;
        left: 7px;
        display: grid;
        min-width: 27px;
        height: 23px;
        place-items: center;
        padding: 0 5px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 4px 12px rgba(35, 54, 46, 0.08);
        color: var(--accent);
        font-size: 0.7rem;
        font-weight: 850;
        line-height: 1;
    }

    .rank-content {
        grid-area: content;
        align-self: end;
    }

    .rank-content strong {
        font-size: 0.9rem;
        line-height: 1.25;
    }

    .rank-content span {
        margin-top: 4px;
        font-size: 0.7rem;
    }

    .ranking-card form {
        grid-area: action;
        align-self: center;
        justify-self: end;
    }

    .ranking-card .icon-button {
        width: 38px;
        height: 38px;
    }

    .image-votes {
        width: 100%;
        grid-area: votes;
        margin: 5px 0 -4px;
    }

    .image-voter-list {
        grid-template-columns: 1fr;
    }

    .rank-score {
        display: flex;
        min-width: 0;
        grid-area: score;
        align-self: start;
        align-items: baseline;
        gap: 5px;
        width: max-content;
        margin: 0;
        padding: 5px 8px;
        border: 1px solid rgba(38, 115, 91, 0.14);
        border-radius: 9px;
        background: #edf6f2;
        text-align: left;
    }

    .rank-score strong {
        display: inline;
        font-size: 1.3rem;
        font-variant-numeric: tabular-nums;
        line-height: 1;
    }

    .rank-score span {
        color: var(--accent-dark);
        font-size: 0.68rem;
    }

    .image-preview-dialog {
        width: calc(100% - 16px);
        max-height: calc(100vh - 16px);
    }

    .image-preview-stage {
        min-height: 58vh;
        max-height: calc(100vh - 78px);
        padding: 12px;
    }

    .image-preview-stage img {
        max-height: calc(100vh - 120px);
    }
}

@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;
    }
}
