/* ==========================================================================
   Дослідження сприйняття фотографій — темна тема
   ========================================================================== */

:root {
    --bg: #0b0c0e;
    --bg-2: #111317;
    --surface: #16181d;
    --surface-2: #1c1f25;
    --line: #2a2e36;
    --line-soft: #20232a;
    --text: #ece8e1;
    --text-2: #b9b4ab;
    --muted: #7d7a74;
    --accent: #f2b84b;
    --accent-2: #ffd27a;
    --accent-ink: #1a1408;
    --accent-soft: rgba(242, 184, 75, .12);
    --danger: #ff7a6b;
    --danger-soft: rgba(255, 122, 107, .12);
    --ok: #7fd6a4;
    --ok-soft: rgba(127, 214, 164, .12);

    --font-display: "Lora", Georgia, "Times New Roman", serif;
    --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; /* службові підписи й цифри */

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, .7);
    --header-h: 0px;
    --footer-h: 0px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* тонке «плівкове» зерно + м'яке світло зверху */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1200px 600px at 15% -10%, rgba(242, 184, 75, .07), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(120, 140, 255, .05), transparent 60%);
}
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: .05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body > * { position: relative; z-index: 1; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }

img { max-width: 100%; display: block; }
b, strong { font-weight: 600; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }

.eyebrow {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
}
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

main { flex: 1; }

/* ---------- Кнопки ---------- */
.btn {
    --b: var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    padding: .8em 1.4em;
    border-radius: 999px;
    border: 1px solid var(--b);
    background: var(--surface);
    color: var(--text);
    font: 600 1rem/1.2 var(--font-body);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    box-shadow: 0 10px 30px -10px rgba(242, 184, 75, .55);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-lg { padding: 1em 2em; font-size: 1.05rem; }
.btn-sm { padding: .45em .9em; font-size: .85rem; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(255, 122, 107, .35); background: transparent; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* ---------- Картки / форми ---------- */
.card {
    background: linear-gradient(180deg, var(--surface), var(--bg-2));
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.alert {
    display: block;
    align-items: flex-start;
    gap: 12px;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin: 0 0 20px;
    border: 1px solid;
    font-size: .95rem;
    line-height: 1.5;
}
.alert:has(> .alert-icon) { display: flex; }
.alert-icon {
    flex: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 700; font-size: .85rem;
    background: currentColor;
}
.alert-icon { color: inherit; }
.alert-error .alert-icon { background: var(--danger); color: #2a0d09; }
.alert-ok .alert-icon { background: var(--ok); color: #0b2416; }
.alert-warn .alert-icon { background: var(--accent); color: var(--accent-ink); }
.alert-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.alert-body b { font-weight: 600; color: var(--text); }
.alert-body ul { margin: 4px 0 0; padding-left: 1.1em; }
.alert-close {
    flex: none; border: 0; background: transparent; color: inherit; opacity: .7;
    font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 2px;
}
.alert-close:hover { opacity: 1; }
.alert-error { background: var(--danger-soft); border-color: rgba(255, 122, 107, .35); color: #ffc2ba; }
.alert-ok { background: var(--ok-soft); border-color: rgba(127, 214, 164, .35); color: #c4f0d6; }
.alert-warn { background: var(--accent-soft); border-color: rgba(242, 184, 75, .35); color: #ffe2a8; }

.field-error { color: var(--danger); font-size: .875rem; margin-top: 8px; display: flex; gap: 6px; align-items: baseline; }
.field-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #2a0d09; font-size: .7rem; font-weight: 700; transform: translateY(2px); }
.has-error { position: relative; }
.answer-block.has-error { padding-left: 16px; border-left: 3px solid var(--danger); }
.answer-block.has-error .answer-title, .q-card.has-error .answer-title { color: #ffd2cc; }
.q-card.has-error { border-color: rgba(255, 122, 107, .55); box-shadow: 0 0 0 1px rgba(255, 122, 107, .25), var(--shadow); }
.has-error textarea, .has-error select { border-color: rgba(255, 122, 107, .6); }

label { cursor: pointer; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], textarea, select {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font: 400 1rem/1.5 var(--font-body);
    transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 110px; resize: vertical; }
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    padding-right: 40px;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
::placeholder { color: var(--muted); }

.form-row { margin-bottom: 18px; }
.form-row > label, .form-label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .95rem; }
.form-hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Вибір-«пігулки» (radio / checkbox) */
.options { display: grid; gap: 10px; }
.options-inline { display: flex; flex-wrap: wrap; gap: 8px; }

.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg-2);
    transition: border-color .15s, background .15s, color .15s;
    line-height: 1.35;
}
.opt span::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--muted);
    border-radius: 50%;
    transition: all .15s;
}
.opt input[type=checkbox] + span::before { border-radius: 5px; }
.opt:hover span { border-color: var(--muted); }
.opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.opt input:checked + span::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--bg-2);
}
.opt input[type=checkbox]:checked + span::before {
    box-shadow: none;
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231a1408' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.opt-exclusive span { border-style: dashed; }

.options-inline .opt span { padding: 9px 14px; border-radius: 999px; }
.options-inline .opt span::before { width: 14px; height: 14px; }

/* Шкала впевненості */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; }
.scale .opt span {
    justify-content: center;
    padding: 12px 0;
    font-family: var(--font-mono);
    font-weight: 600;
    border-radius: 10px;
}
.scale .opt span::before { display: none; }
.scale-legend { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; color: var(--muted); font-size: .8rem; }
.scale-legend span:last-child { text-align: right; }

/* ---------- Футер ---------- */
.site-footer {
    border-top: 1px solid var(--line-soft);
    margin-top: 64px;
    padding: 36px 0 calc(36px + var(--footer-h));
    background: rgba(11, 12, 14, .6);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; }
.footer-text { color: var(--muted); font-size: .85rem; max-width: 460px; }
.footer-text { display: grid; gap: 2px; }
.footer-label { color: var(--text-2); font-family: var(--font-display); font-size: 1rem; }
.partners { display: flex; align-items: center; justify-content: center; gap: 20px 32px; flex-wrap: wrap; }
.partner { display: flex; align-items: center; gap: 10px; color: var(--text-2); text-decoration: none; opacity: .85; transition: opacity .2s; }
.partner:hover { opacity: 1; color: var(--text); }
.partner img { height: 48px; width: auto; max-width: 100%; display: block; }
.partner-mark {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-height: 48px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .78rem;
    line-height: 1.25;
    max-width: 240px;
}
.partner-mark b { font-family: var(--font-display); font-size: .95rem; color: var(--text); font-weight: 600; }
.partner-sep { width: 1px; height: 36px; background: var(--line); }

/* ==========================================================================
   Перший екран
   ========================================================================== */
.hero { padding: 72px 0 24px; }
/* На великих екранах — перший екран по центру висоти вікна (без порожнечі під блоками) */
@media (min-width: 861px) and (min-height: 640px) {
    .hero { min-height: calc(100vh - 126px); min-height: calc(100svh - 126px); display: flex; align-items: center; padding: 48px 0; }
    .hero > .container { width: 100%; }
    main:has(> .hero) + .site-footer { margin-top: 0; }
}
.hero h1 { max-width: 14ch; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-lead { font-size: 1.15rem; color: var(--text-2); max-width: 62ch; }
.hero-lead a { color: var(--text); text-decoration-color: var(--accent); }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero-grid h1 { margin-bottom: 28px; }

.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.facts li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); }
.facts .ic {
    flex: none;
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: .8rem;
}

.consent-card { display: grid; gap: 22px; }
.consent-card h2 { font-size: 1.35rem; margin: 0; }
.consent-action { display: grid; gap: 14px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.consent-action form { display: grid; gap: 14px; }
.consent-action .alert { margin: 0; }
.consent-note { margin: 0; color: var(--text-2); }
.consent-hint { margin: 0; color: var(--muted); font-size: .85rem; text-align: center; }
.nowrap { white-space: nowrap; }
.consent-note b { color: var(--text); }
.consent-card .opt span { align-items: flex-start; }
.consent-card .opt span::before { margin-top: 2px; }
.consent-card .btn { width: 100%; }

.frame-strip { display: flex; gap: 6px; margin-top: 40px; opacity: .55; }
.frame-strip i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.frame-strip i:nth-child(3n) { background: var(--accent); opacity: .5; }

/* ==========================================================================
   Сторінка тесту
   ========================================================================== */
.qbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(11, 12, 14, .88);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--line-soft);
}
.qbar-inner { padding: 14px 20px 16px; }
.qbar-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 6px; }
.qbar-question {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    line-height: 1.3;
    margin: 0;
    color: var(--text);
}

.progress-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: rgba(11, 12, 14, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-soft);
}
.progress-inner { display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
.progress-track { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; transition: width .4s ease; }
.progress-label { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--text-2); white-space: nowrap; }
.progress-dots { display: flex; gap: 4px; }
.progress-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.progress-dots i.done { background: var(--accent); }
.progress-dots i.current { background: var(--text); box-shadow: 0 0 0 3px rgba(236, 232, 225, .15); }

.survey-main { padding: 32px 0 0; }
.container-wide { max-width: 1280px; }
.survey-layout { display: grid; gap: 24px; }
.survey-photo { margin: 0; min-width: 0; }
@media (min-width: 1100px) {
    .survey-layout { grid-template-columns: minmax(0, 1.45fr) minmax(380px, 1fr); gap: 32px; align-items: start; }
    .survey-photo { position: sticky; top: calc(var(--header-h) + 24px); }
    .survey-photo .photo-stage img { max-height: calc(100vh - var(--header-h) - var(--footer-h) - 140px); }
    .survey-layout .answer-card { margin-top: 0; }
}

.photo-stage {
    background: #050506;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    overflow: hidden;
    display: grid;
    place-items: center;
    position: relative;
}
.photo-stage img {
    /* width/height auto + max-* зберігають пропорції фото за будь-якої ширини колонки */
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: min(72vh, 900px);
    margin: 0 auto;
    cursor: zoom-in;
}
.photo-zoom {
    position: absolute;
    right: 12px; bottom: 12px;
    padding: 6px 10px;
    font-size: .75rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, .6);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
}

.provenance {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 4px 0;
}
.provenance-text { flex: 1; color: var(--text-2); font-size: .95rem; }
.provenance-text .credit { color: var(--text); font-weight: 600; }
.provenance-text .caption { margin: 4px 0 0; font-style: italic; }

.info-btn {
    position: relative;
    flex: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--accent);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: border-color .2s, background .2s;
}
.info-btn:hover, .info-btn:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.info-btn::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: 240px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--text);
    color: var(--bg);
    font: 500 .8rem/1.3 var(--font-body);
    opacity: 0;
    transform: translateY(4px);
    pointer-events: none;
    transition: opacity .15s, transform .15s;
}
@media (hover: hover) {
    .info-btn:hover::after, .info-btn:focus-visible::after { opacity: 1; transform: none; }
}

.answer-card { margin-top: 0; }
.answer-block + .answer-block { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line-soft); }
.answer-title { font-weight: 700; margin: 0 0 12px; font-size: 1rem; }
.answer-title small { font-weight: 500; color: var(--muted); }
.answer-actions { display: flex; justify-content: flex-end; margin-top: 26px; }

/* Діалоги */
dialog {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 18px;
    padding: 0;
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 40px);
    box-shadow: 0 40px 120px -20px rgba(0, 0, 0, .9);
}
dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 0; }
.dialog-head h3 { margin: 0; }
.dialog-body { padding: 16px 22px 22px; }
.dialog-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-2);
    font-size: 1.2rem;
    cursor: pointer;
}
.dialog-close:hover { color: var(--text); border-color: var(--muted); }

.meta { margin: 0; display: grid; gap: 0; }
.meta div { display: grid; grid-template-columns: 170px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.meta dt { color: var(--muted); font-size: .85rem; }
.meta dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.meta .empty { color: var(--muted); font-style: italic; }
.meta-level2 { margin-top: 18px; }
.level2-btn { width: 100%; }
.prov-note { margin: 0 0 14px; white-space: pre-line; color: var(--text); line-height: 1.6; }
.prov-note.empty, .meta-empty { color: var(--muted); font-style: italic; }
.meta-empty { margin: 6px 0 0; }
.exif-summary { margin-bottom: 8px; }
.meta-level2[hidden] { display: none; }
.meta-level2 h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 4px; }

/* Перегляд фото на весь екран */
dialog.lightbox {
    width: 100vw; height: 100vh; height: 100dvh;
    max-width: 100vw; max-height: 100vh; max-height: 100dvh;
    margin: 0; padding: 0;
    border: 0; border-radius: 0;
    background: rgba(5, 5, 6, .96);
    box-shadow: none;
    overflow: hidden;
}
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.lightbox-figure {
    margin: 0;
    width: 100%; height: 100%;
    padding: max(56px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(48px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out;
}
.lightbox-figure img {
    /* вписуємо в екран із збереженням пропорцій; невеликі фото збільшуються */
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 4px;
}
.lightbox .dialog-close {
    position: absolute;
    top: max(14px, env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px));
    width: 44px; height: 44px;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    z-index: 2;
}
.lightbox .dialog-close:hover { background: rgba(255, 255, 255, .16); }
.lightbox-hint {
    position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom, 0px));
    text-align: center; color: rgba(255, 255, 255, .55); font-size: .82rem; pointer-events: none;
}
@media (hover: none) { .hint-desktop { display: none; } }

/* ==========================================================================
   Опитувальник
   ========================================================================== */
.q-section { margin-top: 40px; }
.q-section:first-of-type { margin-top: 8px; }
.q-section > .eyebrow { display: block; margin-bottom: 12px; }
.q-card { margin-bottom: 16px; }
.q-card .answer-title { font-size: 1.02rem; }
.q-num { font-family: var(--font-mono); color: var(--accent); margin-right: 8px; font-weight: 500; }
.q-follow { margin-top: 12px; }
.q-follow[hidden] { display: none; }
.matrix { display: grid; gap: 14px; }
.matrix-row { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 12px; }

/* ==========================================================================
   Завершення / джерела
   ========================================================================== */
.done-hero { padding: 72px 0 12px; text-align: center; }
.done-hero .check {
    width: 72px; height: 72px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border: 1px solid rgba(242, 184, 75, .4);
    color: var(--accent);
    font-size: 2rem;
}
.reveal { max-width: 640px; margin: 0 auto; color: var(--text-2); font-size: 1.08rem; text-wrap: pretty; }
.reveal + .reveal { margin-top: 16px; }
.reveal-note { color: var(--text); font-weight: 600; }
.reveal-rights {
    display: inline-block;
    padding: 10px 18px;
    border: 1px solid rgba(242, 184, 75, .35);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: .98rem;
    font-weight: 500;
}

.sources-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.source-item { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.source-item .thumb { aspect-ratio: 4/3; background: #050506; overflow: hidden; position: relative; }
.source-item .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.source-item .body { padding: 12px 14px 14px; font-size: .88rem; display: grid; gap: 4px; }
.source-item .body b { font-size: .95rem; }
.source-item a { overflow-wrap: anywhere; }

/* ==========================================================================
   Адмінка
   ========================================================================== */
.admin-nav {
    position: sticky; top: 0; z-index: 40;
    background: rgba(11, 12, 14, .9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line-soft);
}
.admin-nav .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.admin-nav .container, .admin-main .container, .admin-page .site-footer .container { max-width: 1240px; }
.admin-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.admin-brand { font-family: var(--font-display); font-size: 1.15rem; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; }
.admin-brand span { color: var(--accent); }
.admin-links { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.admin-links::-webkit-scrollbar { display: none; }
.admin-links a { color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: .92rem; font-weight: 600; white-space: nowrap; }
.admin-links a:hover { color: var(--text); background: var(--surface); }
.admin-links a.active { color: var(--accent-ink); background: var(--accent); }
.admin-main { padding: 36px 0 56px; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-head h1 { font-size: 2rem; margin: 0; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; }
.kpi .v { font-family: var(--font-display); font-size: 2.3rem; line-height: 1; margin-top: 8px; }
.kpi .s { color: var(--muted); font-size: .82rem; margin-top: 6px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr:hover td { background: rgba(255, 255, 255, .015); }
.table td.q-text { min-width: 260px; max-width: 420px; line-height: 1.4; }
.table .thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; flex: none; }
.thumb-cell { display: flex; align-items: center; gap: 10px; }

.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; min-width: 80px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; border: 1px solid var(--line); color: var(--text-2); }
.badge-ok { color: var(--ok); border-color: rgba(127, 214, 164, .35); background: var(--ok-soft); }
.badge-warn { color: var(--accent); border-color: rgba(242, 184, 75, .35); background: var(--accent-soft); }
.badge-muted { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.section { margin-top: 26px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-title h2 { font-size: 1.35rem; margin: 0; }

.photo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.photo-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.photo-card .thumb { aspect-ratio: 4/3; background: #050506; position: relative; overflow: hidden; flex: none; }
.photo-card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-card .body { padding: 14px 16px; flex: 1; display: grid; gap: 4px; align-content: start; font-size: .9rem; }
.photo-card .actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.photo-card.inactive .thumb img { opacity: .35; filter: grayscale(1); }

.fieldset { border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 20px; margin: 0 0 18px; }
.fieldset legend { padding: 0 8px; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.exif-box { display: grid; gap: 10px; margin-top: 14px; justify-items: start; }
.exif-box details { width: 100%; }
.exif-box summary { cursor: pointer; color: var(--text-2); font-size: .9rem; }
.exif-raw { margin-top: 8px; max-height: 320px; overflow: auto; font-size: .85rem; }
.exif-raw div { grid-template-columns: 220px 1fr; padding: 6px 0; }
.upload-preview { max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin-bottom: 10px; }

.switch { display: flex; align-items: center; gap: 12px; }
.switch input { margin: 0; width: 44px; height: 24px; appearance: none; background: var(--line); border-radius: 999px; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); background: var(--accent-ink); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--text-2); font-size: .88rem; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.login-wrap { min-height: 80vh; display: grid; place-items: center; padding: 40px 20px; }
.login-card { width: 100%; max-width: 420px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 860px) {
    .admin-nav .container { flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; }
    .admin-brand { flex: 1; font-size: 1.05rem; }
    .admin-actions .btn-label { display: none; }
    .admin-links { order: 3; flex-basis: 100%; margin: 0 -4px; }
    .admin-head h1 { font-size: 1.7rem; }
    .hero { padding-top: 40px; }
    .hero-grid { grid-template-columns: 1fr; gap: 28px; }
    .kpis { grid-template-columns: repeat(2, 1fr); }
    .grid-2, .form-grid { grid-template-columns: 1fr; }
    .matrix-row { grid-template-columns: 1fr; gap: 6px; }
    .progress-dots { display: none; }
}

@media (max-width: 560px) {
    .container { padding: 0 16px; }
    .card { padding: 18px; }
    .meta div { grid-template-columns: 1fr; gap: 2px; }
    .answer-actions .btn { width: 100%; }
    .qbar-inner { padding: 10px 16px 12px; }
    .qbar-top .eyebrow:first-child { display: none; }
    .qbar-top { justify-content: flex-end; margin-bottom: 2px; }
    .partner-sep { display: none; }
    .photo-stage img { max-height: 60vh; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}

/* Посилання на джерело на сторінці подяки — не більше двох рядків */
.source-link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
}
