:root {
  --night: #07162e;
  --night-2: #102443;
  --paper: #edf3f6;
  --ink: #12223a;
  --muted: #607188;
  --gold: #d69a3a;
  --aqua: #4eb3c5;
  --violet: #9a82d1;
  --line: rgba(209, 224, 234, .18);
  --shadow: 0 24px 70px rgba(0, 13, 34, .24);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  --sans: "BIZ UDPGothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); line-height: 1.7; }
button, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--aqua); outline-offset: 3px; }

.legal-ribbon { position: sticky; top: 0; z-index: 20; min-height: 34px; padding: 7px 24px; color: #d9e5ec; background: #020b1b; font-size: 11px; letter-spacing: .08em; text-align: center; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(214,154,58,.16); }
.masthead { display: flex; justify-content: space-between; align-items: center; min-height: 74px; padding: 12px clamp(20px, 5vw, 72px); color: white; background: var(--night); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-family: var(--serif); font-weight: 700; letter-spacing: .08em; }
.brand small { display: block; margin-top: -4px; color: #8da1ba; font-family: var(--mono); font-size: 9px; letter-spacing: .18em; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #8aa0b9; border-radius: 50%; color: var(--gold); }
.source-toggle { padding: 8px 13px; color: #dbe6ed; background: transparent; border: 1px solid #49617e; border-radius: 3px; font-size: 12px; }

.hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(430px, 1.1fr); gap: clamp(28px, 6vw, 90px); align-items: center; min-height: 620px; padding: 70px clamp(20px, 7vw, 108px) 94px; color: white; background: radial-gradient(circle at 70% 45%, #183657 0, var(--night) 48%, #040d1e 100%); overflow: hidden; }
.eyebrow { margin: 0 0 12px; color: var(--aqua); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(38px, 5.3vw, 72px); font-weight: 600; line-height: 1.28; letter-spacing: -.04em; }
.hero h1 em { color: var(--gold); font-style: normal; border-bottom: 1px solid var(--gold); }
.lead { max-width: 610px; margin: 28px 0 0; color: #bbcad8; font-size: 15px; }

.council-table { position: relative; min-height: 440px; isolation: isolate; }
.council-table::before { content: ""; position: absolute; inset: 18% 17% 16%; z-index: -2; border: 1px solid rgba(135,176,201,.4); clip-path: polygon(50% 0, 100% 100%, 0 100%); background: linear-gradient(135deg, rgba(78,179,197,.08), rgba(154,130,209,.08)); box-shadow: inset 0 0 80px rgba(78,179,197,.08); }
.table-lines i { position: absolute; left: 50%; top: 50%; z-index: -1; width: 42%; height: 1px; transform-origin: left; background: linear-gradient(90deg, rgba(214,154,58,.7), transparent); }
.table-lines i:nth-child(1) { transform: rotate(-90deg); }
.table-lines i:nth-child(2) { transform: rotate(28deg); }
.table-lines i:nth-child(3) { transform: rotate(152deg); }
.seat { position: absolute; display: grid; justify-items: center; width: 150px; color: #dce7ee; text-align: center; transition: transform .25s ease, filter .25s ease; }
.seat span { display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 10px; border: 1px solid currentColor; border-radius: 50%; background: rgba(7,22,46,.82); font-family: var(--serif); font-size: 34px; box-shadow: 0 0 0 9px rgba(255,255,255,.03), 0 14px 32px rgba(0,0,0,.24); }
.seat b { font-family: var(--serif); font-size: 14px; letter-spacing: .05em; }
.seat small { color: #8195ac; font-size: 11px; }
.seat-shibusawa { left: 50%; top: 0; transform: translateX(-50%); color: var(--gold); }
.seat-fukuzawa { right: 0; bottom: 0; color: var(--aqua); }
.seat-nitobe { left: 0; bottom: 0; color: var(--violet); }
.seat.active { filter: drop-shadow(0 0 18px currentColor); }
.seat-shibusawa.active { transform: translateX(-50%) translateY(-7px); }
.seat-fukuzawa.active, .seat-nitobe.active { transform: translateY(-7px); }
.table-center { position: absolute; left: 50%; top: 55%; display: grid; width: 165px; min-height: 82px; place-content: center; padding: 12px; transform: translate(-50%, -50%); color: white; background: #0b1a31; border: 1px solid #5f738b; border-radius: 50%; text-align: center; box-shadow: 0 12px 50px rgba(0,0,0,.28); }
.table-center small { color: #7890a8; font-family: var(--mono); font-size: 9px; letter-spacing: .16em; }
.table-center strong { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-family: var(--serif); font-size: 12px; line-height: 1.45; }

.consultation, .results { max-width: 1180px; margin: 0 auto; padding: 90px 28px; }
.section-heading, .results-bar { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid #c9d5dc; }
.section-heading h2, .results h2 { margin: 0; font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); font-weight: 600; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); font-size: 13px; }
#consult-form { padding-top: 34px; }
#consult-form > label, fieldset legend, .adviser-picker label { display: block; margin-bottom: 8px; color: #52667c; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
textarea { display: block; width: 100%; min-height: 142px; padding: 21px 22px; resize: vertical; color: var(--ink); background: white; border: 1px solid #b9c8d1; border-radius: 2px; font-family: var(--serif); font-size: 20px; line-height: 1.7; box-shadow: 0 10px 30px rgba(25,53,74,.06); }
textarea::placeholder { color: #9aa9b4; }
.sample-row { display: flex; gap: 12px; align-items: start; margin-top: 14px; }
.sample-row > span { flex: 0 0 auto; padding-top: 5px; color: var(--muted); font-size: 11px; }
#sample-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 8px; }
.sample-chip { flex: 0 0 auto; max-width: 235px; padding: 6px 10px; color: #3d566e; background: transparent; border: 1px solid #bdcbd4; border-radius: 20px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
fieldset { margin: 30px 0 0; padding: 0; border: 0; }
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mode-card { position: relative; display: block; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card span { display: block; min-height: 80px; padding: 17px 18px; background: #e5edf1; border: 1px solid transparent; border-radius: 3px; transition: .2s ease; }
.mode-card b { display: block; font-family: var(--serif); font-size: 16px; }
.mode-card small { color: var(--muted); font-size: 11px; }
.mode-card.selected span, .mode-card:has(input:focus-visible) span { background: white; border-color: var(--night-2); box-shadow: inset 4px 0 var(--gold); }
.adviser-picker { margin-top: 22px; }
select { width: 100%; padding: 13px 15px; color: var(--ink); background: white; border: 1px solid #b9c8d1; border-radius: 2px; }
.submit-row { display: flex; gap: 20px; align-items: center; margin-top: 30px; }
.primary-action { min-width: 250px; padding: 15px 20px; color: white; background: var(--night); border: 0; border-radius: 2px; font-weight: 700; letter-spacing: .04em; box-shadow: 6px 6px 0 var(--gold); transition: transform .18s ease, box-shadow .18s ease; }
.primary-action:hover { transform: translate(2px,2px); box-shadow: 4px 4px 0 var(--gold); }
.primary-action span { float: right; }
.form-error { color: #a73535; font-size: 13px; }

.results { padding-top: 40px; }
.results-bar { align-items: center; }
.voice-controls { display: flex; flex-wrap: wrap; gap: 8px; justify-content: end; }
.voice-label { flex-basis: 100%; color: #7c5260; font-size: 10px; text-align: right; }
.voice-controls button, .turn-play { padding: 7px 10px; color: var(--ink); background: transparent; border: 1px solid #9dafbb; border-radius: 2px; font-size: 11px; }
#grounding-notice { margin: 20px 0; }
.grounding { padding: 12px 14px; color: #36556d; background: #ddeaf0; border-left: 3px solid var(--aqua); font-size: 12px; }
.grounding.limited { color: #704f24; background: #f2e8d2; border-color: var(--gold); }
.stage-heading { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; margin: 42px 0 15px; color: #5e7184; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; }
.stage-heading::after { content: ""; height: 1px; background: #c9d5dc; }
.turn { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 24px 0; border-bottom: 1px solid #cdd8de; }
.turn.speaker-shibusawa { --speaker-color: var(--gold); }
.turn.speaker-fukuzawa { --speaker-color: var(--aqua); }
.turn.speaker-nitobe { --speaker-color: var(--violet); }
.turn.speaker-moderator { --speaker-color: #667b91; }
.turn-speaker { display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-content: start; }
.speaker-seal { display: grid; place-items: center; width: 46px; height: 46px; color: var(--speaker-color, var(--ink)); border: 1px solid currentColor; border-radius: 50%; font-family: var(--serif); font-size: 19px; }
.turn-speaker b { padding-top: 3px; font-family: var(--serif); font-size: 14px; }
.turn-speaker small { display: block; color: var(--muted); font-size: 9px; }
.turn-body p { margin: 0 0 13px; font-family: var(--serif); font-size: 17px; line-height: 1.95; }
.attribution-label { margin-bottom: 8px; color: #735421; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.responds-to { margin: -2px 0 13px; padding: 8px 10px; color: #5b6d7d; background: #e2eaee; font-size: 10px; }
.turn-meta { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.evidence-badge { padding: 3px 6px; color: #40576b; background: #dfe8ed; font-family: var(--mono); font-size: 9px; letter-spacing: .06em; }
.evidence-link { padding: 0; color: #506c82; background: transparent; border: 0; border-bottom: 1px solid currentColor; font-size: 10px; }
.turn.playing { margin-inline: -18px; padding-inline: 18px; background: rgba(255,255,255,.65); box-shadow: inset 3px 0 var(--speaker-color, var(--gold)); }
.options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 17px; }
.option { padding: 17px; background: white; border-top: 3px solid var(--gold); box-shadow: 0 8px 24px rgba(19,49,69,.08); }
.option b { display: block; margin-bottom: 7px; font-family: var(--serif); }
.option p { margin: 0; color: #54677a; font-family: var(--sans); font-size: 12px; line-height: 1.7; }

.source-drawer { position: fixed; top: 0; right: 0; z-index: 40; width: min(510px, 94vw); height: 100vh; padding: 34px; overflow-y: auto; color: var(--ink); background: #f7fafb; transform: translateX(105%); transition: transform .25s ease; box-shadow: -16px 0 60px rgba(0,0,0,.2); }
.source-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: start; padding-bottom: 18px; border-bottom: 1px solid #c8d4dc; }
.drawer-head h2 { margin: 0; font-family: var(--serif); }
.drawer-head button { width: 38px; height: 38px; background: transparent; border: 1px solid #aebdc6; border-radius: 50%; font-size: 22px; }
.drawer-rule { display: grid; grid-template-columns: 100px 1fr; gap: 12px; margin-top: 16px; font-size: 11px; }
.drawer-rule b { font-family: var(--mono); color: #395b70; }
.drawer-warning { margin: 22px 0; padding: 14px; color: #684d2b; background: #f0e5d0; font-size: 11px; }
.drawer-section-title { margin: 28px 0 4px; color: #52677b; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.source-item, .evidence-item { padding: 18px 8px; border-bottom: 1px solid #d5dfe4; transition: background .18s ease, box-shadow .18s ease; }
.source-item code, .evidence-item code { color: #6b7d8a; font-size: 9px; }
.source-item h3, .evidence-item h3 { margin: 4px 0; font-family: var(--serif); font-size: 15px; }
.source-item p, .evidence-item p { margin: 4px 0; color: var(--muted); font-size: 11px; }
.source-item a, .evidence-item a { color: #1f6680; font-size: 11px; overflow-wrap: anywhere; }
.source-item.targeted, .evidence-item.targeted { background: #fff4dc; box-shadow: inset 3px 0 var(--gold); }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(2,8,18,.55); backdrop-filter: blur(2px); }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px clamp(20px,7vw,108px); color: #91a4b8; background: var(--night); font-size: 10px; letter-spacing: .05em; }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; padding-top: 55px; }
  .council-table { min-height: 390px; }
  .section-heading, .results-bar { align-items: start; flex-direction: column; }
  .voice-controls { justify-content: start; }
  .voice-label { text-align: left; }
  .turn { grid-template-columns: 1fr; gap: 13px; }
  .options { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .legal-ribbon { position: relative; padding-inline: 12px; }
  .masthead { padding-inline: 16px; }
  .brand { font-size: 13px; }
  .source-toggle { max-width: 115px; }
  .hero { min-height: auto; padding: 45px 20px 60px; }
  .lead { font-size: 13px; }
  .council-table { min-height: 340px; }
  .seat { width: 105px; }
  .seat span { width: 62px; height: 62px; font-size: 26px; }
  .seat b { font-size: 11px; }
  .table-center { width: 130px; }
  .consultation, .results { padding-inline: 18px; }
  .section-heading > p { font-size: 11px; }
  .mode-grid { grid-template-columns: 1fr; }
  textarea { font-size: 16px; }
  .submit-row { align-items: stretch; flex-direction: column; }
  .primary-action { width: 100%; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
