:root {
    --coffee: #412923;
    --coffee-2: #64483e;
    --copper: #8a6455;
    --cream: #f8f3ef;
    --paper: #fffdfa;
    --line: #dfcfc3;
    --ink: #3d2d28;
    --muted: #865f50;
    --shadow: 0 18px 55px rgba(65, 41, 35, .10);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: #f4f0ed; color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 16px; line-height: 1.35; }
button, input { font: inherit; }

.survey-shell { width: min(1120px, calc(100% - 32px)); margin: 38px auto; }
.hero { display: grid; grid-template-columns: 1fr auto; gap: 4px 30px; padding: 24px 26px 22px; border-radius: 9px; background: var(--coffee); color: #fff8f3; box-shadow: var(--shadow); }
.brand { margin: 0 0 2px; font-size: 2rem; line-height: 1; font-weight: 800; letter-spacing: .03em; }
.hero h1 { margin: 8px 0 0; font-size: 1.38rem; line-height: 1.15; }
.intro { grid-column: 1 / -1; margin: 8px 0 0; color: #f2e7df; font-size: 1.08rem; }
.time-pill { align-self: center; margin: 0; padding: 5px 14px; border-radius: 999px; background: #805b4c; font-weight: 700; white-space: nowrap; }

.survey-form { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; margin-top: 18px; }
.column { display: flex; flex-direction: column; gap: 14px; }
.question-card { min-width: 0; margin: 0; padding: 13px 16px 15px; border: 1px solid var(--line); border-left: 5px solid var(--coffee-2); border-radius: 8px; background: var(--paper); box-shadow: 0 3px 12px rgba(65, 41, 35, .04); }
.question-card legend { float: left; width: 100%; padding: 0; color: var(--coffee); font-size: 1.18rem; line-height: 1.2; font-weight: 800; }
.question-card legend + * { clear: both; }
.hint { margin: 7px 0 5px; color: var(--muted); font-style: italic; }
.choice { display: flex; align-items: flex-start; gap: 8px; margin: 5px 0; cursor: pointer; font-size: 1.04rem; }
.choice > input[type="radio"], .choice > input[type="checkbox"] { flex: 0 0 auto; appearance: none; width: 18px; height: 18px; margin: 2px 0 0; border: 2px solid #6d5146; background: #fff; cursor: pointer; }
.choice > input[type="radio"] { border-radius: 50%; }
.choice > input[type="checkbox"] { border-radius: 3px; }
.choice > input[type="radio"]:checked { box-shadow: inset 0 0 0 4px #fff; background: var(--coffee); }
.choice > input[type="checkbox"]:checked { background: var(--coffee); box-shadow: inset 0 0 0 3px #fff; }
.choice > input:focus-visible { outline: 3px solid rgba(138, 100, 85, .28); outline-offset: 2px; }
.choice-with-text { align-items: center; flex-wrap: wrap; }
.choice-with-text.stacked .inline-input { flex-basis: 100%; margin-left: 26px; }
.inline-input { flex: 1 1 130px; min-width: 90px; height: 25px; padding: 1px 4px; border: 0; border-bottom: 2px dashed #ad8878; border-radius: 0; background: transparent; color: var(--ink); }
.inline-input:focus { outline: 0; border-bottom-style: solid; border-color: var(--coffee); }
.form-footer { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; padding: 14px 22px 16px; border: 1px solid var(--line); border-radius: 8px; background: #f6ede5; text-align: center; }
.form-footer > p:first-child { margin: 0 0 14px; font-size: 1.02rem; }
.privacy-note { margin: 10px 0 0; color: #755b51; font-size: .82rem; }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 24px; border: 0; border-radius: 7px; background: var(--coffee); color: #fff; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 0 7px 18px rgba(65, 41, 35, .18); transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); background: #53362e; }
.button:focus-visible { outline: 3px solid rgba(138, 100, 85, .35); outline-offset: 3px; }
.button-secondary { background: #f3e7de; color: var(--coffee); box-shadow: none; }
.button-secondary:hover { background: #ead8cb; }
.button-quiet { background: transparent; color: var(--coffee); border: 1px solid var(--line); box-shadow: none; }

.message-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top, #fff 0, #f4efeb 54%, #e9ded7 100%); }
.message-card { width: min(580px, 100%); padding: 42px; border-top: 8px solid var(--coffee); border-radius: 12px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.message-card h1 { margin: 5px 0 12px; color: var(--coffee); font-size: clamp(1.7rem, 5vw, 2.35rem); line-height: 1.1; }
.message-card > p:not(.eyebrow):not(.error-text) { color: #654f47; font-size: 1.08rem; }
.message-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: -5px auto 20px; border-radius: 50%; background: #ede0d7; color: var(--coffee); font-size: 1.8rem; font-weight: 900; }
.eyebrow { margin: 0; color: var(--muted); font-weight: 900; letter-spacing: .14em; }
.login-card form { display: grid; gap: 16px; margin-top: 24px; }
.pin-label { display: grid; gap: 6px; text-align: left; font-weight: 700; }
.pin-label input { width: 100%; padding: 11px 12px; border: 1px solid #cdb9ae; border-radius: 6px; }
.error-text { color: #a12626; font-weight: 700; }

.admin-page { min-height: 100vh; background: #f2eeeb; }
.admin-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 38px 0 70px; }
.admin-header { display: flex; justify-content: space-between; gap: 22px; align-items: center; margin-bottom: 24px; padding: 25px 28px; border-radius: 10px; background: var(--coffee); color: #fff; }
.admin-header h1 { margin: 5px 0; }
.admin-header p { margin-bottom: 0; }
.admin-header .eyebrow { color: #d9bbae; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.print-date { display: none; }
.admin-actions form { margin: 0; }
.admin-header .button-quiet { color: #fff; border-color: #8b6d61; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.result-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.result-card h2 { margin: 0 0 14px; color: var(--coffee); font-size: 1.2rem; }
.results-note { margin: 0 0 14px; color: #654f47; }
.result-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.result-row strong { white-space: nowrap; color: var(--coffee); font-variant-numeric: tabular-nums; }
.result-percent { color: #654f47; font-weight: 400; }
.result-bar { display: block; width: 100%; height: 8px; margin-top: 5px; accent-color: var(--coffee-2); }
.result-comments { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.result-comments summary { color: var(--coffee); font-weight: 700; cursor: pointer; }
.result-comments ul { margin-bottom: 0; padding-left: 22px; }
.result-comments li + li { margin-top: 6px; }
.empty-state { padding: 55px; border: 1px dashed #cdb9ae; border-radius: 10px; background: #fff; text-align: center; }

@media (max-width: 760px) {
    .survey-shell { width: min(100% - 20px, 620px); margin: 10px auto 24px; }
    .hero { grid-template-columns: 1fr; padding: 20px; }
    .brand { font-size: 1.7rem; }
    .hero h1 { font-size: 1.2rem; }
    .intro { font-size: 1rem; }
    .time-pill { grid-row: 3; justify-self: start; margin-top: 10px; }
    .survey-form { grid-template-columns: 1fr; gap: 14px; }
    .column { gap: 12px; }
    .question-card { padding: 13px 13px 14px; }
    .question-card legend { font-size: 1.08rem; }
    .choice { font-size: 1rem; }
    .form-footer { grid-column: 1; }
    .message-card { padding: 30px 20px; }
    .admin-shell { width: min(100% - 20px, 620px); padding-top: 10px; }
    .admin-header { align-items: stretch; flex-direction: column; }
    .admin-actions { flex-wrap: wrap; }
    .results-grid { grid-template-columns: 1fr; }
    .result-card { padding: 16px; }
}

@page { size: A4; margin: 14mm 15mm; }

@media print {
    .admin-page { min-height: 0; background: #fff; color: #221b18; font-size: 10.5pt; line-height: 1.32; }
    .admin-shell { width: auto; margin: 0; padding: 0; }
    .admin-header { display: block; margin-bottom: 4mm; padding: 0 0 3mm; border-bottom: 1pt solid #412923; border-radius: 0; background: transparent; color: #221b18; break-inside: avoid; }
    .admin-header .eyebrow { color: #654f47; font-size: 9pt; }
    .admin-header h1 { margin: 1mm 0 2mm; color: #412923; font-size: 22pt; }
    .admin-header p { margin: 0; }
    .admin-header .print-date { display: block; margin-top: 1mm; color: #654f47; }
    .admin-actions { display: none; }
    .results-grid, .result-list { display: block; }
    .result-card { margin: 0 0 3mm; padding: 2.5mm 0 0; border: 0; border-top: .5pt solid #c1aca1; border-radius: 0; }
    .result-stats { break-inside: avoid; }
    .result-card h2 { margin: 0 0 1.5mm; font-size: 12pt; break-after: avoid; }
    .results-note { margin: 0 0 2mm; }
    .result-list li { margin-bottom: 1mm; }
    .result-bar { height: 3pt; margin-top: .4mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .result-comments { margin: 2.5mm 0; padding: 0; border: 0; }
    .result-comments::details-content { content-visibility: visible; }
    .result-comments summary { display: block; list-style: none; break-after: avoid; }
    .result-comments summary::-webkit-details-marker { display: none; }
    .result-comments ul { display: block; margin: 1mm 0 0; }
    .result-comments li { break-inside: avoid; }
    .result-comments li + li { margin-top: 1mm; }
    .empty-state { padding: 6mm 0; border: 0; text-align: left; }
}
