:root {
    --font-ui: "Manrope", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Space Grotesk", "Manrope", "Segoe UI Variable Display", "Segoe UI", sans-serif;
    --bg: #f6efe7;
    --bg-2: #fffaf5;
    --surface: rgba(255, 255, 255, .88);
    --surface-strong: #ffffff;
    --surface-soft: #fff7ed;
    --surface-warm: #fffaf3;
    --text: #15131a;
    --heading: #111016;
    --muted: #6d6f7a;
    --muted-strong: #4b5563;
    --line: #eadfd4;
    --line-strong: #d9c7b7;
    --orange-50: #fff7ed;
    --orange-100: #ffedd5;
    --orange-200: #fed7aa;
    --orange-300: #fdba74;
    --orange-500: #f97316;
    --orange-600: #ea580c;
    --orange-700: #c2410c;
    --orange-800: #9a3412;
    --orange-900: #7c2d12;
    --primary: var(--orange-500);
    --primary-dark: var(--orange-800);
    --primary-ring: rgba(249, 115, 22, .22);
    --danger: #b42318;
    --danger-dark: #7a271a;
    --danger-bg: #fef3f2;
    --success: #027a48;
    --success-bg: #ecfdf3;
    --success-line: #abefc6;
    --info-bg: #eff8ff;
    --info-text: #175cd3;
    --info-line: #b2ddff;
    --shadow-xs: 0 1px 2px rgba(45, 31, 18, .06);
    --shadow-sm: 0 8px 22px rgba(45, 31, 18, .07);
    --shadow-md: 0 18px 45px rgba(45, 31, 18, .10);
    --shadow-lg: 0 28px 80px rgba(45, 31, 18, .13);
    --radius: 26px;
    --radius-md: 18px;
    --radius-sm: 13px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-ui);
    color: var(--text);
    background:
        radial-gradient(circle at 7% -7%, rgba(249, 115, 22, .26), transparent 34rem),
        radial-gradient(circle at 96% 2%, rgba(255, 210, 120, .24), transparent 31rem),
        radial-gradient(circle at 74% 88%, rgba(234, 88, 12, .10), transparent 28rem),
        linear-gradient(180deg, #fffaf4 0%, var(--bg) 43%, #f8fafc 100%);
    line-height: 1.57;
    font-weight: 400;
    font-feature-settings: "liga" 1, "calt" 1, "kern" 1;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(124, 45, 18, .075) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 72%);
}
body::after {
    content: "";
    position: fixed;
    inset: auto -8rem -18rem auto;
    width: 34rem;
    height: 34rem;
    z-index: 0;
    pointer-events: none;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(249, 115, 22, .13), transparent 68%);
    filter: blur(8px);
}

::selection { background: rgba(249, 115, 22, .22); color: var(--orange-900); }
a { color: var(--orange-800); text-decoration: none; transition: color .16s var(--ease), background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease), transform .16s var(--ease); }
a:hover, a:focus-visible { color: var(--orange-900); text-decoration: none; }
a:not([class]):hover, a:not([class]):focus-visible { background: var(--orange-50); border-radius: 7px; box-shadow: 0 0 0 4px var(--orange-50); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid rgba(249, 115, 22, .34); outline-offset: 3px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    padding: 16px clamp(16px, 3vw, 38px);
    background: rgba(255, 255, 255, .74);
    border-bottom: 1px solid rgba(234, 223, 212, .78);
    backdrop-filter: blur(20px) saturate(1.14);
    position: sticky;
    top: 0;
    z-index: 20;
    transition: background .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
body.is-scrolled .topbar {
    background: rgba(255, 255, 255, .92);
    border-bottom-color: rgba(217, 199, 183, .92);
    box-shadow: 0 12px 34px rgba(45, 31, 18, .08);
}
.topbar-public { justify-content: center; }
.brand a, .brand > span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--heading);
    letter-spacing: -.035em;
}
.brand a:hover, .brand a:focus-visible { color: var(--heading); transform: translateY(-1px); }
.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 15px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -.04em;
    background:
        linear-gradient(135deg, rgba(255,255,255,.26), transparent 36%),
        linear-gradient(135deg, #fb923c 0%, #f97316 48%, #c2410c 100%);
    box-shadow: 0 14px 28px rgba(249, 115, 22, .30), inset 0 1px 0 rgba(255,255,255,.35);
}
.nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.nav a {
    color: #4b5563;
    padding: 9px 13px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    border: 1px solid transparent;
}
.nav a:hover, .nav a:focus-visible, .nav a.nav-active {
    color: var(--orange-900);
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    border-color: rgba(253, 186, 116, .82);
    box-shadow: 0 8px 18px rgba(249, 115, 22, .10);
}
.nav a.nav-active { box-shadow: inset 0 0 0 1px rgba(249, 115, 22, .16), 0 8px 18px rgba(249, 115, 22, .09); }

.container { width: min(1180px, calc(100% - 32px)); margin: 34px auto 78px; position: relative; z-index: 1; }
.public-page .container { width: min(900px, calc(100% - 28px)); }
.auth-page .container { width: min(680px, calc(100% - 28px)); }

.panel, .auth-card, .install-card {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(234, 223, 212, .92);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: clamp(22px, 3vw, 36px);
    margin-bottom: 24px;
    backdrop-filter: blur(18px) saturate(1.08);
}
.panel::before, .auth-card::before, .install-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, .68);
    mask-image: linear-gradient(180deg, #000, transparent 72%);
}
.narrow { max-width: 880px; }
.auth-card, .install-card { max-width: 660px; margin: 50px auto; }
.install-card { max-width: 830px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.07; margin: 0 0 12px; color: var(--heading); letter-spacing: -.035em; }
strong, b { font-weight: 800; }
h1 { font-size: clamp(32px, 4.1vw, 54px); }
h2 { font-size: clamp(23px, 2.15vw, 30px); }
h3 { font-size: 20px; }
p { margin-top: 0; }
small { color: var(--muted); }
.muted, .hint { color: var(--muted); }
.hint { display: block; font-size: 13px; margin-top: 7px; font-weight: 600; }
.lead { font-size: clamp(17px, 2vw, 20px); color: #373741; max-width: 70ch; font-weight: 500; letter-spacing: -.012em; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 13px;
    color: var(--orange-800);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .13em;
}
.eyebrow::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--orange-500);
    box-shadow: 0 0 0 6px rgba(249, 115, 22, .13);
}

.stack { display: grid; gap: 18px; }
fieldset {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 21px;
    margin: 0;
    background: rgba(255, 255, 255, .72);
    box-shadow: var(--shadow-xs);
}
.soft-fieldset { background: linear-gradient(180deg, #fff, #fff7ed); }
legend { font-weight: 800; padding: 0 10px; color: var(--heading); }
label { display: grid; gap: 8px; font-weight: 700; color: #25252d; letter-spacing: -.01em; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="datetime-local"], textarea, select {
    width: 100%;
    border: 1px solid #d8c9ba;
    border-radius: 15px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .98);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.92), var(--shadow-xs);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
}
textarea { resize: vertical; min-height: 112px; }
input:hover, textarea:hover, select:hover { border-color: #cdb8a6; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--orange-500);
    box-shadow: 0 0 0 4px var(--primary-ring), 0 12px 25px rgba(249, 115, 22, .07);
    background: #fff;
}
input[type="radio"], input[type="checkbox"] { accent-color: var(--orange-500); }
.input-with-prefix {
    display: grid;
    grid-template-columns: minmax(0, auto) 1fr;
    align-items: center;
    border: 1px solid #d8c9ba;
    border-radius: 15px;
    background: #fff;
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.input-with-prefix > span {
    height: 100%;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted-strong);
    background: #fbf4ec;
    border-right: 1px solid var(--line);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 700;
}
.input-with-prefix input { border: 0; border-radius: 0; box-shadow: none; }
.input-with-prefix:focus-within { border-color: var(--orange-500); box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-sm); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.actions, .table-actions, .question-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.button, button.button, .small-button {
    font-family: var(--font-ui);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #fff, #fffaf5);
    color: var(--text);
    border-radius: 15px;
    padding: 10px 15px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.1;
    box-shadow: var(--shadow-xs);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease), filter .18s var(--ease);
}
.button:hover, button.button:hover, .button:focus-visible, .small-button:hover, .small-button:focus-visible {
    text-decoration: none;
    border-color: var(--orange-300);
    background: linear-gradient(180deg, #fffaf5, #ffedd5);
    color: var(--orange-900);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.button-primary, a.button-primary, button.button-primary {
    background: linear-gradient(135deg, #fb923c 0%, #f97316 52%, #c2410c 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 16px 34px rgba(249, 115, 22, .30), inset 0 1px 0 rgba(255,255,255,.28);
}
.button-primary:hover, .button-primary:focus-visible, a.button-primary:hover, a.button-primary:focus-visible, button.button-primary:hover, button.button-primary:focus-visible {
    background: linear-gradient(135deg, #fdba74 0%, #f97316 45%, #9a3412 100%);
    color: #fff;
    border-color: transparent;
    filter: saturate(1.04);
    box-shadow: 0 20px 42px rgba(249, 115, 22, .34), inset 0 1px 0 rgba(255,255,255,.28);
}
.button-soft, a.button-soft, button.button-soft {
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    color: var(--orange-900);
    border-color: var(--orange-200);
}
.button-soft:hover, .button-soft:focus-visible, a.button-soft:hover, a.button-soft:focus-visible, button.button-soft:hover, button.button-soft:focus-visible {
    background: linear-gradient(180deg, #ffedd5, #fed7aa);
    color: var(--orange-900);
    border-color: var(--orange-300);
}
.button-compact { min-height: 36px; padding: 8px 12px; font-size: 13px; }
.button-large { width: 100%; min-height: 56px; font-size: 16px; border-radius: 17px; }
.small-button { min-height: 34px; padding: 8px 11px; font-size: 13px; border-radius: 12px; }
.danger { color: var(--danger) !important; }
.button.danger:hover, .small-button.danger:hover, .link-button.danger:hover {
    background: #fee4e2 !important;
    border-color: #fecdca !important;
    color: var(--danger-dark) !important;
}
.inline-form { display: inline; margin: 0; }
.link-button {
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--orange-800);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 6px 9px;
    line-height: 1.15;
    transition: background .16s var(--ease), color .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease);
}
.link-button:hover, .link-button:focus-visible {
    background: var(--orange-100);
    color: var(--orange-900);
    border-color: var(--orange-200);
    transform: translateY(-1px);
}
.table-actions a, .table-actions .link-button {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 7px 10px;
    border-radius: 11px;
    background: var(--orange-50);
    color: var(--orange-800);
    border: 1px solid rgba(254, 215, 170, .85);
    font-weight: 800;
    font-size: 13px;
}
.table-actions a:hover, .table-actions a:focus-visible, .table-actions .link-button:hover, .table-actions .link-button:focus-visible {
    background: var(--orange-100);
    color: var(--orange-900);
    border-color: var(--orange-300);
    box-shadow: 0 8px 18px rgba(249, 115, 22, .10);
}
.table-actions .danger { background: var(--danger-bg); border-color: #fecdca; color: var(--danger) !important; }
.table-actions .danger:hover, .table-actions .danger:focus-visible { background: #fee4e2 !important; color: var(--danger-dark) !important; border-color: #fda29b !important; }

.alert {
    padding: 15px 16px;
    border-radius: 17px;
    margin-bottom: 18px;
    border: 1px solid transparent;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}
.alert ul { margin-bottom: 0; }
.alert-success { background: var(--success-bg); color: var(--success); border-color: var(--success-line); }
.alert-error { background: var(--danger-bg); color: var(--danger); border-color: #fecdca; }
.alert-info { background: var(--info-bg); color: var(--info-text); border-color: var(--info-line); }

.hero, .section-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.hero.panel {
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(255, 247, 237, .92)),
        radial-gradient(circle at 100% 0%, rgba(249, 115, 22, .20), transparent 21rem);
}
.hero.panel::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: -70px;
    width: 220px;
    height: 220px;
    border-radius: 56px;
    background: linear-gradient(135deg, rgba(249, 115, 22, .13), rgba(255,255,255,.05));
    transform: rotate(14deg);
}
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.card {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    background:
        linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,250,245,.96)),
        radial-gradient(circle at 100% 0%, rgba(249, 115, 22, .14), transparent 10rem);
    border: 1px solid rgba(234, 223, 212, .95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(253, 186, 116, .70); }
.card::after {
    content: "";
    position: absolute;
    width: 132px;
    height: 132px;
    right: -54px;
    top: -50px;
    border-radius: 999px;
    background: rgba(249, 115, 22, .13);
}
.card span { color: var(--muted); display: block; font-weight: 800; }
.card strong { font-size: clamp(38px, 4vw, 54px); line-height: 1; display: block; margin-top: 12px; color: var(--heading); letter-spacing: -.07em; }

.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px;
}
th, td { text-align: left; padding: 14px 13px; vertical-align: middle; }
th {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .085em;
    font-weight: 800;
    padding-bottom: 7px;
}
tbody tr { transition: transform .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease); }
tbody td {
    background: rgba(255, 255, 255, .82);
    border-top: 1px solid rgba(234, 223, 212, .92);
    border-bottom: 1px solid rgba(234, 223, 212, .92);
}
tbody td:first-child { border-left: 1px solid rgba(234, 223, 212, .92); border-top-left-radius: 16px; border-bottom-left-radius: 16px; }
tbody td:last-child { border-right: 1px solid rgba(234, 223, 212, .92); border-top-right-radius: 16px; border-bottom-right-radius: 16px; }
tbody tr:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(45, 31, 18, .07); }
tbody tr:hover td { background: #fffaf5; border-color: rgba(253, 186, 116, .65); }
code {
    display: inline-block;
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    background: var(--orange-50);
    border: 1px solid var(--orange-200);
    color: var(--orange-900);
    border-radius: 11px;
    padding: 5px 8px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    padding: 5px 11px;
    font-size: 13px;
    font-weight: 800;
    border: 1px solid transparent;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; box-shadow: 0 0 0 3px rgba(255,255,255,.7); }
.badge-active { background: #ecfdf3; color: #027a48; border-color: #abefc6; }
.badge-draft { background: #f2f4f7; color: #344054; border-color: #d0d5dd; }
.badge-closed { background: #fff1f3; color: #c01048; border-color: #fecdd6; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: #fff;
    cursor: pointer;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease), background .18s var(--ease);
}
.mode-card:hover { border-color: var(--orange-300); background: #fffaf5; transform: translateY(-1px); }
.mode-card strong { display: block; margin-bottom: 3px; color: var(--heading); }
.mode-card small { display: block; color: var(--muted); font-weight: 600; }
.mode-card:has(input:checked) { border-color: var(--orange-500); background: var(--orange-50); box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-sm); transform: translateY(-1px); }

.question-list { display: grid; gap: 12px; }
.question-card {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--line);
    border-radius: 21px;
    padding: 18px;
    background: linear-gradient(180deg, #fff, #fffaf5);
    box-shadow: var(--shadow-xs);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.question-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: rgba(253,186,116,.70); }
.question-card p { margin-bottom: 5px; }
.question-actions form { margin: 0; }
.required { color: var(--danger); font-weight: 800; }

.survey-form { overflow: hidden; padding: 0; }
.survey-form > *:not(.survey-hero) { margin-left: clamp(22px, 3vw, 36px); margin-right: clamp(22px, 3vw, 36px); }
.survey-form > .survey-stack, .survey-form > form { margin-bottom: clamp(22px, 3vw, 36px); }
.survey-hero {
    padding: clamp(30px, 4.2vw, 48px);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .78), rgba(255, 247, 237, .98)),
        radial-gradient(circle at 90% 8%, rgba(249, 115, 22, .22), transparent 19rem);
    border-bottom: 1px solid var(--line);
}
.survey-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.survey-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 33px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: #52525b;
    font-weight: 800;
    font-size: 13px;
    box-shadow: var(--shadow-xs);
}
.privacy-note {
    background: linear-gradient(180deg, #fff7ed, #ffedd5);
    border: 1px solid var(--orange-200);
    color: var(--orange-900);
    border-radius: 17px;
    padding: 14px 16px;
    font-weight: 700;
    box-shadow: var(--shadow-xs);
}
.participant-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 19px;
    padding: 18px;
    box-shadow: var(--shadow-xs);
}
.question-block {
    background: #fff;
    border: 1px solid rgba(234, 223, 212, .84);
    border-radius: 23px;
    padding: 23px;
    box-shadow: 0 12px 28px rgba(45, 31, 18, .055);
}
.question-block legend {
    display: grid;
    gap: 8px;
    width: 100%;
    font-size: 18px;
    line-height: 1.25;
}
.question-kicker {
    color: var(--orange-800);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .12em;
}
.choice-list { display: grid; gap: 10px; }
.choice-list.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice, .checkbox-line {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
}
.choice {
    position: relative;
    cursor: pointer;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: #fffdfb;
    transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease), color .18s var(--ease);
}
.choice:hover, .choice:focus-within { border-color: var(--orange-300); background: #fffaf5; transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.choice:has(input:checked) { border-color: var(--orange-500); background: var(--orange-50); box-shadow: 0 0 0 4px var(--primary-ring), var(--shadow-sm); color: var(--orange-900); }
.choice input, .checkbox-line input { width: auto; }
.scale-row { display: flex; flex-wrap: wrap; gap: 10px; }
.scale-choice {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-weight: 800;
    cursor: pointer;
}
.scale-choice input { position: absolute; opacity: 0; pointer-events: none; }
.scale-choice span {
    display: inline-grid;
    place-items: center;
    min-width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.scale-choice:hover span, .scale-choice:focus-within span { transform: translateY(-1px); border-color: var(--orange-300); background: #fffaf5; }
.scale-choice input:checked + span { background: linear-gradient(135deg, #fb923c, #f97316); color: #fff; border-color: var(--orange-500); box-shadow: 0 12px 24px rgba(249, 115, 22, .26); }
.submit-panel {
    display: grid;
    gap: 10px;
    padding: 21px;
    border: 1px dashed var(--orange-200);
    border-radius: 21px;
    background: linear-gradient(180deg, #fffaf5, #fff7ed);
}

.link-box {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    background: #fffaf5;
    border-radius: 19px;
    padding: 17px;
    margin-top: 18px;
    box-shadow: var(--shadow-xs);
}
.link-box > span { color: var(--muted); font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.link-copy-row, .inline-copy { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; max-width: 100%; }
.inline-copy code, .link-copy-row code { max-width: min(540px, 100%); }
.copy-button.copied { background: var(--success-bg) !important; color: var(--success) !important; border-color: var(--success-line) !important; }

.result-bars { display: grid; gap: 13px; margin-top: 18px; }
.result-row { display: grid; grid-template-columns: minmax(150px, 1fr) 3fr minmax(120px, auto); gap: 14px; align-items: center; }
.result-label { font-weight: 700; }
.result-bar { height: 15px; background: #f1e7dd; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(45,31,18,.06); }
.result-bar span { display: block; height: 100%; background: linear-gradient(90deg, #fb923c, #f97316 70%, #ea580c); border-radius: 999px; }
.result-count { color: var(--muted); text-align: right; white-space: nowrap; font-weight: 800; }
.statline { font-size: 18px; padding: 12px 14px; background: var(--orange-50); border: 1px solid var(--orange-200); border-radius: 15px; display: inline-flex; gap: 6px; box-shadow: var(--shadow-xs); }
.text-answers { display: grid; gap: 12px; }
.text-answer {
    background: #fffdfb;
    border: 1px solid var(--line);
    border-radius: 17px;
    padding: 15px;
    box-shadow: var(--shadow-xs);
}
.text-answer p { margin-bottom: 9px; }
.text-answer small { color: var(--muted); }

.empty-state { text-align: center; padding: clamp(36px, 5vw, 62px); }
.empty-state > * { margin-left: auto !important; margin-right: auto !important; }
.success-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    font-size: 36px;
    font-weight: 800;
    border: 1px solid var(--success-line);
    box-shadow: 0 14px 32px rgba(2, 122, 72, .12);
}
.auth-card {
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,247,237,.95)),
        radial-gradient(circle at 100% 0%, rgba(249, 115, 22, .22), transparent 16rem);
}
.auth-card .button-primary { margin-top: 6px; }
.auth-page .topbar { background: transparent; border-bottom: 0; position: relative; }
.auth-page .topbar .brand > span { justify-content: center; }
.install-card fieldset { display: grid; gap: 14px; }

.is-hidden, [hidden] { display: none !important; }
.table-actions form { display: inline; margin: 0; }

/* Safety net: no hover state may ever become white text on white background. */
a.button:not(.button-primary):hover,
a.small-button:hover,
button.small-button:hover,
.table-actions a:hover,
.table-actions .link-button:hover,
.link-button:hover,
.nav a:hover {
    color: var(--orange-900);
}
.brand a:hover { color: var(--heading); }
.button-primary:hover, a.button-primary:hover, button.button-primary:hover { color: #fff; }

@media (max-width: 900px) {
    .grid-2, .cards, .mode-grid { grid-template-columns: 1fr; }
    .choice-list.two-columns { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .topbar, .hero, .section-title, .question-card { flex-direction: column; align-items: stretch; }
    .topbar-public { align-items: center; }
    .nav { gap: 8px; }
    .container { width: min(100% - 24px, 1180px); margin-top: 20px; }
    table { display: block; overflow-x: auto; white-space: nowrap; border-spacing: 0 8px; }
    th, td { padding: 13px 10px; }
    .result-row { grid-template-columns: 1fr; gap: 7px; }
    .result-count { text-align: left; }
    .panel, .auth-card, .install-card { padding: 20px; border-radius: 21px; }
    .survey-form { padding: 0; }
    .survey-form > *:not(.survey-hero) { margin-left: 18px; margin-right: 18px; }
    .survey-hero { padding: 25px 20px; }
    .question-block { padding: 18px; }
    .input-with-prefix { grid-template-columns: 1fr; }
    .input-with-prefix > span { border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
}
@media (max-width: 520px) {
    .container { width: min(100% - 18px, 1180px); }
    .nav { width: 100%; }
    .nav a, .nav form, .nav .button { flex: 1 1 auto; }
    h1 { font-size: clamp(30px, 10vw, 40px); }
    .actions .button, .question-actions .small-button, .question-actions form { width: 100%; }
    .question-actions { width: 100%; }
    .question-actions form .small-button { width: 100%; }
    .scale-choice span { min-width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
