:root {
  color-scheme: light;
  --paper: #FBFAF7;
  --surface: #FFFFFF;
  --ink: #13201F;
  --ink-60: #5C6664;
  --rule: #DCE4E1;
  --chip: #EEF2F0;
  --tint: #E3F4F2;
  --accent: #007D76;
  --on-accent: #FFFFFF;
  --accent-text: #007D76;
  --teal: #00A39A;
  --cyan: #21B4E6;
  --amber: #F5A623;
  --amber-ink: #3D2800;
  --pink: #ED107B;
  --band: #13201F;
  --on-band: #E4EBE9;
  --on-band-2: #9FB0AC;
  --focus: #21B4E6;
  --error: #B8005E;
  --brand-pink: #ED107B;
  --gate-base: #F6F7F4;
  --gate-glow-1: #E2F5F2;
  --gate-glow-2: #FCE4EF;
  --gate-ink: #29292B;
  --gate-ink-2: #566766;
  --gate-rule: #CDDDDB;
  --gate-field: #FFFFFF;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0F1A19;
    --surface: #172422;
    --ink: #E4EBE9;
    --ink-60: #9FB0AC;
    --rule: #2A3B38;
    --chip: #22322F;
    --tint: #123B37;
    --accent: #3CC9BF;
    --on-accent: #0F1A19;
    --accent-text: #5FD3CA;
    --band: #0A1312;
    --error: #FF7AB6;
    --gate-base: #0F1A19;
    --gate-glow-1: rgba(0, 163, 154, 0.22);
    --gate-glow-2: rgba(237, 16, 123, 0.20);
    --gate-ink: #EEF2F0;
    --gate-ink-2: #A9B8B5;
    --gate-rule: #2E403D;
    --gate-field: #172422;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0F1A19;
  --surface: #172422;
  --ink: #E4EBE9;
  --ink-60: #9FB0AC;
  --rule: #2A3B38;
  --chip: #22322F;
  --tint: #123B37;
  --accent: #3CC9BF;
  --on-accent: #0F1A19;
  --accent-text: #5FD3CA;
  --band: #0A1312;
  --error: #FF7AB6;
  --gate-base: #0F1A19;
  --gate-glow-1: rgba(0, 163, 154, 0.22);
  --gate-glow-2: rgba(237, 16, 123, 0.20);
  --gate-ink: #EEF2F0;
  --gate-ink-2: #A9B8B5;
  --gate-rule: #2E403D;
  --gate-field: #172422;
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; background: var(--paper); scroll-padding-top: env(safe-area-inset-top, 0px); }
html[data-screen="gate"] {
  background:
    radial-gradient(60% 75% at 88% 6%, var(--gate-glow-1) 0%, transparent 70%),
    radial-gradient(55% 70% at 6% 100%, var(--gate-glow-2) 0%, transparent 72%),
    var(--gate-base);
}
body { height: 100%; margin: 0; color: var(--ink); background: transparent;
  font: 400 16px/1.8 'Plus Jakarta Sans', 'Noto Sans JP', system-ui, sans-serif;
  letter-spacing: 0.02em; -webkit-font-smoothing: antialiased; }
#app { min-height: 100%; display: flex; flex-direction: column; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3 { font-family: 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: clamp(28px, 5.4vw, 40px); line-height: 1.4; margin: 0 0 12px; }
h2 { font-size: 22px; line-height: 1.5; margin: 0 0 8px; }
h3 { font-size: 18px; line-height: 1.5; margin: 0; }
p { margin: 0; }
.wordmark { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--pink); line-height: 1; }
.topbar { width: 100%; max-width: 980px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar__org { font-size: 13px; color: var(--ink-60); text-align: right; }
.wrap { width: 100%; max-width: 660px; margin: 0 auto; padding: 16px 20px 72px; flex: 1; }
.wrap--wide { max-width: 980px; }
.lead { color: var(--ink-60); font-size: 17px; margin-bottom: 28px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 30px; border-radius: 999px; border: 0; font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; background: var(--accent); color: var(--on-accent); text-decoration: none; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn--night { background: #13201F; color: #FFFFFF; }
.btn--white-line { background: transparent; color: #FFFFFF; box-shadow: inset 0 0 0 2px #FFFFFF; }
.link { background: none; border: 0; font: inherit; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 0; }

/* gate */
.gate { flex: 1; display: flex; flex-direction: column; color: var(--gate-ink); }
.gate__bar { position: fixed; top: 0; left: 0; right: 0; height: calc(5px + env(safe-area-inset-top, 0px)); background: var(--brand-pink); z-index: 10; }
.gate__inner { width: 100%; max-width: 1180px; margin: 0 auto; padding: clamp(44px, 9vh, 110px) clamp(20px, 6vw, 72px) 64px; display: flex; flex-direction: column; gap: clamp(40px, 9vh, 104px); }
.brandrow { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 18px; }
.gate .wordmark { color: var(--brand-pink); font-size: 30px; }
.brandrow__sep { width: 1px; height: 34px; background: var(--gate-rule); }
.appmark { display: inline-flex; align-items: center; gap: 12px; color: var(--gate-ink-2); font-weight: 700; font-size: 17px; }
.appmark svg { width: 34px; height: 34px; flex: none; }
.gate__main { display: flex; flex-direction: column; gap: 20px; max-width: 780px; }
.gate h1 { font-size: clamp(36px, 6.4vw, 72px); line-height: 1.22; letter-spacing: -0.01em; margin: 0; color: var(--gate-ink); }
.gate__sub { font-size: 18px; font-weight: 500; color: var(--gate-ink-2); }
.gate-form { display: flex; flex-direction: column; gap: 10px; max-width: 540px; margin-top: 16px; }
.gate-form label { font-weight: 700; font-size: 15px; color: var(--gate-ink); }
.btn--gate { background: #C40D66; color: #FFFFFF; border-radius: 10px; min-height: 56px; }
.btn--gate:hover { background: #A80A57; }
.field { display: flex; flex-wrap: wrap; gap: 10px; }
.input { flex: 1 1 220px; min-height: 56px; border: 1.5px solid var(--gate-rule); border-radius: 10px; padding: 0 16px; font: 700 18px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.08em; color: var(--gate-ink); background: var(--gate-field); }
.input:focus-visible { border-color: #00A39A; }
.error { color: var(--error); font-size: 14px; font-weight: 700; }
.hint { color: var(--gate-ink-2); font-size: 13px; }

/* intro */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0; margin: 0 0 24px; border-top: 1px solid var(--rule); }
.facts div { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-size: 13px; color: var(--ink-60); }
.facts dd { margin: 0; font-weight: 700; font-size: 18px; }
.note { font-size: 13px; color: var(--ink-60); margin-bottom: 28px; }

/* setup */
.issue { padding: 24px 0; border-top: 1px solid var(--rule); }
.issue__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.tag { display: inline-block; font: 800 13px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.02em; background: var(--amber); color: var(--amber-ink); border-radius: 8px; padding: 2px 8px; }
.issue__sub { color: var(--ink-60); font-size: 14px; margin: 2px 0 14px; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 520px) { .seg { grid-template-columns: repeat(2, 1fr); } }
.seg button { min-height: 62px; border-radius: 14px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; line-height: 1.35; cursor: pointer; padding: 6px 8px; }
.seg button b { display: block; font: 800 20px 'Plus Jakarta Sans', sans-serif; }
.seg button[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.subfocus { margin-top: 16px; }
.subfocus p { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--tint); border-color: var(--teal); font-weight: 700; }
.mix { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 18px; margin: 8px 0 28px; }
.mix p { font-size: 15px; margin-bottom: 12px; }
.mixbar { display: flex; gap: 3px; height: 18px; }
.mixbar span { flex: 1; border-radius: 4px; }
.mixlegend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink-60); }
.mixlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* survey */
.qhead { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--ink-60); margin-bottom: 8px; }
.qhead__count { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--rule); border-radius: 999px; overflow: hidden; margin-bottom: 28px; }
.progress span { display: block; height: 100%; background: var(--teal); border-radius: 999px; transition: width 0.3s ease; }
.qtitle { font-size: clamp(24px, 4.6vw, 32px); }
.options { display: grid; gap: 10px; margin: 0 0 20px; }
.opt { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 14px 16px; border-radius: 18px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.65; cursor: pointer; }
.opt:hover { border-color: var(--teal); }
.opt[aria-checked="true"] { border-color: var(--teal); background: var(--tint); }
.opt__n { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font: 800 17px 'Plus Jakarta Sans', sans-serif; background: var(--chip); color: var(--ink); }
.opt[aria-checked="true"] .opt__n { background: var(--accent); color: var(--on-accent); }
.qnav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
textarea { width: 100%; min-height: 120px; border: 1.5px solid var(--rule); border-radius: 16px; padding: 14px 16px; font: inherit; color: var(--ink); background: var(--surface); resize: vertical; margin: 8px 0 22px; }
.olabel { font-weight: 700; display: block; }

/* results */
.section { padding: 40px 0; border-top: 1px solid var(--rule); }
.section__intro { color: var(--ink-60); margin-bottom: 20px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.rcard { background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.rcard--quiet { background: transparent; border-style: dashed; color: var(--ink-60); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-60); }
.kv strong { color: var(--ink); }
.score { display: flex; align-items: baseline; gap: 6px; }
.score b { font: 800 36px/1 'Plus Jakarta Sans', sans-serif; }
.score span { color: var(--ink-60); font-size: 14px; }
.bar { height: 10px; background: var(--rule); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.reading { font-size: 14px; }
.chapters { display: grid; gap: 14px; }
.chrow { display: grid; grid-template-columns: minmax(84px, 120px) 1fr 52px; gap: 14px; align-items: center; }
.chrow__name { font-weight: 700; }
.chrow__name small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-60); }
.chrow__val { font: 800 18px 'Plus Jakarta Sans', sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.selfline { margin-top: 18px; font-size: 15px; color: var(--ink-60); }
.selfline strong { color: var(--ink); font-family: 'Plus Jakarta Sans', sans-serif; }
.qcard .tag { align-self: flex-start; }
.qcard__q { font-weight: 700; }
details { border: 1px solid var(--rule); border-radius: 18px; padding: 0 18px; background: var(--surface); }
summary { cursor: pointer; padding: 16px 0; font-weight: 700; }
.alist { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.alist li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; font-size: 14px; }
.alist b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--chip); font: 800 15px 'Plus Jakarta Sans', sans-serif; }
.alist small { display: block; color: var(--ink-60); }
.band { background: var(--band); color: var(--on-band); padding: 56px 0; }
.band h2 { font-size: clamp(24px, 4.4vw, 32px); }
.band p { color: var(--on-band-2); }
.heat { margin-top: 24px; display: flex; flex-direction: column; gap: 5px; max-width: 640px; }
.heat__row { display: grid; grid-template-columns: 118px repeat(5, minmax(0, 1fr)); gap: 5px; align-items: center; }
.heat__row--head { font: 700 12px 'Plus Jakarta Sans', sans-serif; color: var(--on-band-2); text-align: center; }
.heat__label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-band); text-align: left; }
.heat__label i { width: 10px; height: 10px; border-radius: 999px; flex: none; }
.heat__cell { height: 38px; border-radius: 8px; display: grid; place-items: center; font: 800 14px 'Plus Jakarta Sans', sans-serif; }
.heat__cell--me { outline: 3px solid var(--pink); outline-offset: 2px; }
.heatlegend { margin-top: 14px; font-size: 13px; color: var(--on-band-2); display: flex; flex-wrap: wrap; gap: 6px 20px; }
.heatlegend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; outline: 3px solid var(--pink); outline-offset: 1px; margin-right: 8px; vertical-align: -2px; }
.bandfacts { margin-top: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 12px; }
.bandfacts div { border: 1px solid #2E403D; border-radius: 16px; padding: 14px 16px; }
.bandfacts b { display: block; font: 800 22px 'Plus Jakarta Sans', 'Noto Sans JP', sans-serif; color: var(--on-band); }
.bandfacts span { font-size: 13px; color: var(--on-band-2); }
.closing { background: var(--pink); color: #FFFFFF; padding: 56px 0; }
.closing h2 { font-size: clamp(28px, 5vw, 40px); line-height: 1.35; }
.closing__text { font-size: 19px; font-weight: 700; margin: 8px 0 26px; max-width: 34em; }
.closing__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.footer { padding: 24px 20px; text-align: center; font-size: 12px; color: var(--ink-60); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* forms */
.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.form-row label, .flabel { font-weight: 700; font-size: 14px; }
.text { min-height: 50px; border: 1.5px solid var(--rule); border-radius: 12px; padding: 0 14px; font: inherit; color: var(--ink); background: var(--surface); width: 100%; }
select.text { padding-right: 10px; }
.text:focus-visible { border-color: var(--teal); }
.field-error { color: var(--error); font-size: 14px; font-weight: 700; }
.confirmbox { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 18px 20px; margin-bottom: 28px; }
.confirmbox p + p { margin-top: 6px; }

/* admin */
.adm-note { font-size: 13px; color: var(--ink-60); background: var(--chip); border-radius: 12px; padding: 10px 14px; margin-bottom: 24px; }
.adm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.adm-head h1 { margin: 0; }
.tblwrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl th { font-size: 12px; color: var(--ink-60); font-weight: 700; }
.tbl tr:last-child td { border-bottom: 0; }
.code { font: 800 15px 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.06em; }
.status { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--chip); color: var(--ink); }
.status--done { background: var(--tint); }
.smallbtn { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--rule); background: transparent; color: var(--ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rowactions { display: flex; gap: 8px; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.choice button { text-align: left; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.choice button b { display: block; }
.choice button span { font-size: 13px; color: var(--ink-60); }
.choice button[aria-checked="true"] { border-color: var(--teal); background: var(--tint); }
.adm-block { padding: 22px 0; border-top: 1px solid var(--rule); }
.qlist { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.qlist li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.qlist li:last-child { border-bottom: 0; }
.qlist small { color: var(--ink-60); margin-left: 8px; }
.iconbtn { min-width: 36px; min-height: 36px; border-radius: 10px; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; font: inherit; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.addrow select { flex: 1 1 260px; }
.created { background: var(--surface); border: 1px solid var(--rule); border-radius: 20px; padding: 22px; }
.bigcode { font: 800 clamp(26px, 6vw, 40px) 'Plus Jakarta Sans', sans-serif; letter-spacing: 0.08em; color: var(--accent-text); margin: 4px 0 18px; }
.mailbox { min-height: 300px; font-size: 14px; line-height: 1.8; }
.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px 20px; margin-bottom: 8px; font-size: 14px; }
.meta dt { color: var(--ink-60); font-size: 12px; }
.meta dd { margin: 0; font-weight: 700; word-break: break-all; }

/* offers on the closing band */
.offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 8px; }
.offer { background: #FFFFFF; color: #13201F; border-radius: 20px; padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.offer h3 { font-size: 20px; }
.offer p { font-size: 15px; color: #5C6664; flex: 1; }
.offer .btn { align-self: flex-start; }
.btn--deep { background: #C40D66; color: #FFFFFF; }
.btn--outline-dark { background: transparent; color: #13201F; box-shadow: inset 0 0 0 1.5px #13201F; }

.gsi { min-height: 44px; margin: 8px 0 16px; }
.adm-user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-60); }
.loading { color: var(--ink-60); padding: 40px 0; }
