/* ポップアップ勉強スペース
   静かな集中と心地よさ。枠線に頼らず、余白・大きな数字・やわらかい影で階層をつくる。 */

:root {
  --bg: #F3F5F8;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink-2: #1E293B;
  --ink-3: #334155;
  --sub: #64748B;
  --faint: #94A3B8;
  --mist: #E2E8F0;
  --soft: #F1F5F9;
  --teal: #0D9488;
  --teal-soft: #E6F6F4;
  --amber: #D97706;
  --amber-soft: #FEF3E2;
  --rose: #E11D48;
  --rose-soft: #FDECF0;
  --line-green: #06C755;
  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .06), 0 18px 40px rgba(15, 23, 42, .16);
  --nav-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --num: "Outfit", "Zen Kaku Gothic New", sans-serif;
  --font: "Outfit", "Zen Kaku Gothic New", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-weight: 500; font-size: 15px; line-height: 1.7; letter-spacing: .01em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: 26px; line-height: 1.3; font-weight: 900; letter-spacing: 0; }
h2 { font-size: 17px; line-height: 1.4; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.ic { width: 22px; height: 22px; flex: none; display: block; }
.muted { color: var(--sub); font-size: 13.5px; }
.small { font-size: 12px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.kicker, .eyebrow {
  display: block; font-family: var(--num); font-size: 11px; font-weight: 700; line-height: 1.5;
  letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}

/* ---------- アプリヘッダー ---------- */

.status {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(243, 245, 248, .82);
  -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
}
.status-inner { max-width: 520px; margin: 0 auto; }
.app-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.app-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--num); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.app-mark { width: 30px; height: 30px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; }
.app-mark .ic { width: 17px; height: 17px; }
.status-title { font-family: var(--num); font-weight: 700; letter-spacing: .1em; font-size: 12px; color: var(--sub); }

.live-badge {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 10px; border-radius: 999px;
  font-weight: 700; font-size: 12.5px; line-height: 1.4; white-space: nowrap; background: var(--card); box-shadow: var(--shadow);
  color: var(--ink-2);
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.live-dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; background: currentColor; opacity: .35; animation: ping 1.8s ease-out infinite; }
.live-badge.LOW .live-dot, .live-badge.ON .live-dot { color: var(--teal); }
.live-badge.MID .live-dot { color: var(--amber); }
.live-badge.HIGH .live-dot { color: var(--rose); }
.live-badge.OFF { color: var(--sub); }
.live-badge.OFF .live-dot { color: var(--faint); }
.live-badge.OFF .live-dot::after { display: none; }

.notice-bar { max-width: 520px; margin: 0 auto; padding: 0 16px; }
.notice-bar:empty { display: none; }
.notice {
  display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 8px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--amber-soft); color: #7A4504; font-size: 12.5px; line-height: 1.55;
}
.notice .ic { width: 16px; height: 16px; margin-top: 2px; }

/* ---------- レイアウト ---------- */

.view { max-width: 520px; margin: 0 auto; padding: 6px 16px 24px; display: grid; gap: 14px; }
body.has-nav .view { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 56px); }

.page-head { display: grid; gap: 4px; justify-items: start; padding: 6px 4px 2px; }
.page-head h1 { margin-top: 2px; }

.panel { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px 18px; min-width: 0; }
.panel > h1 { margin-bottom: 4px; }
.panel > h1 + .muted { margin-bottom: 18px; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; }
.panel-count { font-family: var(--num); font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
.panel-count b { font-size: 22px; font-weight: 700; color: var(--ink); line-height: 1; }
.panel-sub { color: var(--sub); font-size: 12px; margin: -8px 0 14px; }
.panel-foot { color: var(--sub); font-size: 12px; text-align: center; margin-top: 16px; }

.center-box { display: grid; justify-items: center; gap: 14px; padding: 64px 16px; text-align: center; }
.radar { position: relative; width: 64px; height: 64px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }
.radar::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--teal); animation: ring 1.6s ease-out infinite; }
.radar .ic { width: 28px; height: 28px; }

.state { display: grid; gap: 12px; justify-items: start; }
.state .btn-row, .state .guide { width: 100%; }
.state-ico { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--soft); color: var(--ink-3); }
.state-ico .ic { width: 24px; height: 24px; }
.state-ico.teal { background: var(--teal-soft); color: var(--teal); }
.state-ico.amber { background: var(--amber-soft); color: var(--amber); }
.state-ico.slate { background: var(--soft); color: var(--sub); }
.rest { display: flex; gap: 14px; align-items: flex-start; }
.rest-name { color: var(--sub); font-size: 12px; }
.done { justify-items: center; text-align: center; padding: 28px 18px 20px; }
.done .state-ico { width: 60px; height: 60px; border-radius: 50%; }
.done-num { font-family: var(--num); font-size: 44px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.done-num small { font-family: var(--font); font-size: 14px; font-weight: 700; margin: 0 4px 0 2px; color: var(--ink-3); }

/* ---------- 混雑のヒーローカード ---------- */

.crowd { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 18px 16px; --tone: var(--teal); }
.crowd.MID { --tone: var(--amber); }
.crowd.HIGH { --tone: var(--rose); }
.crowd-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crowd-time { display: inline-flex; align-items: center; gap: 5px; color: var(--sub); font-size: 12px; white-space: nowrap; }
.crowd-time .ic { width: 15px; height: 15px; }
.crowd-time b { font-family: var(--num); color: var(--ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.crowd-num { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; margin-top: 2px; line-height: 1.1; }
.crowd-num b { font-family: var(--num); font-size: 48px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.crowd-pre, .crowd-unit { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.crowd-total { margin-left: auto; font-family: var(--num); font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.crowd-few { font-size: 30px; font-weight: 900; line-height: 1.4; color: var(--amber); margin-top: 2px; }
.crowd-note { color: var(--sub); font-size: 12px; }
.crowd-level { font-size: 30px; font-weight: 900; line-height: 1.4; margin-top: 2px; }
.gauge { display: flex; gap: 4px; margin-top: 12px; }
.gauge i { flex: 1; height: 8px; border-radius: 999px; background: var(--mist); transition: background .3s ease; }
.gauge i.on { background: var(--tone); }
.crowd.simple .gauge i { height: 10px; }
.gauge-legend { display: flex; justify-content: space-between; margin-top: 6px; color: var(--faint); font-size: 11px; }

/* ---------- 未入室：入室アクションカード ---------- */

.action {
  width: 100%; border: 0; text-align: left; color: #fff; display: grid; gap: 14px;
  padding: 18px 18px 20px; border-radius: var(--r-lg);
  background: radial-gradient(120% 140% at 100% 0%, #334155 0%, rgba(51, 65, 85, 0) 55%), linear-gradient(150deg, #1E293B 0%, #0F172A 70%);
  box-shadow: var(--shadow-lg); transition: transform .14s ease;
}
.action:active { transform: scale(.985); }
.action-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-name { font-size: 12px; color: rgba(255, 255, 255, .62); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-body { display: flex; align-items: center; gap: 14px; }
.action-ico { width: 58px; height: 58px; border-radius: 18px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; flex: none; }
.action-ico .ic { width: 32px; height: 32px; }
.action-text { display: grid; gap: 2px; flex: 1; min-width: 0; }
.action-title { font-size: 17px; font-weight: 900; line-height: 1.35; }
.action-sub { font-size: 12px; color: rgba(255, 255, 255, .66); }
.action-go { width: 32px; height: 32px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; flex: none; }
.action-go .ic { width: 16px; height: 16px; }

.text-link {
  justify-self: center; background: none; border: 0; min-height: 44px; padding: 0 12px; margin: -6px 0 -4px;
  color: var(--sub); font-size: 13px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--faint);
}
.text-link.light { color: rgba(255, 255, 255, .72); text-decoration-color: rgba(255, 255, 255, .4); margin: 0; }

/* ---------- 入室中：アクティブセッションカード ---------- */

.session {
  color: #fff; border-radius: var(--r-lg); padding: 18px 18px 18px; box-shadow: var(--shadow-lg);
  background: radial-gradient(110% 120% at 0% 0%, rgba(13, 148, 136, .55) 0%, rgba(13, 148, 136, 0) 60%), linear-gradient(160deg, #0F172A 0%, #12263A 100%);
}
.session-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.session .live-badge { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: none; }
.session .live-badge .live-dot { color: #5EEAD4; }
.session-name { font-size: 12px; color: rgba(255, 255, 255, .66); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session .kicker { color: rgba(255, 255, 255, .55); }
.timer { font-family: var(--num); font-size: 48px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.session-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 16px; }
.session-meta div { background: rgba(255, 255, 255, .08); border-radius: var(--r-sm); padding: 8px 10px; min-width: 0; }
.session-meta dt { font-size: 11px; color: rgba(255, 255, 255, .6); line-height: 1.4; }
.session-meta dd { font-family: var(--num); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5; }
.session-note { font-size: 12px; color: rgba(255, 255, 255, .66); line-height: 1.6; margin-top: 10px; }
.session-foot { display: flex; justify-content: flex-end; margin: 4px -8px -8px 0; }

/* ---------- ボタン（タップ領域 48px 以上） ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 12px 20px; border: 0; border-radius: 16px;
  font-weight: 700; font-size: 15px; line-height: 1.3; text-align: center; text-decoration: none;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic { width: 20px; height: 20px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--soft); color: var(--ink); }
.btn-white { background: #fff; color: var(--ink); }
.btn-line { background: #058A3C; color: #fff; font-size: 17px; } /* 白文字が読めるよう、LINEグリーンより一段濃い緑。文字は見出しと同じ大きさ */
.btn-row { display: grid; gap: 10px; margin-top: 4px; }
.icon-btn { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink); display: grid; place-items: center; flex: none; }
.icon-btn .ic { width: 20px; height: 20px; }

/* ---------- Bento：累計の実績 ---------- */

.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px 14px 12px; min-width: 0; display: grid; gap: 6px; align-content: start; }
.kpi.wide { grid-column: 1 / -1; gap: 12px; padding: 14px 16px 16px; }
.kpi-ico { width: 36px; height: 36px; border-radius: 12px; background: var(--soft); color: var(--ink-2); display: grid; place-items: center; }
.kpi-ico .ic { width: 19px; height: 19px; }
.kpi-ico.teal { background: var(--teal-soft); color: var(--teal); }
.kpi-ico.amber { background: var(--amber-soft); color: var(--amber); }
.kpi-label { color: var(--sub); font-size: 11.5px; line-height: 1.45; }
.kpi-num { font-family: var(--num); font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi-num small { font-family: var(--font); font-size: 12px; font-weight: 700; margin: 0 3px 0 1px; color: var(--ink-3); letter-spacing: 0; }
.next-row { display: flex; align-items: center; gap: 12px; }
.next-text { flex: 1; min-width: 0; line-height: 1.4; }
.next-text b { font-size: 15px; }
.next-left { color: var(--sub); font-size: 12px; white-space: nowrap; }
.next-left b { font-family: var(--num); font-size: 22px; color: var(--ink); margin: 0 2px; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--amber); }

/* ---------- 公式LINEの案内 ---------- */

.line-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; display: grid; gap: 12px; }
.line-head { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; line-height: 1.4; } /* 「参加実績」などの見出しと同じ大きさ */
.line-logo { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--line-green); color: #fff; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-size: 11px; letter-spacing: .04em; }

/* ---------- スタンプ帳 ---------- */

.stamps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 10px; }
.slot { display: grid; justify-items: center; gap: 2px; min-width: 0; }
.slot-date { font-family: var(--num); font-size: 11px; color: var(--sub); line-height: 1.3; font-variant-numeric: tabular-nums; }
.stamp {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: var(--soft); color: var(--faint); font-family: var(--num); font-size: 13px; font-weight: 500;
}
/* 学校の「たいへんよくできました」風の、赤い桜型のはんこ */
.stamp.on { background: none; transform: rotate(-8deg); }
.hanko { display: block; width: 112%; height: 112%; margin: -6%; overflow: visible; font-family: var(--font); }
.stamp.new { animation: stamp-in .7s cubic-bezier(.2, 1.4, .4, 1) both; }
.stamp.new::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid #E0392B; animation: ring .8s ease-out .25s both; }
.stamp-big { width: 140px; }
.celebrate { display: grid; justify-items: center; gap: 12px; text-align: center; }
.celebrate-title { font-weight: 900; font-size: 17px; }
.new-badge { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-sm); background: var(--amber-soft); text-align: left; animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
.promo { display: flex; gap: 10px; align-items: flex-start; background: var(--teal-soft); color: #0B5D56; border-radius: var(--r-md); padding: 12px 14px; font-weight: 700; font-size: 13px; line-height: 1.6; }
.promo .ic { width: 18px; height: 18px; margin-top: 2px; }

/* ---------- 称号バッジ（タイル） ---------- */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 6px 10px; border-radius: 16px; background: var(--soft); min-width: 0; }
.tile.earned { background: var(--amber-soft); }
.tile-ico { width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--faint); display: grid; place-items: center; flex: none; }
.tile-ico.earned { color: var(--amber); }
.tile-ico .ic { width: 21px; height: 21px; }
.tile-name { font-size: 12px; font-weight: 700; line-height: 1.35; color: var(--sub); }
.tile.earned .tile-name { color: var(--ink); }
.tile-cond { font-size: 10.5px; color: var(--sub); line-height: 1.3; }

/* ---------- これまでのイベント参加（アコーディオン） ---------- */

.pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--ink-3); font-size: 11.5px; font-weight: 700; line-height: 1.6; white-space: nowrap; }
.pill b { font-family: var(--num); font-size: 13px; font-variant-numeric: tabular-nums; }
.pill .ic { width: 13px; height: 13px; }
.pill.teal { background: var(--teal-soft); color: var(--teal); }
.pill.amber { background: var(--amber-soft); color: #9A5505; }
.pill.me { background: var(--ink); color: #fff; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 7px; background: var(--soft); color: var(--ink-3); font-size: 11px; font-weight: 700; line-height: 1.7; }

.acc-list { display: grid; gap: 8px; }
.acc { background: var(--soft); border-radius: 18px; transition: background .2s ease; }
.acc.open { background: #F8FAFC; box-shadow: inset 0 0 0 1.5px var(--mist); }
.acc-head { width: 100%; min-height: 56px; padding: 12px 12px 12px 14px; background: none; border: 0; display: flex; align-items: center; gap: 10px; text-align: left; }
.acc-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.acc-name { font-weight: 700; font-size: 14px; line-height: 1.4; }
.acc-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.acc-caret { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--sub); display: grid; place-items: center; flex: none; transition: transform .28s ease; }
.acc-caret .ic { width: 16px; height: 16px; }
.acc.open .acc-caret { transform: rotate(180deg); }
.acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.acc.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { overflow: hidden; min-height: 0; }
.acc-pad { padding: 0 14px 16px; display: grid; gap: 12px; }
.acc-period { font-family: var(--num); font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.acc-stats { display: grid; grid-template-columns: 1fr 1.6fr; gap: 8px; }
.acc-stats div { background: #fff; border-radius: var(--r-sm); padding: 8px 12px; min-width: 0; box-shadow: var(--shadow); }
.acc-stats dt { color: var(--sub); font-size: 11px; line-height: 1.4; }
.acc-stats dd { font-family: var(--num); font-weight: 700; font-size: 20px; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acc-stats dd small { font-family: var(--font); font-size: 11.5px; margin: 0 2px; }
.acc-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.acc-badges-label { font-size: 11px; color: var(--sub); margin-right: 2px; }
/* 日ごとの実績：左に日付、右に時間のミニバー */
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.day { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; }
.day-date { font-family: var(--num); font-size: 13px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.day-date small { display: block; font-family: var(--font); font-size: 10.5px; font-weight: 500; color: var(--sub); }
.day-main { display: grid; gap: 5px; min-width: 0; }
.day-bar { height: 6px; border-radius: 999px; background: var(--mist); overflow: hidden; margin-top: 6px; }
.day-bar i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.day-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.day-time { font-size: 13px; margin-right: 2px; }

/* ---------- プロフィール ---------- */

.profile { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.profile-text { flex: 1; min-width: 0; }
.profile-name { font-weight: 700; font-size: 15px; line-height: 1.4; word-break: break-all; }

/* ---------- フォーム ---------- */

.form { display: grid; gap: 22px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend, .q > legend { font-weight: 700; padding: 0; font-size: 14px; }
.hint { color: var(--sub); font-size: 12px; font-weight: 500; line-height: 1.6; }
.input, .select, .textarea { width: 100%; min-height: 52px; padding: 12px 14px; background: var(--soft); border: 1.5px solid transparent; border-radius: var(--r-sm); font-size: 16px; }
.textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--sub) 50%), linear-gradient(135deg, var(--sub) 50%, transparent 50%);
  background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat;
}
.nick-row { display: grid; gap: 8px; }
.dice { min-height: 48px; font-size: 13.5px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; min-width: 60px; padding: 8px 16px; background: var(--soft); border: 0; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-3); transition: background .12s ease, color .12s ease, transform .12s ease; }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }

.q { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.stars { display: flex; gap: 4px; }
.star { flex: 1; min-height: 56px; background: none; border: 0; padding: 0; font-size: 34px; line-height: 1; color: var(--mist); transition: transform .12s ease, color .12s ease; }
.star.on { color: #F59E0B; }
.star:active { transform: scale(1.2); }

/* 同意：アイコンつきのカード型リスト */
.assure { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.assure li { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--soft); font-size: 13px; line-height: 1.55; }
.assure-ico { width: 36px; height: 36px; border-radius: 12px; background: #fff; color: var(--teal); display: grid; place-items: center; flex: none; }
.assure-ico .ic { width: 19px; height: 19px; }
.check { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 14px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--mist); font-weight: 700; font-size: 14px; }
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check-box { width: 26px; height: 26px; border-radius: 9px; background: var(--soft); box-shadow: inset 0 0 0 1.5px var(--faint); color: transparent; display: grid; place-items: center; flex: none; transition: background .15s ease, color .15s ease; }
.check-box .ic { width: 16px; height: 16px; stroke-width: 2.5; }
.check input:checked + .check-box { background: var(--teal); box-shadow: none; color: #fff; }
.check:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--teal); }
.check input:focus-visible + .check-box { outline: 2px solid var(--teal); outline-offset: 2px; }

.error { background: var(--rose-soft); color: #A8123A; border-radius: var(--r-sm); padding: 10px 14px; font-weight: 700; font-size: 13px; }
.info { background: var(--soft); color: var(--ink-3); border-radius: var(--r-sm); padding: 10px 14px; font-size: 12.5px; line-height: 1.65; }
.guide { display: grid; gap: 8px; }
.guide-item { background: var(--soft); border-radius: 16px; padding: 12px 14px; }
.guide-item h3 { font-size: 13px; margin-bottom: 4px; }
.guide-item ol { margin: 0; padding-left: 1.3em; font-size: 12.5px; color: var(--sub); }

/* ---------- ランキング ---------- */

.subtabs { display: flex; gap: 2px; padding: 4px; background: #E6EAF0; border-radius: 16px; }
.subtab { flex: 1; min-height: 44px; padding: 6px 2px; border: 0; border-radius: 12px; background: transparent; color: var(--sub); font-weight: 700; font-size: 12.5px; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.subtab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(15, 23, 42, .12); }

.podium { display: grid; grid-template-columns: 1fr 1.12fr 1fr; align-items: end; gap: 8px; }
.pod { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; animation: rise .5s ease both; }
.pod-rank { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: var(--num); font-weight: 700; font-size: 15px; color: #fff; background: var(--faint); }
.pod.p1 .pod-rank { width: 42px; height: 42px; font-size: 18px; background: linear-gradient(145deg, #FBBF24, #D97706); box-shadow: 0 6px 14px rgba(217, 119, 6, .35); }
.pod.p2 .pod-rank { background: linear-gradient(145deg, #CBD5E1, #94A3B8); }
.pod.p3 .pod-rank { background: linear-gradient(145deg, #E2B08A, #B4703F); }
.pod-name { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px; font-weight: 700; font-size: 12.5px; line-height: 1.35; word-break: break-all; max-width: 100%; }
.pod-name .ic { width: 14px; height: 14px; color: var(--amber); }
.pod-val { font-family: var(--num); font-weight: 700; font-size: 26px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.pod-val small { font-family: var(--font); font-size: 11px; margin-left: 2px; color: var(--ink-3); }
.pod-base { width: 100%; border-radius: 14px 14px 0 0; background: linear-gradient(180deg, var(--soft), rgba(241, 245, 249, 0)); }
.pod.p1 .pod-base { height: 72px; background: linear-gradient(180deg, var(--amber-soft), rgba(254, 243, 226, 0)); }
.pod.p2 .pod-base { height: 50px; }
.pod.p3 .pod-base { height: 36px; }
.pod.p1 { animation-delay: .1s; }
.pod.p3 { animation-delay: .2s; }

.ranklist { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.rankrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--soft); min-height: 52px; }
.rankrow.me { background: var(--teal-soft); }
.rank-no { width: 22px; text-align: center; font-family: var(--num); font-weight: 700; color: var(--faint); flex: none; font-variant-numeric: tabular-nums; }
.rank-name { flex: 1; min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; font-weight: 700; font-size: 14px; word-break: break-all; line-height: 1.35; }
.rank-name .ic { width: 15px; height: 15px; color: var(--amber); }
.rank-sub { flex-basis: 100%; color: var(--sub); font-size: 11px; font-weight: 500; }
.rank-val { font-family: var(--num); font-weight: 700; font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rank-val small { font-family: var(--font); font-size: 11px; margin-left: 2px; color: var(--ink-3); }
.empty { display: grid; justify-items: center; gap: 12px; padding: 20px 8px; text-align: center; color: var(--sub); font-size: 13px; }

/* ---------- 下部ナビ（すりガラスのフローティングバー＋中央の二次元コードボタン） ---------- */

.nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: 30;
  max-width: 496px; margin: 0 auto; height: var(--nav-h);
  display: grid; grid-template-columns: 1fr 76px 1fr; align-items: center; justify-items: center;
  padding: 0 8px; border-radius: 26px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: saturate(1.8) blur(12px); backdrop-filter: saturate(1.8) blur(12px);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .04), 0 12px 32px rgba(15, 23, 42, .14);
}
.nav-btn { width: 100%; height: 100%; border: 0; background: transparent; color: var(--faint); font-weight: 700; font-size: 10.5px; display: grid; justify-items: center; align-content: center; gap: 3px; line-height: 1.2; transition: color .15s ease; }
.nav-btn svg { width: 23px; height: 23px; }
.nav-btn[aria-current="page"] { color: var(--ink); }
.nav-scan {
  width: 66px; height: 66px; margin-top: -30px; border: 0; border-radius: 50%; color: #fff;
  background: linear-gradient(150deg, #334155, #0F172A); display: grid; place-items: center;
  box-shadow: 0 0 0 5px var(--bg), 0 14px 26px rgba(15, 23, 42, .38); transition: transform .14s ease;
}
.nav-scan:active { transform: scale(.93); }
.nav-scan svg { width: 28px; height: 28px; }

/* ---------- モーダル・トースト・ローディング ---------- */

.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); display: grid; align-items: end; }
.sheet { background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + var(--safe-b)); max-height: 92vh; overflow-y: auto; width: 100%; max-width: 520px; margin: 0 auto; animation: sheet-up .28s cubic-bezier(.2, .9, .3, 1) both; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 999px; background: var(--mist); margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; min-height: 48px; }
.sheet .info { margin-bottom: 18px; }
.close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--soft); color: var(--ink-3); display: grid; place-items: center; flex: none; }
.close .ic, .close svg { width: 18px; height: 18px; }

.busy { position: fixed; inset: 0; z-index: 90; background: rgba(243, 245, 248, .8); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); display: grid; place-items: center; }
.busy-box { display: grid; justify-items: center; gap: 12px; padding: 24px 28px; background: #fff; border-radius: 24px; box-shadow: var(--shadow-lg); font-weight: 700; font-size: 13.5px; text-align: center; max-width: 80vw; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 34px); z-index: 95; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-weight: 700; font-size: 13px; line-height: 1.5; box-shadow: var(--shadow-lg); animation: toast-in .25s ease both; text-align: center;
}
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--mist); border-top-color: var(--ink); animation: spin .8s linear infinite; }

/* ---------- 二次元コード読み取り（スキャナー） ---------- */

.scan { position: fixed; inset: 0; z-index: 80; background: #05080F; color: #fff; display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + var(--safe-b)); }
.scan-box { width: 100%; max-width: 420px; display: grid; gap: 18px; }
.scan-head { display: flex; align-items: center; justify-content: space-between; }
.scan-head h2 { font-size: 17px; }
.scan .close { background: rgba(255, 255, 255, .12); color: #fff; }
.scan-stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 24px; overflow: hidden; background: #0B1220; }
.scan-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 四隅のガイド枠。枠の外は少し暗くする */
.scan-frame { position: absolute; inset: 15%; border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(5, 8, 15, .5); }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 22px 0 0 0; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 22px 0 0; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 22px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 22px 0; }
.scan-frame b { position: absolute; left: 10%; right: 10%; top: 50%; height: 2px; border-radius: 2px; background: #5EEAD4; box-shadow: 0 0 12px #5EEAD4; animation: scanline 2s ease-in-out infinite; }
.scan-hint { text-align: center; font-size: 13.5px; color: rgba(255, 255, 255, .8); min-height: 1.7em; }
.scan-error { background: #fff; color: var(--ink); border-radius: 24px; padding: 24px 18px 18px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.scan-error p { color: var(--sub); font-size: 13.5px; }
.scan-error .btn { margin-top: 6px; }

/* ---------- アプリ内ブラウザ案内 ---------- */

.inapp { position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; padding: 24px 16px; display: grid; place-items: center; }
.inapp-card { width: 100%; max-width: 420px; display: grid; gap: 14px; text-align: center; justify-items: center; }
.inapp-card > * { width: 100%; }
.inapp-card > .state-ico { width: 56px; }
.inapp-lead { color: var(--sub); font-size: 13.5px; }
.inapp-steps { text-align: left; margin: 0; padding: 14px 14px 14px 2.4em; background: #fff; border-radius: 20px; box-shadow: var(--shadow); display: grid; gap: 8px; font-size: 13.5px; }
.inapp-or { color: var(--sub); font-size: 12.5px; }
.inapp-url { font-family: var(--num); font-size: 12px; color: var(--sub); word-break: break-all; }
.kbd { display: inline-grid; place-items: center; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--soft); color: var(--ink); font-weight: 900; }
.phone { width: 190px !important; margin: 0 auto; border: 2.5px solid var(--ink); border-radius: 26px; background: #fff; overflow: hidden; }
.phone-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: var(--soft); min-height: 36px; }
.phone-url { font-family: var(--num); font-size: 10.5px; color: var(--sub); background: #fff; border-radius: 8px; padding: 2px 10px; }
.phone-menu { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.phone-menu.hot { background: var(--teal); color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.phone-body { height: 120px; display: grid; place-items: center; padding: 10px; }
.phone-sheet { font-size: 11px; font-weight: 700; padding: 8px 10px; border-radius: 10px; background: var(--ink); color: #fff; }
.noscript { padding: 24px; text-align: center; }

/* ---------- 管理画面 ---------- */

.admin-big { text-align: center; padding: 24px 18px; }
.admin-count { font-family: var(--num); font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.admin-count small { font-family: var(--font); font-size: 15px; font-weight: 700; color: var(--sub); letter-spacing: 0; }
.admin-pct { font-size: 14px; font-weight: 700; margin: 8px 0 12px; }
.meter { height: 10px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.meter.MID > i { background: var(--amber); }
.meter.HIGH > i { background: var(--rose); }
.admin-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px 16px 12px; min-width: 0; }
.stat-label { color: var(--sub); font-size: 11.5px; line-height: 1.4; }
.stat-value { font-family: var(--num); font-weight: 700; font-size: 32px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-value small { font-family: var(--font); font-size: 12px; font-weight: 700; margin-left: 2px; color: var(--ink-3); }
.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 14px; border-radius: 16px; background: var(--soft); }
.admin-nick { font-weight: 900; font-size: 15px; word-break: break-all; }
.admin-time { font-family: var(--num); font-weight: 700; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.admin-sub { color: var(--sub); font-size: 12px; }
.gps { justify-self: end; padding: 1px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.gps.VERIFIED { background: var(--teal-soft); color: var(--teal); }
.gps.UNVERIFIED { background: var(--amber-soft); color: #9A5505; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- アニメーション ---------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes ping { 0% { transform: scale(.6); opacity: .5; } 80%, 100% { transform: scale(1.6); opacity: 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(.9); } }
@keyframes stamp-in { 0% { opacity: 0; transform: scale(2.6) rotate(-28deg); } 55% { opacity: 1; transform: scale(.9) rotate(-8deg); } 100% { opacity: 1; transform: scale(1) rotate(-8deg); } }
@keyframes ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.7); } 100% { opacity: 1; transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-up { from { transform: translateY(48px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes scanline { 0%, 100% { transform: translateY(-70px); opacity: .25; } 50% { transform: translateY(70px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* アコーディオンの中のピルは、地の色と区別できるよう白にする */
.acc .pill:not(.teal):not(.amber) { background: #fff; }

/* 位置の確認が長引いたとき（4秒後）に出す、先へ進むためのボタン */
.late { display: grid; gap: 8px; width: 100%; max-width: 320px; margin-top: 8px; animation: late-in .4s ease 4s both; }
@keyframes late-in { from { opacity: 0; visibility: hidden; transform: translateY(8px); } to { opacity: 1; visibility: visible; transform: translateY(0); } }

/* ---------- チェックイン／チェックアウト（時間表示カードの中の2つのボタン） ---------- */

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duo-tile {
  display: grid; gap: 1px; align-content: start; text-align: left; min-width: 0;
  padding: 10px 12px 12px; border: 0; border-radius: 16px;
  background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .42);
  transition: transform .14s ease;
}
.duo-tile:disabled { cursor: default; }
.duo-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.duo-ico { width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .08); display: grid; place-items: center; flex: none; }
.duo-ico .ic { width: 17px; height: 17px; }
.duo-head .eyebrow { font-size: 10px; letter-spacing: .12em; color: inherit; }
.duo-title { font-size: 15px; font-weight: 900; line-height: 1.35; white-space: nowrap; }
.duo-sub { font-size: 10.5px; line-height: 1.4; }
/* いま使えるほうだけを白で強調する */
.duo-tile.on { background: #fff; color: var(--sub); box-shadow: 0 8px 20px rgba(0, 0, 0, .28); }
.duo-tile.on:active { transform: scale(.97); }
.duo-tile.on .duo-ico { background: var(--ink); color: #fff; }
.duo-tile.on .duo-title { color: var(--ink); }
.duo-tile.on .eyebrow { color: var(--faint); }

/* 未入室のときの時間表示：数字を淡くして、まだ動いていないことを伝える */
.session.idle { background: linear-gradient(160deg, #1E293B 0%, #0F172A 100%); }
.session.idle .timer { color: rgba(255, 255, 255, .32); }
.session .timer { margin-bottom: 14px; }
.session-meta { margin: 0 0 12px; }
.session .live-badge.OFF { color: rgba(255, 255, 255, .7); }
.session .live-badge.OFF .live-dot { color: rgba(255, 255, 255, .45); }
.session-note { text-align: center; }

/* プロフィールは一番上に置くので、ほかのカードより薄くして主張を抑える */
.profile { padding: 12px 14px 12px 12px; }
.profile .avatar { width: 44px; height: 44px; }
.profile .icon-btn { width: 44px; height: 44px; }

.scan-skip { justify-self: center; animation: rise .35s ease both; }
.scan-error .text-link { margin: 0 0 -6px; }
.scan-error .btn { margin-top: 6px; }

/* ヘッダーに固定する「本日の営業時間」 */
.hours { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }
.hours .ic { width: 15px; height: 15px; color: var(--teal); }
.hours b { font-family: var(--num); font-size: 15px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.hours.off { color: var(--sub); }
.hours.off .ic { color: var(--faint); }

/* 入室時刻と本日の閉館の2項目 */
.session-meta { grid-template-columns: 1fr 1fr; }

/* 「本日の営業時間　15:45〜19:00」：時刻を大きめの太字にして強調する */
.hours { gap: 7px; margin-top: 10px; padding: 7px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.hours > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex: 1; min-width: 0; }
.hours b { font-size: 19px; letter-spacing: .01em; color: var(--ink); white-space: nowrap; }
.hours.off { background: transparent; box-shadow: none; padding-left: 0; padding-right: 0; }
.hours.off b { color: var(--sub); font-size: 15px; }

/* ヘッダー右側：自分の状態（入室中）と混雑のバッジを並べる */
.app-badges { display: flex; align-items: center; gap: 6px; min-width: 0; }
.live-badge.self { background: var(--ink); color: #fff; }
.live-badge.self .live-dot { color: #5EEAD4; }
/* バッジが2つ並ぶ幅の狭い画面では、アプリ名の文字を省いてマークだけにする */
@media (max-width: 420px) { .app-bar:has(.live-badge.self) .app-name { display: none; } }

/* ---------- ランキング：あなたの成績 ---------- */

.mine-kpi { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; }
.mine-kpi > div { background: var(--soft); border-radius: 16px; padding: 10px 14px; min-width: 0; }
.mine-kpi .kpi-num { font-size: 30px; }
.places { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.place { display: grid; gap: 1px; align-content: start; background: var(--soft); border-radius: 16px; padding: 10px 10px 10px 12px; min-width: 0; }
.place-label { font-size: 10.5px; color: var(--sub); line-height: 1.4; }
.place-rank { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; line-height: 1.2; }
.place-rank b { font-family: var(--num); font-size: 28px; font-weight: 700; color: var(--ink); margin-right: 1px; font-variant-numeric: tabular-nums; }
.place-rank small { display: block; font-family: var(--num); font-size: 10.5px; font-weight: 500; color: var(--sub); }
.place-rank.none { font-family: var(--num); font-size: 24px; color: var(--faint); }
.place-name { font-size: 10.5px; color: var(--sub); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-subjects { margin-top: 14px; display: grid; gap: 8px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 16px 3.2em 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.bars-no { font-family: var(--num); font-weight: 700; color: var(--faint); text-align: center; }
.bars-name { font-weight: 700; white-space: nowrap; }
.bars-bar { height: 8px; border-radius: 999px; background: var(--mist); overflow: hidden; }
.bars-bar i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.bars-val { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }
.bars-val small { font-family: var(--font); font-size: 10.5px; margin-left: 1px; color: var(--ink-3); }

/* ---------- ランキング：一覧（3位以内は金・銀・銅のマーク） ---------- */

.panel .subtabs { margin-bottom: 12px; }
.panel .ranklist { margin-top: 0; }
.medal { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; margin: 0 -3px; }
.medal .ic { width: 16px; height: 16px; }
.medal.m1 { background: linear-gradient(145deg, #FBBF24, #D97706); }
.medal.m2 { background: linear-gradient(145deg, #CBD5E1, #94A3B8); }
.medal.m3 { background: linear-gradient(145deg, #E2B08A, #B4703F); }

/* ---------- あなたの成績：カード幅をそろえ、順位は一覧、科目は円グラフ ---------- */

.mine-kpi { grid-template-columns: 1fr 1fr; }
.mine-kpi .kpi-num { font-size: 28px; }
.mine-ranks { margin-top: 10px !important; }
.mine-ranks .rank-name > span:first-child { font-size: 13.5px; }
.rank-val.none { color: var(--faint); }
.pie { display: flex; align-items: center; gap: 16px; }
.pie-chart { width: 124px; height: 124px; flex: none; }
.pie-total { font-family: var(--num); font-size: 9px; font-weight: 700; fill: var(--ink); }
.pie-unit { font-family: var(--font); font-size: 3.4px; font-weight: 700; fill: var(--sub); }
.pie-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; flex: 1; min-width: 0; }
.pie-legend li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pie-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pie-name { flex: 1; min-width: 0; font-weight: 700; }
.pie-val { font-family: var(--num); font-weight: 700; font-variant-numeric: tabular-nums; }
.pie-val small { font-size: 10.5px; margin-left: 1px; color: var(--sub); }

/* あなたの成績：行の左に置く小さなアイコン（メダルと同じ大きさ） */
.rank-ico { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--sub); display: grid; place-items: center; flex: none; margin: 0 -3px; }
.rank-ico .ic { width: 15px; height: 15px; }
.mine-ranks { margin-top: 0 !important; }

/* ---------- よく勉強した科目：積み上げバー＋回数と割合 ---------- */

.mix { display: grid; gap: 12px; }
.mix-bar { display: flex; gap: 3px; height: 12px; }
.mix-bar i { display: block; min-width: 6px; border-radius: 999px; }
.mix-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mix-legend li { display: grid; grid-template-columns: 10px 1fr auto 3.2em; align-items: baseline; gap: 10px; font-size: 13.5px; }
.mix-legend li > i { width: 10px; height: 10px; border-radius: 3px; align-self: center; }
.mix-name { font-weight: 700; min-width: 0; }
.mix-count { font-family: var(--num); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.mix-count small { font-family: var(--font); font-size: 10.5px; margin-left: 1px; color: var(--ink-3); }
.mix-pct { font-family: var(--num); font-size: 13px; color: var(--sub); text-align: right; font-variant-numeric: tabular-nums; }
.mix-pct small { font-size: 10.5px; margin-left: 1px; }

/* 2行目（学校名・学年）は、1行目の見出しと文字の頭をそろえる */
.mine-ranks .rank-sub { margin-left: 0; }
.mine-ranks .rank-name:not(:has(.rank-sub)) { min-height: 0; }

/* ---------- 時間表示カード：小さい文字ほど濃くして、読みやすさを優先する ---------- */

.session .kicker { color: rgba(255, 255, 255, .75); }
.session-meta dt { color: rgba(255, 255, 255, .75); }
.session-note { color: rgba(255, 255, 255, .78); }
.timer .sec { color: #5EEAD4; }                                /* 秒だけティールにして「動いている」ことを示す */
.session.idle .timer { color: rgba(255, 255, 255, .45); letter-spacing: .04em; } /* 未入室は数字ではなく「未計測」 */
.duo-tile { color: rgba(255, 255, 255, .62); }                 /* 押せないボタン：理由の説明が読める濃さにする */
.duo-tile:disabled .duo-title { color: rgba(255, 255, 255, .62); }
.duo-tile.on { color: var(--sub); }
.session.idle .timer { font-weight: 500; letter-spacing: 0; }

/* 時間表示カード：チェックイン・チェックアウトのお願い（補足より少し目立たせる） */
.session-note strong { color: #fff; }
.session-ask {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(94, 234, 212, .12); box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .35);
  color: rgba(255, 255, 255, .92); font-size: 12.5px; line-height: 1.6; text-align: left;
}
.session-ask .ic { width: 16px; height: 16px; margin-top: 2px; color: #5EEAD4; }
.session-ask strong { color: #5EEAD4; }

/* ---------- スタンプ（二重の丸枠・ティール1色。日付入り） ---------- */

.stamp { background: transparent; border: 1.5px dashed #CBD5E1; color: var(--faint); }
.stamp.on { border: 0; transform: rotate(-8deg); }
.stamp.on .hanko { width: 104%; height: 104%; margin: -2%; }
.hanko { filter: drop-shadow(0 1px 0 rgba(13, 148, 136, .12)); }
.stamp.new::after { border-color: var(--teal); }
.stamps { gap: 10px; }
.stamp-big { width: 150px; }

/* ---------- スタンプ帳の台紙 ---------- */

.sheet-no { display: inline-block; margin-left: 8px; padding: 1px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; font-weight: 700; vertical-align: 2px; }
.sheet-msg { margin-top: 14px; color: var(--sub); font-size: 12.5px; text-align: center; }
.sheet-msg b { font-family: var(--num); font-size: 18px; color: var(--ink); margin: 0 2px; }
.sheet-msg.done { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 10px 12px; border-radius: 14px; background: var(--teal-soft); color: #0B5D56; font-weight: 700; }
.sheet-msg.done .ic { width: 17px; height: 17px; margin-top: 2px; }
.certs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.certs-label { font-size: 11.5px; color: var(--sub); margin-right: 2px; }
.cert-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 14px; border: 0; border-radius: 999px; background: var(--amber-soft); color: #9A5505; font-weight: 700; font-size: 13px; }
.cert-btn .ic { width: 15px; height: 15px; }

/* ---------- コンプリートのお祝い画面 ---------- */

.sheet.complete { text-align: center; padding-top: 14px; }
.complete-hero { display: grid; justify-items: center; gap: 6px; padding: 8px 4px 18px; }
.complete-hero .stamp-big { margin-bottom: 10px; }
.complete-hero h1 { font-size: 30px; }
.complete-msg { color: var(--ink-3); font-size: 14px; font-weight: 700; line-height: 1.8; max-width: 22em; }
.complete-info { display: grid; gap: 1px; margin: 0 0 18px; border-radius: 16px; overflow: hidden; background: var(--mist); text-align: left; }
.complete-info div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--soft); }
.complete-info dt { color: var(--sub); font-size: 12px; flex: none; }
.complete-info dd { font-weight: 700; font-size: 13px; text-align: right; min-width: 0; }

/* 参加実績：アコーディオンの中の個人成績（地の色と区別できるよう、行は白にする） */
.acc .mine-ranks .rankrow { background: #fff; }
.acc .mine-subjects { margin-top: 2px; }
.acc-days { display: grid; gap: 10px; margin-top: 4px; }

/* 台紙のスタンプは、スクロールが終わるのを待ってから押す（お祝い画面の大きなスタンプはすぐ押す） */
.stamps .stamp.new { animation-delay: .55s; }
.stamps .stamp.new::after { animation-delay: .8s; }

/* ---------- 参加実績：一覧と詳細シート ---------- */

.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-row { width: 100%; min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border: 0; border-radius: 16px; background: var(--soft); text-align: left; transition: transform .12s ease; }
.hist-row:active { transform: scale(.98); }
.hist-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.hist-name { font-weight: 700; font-size: 14px; line-height: 1.4; }
.hist-period { font-family: var(--num); font-size: 12px; color: var(--sub); font-variant-numeric: tabular-nums; }
.hist-go { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--sub); display: grid; place-items: center; flex: none; transform: rotate(-90deg); }
.hist-go .ic { width: 15px; height: 15px; }
.pill.ended { background: #E2E8F0; color: var(--sub); }
.hist-sheet .sheet-head { align-items: flex-start; }
.hist-title { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.hist-title h2 { font-size: 18px; }
.hist-sheet .mine-subjects { margin-top: 14px; }
.hist-sheet .acc-days { margin-top: 16px; }

/* ---------- 日ごとの記録：1日1行（日付・棒・時間）。棒の太さは「勉強した科目」とそろえる ---------- */

.mix-bar { height: 10px; }
.days { gap: 12px; }
.day { display: grid; grid-template-columns: 4.6em 1fr 5.4em; align-items: center; gap: 4px 10px; }
.day-date { font-family: var(--num); font-size: 13px; font-weight: 700; line-height: 1.2; white-space: nowrap; font-variant-numeric: tabular-nums; }
.day-date small { display: inline; margin-left: 4px; font-family: var(--font); font-size: 11px; font-weight: 500; color: var(--sub); }
.day-bar { height: 10px; margin: 0; border-radius: 999px; background: var(--mist); overflow: hidden; }
.day-bar i { display: block; height: 100%; border-radius: 999px; background: var(--teal); }
.day-time { font-size: 12.5px; text-align: right; white-space: nowrap; }
.day-tags { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: -2px; }

/* 選択肢の設問（fieldset の legend）は、grid の gap が効かないため、見出しの下に同じ余白を明示する */
.q > legend { margin-bottom: 10px; }
.field > legend { margin-bottom: 8px; }

.nav-scan .ic { width: 28px; height: 28px; }

/* ---------- 参加実績の状態・最終結果の画面・管理画面のイベント ---------- */

.pill.pending { background: var(--amber-soft); color: #9A5505; }
.back-link { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px 0 2px; margin: -4px 0 -10px; border: 0; background: none; color: var(--sub); font-weight: 700; font-size: 13px; }
.back-link .ic { width: 18px; height: 18px; transform: rotate(90deg); }
.mine .acc-days { margin-top: 16px; }
.admin-ev { grid-template-columns: 1fr auto; align-items: center; }
.admin-ev .admin-nick { font-size: 14px; }
.admin-ev .pill { justify-self: end; }
.admin-ev > span:last-child { grid-column: 1 / -1; }
.admin-ev .btn-sm { width: 100%; margin-top: 6px; }
.line-text { font-size: 13px; letter-spacing: 0; }

/* ニックネームがAIの審査で通らなかったとき */
.nick-error { color: #C81E3C; font-weight: 700; font-size: 13px; line-height: 1.6; margin-top: -2px; }
.nick-error span { font-weight: 500; font-size: 12px; }
.input.invalid { border-color: #E11D48; background: #FFF5F7; }
