:root {
    color-scheme: light dark;
    --bg: light-dark(#f3f5f6, #10161a);
    --surface: light-dark(#ffffff, #192126);
    --surface-soft: light-dark(#eaf0f2, #222c32);
    --text: light-dark(#172026, #edf2f4);
    --muted: light-dark(#60707a, #aab7bd);
    --line: light-dark(#d5dee3, #34434b);
    --navy: light-dark(#17324d, #b8d7ef);
    --navy-on: light-dark(#ffffff, #10202c);
    --blue: light-dark(#1666a8, #67b9f5);
    --blue-soft: light-dark(#e5f1fb, #183044);
    --green: light-dark(#147a43, #55d28b);
    --green-soft: light-dark(#e2f4e9, #173528);
    --amber: light-dark(#995b00, #ffc55d);
    --amber-soft: light-dark(#fff0cf, #3d3119);
    --red: light-dark(#b42318, #ff8179);
    --red-soft: light-dark(#fee7e5, #42211f);
    --shadow: 0 12px 32px light-dark(rgba(23, 50, 77, .09), rgba(0, 0, 0, .28));
    --radius: 14px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--blue); }
button, input, textarea, select { font: inherit; }
button, .button { touch-action: manipulation; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.06; letter-spacing: -.035em; font-weight: 650; }
h2 { font-size: 1.25rem; line-height: 1.25; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .7rem 1rem; background: var(--surface); }
.skip-link:focus { top: 1rem; }
.site-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 max(1rem, calc((100vw - 1220px) / 2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--text); text-decoration: none; }
.brand span:last-child { display: flex; flex-direction: column; }
.brand small { color: var(--muted); font-size: .72rem; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--navy); color: var(--navy-on); font-weight: 750; }
.header-actions { display: flex; gap: 1rem; }
.header-actions a { color: var(--text); text-decoration: none; font-size: .9rem; }
.page { width: min(1220px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; min-height: calc(100vh - 150px); }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.5rem max(1rem, calc((100vw - 1220px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.eyebrow { margin-bottom: .5rem; color: var(--blue); font-size: .77rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.lead { color: var(--muted); font-size: 1.06rem; max-width: 75ch; }
.muted { color: var(--muted); }
.is-hidden { display: none !important; }
.hero, .work-hero, .rating-hero, .results-hero, .board-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 3rem; padding: clamp(2rem, 6vw, 5rem); align-items: center; }
.button-row { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.button-row.end { justify-content: flex-end; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .4rem; min-height: 42px; padding: .62rem 1rem; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-weight: 650; cursor: pointer; }
.button.primary { background: var(--navy); color: var(--navy-on); }
.button.secondary { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 30%, transparent); }
.button.ghost { color: var(--text); border-color: var(--line); background: transparent; }
.button.text { color: var(--blue); background: transparent; padding-inline: .2rem; }
.button.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.button.block { width: 100%; }
.button.small { min-height: 34px; padding: .38rem .65rem; font-size: .8rem; }
.button:disabled { opacity: .55; cursor: wait; }
.process-preview ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.process-preview li { display: flex; gap: .8rem; align-items: flex-start; }
.process-preview li > span, .team-number { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-soft); color: var(--navy); font-weight: 750; }
.process-preview li div { display: flex; flex-direction: column; }
.process-preview small { color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.feature, .notice-card, .instruction-card, .panel, .rating-intro, .rating-progress-wrap, .result-topic, .legend-panel, .method-note { padding: 1.3rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.feature-icon { display: inline-flex; align-items: center; min-height: 34px; padding: 0 .65rem; margin-bottom: 1rem; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-weight: 750; }
.notice-card { margin-top: 1rem; }
.notice-card p, .feature p { margin-bottom: 0; color: var(--muted); }
.auth-shell { min-height: 68vh; display: grid; place-items: center; }
.auth-card { width: min(470px, 100%); padding: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-stack { display: grid; gap: 1rem; }
label > span, .form-stack label > span { display: block; margin-bottom: .34rem; font-weight: 650; font-size: .88rem; }
label small { color: var(--muted); font-weight: 450; }
input[type="text"], input[type="password"], input[type="number"], textarea, select { width: 100%; padding: .72rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); outline-offset: 2px; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-row { display: flex; gap: .7rem; align-items: flex-start; padding: .9rem; border: 1px solid var(--line); border-radius: 9px; }
.check-row input { margin-top: .3rem; }
.check-row span { margin: 0; display: flex; flex-direction: column; }
.dialog-card { width: min(650px, calc(100% - 2rem)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.dialog-card::backdrop { background: rgba(10, 20, 26, .62); }
.dialog-heading { display: flex; justify-content: space-between; gap: 1rem; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 1.8rem; cursor: pointer; }
.alert { padding: .9rem 1rem; margin-bottom: 1rem; border-radius: 9px; }
.alert.success, .status-message.success { background: var(--green-soft); color: var(--green); }
.alert.error, .status-message.error { background: var(--red-soft); color: var(--red); }
.alert.warning { background: var(--amber-soft); color: var(--amber); }
.alert.info, .status-message.info { background: var(--blue-soft); color: var(--blue); }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; margin-bottom: 1.5rem; }
.page-heading.compact h1 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin-bottom: .4rem; }
.back-link { display: inline-block; margin-bottom: .8rem; color: var(--muted); text-decoration: none; }
.title-line { display: flex; gap: .7rem; align-items: center; }
.title-line h1 { margin: 0; }
.survey-list { display: grid; gap: .65rem; }
.survey-row { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 1rem; padding: 1rem; color: var(--text); text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.survey-row:hover { border-color: var(--blue); }
.survey-main { display: flex; flex-direction: column; }
.survey-main small { color: var(--muted); }
.mode-pill, .status-pill { display: inline-flex; align-items: center; justify-content: center; width: fit-content; padding: .28rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
.mode-pill.simulation { background: var(--amber-soft); color: var(--amber); }
.mode-pill.real, .status-pill.info { background: var(--blue-soft); color: var(--blue); }
.status-pill.success, .status-pill.low { background: var(--green-soft); color: var(--green); }
.status-pill.warning, .status-pill.medium { background: var(--amber-soft); color: var(--amber); }
.status-pill.high { background: var(--red-soft); color: var(--red); }
.status-pill.neutral, .status-pill.none { background: var(--surface-soft); color: var(--muted); }
.status-pill.large { padding: .5rem .75rem; }
.empty-state { padding: 3rem 1.5rem; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-state h1, .empty-state h2 { font-size: 1.7rem; }
.success-state { border-color: var(--green); }
.phase-track { display: grid; grid-template-columns: repeat(6, 1fr); margin-bottom: 1.5rem; }
.phase { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; color: var(--muted); font-size: .75rem; text-align: center; }
.phase::before { content: ""; position: absolute; top: 15px; left: 0; width: 100%; height: 2px; background: var(--line); z-index: -1; }
.phase i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-soft); border: 2px solid var(--line); font-style: normal; }
.phase.done i { background: var(--green); color: white; border-color: var(--green); }
.phase.active i { background: var(--navy); color: var(--navy-on); border-color: var(--navy); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.admin-main { display: grid; gap: 1rem; }
.panel-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.panel-heading h2 { margin-bottom: .2rem; }
.panel-heading p:last-child { color: var(--muted); margin-bottom: 0; }
.topic-editor { display: grid; gap: .8rem; }
.topic-editor fieldset, .item-editor { margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.topic-editor legend, .item-editor legend { padding: 0 .4rem; color: var(--navy); font-weight: 750; }
.topic-editor fieldset { display: grid; gap: .7rem; }
.progress { height: 9px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.progress span { display: block; height: 100%; background: var(--green); transition: width .25s ease; }
.team-list { display: grid; margin-top: 1rem; }
.team-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: .8rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row > div { display: flex; flex-direction: column; }
.team-row small { color: var(--muted); }
.sticky-panel { position: sticky; top: 1rem; }
.action-stack, .link-list, .simulation-actions { display: grid; gap: .65rem; }
.link-list a { display: flex; flex-direction: column; padding: .75rem; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 8px; }
.link-list a:hover { border-color: var(--blue); }
.link-list small { color: var(--muted); }
.panel hr { margin: 1.2rem 0; border: 0; border-top: 1px solid var(--line); }
.check-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; margin-bottom: 1rem; }
.check-grid > div { padding: .8rem; background: var(--surface-soft); border-radius: 9px; }
.check-grid strong, .check-grid span { display: block; }
.check-grid strong { font-size: 1.3rem; }
.check-grid span { color: var(--muted); font-size: .75rem; }
.simulation-form { display: grid; grid-template-columns: 100px minmax(180px, 1fr) 110px auto; gap: .6rem; align-items: end; }
.simulation-watermark { position: relative; overflow: hidden; }
.simulation-watermark::after { content: "SIMULATION"; position: absolute; right: -35px; top: 21px; padding: .25rem 3rem; transform: rotate(35deg); background: var(--amber); color: light-dark(#fff, #2a1e06); font-weight: 800; font-size: .7rem; letter-spacing: .1em; }
.work-hero, .rating-hero, .results-hero, .board-hero { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: 1.5rem; margin-bottom: 1rem; }
.work-hero h1, .rating-hero h1, .results-hero h1, .board-hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: .4rem; }
.instruction-card { margin-bottom: 1rem; }
.sentence-template { margin: 1rem 0 0; padding: .8rem; background: var(--blue-soft); border-radius: 8px; color: var(--blue); }
.sentence-template span { display: block; font-size: .72rem; font-weight: 750; text-transform: uppercase; }
.team-form { display: grid; gap: 1rem; }
.item-editor { display: grid; gap: .7rem; background: var(--surface); }
.submit-bar { position: sticky; bottom: 1rem; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: .7rem; padding: .8rem; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); border-radius: 12px; backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.submitted-items { display: grid; gap: .8rem; }
.submitted-items li { padding: .75rem; background: var(--surface-soft); border-radius: 8px; }
.submitted-items p { margin: .3rem 0 0; color: var(--muted); }
.board-hero { margin-bottom: 1.5rem; }
.board-status { min-width: 210px; padding: 1rem; background: var(--surface-soft); border-radius: 10px; }
.board-status strong, .board-status span { display: block; }
.board-status strong { font-size: 1.8rem; }
.board-status span { margin-bottom: .6rem; color: var(--muted); }
.board-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.topic-qr-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.topic-qr-heading { display: flex; gap: .7rem; }
.topic-qr-heading h2 { margin-bottom: .25rem; }
.topic-qr-heading p { color: var(--muted); font-size: .85rem; }
.qr-block { display: flex; gap: 1rem; align-items: center; min-width: 0; }
.qr-block.vertical { flex-direction: column; text-align: center; }
.qr-code { flex: 0 0 auto; width: 220px; height: 220px; padding: 8px; background: white; border-radius: 8px; }
.qr-code img, .qr-code canvas { display: block; width: 100% !important; height: 100% !important; }
.qr-copy { min-width: 0; display: flex; flex-direction: column; }
.qr-copy a { overflow-wrap: anywhere; font-size: .78rem; }
.rating-ready { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; margin-top: 1rem; padding: 1.4rem; background: var(--green-soft); border: 1px solid var(--green); border-radius: var(--radius); }
.rating-ready .qr-code { width: 160px; height: 160px; }
.rating-intro { margin-bottom: 1rem; }
.scale-explainer { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem; background: var(--surface-soft); border-radius: 9px; }
.scale-explainer strong { font-size: 1.35rem; color: var(--navy); }
.rating-progress-wrap { position: sticky; top: .5rem; z-index: 4; margin-bottom: 1rem; box-shadow: var(--shadow); }
.rating-progress-wrap > div:first-child { display: flex; justify-content: space-between; margin-bottom: .45rem; }
.rating-form, .rating-topic { display: grid; gap: 1rem; }
.rating-topic { padding: 1.2rem; margin-bottom: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rating-topic-heading, .result-topic-heading { display: flex; gap: .8rem; align-items: flex-start; }
.rating-topic-heading h2, .result-topic-heading h2 { margin-bottom: .25rem; }
.rating-topic-heading p, .result-topic-heading p { color: var(--muted); margin-bottom: 0; }
.rating-item { margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
.rating-item.is-complete { border-color: color-mix(in srgb, var(--green) 55%, var(--line)); }
.rating-item legend { width: calc(100% - 1rem); padding: 0 .4rem; }
.rating-item legend strong, .rating-item legend small { display: block; }
.rating-item legend small { margin-top: .2rem; color: var(--muted); font-weight: 450; }
.number-scale { display: grid; grid-template-columns: repeat(11, minmax(36px, 1fr)); gap: .35rem; margin-top: .8rem; }
.number-scale label { position: relative; }
.number-scale input { position: absolute; opacity: 0; }
.number-scale span { display: grid; place-items: center; min-height: 43px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); font-weight: 700; }
.number-scale input:checked + span { color: var(--navy-on); background: var(--navy); border-color: var(--navy); }
.number-scale input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 35%, transparent); }
.cannot-rate { display: inline-flex; gap: .45rem; align-items: center; margin-top: .65rem; color: var(--muted); }
.cannot-rate span { margin: 0; font-weight: 500; }
.rating-submit { justify-content: space-between; }
.status-message { padding: .55rem .7rem; border-radius: 8px; }
.loader { width: 34px; height: 34px; margin: 1rem auto 0; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.results-hero .result-count { min-width: 180px; padding: 1rem; text-align: center; background: var(--surface-soft); border-radius: 10px; }
.result-count strong, .result-count span { display: block; }
.result-count strong { font-size: 2rem; }
.result-count span { color: var(--muted); }
.theme-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.theme-summary { padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 10px; }
.theme-summary span, .theme-summary strong, .theme-summary small { display: block; }
.theme-summary strong { margin: .35rem 0; font-size: 1.65rem; }
.theme-summary small { color: var(--muted); }
.theme-summary.low { border-left-color: var(--green); }
.theme-summary.medium { border-left-color: var(--amber); }
.theme-summary.high { border-left-color: var(--red); }
.legend-panel { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.legend-panel > div { display: flex; flex-wrap: wrap; gap: .8rem; }
.legend-panel p { color: var(--muted); margin: 0; font-size: .83rem; }
.legend-key { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; }
.legend-key i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.legend-key.low { color: var(--green); }.legend-key.medium { color: var(--amber); }.legend-key.high { color: var(--red); }
.result-topic { margin-bottom: 1rem; padding: 0; overflow: hidden; }
.result-topic-heading { padding: 1.1rem; background: var(--surface-soft); align-items: center; }
.result-topic-heading > div { flex: 1; }
.result-topic-heading > strong { font-size: 1.5rem; }
.results-table-wrap { overflow-x: auto; }
.results-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: .86rem; }
.results-table th, .results-table td { padding: .8rem; border-bottom: 1px solid var(--line); text-align: right; vertical-align: top; }
.results-table th:first-child, .results-table td:first-child { text-align: left; }
.results-table th { color: var(--muted); font-size: .75rem; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table details summary { cursor: pointer; list-style-position: outside; }
.results-table details p { margin: .5rem 0; color: var(--muted); }
.polarization { display: inline-block; margin-left: .5rem; color: var(--amber); font-size: .7rem; }
.score-cell { display: inline-flex; justify-content: flex-end; align-items: center; gap: .45rem; min-width: 100px; }
.score-cell > i { width: 58px; height: 7px; overflow: hidden; background: var(--surface-soft); border-radius: 999px; }
.score-cell > i b { display: block; height: 100%; background: currentColor; }
.score-cell.low { color: var(--green); }.score-cell.medium { color: var(--amber); }.score-cell.high { color: var(--red); }
.distribution { display: grid; gap: .22rem; margin-top: .7rem; max-width: 480px; }
.distribution > div { display: grid; grid-template-columns: 20px 1fr 28px; gap: .35rem; align-items: center; }
.distribution i { height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-soft); }
.distribution b { display: block; height: 100%; background: var(--blue); }
.method-note { color: var(--muted); }

@media (max-width: 900px) {
    .landing-hero, .admin-grid { grid-template-columns: 1fr; }
    .admin-side { order: -1; }
    .sticky-panel { position: static; }
    .feature-grid { grid-template-columns: 1fr; }
    .team-row { grid-template-columns: auto 1fr auto; }
    .team-row > .button, .team-row > form { grid-column: 2 / -1; }
    .simulation-form { grid-template-columns: 1fr 1fr; }
    .check-grid { grid-template-columns: repeat(2, 1fr); }
    .rating-ready { grid-template-columns: 1fr; }
    .number-scale { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 620px) {
    .page { width: min(100% - 1rem, 1220px); padding-top: 1rem; }
    .site-header, .site-footer, .page-heading, .work-hero, .rating-hero, .results-hero, .board-hero, .legend-panel { align-items: flex-start; flex-direction: column; }
    .header-actions { display: none; }
    .landing-hero { padding: 1.4rem; }
    h1 { font-size: 2.15rem; }
    .survey-row { grid-template-columns: auto 1fr; }
    .survey-row > .status-pill { grid-column: 2; }
    .form-grid.two, .simulation-form { grid-template-columns: 1fr; }
    .phase-track { overflow-x: auto; grid-template-columns: repeat(6, 90px); padding-bottom: .4rem; }
    .panel-heading, .submit-bar { align-items: stretch; flex-direction: column; }
    .team-row { grid-template-columns: auto 1fr; }
    .team-row > .status-pill { grid-column: 2; }
    .board-status { width: 100%; }
    .number-scale { grid-template-columns: repeat(4, 1fr); }
    .rating-progress-wrap { top: .25rem; }
    .scale-explainer { flex-direction: column; }
    .qr-block { flex-direction: column; align-items: flex-start; }
    .site-footer { padding-inline: 1rem; }
}

