:root {
  color-scheme: light;
  font: 16px/1.53 system-ui, -apple-system, "Segoe UI", sans-serif;
  --paper: #fff;
  --ground: #f5f5f4;
  --soft: #eeeeec;
  --ink: #1d1e1d;
  --muted: #555953;
  --line: #d9dbd6;
  --control: #b6b9b1;
  --primary: #2b2e2a;
  --focus: #343a50;
  --error: #8d2925;
  background: var(--ground);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
a { color: inherit; text-underline-offset: .2em; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
h1, h2, h3, h4 { line-height: 1.18; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: 2.5rem; font-weight: 720; }
h2 { font-size: 1.25rem; font-weight: 670; }
h3 { font-size: 1.08rem; font-weight: 670; }
h4 { font-size: .99rem; font-weight: 670; }
ul { padding-inline-start: 1.3rem; }
p { overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
h1[tabindex="-1"]:focus, main[tabindex="-1"]:focus { outline: none; }
::selection { color: white; background: var(--primary); }

.shell { width: min(100% - 72px, 1232px); margin-inline: auto; }
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 72px; }
.brand { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; }
.brand strong { font-size: 1.06rem; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-size: .875rem; padding-left: 18px; border-left: 1px solid var(--line); }
.main { padding-block: 36px 64px; }
.page-heading p { margin-top: 6px; }
.page-heading { margin-bottom: 22px; }
.muted { color: var(--muted); }
.narrow { max-width: 670px; margin-inline: auto; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.intro { padding: 28px; display: grid; justify-items: start; gap: 16px; }
.intro ul { margin-block: 0; }
.intro li + li { margin-top: 6px; }
.intro .field { width: 100%; }
.intro .notice { width: 100%; }
.notice { background: var(--soft); border-radius: 8px; padding: 11px 14px; color: var(--muted); }
.button, .nav-button, .round-choice {
  display: inline-flex; gap: 8px; justify-content: center; align-items: center;
  min-height: 44px; padding: 7px 13px; border: 1px solid var(--control); border-radius: 7px;
  background: var(--paper); color: var(--ink); text-align: center; text-decoration: none; font-weight: 600;
}
.button:hover:not(:disabled), .nav-button:hover, .round-choice:hover { background: var(--soft); }
.button.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.button.primary:hover:not(:disabled) { background: #454942; border-color: #454942; }
.button.subtle { border-color: transparent; background: transparent; }
.button.danger { color: var(--error); border-color: #b9837f; }
.button.small { padding-inline: 9px; font-size: .875rem; }
.button[aria-disabled="true"] { opacity: .45; }
.icon { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stack { display: grid; gap: 16px; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: absolute; z-index: 4; top: 10px; left: 10px; padding: 10px; background: white; }

.progress-block { margin-bottom: 18px; }
.counter { font-weight: 650; font-variant-numeric: tabular-nums; }
progress { appearance: none; display: block; border: 0; overflow: hidden; background: #e4e6e1; border-radius: 20px; }
progress::-webkit-progress-bar { background: #e4e6e1; }
progress::-webkit-progress-value { background: var(--primary); }
progress::-moz-progress-bar { background: var(--primary); }
.progress { width: 100%; height: 5px; margin-top: 10px; }
.concept-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 24px; flex-wrap: wrap; margin-bottom: 19px; }
.concept-heading .page-heading { margin: 0; }
.region-tag, .tag { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 640; color: #454842; background: var(--soft); padding: 4px 9px; border: 1px solid #e0e1dc; border-radius: 5px; }
.tag.open { color: #375142; background: #e8eee8; border-color: #d9e3da; }
.tag.draft { color: #624823; background: #f5efe5; border-color: #e9dec9; }
.tag.closed { color: #474a46; }
.survey-grid { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(375px, 1fr); align-items: start; gap: 20px; }
.preview-panel { overflow: hidden; padding: 15px; }
.preview-return { margin-bottom: 12px; }
.preview-header { padding: 0 2px 13px; }
.preview-header h2 { font-size: 1.08rem; margin-bottom: 3px; }
.preview-header p, .preview-note { font-size: .875rem; }
.preview-image { background: var(--soft); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.preview-image img { width: 100%; }
.preview-note { margin: 11px 2px 1px; }
.mobile-preview { display: none; }
.image-error { padding: 15px; }
.form-panel { padding: 21px; }
.form-panel > h2 { margin-bottom: 16px; }
.form-panel .field { margin-top: 16px; }
.criterion, .choice-fieldset, .comparison { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
.criterion + .criterion { border-top: 1px solid var(--line); margin-top: 13px; padding-top: 14px; }
.criterion legend { display: table; float: left; width: 100%; padding: 0; font-weight: 650; margin-bottom: 12px; }
.scale { display: grid; clear: both; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.scale-choice { position: relative; }
.scale-choice input[type="radio"] { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.scale-choice span {
  min-height: 44px; display: grid; place-items: center; border: 1px solid var(--control);
  border-radius: 6px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.scale-choice:hover span { background: var(--soft); }
.scale-choice input:checked + span { color: white; background: var(--primary); border-color: var(--primary); }
.scale-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.anchors { display: grid; grid-template-columns: 1fr auto 1fr; gap: 7px; margin-top: 8px; color: var(--muted); font-size: .8rem; line-height: 1.32; }
.anchors span:last-child { text-align: right; }
.na-choice, .check-row { display: flex; gap: 9px; align-items: center; min-height: 44px; cursor: pointer; }
.na-choice { margin-top: 5px; width: fit-content; }
input[type="radio"], input[type="checkbox"] { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); flex-shrink: 0; }
.form-panel .save-row { margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line); }
.save-status { color: var(--muted); font-size: .875rem; }
.save-status[data-error="true"] { color: var(--error); }
.survey-nav { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 17px; }
.review-link { margin-top: 6px; }
.field { display: grid; gap: 6px; min-width: 0; font-weight: 620; }
.field input, .field select, .field textarea, select {
  width: 100%; min-height: 44px; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--control);
  background: var(--paper); color: var(--ink); font-weight: 400;
}
textarea { resize: vertical; }
.optional { font-weight: 400; margin-left: 7px; font-size: .82rem; }
.favorite-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 13px; margin-top: 8px; }
.favorite { overflow: hidden; padding: 12px; }
.favorite-image { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.favorite-image img { width: 100%; }
.favorite .check-row { margin-top: 5px; }
.favorite-actions { gap: 4px; }
.final-note { max-width: 690px; margin-top: 24px; }
.final-note .field { margin-top: 0; }
.final-note .actions { margin-top: 14px; }
.notice + [role="status"] { margin-top: 12px; }

.viewer { width: min(96vw, 1500px); height: 92dvh; max-width: 100%; max-height: 100%; padding: 0; border: 1px solid var(--control); border-radius: 10px; color: var(--ink); background: var(--paper); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
dialog::backdrop { background: rgb(25 27 25 / 68%); }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 8px 12px; }
.viewer-toolbar h2 { font-size: 1.07rem; }
.viewer-controls .button { min-width: 44px; }
.viewer-scale { min-width: 68px; text-align: center; font-size: .85rem; }
.viewer-image { overflow: auto; padding: 10px; background: var(--soft); }
.viewer-image img { margin-inline: auto; }
.viewer-image[data-zoom="actual"] img, .viewer-image[data-zoom="large"] img { max-width: none; }
.admin-preview { width: min(95vw, 850px); max-height: 94dvh; padding: 0; border: 1px solid var(--control); border-radius: 10px; color: var(--ink); }
.preview-dialog-body { padding: 14px; }
.preview-dialog-body > .preview-image { margin-top: 8px; }

.admin-main { padding-top: 29px; }
.admin-main h1 { font-size: 2rem; }
.admin-nav, .round-tabs { display: flex; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--line); }
.nav-button { border: 1px solid transparent; background: transparent; border-radius: 7px 7px 0 0; color: var(--muted); }
.nav-button[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--primary); background: var(--paper); }
.admin-feedback { min-height: 20px; margin: 4px 0 6px; }
.admin-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: start; gap: 24px; }
.round-list { padding: 13px; display: grid; gap: 7px; }
.round-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 3px; }
.round-list-head h2, .round-list-head .button { font-size: .9rem; }
.round-choice { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 9px; border-color: transparent; gap: 3px; overflow-wrap: anywhere; }
.round-choice .muted { font-size: .8rem; font-weight: 400; }
.round-choice[aria-current="page"] { border-color: var(--line); background: var(--soft); }
.round-content { min-width: 0; }
.round-heading { align-items: flex-start; margin: 2px 0 13px; }
.round-heading h2 { font-size: 1.45rem; }
.round-heading p { margin-top: 5px; font-size: .875rem; }
.round-heading .tag { flex-shrink: 0; }
.round-tabs { margin-bottom: 14px; }
.admin-form { display: grid; align-items: start; justify-items: start; gap: 12px; padding: 16px; }
.admin-form .field, .admin-form .form-grid { width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.choice-fieldset { width: 100%; }
.choice-fieldset legend, .comparison legend { font-weight: 680; }
.choice-list { margin-top: 7px; }
.choice-list .check-row { flex-wrap: wrap; padding: 2px 0; border-bottom: 1px solid var(--line); }
summary { min-height: 44px; align-content: center; font-weight: 620; }
.invite-actions { display: flex; flex-wrap: wrap; gap: 5px; min-width: 174px; }
.group-invite-counts, .group-invite-date { white-space: nowrap; }
.invite-form, .reveal { margin-bottom: 12px; }
.reveal .stack, .reveal .field { width: 100%; }
.secret-line { width: 100%; align-items: end; }
.list-heading, .section-heading { margin-bottom: 10px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 285px), 1fr)); gap: 14px; margin-top: 12px; }
.catalog-card { overflow: hidden; }
.catalog-card > img { width: 100%; }
.catalog-description { padding: 14px; display: grid; gap: 8px; }
.details dt { color: var(--muted); font-size: .85rem; }
.details dd { margin-bottom: 7px; overflow-wrap: anywhere; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list .tag { vertical-align: middle; }
.table-scroll { overflow-x: auto; max-width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 11px; vertical-align: middle; border-bottom: 1px solid var(--line); }
td { overflow-wrap: anywhere; }
tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
thead { background: #f0f0ee; }
thead th { border-bottom: 1px solid var(--line); }
th[scope="row"] { max-width: 200px; font-weight: 640; }
.report-tools { display: grid; gap: 7px; margin-bottom: 13px; }
.group-filter { border-bottom: 1px solid var(--line); }
.group-filter .actions { padding: 0 0 6px; }
.group-filter .check-row { padding-inline: 7px; }
.report-tools .spread { align-items: end; flex-wrap: wrap; }
.report-tools .field { font-size: .875rem; }
.report-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 12px 0; }
.report-counts div { min-width: 0; padding-inline: 12px; }
.report-counts div + div { border-left: 1px solid var(--line); }
.report-counts dt { font-size: .85rem; color: var(--muted); }
.report-counts dd { font-size: 1.4rem; font-weight: 690; }
.result-note { margin-top: 10px; font-size: .875rem; }
.results-section, .comparison { margin-top: 15px; }
.results-section h3, .results-section h4 { margin-bottom: 7px; }
.results-section .notice { margin-bottom: 6px; }
.group-results { border-top: 1px solid var(--line); }
.group-results > :not(summary) { margin: 6px 0 12px; }
.group-results > .field { max-width: 22rem; }
.metric-cell { min-width: 120px; display: grid; gap: 3px; }
.metric-cell meter { width: 100%; height: 12px; }
meter::-webkit-meter-optimum-value { background: #565b52; }
meter::-moz-meter-bar { background: #565b52; }
.metric-cell .muted { font-size: .8rem; }
.distribution .muted { min-width: 140px; padding-bottom: 7px; }
.bar-row { display: grid; grid-template-columns: 1ch minmax(70px, 1fr) 3ch; align-items: center; gap: 6px; }
.bar-row progress { width: 100%; height: 6px; }
.comparison .check-row { padding-inline: 6px; }

@media (min-width: 761px) {
  .survey-grid > .preview-panel { position: sticky; top: 12px; }
  .survey-grid.reviewing { --preview-controls-height: 224px; }
  .survey-grid .preview-image img {
    max-height: max(110px, calc(100dvh - var(--preview-controls-height, 168px)));
    object-fit: contain;
  }
}
@media (max-width: 970px) {
  .shell { width: calc(100% - 40px); }
  .survey-grid { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 13px; }
  .form-panel { padding: 13px; }
  .admin-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 13px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 58px; }
  .brand { display: block; line-height: 1.25; padding-block: 9px; }
  .brand span { display: block; padding: 0; border: 0; font-size: .8rem; margin-top: 2px; }
  .main { padding-block: 22px 40px; }
  h1 { font-size: 2rem; }
  .survey-grid, .admin-layout { grid-template-columns: minmax(0, 1fr); }
  .concept-heading { margin-bottom: 13px; }
  .preview-panel { padding: 9px; }
  .preview-return { display: none; }
  .preview-header { padding-bottom: 8px; }
  .preview-header .button { font-size: .875rem; }
  .form-panel { padding: 11px; }
  .survey-grid .form-panel :is(input, textarea) { scroll-margin-block-start: 62px; }
  .mobile-preview {
    display: flex; position: sticky; top: 0; z-index: 1; align-items: center;
    justify-content: space-between; gap: 4px; padding: 5px 11px; margin: 0 -11px 12px;
    background: var(--paper); border-bottom: 1px solid var(--line);
  }
  .mobile-preview .button { gap: 5px; padding-inline: 6px; }
  .mobile-preview-thumb { width: 36px; height: 24px; flex: none; overflow: hidden; }
  .mobile-preview-thumb img { width: 100%; height: 100%; object-fit: contain; }
  .mobile-preview-thumb .image-error { display: none; }
  .intro { padding: 16px; }
  .scale { gap: 2px; }
  .viewer { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; }
  .viewer-toolbar { padding-inline: 6px; }
  .round-list { display: flex; flex-wrap: wrap; }
  .round-list-head { width: 100%; }
  .admin-main h1 { font-size: 1.75rem; }
  .report-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; }
  .report-counts div:nth-child(3) { border-left: 0; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 350px) and (max-width: 390px) {
  .form-panel { padding-inline: 5px; }
  .form-panel > :not(.criterion) { margin-inline: 6px; }
  .form-panel > .mobile-preview { margin-inline: -5px; }
}
