/*
VOICE: 仲間内で回す「受験票」。事務的すぎず、毎日ひらきたくなる落ち着いた道具。
IDEA: ミシン目つきの受験票と、合格の朱印。
PICTURE: ホーム最上段の受験票カウントダウン。半券には名前と過去問の消化数。
COLOUR and TYPE: 深い青緑を主に白地、朱をひとさし。Zen Kaku Gothic New と Outfit の数字。
LAYOUT: スマホは1カラムと下タブ、広い画面は上タブで最大960px。
*/
:root {
  color-scheme: light;
  --bg: #f2f4f1;
  --card: #ffffff;
  --card2: #f6f8f6;
  --ink: #13201c;
  --muted: #586863;
  --line: #dce3df;
  --brand: #0b5d57;
  --brand-deep: #073f3b;
  --brand-soft: #e3f0ee;
  --ticket: #0b5d57;
  --on-brand: #ffffff;
  --accent: #d63f1d;
  --ok: #1f6fd1;
  --ng: #c4302b;
  --m0: #257de0; --m1: #f47230; --m2: #00b894; --m3: #f2a600; --m4: #ee7fac; --m5: #008a17; --m6: #6a4ce2;
  --p1: #cce3fd; --p2: #84b9f3; --p3: #2370cd;
  --f1: #fde3e1; --f2: #f5aaa5; --f3: #dc4a45;
  --shadow: 0 1px 2px rgb(10 30 25 / .06), 0 6px 20px rgb(10 30 25 / .06);
  --r: 14px;
  --nav-h: 64px;
  --font: "Zen Kaku Gothic New", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --num: "Outfit", "Zen Kaku Gothic New", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0c1311; --card: #141e1b; --card2: #1a2623; --ink: #e4ebe8; --muted: #93a39d; --line: #26332f;
    --brand: #2c9d91; --ticket: #136158; --brand-deep: #0f3632; --brand-soft: #16302c; --accent: #ff6b4a; --ok: #4f9cf0; --ng: #f06a65;
    --m0: #338ced; --m1: #e76624; --m2: #00a888; --m3: #d28e05; --m4: #e24d8b; --m5: #0aac23; --m6: #9887ef;
    --p1: #183a61; --p2: #1f5796; --p3: #338ced; --f1: #43201f; --f2: #7a2c2a; --f3: #c9403b;
    --shadow: 0 1px 2px rgb(0 0 0 / .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c1311; --card: #141e1b; --card2: #1a2623; --ink: #e4ebe8; --muted: #93a39d; --line: #26332f;
  --brand: #2c9d91; --ticket: #136158; --brand-deep: #0f3632; --brand-soft: #16302c; --accent: #ff6b4a; --ok: #4f9cf0; --ng: #f06a65;
  --m0: #338ced; --m1: #e76624; --m2: #00a888; --m3: #d28e05; --m4: #e24d8b; --m5: #0aac23; --m6: #9887ef;
  --p1: #183a61; --p2: #1f5796; --p3: #338ced; --f1: #43201f; --f2: #7a2c2a; --f3: #c9403b;
  --shadow: 0 1px 2px rgb(0 0 0 / .3);
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--font); overflow-x: clip;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.25; margin: 0; text-wrap: balance; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }

/* ───── ヘッダーとタブ ───── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--brand-deep); color: var(--on-brand);
}
.brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: .02em; }
.brand svg { width: 26px; height: 26px; color: #fff; }
.who {
  margin-left: auto; border: 1px solid rgb(255 255 255 / .35); background: transparent; color: #fff;
  border-radius: 999px; padding: 6px 14px; min-height: 40px; cursor: pointer; display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.who i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--nav-h); color: var(--muted); text-decoration: none; font-size: 12px;
}
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[data-view="home"] svg, .tabs a[data-view="scores"] svg, .tabs a[data-view="info"] svg { fill: currentColor; fill-opacity: .14; }
.tabs a.on { color: var(--brand); font-weight: 700; }
.tabs a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font: 700 11px/18px var(--num); text-align: center; }
@media (min-width: 820px) {
  body { padding-bottom: 40px; }
  .tabs { position: static; display: flex; gap: 4px; background: transparent; border: 0; padding: 0; margin-left: 24px; }
  .tabs a { flex-direction: row; height: 40px; padding: 0 14px; border-radius: 10px; color: rgb(255 255 255 / .78); font-size: 15px; gap: 6px; }
  .tabs svg { width: 20px; height: 20px; }
  .tabs a.on { background: rgb(255 255 255 / .14); color: #fff; }
  .tabs a.on::before { display: none; }
  .badge { position: static; margin-left: 2px; }
}

.menu { position: fixed; z-index: 40; top: calc(env(safe-area-inset-top) + 58px); right: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 180px; }
.menu button { text-align: left; border: 0; background: none; padding: 12px 14px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.menu button:hover { background: var(--card2); }

/* ───── 共通部品 ───── */
main { display: block; max-width: 980px; margin: 0 auto; padding: 16px max(16px, env(safe-area-inset-left)) 24px; outline: none; }
.boot { color: var(--muted); padding: 40px 0; text-align: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-h h2 { font-size: 20px; }
.sec-h .sub { color: var(--muted); font-size: 14px; }
.sec-h .more { margin-left: auto; font-size: 14px; }
.page-h { margin: 6px 0 16px; }
.page-h h1 { font-size: clamp(24px, 5vw, 32px); }
.page-h p { margin: 6px 0 0; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap;
}
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }
.row-btns { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px; min-height: 40px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: 15px;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; white-space: nowrap; }
.tag.warn { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.tag.plain { background: var(--card2); color: var(--muted); }
.empty { color: var(--muted); padding: 14px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; font-size: 15px; }
.err { color: var(--ng); font-size: 14px; margin: 8px 0 0; min-height: 1em; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.field input, .field select, .search {
  font-size: 16px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 46px; width: 100%;
}
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ───── ログイン ───── */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; background: var(--brand-deep); margin: -16px calc(-1 * max(16px, env(safe-area-inset-left))) -24px; }
.login-box { width: min(440px, 100%); }
.login h1 { color: #fff; font-size: 36px; letter-spacing: .02em; }
.login .lead { color: rgb(255 255 255 / .8); margin: 6px 0 18px; }
.login .card { padding: 20px; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 6px 0 16px; }
.names .chip { justify-content: center; border-radius: 12px; min-height: 48px; font-size: 16px; white-space: nowrap; padding: 6px 8px; }
.login-count { color: #fff; display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.login-count b { font: 700 44px/1 var(--num); color: #fff; }

/* ───── 受験票（カウントダウン） ───── */
.ticket {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  background: var(--ticket); color: var(--on-brand); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.ticket-main { padding: 20px 22px 22px; position: relative; }
.ticket-main::after { content: ""; position: absolute; right: -1px; top: 14px; bottom: 14px; border-right: 2px dashed rgb(255 255 255 / .35); }
.ticket .kicker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; opacity: .92; }
.ticket .kicker .tag { background: rgb(255 255 255 / .16); color: #fff; }
.ticket .kicker .tag.fixed { background: #fff; color: var(--brand-deep); }
.count { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 4px; flex-wrap: wrap; }
.count .pre { font-size: 20px; font-weight: 700; }
.count .big { font: 700 clamp(64px, 18vw, 112px)/.95 var(--num); letter-spacing: -.02em; }
.count .unit { font-size: 24px; font-weight: 700; }
.count-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 15px; opacity: .92; }
.count-sub b { font-family: var(--num); font-size: 18px; }
.exam-date { margin-top: 12px; font-weight: 700; font-size: 16px; }
.exam-date small { font-weight: 400; opacity: .8; }
.ticket-stub {
  width: 132px; padding: 18px 14px; background: var(--brand-deep); display: grid; align-content: space-between; gap: 10px; text-align: center; position: relative;
}
.ticket-stub::before, .ticket-stub::after { content: ""; position: absolute; left: -11px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); }
.ticket-stub::before { top: -11px; } .ticket-stub::after { bottom: -11px; }
.stub-label { font-size: 12px; opacity: .75; }
.stub-name { font-size: 20px; font-weight: 700; }
.stamp {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--accent); color: var(--accent); background: #fff;
  display: grid; place-content: center; transform: rotate(-12deg); line-height: 1.05;
}
.stamp b { font: 700 24px/1 var(--num); }
.stamp span { font-size: 11px; font-weight: 700; }
@media (max-width: 520px) {
  .ticket { grid-template-columns: 1fr; }
  .ticket-main::after { right: 14px; left: 14px; top: auto; bottom: -1px; border-right: 0; border-bottom: 2px dashed rgb(255 255 255 / .35); }
  .ticket-stub { width: auto; grid-template-columns: auto 1fr auto; align-items: center; text-align: left; padding: 14px 18px; }
  .ticket-stub::before, .ticket-stub::after { left: auto; top: -11px; bottom: auto; }
  .ticket-stub::before { left: -11px; } .ticket-stub::after { right: -11px; }
  .stamp { width: 64px; height: 64px; }
  .stamp b { font-size: 20px; }
}
@media (prefers-reduced-motion: no-preference) {
  .stamp { animation: press .5s cubic-bezier(.2, 1.6, .4, 1) both .15s; }
  @keyframes press { from { transform: rotate(-12deg) scale(1.6); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }
}
.pace { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pace div { background: var(--card2); border-radius: 12px; padding: 12px 14px; }
.pace b { display: block; font: 700 26px/1.1 var(--num); }
.pace span { font-size: 13px; color: var(--muted); }

/* ───── チーム一覧 ───── */
.team { display: grid; gap: 2px; }
.team-row { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) 4.2em 4.2em; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.team-row:last-child { border-bottom: 0; }
.team-row.me { background: var(--brand-soft); border-radius: 10px; padding-inline: 8px; }
.team-head { font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.team-name { display: flex; align-items: center; gap: 6px; font-weight: 700; white-space: nowrap; }
.prog { display: grid; gap: 4px; }
.prog-bar { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.prog-bar i { display: block; height: 100%; border-radius: 4px; }
.prog small { font-size: 12px; color: var(--muted); }
.team-num { text-align: right; font: 600 18px/1.1 var(--num); white-space: nowrap; }
.team-num small { display: block; font: 400 11px/1.3 var(--font); color: var(--muted); }
.pass-ok { color: var(--ok); } .pass-ng { color: var(--ng); }

.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.feed li:last-child { border-bottom: 0; }
.feed time { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sched { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sched li { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sched li:last-child { border-bottom: 0; }
.sched b { font-weight: 700; color: var(--brand); white-space: nowrap; }

/* ───── 点数マトリクス ───── */
.matrix { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; font-size: 14px; }
.matrix th { font-weight: 700; font-size: 13px; padding: 4px 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matrix thead th { vertical-align: bottom; }
.matrix th.ex { text-align: left; width: 4.6em; color: var(--muted); font-weight: 500; }
.matrix th .dot { display: block; margin: 0 auto 4px; }
.matrix th.me { color: var(--brand); }
.matrix td { text-align: center; padding: 0; height: 38px; border-radius: 6px; background: var(--card2); font: 600 15px/38px var(--num); cursor: default; }
.matrix td.na { color: var(--line); font-weight: 400; }
.matrix td.p1 { background: var(--p1); } .matrix td.p2 { background: var(--p2); } .matrix td.p3 { background: var(--p3); color: #fff; }
.matrix td.f1 { background: var(--f1); } .matrix td.f2 { background: var(--f2); } .matrix td.f3 { background: var(--f3); color: #fff; }
.matrix td sup { font-size: 9px; margin-left: 1px; vertical-align: 5px; }
.matrix .pl { font: 500 12px/1 var(--num); color: var(--muted); display: block; margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); margin-top: 10px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* 横棒グラフ（年度別の最高点） */
.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 5.2em minmax(0, 1fr) 2.6em; gap: 10px; align-items: center; min-height: 30px; }
.bar-row > span:first-child { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar-track { position: relative; height: 16px; background: var(--card2); border-radius: 0 4px 4px 0; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
.bar-pass { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.bar-val { text-align: right; font: 600 15px var(--num); white-space: nowrap; }
.meter { display: grid; gap: 10px; }
.meter-row { display: grid; gap: 4px; }
.meter-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.meter-top b { font-weight: 700; }
.meter-bars { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 3.4em; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.meter-bars .track { height: 8px; border-radius: 4px; background: var(--card2); overflow: hidden; }
.meter-bars .track i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.meter-bars .track i.q { background: var(--m6); }
.meter-bars span:last-child { text-align: right; font-family: var(--num); color: var(--ink); }

.attempts { width: 100%; border-collapse: collapse; font-size: 15px; }
.attempts th, .attempts td { padding: 10px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.attempts th { font-size: 12px; color: var(--muted); font-weight: 500; }
.attempts td.r { text-align: right; font-family: var(--num); white-space: nowrap; }
.attempts .memo { color: var(--muted); font-size: 13px; }
.attempts .acts { display: flex; gap: 6px; justify-content: flex-end; }

/* ───── 過去問一覧 ───── */
.exams { display: grid; gap: 10px; }
.exam { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.exam h3 { font-size: 18px; }
.exam .facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin-top: 2px; }
.exam .facts b { color: var(--ink); font-family: var(--num); font-size: 16px; }
.exam .who-did { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.exam .who-did span { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; background: var(--card2); border-radius: 999px; padding: 2px 9px 2px 6px; white-space: nowrap; }
.exam .acts { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 560px) { .exam { grid-template-columns: 1fr; } .exam .acts { flex-direction: row; flex-wrap: wrap; } }

/* ───── 演習 ───── */
.qcard { padding: 22px 20px; }
.qmeta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.qprog { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; margin: 12px 0 16px; }
.qprog i { display: block; height: 100%; background: var(--brand); transition: width .25s; }
.qtext { font-size: 19px; line-height: 1.75; margin: 4px 0 20px; }
.ox { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ox button {
  min-height: 84px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); cursor: pointer;
  font: 700 44px/1 var(--num); display: grid; place-items: center;
}
.ox button:hover { border-color: var(--brand); }
.ox button.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--card)); }
.ox button.wrong { border-color: var(--ng); background: color-mix(in srgb, var(--ng) 10%, var(--card)); }
.verdict { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--card2); }
.verdict h3 { font-size: 18px; margin-bottom: 6px; }
.verdict.ok h3 { color: var(--ok); } .verdict.ng h3 { color: var(--ng); }
.verdict p { margin: 0; }
.result-big { font: 700 64px/1 var(--num); }
.wronglist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.wronglist li { padding: 12px 14px; border-radius: 12px; background: var(--card2); font-size: 15px; }
.wronglist .ans { font-weight: 700; color: var(--ng); }
.setup-row { display: grid; gap: 8px; margin-bottom: 16px; }
.setup-row > b { font-size: 14px; color: var(--muted); font-weight: 500; }
.ai-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.ai-list li { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; padding: 10px 12px; background: var(--card2); border-radius: 10px; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 3px solid rgb(255 255 255 / .4); border-top-color: #fff; border-radius: 50%; display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }

/* ───── 情報 ───── */
.news { list-style: none; margin: 0; padding: 0; display: grid; }
.news li { display: grid; grid-template-columns: 6.2em 1fr; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.news li:last-child { border-bottom: 0; }
.news time { font: 500 14px var(--num); color: var(--muted); white-space: nowrap; padding-top: 2px; }
.news a { color: var(--ink); text-decoration: none; }
.news a:hover { text-decoration: underline; }
.news .files { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.news .new { color: var(--accent); font-weight: 700; font-size: 12px; margin-right: 6px; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.links a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 44px; }
.links li:last-child a { border-bottom: 0; }
.links a::after { content: "↗"; color: var(--muted); }
.yt { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.yt a { display: grid; gap: 6px; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); align-content: start; }
.yt a:hover { border-color: var(--brand); }
.yt .yt-h { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; }
.yt .play { width: 34px; height: 24px; border-radius: 7px; background: #e1251b; display: grid; place-items: center; }
.yt .play::after { content: ""; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; }
.yt b { font-size: 16px; line-height: 1.35; }
.yt p { margin: 0; font-size: 14px; color: var(--muted); }
.yt .tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pick { border: 2px solid var(--brand); }

/* ───── ダイアログ・ツールチップ・トースト ───── */
dialog.sheet {
  border: 0; padding: 0; border-radius: 18px; width: min(520px, calc(100vw - 24px)); max-height: calc(100svh - 32px);
  background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgb(0 0 0 / .3);
}
dialog.sheet::backdrop { background: rgb(5 20 18 / .5); }
dialog.sheet form { padding: 20px; overflow: auto; max-height: calc(100svh - 32px); }
dialog.sheet h2 { font-size: 22px; margin-bottom: 12px; }
.parts { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 2px; margin: 0 0 12px; }
.parts legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
.parts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
@media (max-width: 600px) {
  dialog.sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
  dialog.sheet form { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--ink); color: var(--bg); padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.45; max-width: 240px; box-shadow: var(--shadow); white-space: pre-line; }
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 14px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (min-width: 820px) { .toast { bottom: 24px; } }

@media (max-width: 600px) {
  .card { padding: 16px 14px; }
  .team-row { grid-template-columns: 4.6em minmax(0, 1fr) 3.6em 3.6em; gap: 8px; }
  .matrix { font-size: 13px; border-spacing: 1px; }
  .matrix td { font-size: 14px; height: 34px; line-height: 34px; }
  .matrix th { font-size: 11px; }
  .matrix th.ex { width: 3.9em; font-size: 11px; }
  .qtext { font-size: 18px; }
}
