:root {
  --ink: #171612;
  --muted: #6a6861;
  --paper: #f4f1ea;
  --white: #fffdf8;
  --gold: #cf9f2e;
  --gold-dark: #9b7112;
  --gold-soft: #f6e9bf;
  --green: #217a52;
  --green-soft: #e3f3e9;
  --red: #a4443e;
  --red-soft: #f8e9e7;
  --line: #ded9cd;
  --shadow: 0 18px 60px rgba(39, 33, 20, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 12% -10%, #fff7da 0, transparent 32rem), var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.site-header { height: 72px; padding: 0 max(22px, calc((100vw - 1100px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(23, 22, 18, .12); background: rgba(244, 241, 234, .88); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; color: var(--white); background: var(--ink); border-radius: 9px; font-family: Georgia, serif; font-size: 20px; }
.text-link, .back-link { color: var(--ink); font-weight: 750; text-decoration: none; border: 0; background: transparent; padding: 10px 0; cursor: pointer; }
.text-link:hover, .back-link:hover { color: var(--gold-dark); }
.shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0 90px; }
.footer { text-align: center; padding: 28px 16px 42px; color: var(--muted); font-size: 13px; letter-spacing: .04em; }

.hero { max-width: 760px; padding: 14px 0 52px; }
.eyebrow, .step-label { color: var(--gold-dark); font-size: 12px; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(54px, 9vw, 94px); line-height: .92; letter-spacing: -.055em; font-weight: 500; }
h1 span { color: var(--gold-dark); }
h2 { margin: 5px 0 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
h3 { margin: 34px 0 14px; font-size: 16px; }
.hero-copy { max-width: 650px; margin-bottom: 22px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.privacy-note { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid #d9c990; border-radius: 999px; background: rgba(255, 253, 248, .55); color: #5d4a1f; font-size: 13px; font-weight: 650; }
.privacy-note span { color: var(--green); font-size: 10px; }

.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.selection-panel, .question-panel, .review-panel, .completion-panel, .results-panel, .detail-panel { padding: clamp(22px, 4vw, 42px); }
.section-heading, .person-heading, .dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.pill { display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid var(--line); background: #f7f4ed; color: var(--muted); border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 750; }
.member-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.member-card { min-height: 84px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #fff; text-align: left; cursor: pointer; transition: .2s ease; }
.member-card:hover { transform: translateY(-2px); border-color: #b99a4e; box-shadow: 0 12px 28px rgba(39, 33, 20, .09); }
.member-card strong, .member-card small, .review-row strong, .review-row small { display: block; }
.member-card small, .review-row small { color: var(--muted); margin-top: 4px; }
.arrow { font-size: 20px; }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--gold-soft); color: #634a12; font-size: 12px; font-weight: 900; letter-spacing: .04em; }
.avatar-2 { background: #e4ece6; color: #285f43; }
.avatar-3 { background: #e9e5f2; color: #5e4c7a; }
.avatar-large { width: 58px; height: 58px; border-radius: 16px; font-size: 15px; }
.fine-print { margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.fine-print.center { text-align: center; }

.evaluation-head { max-width: 830px; margin-bottom: 30px; }
.compact-title { margin: 12px 0 22px; font-size: clamp(42px, 7vw, 68px); line-height: 1; }
.progress-wrap { margin-top: 28px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 13px; }
.progress-meta strong { color: var(--ink); }
.progress-track, .mini-track { height: 8px; overflow: hidden; background: #ddd8ca; border-radius: 999px; }
.progress-track span, .mini-track i { display: block; height: 100%; background: var(--gold); border-radius: inherit; transition: width .25s ease; }
.person-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.person-tab { min-height: 62px; border: 1px solid var(--line); background: rgba(255,255,255,.5); border-radius: 13px; cursor: pointer; }
.person-tab span, .person-tab small { display: block; margin: auto; }
.person-tab span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: #e5e0d5; font-size: 12px; font-weight: 850; }
.person-tab small { margin-top: 4px; color: var(--muted); }
.person-tab.active { border-color: var(--gold-dark); background: var(--gold-soft); }
.person-tab.complete span { color: white; background: var(--green); }
.person-heading { justify-content: flex-start; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.person-heading .pill { margin-left: auto; }
.question-list { display: grid; gap: 10px; }
.question { margin: 0; padding: 18px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.question.answered { border-color: #c9d9ce; background: #fbfefc; }
.question legend { display: contents; font-size: 15px; line-height: 1.45; font-weight: 650; }
.question legend span { display: inline-grid; place-items: center; width: 26px; height: 26px; margin-right: 10px; border-radius: 8px; background: #f0ece3; color: var(--muted); font-size: 11px; font-weight: 850; }
.choice-group { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 150px; }
.choice { min-height: 42px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 10px; background: #f8f6f0; font-weight: 800; cursor: pointer; }
.choice.yes.selected { background: var(--green); border-color: var(--green); color: white; }
.choice.no.selected { background: var(--red); border-color: var(--red); color: white; }
.form-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 11px 20px; border: 1px solid transparent; border-radius: 12px; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--ink); }
.button.primary:hover { background: #39362e; }
.button.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.full { width: 100%; margin-top: 24px; }
.alert { padding: 13px 15px; margin: 18px 0 0; border-radius: 11px; font-size: 14px; font-weight: 650; }
.alert.error { color: #7b2f2b; background: var(--red-soft); border: 1px solid #ebc8c4; }

.review-list { display: grid; gap: 10px; }
.review-row { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: white; text-align: left; cursor: pointer; }
.review-row:hover { border-color: var(--gold-dark); }
.score { text-align: right; }
.score strong { font-size: 22px; }
.success-card, .login-card { max-width: 600px; margin: 50px auto; padding: clamp(32px, 6vw, 64px); text-align: center; }
.success-card h1, .login-card h1 { margin: 16px 0; font-size: clamp(40px, 7vw, 62px); line-height: 1; }
.success-card p, .login-card p { color: var(--muted); line-height: 1.6; }
.success-icon { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 34px; font-weight: 900; }
.lock-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 15px; background: var(--gold-soft); color: var(--gold-dark); }
.field-label { display: block; margin: 25px 0 8px; text-align: left; font-size: 13px; font-weight: 800; }
.text-input, .select-input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cfc8b8; border-radius: 11px; background: white; color: var(--ink); }
.text-input:focus, .select-input:focus { outline: 3px solid rgba(207,159,46,.25); border-color: var(--gold-dark); }
.centered { display: inline-block; margin-top: 22px; }

.dashboard-head { align-items: flex-end; margin-bottom: 30px; }
.dashboard-head p { margin: 10px 0 0; color: var(--muted); }
.head-actions { display: flex; gap: 8px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { min-height: 155px; padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: 0 10px 30px rgba(39,33,20,.05); }
.metric-card > span, .metric-card > small { display: block; color: var(--muted); font-size: 12px; }
.metric-card > strong { display: block; margin: 16px 0 10px; font-family: Georgia, serif; font-size: 42px; font-weight: 500; }
.metric-card strong small { font: 700 16px Inter, sans-serif; color: var(--muted); }
.metric-card.accent { color: white; background: var(--ink); border-color: var(--ink); }
.metric-card.accent > span, .metric-card.accent > small, .metric-card.accent strong small { color: #d8d1bf; }
.mini-track { margin-top: 15px; height: 6px; }
.completion-panel, .results-panel, .detail-panel { margin-top: 18px; }
.status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.status-person { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 14px; border-radius: 12px; background: #f4f1ea; }
.status-person > span { grid-row: span 2; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; }
.status-person small { color: var(--muted); }
.status-person.done { background: var(--green-soft); }
.status-person.done > span { color: white; background: var(--green); }
.score-table { overflow-x: auto; }
.score-row { min-width: 680px; width: 100%; display: grid; grid-template-columns: 2fr .6fr 1fr 1fr; align-items: center; gap: 14px; padding: 16px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
button.score-row { cursor: pointer; }
button.score-row:hover, .score-row.selected { background: #faf5e6; }
.score-header { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.result-bar { display: block; width: 100%; max-width: 190px; height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: #e5e0d5; }
.result-bar b { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.select-input { width: auto; min-width: 200px; }
.reviewer-score-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 9px; }
.reviewer-score-grid article { padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.reviewer-score-grid span, .reviewer-score-grid small { display: block; color: var(--muted); font-size: 11px; }
.reviewer-score-grid strong { display: block; margin: 10px 0 4px; font: 500 28px Georgia, serif; }
.reviewer-score-grid strong small { display: inline; font: 700 12px Inter, sans-serif; }
.question-stats { display: grid; gap: 8px; }
.stat-row { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat-row summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 15px; cursor: pointer; list-style: none; }
.stat-row summary::-webkit-details-marker { display: none; }
.question-number { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #f0ece3; color: var(--muted); font-size: 11px; font-weight: 850; }
.stat-question strong { font-size: 13px; line-height: 1.35; }
.stat-count { min-width: 75px; text-align: right; }
.stat-count strong, .stat-count small { display: block; }
.stat-count small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.named-answers { padding: 0 15px 15px 55px; }
.named-answers div { display: flex; justify-content: space-between; padding: 9px 10px; border-top: 1px solid #eeeae1; font-size: 13px; }
.answer-yes { color: var(--green); }
.answer-no { color: var(--red); }
.empty-state { padding: 28px; border: 1px dashed #cfc8b8; border-radius: 12px; color: var(--muted); text-align: center; }

@media (max-width: 820px) {
  .shell { padding-top: 44px; }
  .member-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
  .reviewer-score-grid { grid-template-columns: repeat(2, 1fr); }
  .status-grid { grid-template-columns: 1fr 1fr; }
  .question { grid-template-columns: 1fr; }
  .choice-group { min-width: 0; }
  .dashboard-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .site-header { height: 64px; }
  .brand span:last-child { display: none; }
  .shell { width: min(100% - 20px, 1100px); padding-top: 32px; }
  .hero { padding-bottom: 32px; }
  h1 { font-size: 54px; }
  .member-grid, .metric-grid, .status-grid { grid-template-columns: 1fr; }
  .selection-panel, .question-panel, .review-panel, .completion-panel, .results-panel, .detail-panel { padding: 18px; border-radius: 17px; }
  .section-heading { align-items: flex-start; }
  .person-tabs { gap: 4px; }
  .person-tab { min-height: 54px; padding: 5px 2px; }
  .person-tab small { font-size: 10px; }
  .person-heading { flex-wrap: wrap; }
  .person-heading .pill { margin-left: 0; }
  .question { padding: 15px; }
  .question legend { font-size: 14px; }
  .choice { min-height: 48px; }
  .form-actions { position: sticky; bottom: 8px; padding: 8px; margin-inline: -8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.93); backdrop-filter: blur(12px); }
  .form-actions .button { flex: 1; padding-inline: 10px; }
  .head-actions { width: 100%; }
  .head-actions .button { flex: 1; }
  .reviewer-score-grid { grid-template-columns: 1fr 1fr; }
  .detail-panel .section-heading { flex-direction: column; }
  .select-input { width: 100%; }
  .stat-row summary { grid-template-columns: auto 1fr; }
  .stat-count { grid-column: 2; text-align: left; }
  .named-answers { padding-left: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
