/*! VIVA classroom | (c) 2026 VIVA classroom 運営 | All rights reserved. 無断での複製・転載・改変・再配布を禁じます（LICENSE）。 */
/* フォントはダウンロードしない（英数字も日本語も端末に入っているもの。iPad はサンフランシスコ＋ヒラギノ） */

:root {
  --bg: #08090a;
  --bg-2: #0d0f0e;
  --surface: #111412;
  --surface-2: #171b19;
  --surface-3: #1e2320;
  --line: rgba(255, 255, 255, .065);
  --line-2: rgba(255, 255, 255, .11);
  --text: #f4f6f5;
  --muted: #9aa39e;
  --faint: #626b66;
  --accent: #10b981;
  --accent-hi: #34d399;
  --accent-soft: rgba(16, 185, 129, .12);
  --accent-line: rgba(52, 211, 153, .28);
  --on-accent: #03140d;
  --holiday: #fb7185;
  --event: #60a5fa;
  --exam: #fbbf24;
  --note: #a1a1aa;
  --danger: #f87171;
  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Noto Sans CJK JP', 'Yu Gothic UI', 'Meiryo', system-ui, sans-serif;   /* 日本語は端末に入っているフォント（iPad はヒラギノ）。ダウンロードしない */
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01';
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 500px at 12% -8%, rgba(16, 185, 129, .10), transparent 60%),
              radial-gradient(700px 400px at 100% 0%, rgba(96, 165, 250, .05), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(16, 185, 129, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232825; border-radius: 10px; border: 3px solid var(--bg); }
.i { flex: none; display: block; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
[hidden] { display: none !important; }

/* ===== ボタン・入力 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: rgba(255, 255, 255, .16); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 1px 2px rgba(0, 0, 0, .4); }
.seg a { height: 28px; padding: 0 14px; border-radius: 7px; color: var(--muted); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 1px 2px rgba(0, 0, 0, .4); }

.tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--muted); }
.tag.green { background: var(--accent-soft); color: var(--accent-hi); }
.tag.red { background: rgba(251, 113, 133, .12); color: var(--holiday); }
.tag.amber { background: rgba(251, 191, 36, .12); color: var(--exam); }
.tag.blue { background: rgba(96, 165, 250, .12); color: var(--event); }

.av {
  --c: var(--accent); width: 32px; height: 32px; border-radius: 10px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
.av.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 11.5px; }
.av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 22px; }
.av.group { color: var(--muted); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ===== 認証 ===== */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; position: relative; z-index: 1; }
.auth-hero { padding: 56px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); position: relative; overflow: hidden; }
.auth-hero::after {
  content: ''; position: absolute; width: 620px; height: 620px; right: -220px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .22), transparent 65%); filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(145deg, #34d399, #059669); display: grid; place-items: center; color: var(--on-accent); box-shadow: 0 6px 20px -6px rgba(16, 185, 129, .7); }
.brand-mark svg { width: 17px; height: 17px; }
.brand small { color: var(--faint); font-weight: 500; margin-left: 2px; }
.auth-copy h1 { font-size: 46px; line-height: 1.12; letter-spacing: -.035em; margin: 0 0 18px; font-weight: 700; }
.auth-copy h1 em { font-style: normal; background: linear-gradient(90deg, #6ee7b7, #10b981 60%, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-copy p { color: var(--muted); font-size: 15px; max-width: 420px; margin: 0; }
.auth-points { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--muted); font-size: 12.5px; position: relative; z-index: 1; }
.auth-points span { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.auth-points svg { color: var(--accent-hi); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-box { width: 100%; max-width: 360px; }
.auth-box h2 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-box > p { color: var(--muted); margin: 0 0 26px; }
.auth-alt { margin-top: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.auth-alt a { color: var(--accent-hi); font-weight: 600; }
.alert { display: flex; gap: 9px; align-items: flex-start; padding: 11px 13px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 16px; border: 1px solid; }
.alert.err { color: #fecaca; background: rgba(248, 113, 113, .08); border-color: rgba(248, 113, 113, .25); }
.alert.ok { color: #a7f3d0; background: var(--accent-soft); border-color: var(--accent-line); }

/* ===== 骨組み ===== */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); height: 100vh; position: relative; z-index: 1; }
.side { display: flex; flex-direction: column; padding: 18px 12px; border-right: 1px solid var(--line); background: rgba(8, 9, 10, .6); backdrop-filter: blur(12px); }
.side .brand { padding: 4px 8px 22px; }
.class-chip { margin: 0 6px 18px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.class-chip small { display: block; font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .04em; }
.class-chip b { font-size: 14px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-sec { font-size: 11px; font-weight: 600; color: var(--faint); padding: 14px 10px 6px; letter-spacing: .03em; }
.nav a {
  display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: 9px;
  color: var(--muted); font-weight: 500; font-size: 13.5px; position: relative; transition: background .12s, color .12s;
}
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a.on .i { color: var(--accent-hi); }
.nav .badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 8px 2px; border-top: 1px solid var(--line); }
.side-foot .who { min-width: 0; flex: 1; line-height: 1.3; }
.side-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: var(--faint); font-size: 11.5px; }

.main { min-width: 0; overflow-y: auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 34px 36px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head .eyebrow { font-size: 12px; font-weight: 600; color: var(--accent-hi); margin-bottom: 6px; letter-spacing: .02em; }
.page-head h1 { font-size: 30px; letter-spacing: -.03em; margin: 0; line-height: 1.15; font-weight: 700; }
.page-head .actions { display: flex; gap: 8px; }

.card { background: linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 40%), var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h2 { font-size: 14.5px; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.card-head h2 .i { color: var(--muted); }
.card-body { padding: 14px 18px 18px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ===== 課題 ===== */
.celebrate {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, .16), rgba(16, 185, 129, .05)); border: 1px solid var(--accent-line);
}
.celebrate .ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.celebrate b { display: block; font-size: 15px; color: #d1fae5; }
.celebrate span { font-size: 12.5px; color: #86c9ad; }
.task { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s; }
.task + .task { margin-top: 8px; }
.task:hover { border-color: var(--line-2); }
.task .chk {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: transparent; flex: none;
  display: grid; place-items: center; color: transparent; transition: all .15s var(--ease); padding: 0;
}
.task .chk:hover { border-color: var(--accent); }
.task.done .chk { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.task.done .t-title { color: var(--faint); text-decoration: line-through; }
.task .t-main { min-width: 0; flex: 1; }
.task .t-title { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .t-sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.due.soon { color: var(--exam); }
.due.over { color: var(--danger); }
.progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; width: 90px; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }

/* ===== 宿題掲示板 ===== */
.av.xs { width: 18px; height: 18px; border-radius: 6px; font-size: 9.5px; margin-right: 5px; vertical-align: -4px; }
.hw { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); transition: border-color .15s; }
.hw + .hw { margin-top: 10px; }
.hw:hover { border-color: var(--line-2); }
.hw .chk { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: transparent; flex: none; display: grid; place-items: center; color: transparent; transition: all .15s var(--ease); padding: 0; margin-top: 1px; }
.hw .chk:hover { border-color: var(--accent); }
.hw.done .chk { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hw.done .hw-title { color: var(--faint); text-decoration: line-through; }
.hw-main { flex: 1; min-width: 0; }
.hw-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hw-title { font-size: 14px; }
.hw-detail { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.hw-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12px; color: var(--faint); }
.hw-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.hw-meta .due { color: var(--muted); }
.hw-meta .due.soon { color: var(--exam); } .hw-meta .due.over { color: var(--danger); }
.hw-side { display: flex; align-items: flex-start; gap: 4px; flex: none; }
.trust { display: flex; gap: 6px; }
.vote { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600; transition: all .15s; }
.vote b { font-weight: 700; color: var(--text); }
.vote:hover:not(:disabled) { border-color: rgba(255, 255, 255, .2); color: var(--text); }
.vote:disabled { opacity: .45; cursor: default; }
.vote.up.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.vote.up.on b { color: var(--accent-hi); }
.vote.down.on { background: rgba(251, 191, 36, .1); border-color: rgba(251, 191, 36, .35); color: var(--exam); }
.vote.down.on b { color: var(--exam); }
.tag .i { margin-right: -1px; }
.imp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.imp-table th { text-align: left; color: var(--faint); font-weight: 600; padding: 6px; border-bottom: 1px solid var(--line); }
.imp-table td { padding: 4px; border-bottom: 1px solid var(--line); }
.imp-table input { width: 100%; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 7px; padding: 0 6px; outline: none; }
.imp-table input:focus { border-color: var(--accent); background: var(--bg-2); }
.imp-table input.bad { border-color: rgba(248, 113, 113, .5); }
.imp-table .ck { width: 28px; text-align: center; }
.imp-table .ck input { width: 15px; height: 15px; accent-color: var(--accent); }

/* スクショ読み取り */
.scan-drop { display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; transition: all .15s; outline: none;
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%); }
.scan-drop:hover, .scan-drop:focus-visible, .scan-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.scan-drop.off { cursor: default; opacity: .7; background: none; }
.scan-drop.off:hover { border-color: var(--line-2); background: none; }
.scan-ico { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 6px 20px -6px var(--accent); }
.scan-drop.off .scan-ico { background: var(--bg-3, var(--bg-2)); color: var(--faint); box-shadow: none; }
.scan-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.scan-txt b { font-size: 15px; }
.scan-txt span { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.scan-wait { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); }
.scan-wait b { display: block; font-size: 14.5px; margin-bottom: 3px; }
.scan-wait span:not(.spin) { font-size: 12.5px; color: var(--muted); }
.spin { width: 30px; height: 30px; flex: none; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.imp-alt { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.imp-alt summary { cursor: pointer; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; list-style: none; }
.imp-alt summary::-webkit-details-marker { display: none; }
.imp-alt[open] summary { color: var(--text); }
@media (max-width: 560px) { .scan-drop { padding: 16px; gap: 12px; } .scan-ico { width: 44px; height: 44px; } }
.modal.wide { max-width: 760px; }

/* ===== プリント市場 ===== */
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; transition: all .12s; }
.fchip:hover { color: var(--text); border-color: rgba(255, 255, 255, .2); }
.fchip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hi); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform .18s var(--ease), border-color .15s, box-shadow .18s; }
.pcard:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .8); }
.pcard.want { border-color: rgba(251, 191, 36, .28); }
.pthumb { position: relative; aspect-ratio: 4 / 3; background: var(--bg-2); overflow: hidden; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.pcard:hover .pthumb img { transform: scale(1.03); }
.pthumb-empty { height: 100%; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: var(--faint); font-size: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(255, 255, 255, .018) 10px 20px); }
.pcard.want .pthumb-empty { color: var(--exam); }
.pbadge { position: absolute; left: 10px; top: 10px; height: 22px; padding: 0 9px; border-radius: 7px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; backdrop-filter: blur(8px); }
.pbadge.want { background: rgba(251, 191, 36, .9); color: #2a1d02; }
.pbadge.ok { background: rgba(16, 185, 129, .9); color: var(--on-accent); }
.pbadge.share { background: rgba(8, 9, 10, .7); color: #cfe0ff; border: 1px solid rgba(255, 255, 255, .12); }
.pcount { position: absolute; right: 10px; bottom: 10px; height: 22px; padding: 0 8px; border-radius: 7px; background: rgba(8, 9, 10, .72); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.pinfo { padding: 12px 14px 14px; display: flex; flex-direction: column; align-items: flex-start; }
.pinfo b { font-size: 13.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.pmeta span { display: inline-flex; align-items: center; gap: 3px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.gallery.sm { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.gallery a { display: block; border-radius: 11px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 3 / 4; background: var(--bg-2); cursor: zoom-in; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s var(--ease); }
.gallery a:hover img { transform: scale(1.04); }
.photo-previews { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-previews:not(:empty) { margin-top: 10px; }
.photo-previews .pv { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.photo-previews .pv img { width: 100%; height: 100%; object-fit: cover; }
.photo-previews .pv button { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: rgba(0, 0, 0, .7); color: #fff; display: grid; place-items: center; padding: 0; }
.photo-previews .pv.busy::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; transition: all .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-hi); }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: grid; place-items: center; animation: fadeIn .15s; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 30px 80px rgba(0, 0, 0, .8); }
.lightbox .lb-tools { position: fixed; top: 16px; right: 16px; display: flex; gap: 8px; }
.kind-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.kind-pick label { cursor: pointer; }
.kind-pick input { display: none; }
.kind-pick span { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-size: 13px; font-weight: 700; transition: all .15s; }
.kind-pick small { font-weight: 500; color: var(--faint); font-size: 11.5px; }
.kind-pick input:checked + span { border-color: var(--accent); background: var(--accent-soft); }

/* ===== 今日の時間割 ===== */
.today-tt { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pd { padding: 10px; border-radius: 11px; background: var(--bg-2); border: 1px solid var(--line); position: relative; overflow: hidden; min-height: 70px; }
.pd::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--line-2)); }
.pd small { font-size: 11px; color: var(--faint); font-weight: 600; }
.pd b { display: block; font-size: 13.5px; margin: 2px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd span { font-size: 11.5px; color: var(--muted); }
.pd.now { border-color: var(--accent-line); background: var(--accent-soft); }
.pd.empty b { color: var(--faint); font-weight: 500; }
.off-day { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--muted); }

/* ===== カレンダー ===== */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; }
.cal-title { display: flex; align-items: center; gap: 10px; }
.cal-title h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; min-width: 130px; }
.cal-tools { display: flex; align-items: center; gap: 8px; }
.cal-range { font-size: 12px; color: var(--faint); padding: 0 18px 12px; margin-top: -6px; }
.month { border-top: 1px solid var(--line); }
.month-dow, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-dow div { padding: 9px 10px; font-size: 11.5px; font-weight: 600; color: var(--faint); text-align: center; border-bottom: 1px solid var(--line); }
.month-dow div.sat { color: #7aa8e8; } .month-dow div.sun { color: #e07f90; }
.day { min-height: 104px; padding: 7px 7px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: rgba(255, 255, 255, .018); }
.day.out { background: rgba(0, 0, 0, .25); }
.day.out .dn { color: var(--faint); opacity: .55; }
.day .dn { font-size: 12.5px; font-weight: 600; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; margin-bottom: 1px; }
.day.sat .dn { color: #7aa8e8; } .day.sun .dn, .day.hol .dn { color: #f08a9b; }
.day.today .dn { background: var(--accent); color: var(--on-accent); }
.day.sel { background: rgba(16, 185, 129, .05); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip {
  display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; line-height: 1.5;
  background: color-mix(in srgb, var(--k) 14%, transparent); color: color-mix(in srgb, var(--k) 88%, white);
}
.chip::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--k); flex: none; }
.chip.done { opacity: .45; text-decoration: line-through; }
.more { font-size: 11px; color: var(--muted); padding-left: 6px; }
.k-holiday { --k: var(--holiday); } .k-event { --k: var(--event); } .k-exam { --k: var(--exam); } .k-note { --k: var(--note); } .k-assignment { --k: var(--accent); }

.week { border-top: 1px solid var(--line); overflow-x: auto; }
.week-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 820px; }
.week-grid > div { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); padding: 7px; min-width: 0; }
.week-grid > div:nth-child(8n) { border-right: 0; }
.wk-h { text-align: center; padding: 10px 6px !important; }
.wk-h small { display: block; font-size: 11px; color: var(--faint); font-weight: 600; }
.wk-h b { font-size: 18px; letter-spacing: -.02em; }
.wk-h.today b { color: var(--accent-hi); }
.wk-h.hol b, .wk-h.sun b { color: #f08a9b; } .wk-h.sat b { color: #7aa8e8; }
.wk-lbl { font-size: 11px; color: var(--faint); font-weight: 600; display: flex; align-items: center; justify-content: center; }
.wk-all { min-height: 44px; display: flex; flex-direction: column; gap: 3px; }
.wk-cell { min-height: 58px; }
.wk-cell .pd { min-height: 0; padding: 7px 8px 7px 10px; }
.wk-cell .pd b { font-size: 12.5px; }
.wk-off { height: 100%; display: grid; place-items: center; font-size: 11px; color: var(--faint); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(255, 255, 255, .02) 6px 12px); border-radius: 8px; min-height: 44px; }

.day-panel { border-top: 1px solid var(--line); padding: 16px 18px 18px; }
.day-panel h4 { margin: 0 0 10px; font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.di { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.di + .di { margin-top: 6px; }
.di .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--k); flex: none; }
.di .grow { flex: 1; min-width: 0; }
.di .grow b { font-size: 13px; display: block; }
.di .grow small { color: var(--muted); font-size: 11.5px; }

/* ===== ポップオーバー ===== */
.pop-wrap { position: relative; }
.pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .8);
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.pop label { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.pop label:hover { background: var(--surface-3); }
.pop input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.pop .sw { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.search-box { position: relative; }
.search-box .i { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.search-box .input { padding-left: 34px; height: 36px; }
.results { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.res { display: flex; align-items: center; gap: 10px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.res:hover { background: var(--surface-3); }
.res small { margin-left: auto; color: var(--faint); font-size: 11.5px; }

/* ===== チャット ===== */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100vh; }
.chat.info-open { grid-template-columns: 300px minmax(0, 1fr) 280px; }
.c-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: rgba(13, 15, 14, .55); }
.c-list-head { padding: 22px 16px 12px; display: flex; align-items: center; justify-content: space-between; }
.c-list-head h1 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.c-filter { padding: 0 12px 10px; }
.c-rows { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.c-row { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 11px; cursor: pointer; transition: background .12s; }
.c-row:hover { background: var(--surface); }
.c-row.on { background: var(--surface-2); }
.c-row .meta { min-width: 0; flex: 1; }
.c-row .top { display: flex; align-items: baseline; gap: 8px; }
.c-row .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.c-row .tm { font-size: 11px; color: var(--faint); flex: none; }
.c-row .pv { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-row.unread .nm, .c-row.unread .pv { color: var(--text); }
.c-row .cnt { min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; flex: none; }
.av-wrap { position: relative; flex: none; }
.av-wrap .online { position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); border: 2.5px solid var(--bg); }

.c-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.c-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(8, 9, 10, .7); backdrop-filter: blur(10px); }
.c-head .ttl { min-width: 0; flex: 1; line-height: 1.3; }
.c-head .ttl b { font-size: 14.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-head .ttl small { font-size: 12px; color: var(--muted); }
.msgs { flex: 1; overflow-y: auto; padding: 22px 24px 10px; }
.sep { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; color: var(--faint); font-size: 11.5px; font-weight: 600; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.m { display: flex; gap: 11px; padding: 2px 0; }
.m .av { margin-top: 2px; }
.m.cont { padding-left: 43px; }
.m.cont .av, .m.cont .m-who { display: none; }
.m-body { min-width: 0; max-width: min(620px, 80%); }
.m-who { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.m-who b { font-size: 13px; }
.m-who time { font-size: 11px; color: var(--faint); }
.bubble { display: inline-block; padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.m.cont .bubble { border-radius: 14px; }
.m.me { flex-direction: row-reverse; }
.m.me.cont { padding-left: 0; padding-right: 0; }
.m.me .av, .m.me .m-who b { display: none; }
.m.me .m-body { text-align: right; }
.m.me .m-who { justify-content: flex-end; }
.m.me .bubble { background: var(--accent); color: var(--on-accent); border-color: transparent; border-radius: 14px 4px 14px 14px; text-align: left; font-weight: 500; }
.m.me.cont .bubble { border-radius: 14px; }
.m + .m:not(.cont) { margin-top: 12px; }
.sys { text-align: center; margin: 12px 0; }
.sys span { display: inline-block; font-size: 11.5px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 4px 11px; border-radius: 20px; }
.composer { flex: none; padding: 12px 20px 18px; }
.composer-box { display: flex; align-items: flex-end; gap: 8px; padding: 7px 7px 7px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; border: 0; background: transparent; outline: none; resize: none; font-size: 14px; line-height: 1.55; padding: 6px 0; max-height: 160px; }
.composer .hint { font-size: 11px; color: var(--faint); margin: 6px 4px 0; }
.send { width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; transition: opacity .15s; }
.send:disabled { opacity: .35; cursor: default; }
.c-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.c-empty .big { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--accent-hi); }
.c-empty h3 { color: var(--text); margin: 0 0 6px; font-size: 17px; }
.c-info { border-left: 1px solid var(--line); overflow-y: auto; padding: 20px 16px; background: rgba(13, 15, 14, .55); }
.c-info h3 { font-size: 13px; color: var(--muted); margin: 18px 0 8px; font-weight: 600; }
.mem { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-radius: 9px; }
.mem:hover { background: var(--surface); }
.mem .grow { flex: 1; min-width: 0; font-size: 13px; }
.mem .grow small { display: block; color: var(--faint); font-size: 11px; }

/* ===== モーダル・トースト ===== */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .62); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9); animation: modalIn .2s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 4px; }
.modal-head h3 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.modal-body { padding: 14px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 6px 20px 20px; }
.picker { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 11px; padding: 4px; background: var(--bg-2); }
.pick { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.pick:hover { background: var(--surface-2); }
.pick .grow { flex: 1; min-width: 0; font-size: 13px; }
.pick .grow small { color: var(--faint); font-size: 11.5px; margin-left: 6px; }
.pick input { accent-color: var(--accent); width: 16px; height: 16px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); font-size: 13px; animation: modalIn .2s var(--ease); }
.toast .i { color: var(--accent-hi); }
.toast.err .i { color: var(--danger); }

/* ===== 表 ===== */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--faint); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.who-cell { display: flex; align-items: center; gap: 11px; }
.who-cell b { display: block; font-size: 13.5px; }
.who-cell small { color: var(--faint); font-size: 12px; }

.tt-edit { width: 100%; border-collapse: separate; border-spacing: 6px; }
.tt-edit th { font-size: 12px; color: var(--faint); font-weight: 600; padding: 4px; }
.tt-edit td { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; vertical-align: top; }
.tt-edit input[type=text] { width: 100%; border: 0; background: transparent; outline: none; font-size: 12px; padding: 3px 0; color: var(--muted); }
.tt-edit input.s { font-size: 13px; font-weight: 700; color: var(--text); }
.tt-edit input[type=color] { width: 100%; height: 6px; border: 0; padding: 0; background: none; cursor: pointer; margin-top: 4px; }
.tt-edit input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.tt-edit input[type=color]::-webkit-color-swatch { border: 0; border-radius: 3px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches label { cursor: pointer; }
.swatches input { display: none; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 9px; background: var(--c); box-shadow: inset 0 0 0 2px transparent; transition: transform .12s; }
.swatches input:checked + span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }

.mobile-bar { display: none; }
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: 1fr; }
  .chat.info-open { grid-template-columns: 300px minmax(0, 1fr); }
  .c-info { position: fixed; right: 0; top: 0; bottom: 0; width: 290px; z-index: 40; background: var(--bg-2); }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .main { padding-bottom: 64px; }
  .page { padding: 22px 16px 40px; }
  .page-head h1 { font-size: 24px; }
  .today-tt { grid-template-columns: repeat(3, 1fr); }
  .day { min-height: 70px; padding: 4px; }
  .chip { font-size: 10px; padding: 1px 4px; }
  .chip::before { display: none; }
  .chat, .chat.info-open { grid-template-columns: 1fr; height: calc(100vh - 64px); }
  .chat.open .c-list { display: none; }
  .chat:not(.open) .c-main { display: none; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 64px; z-index: 50; background: rgba(8, 9, 10, .92); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .mobile-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--faint); font-weight: 600; position: relative; }
  .mobile-bar a.on { color: var(--accent-hi); }
  .mobile-bar .badge { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
}

/* =====================================================================
   iPad 前提の調整
   ===================================================================== */
.shell { height: 100vh; height: 100dvh; padding-top: env(safe-area-inset-top); }
.chat { height: calc(100vh - env(safe-area-inset-top)); height: calc(100dvh - env(safe-area-inset-top)); }
.side { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
.c-back { display: none; }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* 指で操作する端末（iPad）: 押しやすい大きさ・ズームしない文字サイズ */
@media (pointer: coarse) {
  body { font-size: 15px; -webkit-tap-highlight-color: transparent; }
  .btn { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 11px; }
  .btn-sm { height: 38px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
  .btn-icon { width: 44px; } .btn-sm.btn-icon { width: 38px; }
  .input, .select { height: 46px; font-size: 16px; }
  .textarea, .composer textarea { font-size: 16px; }
  .nav a { height: 46px; font-size: 14.5px; }
  .seg button, .seg a { height: 36px; padding: 0 16px; font-size: 13.5px; }
  .c-row { padding: 12px 10px; }
  .pick { padding: 11px 10px; }
  .pick input { width: 20px; height: 20px; }
  .pop label { min-height: 44px; }
  .send { width: 44px; height: 44px; border-radius: 12px; }
  .task .chk, .hw .chk { width: 30px; height: 30px; }
  .day { min-height: 104px; }
  .bubble { font-size: 15.5px; }
  .toasts { bottom: max(20px, env(safe-area-inset-bottom)); }
}
/* タッチ端末ではホバーの見た目が押したあと残るので出さない */
@media (hover: none) {
  .btn:hover { background: var(--surface-2); border-color: var(--line-2); }
  .btn-primary:hover { background: var(--accent); border-color: transparent; }
  .btn-ghost:hover { background: transparent; color: var(--muted); border-color: transparent; }
  .pcard:hover { transform: none; box-shadow: none; }
  .pcard:hover .pthumb img, .gallery a:hover img { transform: none; }
  .c-row:hover, .mem:hover, .pick:hover, .day:hover { background: transparent; }
  .c-row.on:hover { background: var(--surface-2); }
  .btn:active, .c-row:active, .pick:active, .menu-grid a:active { opacity: .7; }
}

/* iPad の縦向き・分割表示（761〜1180px）: 左はアイコンのレールにして画面を広く使う */
@media (min-width: 761px) and (max-width: 1180px) {
  .shell { grid-template-columns: 84px minmax(0, 1fr); }
  .side { padding: 14px 8px; align-items: center; }
  .side .brand { padding: 4px 0 16px; justify-content: center; }
  .brand-txt, .class-chip, .nav-sec, .side-foot .who, .side-foot form { display: none; }
  .nav { width: 100%; gap: 4px; }
  .nav a { flex-direction: column; justify-content: center; gap: 3px; height: 58px; padding: 0 2px; font-size: 10.5px; text-align: center; line-height: 1.2; }
  .nav a .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a.on::before { left: -8px; top: 14px; bottom: 14px; }
  .nav .badge { position: absolute; top: 4px; right: 12px; margin: 0; }
  .nav .pts { position: absolute; top: 4px; right: 4px; margin: 0; }
  .side-foot { justify-content: center; border-top: 0; padding: 10px 0 0; }
  .page { padding: 26px 24px 50px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .chat, .chat.info-open { grid-template-columns: 290px minmax(0, 1fr); }
  .c-info { position: fixed; right: 0; top: 0; bottom: 0; width: 320px; z-index: 40; background: var(--bg-2); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .8); padding-top: max(20px, env(safe-area-inset-top)); }
}
@media (min-width: 1000px) and (max-width: 1180px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr) 320px; }
}
/* スマホ・iPad の狭い分割表示 */
@media (max-width: 760px) {
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .mobile-bar { height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .chat, .chat.info-open { height: calc(100vh - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); height: calc(100dvh - 64px - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
  .c-back { display: inline-flex; }
  .hide-sm { display: none; }
  .grid-auto { grid-template-columns: 1fr; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); max-height: 92vh; overflow-y: auto; }
  .modal.wide { max-width: none; }
  .c-info { width: 100%; }
  .fr-act .btn span { display: none; }
}
.nav .pts { margin-left: auto; font-size: 11px; font-weight: 700; color: #fcd34d; background: rgba(251, 191, 36, .1); padding: 1px 7px; border-radius: 9px; }
.nav .badge.warn { background: var(--exam); }

/* ボトムシート（通知・メニュー） */
.modal.sheet .modal-body { padding-top: 6px; }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.menu-grid a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 84px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.menu-grid a.on { color: var(--accent-hi); border-color: var(--accent-line); }
.menu-grid .badge { position: absolute; top: 8px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: 10.5px; display: grid; place-items: center; }
.notif-list { max-height: 60vh; overflow-y: auto; margin: 0 -8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 10px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.notif + .notif { border-top: 1px solid var(--line); border-radius: 0; }
.notif.new { background: var(--accent-soft); border-radius: 12px; }
.notif .grow { flex: 1; min-width: 0; }
.notif small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.notif-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-3); color: var(--accent-hi); }
.notif-ic .av { width: 30px; height: 30px; }
.sheet-list { display: flex; flex-direction: column; gap: 6px; }
.sheet-list button { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 50px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); text-align: left; font-weight: 600; }
.sheet-list button small { flex-basis: 100%; padding-left: 30px; color: var(--faint); font-weight: 400; font-size: 12px; }
.sheet-list .danger { color: var(--danger); }

/* 称号・アイコンの枠 */
.ttl-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; vertical-align: 1px;
  color: #fde68a; background: linear-gradient(135deg, rgba(251, 191, 36, .18), rgba(245, 158, 11, .08)); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .3); white-space: nowrap; }
.av.fr-mint { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #34d399; }
.av.fr-gold { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fbbf24, 0 0 14px -2px rgba(251, 191, 36, .7); }
.av.fr-sakura { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f9a8d4, 0 0 14px -2px rgba(244, 114, 182, .6); }
.av.fr-neon { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #22d3ee, 0 0 18px 0 rgba(34, 211, 238, .8); animation: neon 2.4s ease-in-out infinite; }
@keyframes neon { 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #a78bfa, 0 0 22px 2px rgba(167, 139, 250, .8); } }
.av.fr-rainbow { position: relative; isolation: isolate; box-shadow: 0 0 0 2px var(--bg); }
.av.fr-rainbow::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; padding: 2px; z-index: -1;
  background: conic-gradient(#f87171, #fbbf24, #34d399, #60a5fa, #a78bfa, #f472b6, #f87171); animation: spin 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.m .av[class*="fr-"] { margin: 4px; }

/* チャット: 送信取り消し・ブロック中・メッセージの操作 */
.gone { text-align: center; margin: 10px 0; }
.gone span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); padding: 5px 12px; border-radius: 20px; border: 1px dashed var(--line-2); }
.bubble { cursor: pointer; }
.m.acting .bubble { outline: 2px solid var(--accent-line); outline-offset: 2px; }
.m-actions { display: flex; gap: 6px; margin-top: 6px; animation: popIn .15s var(--ease); }
.m.me .m-actions { justify-content: flex-end; }
.m-actions button { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.m-actions .danger { color: var(--danger); }
.cant-send { display: flex; align-items: center; gap: 10px; justify-content: center; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }
.composer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
@media (max-width: 760px) { .composer { padding-bottom: 12px; } }
.c-info .mem .btn-sm { flex: none; }

/* カレンダー: 自分だけの予定 */
.chip.priv { border-style: dashed; }
.chip.priv .i { display: inline-block; vertical-align: -1px; margin-right: 3px; }
.seg-lg button { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* フレンド */
.fr-search { margin-bottom: 18px; max-width: 420px; }
.fr-sec { margin-bottom: 18px; }
.fr-list { padding-top: 8px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.fr-row + .fr-row { border-top: 1px solid var(--line); }
.fr-row .grow { flex: 1; min-width: 0; }
.fr-row .grow b { font-size: 14.5px; }
.fr-row .grow small { display: block; color: var(--faint); font-size: 12px; }
.fr-act { display: flex; gap: 6px; flex: none; }
.fr-empty { margin: 4px 0; font-size: 13px; }

/* ポイント */
.pts-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px;
  background: radial-gradient(500px 200px at 0% 0%, rgba(251, 191, 36, .14), transparent 70%), var(--surface); }
.pts-big { display: flex; align-items: baseline; gap: 8px; }
.pts-big b { font-size: 46px; letter-spacing: -.03em; line-height: 1; }
.pts-big small { color: var(--muted); font-size: 15px; font-weight: 700; }
.pts-star { color: #fbbf24; align-self: center; }
.pts-me { display: flex; align-items: center; gap: 14px; }
.pts-me small { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.shop-h { font-size: 12px; color: var(--faint); font-weight: 700; margin: 4px 0 10px; letter-spacing: .03em; }
.shop-h + .shop { margin-bottom: 18px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-2); text-align: center; }
.shop-item.on { border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .05); }
.shop-item .av { width: 40px; height: 40px; border-radius: 12px; font-size: 16px; margin: 4px; }
.shop-name { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: -4px; }
.shop-item .btn { width: 100%; }
.shop-item .btn .i { color: #fbbf24; }
.shop-item .btn-primary .i { color: var(--on-accent); }
.rule { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-size: 13.5px; }
.rule + .rule { border-top: 1px solid var(--line); }
.rule b { color: #fcd34d; }
.rule b.neg { color: var(--muted); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 10px; font-size: 13.5px; }
.rank-row.me { background: var(--accent-soft); }
.rank-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row b small { color: var(--faint); font-size: 11px; margin-left: 2px; }
.rank-n { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--surface-3); color: var(--muted); flex: none; }
.rank-1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #3b2500; }
.rank-2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #1f2937; }
.rank-3 { background: linear-gradient(135deg, #fdba74, #c2410c); color: #2a1206; }

/* 招待・承認 */
.invite { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.invite .grow { flex: 1; min-width: 180px; }
.qr { padding: 10px; background: #fff; border-radius: 14px; flex: none; }
.qr img, .qr canvas { display: block; }
.invite-code { font-size: 26px; font-weight: 800; letter-spacing: .08em; word-break: break-all; }
.invite-set { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.code-input { font-size: 18px; letter-spacing: .06em; font-weight: 700; }
.waiting-card { border-color: rgba(251, 191, 36, .35); }
.wait-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; flex-wrap: wrap; }
.wait-row + .wait-row { border-top: 1px solid var(--line); }
.wait-row .grow { flex: 1; min-width: 160px; }
.wait-row .grow small { display: block; color: var(--faint); font-size: 12px; }
.pending-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.pending-card { max-width: 480px; padding: 36px 30px; text-align: center; }
.pending-card h1 { font-size: 22px; margin: 18px 0 12px; letter-spacing: -.02em; }
.pending-card p { color: var(--muted); font-size: 14px; line-height: 1.8; }
.pending-ico { width: 68px; height: 68px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: rgba(251, 191, 36, .12); color: #fbbf24; }
.steps { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.steps div { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.steps span { width: 22px; height: 22px; border-radius: 7px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-hi); font-weight: 800; font-size: 12px; }

/* 時間割: 時刻・7限以上・スクショ読み取りの確認表 */
.today-tt { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.wk-lbl .pt-time { display: block; font-size: 10.5px; color: var(--faint); font-weight: 500; line-height: 1.35; margin-top: 3px; }
.tt-edit th .tt-time { display: block; width: 100%; margin-top: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg-2); font-size: 11.5px; padding: 3px 4px; color: var(--muted); }
.tt-prev-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; max-height: 56vh; }
.tt-prev { border-collapse: separate; border-spacing: 4px; min-width: 640px; width: 100%; }
.tt-prev th { font-size: 12px; color: var(--faint); font-weight: 700; padding: 4px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tt-prev tr th:first-child { width: 86px; text-align: left; }
.tt-prev th input[type=time] { display: block; width: 100%; margin-top: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); font-size: 11px; padding: 2px 3px; color: var(--muted); }
.tt-prev td { background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 9px; padding: 5px 7px; vertical-align: top; }
.tt-prev td input { width: 100%; border: 0; background: transparent; outline: none; font-size: 12px; color: var(--muted); padding: 2px 0; }
.tt-prev td input.s { font-size: 14px; font-weight: 700; color: var(--text); }
@media (pointer: coarse) { .tt-prev td input { font-size: 16px; } .tt-prev td input.s { font-size: 16px; } }

/* クラス（1組・2組・3組…） */
.cls-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cls-pick label { cursor: pointer; }
.cls-pick label input { position: absolute; opacity: 0; pointer-events: none; }
.cls-pick label span { display: inline-flex; align-items: center; justify-content: center; min-width: 76px; height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 700; font-size: 15px; transition: all .12s; }
.cls-pick label input:checked + span { background: var(--accent); color: var(--on-accent); border-color: transparent; box-shadow: 0 6px 18px -8px var(--accent); }
.cls-pick label input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.cls-pick .btn { min-width: 76px; font-size: 15px; }
.cls-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 18px; border-color: rgba(251, 191, 36, .4); background: linear-gradient(135deg, rgba(251, 191, 36, .08), transparent 60%), var(--surface); }
.cls-banner-txt { display: flex; align-items: center; gap: 12px; color: #fbbf24; }
.cls-banner-txt b { display: block; color: var(--text); font-size: 14.5px; }
.cls-banner-txt span { display: block; color: var(--muted); font-size: 12.5px; }
.cls-tabs { display: inline-flex; flex-wrap: wrap; }
.cls-inline .select { height: 32px; font-size: 13px; padding: 0 8px; min-width: 88px; width: auto; }
@media (pointer: coarse) { .cls-inline .select { height: 40px; font-size: 16px; } }
.cls-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cls-row .input { flex: 1; }
.cls-row .faint { font-size: 12px; min-width: 34px; text-align: right; }
.tgt-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.tgt-seg label { flex: 1; min-width: 120px; cursor: pointer; }
.tgt-seg input { position: absolute; opacity: 0; pointer-events: none; }
.tgt-seg span { display: flex; align-items: center; justify-content: center; gap: 7px; height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--bg-2); font-weight: 600; font-size: 13.5px; color: var(--muted); }
.tgt-seg input:checked + span { color: var(--text); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }

/* 時間割の読み取り: 選んだ画像の小さな見本 */
.shot-thumb { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); font-size: 12px; color: var(--muted); }
.shot-thumb:empty { display: none; }
.shot-thumb img { width: 84px; height: 84px; object-fit: cover; object-position: top; border-radius: 8px; background: #fff; flex: none; }

/* なんでも質問 */
.qa-row { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; transition: border-color .15s; }
.qa-row:hover { border-color: var(--line-2); }
.qa-row .grow { flex: 1; min-width: 0; }
.qa-count { width: 56px; flex: none; text-align: center; padding: 8px 0; border-radius: 12px; border: 1px solid var(--line); color: var(--faint); }
.qa-count b { display: block; font-size: 18px; line-height: 1.1; }
.qa-count small { font-size: 10.5px; }
.qa-count.has { color: var(--text); border-color: var(--line-2); }
.qa-count.ok { color: var(--accent-hi); border-color: var(--accent-line); background: var(--accent-soft); }
.qa-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.qa-tags:empty { display: none; }
.qa-title { display: block; font-size: 15px; line-height: 1.5; margin-bottom: 6px; }
.qa-new { margin-bottom: 18px; border-color: var(--accent-line); }
.av.anon { color: var(--muted); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.av.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 10px; }
.anon-note { margin-left: 6px; font-size: 11px; color: var(--exam); }
.anon-check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 6px; cursor: pointer; }
.anon-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.anon-check b { display: block; font-size: 13.5px; }
.anon-check small { display: block; color: var(--faint); font-size: 12px; }
.reply.best { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line) inset; }
/* 運営からのお知らせ */
.ann-card { margin-bottom: 18px; border-color: rgba(96, 165, 250, .35); background: linear-gradient(135deg, rgba(96, 165, 250, .08), transparent 55%), var(--surface); }
.ann-card .card-head h2 .i { color: var(--event); }
.ann + .ann { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ann-top { display: flex; align-items: center; gap: 10px; }
.ann-top b { font-size: 14.5px; }
.ann-top .faint { font-size: 12px; }
.ann p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.ann-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }

/* ダイアログ: 中身だけスクロールして、下のボタンは常に見えるように（iPad で「保存」が画面外に出ないように） */
.modal { display: flex; flex-direction: column; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow: hidden; }
.modal-head, .modal-foot { flex: none; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.modal-foot { padding-top: 12px; border-top: 1px solid var(--line); background: var(--surface); }
.tt-prev-wrap { max-height: none; }
@media (max-width: 760px) { .modal { max-height: 92vh; max-height: calc(92dvh - env(safe-area-inset-top)); overflow: hidden; } .modal-foot { padding-bottom: max(16px, env(safe-area-inset-bottom)); } }
.tt-savebar { position: sticky; top: -14px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--accent-line); font-size: 13px; font-weight: 600; }

/* ===== 追加分（安全・チャット・マイページ） ===== */
.rules { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; margin: 4px 0 10px; background: var(--bg-2); font-size: 12.5px; color: var(--muted); }
.rules b { color: var(--text); font-size: 13.5px; }
.rules ul { margin: 6px 0; padding-left: 18px; line-height: 1.7; }
.report-link { color: var(--faint); font-size: 12px; }
.report-snap { margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); font-size: 12.5px; white-space: normal; word-break: break-word; }
.mute-sel { height: 30px; width: auto; font-size: 12.5px; padding: 0 6px; }
.alog div { font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
/* チャット */
.c-main { position: relative; }
.new-btn { position: absolute; left: 50%; transform: translateX(-50%); bottom: 110px; z-index: 5; height: 38px; padding: 0 16px; border-radius: 19px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 8px 24px -8px rgba(0,0,0,.8); }
.unread-sep { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--accent-hi); font-size: 11.5px; font-weight: 700; }
.unread-sep::before, .unread-sep::after { content: ""; flex: 1; height: 1px; background: var(--accent-line); }
.m-read { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.m-read:empty { display: none; }
.bubble.img { padding: 4px; display: inline-block; background: var(--surface-2); }
.bubble.img img { display: block; max-width: min(320px, 60vw); max-height: 320px; border-radius: 10px; }
.bubble.poll { display: block; min-width: 240px; max-width: 360px; text-align: left; color: var(--text) !important; background: var(--surface-2) !important; border: 1px solid var(--line-2) !important; }
.bubble.poll b { display: block; margin-bottom: 8px; }
.bubble.poll small { display: block; margin-top: 6px; color: var(--faint); font-size: 11px; }
.poll-opt { position: relative; display: flex; align-items: center; width: 100%; min-height: 40px; margin-top: 6px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); overflow: hidden; font-size: 13.5px; }
.poll-opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); }
.poll-opt .t, .poll-opt .n { position: relative; }
.poll-opt .t { flex: 1; }
.poll-opt .n { font-weight: 700; color: var(--muted); }
.poll-opt.on { border-color: var(--accent); }
.cbtn { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; }
.offline-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 90; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: #b45309; color: #fff; text-align: center; font-size: 13px; font-weight: 600; }
/* マイページ */
.home-search { margin-bottom: 14px; max-width: 520px; }
.home-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.home-strip:empty { display: none; }
.strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.strip.exam { border-color: rgba(251, 191, 36, .4); color: #fcd34d; }
.strip.exam span { color: var(--text); }
.strip .big { font-size: 18px; color: #fcd34d; margin-left: 4px; }
.onboard { margin-bottom: 18px; border-color: var(--accent-line); }
.steps .done { opacity: .5; text-decoration: line-through; }
.steps a { color: var(--accent-hi); font-weight: 600; }
.prep-tt { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.prep-tt span { font-size: 12.5px; padding: 4px 9px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.prep-tt .chg { border-color: rgba(251, 191, 36, .5); color: #fcd34d; }
.prep-item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.prep-item input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.prep-item input:checked + span { color: var(--faint); text-decoration: line-through; }
.prep-item .x { margin-left: auto; border: 0; background: none; color: var(--faint); }
.prep-add { display: flex; gap: 6px; margin-top: 10px; }
.tt-chg-form { display: grid; grid-template-columns: 150px 90px 1fr 1fr auto; gap: 8px; }
@media (max-width: 900px) { .tt-chg-form { grid-template-columns: 1fr 1fr; } .tt-chg-form .btn { grid-column: 1 / -1; } }
@media (max-width: 760px) { .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); } }
/* 文字の見やすさ・キーボード操作 */
:root { --faint: #7b857f; }
.btn:focus-visible, .nav a:focus-visible, .c-row:focus-visible, .input:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ===== スマホ（〜760px）の崩れ直し ===== */
@media (max-width: 760px) {
  .grid-2, .grid-auto, .grid-2.grid-auto { grid-template-columns: minmax(0, 1fr) !important; }
  .stack, .stack > *, .card { min-width: 0; }
  .page { padding: 16px 14px 32px; }
  .page-head { flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-head > div:first-child { min-width: 0; flex: 1 1 auto; }
  .page-head h1 { font-size: 22px; }
  .page-head .actions { flex-wrap: wrap; gap: 6px; }
  .page-head .actions .btn { height: 40px; padding: 0 12px; font-size: 13px; }
  .card-head { flex-wrap: wrap; padding: 14px 14px 0; }
  .card-body { padding: 12px 14px 14px; }
  .t-title, .hw-title, .qa-title { word-break: break-word; overflow-wrap: anywhere; }
  .task .t-main, .hw-main { min-width: 0; }
  .hw { flex-wrap: wrap; }
  .hw-side { width: 100%; justify-content: space-between; }
  .today-tt { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tt-chg-form { grid-template-columns: 1fr 1fr; }
  .search-box[style*="width:240px"], form.search-box { width: 100% !important; margin-left: 0 !important; }
  .seg { flex-wrap: wrap; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .qa-row { gap: 10px; padding: 12px; }
  .qa-count { width: 46px; }
  .fr-row { flex-wrap: wrap; }
  .fr-act { width: 100%; justify-content: flex-end; }
  .tbl th, .tbl td { padding: 8px 6px; font-size: 12.5px; }
  .wait-row form, .who-cell { min-width: 0; }
  .m-body { max-width: 82%; }
  .bubble.poll { min-width: 0; max-width: 100%; }
  .c-head { padding: 0 10px; gap: 8px; }
  .msgs { padding: 14px 12px 8px; }
  .composer { padding: 8px 10px 10px; }
  .composer .hint { display: none; }
  .new-btn { bottom: 84px; }
  .home-search { max-width: none; }
  .pts-big b { font-size: 36px; }
  .invite { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  .day { min-height: 62px !important; padding: 4px 3px; }
  .day .dn { width: 20px; height: 20px; font-size: 11.5px; }
  .cal-bar { padding: 12px; } .cal-range { padding: 0 12px 10px; }
  .cal-title h3 { min-width: 0; font-size: 16px; }
  /* トークの中にいる間は下のメニューを隠して、画面いっぱいに（LINE のように） */
  body:has(.chat.open) .mobile-bar { display: none; }
  body:has(.chat.open) .main { padding-bottom: 0; }
  .chat.open { height: calc(100vh - env(safe-area-inset-top)); height: calc(100dvh - env(safe-area-inset-top)); }
  .chat.open .composer { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .composer textarea { overflow-y: auto; scrollbar-width: none; }
  .composer textarea::-webkit-scrollbar { display: none; }
  .composer-box { padding: 5px 5px 5px 4px; gap: 2px; }
  .cbtn { width: 34px; height: 34px; }
}

/* ---- アイコン写真（個人・グループ） ---- */
.av > img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.av:has(> img) { background: var(--surface-3); }
.av-emoji { font-size: 1.15em; line-height: 1; }
.av.group.lg { width: 56px; height: 56px; border-radius: 16px; }
.av.group.lg .av-emoji { font-size: 28px; }
.g-av-btn { position: relative; display: inline-block; border: 0; padding: 0; background: none; cursor: pointer; border-radius: 16px; }
.g-av-cam { position: absolute; right: -4px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; border: 2px solid var(--bg); }
.emoji-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.emoji-grid .btn { font-size: 20px; padding: 8px 0; justify-content: center; }

/* ---- リアクション・返信・メンション・宿題カード・ボット ---- */
.m-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.m-reacts:empty { display: none; }
.m.me .m-reacts { justify-content: flex-end; }
.rc { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 2px 8px; font-size: 12.5px; cursor: pointer; line-height: 1.5; }
.rc.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, transparent); }
.react-pick { display: flex; gap: 2px; padding: 2px 2px 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.react-pick button { flex: 1; font-size: 20px; padding: 6px 0 !important; justify-content: center; background: none; border: 0; border-radius: 10px; cursor: pointer; }
.react-pick button:hover { background: var(--surface-3); }
.quote { font-size: 12px; color: var(--muted); border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 8px; padding: 4px 8px; margin: 2px 0 3px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.quote b { color: var(--text); margin-right: 6px; font-weight: 600; }
.m.flash .bubble { outline: 2px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
.bubble.big-emoji { background: none !important; box-shadow: none !important; font-size: 44px; line-height: 1.15; padding: 0 2px; }
.mention { color: var(--accent-hi, var(--accent)); font-weight: 600; }
.mention.me { background: color-mix(in srgb, #f59e0b 28%, transparent); border-radius: 4px; padding: 0 2px; color: inherit; }
.bubble.assign { display: flex; flex-direction: column; gap: 4px; min-width: 220px; max-width: 320px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); }
.bubble.assign small { color: var(--muted); font-size: 12px; }
.bubble.assign.done b { text-decoration: line-through; opacity: .7; }
.assign-acts { display: flex; gap: 6px; margin-top: 4px; }
.assign-pick { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.assign-pick .notif { width: 100%; text-align: left; border: 0; cursor: pointer; }
.bot-post { margin: 10px auto; max-width: min(420px, 92%); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 14px; }
.bot-b { white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 6px; background: var(--surface-2); border-left: 3px solid var(--accent); border-radius: 10px; }
.reply-bar[hidden], .mention-pop[hidden] { display: none; }
.reply-bar .grow { min-width: 0; }
.reply-bar b { display: block; font-size: 12px; }
.reply-bar small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-pop { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mention-pop button { border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; }
.m-actions { flex-wrap: wrap; }
.m-actions .react-pick { flex-basis: 100%; }
.m-actions .react-pick button { flex: 1; height: 42px; padding: 0; border: 0; background: none; font-size: 21px; justify-content: center; }
.m .bubble.assign, .m.me .bubble.assign { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); font-weight: 400; }
.m.me .mention { color: inherit; text-decoration: underline; }

/* ---- 行事・持ち物 ---- */
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pk-past { opacity: .7; }
.pk-card { display: block; color: inherit; text-decoration: none; transition: border-color .15s; }
.pk-card:hover { border-color: var(--accent); }
.pk-title { display: block; font-size: 16px; margin: 8px 0 2px; }
.pk-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pk-note { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); }
.pk-prog { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 12px 0 6px; }
.pk-prog span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .25s; }
.pk-count { font-size: 12.5px; color: var(--muted); }
.pk-count b { color: var(--text); font-size: 15px; }
.pk-group { margin-top: 12px; }
.pk-list { padding: 4px 8px 8px; }
.pk-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.pk-item:last-child { border-bottom: 0; }
.pk-item label { flex: 1; display: flex; align-items: center; gap: 12px; padding: 11px 8px; cursor: pointer; min-height: 48px; }
.pk-item input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.pk-item input:checked + span { text-decoration: line-through; color: var(--faint, var(--muted)); }
.pk-item small.tag { margin-left: auto; }
.pk-tpl { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pk-home { display: flex; flex-direction: column; gap: 6px; }
.pk-home a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: inherit; text-decoration: none; }
.pk-home small { color: var(--muted); font-size: 12px; }
.bubble.pack { display: flex; flex-direction: column; gap: 4px; min-width: 220px; max-width: 320px; text-decoration: none; }
.m .bubble.pack, .m.me .bubble.pack { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); font-weight: 400; }
.bubble.pack small { color: var(--muted); font-size: 12px; }
.bubble.pack .btn { align-self: flex-start; margin-top: 4px; }
.pk-scan-st { font-size: 12.5px; margin: 0 0 8px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pk-scan-st.bad { background: color-mix(in srgb, #ef4444 14%, transparent); }
.pk-scan-st[hidden] { display: none; }

.m.pending { opacity: 1; } .m.pending.slow { opacity: .7; }   /* 送ってすぐは、ふつうの見た目（遅いときだけ うすく） */

/* 中の位置（offsetTop）をトークの枠からの距離にする */
.msgs { position: relative; }

/* チャット画面は画面全体を固定する（iPad でキーボードの出し入れや未読位置への移動のあと、画面全体が上にずれて戻らないのを防ぐ）。
   スクロールするのはトーク一覧とメッセージの枠の中だけ */
html:has(body[data-page="chat"]) { overflow: hidden; height: 100%; }
body[data-page="chat"] { position: fixed; inset: 0; overflow: hidden; }
/* キーボードが出たら、見えている高さに合わせる（JS が height を入れる） */
body[data-page="chat"][style*="height"] { bottom: auto; }
/* 「〇〇が入力中…」 */
.typing-bar { flex: none; padding: 2px 24px 0; font-size: 12px; color: var(--muted); }
.typing-pv { color: var(--accent-hi, var(--accent)); }
.typing-bar, .typing-pv { animation: typingFade 1.4s ease-in-out infinite; }
@keyframes typingFade { 50% { opacity: .45; } }

/* AI先生 */
.ai-answer { margin-top: 14px; }
.ai-q { font-size: 13px; color: var(--muted); border-left: 3px solid var(--accent); padding: 2px 10px; margin-bottom: 10px; white-space: pre-wrap; }
.ai-a { white-space: pre-wrap; line-height: 1.75; font-size: 14.5px; }
.ai-hist { margin-bottom: 8px; padding: 10px 14px; }
.ai-hist summary { cursor: pointer; font-size: 13.5px; }
.ai-hist .ai-a { margin-top: 10px; font-size: 13.5px; }
.seg label span { display: inline-block; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }

/* AI先生: 単語テスト・理解力テスト */
.ai-tabs a { cursor: pointer; }
.vc-top { display: flex; justify-content: space-between; align-items: center; }
.vc-q { font-size: 26px; font-weight: 700; text-align: center; margin: 18px 0; word-break: break-word; }
.vc-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vc-c { min-height: 54px; justify-content: center; white-space: normal; font-size: 15px; }
.vc-c.right, .qz-c.right { border-color: var(--accent) !important; background: color-mix(in srgb, var(--accent) 18%, transparent) !important; }
.vc-c.wrong, .qz-c.wrong { border-color: #ef4444 !important; background: color-mix(in srgb, #ef4444 15%, transparent) !important; }
.vc-type { display: flex; gap: 8px; }
.vc-fb { text-align: center; margin-top: 14px; min-height: 24px; }
.vc-fb .ok, .qz-ex .ok { color: var(--accent); } .vc-fb .ng, .qz-ex .ng { color: #ef4444; }
.qz-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.qz-q { margin-bottom: 8px; line-height: 1.6; }
.qz-c { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; margin-bottom: 6px; cursor: pointer; }
.qz-ex { font-size: 13px; color: var(--muted); margin-top: 6px; }
@media (max-width: 600px) { .vc-choices { grid-template-columns: 1fr; } }
.ai-chat { display: flex; flex-direction: column; }
.ai-chat-log { height: min(55vh, 460px); overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-bub { max-width: 82%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; line-height: 1.6; font-size: 14.5px; word-break: break-word; }
.ai-bub.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; }
.ai-bub.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-radius: 14px 4px 14px 14px; }
.ai-chat-in { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }

/* ---- AI先生: 見やすく ---- */
.ai-hero { display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 16px; border-radius: 18px; border: 1px solid var(--line-2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, #8b5cf6 14%, transparent)); position: relative; }
.ai-hero-av { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 32px; background: var(--surface); box-shadow: 0 4px 14px -6px rgba(0,0,0,.5); flex: none; }
.ai-hero h1 { margin: 0 0 4px; font-size: 22px; }
.ai-hero p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.ai-hero-tag { position: absolute; top: 12px; right: 12px; }
.ai-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.ai-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); text-decoration: none; text-align: center; transition: border-color .15s, background .15s; }
.ai-tabs a b { font-size: 14px; }
.ai-tabs a small { font-size: 11px; color: var(--muted); }
.ai-tabs a small b { font-size: 11px; color: var(--accent-hi, var(--accent)); }
.ai-tab-ic { font-size: 24px; line-height: 1.1; }
.ai-tabs a.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); box-shadow: 0 0 0 3px var(--accent-soft, transparent); }
.ai-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.ai-modes label span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); cursor: pointer; height: 100%; }
.ai-modes label small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.ai-modes input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.ai-input { font-size: 15px; min-height: 110px; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ai-examples button { border: 1px dashed var(--line-2); background: none; color: var(--muted); border-radius: 999px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.ai-examples button:hover { color: var(--text); border-style: solid; }
.ai-ask-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ai-think { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.ai-think span { display: flex; flex-direction: column; }
.ai-think small { font-size: 11px; color: var(--muted); }
.ai-think input { width: 18px; height: 18px; accent-color: var(--accent); }
.ai-go { padding-left: 18px; padding-right: 18px; }
.ai-note { font-size: 11.5px; color: var(--faint, var(--muted)); margin: 8px 2px 0; }
.ai-answer { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.ai-answer .ai-q { align-self: flex-end; max-width: 85%; border: 0; margin: 0; padding: 8px 12px; color: var(--on-accent); }
.ai-t-row { display: flex; gap: 10px; align-items: flex-start; }
.ai-t-av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.ai-t-row .ai-bub { max-width: 100%; flex: 1; padding: 12px 16px; }
.ai-st { font-size: 12px; color: var(--muted); margin-top: 6px; }
.ai-st:empty { display: none; }
.ai-hist summary { list-style: none; display: flex; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .ai-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-modes { grid-template-columns: 1fr; }
  .ai-hero { padding: 14px; } .ai-hero-av { width: 46px; height: 46px; font-size: 26px; }
}
.ai-src { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ai-src a { color: var(--accent-hi, var(--accent)); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-src a small { color: var(--muted); margin-left: 4px; }

/* ---- AI先生 v2: トーク形式・入力欄は下に固定 ---- */
.ai-hero, .ai-note { display: none; }
.ai-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ai-top-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ai-top-t b { font-size: 18px; }
.ai-top-t small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-top-av { font-size: 22px; }
.ai-tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; grid-template-columns: none; }
.ai-tabs a { flex: 1 0 auto; flex-direction: row; justify-content: center; gap: 6px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.ai-tabs a small { font-size: 11px; font-weight: 500; }
.ai-tabs a small b { font-size: 11px; }
.ai-pane { display: flex; flex-direction: column; height: calc(100dvh - 150px); min-height: 380px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); overflow: hidden; }
.ai-pane[hidden] { display: none; }
.ai-thread { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.ai-turn { display: flex; flex-direction: column; gap: 8px; }
.ai-turn .ai-bub.me { align-self: flex-end; max-width: 80%; }
.ai-t-row .ai-bub.bot { max-width: min(680px, 100%); flex: 0 1 auto; }
.ai-a { white-space: normal; line-height: 1.8; font-size: 15px; }
.ai-a .ai-p { margin: 0; }
.ai-a .ai-gap { height: 8px; }
.ai-a .ai-h { font-weight: 700; margin: 6px 0 2px; }
.ai-a .ai-li { display: flex; gap: 8px; margin: 3px 0; }
.ai-a .ai-li > span { flex: none; min-width: 1.4em; color: var(--accent-hi, var(--accent)); font-weight: 700; }
.ai-a .ai-li.num > span { width: 1.6em; height: 1.6em; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); margin-top: 2px; }
.ai-st { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.ai-dots { display: inline-flex; gap: 4px; padding: 6px 0; }
.ai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: aiDot 1.2s infinite ease-in-out; }
.ai-dots i:nth-child(2) { animation-delay: .15s; } .ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ai-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 460px; padding: 20px 8px; }
.ai-empty-av { font-size: 44px; }
.ai-empty small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.ai-empty .ai-examples { justify-content: center; margin-top: 8px; }
.ai-composer { border-top: 1px solid var(--line); padding: 8px 10px 10px; background: var(--surface); }
.ai-opts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.ai-pills { display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.ai-pills label span { display: inline-block; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.ai-pills input:checked + span { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.ai-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.ai-chip:has(input:checked) { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.ai-chip:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.ai-inrow { display: flex; gap: 8px; align-items: flex-end; }
.ai-inrow .textarea { flex: 1; min-height: 44px; max-height: 160px; resize: none; font-size: 15px; padding: 10px 12px; }
.ai-send { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 14px; flex: none; }
.ai-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ai-chat .ai-chat-log { flex: 1; height: auto; min-height: 0; }
.ai-chat .ai-chat-in { padding: 10px; }
.ai-chat .ai-chat-in .input { font-size: 15px; }
@media (max-width: 760px) {
  .ai-pane { height: calc(100dvh - 205px); border-radius: 14px; }
  .ai-top-t small { display: none; }
  .ai-turn .ai-bub.me { max-width: 88%; }
}
@media (max-width: 600px) {
  .ai-tabs { overflow: visible; gap: 4px; }
  .ai-tabs a { flex: 1 1 0; padding: 7px 2px; font-size: 12.5px; gap: 2px; min-width: 0; }
  .ai-tabs a small { display: none; }
}
.ai-chat .faint { align-items: center; white-space: nowrap; }

.ai-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ai-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ai-bar span { display: flex; gap: 12px; flex: none; }
.ai-msel { width: auto; flex: none; padding: 6px 8px; font-size: 13px; }


/* AI 答えを見やすく */
.ai-turn .ai-a { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 12px 15px; font-size: 16px; line-height: 1.85; }
.ai-a .ai-h { font-size: 16.5px; color: var(--accent-hi, var(--accent)); margin: 10px 0 4px; }
.ai-a b, .ai-a strong { background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 0 3px; border-radius: 4px; }

/* AI の図（グラフ・流れ図） */
.ai-graph-box { margin: 10px 0 4px; max-width: 320px; }
.ai-graph { width: 100%; height: auto; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; }
.ai-graph .gl { stroke: var(--line); stroke-width: .6; }
.ai-graph .ax { stroke: var(--text); stroke-width: 1.3; opacity: .7; }
.ai-graph .lb { font-size: 11px; fill: var(--muted, #888); }
.ai-graph-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 700; margin-top: 4px; }
.ai-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.ai-fbox { padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); font-size: 14px; line-height: 1.4; }
.ai-farr { color: var(--accent-hi, var(--accent)); font-weight: 700; }
.ai-chat-fig { white-space: normal; margin-top: 6px; background: none !important; border: 0 !important; padding: 0 !important; }

/* ===== ライトモード（html[data-theme=light]） ===== */
html[data-theme=light] {
  --bg: #f5f7f6; --bg-2: #eef1ef; --surface: #ffffff; --surface-2: #f3f5f4; --surface-3: #e8ecea;
  --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .14);
  --text: #111614; --muted: #55605a; --faint: #7b857f;
  --accent: #059669; --accent-hi: #047857; --accent-soft: rgba(5, 150, 105, .10); --accent-line: rgba(5, 150, 105, .32); --on-accent: #ffffff;
  --holiday: #e11d48; --event: #2563eb; --exam: #b45309; --note: #6b7280; --danger: #dc2626;
  color-scheme: light;
}
html[data-theme=dark] { color-scheme: dark; }
html[data-theme=light] body::before { background: radial-gradient(900px 500px at 12% -8%, rgba(16, 185, 129, .08), transparent 60%); }
html[data-theme=light] ::-webkit-scrollbar-thumb { background: #c9d0cc; }
html[data-theme=light] .alert.err { color: #b91c1c; }
html[data-theme=light] .alert.ok { color: #047857; }
html[data-theme=light] .side, html[data-theme=light] .c-list, html[data-theme=light] .c-head, html[data-theme=light] .c-info, html[data-theme=light] .mobile-bar { background: rgba(255, 255, 255, .88); }
html[data-theme=light] .pcount, html[data-theme=light] .pbadge.share { background: rgba(255, 255, 255, .9); color: #1d4ed8; border-color: rgba(0, 0, 0, .1); }
html[data-theme=light] .celebrate b { color: #065f46; }
html[data-theme=light] .celebrate span { color: #047857; }
html[data-theme=light] .month-dow div.sat, html[data-theme=light] .day.sat .dn, html[data-theme=light] .wk-h.sat b { color: #2563eb; }
html[data-theme=light] .month-dow div.sun, html[data-theme=light] .day.sun .dn, html[data-theme=light] .wk-h.hol b, html[data-theme=light] .wk-h.sun b { color: #e11d48; }
html[data-theme=light] .day:hover { background: rgba(0, 0, 0, .03); }
html[data-theme=light] .nav .pts, html[data-theme=light] .pts-star, html[data-theme=light] .shop-item .btn .i, html[data-theme=light] .rule b, html[data-theme=light] .pending-ico,
html[data-theme=light] .cls-banner-txt, html[data-theme=light] .strip.exam, html[data-theme=light] .strip .big, html[data-theme=light] .prep-tt .chg, html[data-theme=light] .ttl-badge { color: #b45309; }
/* 表示の切り替えボタン */
.theme-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-seg button { flex: 1; min-width: 90px; }
.theme-seg button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* ===== AI 入力欄（まとめたデザイン） ===== */
.ai-composer { border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); padding: 8px 10px 8px; margin: 10px 12px 12px; box-shadow: 0 6px 24px -14px rgba(0, 0, 0, .5); transition: border-color .15s, box-shadow .15s; }
.ai-composer:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.ai-composer .ai-inrow { display: block; }
.ai-composer .ai-inrow .textarea { border: 0; background: transparent; box-shadow: none; padding: 6px 4px; min-height: 40px; max-height: 180px; font-size: 16px; resize: none; width: 100%; }
.ai-composer .ai-inrow .textarea:focus { outline: none; box-shadow: none; }
.ai-tools { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.ai-ibtn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--muted); border: 1px solid var(--line-2); background: var(--surface-2); flex: none; font-size: 16px; }
.ai-ibtn:hover { color: var(--text); }
.ai-tg input:checked + span { filter: none; }
.ai-tg:has(input:checked) { background: var(--accent-soft); border-color: var(--accent-line); }
.ai-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); flex: none; }
.ai-seg label span { display: block; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.ai-seg input:checked + span { background: var(--accent); color: var(--on-accent); }
.ai-msel { position: relative; flex: none; }
.ai-mbtn { height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: inherit; }
.ai-mpop { position: absolute; bottom: 44px; left: 0; z-index: 30; width: min(300px, 80vw); max-height: min(320px, 55vh); overflow: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .6); }
.ai-mpop-h { display: block; font-size: 11.5px; color: var(--faint); padding: 6px 10px 4px; }
.ai-mpop label span { display: block; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.ai-mpop label span b { display: block; font-size: 14px; }
.ai-mpop label span small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ai-mpop label span:hover { background: var(--surface-2); }
.ai-mpop input:checked + span { background: var(--accent-soft); outline: 1px solid var(--accent-line); }
.ai-composer .ai-send { width: 38px; height: 38px; border-radius: 50%; padding: 0; display: grid; place-items: center; flex: none; }
.ai-composer #aiPrev:empty { display: none; }
@media (max-width: 520px) { .ai-seg label span { padding: 5px 8px; font-size: 12px; } .ai-mbtn { padding: 0 10px; font-size: 12.5px; } .ai-composer { margin: 8px; } }
/* キーボードが出ているあいだ: AI の画面は見えている高さに収める（入力欄がキーボードに隠れない） */
.kb-open .ai-pane { height: calc(var(--vvh, 100dvh) - 12px); min-height: 0; }
/* =====================================================================
   AI先生 v3 デザイン（すっきり・中央の1列・浮かぶ入力欄）
   ===================================================================== */
body[data-page="ai"] .page { max-width: 980px; }
.ai-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 2px 12px; }
.ai-top-t { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ai-top-av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, #60a5fa 25%, transparent)); box-shadow: inset 0 0 0 1px var(--accent-line); }
.ai-top-t b { font-size: 19px; letter-spacing: .01em; }
.ai-top-t small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* タブ: 細い切り替え（セグメント） */
.ai-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); margin-bottom: 12px; }
.ai-tabs a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); border: 0 !important; background: transparent !important; box-shadow: none !important; transition: background .15s, color .15s; }
.ai-tabs a:hover { color: var(--text); }
.ai-tabs a.on { background: var(--accent-soft) !important; color: var(--accent-hi) !important; box-shadow: inset 0 0 0 1px var(--accent-line) !important; }
.ai-tabs a small { font-size: 11px; font-weight: 500; opacity: .75; }
/* 質問の画面: 枠をなくして、会話と入力欄を中央の1列に */
.ai-pane { border: 0 !important; background: transparent !important; border-radius: 0; }
.ai-bar { border: 0 !important; background: transparent !important; padding: 2px 4px 8px !important; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ai-bar b { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-bar span { display: flex; gap: 6px; flex: none; }
.ai-bar span a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 600; color: var(--text); }
.ai-bar span a:hover { border-color: var(--accent-line); }
.ai-thread { padding: 8px 6px 18px !important; }
.ai-thread > * { max-width: 760px; margin-left: auto !important; margin-right: auto !important; }
/* はじめの画面 */
.ai-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; min-height: 100%; padding: 24px 8px; }
.ai-hello { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ai-hello-g { font-size: clamp(24px, 4vw, 34px); font-weight: 700; line-height: 1.25; background: linear-gradient(90deg, #34d399, #60a5fa 55%, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ai-hello small { color: var(--muted); font-size: 14px; }
.ai-examples { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 560px; }
.ai-examples button { display: grid !important; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 12px 14px !important; border-radius: 16px !important; background: var(--surface) !important; border: 1px solid var(--line-2) !important; color: var(--text); cursor: pointer; transition: transform .15s var(--ease), border-color .15s; font: inherit; }
.ai-examples button:hover { transform: translateY(-2px); border-color: var(--accent-line) !important; }
.ai-examples button i { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 18px; background: var(--surface-2); }
.ai-examples button b { font-size: 14px; }
.ai-examples button small { font-size: 12px; color: var(--muted); }
.ai-note { margin: 0; max-width: 520px; font-size: 12px; color: var(--faint); line-height: 1.7; }
/* 会話: 自分は右の吹き出し、AI は吹き出しなしで読みやすく */
.ai-turn { gap: 12px; margin-bottom: 22px; }
.ai-turn .ai-bub.me { max-width: min(78%, 560px); background: var(--accent-soft) !important; color: var(--text) !important; border: 1px solid var(--accent-line); border-radius: 18px 18px 6px 18px !important; padding: 10px 14px !important; font-size: 15px; line-height: 1.65; }
.ai-t-row { display: flex; gap: 12px; align-items: flex-start; }
.ai-t-av { width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: 17px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, #60a5fa 25%, transparent)); box-shadow: inset 0 0 0 1px var(--accent-line); }
.ai-turn .ai-bub.bot { flex: 1; min-width: 0; max-width: none !important; background: transparent !important; border: 0 !important; padding: 4px 0 0 !important; }
.ai-turn .ai-a { background: transparent !important; border: 0 !important; padding: 0 !important; font-size: 15.5px; line-height: 1.9; }
.ai-a .ai-h { font-size: 16.5px; margin: 14px 0 6px; padding-left: 10px; border-left: 3px solid var(--accent); color: var(--text); }
.ai-a b, .ai-a strong { background: none; color: var(--accent-hi); padding: 0; }
.ai-st { margin-top: 8px; font-size: 11.5px; color: var(--faint); }
.ai-graph-box { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 10px; max-width: 340px; }
.ai-graph { border: 0 !important; }
.ai-flow { padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); }
/* 入力欄: 中央に浮かぶ */
.ai-composer { max-width: 760px; width: calc(100% - 16px); margin: 6px auto 10px !important; border-radius: 24px !important; background: var(--surface) !important; box-shadow: 0 12px 40px -16px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--line-2) !important; border: 0 !important; padding: 10px 12px 10px !important; }
.ai-composer:focus-within { box-shadow: 0 12px 40px -16px rgba(0, 0, 0, .55), inset 0 0 0 1px var(--accent-line), 0 0 0 4px var(--accent-soft) !important; }
.ai-composer .ai-inrow .textarea { font-size: 16px; padding: 6px 6px 4px; }
.ai-ibtn, .ai-mbtn, .ai-seg { background: transparent !important; }
.ai-ibtn { border-color: var(--line-2); }
.ai-composer .ai-send { width: 40px; height: 40px; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent); }
html[data-theme=light] .ai-composer { box-shadow: 0 10px 34px -18px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--line-2) !important; }
@media (max-width: 640px) {
  .ai-top-t small { display: none; }
  .ai-examples { grid-template-columns: 1fr; }
  .ai-tabs a { font-size: 13px; padding: 8px 4px; }
  .ai-tabs a small { display: none; }
  .ai-turn .ai-bub.me { max-width: 86%; }
}
.ai-hr { border: 0; height: 1px; background: var(--line-2); margin: 14px 0; }

/* AI の画面は、ページ全体がスクロールしないよう画面にぴったり収める */
@media (min-width: 761px) { body[data-page="ai"] .page { padding-bottom: 8px; } }

/* サイドバーは画面の高さに収めて、その中だけスクロール（項目が多くてもページ全体が動かない） */
.side { min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.shell { overflow: hidden; }
.shell > main { min-height: 0; overflow-y: auto; }

/* はじめの画面: 入りきるときは真ん中、入りきらないときは上から（上が切れない） */
.ai-empty { justify-content: flex-start !important; }
.ai-hello { margin-top: auto; }
.ai-note { margin-bottom: auto !important; }
.ai-seg em { font-style: normal; }
@media (max-width: 640px) {
  .ai-hello-g { font-size: 24px; }
  .ai-empty { gap: 16px; padding: 12px 4px; }
  .ai-examples { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .ai-examples button { grid-template-columns: 1fr; padding: 10px 12px !important; row-gap: 4px; }
  .ai-examples button i { grid-row: auto; width: 30px; height: 30px; font-size: 16px; }
  .ai-examples button b { font-size: 13px; }
  .ai-examples button small { display: none; }
  .ai-note { font-size: 11px; }
  /* 入力欄の下の列: 小さい画面では文字を省いて1行に収める */
  .ai-tools { gap: 5px; }
  .ai-ibtn { width: 34px; height: 34px; }
  .ai-seg em { display: none; }
  .ai-seg label span { padding: 5px 9px; font-size: 15px; }
  .ai-mbtn { max-width: 118px; overflow: hidden; text-overflow: ellipsis; padding: 0 9px; }
  .ai-composer { width: calc(100% - 8px); padding: 8px 10px !important; }
  .ai-composer .ai-send { width: 38px; height: 38px; }
}
@media (max-width: 640px) {
  .ai-tools { gap: 4px; min-width: 0; }
  .ai-ibtn { width: 32px; height: 32px; }
  .ai-seg label span { padding: 4px 7px; }
  .ai-mbtn { max-width: 104px; height: 34px; font-size: 12px; }
  .ai-composer .ai-send { width: 36px; height: 36px; margin-left: auto; }
  .ai-tools > span[style*="flex:1"] { display: none; }
}

/* 雑談の入力欄も質問と同じ形に */
.ai-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.ai-chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 6px 14px; }
.ai-chat-log > * { max-width: 760px; }
.ai-msel2 { appearance: none; -webkit-appearance: none; padding-right: 26px !important; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important; background-position: calc(100% - 13px) 15px, calc(100% - 9px) 15px !important; background-size: 4px 4px !important; background-repeat: no-repeat !important; }

/* =====================================================================
   VIVA デザイン v2（全体）: 浮かぶサイドバー・光るふちのカード・グラデーションのボタン
   ===================================================================== */
:root {
  --r: 18px; --r-sm: 12px;
  --edge-hi: rgba(255, 255, 255, .13); --edge-lo: rgba(255, 255, 255, .03);
  --lift: 0 14px 36px -22px rgba(0, 0, 0, .75);
  --grad: linear-gradient(135deg, #34d399 0%, #10b981 45%, #0ea5a4 100%);
  --glass: rgba(14, 17, 16, .72);
}
html[data-theme=light] {
  --edge-hi: rgba(0, 0, 0, .10); --edge-lo: rgba(0, 0, 0, .04);
  --lift: 0 14px 34px -22px rgba(16, 24, 20, .35);
  --glass: rgba(255, 255, 255, .78);
}
/* 背景: オーロラ */
body::before {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(16, 185, 129, .16), transparent 60%),
    radial-gradient(760px 460px at 105% 0%, rgba(96, 165, 250, .10), transparent 60%),
    radial-gradient(700px 520px at 60% 115%, rgba(167, 139, 250, .08), transparent 60%) !important;
}
html[data-theme=light] body::before {
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(16, 185, 129, .14), transparent 60%),
    radial-gradient(760px 460px at 105% 0%, rgba(96, 165, 250, .10), transparent 60%),
    radial-gradient(700px 520px at 60% 115%, rgba(167, 139, 250, .08), transparent 60%) !important;
}

/* ---- ボタン ---- */
.btn { height: 38px; padding: 0 16px; border-radius: 12px; font-weight: 650; letter-spacing: .01em; transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 22px -10px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .25); text-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn-primary:disabled { filter: grayscale(.4) opacity(.6); box-shadow: none; }
.btn-sm { height: 32px; padding: 0 12px; border-radius: 10px; }
.btn-icon { width: 38px; }
.btn-sm.btn-icon { width: 32px; }
html[data-theme=light] .btn:not(.btn-primary):not(.btn-ghost) { background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .05); }

/* ---- 入力 ---- */
.input, .select, .textarea { height: 42px; border-radius: 12px; background: var(--surface-2); padding: 0 14px; }
.textarea { height: auto; padding: 11px 14px; }
.input:hover, .textarea:hover { border-color: var(--edge-hi); }
.input:focus, .select:focus, .textarea:focus { background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
html[data-theme=light] .input, html[data-theme=light] .select, html[data-theme=light] .textarea { background: #fff; }

/* ---- タグ・切り替え ---- */
.tag { height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; }
.seg { border-radius: 12px; padding: 4px; background: var(--surface-2); }
.seg button, .seg a { height: 30px; border-radius: 9px; }
.seg button.on, .seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), inset 0 0 0 1px var(--edge-hi); }

/* ---- カード: 光るふち＋ほんの少し浮かせる ---- */
.card {
  border: 1px solid transparent !important; border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #fff 4%), var(--surface)) padding-box,
              linear-gradient(180deg, var(--edge-hi), var(--edge-lo)) border-box !important;
  box-shadow: var(--lift);
}
html[data-theme=light] .card { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(180deg, var(--edge-hi), var(--edge-lo)) border-box !important; }
a.card { transition: transform .18s var(--ease), box-shadow .18s; }
a.card:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -22px rgba(0, 0, 0, .8); }
.card-head { padding: 18px 20px 0; }
.card-head h2 { font-size: 15px; gap: 10px; }
.card-head h2 .i { width: 28px; height: 28px; padding: 6px; border-radius: 9px; color: var(--accent-hi); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.card-body { padding: 16px 20px 20px; }

/* ---- ページの見出し ---- */
.page { padding: 30px 34px 60px; }
.page-head { margin-bottom: 24px; }
.page-head .eyebrow { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); font-size: 11.5px; margin-bottom: 10px; }
.page-head .eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-hi); box-shadow: 0 0 8px var(--accent-hi); }
.page-head h1 { font-size: 32px; letter-spacing: -.035em; }

/* ---- サイドバー: 浮かぶガラスのパネル（PC・iPad 横） ---- */
@media (min-width: 761px) {
  .shell { grid-template-columns: 256px minmax(0, 1fr); }
  .side { margin: 12px 0 12px 12px; border-radius: 24px; border: 1px solid transparent !important; padding: 16px 12px;
    background: linear-gradient(var(--glass), var(--glass)) padding-box, linear-gradient(180deg, var(--edge-hi), var(--edge-lo)) border-box !important;
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: var(--lift); }
}
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); box-shadow: 0 8px 24px -8px rgba(16, 185, 129, .9), inset 0 1px 0 rgba(255, 255, 255, .3); color: #fff; }
.side .brand { padding: 4px 8px 18px; font-size: 16px; }
.class-chip { margin: 0 4px 14px; padding: 12px 14px; border-radius: 16px; border: 0; background: linear-gradient(135deg, rgba(16, 185, 129, .18), rgba(96, 165, 250, .10)); box-shadow: inset 0 0 0 1px var(--accent-line); }
.class-chip b { font-size: 15px; }
.nav { gap: 3px; }
.nav a { height: 40px; padding: 0 8px; border-radius: 12px; gap: 10px; font-size: 13.5px; font-weight: 550; }
.nav a .i { width: 28px; height: 28px; padding: 6px; border-radius: 9px; transition: background .15s, color .15s; }
.nav a:hover { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }
.nav a.on { background: linear-gradient(90deg, var(--accent-soft), transparent 90%); color: var(--text); font-weight: 700; }
.nav a.on::before { display: none; }
.nav a.on .i { background: var(--grad); color: #fff; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .9); }
.nav .badge { background: var(--grad); color: #fff; box-shadow: 0 4px 10px -4px rgba(16, 185, 129, .9); }
.side-foot { border-top: 1px solid var(--line); padding: 12px 6px 2px; }

/* ---- スマホの下のメニュー: 浮かぶガラスのバー ---- */
@media (max-width: 760px) {
  .mobile-bar { left: 10px !important; right: 10px !important; bottom: calc(8px + env(safe-area-inset-bottom)) !important; border-radius: 22px !important; border: 1px solid transparent !important;
    background: linear-gradient(var(--glass), var(--glass)) padding-box, linear-gradient(180deg, var(--edge-hi), var(--edge-lo)) border-box !important;
    backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .6); padding-bottom: 0 !important; }
  .page { padding: 20px 16px 110px; }
  .page-head h1 { font-size: 26px; }
  .card { border-radius: 18px; }
}

/* ---- お知らせ・トースト ---- */
.alert { border-radius: 14px; }
.toast { border-radius: 14px !important; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .7) !important; }

/* ---- 開いたときに、ふわっと出る ---- */
@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: viva-in .42s var(--ease) backwards; }
  .page > *:nth-child(2) { animation-delay: .04s; } .page > *:nth-child(3) { animation-delay: .08s; } .page > *:nth-child(4) { animation-delay: .12s; } .page > *:nth-child(n+5) { animation-delay: .16s; }
}
@keyframes viva-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
::-webkit-scrollbar-thumb { border-radius: 10px; }

/* ライトモードの仕上げ */
html[data-theme=light] .day.out { background: rgba(0, 0, 0, .035); }
html[data-theme=light] .modal-bg { background: rgba(20, 30, 25, .35); }
html[data-theme=light] .side-foot { border-top-color: var(--line); }
html[data-theme=light] .class-chip { background: linear-gradient(135deg, rgba(16, 185, 129, .14), rgba(96, 165, 250, .08)); }
html[data-theme=light] ::-webkit-scrollbar-thumb { border-color: var(--bg); }

/* キーボードが出ているあいだは、下のメニューを隠す（入力欄の邪魔をしない） */
.kb-open .mobile-bar { display: none !important; }
.kb-open .main { padding-bottom: 12px !important; }

/* iPad の幅（761〜1180px）: 左のメニューはアイコン＋小さい文字の細い列（v2 デザイン版） */
@media (min-width: 761px) and (max-width: 1180px) {
  .shell { grid-template-columns: 100px minmax(0, 1fr); }
  .side { padding: 12px 6px; align-items: stretch; }
  .side .brand { justify-content: center; padding: 4px 0 12px; }
  .nav { gap: 2px; }
  .nav a { flex-direction: column; justify-content: center; height: 60px; padding: 4px 2px; gap: 3px; border-radius: 14px; font-size: 10.5px; font-weight: 600; line-height: 1.2; text-align: center; }
  .nav a .lbl { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav a .i { width: 30px; height: 30px; padding: 7px; }
  .nav a.on { background: var(--accent-soft); }
  .nav .badge { position: absolute; top: 2px; right: 10px; margin: 0; }
  .nav .pts { position: absolute; top: 2px; right: 4px; margin: 0; }
  .side-foot { justify-content: center; border-top: 0; padding: 8px 0 0; }
}

/* ===== 軽くする（iPad でスクロールが重くならないように） =====
   ぼかし（backdrop-filter）は毎回計算し直すので使わない。大きい影も小さく */
.side, .mobile-bar, .toast, .modal-bg, .c-list, .c-head, .c-info { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
:root { --glass: #0f1311; --lift: 0 2px 10px -6px rgba(0, 0, 0, .6); }
html[data-theme=light] { --glass: #ffffff; --lift: 0 2px 8px -5px rgba(16, 24, 20, .18); }
a.card:hover { box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .6); }
.btn-primary { box-shadow: 0 4px 10px -6px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .25); }
.nav a.on .i, .nav .badge { box-shadow: none; }
/* 背景のオーロラは固定の1枚だけ（重ねない） */
body::before { will-change: auto; }
@media (prefers-reduced-motion: no-preference) { .page > * { animation-duration: .25s; } }

/* 表の中は小さめのボタン・選択欄に戻す（v2 で大きくした分、表がはみ出さないように） */
.tag { white-space: nowrap; }
.tbl .btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.tbl .btn-sm.btn-icon { width: 30px; padding: 0; }
.tbl .select, .tbl .input { height: 34px; padding: 0 10px; font-size: 13px; }
.card-body:has(> .tbl) { overflow-x: auto; }
/* メンバー管理: iPad の幅では表を横いっぱいに、右のカードは下へ */
@media (max-width: 1320px) { body[data-page="members"] .grid-2 { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 900px) { body[data-page="members"] .tbl .hide-sm { display: none; } body[data-page="members"] .who-cell small { white-space: nowrap; } }

/* ===== 通話の画面 ===== */
.call-ui { position: fixed; inset: 0; z-index: 200; background: radial-gradient(600px 400px at 50% 20%, rgba(16, 185, 129, .25), transparent 70%), #07100c; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: max(40px, env(safe-area-inset-top)) 20px max(34px, env(safe-area-inset-bottom)); animation: viva-in .2s both; }
.call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; display: none; }
.call-ui.video .call-remote { display: block; }
.call-ui:not(.video) .call-remote { display: block; width: 1px; height: 1px; opacity: 0; }
.call-local { position: absolute; right: 16px; top: max(16px, env(safe-area-inset-top)); width: 110px; height: 150px; object-fit: cover; border-radius: 16px; background: #111; box-shadow: 0 10px 30px -10px #000; transform: scaleX(-1); z-index: 2; display: none; }
.call-ui.video .call-local { display: block; }
.call-top { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-top: 8vh; }
.call-ui.video .call-top { margin-top: 0; align-self: flex-start; align-items: flex-start; text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
.call-ui.video .call-av { display: none; }
.call-av { --c: #10b981; width: 110px; height: 110px; border-radius: 34px; display: grid; place-items: center; font-size: 44px; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 50%, #000)); box-shadow: 0 0 0 10px color-mix(in srgb, var(--c) 18%, transparent), 0 0 0 22px color-mix(in srgb, var(--c) 8%, transparent); animation: call-pulse 1.6s ease-in-out infinite; }
@keyframes call-pulse { 50% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--c) 14%, transparent), 0 0 0 30px color-mix(in srgb, var(--c) 5%, transparent); } }
.call-name { font-size: 24px; margin-top: 12px; }
.call-st { font-size: 14px; opacity: .8; min-height: 20px; }
.call-time { font-size: 15px; font-variant-numeric: tabular-nums; opacity: .9; }
.call-btns { position: relative; z-index: 2; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.call-b { width: 66px; height: 66px; border-radius: 50%; border: 0; display: grid; place-items: center; align-content: center; gap: 2px; color: #fff; background: rgba(255, 255, 255, .16); font-size: 22px; cursor: pointer; }
.call-b small { font-size: 10.5px; opacity: .85; }
.call-b svg { width: 26px; height: 26px; }
.call-b.red { background: #ef4444; }
.call-b.red svg { transform: rotate(135deg); }
.call-b.green { background: #10b981; animation: call-pulse 1.6s infinite; --c: #10b981; }
.call-b.off { background: #fff; color: #111; }
/* アイコンだけのボタンは余白なし（v2 の余白でアイコンがつぶれないように） */
.btn.btn-icon { padding: 0; }
.btn svg { flex: none; }

/* ページの見出し（作成ボタンのメニューなど）は、下のカードより手前に */
.page-head { position: relative; z-index: 30; }

/* ===== AI の図（表・グラフ・図形） ===== */
.ai-fig { margin: 12px 0; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); max-width: 380px; }
.ai-fig-t { font-weight: 700; font-size: 13.5px; margin: 0 0 6px; }
.ai-chart { width: 100%; height: auto; display: block; }
.ai-chart .gl { stroke: var(--line-2); stroke-width: .8; }
.ai-chart .lb2 { font-size: 11px; fill: var(--muted); }
.ai-svg-box { background: #fff; }
.ai-svg { width: 100%; height: auto; display: block; color: #111; }
.ai-svg text { font-family: var(--font); }
.ai-tbl-wrap { overflow-x: auto; margin: 10px 0; border-radius: 12px; border: 1px solid var(--line-2); max-width: 100%; }
.ai-tbl { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.5; }
.ai-tbl th { background: var(--accent-soft); color: var(--text); font-weight: 700; text-align: left; }
.ai-tbl th, .ai-tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ai-tbl tr:last-child td { border-bottom: 0; }
.ai-tbl tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.ai-code { margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; overflow-x: auto; white-space: pre; }
/* 通知のバナー（画面の上） */
#vbanners { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100vw - 20px)); pointer-events: none; }
.vbanner { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .55); color: var(--text); animation: vb-in .25s var(--ease) both; }
.vbanner.out { opacity: 0; transform: translateY(-8px); transition: .3s; }
.vb-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); flex: none; }
.vb-tx { min-width: 0; display: flex; flex-direction: column; }
.vb-tx b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vb-tx small { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes vb-in { from { opacity: 0; transform: translateY(-12px); } }

/* パスワードの表示ボタン */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 34px; border: 0; background: transparent; border-radius: 10px; font-size: 17px; cursor: pointer; }
.pw-eye:hover { background: var(--surface-2); }

/* チャットの見出し・色の見本 */
.bubble .mh { display: block; font-weight: 800; line-height: 1.3; margin: 2px 0; }
.bubble .mh1 { font-size: 1.5em; }
.bubble .mh2 { font-size: 1.3em; }
.bubble .mh3 { font-size: 1.12em; }
.cswatch { display: inline-block; width: .9em; height: .9em; border-radius: 3px; margin: 0 3px -1px 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }

/* 👑 ロイヤルゴールド（永久管理者専用）: 流れる金の輪・光の脈動・王冠 */
.av.fr-royal { position: relative; isolation: isolate; overflow: visible; box-shadow: 0 0 0 2px var(--bg), 0 0 16px 2px rgba(251, 191, 36, .55); animation: royalGlow 2.6s ease-in-out infinite; }
.av.fr-royal::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; padding: 3px; z-index: -1;
  background: conic-gradient(from var(--ra), #7c4a03, #fde68a, #f59e0b, #fffbeb, #b45309, #fcd34d, #fff7d6, #d97706, #7c4a03); animation: royalFlow 3s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.av.fr-royal::before { content: "👑"; position: absolute; top: -.62em; left: 50%; transform: translateX(-50%) rotate(-12deg); font-size: max(10px, 42%); line-height: 1; z-index: 2;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)) drop-shadow(0 0 4px rgba(251, 191, 36, .9)); pointer-events: none; }
@keyframes royalGlow { 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 26px 6px rgba(251, 191, 36, .85), 0 0 48px 10px rgba(245, 158, 11, .3); } }
@media (prefers-reduced-motion: reduce) { .av.fr-royal, .av.fr-royal::after { animation: none; } }
/* ロイヤルゴールドのまわり: 虹のオーラ + 回るクリスタルのかけら（8色・二重の軌道・きらめき） */
.av.fr-royal > .shards { position: absolute; inset: -15px; pointer-events: none; z-index: -1; overflow: clip; animation: shardOrbit 10s linear infinite; }   /* 箱は回さない（はみ出しが変わって画面が揺れるため） */
.av.sm.fr-royal > .shards { inset: -11px; }
.av.lg.fr-royal > .shards { inset: -20px; }
.av.fr-royal > .shards::before { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: conic-gradient(#ff4d6d, #ff9f1c, #ffe45e, #3ddc97, #38bdf8, #6366f1, #c084fc, #ff4d6d); filter: blur(7px); opacity: .55;
  -webkit-mask: radial-gradient(closest-side, transparent 58%, #000 72%, transparent 100%); mask: radial-gradient(closest-side, transparent 58%, #000 72%, transparent 100%);
  background: conic-gradient(from var(--ra), #ff4d6d, #ff9f1c, #ffe45e, #3ddc97, #38bdf8, #6366f1, #c084fc, #ff4d6d); animation: royalFlow 4s linear infinite reverse; }
.av.fr-royal > .shards > b { position: absolute; inset: 0; transform: rotate(calc(var(--i) * 45deg + var(--orb))); filter: drop-shadow(0 0 3px var(--k)) drop-shadow(0 0 1px #fff); }
.av.fr-royal > .shards > b::before { content: ""; position: absolute; left: 50%; top: 0; width: 7px; height: 11px; margin-left: -3.5px;
  clip-path: polygon(50% 0, 100% 42%, 50% 100%, 0 42%);
  background: linear-gradient(155deg, #fff 0 18%, var(--k) 45%, color-mix(in srgb, var(--k) 55%, #000) 100%);
  animation: shardTwinkle 1.7s ease-in-out infinite; animation-delay: calc(var(--i) * -.21s); }
.av.fr-royal > .shards > b:nth-child(even)::before { top: 5px; width: 5px; height: 7px; margin-left: -2.5px; }
.av.sm.fr-royal > .shards > b::before { width: 5px; height: 8px; margin-left: -2.5px; }
.av.sm.fr-royal > .shards > b:nth-child(even)::before { top: 3px; width: 3px; height: 5px; margin-left: -1.5px; }
.av.fr-royal > .shards > b:nth-child(1) { --i: 0; --k: #ff4d6d; } .av.fr-royal > .shards > b:nth-child(2) { --i: 1; --k: #ff9f1c; }
.av.fr-royal > .shards > b:nth-child(3) { --i: 2; --k: #ffe45e; } .av.fr-royal > .shards > b:nth-child(4) { --i: 3; --k: #3ddc97; }
.av.fr-royal > .shards > b:nth-child(5) { --i: 4; --k: #38bdf8; } .av.fr-royal > .shards > b:nth-child(6) { --i: 5; --k: #6366f1; }
.av.fr-royal > .shards > b:nth-child(7) { --i: 6; --k: #c084fc; } .av.fr-royal > .shards > b:nth-child(8) { --i: 7; --k: #f472b6; }
@keyframes shardTwinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.55); } }
@media (prefers-reduced-motion: reduce) { .av.fr-royal > .shards, .av.fr-royal > .shards::before, .av.fr-royal > .shards > b::before { animation: none; } }
@property --ra { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes royalFlow { to { --ra: 360deg; } }   /* 輪は回さず、金の光だけを流す */
.av.fr-royal::before { font-size: max(12px, 55%); top: -.75em; }
.av.fr-royal::before { font-size: 16px; top: -13px; } .av.lg.fr-royal::before { font-size: 24px; top: -19px; } .av.sm.fr-royal::before { font-size: 12px; top: -10px; }
.av.fr-royal > .shards::before { opacity: .75; }
@property --orb { syntax: '<angle>'; inherits: true; initial-value: 0deg; }
@keyframes shardOrbit { to { --orb: 360deg; } }
@media (prefers-reduced-motion: reduce) { .av.fr-royal > .shards::before { animation: none; } }

/* シルバー（永久管理者がつけてあげる枠）: 流れる銀の輪 */
.av.fr-silver { position: relative; isolation: isolate; box-shadow: 0 0 0 2px var(--bg), 0 0 12px 1px rgba(203, 213, 225, .55); }
.av.fr-silver::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; padding: 2.5px; z-index: -1;
  background: conic-gradient(from var(--ra), #6b7280, #f8fafc, #9ca3af, #ffffff, #64748b, #e2e8f0, #6b7280); animation: royalFlow 3.5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-reduced-motion: reduce) { .av.fr-silver::after { animation: none; } }

/* スタンプ */
.stk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 50vh; overflow: auto; }
.stk { background: none; border: 0; padding: 4px; border-radius: 12px; cursor: pointer; }
.stk:hover { background: var(--surface-3); }
.stk-e { font-size: 34px; line-height: 1.2; }
.stk img { width: 100%; aspect-ratio: 1; object-fit: contain; display: block; }
.stk-wrap { position: relative; }
.stk-x { position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--surface-3); color: var(--muted); font-size: 12px; cursor: pointer; line-height: 20px; padding: 0; }
.m .sticker { display: block; max-width: 150px; max-height: 150px; object-fit: contain; }
.bubble.sticker-e { background: none !important; box-shadow: none !important; font-size: 56px; padding: 0 !important; line-height: 1.1; }

/* AI 単元テスト */
.unit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .unit-grid { grid-template-columns: 1fr; } }
.unit-subj { display: flex; gap: 6px; flex-wrap: wrap; }
.ut-q { padding: 12px 0; border-bottom: 1px solid var(--line); }
.ut-qt { margin-bottom: 8px; line-height: 1.6; }
.ut-c { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.ut-c:hover { background: var(--surface-3); }
.ut-q.ng .ut-c:has(input:checked) { background: rgba(239, 68, 68, .14); }
.ut-c.right { background: rgba(16, 185, 129, .16); }
.ut-ex { font-size: 13px; color: var(--muted); margin-top: 6px; }
/* ===== ⚔️ 対戦 ===== */
.vs-av { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 800; font-size: 26px; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 22px var(--c); flex: none; }
.vs-av.sm { width: 30px; height: 30px; font-size: 13px; box-shadow: 0 0 0 2px var(--bg); }
.vs-intro { position: fixed; inset: 0; z-index: 9999; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 20px; background: radial-gradient(circle at 50% 50%, rgba(250, 204, 21, .25), transparent 55%), linear-gradient(115deg, #1e3a8a 0 49.6%, #fff 49.6% 50.4%, #7f1d1d 50.4%); color: #fff; overflow: hidden; transition: opacity .45s; }
.vs-intro.out { opacity: 0; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.vs-side b { font-size: 20px; text-shadow: 0 2px 8px rgba(0,0,0,.5); } .vs-side small { opacity: .85; }
.vs-side.l { animation: vsInL .5s cubic-bezier(.2, 1.4, .4, 1) both; } .vs-side.r { animation: vsInR .5s cubic-bezier(.2, 1.4, .4, 1) .1s both; }
.vs-side .vs-av { width: 92px; height: 92px; font-size: 40px; }
.vs-mid { text-align: center; } .vs-mid small { display: block; opacity: .85; font-size: 12px; margin-top: 4px; }
.vs-mid i { display: block; font-style: italic; font-weight: 900; font-size: 84px; line-height: 1; background: linear-gradient(180deg, #fff7ad, #facc15 45%, #f97316); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #7c2d12) drop-shadow(0 0 18px rgba(250, 204, 21, .8)); animation: vsSlam .55s cubic-bezier(.3, 1.6, .5, 1) .35s both; }
.vs-go { position: absolute; left: 0; right: 0; bottom: 18%; text-align: center; font-size: 28px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 3px 12px rgba(0,0,0,.6); animation: vsPop .4s ease 1.1s both; }
@keyframes vsInL { from { transform: translateX(-120%); opacity: 0; } } @keyframes vsInR { from { transform: translateX(120%); opacity: 0; } }
@keyframes vsSlam { from { transform: scale(4) rotate(-15deg); opacity: 0; } } @keyframes vsPop { from { transform: scale(.5); opacity: 0; } }
.vs-hud { position: sticky; top: 4px; z-index: 3; margin: -4px 0 12px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(115deg, rgba(37, 99, 235, .16), rgba(220, 38, 38, .16)); border: 1px solid var(--line-2); backdrop-filter: blur(10px); }
.vs-hud-t { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
.vs-hud-s { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); } .vs-hud-s .late { color: var(--danger); font-weight: 700; }
.vs-track { position: relative; height: 26px; margin: 8px 14px; border-radius: 99px; background: repeating-linear-gradient(90deg, var(--surface-3) 0 12px, transparent 12px 24px); }
.vs-track i { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; transition: left .5s linear; }
.vs-track i.me { background: #2563eb; box-shadow: 0 0 10px #3b82f6; z-index: 1; } .vs-track i.op { background: #dc2626; opacity: .75; }
.vs-res { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); animation: vsPop .3s ease both; }
.vs-res-box { position: relative; width: min(420px, 100%); padding: 22px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line-2); text-align: center; overflow: hidden; }
.vs-big { font-size: 46px; font-weight: 900; font-style: italic; line-height: 1.1; margin-bottom: 4px; animation: vsSlam .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.vs-res.win .vs-big { background: linear-gradient(180deg, #fff7ad, #facc15, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(250, 204, 21, .7)); }
.vs-res.win .vs-res-box { box-shadow: 0 0 0 2px #facc15, 0 0 40px rgba(250, 204, 21, .45); }
.vs-res.lose .vs-big { color: #94a3b8; } .vs-res.draw .vs-big { color: var(--accent); }
.vs-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; text-align: left; } .vs-row .vs-av { width: 36px; height: 36px; font-size: 15px; } .vs-row small { color: var(--muted); width: 52px; }
.vs-bar { flex: 1; height: 14px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .vs-bar i { display: block; height: 100%; border-radius: 99px; animation: vsGrow .9s cubic-bezier(.2, .8, .2, 1) .2s both; }
.vs-row.me .vs-bar i { background: linear-gradient(90deg, #60a5fa, #2563eb); } .vs-row.op .vs-bar i { background: linear-gradient(90deg, #f87171, #dc2626); }
@keyframes vsGrow { from { width: 0; } }
.vs-conf { position: absolute; inset: 0; pointer-events: none; }
.vs-conf i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; animation: vsFall 2.4s linear infinite; }
.vs-conf i:nth-child(4n+1) { background: #facc15; } .vs-conf i:nth-child(4n+2) { background: #f472b6; } .vs-conf i:nth-child(4n+3) { background: #38bdf8; } .vs-conf i:nth-child(4n) { background: #34d399; }
.vs-conf i:nth-child(1) { left: 4%; animation-delay: -.2s; } .vs-conf i:nth-child(2) { left: 11%; animation-delay: -1.1s; } .vs-conf i:nth-child(3) { left: 18%; animation-delay: -.6s; } .vs-conf i:nth-child(4) { left: 25%; animation-delay: -1.8s; } .vs-conf i:nth-child(5) { left: 32%; animation-delay: -.9s; } .vs-conf i:nth-child(6) { left: 39%; animation-delay: -1.5s; } .vs-conf i:nth-child(7) { left: 46%; animation-delay: -.3s; }
.vs-conf i:nth-child(8) { left: 53%; animation-delay: -2s; } .vs-conf i:nth-child(9) { left: 60%; animation-delay: -.7s; } .vs-conf i:nth-child(10) { left: 67%; animation-delay: -1.3s; } .vs-conf i:nth-child(11) { left: 74%; animation-delay: -.1s; } .vs-conf i:nth-child(12) { left: 81%; animation-delay: -1.7s; } .vs-conf i:nth-child(13) { left: 88%; animation-delay: -.5s; } .vs-conf i:nth-child(14) { left: 95%; animation-delay: -1.2s; }
.vs-conf i:nth-child(n+15) { animation-duration: 3s; } .vs-conf i:nth-child(15) { left: 7%; } .vs-conf i:nth-child(16) { left: 15%; animation-delay: -1.4s; } .vs-conf i:nth-child(17) { left: 22%; animation-delay: -.4s; } .vs-conf i:nth-child(18) { left: 36%; animation-delay: -2.2s; } .vs-conf i:nth-child(19) { left: 43%; animation-delay: -1s; } .vs-conf i:nth-child(20) { left: 57%; animation-delay: -.8s; }
.vs-conf i:nth-child(21) { left: 64%; animation-delay: -1.9s; } .vs-conf i:nth-child(22) { left: 71%; animation-delay: -.25s; } .vs-conf i:nth-child(23) { left: 78%; animation-delay: -1.6s; } .vs-conf i:nth-child(24) { left: 85%; animation-delay: -.65s; } .vs-conf i:nth-child(25) { left: 92%; animation-delay: -2.4s; } .vs-conf i:nth-child(26) { left: 50%; animation-delay: -1.25s; } .vs-conf i:nth-child(27) { left: 29%; animation-delay: -2.6s; }
@keyframes vsFall { to { transform: translateY(560px) rotate(720deg); } }
.vs-sent { position: fixed; left: 50%; top: 40%; z-index: 9999; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 26px; border-radius: 20px; background: linear-gradient(135deg, #1e3a8a, #7f1d1d); color: #fff; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: vsPop .35s cubic-bezier(.3, 1.6, .5, 1) both; }
.vs-sent b { font-size: 54px; animation: vsSlam .5s ease both; } .vs-sent small { opacity: .85; }
.vs-rec { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; text-align: center; font-size: 12px; color: var(--muted); }
.vs-rec > div { padding: 8px 4px; border-radius: 12px; background: var(--surface-3); } .vs-rec b { display: block; font-size: 22px; color: var(--text); }
.vs-rec > div:first-child b { color: #f59e0b; }
.vs-card { display: flex; align-items: center; gap: 8px; padding: 10px; margin-bottom: 8px; border-radius: 14px; border: 1px solid var(--line-2); background: linear-gradient(115deg, rgba(37, 99, 235, .10), transparent 45%, transparent 55%, rgba(220, 38, 38, .10)); }
.vs-card > i { font-style: italic; font-weight: 900; color: #f59e0b; font-size: 13px; } .vs-card .vs-sc { font-size: 20px; min-width: 1em; text-align: center; }
.vs-card .grow { min-width: 0; display: flex; flex-direction: column; } .vs-card .grow small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs-card.win { border-color: rgba(250, 204, 21, .6); box-shadow: inset 0 0 0 1px rgba(250, 204, 21, .25); }
.vs-tag { flex: none; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; background: var(--surface-3); }
.vs-tag.win { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; } .vs-tag.lose { color: var(--muted); } .vs-tag.draw { color: var(--accent); } .vs-tag.wait { color: var(--muted); font-weight: 600; }
@media (max-width: 560px) { .vs-intro { grid-template-columns: 1fr; gap: 14px; background: linear-gradient(180deg, #1e3a8a 0 49.6%, #fff 49.6% 50.4%, #7f1d1d 50.4%); } .vs-mid i { font-size: 64px; } }
@media (prefers-reduced-motion: reduce) { .vs-intro *, .vs-res *, .vs-sent, .vs-conf i { animation: none !important; } }
.lv-btn { width: 100%; justify-content: center; margin: 0 0 10px; background: linear-gradient(115deg, rgba(37, 99, 235, .18), rgba(220, 38, 38, .18)); font-weight: 700; }
.lv-race > div { position: relative; height: 22px; margin-top: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.lv-race i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .5s ease; }
.lv-race .me i { background: linear-gradient(90deg, #60a5fa, #2563eb); } .lv-race .op i { background: linear-gradient(90deg, #f87171, #dc2626); }
.lv-race span { position: relative; padding-left: 10px; font-size: 12px; font-weight: 700; line-height: 22px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.lv-count .vs-mid i { font-size: 140px; }
.lv-wait { top: 50%; }
.rm-remind { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; font-size: 13px; } .rm-remind span { flex: 1; }
.rm-class { margin-bottom: 12px; } .rm-class-h { font-weight: 800; margin-bottom: 6px; }
.rm-cl { display: grid; grid-template-columns: 2em 4em 1fr 3em; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-size: 14px; }
.rm-cl.mine { background: var(--accent-soft); } .rm-cl > div { height: 12px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .rm-cl > div i { display: block; height: 100%; background: var(--grad); border-radius: 99px; animation: vsGrow .9s ease both; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.bg { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: center; opacity: .55; filter: grayscale(.9); }
.bg b { font-size: 30px; } .bg span { font-weight: 800; font-size: 13px; } .bg small { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
.bg i { display: block; width: 80%; height: 5px; margin-top: 4px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .bg i u { display: block; height: 100%; background: var(--accent); }
.bg.got { opacity: 1; filter: none; border-color: rgba(250, 204, 21, .55); background: linear-gradient(160deg, rgba(250, 204, 21, .14), var(--surface-2) 60%); box-shadow: 0 6px 18px -10px rgba(250, 204, 21, .6); }
.bg.got b { animation: bgPop 2.8s ease-in-out infinite; } @keyframes bgPop { 50% { transform: scale(1.12) rotate(-6deg); } }
.bg-mini { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; } .bg-mini b { font-size: 20px; } .bg-mini small { margin-left: auto; }
.ex-form { display: grid; grid-template-columns: 1fr 6em 5em auto 4.5em auto; gap: 6px; align-items: center; }
@media (max-width: 600px) { .ex-form { grid-template-columns: 1fr 1fr; } .ex-form > span { display: none; } }
.ex-svg { width: 100%; height: auto; margin-top: 12px; }
.ex-t { padding: 8px 0; border-bottom: 1px solid var(--line); } .ex-t > div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ex-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 10px; border-radius: 99px; font-size: 12.5px; border: 1px solid var(--k); color: var(--k); }
.ex-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }
@media (prefers-reduced-motion: reduce) { .bg.got b { animation: none; } }
.terms { max-width: 760px; margin: 0 auto; line-height: 1.85; font-size: 15px; }
.terms h1 { font-size: 24px; margin: 0 0 4px; } .terms-meta { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.terms h2 { font-size: 17px; margin: 26px 0 8px; padding: 6px 12px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; scroll-margin-top: 70px; }
.terms h2.hot { border-left-color: var(--danger); background: rgba(239, 68, 68, .10); }
.terms ol, .terms ul { padding-left: 1.5em; margin: 6px 0; } .terms li { margin: 4px 0; }
.terms-box { border: 2px solid var(--danger); border-radius: 14px; padding: 6px 14px; background: rgba(239, 68, 68, .06); }
.terms-toc { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; margin: 12px 0; }
.terms-toc b { width: 100%; } .terms-toc a { padding: 3px 10px; border-radius: 99px; background: var(--surface-3); } .terms-toc a.hot { background: rgba(239, 68, 68, .18); color: var(--danger); font-weight: 700; }
.terms-end { text-align: right; color: var(--muted); }
.pw-meter { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); } .pw-meter i { flex: 1; max-width: 160px; height: 5px; border-radius: 99px; background: var(--surface-3); position: relative; overflow: hidden; }
.pw-meter i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 0; background: #ef4444; transition: width .3s; } .pw-meter.s1 i::after { width: 20%; } .pw-meter.s2 i::after { width: 40%; background: #f59e0b; } .pw-meter.s3 i::after { width: 60%; background: #eab308; } .pw-meter.s4 i::after { width: 80%; background: #22c55e; } .pw-meter.s5 i::after { width: 100%; background: #10b981; }
.mood-pick { display: flex; gap: 6px; flex-wrap: wrap; } .mood-pick .btn { flex: 1; min-width: 120px; justify-content: center; }
.mood-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; } .mood-u { padding: 4px 10px; border-radius: 99px; background: var(--surface-3); font-size: 13px; } .mood-u small { color: var(--muted); margin-left: 4px; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 4px; max-height: 60vh; overflow-y: auto; } .album img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; }
.side-search { padding: 6px 4px; } .side-search .input { height: 34px; font-size: 13px; }
.ls-box { padding: 10px; border-radius: 12px; background: var(--surface-3); margin-bottom: 8px; } #lsScript { font-size: 13.5px; line-height: 1.8; }
#srAll .rule { display: flex; align-items: center; }
.stamps { display: flex; gap: 4px; } .stamps i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-style: normal; background: var(--surface-3); color: var(--muted); border: 1px dashed var(--line-2); }
.stamps i.on { background: var(--accent); color: var(--on-accent); border-style: solid; font-weight: 800; } .stamps i.new { animation: bgPop 1.2s ease 2; }
.nav-grp { display: flex; align-items: center; gap: 6px; width: 100%; margin: 10px 0 2px; padding: 4px 10px; border: 0; background: none; color: var(--faint); font: inherit; font-size: 11px; font-weight: 800; letter-spacing: .08em; cursor: pointer; text-align: left; }
.nav-grp span:first-child { flex: 1; } .nav-grp i { font-style: normal; transition: transform .2s; } .nav-grp.shut i { transform: rotate(-90deg); } .nav-grp:hover { color: var(--muted); }
.nav-grp .badge { position: static; }
.nav-sub { display: flex; flex-direction: column; gap: 2px; }
.menu-sec { grid-column: 1 / -1; margin: 8px 0 0; font-size: 11px; font-weight: 800; color: var(--faint); letter-spacing: .08em; }
.rtabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; margin: 0 0 14px; padding: 6px; border-radius: 14px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); }
.rtabs button { flex: 1; padding: 9px 6px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.rtabs button.on { background: var(--accent); color: var(--on-accent); }
.home-mini { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: -8px 0 14px; padding: 6px 12px; font-size: 13px; color: var(--muted); }
.home-mini .card-body { display: contents; }
.va-sug { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); max-height: 260px; overflow-y: auto; }
.va-sug button { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.va-sug button:hover, .va-sug button.on { background: var(--accent-soft); } .va-sug b { color: var(--accent); } .va-sug i { font-style: normal; color: var(--faint); font-size: 12px; } .va-sug span { margin-left: auto; color: var(--muted); font-size: 12px; }
.va-bub code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: 12.5px; }
.home-today { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: start; }
.home-today > div:empty { display: none; }
@media (min-width: 900px) { .home-today { grid-template-columns: 1fr 1fr; } .home-today > div > .card { margin-bottom: 16px; } }
.hub-tabs { position: sticky; top: 0; z-index: 6; display: flex; gap: 4px; max-width: 1180px; margin: 0 auto; padding: 10px 34px 0; background: var(--bg); overflow-x: auto; scrollbar-width: none; }
.hub-tabs a { position: relative; flex: none; padding: 8px 14px 10px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 700; font-size: 14px; border-bottom: 2px solid transparent; }
.hub-tabs a.on { color: var(--text); border-bottom-color: var(--accent); } .hub-tabs a:hover { color: var(--text); }
.hub-tabs .badge { position: static; margin-left: 6px; }
.hub-tabs + .page { padding-top: 18px; }
.home-more { margin-top: 18px; } .home-more > summary { cursor: pointer; padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 700; list-style: none; }
.home-more > summary::before { content: '▸ '; } .home-more[open] > summary::before { content: '▾ '; } .home-more > .grid-2 { margin-top: 14px; }
@media (max-width: 760px) { .hub-tabs { padding: 8px 12px 0; } .hub-tabs a { padding: 8px 10px; font-size: 13px; } }
/* カードの余白を少し詰める */
.card-head { padding: 14px 16px 0; } .card-body { padding: 12px 16px 16px; } .stack { gap: 14px; } .grid-2 { gap: 14px; }
.page { padding-top: 24px; } .page-head { margin-bottom: 16px; }
.rm-ask { top: 45%; z-index: 9998; }
.qz { padding: 10px 0; border-bottom: 1px solid var(--line); } .qz-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; } .qz-h small { flex: 1; } .qz.done .ut-qt, .qz.mine .ut-qt { opacity: .75; }
#qzSubj { margin-bottom: 6px; }
.goal-pt { margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 700; } .goal-pt.zero { background: var(--surface-3); color: var(--muted); font-weight: 400; }
.goal { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .goal.done { opacity: .7; } .goal.late small { color: var(--danger); }
.crop-wrap { max-height: 60vh; overflow: auto; text-align: center; } #cropCv { max-width: 100%; height: auto; touch-action: none; cursor: crosshair; border-radius: 8px; }
.rp { max-width: 720px; margin: 0 auto; } .rp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; } .rp-grid > div { padding: 12px; border-radius: 12px; background: var(--surface-3); text-align: center; } .rp-grid b { display: block; font-size: 24px; }
.rp-bars { display: flex; gap: 6px; align-items: flex-end; height: 90px; margin: 8px 0; } .rp-bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; gap: 2px; } .rp-bars i { width: 70%; background: var(--grad); border-radius: 6px 6px 0 0; }
@media print { .side, .mobile-bar, .topbar, .page-head, .rp-tools, #toasts { display: none !important; } .rp { max-width: none; } .card { border: 1px solid #999 !important; box-shadow: none !important; } }
.ai-rest { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-3); } .ai-rest > small { display: block; margin: 2px 0 6px; }
.c-fold { padding: 8px 12px 2px; font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .5px; }
.va-form .btn.on { background: var(--accent-soft); color: var(--accent); }
.rm-clock { font-size: 64px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 2px; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rm-chart { display: flex; gap: 6px; align-items: flex-end; height: 160px; }
.rm-bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; gap: 3px; font-size: 11px; }
.rm-bar > div { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 6px; overflow: hidden; background: var(--surface-3); }
.rm-bar > div > i { display: block; width: 100%; }
.rm-bar small { color: var(--muted); min-height: 1em; }
.sr-card { margin: 8px 0; padding: 22px 12px; border-radius: 14px; background: var(--surface-3); text-align: center; display: flex; flex-direction: column; gap: 8px; }
.sr-card b { font-size: 26px; } .sr-card .sr-m { font-size: 17px; color: var(--accent); }

 
.tk-units { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow-y: auto; }
.tk-u { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; }
.tk-u:has(input:checked) { background: rgba(16, 185, 129, .14); border-color: #10b981; }
.ut-hint { font-size: 13px; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: rgba(250, 204, 21, .12); }
.ut-sim { margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px dashed var(--line); background: var(--surface-3, rgba(127,127,127,.06)); }
.ut-timer { position: sticky; top: 6px; z-index: 2; float: right; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3, rgba(127,127,127,.12)); }
.ut-score { font-size: 34px; font-weight: 800; text-align: center; margin: 14px 0; }
.ut-score small { font-size: 15px; color: var(--muted); margin-left: 6px; }
.ut-ana { white-space: pre-wrap; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--surface-3); line-height: 1.7; font-size: 14px; }
.ut-in { max-width: 320px; }
.ut-in { max-width: 520px; width: 100%; }
.ut-fig { margin: 8px 0 10px; padding: 8px; border-radius: 12px; background: var(--surface-2, rgba(0,0,0,.03)); max-width: 440px; }
.ut-qt, .ut-ex, .ut-c span { white-space: pre-wrap; }

/* VIVA AI */
.va-card .card-body { display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.va-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; max-height: calc(100vh - 300px); }
.va-hello { margin: auto; text-align: center; max-width: 520px; padding: 20px 0; }
.va-hello-ic { font-size: 40px; }
.va-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.va-bub { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.7; }
.va-bub.me { align-self: flex-end; background: var(--accent, #10b981); color: #fff; white-space: pre-wrap; border-bottom-right-radius: 6px; }
.va-bub.bot { align-self: flex-start; background: var(--surface-3); border-bottom-left-radius: 6px; }
.va-form { display: flex; gap: 8px; align-items: flex-end; }
.va-form .textarea { flex: 1; resize: none; min-height: 44px; }

/* テスト勉強 */
.sd-test { margin-bottom: 16px; }
.sd-ranges { display: grid; gap: 6px; margin: 10px 0; font-size: 13.5px; line-height: 1.6; }
.sd-acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.sd-prog { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.sd-prog span { display: block; height: 100%; background: #10b981; border-radius: inherit; }
.sd-day { padding: 8px 0; border-top: 1px solid var(--line); }
.sd-day.today { background: rgba(16, 185, 129, .07); border-radius: 10px; padding: 8px; }
.sd-day.past { opacity: .6; }
.sd-task { display: flex; gap: 8px; align-items: flex-start; padding: 5px 2px; cursor: pointer; font-size: 14px; line-height: 1.5; }
.sd-task.done span { text-decoration: line-through; opacity: .55; }
.sd-prop { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #10b981, #0ea5e9); color: #fff; font-weight: 700; font-size: 15px; }
.sd-prop small { display: block; font-weight: 500; opacity: .9; font-size: 12px; margin-top: 2px; }
.sd-msg { background: var(--surface-3); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.7; white-space: pre-wrap; }
.sd-cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 55vh; overflow: auto; }
.sd-cal-d { border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 12.5px; line-height: 1.5; display: grid; gap: 4px; }
.sd-cal-d.today { border-color: #10b981; background: rgba(16, 185, 129, .07); }
.va-note { text-decoration: none; font-size: 13px; }
.pe-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.pe-col { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.pe-col.on { outline: 3px solid var(--accent, #10b981); outline-offset: 1px; }
.pe-wrap { max-height: 60vh; overflow: auto; text-align: center; }
.pe-cv { max-width: 100%; max-height: 58vh; touch-action: none; cursor: crosshair; border-radius: 8px; }
.sd-week, .sd-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sd-week span { text-align: center; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
.sd-cell { min-height: 76px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; font-size: 11.5px; overflow: hidden; }
.sd-cell b { display: block; font-size: 11.5px; margin-bottom: 2px; }
.sd-cell.sun b { color: #ef4444; } .sd-cell.sat b { color: #3b82f6; }
.sd-cell.today { border-color: #10b981; background: rgba(16, 185, 129, .08); }
.sd-cell.past { opacity: .55; }
.sd-cell.test { background: rgba(245, 158, 11, .12); border-color: #f59e0b; }
.sd-cell .sd-task { font-size: 11.5px; padding: 2px 0; gap: 4px; line-height: 1.35; }
.sd-cell .sd-task input { width: 13px; height: 13px; margin-top: 2px; flex: none; }
.sd-cell .tag { font-size: 10px; padding: 0 4px; }
@media (max-width: 600px) { .sd-cell { min-height: 60px; font-size: 10.5px; } .sd-cell .sd-task { font-size: 10.5px; } }

/* ポイントで買える枠（追加分） */
.av.fr-leaf { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #22c55e, 0 0 10px -2px rgba(34, 197, 94, .7); }
.av.fr-ocean { position: relative; isolation: isolate; box-shadow: 0 0 0 2px var(--bg), 0 0 12px -2px rgba(14, 165, 233, .7); }
.av.fr-ocean::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; padding: 2.5px; z-index: -1;
  background: conic-gradient(from var(--ra), #0ea5e9, #22d3ee, #1d4ed8, #67e8f9, #0ea5e9); animation: royalFlow 4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.av.fr-ice { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #bae6fd, 0 0 16px 0 rgba(186, 230, 253, .9); }
.av.fr-fire { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #f97316, 0 0 16px 0 rgba(239, 68, 68, .8); animation: fireGlow 1.6s ease-in-out infinite; }
@keyframes fireGlow { 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #ef4444, 0 0 24px 4px rgba(249, 115, 22, .9); } }
.av.fr-galaxy { position: relative; isolation: isolate; box-shadow: 0 0 0 2px var(--bg), 0 0 18px 2px rgba(139, 92, 246, .6); }
.av.fr-galaxy::after { content: ""; position: absolute; inset: -5px; border-radius: inherit; padding: 3px; z-index: -1;
  background: conic-gradient(from var(--ra), #1e1b4b, #8b5cf6, #ec4899, #1e1b4b, #38bdf8, #a78bfa, #1e1b4b); animation: royalFlow 5s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@media (prefers-reduced-motion: reduce) { .av.fr-ocean::after, .av.fr-galaxy::after, .av.fr-fire { animation: none; } }

/* チャットの吹き出し（ポイントで買える） */
.bubble-sample { display: inline-block; padding: 6px 12px; border-radius: 14px; font-size: 12.5px; background: var(--surface-3); }
.bubble.bb-sky, .bubble-sample.bb-sky { background: #0ea5e9 !important; color: #fff !important; }
.bubble.bb-pink, .bubble-sample.bb-pink { background: #ec4899 !important; color: #fff !important; }
.bubble.bb-gold, .bubble-sample.bb-gold { background: linear-gradient(135deg, #b45309, #fbbf24, #fde68a) !important; color: #3b2300 !important; }
.bubble.bb-night, .bubble-sample.bb-night { background: #1e1b4b !important; color: #e0e7ff !important; }
.bubble.bb-grad, .bubble-sample.bb-grad { background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b) !important; color: #fff !important; }
/* チャットの名前の色（ポイントで買える） */
.nc-red { color: #ef4444 !important; } .nc-blue { color: #3b82f6 !important; }
.nc-gold { background: linear-gradient(90deg, #b45309, #fbbf24, #b45309); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.nc-rainbow { background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #3b82f6, #a855f7); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
/* 永久管理者専用: 名前と吹き出しのロイヤル */
.nc-royal { background: linear-gradient(90deg, #b45309, #fde68a, #f59e0b, #fff7d6, #b45309); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: ncShine 3s linear infinite; }
@keyframes ncShine { to { background-position: -200% 0; } }
.bubble.bb-royal, .bubble-sample.bb-royal { background: linear-gradient(135deg, #1e1b4b, #4c1d95) !important; color: #fde68a !important; box-shadow: 0 0 0 1.5px #f59e0b, 0 0 12px -2px rgba(245, 158, 11, .7) !important; }
@media (prefers-reduced-motion: reduce) { .nc-royal { animation: none; } }
/* 最高管理者だけ: エンペラー（枠・名前・吹き出し） */
@property --ea { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.av.fr-emperor { position: relative; isolation: isolate; overflow: visible; animation: empGlow 2.6s ease-in-out infinite; }
@keyframes empGlow { 0%, 100% { box-shadow: 0 0 0 2px var(--bg), 0 0 14px 3px rgba(168, 85, 247, .65), 0 0 28px 6px rgba(250, 204, 21, .35); } 50% { box-shadow: 0 0 0 2px var(--bg), 0 0 18px 5px rgba(56, 189, 248, .6), 0 0 34px 9px rgba(244, 114, 182, .4); } }
.av.fr-emperor::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; padding: 4px; z-index: -1;
  background: conic-gradient(from var(--ea), #facc15, #fff7d6, #a855f7, #38bdf8, #fff, #f472b6, #facc15); animation: empSpin 2.4s linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes empSpin { to { --ea: 360deg; } }
.av.fr-emperor::before { content: "👑"; position: absolute; left: 50%; top: -13px; font-size: 16px; transform: translateX(-50%) rotate(-10deg); z-index: 3; filter: drop-shadow(0 0 4px #facc15) drop-shadow(0 0 8px #a855f7); animation: empCrown 2.6s ease-in-out infinite; }
.av.lg.fr-emperor::before { font-size: 24px; top: -20px; } .av.sm.fr-emperor::before { font-size: 11px; top: -9px; }
@keyframes empCrown { 50% { transform: translateX(-50%) translateY(-2px) rotate(-4deg); } }
.av.fr-emperor > .shards { position: absolute; inset: -16px; pointer-events: none; z-index: -1; animation: empOrbit 6s linear infinite; }
.av.sm.fr-emperor > .shards { inset: -11px; } .av.lg.fr-emperor > .shards { inset: -22px; }
.av.fr-emperor > .shards > b { position: absolute; inset: 0; transform: rotate(calc(var(--i) * 45deg)); }
.av.fr-emperor > .shards > b::before { content: "✦"; position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-size: 9px; line-height: 1; color: var(--k); text-shadow: 0 0 6px var(--k); animation: empTw 1.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.2s); }
.av.sm.fr-emperor > .shards > b::before { font-size: 6px; }
.av.fr-emperor > .shards > b:nth-child(1) { --i: 0; --k: #facc15; } .av.fr-emperor > .shards > b:nth-child(2) { --i: 1; --k: #f472b6; } .av.fr-emperor > .shards > b:nth-child(3) { --i: 2; --k: #a855f7; } .av.fr-emperor > .shards > b:nth-child(4) { --i: 3; --k: #38bdf8; }
.av.fr-emperor > .shards > b:nth-child(5) { --i: 4; --k: #fff; } .av.fr-emperor > .shards > b:nth-child(6) { --i: 5; --k: #facc15; } .av.fr-emperor > .shards > b:nth-child(7) { --i: 6; --k: #34d399; } .av.fr-emperor > .shards > b:nth-child(8) { --i: 7; --k: #c084fc; }
@keyframes empOrbit { to { transform: rotate(-360deg); } }
@keyframes empTw { 50% { opacity: .25; transform: translateX(-50%) scale(.6); } }
.nc-emperor { background: linear-gradient(90deg, #facc15, #fff7d6, #a855f7, #38bdf8, #f472b6, #facc15); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: ncShine 4s linear infinite; filter: drop-shadow(0 0 3px rgba(168, 85, 247, .55)); font-weight: 800; }
.bubble.bb-emperor, .bubble-sample.bb-emperor { background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.18) 0 1px, transparent 2px) 0 0 / 22px 22px, radial-gradient(circle at 70% 60%, rgba(250,204,21,.35) 0 1px, transparent 2px) 0 0 / 31px 31px, linear-gradient(135deg, #0f0a2e, #3b0764 55%, #0c4a6e) !important; color: #fef3c7 !important; animation: empBub 3s ease-in-out infinite; }
@keyframes empBub { 0%, 100% { box-shadow: 0 0 0 1.5px #facc15, 0 0 14px -2px rgba(168, 85, 247, .8); } 50% { box-shadow: 0 0 0 1.5px #38bdf8, 0 0 16px -1px rgba(250, 204, 21, .75); } }
@media (prefers-reduced-motion: reduce) { .av.fr-emperor, .av.fr-emperor::after, .av.fr-emperor::before, .av.fr-emperor > .shards, .av.fr-emperor > .shards > b::before, .nc-emperor, .bubble.bb-emperor { animation: none; } }

/* iPad の使いやすさ: 指で押しやすい大きさ・入力で勝手に拡大されない文字・キーボードを出したときの高さ */
@media (pointer: coarse) {
  .cbtn { min-width: 44px; min-height: 44px; }
  .btn-sm { min-height: 36px; }
  input.input, textarea.textarea, select.select, .tt-grid input, .tt-grid select { font-size: 16px; }
}
@supports (height: 100dvh) { .chat { height: calc(100dvh - 64px); } }
.pin-bar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: var(--surface-3); border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; } .pin-bar .grow { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.csearch-hit { outline: 3px solid #f59e0b; outline-offset: 2px; transition: outline .2s; }
.cbtn.rec { color: #ef4444; animation: fireGlow 1.2s infinite; } .bubble.voice { padding: 6px !important; } .bubble.voice audio { max-width: 240px; height: 36px; display: block; }
.gcall-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9000; display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 999px; background: #0f172a; color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.3); font-size: 14px; }
.gcall-bar .btn { color: inherit; }
.va-act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border: 1.5px dashed var(--accent, #10b981); }
.chip-tm { font-weight: 700; opacity: .85; margin-right: 2px; }
.ev-card { margin-bottom: 16px; background: linear-gradient(135deg, rgba(16,185,129,.12), rgba(14,165,233,.12)); }

/* ===== きせかえテーマ（html[data-skin=…]。土台は data-theme の dark / light） ===== */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.skin-b { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.skin-b i { flex: none; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--sb) 50%, var(--sa) 50%); box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.skin-b.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
html[data-skin=midnight] { --bg: #070b16; --bg-2: #0a1020; --surface: #0e1527; --surface-2: #131c33; --surface-3: #1a2440; --line: rgba(148, 178, 255, .08); --line-2: rgba(148, 178, 255, .14); --muted: #93a0bd; --faint: #5d6886;
  --accent: #3b82f6; --accent-hi: #60a5fa; --accent-soft: rgba(59, 130, 246, .15); --accent-line: rgba(96, 165, 250, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #60a5fa, #3b82f6 45%, #6366f1); --glass: rgba(10, 16, 32, .76); --sk1: rgba(59, 130, 246, .20); --sk2: rgba(99, 102, 241, .14); }
html[data-skin=neon] { --bg: #0c0614; --bg-2: #110820; --surface: #160c26; --surface-2: #1d1031; --surface-3: #26153f; --line: rgba(232, 121, 249, .09); --line-2: rgba(232, 121, 249, .16); --muted: #b39cc7; --faint: #6f5a85;
  --accent: #d946ef; --accent-hi: #f0abfc; --accent-soft: rgba(217, 70, 239, .15); --accent-line: rgba(240, 171, 252, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #f472b6, #d946ef 45%, #8b5cf6); --glass: rgba(18, 9, 30, .76); --sk1: rgba(217, 70, 239, .22); --sk2: rgba(34, 211, 238, .12); }
html[data-skin=sunset] { --bg: #120a07; --bg-2: #170d09; --surface: #1d120d; --surface-2: #251812; --surface-3: #301f17; --line: rgba(253, 186, 116, .08); --line-2: rgba(253, 186, 116, .15); --muted: #c2a593; --faint: #7d6152;
  --accent: #f97316; --accent-hi: #fb923c; --accent-soft: rgba(249, 115, 22, .15); --accent-line: rgba(251, 146, 60, .32); --on-accent: #1c0a02; --grad: linear-gradient(135deg, #fbbf24, #f97316 45%, #e11d48); --glass: rgba(26, 14, 10, .76); --sk1: rgba(249, 115, 22, .20); --sk2: rgba(225, 29, 72, .13); }
html[data-skin=oled] { --bg: #000; --bg-2: #000; --surface: #0a0a0a; --surface-2: #121212; --surface-3: #1a1a1a; --glass: rgba(0, 0, 0, .8); --sk1: rgba(16, 185, 129, .10); --sk2: rgba(96, 165, 250, .05); }
html[data-skin=sakura] { --bg: #fff5f8; --bg-2: #ffeef3; --surface: #ffffff; --surface-2: #fff4f7; --surface-3: #fde4ec; --line: rgba(190, 24, 93, .09); --line-2: rgba(190, 24, 93, .16); --text: #2a1520; --muted: #7a5566; --faint: #a5899a;
  --accent: #db2777; --accent-hi: #be185d; --accent-soft: rgba(236, 72, 153, .12); --accent-line: rgba(219, 39, 119, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #f9a8d4, #ec4899 45%, #db2777); --glass: rgba(255, 250, 252, .8); --sk1: rgba(244, 114, 182, .18); --sk2: rgba(251, 207, 232, .5); }
html[data-skin=ocean] { --bg: #f0f7ff; --bg-2: #e6f1fd; --surface: #ffffff; --surface-2: #f2f8ff; --surface-3: #dcecfb; --line: rgba(3, 105, 161, .09); --line-2: rgba(3, 105, 161, .16); --text: #0b1d2e; --muted: #4c6479; --faint: #8399ac;
  --accent: #0284c7; --accent-hi: #0369a1; --accent-soft: rgba(2, 132, 199, .11); --accent-line: rgba(2, 132, 199, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #38bdf8, #0284c7 45%, #0d9488); --glass: rgba(250, 253, 255, .8); --sk1: rgba(56, 189, 248, .20); --sk2: rgba(45, 212, 191, .14); }
html[data-skin=cream] { --bg: #fbf7ef; --bg-2: #f6f0e3; --surface: #fffdf8; --surface-2: #faf5ea; --surface-3: #f1e8d6; --line: rgba(120, 72, 20, .10); --line-2: rgba(120, 72, 20, .17); --text: #2b2114; --muted: #75664f; --faint: #a39479;
  --accent: #d97706; --accent-hi: #b45309; --accent-soft: rgba(217, 119, 6, .11); --accent-line: rgba(217, 119, 6, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #fcd34d, #f59e0b 45%, #d97706); --glass: rgba(255, 252, 245, .82); --sk1: rgba(251, 191, 36, .20); --sk2: rgba(253, 230, 138, .4); }
html[data-skin=lavender] { --bg: #f6f3ff; --bg-2: #efeafd; --surface: #ffffff; --surface-2: #f6f2ff; --surface-3: #e8e0fb; --line: rgba(91, 33, 182, .09); --line-2: rgba(91, 33, 182, .16); --text: #1e1530; --muted: #625577; --faint: #978aab;
  --accent: #7c3aed; --accent-hi: #6d28d9; --accent-soft: rgba(124, 58, 237, .11); --accent-line: rgba(124, 58, 237, .32); --on-accent: #fff; --grad: linear-gradient(135deg, #c4b5fd, #8b5cf6 45%, #7c3aed); --glass: rgba(252, 250, 255, .82); --sk1: rgba(167, 139, 250, .22); --sk2: rgba(244, 114, 182, .12); }
html[data-skin] body::before { background: radial-gradient(900px 520px at 8% -10%, var(--sk1), transparent 60%), radial-gradient(760px 460px at 105% 0%, var(--sk2), transparent 60%) !important; }
html[data-skin][data-theme] body { background: var(--bg); }
html[data-skin][data-theme] .side, html[data-skin][data-theme] .c-list, html[data-skin][data-theme] .c-head, html[data-skin][data-theme] .c-info, html[data-skin][data-theme] .mobile-bar { background: var(--glass) !important; }
/* 細い左メニュー（アイコンだけ）のときは、グループの見出しを細い線にして、いつも全部見せる */
@media (min-width: 761px) and (max-width: 1180px) {
  .nav-grp { justify-content: center; margin: 6px 8px; padding: 0; height: 1px; background: var(--line-2); pointer-events: none; overflow: hidden; }
  .nav-grp > * { display: none; }
  .nav-sub[hidden] { display: flex !important; }
}
.ann-card .card-body.clamp { max-height: 200px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.ann-more { width: 100%; justify-content: center; margin: -6px 0 6px; }

.bubble.video { padding: 4px; } .bubble.video video { display: block; max-width: min(320px, 70vw); max-height: 360px; border-radius: 12px; background: #000; }
.m-more { display: inline-block; vertical-align: top; margin: 4px 4px 0; padding: 0 10px; height: 26px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.m-more:hover { color: var(--text); }
.lic-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; } .lic-hero h1 { margin: 0 0 2px; }
.lic-seal { flex: none; width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: var(--on-accent); background: var(--grad); box-shadow: 0 8px 24px -10px var(--accent); }
.lic-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 8px; } @media (max-width: 600px) { .lic-cards { grid-template-columns: 1fr; } }
.lic-card { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14px; } .lic-card ul { margin: 6px 0 0; padding-left: 1.2em; } .lic-card li { margin: 2px 0; }
.lic-card.ok { border-color: rgba(16, 185, 129, .45); background: rgba(16, 185, 129, .07); } .lic-card.ng { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .07); }
.lic-en { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--muted); } .lic-en b { color: var(--text); }
.lic a, .terms li a { color: var(--accent); text-decoration: underline; }
.maint-seg { display: flex; gap: 6px; flex-wrap: wrap; } .maint-seg .btn { flex: 1; min-width: 130px; justify-content: center; }
.site-foot { max-width: 1180px; margin: 0 auto; padding: 8px 34px 90px; font-size: 11.5px; color: var(--faint); text-align: center; } .site-foot a { text-decoration: underline; }

/* =====================================================================
   🎨 デザイン（html[data-design=…]）: 色（テーマ）とは別に、形・雰囲気を変える
   standard（なし）/ soft / minimal / glass / pop / compact / note / retro
   ===================================================================== */
/* ---- スタンダードのみがき直し（全デザイン共通） ---- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }
.btn:active { transform: scale(.97); }
.card { transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
a.card:hover, .qz:hover { transform: translateY(-1px); }
.card-head h2 { letter-spacing: -.01em; }
.page-head h1 { text-wrap: balance; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.nav a { transition: background .15s, color .15s; }
img, video { -webkit-user-drag: none; }

/* ---- ☁️ ソフト: まるくて、やわらかい ---- */
html[data-design=soft] { --r: 26px; --r-sm: 18px; }
html[data-design=soft] .card { border-radius: 28px; border-color: transparent !important; background: var(--surface) !important; box-shadow: 0 18px 40px -26px rgba(0, 0, 0, .55), 0 2px 6px -2px rgba(0, 0, 0, .12); }
html[data-design=soft][data-theme=light] .card { background: #fff !important; box-shadow: 0 18px 40px -24px rgba(30, 40, 60, .25), 0 2px 6px -2px rgba(30, 40, 60, .06); }
html[data-design=soft] .btn { border-radius: 999px; }
html[data-design=soft] .input, html[data-design=soft] .select { border-radius: 999px; padding: 0 18px; }
html[data-design=soft] .textarea { border-radius: 20px; }
html[data-design=soft] .bubble { border-radius: 8px 22px 22px 22px; border-color: transparent; }
html[data-design=soft] .m.me .bubble { border-radius: 22px 8px 22px 22px; }
html[data-design=soft] .nav a, html[data-design=soft] .c-row { border-radius: 999px; }
html[data-design=soft] .tag { border-radius: 999px; }
html[data-design=soft] .hub-tabs a { border-radius: 999px; border-bottom: 0; } html[data-design=soft] .hub-tabs a.on { background: var(--accent-soft); color: var(--accent); }
html[data-design=soft] .rtabs, html[data-design=soft] .rtabs button { border-radius: 999px; }

/* ---- ▫️ ミニマル: 線だけ・平ら・静か ---- */
html[data-design=minimal] { --r: 8px; --r-sm: 6px; --lift: none; }
html[data-design=minimal] body::before { display: none; }
html[data-design=minimal] .card { border-radius: 10px; border: 1px solid var(--line-2) !important; background: var(--surface) !important; box-shadow: none; }
html[data-design=minimal] .btn { border-radius: 8px; box-shadow: none; }
html[data-design=minimal] .btn-primary { background: var(--accent); box-shadow: none; text-shadow: none; }
html[data-design=minimal] .input, html[data-design=minimal] .select, html[data-design=minimal] .textarea { border-radius: 8px; background: transparent; }
html[data-design=minimal] .bubble { border-radius: 10px; box-shadow: none; }
html[data-design=minimal] .tag { border-radius: 4px; background: transparent; border: 1px solid var(--line-2); }
html[data-design=minimal] .card-head h2 .i { background: none; box-shadow: none; padding: 0; width: auto; height: auto; }
html[data-design=minimal] .page-head h1 { font-weight: 600; letter-spacing: -.02em; }
html[data-design=minimal] .nav a, html[data-design=minimal] .c-row { border-radius: 8px; }
html[data-design=minimal] .nav a.on { background: none; color: var(--accent); }

/* ---- 🫧 ガラス: すりガラスと色の光（ゆっくり動く光・光るふち・反射） ---- */
html[data-design=glass] { --r: 22px; --r-sm: 14px; --g-line: rgba(255, 255, 255, .16); --g-hi: rgba(255, 255, 255, .45); --g-fill: color-mix(in srgb, var(--surface) 52%, transparent); }
html[data-design=glass][data-theme=light] { --g-line: rgba(255, 255, 255, .75); --g-hi: rgba(255, 255, 255, .95); --g-fill: rgba(255, 255, 255, .5); }
html[data-design=glass] body::before { background: radial-gradient(700px 500px at 10% 0%, color-mix(in srgb, var(--accent) 38%, transparent), transparent 60%), radial-gradient(600px 500px at 95% 20%, rgba(168, 85, 247, .3), transparent 60%), radial-gradient(700px 600px at 50% 110%, rgba(56, 189, 248, .24), transparent 60%) !important; }
html[data-design=glass] body::after { content: ''; position: fixed; inset: -20%; z-index: 0; pointer-events: none; background: radial-gradient(420px 420px at 30% 30%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%), radial-gradient(380px 380px at 70% 65%, rgba(236, 72, 153, .22), transparent 70%), radial-gradient(360px 360px at 55% 20%, rgba(56, 189, 248, .22), transparent 70%); filter: blur(30px); animation: gl-drift 28s ease-in-out infinite alternate; }
@keyframes gl-drift { from { transform: translate(-4%, -3%) rotate(0deg); } to { transform: translate(4%, 5%) rotate(6deg); } }
html[data-design=glass] .card { position: relative; overflow: hidden; border: 1px solid var(--g-line) !important; background: linear-gradient(135deg, rgba(255, 255, 255, .10), transparent 45%, rgba(255, 255, 255, .04)), var(--g-fill) !important; -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%); box-shadow: 0 24px 60px -32px rgba(0, 0, 0, .65), inset 0 1px 0 var(--g-hi), inset 0 -1px 0 rgba(255, 255, 255, .05); }
html[data-design=glass] .card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(135deg, var(--g-hi), transparent 35%, transparent 65%, color-mix(in srgb, var(--accent) 50%, transparent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
html[data-design=glass] .card::after { content: ''; position: absolute; left: -40%; top: -60%; width: 60%; height: 220%; background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, .13) 50%, transparent 60%); transform: rotate(12deg); pointer-events: none; }
html[data-design=glass] a.card:hover { transform: translateY(-2px); box-shadow: 0 30px 70px -30px color-mix(in srgb, var(--accent) 55%, rgba(0, 0, 0, .6)), inset 0 1px 0 var(--g-hi); }
html[data-design=glass] .side, html[data-design=glass] .c-list, html[data-design=glass] .c-head, html[data-design=glass] .mobile-bar, html[data-design=glass] .hub-tabs { background: color-mix(in srgb, var(--bg) 40%, transparent) !important; -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); border-color: var(--g-line) !important; }
html[data-design=glass] .side { box-shadow: inset -1px 0 0 var(--g-line); }
html[data-design=glass] .nav a { border-radius: 12px; }
html[data-design=glass] .nav a.on { background: linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)); box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 1px var(--g-line); }
html[data-design=glass] .nav a.on::before { box-shadow: 0 0 10px var(--accent); }
html[data-design=glass] .btn { border: 1px solid var(--g-line); background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03)); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 var(--g-hi); }
html[data-design=glass] .btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent)); border-color: color-mix(in srgb, var(--accent) 60%, #fff); color: var(--on-accent); box-shadow: 0 10px 28px -10px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .5); }
html[data-design=glass] .btn-ghost { border-color: transparent; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html[data-design=glass] .input, html[data-design=glass] .select, html[data-design=glass] .textarea { background: color-mix(in srgb, var(--surface-2) 45%, transparent); border-color: var(--g-line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); }
html[data-design=glass] .input:focus, html[data-design=glass] .select:focus, html[data-design=glass] .textarea:focus { border-color: color-mix(in srgb, var(--accent) 70%, #fff); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 24px -6px var(--accent); }
html[data-design=glass] .bubble { background: color-mix(in srgb, var(--surface-2) 55%, transparent); border-color: var(--g-line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
html[data-design=glass] .m.me .bubble { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 90%, #fff), var(--accent)); box-shadow: 0 10px 24px -12px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .4); }
html[data-design=glass] .tag { background: rgba(255, 255, 255, .10); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html[data-design=glass] .card-head h2 .i { background: linear-gradient(135deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04)); box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 1px var(--g-line), 0 0 14px -4px var(--accent); }
html[data-design=glass] .page-head h1 { text-shadow: 0 2px 24px color-mix(in srgb, var(--accent) 40%, transparent); }
html[data-design=glass] .hub-tabs a { border-radius: 999px; border-bottom: 0; padding: 7px 14px; margin-bottom: 6px; }
html[data-design=glass] .hub-tabs a.on { background: linear-gradient(135deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .06)); box-shadow: inset 0 1px 0 var(--g-hi), inset 0 0 0 1px var(--g-line); color: var(--text); }
html[data-design=glass] .c-row { border-radius: 14px; } html[data-design=glass] .c-row:hover { background: rgba(255, 255, 255, .07); }
html[data-design=glass] .modal { background: var(--g-fill); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .7), inset 0 1px 0 var(--g-hi); }
html[data-design=glass] .modal-bg { background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
html[data-design=glass] .toast { background: var(--g-fill); border: 1px solid var(--g-line); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: inset 0 1px 0 var(--g-hi), 0 16px 40px -20px rgba(0, 0, 0, .6); }
html[data-design=glass] .rtabs { background: rgba(255, 255, 255, .06); border: 1px solid var(--g-line); border-radius: 999px; } html[data-design=glass] .rtabs button { border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { html[data-design=glass] body::after { animation: none; } }

/* ---- 💥 ポップ: 太いふち・くっきり影・元気 ---- */
html[data-design=pop] { --pop: var(--text); }
html[data-design=pop] .card { border-radius: 16px; border: 2px solid var(--pop) !important; background: var(--surface) !important; box-shadow: 5px 5px 0 var(--pop); }
html[data-design=pop] a.card:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--pop); }
html[data-design=pop] .btn { border: 2px solid var(--pop); border-radius: 12px; font-weight: 800; box-shadow: 3px 3px 0 var(--pop); }
html[data-design=pop] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop); }
html[data-design=pop] .btn-primary { background: var(--accent); color: var(--on-accent); text-shadow: none; }
html[data-design=pop] .btn-ghost { box-shadow: none; border-color: transparent; }
html[data-design=pop] .input, html[data-design=pop] .select, html[data-design=pop] .textarea { border: 2px solid var(--pop); border-radius: 12px; }
html[data-design=pop] .bubble { border: 2px solid var(--pop); box-shadow: 3px 3px 0 var(--pop); }
html[data-design=pop] .page-head h1, html[data-design=pop] .card-head h2 { font-weight: 900; }
html[data-design=pop] .tag { border: 1.5px solid var(--pop); font-weight: 800; }
html[data-design=pop] .nav a.on { background: var(--accent); color: var(--on-accent); }
html[data-design=pop] .hub-tabs a.on { border-bottom-width: 4px; }

/* ---- 📐 コンパクト: たくさん表示（iPad で一覧を見たい人向け） ---- */
html[data-design=compact] body { font-size: 13.5px; }
html[data-design=compact] .page { padding: 16px 20px 40px; }
html[data-design=compact] .page-head { margin-bottom: 10px; } html[data-design=compact] .page-head h1 { font-size: 24px; }
html[data-design=compact] .card { border-radius: 14px; }
html[data-design=compact] .card-head { padding: 10px 12px 0; } html[data-design=compact] .card-body { padding: 8px 12px 12px; }
html[data-design=compact] .stack, html[data-design=compact] .grid-2 { gap: 10px; }
html[data-design=compact] .btn { height: 32px; padding: 0 12px; font-size: 13px; }
html[data-design=compact] .input, html[data-design=compact] .select { height: 34px; }
html[data-design=compact] .nav a { height: 34px; font-size: 13px; }
html[data-design=compact] .bubble { padding: 6px 10px; font-size: 13.5px; }
html[data-design=compact] .c-row { padding: 6px 8px; }

/* ---- 📓 ノート: 罫線ノート・赤い余白線・マスキングテープ。文房具みたい ---- */
html[data-design=note] { --r: 6px; --r-sm: 4px; --lift: none; --rule: color-mix(in srgb, var(--accent) 16%, transparent); --margin: rgba(239, 68, 68, .5); --tape: color-mix(in srgb, var(--accent) 45%, #fff 30%); }
html[data-design=note] body::before { background: radial-gradient(circle at 1px 1px, var(--line-2) 1px, transparent 1.6px) 0 0 / 22px 22px; opacity: .6; }
html[data-design=note] .card { position: relative; overflow: visible; border-radius: 3px 3px 12px 3px; border: 1px solid var(--line-2) !important; box-shadow: 0 1px 0 var(--line-2), 0 12px 24px -20px rgba(0, 0, 0, .55); background: repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px) 0 10px / 100% 28px, var(--surface) !important; }
html[data-design=note] .card::before { content: ''; position: absolute; left: 30px; top: 0; bottom: 0; width: 1px; background: var(--margin); pointer-events: none; }
html[data-design=note] .card::after { content: ''; position: absolute; top: -8px; left: 50%; width: 72px; height: 16px; margin-left: -36px; background: var(--tape); opacity: .55; transform: rotate(-2deg); border-left: 2px dashed rgba(255, 255, 255, .5); border-right: 2px dashed rgba(255, 255, 255, .5); pointer-events: none; }
html[data-design=note] .card:nth-child(even)::after { transform: rotate(2deg); margin-left: 20px; }
html[data-design=note] .card-head { padding-left: 42px; } html[data-design=note] .card-body { padding-left: 42px; }
html[data-design=note] .page-head h1 { font-family: 'Hiragino Mincho ProN', 'Yu Mincho', YuMincho, 'Noto Serif JP', serif; font-weight: 600; letter-spacing: 0; }
html[data-design=note] .card-head h2 { background: linear-gradient(transparent 55%, var(--accent-soft) 55%, var(--accent-soft) 92%, transparent 92%); padding: 0 4px; }
html[data-design=note] .card-head h2 .i { border-radius: 50%; background: none; box-shadow: none; border: 1.5px dashed var(--accent); color: var(--accent); }
html[data-design=note] .btn { border-radius: 2px; border: 1px solid var(--line-2); box-shadow: 1px 2px 0 var(--line-2); font-weight: 650; }
html[data-design=note] .btn:active { transform: translate(1px, 2px); box-shadow: none; }
html[data-design=note] .btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; text-shadow: none; box-shadow: 2px 3px 8px -4px rgba(0, 0, 0, .5); }
html[data-design=note] .btn-ghost { border-color: transparent; box-shadow: none; }
html[data-design=note] .input, html[data-design=note] .select { border: 0; border-bottom: 2px solid var(--line-2); border-radius: 0; background: transparent; padding: 0 6px; }
html[data-design=note] .textarea { border: 1px dashed var(--line-2); border-radius: 2px; background: repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px) 0 8px / 100% 28px, var(--surface); line-height: 28px; padding-top: 8px; }
html[data-design=note] .input:focus, html[data-design=note] .select:focus, html[data-design=note] .textarea:focus { box-shadow: none; border-color: var(--accent); }
html[data-design=note] .bubble { border-radius: 2px; border: 1px solid var(--line-2); box-shadow: 2px 2px 0 var(--line-2); }
html[data-design=note] .m.me .bubble { background: var(--accent-soft); color: var(--text); border-color: var(--accent-line); box-shadow: 2px 2px 0 var(--accent-line); }
html[data-design=note] .tag { border-radius: 2px; border: 1px dashed var(--line-2); background: transparent; }
html[data-design=note] .side { border-right: 1px dashed var(--line-2); }
html[data-design=note] .nav a { border-radius: 2px; isolation: isolate; }
html[data-design=note] .nav a.on { background: transparent; } html[data-design=note] .nav a.on::before { display: none; }
html[data-design=note] .nav a.on::after { content: ''; position: absolute; left: 34px; right: 8px; bottom: 7px; height: 7px; background: var(--accent-soft); z-index: -1; }
html[data-design=note] .hub-tabs a { border-radius: 0; } html[data-design=note] .hub-tabs a.on { border-bottom: 2px solid var(--accent); }
html[data-design=note] .c-row { border-radius: 3px; }
html[data-design=note] .rtabs, html[data-design=note] .rtabs button { border-radius: 2px; }

/* ---- 🕹️ レトロ: ドット絵ゲームの画面。角ばった二重わく・走査線・▶カーソル ---- */
html[data-design=retro] { --r: 0px; --r-sm: 0px; --lift: none; --px: var(--text); }
html[data-design=retro] body::before { background: repeating-linear-gradient(180deg, rgba(0, 0, 0, .09) 0 1px, transparent 1px 3px); z-index: 9999; }
html[data-design=retro] .card { border-radius: 0; border: 3px solid var(--px) !important; background: var(--surface) !important; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--px), 5px 5px 0 var(--accent); }
html[data-design=retro] a.card:hover { transform: translate(-1px, -1px); box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--px), 7px 7px 0 var(--accent); }
html[data-design=retro] .page-head h1 { letter-spacing: .02em; text-shadow: 3px 3px 0 var(--accent); }
html[data-design=retro] .card-head h2 { font-weight: 800; letter-spacing: .02em; }
html[data-design=retro] .card-head h2 .i { border-radius: 0; background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 2px var(--px); }
html[data-design=retro] .btn { border-radius: 0; border: 3px solid var(--px); font-weight: 800; letter-spacing: .03em; box-shadow: inset -3px -3px 0 rgba(0, 0, 0, .28), inset 3px 3px 0 rgba(255, 255, 255, .28); }
html[data-design=retro] .btn:active { transform: translate(1px, 1px); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .28); }
html[data-design=retro] .btn-primary { background: var(--accent); color: var(--on-accent); text-shadow: 2px 2px 0 rgba(0, 0, 0, .35); }
html[data-design=retro] .btn-ghost { border-color: transparent; box-shadow: none; }
html[data-design=retro] .input, html[data-design=retro] .select, html[data-design=retro] .textarea { border-radius: 0; border: 3px solid var(--px); background: var(--bg); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .14); }
html[data-design=retro] .input:focus, html[data-design=retro] .select:focus, html[data-design=retro] .textarea:focus { border-color: var(--accent); box-shadow: inset 3px 3px 0 rgba(0, 0, 0, .14); }
html[data-design=retro] .bubble { border-radius: 0; border: 3px solid var(--px); box-shadow: 3px 3px 0 var(--px); }
html[data-design=retro] .m.me .bubble { background: var(--surface); color: var(--text); border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
html[data-design=retro] .tag { border-radius: 0; border: 2px solid var(--px); background: var(--bg); font-weight: 800; }
html[data-design=retro] .side { border-right: 3px solid var(--px); }
html[data-design=retro] .nav a { border-radius: 0; }
html[data-design=retro] .nav a.on { background: var(--accent); color: var(--on-accent); }
html[data-design=retro] .nav a.on::before { content: '▶'; width: auto; left: -11px; top: 50%; bottom: auto; transform: translateY(-50%); background: none; border-radius: 0; font-size: 9px; color: var(--accent); animation: rt-blink 1s steps(2) infinite; }
@keyframes rt-blink { to { opacity: 0; } }
html[data-design=retro] .hub-tabs a { border-radius: 0; border: 2px solid transparent; border-bottom: 0; }
html[data-design=retro] .hub-tabs a.on { border-color: var(--px); background: var(--surface); }
html[data-design=retro] .c-row { border-radius: 0; }
html[data-design=retro] .rtabs, html[data-design=retro] .rtabs button, html[data-design=retro] .av, html[data-design=retro] .skin-b, html[data-design=retro] .design-b { border-radius: 0 !important; }
@media (prefers-reduced-motion: reduce) { html[data-design=retro] .nav a.on::before { animation: none; } }

/* ---- 選ぶところ（マイページ） ---- */
.design-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.design-b { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.design-b b { font-size: 13.5px; } .design-b small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.design-b.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.design-b .dz { width: 100%; height: 44px; display: flex; gap: 6px; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); }
.design-b .dz i { width: 44px; height: 26px; display: block; background: var(--surface); }
.design-b .dz u { width: 26px; height: 14px; display: block; background: var(--accent); }
.dz.standard i { border-radius: 8px; border: 1px solid var(--line-2); } .dz.standard u { border-radius: 6px; }
.dz.soft i { border-radius: 14px; box-shadow: 0 6px 12px -6px rgba(0,0,0,.4); } .dz.soft u { border-radius: 99px; }
.dz.minimal i { border-radius: 3px; border: 1px solid var(--line-2); background: none; } .dz.minimal u { border-radius: 2px; }
.dz.glass { background: linear-gradient(120deg, var(--accent), #a855f7, #38bdf8) !important; } .dz.glass i { border-radius: 8px; background: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.6); } .dz.glass u { border-radius: 6px; background: rgba(255,255,255,.85); }
.dz.pop i { border-radius: 6px; border: 2px solid var(--text); box-shadow: 3px 3px 0 var(--text); } .dz.pop u { border-radius: 4px; border: 2px solid var(--text); }
.dz.compact { gap: 3px; } .dz.compact i { width: 26px; height: 16px; border-radius: 4px; border: 1px solid var(--line-2); } .dz.compact u { width: 18px; height: 10px; border-radius: 3px; }
.dz.note { background: repeating-linear-gradient(180deg, var(--bg) 0 6px, var(--line-2) 6px 7px) !important; } .dz.note i { border-radius: 2px; border: 1px solid var(--line-2); box-shadow: 2px 2px 0 var(--line-2); } .dz.note u { border-radius: 2px; transform: rotate(-8deg); opacity: .85; }
.dz.retro i { border-radius: 0; border: 2px solid var(--text); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--text), 3px 3px 0 var(--accent); } .dz.retro u { border-radius: 0; box-shadow: inset -2px -2px 0 rgba(0,0,0,.3), inset 2px 2px 0 rgba(255,255,255,.3); }
@media (prefers-reduced-motion: reduce) { .card, a.card:hover, .btn:active { transition: none; transform: none; } }

/* ---- ⚔️ 勝負のお知らせ（マイページの上） ---- */
.strip.duel { border-color: rgba(239, 68, 68, .45); background: linear-gradient(90deg, rgba(239, 68, 68, .12), transparent 60%), var(--surface); cursor: pointer; }
.strip.duel .go { margin-left: auto; color: #f87171; white-space: nowrap; }
.strip.duel:hover { border-color: #ef4444; }

/* ---- 🔔 通知: 種類ごとの色・チップ・日付の区切り ---- */
.notif-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 4px 8px 10px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.notif-chips button { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; }
.notif-chips button.on { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.notif-day { padding: 8px 10px 2px; font-size: 11.5px; font-weight: 700; color: var(--faint); letter-spacing: .04em; }
.notif-k { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; line-height: 16px; vertical-align: 1px; background: var(--surface-3); color: var(--muted); }
.notif-ic.k-duel, .notif-k.k-duel { background: rgba(239, 68, 68, .16); color: #f87171; }
.notif-ic.k-announce, .notif-k.k-announce { background: rgba(96, 165, 250, .16); color: #60a5fa; }
.notif-ic.k-point, .notif-k.k-point, .notif-ic.k-trust, .notif-k.k-trust { background: rgba(251, 191, 36, .16); color: #fbbf24; }
.notif-ic.k-friend, .notif-k.k-friend, .notif-ic.k-mention, .notif-k.k-mention { background: rgba(168, 85, 247, .16); color: #c084fc; }
.notif-ic.k-report, .notif-k.k-report, .notif-ic.k-join, .notif-k.k-join, .notif-ic.k-admin, .notif-k.k-admin { background: rgba(148, 163, 184, .18); color: #94a3b8; }
.notif-ic.k-qa, .notif-k.k-qa, .notif-ic.k-print, .notif-k.k-print { background: var(--accent-soft); color: var(--accent-hi); }
html[data-theme=light] .notif-ic.k-duel, html[data-theme=light] .notif-k.k-duel { color: #dc2626; } html[data-theme=light] .notif-ic.k-announce, html[data-theme=light] .notif-k.k-announce { color: #2563eb; }
html[data-theme=light] .notif-ic.k-point, html[data-theme=light] .notif-k.k-point, html[data-theme=light] .notif-ic.k-trust, html[data-theme=light] .notif-k.k-trust { color: #b45309; }
html[data-theme=light] .notif-ic.k-friend, html[data-theme=light] .notif-k.k-friend, html[data-theme=light] .notif-ic.k-mention, html[data-theme=light] .notif-k.k-mention { color: #7e22ce; }
html[data-theme=light] .notif-ic.k-report, html[data-theme=light] .notif-k.k-report, html[data-theme=light] .notif-ic.k-join, html[data-theme=light] .notif-k.k-join, html[data-theme=light] .notif-ic.k-admin, html[data-theme=light] .notif-k.k-admin { color: #475569; }

/* ---- ⚡ 軽量モード（html[data-lite]）: ぼかし・影・アニメーションを切る ---- */
html[data-lite] *, html[data-lite] *::before, html[data-lite] *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; animation: none !important; transition: none !important; filter: none !important; }
html[data-lite] body::before, html[data-lite] body::after { display: none !important; }
html[data-lite] .card, html[data-lite] .btn, html[data-lite] .bubble, html[data-lite] .modal { box-shadow: none !important; }
html[data-lite] .card { background: var(--surface) !important; border: 1px solid var(--line-2) !important; }
html[data-lite] .side, html[data-lite] .c-list, html[data-lite] .c-head, html[data-lite] .mobile-bar, html[data-lite] .hub-tabs, html[data-lite] .modal { background: var(--bg) !important; }
html[data-lite] .av.fr-royal > .shards { display: none !important; }
html[data-lite] .page > * { opacity: 1 !important; transform: none !important; }
/* =====================================================================
   🎮 バトル（battle.js）: 全画面のアリーナ。テーマに関係なく、いつも夜のネオン
   ===================================================================== */


@keyframes bt-sheen { 0%, 60% { left: -30%; } 100% { left: 130%; } }

  





/* ---- アリーナ（全画面）。中の色はいつも同じ ---- */


@keyframes bt-aurora { to { transform: translate(4%, -3%) rotate(8deg) scale(1.05); } }

@keyframes bt-grid { to { background-position: 0 60px, 0 0; } }






 @keyframes bt-bob { 50% { transform: translateY(-12px) rotate(-8deg); } }

   
@keyframes bt-dot { 50% { transform: translateY(-7px); opacity: .45; } }

/* ---- 🎲 ルーレット（スロット風） ---- */

  
 
 
 @keyframes bt-win { to { transform: scale(1.22); } }

/* ---- 決める画面 ---- */



 
 

 

  




@keyframes bt-holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }




/* ---- 問題を作っている間の説明 ---- */


  
 
@keyframes bt-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
 
 


/* ---- カウントダウン ---- */


@keyframes bt-cd { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .8; } }


/* ===== 対戦中: 左 = 自分 / 右 = 相手 ===== */






 

 
 
 
 
  


 


 






 
 
 

  

  
 
@keyframes bt-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
/* 🚩 範囲外の報告 */


 

  

 
 @keyframes bt-askt { from { width: 100%; } to { width: 0; } }
/* 手札（カード・アイテム）: トレカ風 */


@keyframes bt-lv3 { 50% { box-shadow: 0 0 34px 0 rgba(251, 191, 36, .9); } }
  
/* 右: 相手の画面 */
  
 
.q-same .bt-mirror::before { content: 'SAME'; background: rgba(255, 255, 255, .12); box-shadow: none; animation: none; }

 @keyframes bt-blink { to { opacity: 0; } }


 
 
  

/* お知らせ（上のまん中） */


@keyframes bt-tin { from { transform: translateY(-20px) scale(.8); opacity: 0; } }
    


/* ===== 💥 エフェクト（自分の画面の上） */


.cv-fog { filter: blur(3px); }

@keyframes bt-flicker { 0% { opacity: 0; } 15% { opacity: 1; } 30% { opacity: .2; } 45% { opacity: 1; } 60% { opacity: .5; } 75% { opacity: 1; } }
 @keyframes bt-flash { to { opacity: 0; } }
 @keyframes bt-quake { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-5px, 3px) rotate(-.6deg); } 50% { transform: translate(4px, -4px) rotate(.5deg); } 75% { transform: translate(-3px, -2px) rotate(-.3deg); } 100% { transform: translate(5px, 2px) rotate(.4deg); } }
 @keyframes bt-sleep { 0%, 100% { filter: blur(1.5px) brightness(.8); } 50% { filter: blur(7px) brightness(.45); } }


 

html[data-lite] .cv-fog { filter: none; } 
/* 結果 */


 @keyframes bt-rays { to { transform: rotate(360deg); } }
   

 
  
 
   
 
 
 
   
 

/* ---- 🃏 カード（トレカ風）: 色（--h）・レア度（コモン / レア / レジェンド / カオス）・星 ---- */




 










 

/* レア度 */












/* ---- 点数のカウントアップ ---- */
  @keyframes bt-pop { 30% { transform: scale(1.35); } }
  
@keyframes bt-delta { to { transform: translateY(-36px); opacity: 0; } }
      
  

/* ---- オーラ（自分・相手にかかっている状態） ---- */


@keyframes bt-hex { 50% { opacity: .4; } }
 



 @keyframes bt-fire { to { box-shadow: 0 0 0 2px #f97316, 0 0 26px #f97316, 0 -8px 20px #facc15; } }
 @keyframes bt-good { 30% { box-shadow: 0 0 0 3px #34d399, 0 0 80px #34d399; } }
 @keyframes bt-hurt { 20% { transform: translateX(-8px); box-shadow: 0 0 0 3px #f43f5e, inset 0 0 80px rgba(244, 63, 94, .5); } 40% { transform: translateX(8px); } 60% { transform: translateX(-4px); } }


/* ---- はじける演出（アイテム） ---- */


@keyframes bt-ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(3.2); opacity: 0; } }

@keyframes bt-bemo { 0% { transform: scale(0) rotate(-30deg); } 35% { transform: scale(1.3) rotate(8deg); } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.4) translateY(-30px); opacity: 0; } }

@keyframes bt-part { from { transform: translate(0, 0) scale(.4); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1) rotate(200deg); opacity: 0; } }

/* ---- 相手に当たった（右がわ） ---- */

 
 @keyframes bt-sonar { to { transform: scale(22); opacity: 0; } }

/* ---- 💣 ばくだん ---- */

 @keyframes bt-tick { to { transform: scale(1.12) rotate(-8deg); } }
 
 
  

/* ---- それぞれのエフェクトの仕上げ ---- */

 


@keyframes bt-glitch { 0% { clip-path: inset(0 0 0 0); transform: translate(0); } 25% { clip-path: inset(20% 0 30% 0); transform: translate(-6px, 1px); } 50% { clip-path: inset(60% 0 5% 0); transform: translate(5px, -1px); } 75% { clip-path: inset(5% 0 70% 0); transform: translate(-3px, 2px); } }
   
@keyframes bt-ghost { 0%, 100% { opacity: 1; filter: none; } 45%, 60% { opacity: .03; filter: blur(4px); } }

 

 


 @keyframes bt-suckq { 50% { transform: scale(.92) rotate(-3deg); filter: blur(1px); } 100% { transform: none; } }
/* 💤 まぶた */
  
@keyframes bt-blink-lid { 0%, 100% { transform: scaleY(.25); } 40%, 60% { transform: scaleY(.98); } 70% { transform: scaleY(.4); } }
  

/* 🪞 かがみ */

/* 🦖 きょうりゅう */
 
@keyframes bt-dino-walk { from { transform: translateX(-260px); } to { transform: translateX(calc(100cqw + 60px)); } } @keyframes bt-stomp { to { transform: scaleX(-1) translateY(-18px) rotate(4deg); } }


/* ⏱️ 時計 */

  
@keyframes bt-hand { to { transform: rotate(360deg); } }
/* 🦝 どろぼう */
  
@keyframes bt-run { to { transform: translateX(calc(100cqw + 260px)); } }

@keyframes bt-stamp { 0% { transform: translate(-50%, -50%) rotate(-12deg) scale(3); opacity: 0; } 20% { transform: translate(-50%, -50%) rotate(-12deg) scale(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }


/* ---- 🎮 バトル: AI 練習のボタン・強さ ---- */

    

/* ---- 📱 スマホ（たて）: 相手は上の細い帯、自分は大きく、手札は小さめのカード ---- */

/* スマホ（よこ）・低い画面: 左右のまま、すき間をつめる */


/* ---- 🎮 バトル: ライトテーマ・デザインの色が入りこまないようにする（白い背景に白い文字を防ぐ） ---- */








/* 相手・強さを選ぶ小さな画面（サイトのポップアップの中）も、読みやすい色に */
.modal .bt-mode { color: var(--text); } .modal .bt-mode small { color: var(--muted); }
html[data-theme=light] .modal .bt-who .bt-mode.lv-1 b { color: #15803d; } html[data-theme=light] .modal .bt-who .bt-mode.lv-2 b { color: #0369a1; } html[data-theme=light] .modal .bt-who .bt-mode.lv-3 b { color: #b45309; } html[data-theme=light] .modal .bt-who .bt-mode.lv-4 b { color: #be123c; }
html[data-theme=light] .modal .bt-mode.on { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---- カードの説明: 一覧ではぜんぶ読めるように ---- */
 
/* ---- カードをタップしたときの説明（大きく全文 → 使う） ---- */

@keyframes bt-flash-in { from { opacity: 0; } }

@keyframes bt-bemo-in { from { transform: scale(.6) rotate(-6deg); opacity: 0; } }
   

 


 

/* ---- 🎮 バトル: 戦績・図鑑・観戦 ---- */


 



 
 
    
  



   
 
  
  
 
  
  


   
 

 
 


/* ---- 🎯 ミッション ---- */
  

    
 
 

.bk-list { display: flex; flex-direction: column; gap: 4px; } .bk-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
/* ---- 🏅 ランク・😂 スタンプ・🔁 再戦 ---- */


  


@keyframes bt-emo { 0% { transform: translateY(40px) scale(.3); opacity: 0; } 20% { transform: translateY(0) scale(1.15); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-160px) scale(.9); opacity: 0; } }
   

   


   

/* ---- 🐉 週替わりボス ---- */
.boss-ban { --bc: #ef4444; position: relative; overflow: hidden; width: 100%; display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 12px 16px; border-radius: 18px; text-align: left; color: #fff; border: 1px solid color-mix(in srgb, var(--bc) 60%, transparent); background: radial-gradient(120% 140% at 0% 50%, color-mix(in srgb, var(--bc) 55%, transparent), transparent 60%), linear-gradient(120deg, #140b1e, #0b0b1a); box-shadow: 0 12px 34px -16px var(--bc); }
.boss-ban .boss-em { font-size: 44px; filter: drop-shadow(0 0 14px var(--bc)); animation: boss-breath 2.4s ease-in-out infinite; } @keyframes boss-breath { 50% { transform: scale(1.08) rotate(-4deg); } }
.boss-ban .boss-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; } .boss-ban b { font-size: 16px; font-weight: 900; } .boss-ban small { font-size: 11.5px; opacity: .85; }
.boss-hp { height: 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; margin-top: 3px; } .boss-hp i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #ef4444, #f97316, #facc15); box-shadow: 0 0 12px #f97316; transition: width .8s; }
.boss-ban.dead .boss-em { filter: grayscale(.4) drop-shadow(0 0 14px #fbbf24); animation: none; transform: rotate(-90deg); } .boss-ban.dead .boss-hp i { width: 0 !important; }
.boss-hero { --bc: #ef4444; text-align: center; padding: 22px 16px 16px; border-radius: 22px; border: 2px solid var(--bc); background: radial-gradient(80% 90% at 50% 20%, color-mix(in srgb, var(--bc) 40%, transparent), transparent 70%), var(--surface); box-shadow: 0 0 60px -20px var(--bc); }
.boss-big { font-size: 120px; line-height: 1; filter: drop-shadow(0 0 30px var(--bc)); animation: boss-breath 2.4s ease-in-out infinite; } .boss-hero h2 { margin: 6px 0 2px; font-size: 26px; font-weight: 900; } .boss-hero p { margin: 4px 0; color: var(--muted); }
.boss-hero.dead .boss-big { transform: rotate(-90deg); animation: none; filter: grayscale(.5); }
.boss-bar { position: relative; height: 26px; margin: 14px auto 8px; max-width: 520px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; border: 1px solid var(--line-2); }
.boss-bar i { display: block; height: 100%; background: linear-gradient(90deg, #dc2626, #f97316, #facc15); box-shadow: 0 0 18px #f97316; } .boss-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 900; text-shadow: 0 1px 3px #000; }
.boss-win { color: #fbbf24 !important; font-weight: 900; font-size: 16px; }
/* 練習の問題の選び方 */
 
  

/* ---- 🃏 デッキ・🏫 ボスのクラス別 ---- */



 
.boss-cls { display: flex; flex-direction: column; gap: 6px; } .boss-cl { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); } .boss-cl span { font-weight: 900; color: #fb923c; } .boss-cl small { color: var(--muted); font-weight: 600; margin-left: 2px; }
#bgGrid .bg.got[data-bk] { cursor: pointer; } #bgGrid .bg.got[data-bk]:hover { outline: 2px solid var(--accent); }


/* ---- 🐉 ボスバトル ---- */
.boss-go { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%; margin-top: 14px; padding: 14px; border-radius: 18px; border: 0; color: #fff; font-size: 19px; font-weight: 900; letter-spacing: .04em; background: linear-gradient(90deg, #b91c1c, #f97316, #b91c1c); background-size: 200% 100%; animation: boss-go 3s linear infinite; box-shadow: 0 0 34px -6px #f97316; }
.boss-go small { font-size: 11.5px; font-weight: 700; opacity: .9; } .boss-go:disabled { opacity: .5; } @keyframes boss-go { to { background-position: -200% 0; } }
.bb-view { --bc: #ef4444; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.bb-em { font-size: 130px; line-height: 1; filter: drop-shadow(0 0 30px var(--bc)); animation: boss-breath 2.4s ease-in-out infinite; } .bb-view b { font-size: 20px; font-weight: 900; } .bb-view .boss-bar { width: 100%; margin: 6px 0; } .bb-view small { color: var(--muted); font-weight: 700; } .bb-tip { color: #fb923c !important; }
 @keyframes bb-hit { 20% { transform: translateX(-14px) rotate(-10deg) scale(.92); filter: brightness(2.5) drop-shadow(0 0 30px #fff); } 50% { transform: translateX(10px) rotate(6deg); } }
.bb-dmg { position: absolute; left: 50%; top: 30%; z-index: 30; transform: translateX(-50%); font-size: 40px; font-weight: 900; color: #fbbf24; text-shadow: 0 0 16px #f97316, 0 3px 0 #7c2d12; pointer-events: none; animation: bt-delta 1.2s ease-out forwards; }
@media (max-width: 600px) { .bb-em { font-size: 64px; } .bb-view b { font-size: 15px; } .bb-view .bb-tip { display: none; } }

/* =====================================================================
   🐉 ボスバトル（raid.js / raid_art.js）
   ===================================================================== */
.ra { width: 100%; height: 100%; display: block; overflow: visible; }
.ra .ra-eye { animation: ra-eye 3.2s ease-in-out infinite; } @keyframes ra-eye { 0%, 92%, 100% { opacity: 1; } 95% { opacity: .15; } }
.ra .ra-wing { animation: ra-wing 1.6s ease-in-out infinite; } .ra .ra-wing.r { animation-name: ra-wingr; } @keyframes ra-wing { 50% { transform: rotate(-12deg) translateY(-4px); } } @keyframes ra-wingr { 50% { transform: rotate(12deg) translateY(-4px); } }
.ra .ra-tent { animation: ra-tent 2.6s ease-in-out infinite; } @keyframes ra-tent { 50% { transform: rotate(6deg); } }
.ra .ra-float { animation: ra-float 3s ease-in-out infinite; } @keyframes ra-float { 50% { transform: translateY(-8px); } }
.ra .ra-glow { animation: ra-glow 1.8s ease-in-out infinite; } @keyframes ra-glow { 50% { opacity: .55; filter: brightness(1.5); } }

 @keyframes rd-flinch { 20% { transform: translateX(-18px) rotate(-6deg); filter: brightness(3) drop-shadow(0 0 40px #fff); } 50% { transform: translateX(12px) rotate(4deg); } }
 @keyframes rd-lunge { 30% { transform: scale(1.18) translateY(14px); filter: brightness(1.3) drop-shadow(0 0 50px var(--bc)); } }
   
@keyframes rd-glow { 50% { filter: drop-shadow(0 0 60px var(--gc)) brightness(1.4); transform: scale(1.06); } }


/* ロビー・説明 */



  
 
 

  

  

  



/* 対戦中 */




 

 
 
     
 

 
@keyframes rd-mv { 0% { transform: translate(-50%, 30px) scale(.4); opacity: 0; } 20% { transform: translate(-50%, 0) scale(1.1); opacity: 1; } 75% { opacity: 1; } 100% { transform: translate(-50%, -20px); opacity: 0; } }

 
 

 
 
  


   
  
 
 

 @keyframes rd-slash { from { transform: translateX(-100%); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
 


.boss-ban .boss-em.rd-art { width: 64px; height: 64px; font-size: 44px; animation: boss-breath 2.4s ease-in-out infinite; } .boss-ban .boss-em .ra { width: 64px; height: 64px; }
.boss-hero .boss-big.rd-art { width: 220px; height: 220px; margin: 0 auto; font-size: 120px; }

/* 🎮 3D のボス */
 
 
 


/* ---- 🃏 ボス戦の手札 ---- */



  
  
 
   


 

.rd-art.rd-3d > .rd-svg, .boss-big.rd-3d > svg { display: none; } .rd-art.rd-3d-fail > .rd-svg, .boss-big.rd-3d-fail > svg { display: block; }

.boss-hero .boss-big.rd-art.rd-3d { width: min(320px, 80vw); height: min(320px, 80vw); }
.boss-hero.dead .boss-big.rd-3d { transform: none; filter: none; }
.boss-hist { display: grid; gap: 8px; } .boss-h { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border-left: 4px solid var(--bc); opacity: .85; }
.boss-h .em { grid-row: span 2; font-size: 28px; text-align: center; } .boss-h small { opacity: .8; } .boss-h.won { opacity: 1; background: linear-gradient(90deg, color-mix(in srgb, var(--bc) 18%, transparent), rgba(255, 255, 255, .04)); }
 



.boss-weak { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .45); font-weight: 700; }

.boss-weak small { display: block; font-weight: 500; opacity: .8; margin-top: 2px; }
.bdx-view { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 14px; align-items: center; margin-bottom: 12px; padding: 12px; border-radius: 18px; background: radial-gradient(60% 70% at 30% 60%, color-mix(in srgb, var(--bc, #a855f7) 25%, transparent), rgba(255, 255, 255, .03)); }
.bdx-art { width: 100%; aspect-ratio: 1; } .bdx-art .rd-svg svg { width: 100%; height: 100%; } .bdx-art.sil:not(.rd-3d) .rd-svg { filter: brightness(0) drop-shadow(0 0 12px var(--bc)); }
.bdx-info h3 { margin: 0 0 6px; font-size: 22px; } .bdx-info p { margin: 4px 0; }
.bdx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.bdx { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: inherit; cursor: pointer; font: inherit; }
.bdx .bdx-pic { width: 70px; height: 70px; font-size: 44px; display: grid; place-items: center; } .bdx .bdx-pic svg { width: 100%; height: 100%; }
.bdx:not(.got):not(.now) .bdx-pic { filter: brightness(0) drop-shadow(0 0 6px var(--bc)); opacity: .8; }
.bdx.got { border-color: color-mix(in srgb, var(--bc) 60%, transparent); } .bdx.now { border-color: #f59e0b; } .bdx.on { outline: 2px solid var(--bc); background: color-mix(in srgb, var(--bc) 18%, transparent); }
.bdx small { font-size: 11px; opacity: .75; }
@media (max-width: 600px) { .bdx-view { grid-template-columns: 1fr; text-align: center; } .bdx-art { max-width: 260px; margin: 0 auto; } }

 

@keyframes bt-tro { 0% { transform: scale(0) rotate(-30deg); } 100% { transform: scale(1) rotate(0); } }


/* 🎰 正解ガチャ */
.ga-box { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 16px; align-items: center; }
.ga-stage { min-height: 260px; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(60% 60% at 50% 50%, rgba(168, 85, 247, .25), transparent 70%); }
.ga-back { font-size: 110px; filter: drop-shadow(0 0 20px #a855f7); } .ga-back.spin { animation: ga-spin .35s linear infinite; }
@keyframes ga-spin { from { transform: rotateY(0); } to { transform: rotateY(360deg); } }
.ga-res { display: flex; flex-direction: column; align-items: center; gap: 8px; animation: ga-pop .5s cubic-bezier(.3, 1.6, .5, 1); } .ga-res b { font-size: 14px; }
.ga-res.lv3 .bt-card { box-shadow: 0 0 30px #fde047; } @keyframes ga-pop { from { transform: scale(.3) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ga-side { display: flex; flex-direction: column; gap: 8px; } .ga-tk { font-size: 22px; font-weight: 800; }
@media (max-width: 600px) { .ga-box { grid-template-columns: 1fr; } .ga-stage { min-height: 220px; } }
/* 🎯 クラス目標ゲージ */
.rm-goal { margin: 0 0 10px; padding: 10px 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent, #6366f1) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 35%, transparent); }
.rm-goal-h { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 800; margin-bottom: 6px; }
.rm-goal-bar { height: 12px; border-radius: 99px; background: rgba(127, 127, 127, .2); overflow: hidden; } .rm-goal-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22c55e, #facc15); transition: width .8s; }
.rm-goal.done .rm-goal-bar i { background: linear-gradient(90deg, #f59e0b, #ef4444, #a855f7); }
/* ⏱️ 30秒タイムアタック */
.ta-modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ta-mode { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2, rgba(127, 127, 127, .06)); color: inherit; font: inherit; cursor: pointer; } .ta-mode small { opacity: .7; }
.ta-play { display: flex; flex-direction: column; gap: 10px; } .ta-top { display: flex; justify-content: space-between; font-size: 20px; font-weight: 800; } .ta-t { font-variant-numeric: tabular-nums; }
.ta-bar { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .2); overflow: hidden; } .ta-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e); }
.ta-q { font-size: 34px; font-weight: 900; text-align: center; padding: 14px 0; font-variant-numeric: tabular-nums; } .ta-q.ok { animation: ta-ok .3s; } .ta-q.ng { animation: ta-ng .3s; color: #ef4444; }
@keyframes ta-ok { 50% { transform: scale(1.12); color: #22c55e; } } @keyframes ta-ng { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.ta-f { display: flex; gap: 8px; } .ta-f .input { flex: 1; font-size: 20px; text-align: center; }
.ta-end { text-align: center; } .ta-big { font-size: 48px; font-weight: 900; } .ta-end.nb .ta-big { color: #f59e0b; text-shadow: 0 0 20px rgba(245, 158, 11, .5); }
/* 🎲 復習ビンゴ */
.bg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 420px; margin: 0 auto; }
.bg-c { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2, rgba(127, 127, 127, .06)); color: inherit; font: inherit; font-size: 11.5px; line-height: 1.3; cursor: pointer; overflow: hidden; }
.bg-c small { font-weight: 800; opacity: .7; } .bg-c span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bg-c.open { font-size: 34px; background: color-mix(in srgb, #22c55e 18%, transparent); border-color: #22c55e; cursor: default; } .bg-c.free { background: color-mix(in srgb, #f59e0b 16%, transparent); border-color: #f59e0b; }
.bg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 10px auto 0; max-width: 420px; }
.bg-q { margin-top: 10px; } .bg-qq { font-weight: 700; margin-bottom: 8px; } .bg-f { display: flex; gap: 8px; } .bg-f .input { flex: 1; }
/* 📝 問題文の中の表・上つき */
.q-tbl { border-collapse: collapse; margin: 6px 0; font-size: .95em; } .q-tbl th, .q-tbl td { border: 1px solid var(--line, rgba(127, 127, 127, .35)); padding: 3px 10px; text-align: center; } .q-tbl th { background: rgba(127, 127, 127, .12); }
sup { font-size: .7em; }
/* 🚫 端末バン */
.dv-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(127, 127, 127, .06); margin-bottom: 6px; } .dv-row span { display: flex; flex-direction: column; min-width: 0; } .dv-row small { opacity: .7; overflow-wrap: anywhere; } .dv-row.ban { background: rgba(239, 68, 68, .1); }

/* 📝 単元テストは全画面（✏️ ペン・🧮 計算用紙） */
#utRun.ut-full { position: fixed; inset: 0; z-index: 950; margin: 0; border-radius: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg, #0b0b1e); padding-bottom: 50vh; }
#utRun.ut-full > .card-body { max-width: 860px; margin: 0 auto; }
body.ut-open { overflow: hidden; } body.ut-open .side, body.ut-open .mobile-bar { visibility: hidden; }
.ut-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg, #0b0b1e) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.ut-bar-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50vw; }
.ut-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ut-tb { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface, rgba(127, 127, 127, .1)); color: inherit; font: inherit; font-weight: 700; cursor: pointer; } .ut-tb.on { background: #6366f1; border-color: #6366f1; color: #fff; }
.ut-pens { display: inline-flex; gap: 4px; align-items: center; } .ut-pens button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent; background: var(--c, transparent); cursor: pointer; font-size: 15px; } .ut-pens button.on { border-color: #fff; box-shadow: 0 0 0 2px #6366f1; }
.ut-ink { position: absolute; left: 0; top: 0; z-index: 3; }
#utRun.ut-inking .ut-ink { cursor: crosshair; } #utRun.ut-inking > .card-body { outline: 2px dashed rgba(99, 102, 241, .5); outline-offset: -2px; }
.ut-sheet { position: fixed; left: 0; right: 0; bottom: 0; height: 46vh; z-index: 960; display: flex; flex-direction: column; background: #fffef5; color: #111; border-top: 3px solid #6366f1; box-shadow: 0 -10px 30px rgba(0, 0, 0, .35); padding-bottom: env(safe-area-inset-bottom); }
.ut-sheet-h { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #e5e7eb; } .ut-sheet-h small { flex: 1; color: #6b7280; }
.ut-paper { flex: 1; width: 100%; touch-action: none; background-image: linear-gradient(#e0e7ff 1px, transparent 1px), linear-gradient(90deg, #e0e7ff 1px, transparent 1px); background-size: 24px 24px; }
/* 💄 アイコンのアクセ */
.av:has(> .dco) { position: relative; overflow: visible; }
.av > .dco { position: absolute; top: -.62em; right: -.5em; font-size: .78em; font-style: normal; line-height: 1; pointer-events: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); transform: rotate(14deg); }
.av.sm > .dco { font-size: .85em; } .av.lg > .dco { font-size: .62em; }
.av.dc-spark > .dco { animation: dco-tw 1.6s ease-in-out infinite; } @keyframes dco-tw { 50% { transform: rotate(14deg) scale(1.25); opacity: .7; } }
.av > .dco { font-size: 17px; z-index: 3; top: -9px; right: -9px; } .av.sm > .dco { font-size: 13px; top: -7px; right: -7px; } .av.lg > .dco { font-size: 26px; top: -13px; right: -13px; }
.shop-item .av > .dco { font-size: 22px; top: -12px; right: -12px; }
/* ポイントのページを軽く: 画面の外のショップの品は描かない・見本の枠のアニメは画面に入ったときだけ */
.shop-item { content-visibility: auto; contain-intrinsic-size: auto 120px; }

/* ================= 🎪 あそぶ ================= */
  
 
   
 
/* たまご */
.egg { display: inline-block; width: 64px; height: 80px; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%; background: radial-gradient(circle at 35% 30%, #fff 0 12%, transparent 13%), radial-gradient(circle at 60% 65%, color-mix(in srgb, var(--pc, #a78bfa) 60%, #fff) 0 10%, transparent 11%), radial-gradient(circle at 30% 70%, color-mix(in srgb, var(--pc, #a78bfa) 50%, #fff) 0 7%, transparent 8%), linear-gradient(160deg, #fff, color-mix(in srgb, var(--pc, #a78bfa) 45%, #fff)); box-shadow: inset -6px -8px 14px rgba(0,0,0,.15), 0 8px 16px -6px var(--pc, #a78bfa); animation: egg-wob 2.4s ease-in-out infinite; }
@keyframes egg-wob { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-8deg); } 82% { transform: rotate(7deg); } 88% { transform: rotate(-4deg); } }

    
 
/* ペットの画面 */

  
 
  


    
   
 

/* 部屋（背景） */
.room-sakura { background: linear-gradient(180deg, #ffe4f1, #fbcfe8 60%, #a7f3d0) !important; color: #3b0a24; } .room-sea { background: linear-gradient(180deg, #bae6fd, #7dd3fc 55%, #fde68a) !important; color: #082f49; } .room-candy { background: repeating-linear-gradient(45deg, #fce7f3 0 20px, #ede9fe 20px 40px) !important; color: #4a044e; } .room-space { background: radial-gradient(2px 2px at 20% 30%, #fff, transparent), radial-gradient(2px 2px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), linear-gradient(180deg, #0b1026, #312e81) !important; color: #e0e7ff; } .room-castle { background: linear-gradient(180deg, #fef3c7, #fcd34d 60%, #92400e) !important; color: #451a03; }
   
   
     
 
  @keyframes evo-in { from { opacity: 0; } } @keyframes evo-spin { from { transform: scale(.2) rotate(-720deg); filter: brightness(10); } }
/* 🗺️ すごろく */
 
    


    
      
  @keyframes sg-hop { 50% { margin-top: -18px; } }

 

     
 @keyframes sg-spin { to { transform: rotateX(360deg) rotateY(720deg); } }
     
    
/* 🎟️ シーズン */
.ss-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 18px; } .ss-now .pl-bar { flex: 1; min-width: 160px; height: 14px; }
.ss-track { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ss-t { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface, rgba(127,127,127,.06)); text-align: center; } .ss-t .n { position: absolute; top: 6px; left: 8px; font-size: 11px; font-weight: 900; opacity: .6; } .ss-t .e { font-size: 30px; } .ss-t small { font-size: 11.5px; }
.ss-t.lock { opacity: .45; filter: grayscale(.6); } .ss-t.can { border-color: #ec4899; box-shadow: 0 0 0 2px rgba(236,72,153,.3); animation: ss-glow 1.6s ease-in-out infinite; } .ss-t.got { background: color-mix(in srgb, #22c55e 14%, transparent); } .ss-t.got b { color: #22c55e; } .ss-t.big { background: linear-gradient(160deg, rgba(168,85,247,.18), rgba(236,72,153,.12)); } @keyframes ss-glow { 50% { box-shadow: 0 0 0 5px rgba(236,72,153,.15); } }
/* 🧩 謎解き */
.esc-wait { text-align: center; padding: 40px 10px; } .esc-door { font-size: 90px; animation: egg-wob 1.6s ease-in-out infinite; }
.esc-room { padding: 18px; border-radius: 24px; background: radial-gradient(70% 60% at 50% 0%, rgba(251,191,36,.18), transparent 60%), linear-gradient(180deg, #1c1917, #292524); color: #f5f5f4; border: 1px solid #44403c; } .esc-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; } .esc-story { font-size: 15px; line-height: 1.7; opacity: .9; }
.esc-doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0; } .esc-d { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border-radius: 16px 16px 6px 6px; border: 2px solid #78350f; background: linear-gradient(180deg, #78350f, #451a03); color: #fde68a; font: inherit; cursor: pointer; } .esc-d .ic { font-size: 34px; } .esc-d small { opacity: .8; font-size: 11.5px; } .esc-d.ok { background: linear-gradient(180deg, #166534, #14532d); border-color: #22c55e; color: #dcfce7; cursor: default; }
.esc-final { padding: 14px; border-radius: 16px; text-align: center; background: rgba(0,0,0,.35); border: 2px dashed #57534e; } .esc-final.open { border-color: #fbbf24; } .esc-room.fin .esc-final { background: linear-gradient(180deg, #fde68a, #fb923c); color: #451a03; border-style: solid; } .esc-out { font-size: 30px; font-weight: 900; }
.esc-q .esc-qt { font-size: 15px; line-height: 1.7; } .esc-q form { display: flex; gap: 8px; } .esc-q form .input { flex: 1; } .esc-hint { padding: 8px 10px; border-radius: 10px; background: rgba(251,191,36,.15); } .shake { animation: ta-ng .3s; }
/* 🧑‍🏫 先生チャレンジ */
.t-room { display: flex; flex-direction: column; gap: 10px; } .t-top { display: flex; justify-content: space-between; align-items: center; } .t-log { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; padding: 10px; border-radius: 18px; background: linear-gradient(180deg, #14532d, #052e16); }
.t-msg { max-width: 85%; padding: 10px 12px; border-radius: 16px; } .t-msg p { margin: 4px 0 0; white-space: pre-wrap; } .t-msg.me { align-self: flex-end; background: #fef9c3; color: #422006; } .t-msg.yu { align-self: flex-start; background: #fff; color: #111827; } .t-msg.wait p { opacity: .6; }
.t-ev { margin-top: 6px; padding-top: 6px; border-top: 1px dashed #d1d5db; display: flex; flex-direction: column; gap: 2px; font-size: 14px; } .t-ev small { font-size: 12px; color: #374151; }
.t-f { display: flex; gap: 8px; align-items: flex-end; } .t-f .textarea { flex: 1; } .t-done { text-align: center; padding: 14px; border-radius: 16px; background: var(--surface, rgba(127,127,127,.08)); } .t-done .big { font-size: 34px; }
/* 🏟️ バトルのアリーナ（作った人の背景） */
    
.shop-theme { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 30px; } .shop-theme.th-sakura { background: linear-gradient(135deg, #fbcfe8, #a7f3d0); } .shop-theme.th-sea { background: linear-gradient(135deg, #7dd3fc, #1e3a8a); } .shop-theme.th-volcano { background: linear-gradient(135deg, #f97316, #450a0a); } .shop-theme.th-space { background: linear-gradient(135deg, #312e81, #020617); } .shop-theme.th-neon { background: linear-gradient(135deg, #ec4899, #22d3ee); } .shop-theme.th-candy { background: repeating-linear-gradient(45deg, #fce7f3 0 8px, #ede9fe 8px 16px); } .shop-theme.th-castle { background: linear-gradient(135deg, #fde68a, #92400e); }
.bdx-rs { margin-top: 8px; padding: 10px; border-radius: 14px; background: rgba(127,127,127,.08); display: flex; flex-direction: column; gap: 6px; } .bdx-lore { margin: 0; font-size: 13px; } .bdx-lore.lock { opacity: .55; }
    


/* ================= 🗺️ すごろく（全画面の大きな地図） ================= */
 
.sgw { position: fixed; inset: 0; z-index: 900; overflow: auto; -webkit-overflow-scrolling: touch; background: #86efac; cursor: grab; } .sgw.drag { cursor: grabbing; }








 

    
 
 


 
  
  
    
  @keyframes sgw-hop { 50% { margin-top: -30px; } }
 
  
   
  

/* 🥚 ペットの専用ページ: 大きく */
 

.sgw3d { position: fixed; inset: 0; z-index: 900; background: #9be7ff; } .sg3d-cv { display: block; width: 100% !important; height: 100% !important; }
.sg3d-load { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); padding: 12px 20px; border-radius: 16px; background: rgba(0,0,0,.55); color: #fff; font-weight: 800; z-index: 2; }
.bubble.code { max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.45; -webkit-overflow-scrolling: touch; }

/* 🗺️ すごろく v2 */




 
 @keyframes sg-area { 0% { opacity: 0; transform: translate(-50%, -20px) scale(.9); } 15%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -10px); } }


  
 
  
 
  
  


    

/* 🎫 チケット */
.tk-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800; text-align: center; } .tk-badge.urgent { background: #b91c1c; animation: ss-glow 1.4s infinite; }
.tk-wrap { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.tk-side { display: flex; flex-direction: column; gap: 8px; } .tk-note { font-size: 12px; margin: 0; }
.tk-item { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface, rgba(127,127,127,.06)); color: inherit; font: inherit; cursor: pointer; }
.tk-item.on { border-color: var(--accent, #6366f1); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #6366f1) 30%, transparent); } .tk-item small { opacity: .7; font-size: 12px; } .tk-item .dot { position: absolute; top: 10px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; }
.tk-tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(127,127,127,.15); } .tk-tag.urgent { background: #fee2e2; color: #b91c1c; } .tk-tag.human { background: #dbeafe; color: #1d4ed8; } .tk-tag.ai { background: #ede9fe; color: #6d28d9; } .tk-tag.closed { opacity: .7; }
.tk-main { min-height: 60vh; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface, rgba(127,127,127,.04)); display: flex; flex-direction: column; gap: 10px; }
.tk-form { display: flex; flex-direction: column; gap: 6px; } .tk-form h2 { margin: 0 0 6px; } .tk-direct { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 4px; } .tk-fbtn { margin-top: 6px; }
.tk-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .tk-head h2 { margin: 0 0 4px; font-size: 19px; } .tk-hbtn { display: flex; gap: 6px; align-items: flex-start; } .tk-reason { margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(127,127,127,.1); font-size: 12.5px; }
.tk-msgs { flex: 1; display: flex; flex-direction: column; gap: 10px; max-height: 58vh; overflow: auto; padding: 4px; }
.tk-m { max-width: 82%; padding: 9px 12px; border-radius: 14px; background: rgba(127,127,127,.1); align-self: flex-start; } .tk-m small { display: block; opacity: .7; font-size: 11.5px; margin-bottom: 2px; } .tk-m div { white-space: normal; overflow-wrap: anywhere; }
.tk-m.ai { background: color-mix(in srgb, #8b5cf6 14%, transparent); } .tk-m.staff { background: color-mix(in srgb, #3b82f6 16%, transparent); } .tk-m.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent, #22c55e) 18%, transparent); }
.tk-send { display: flex; gap: 8px; align-items: flex-end; } .tk-send .textarea { flex: 1; }
@media (max-width: 760px) { .tk-wrap { grid-template-columns: 1fr; } .tk-main { min-height: 50vh; } }

/* 📎 ファイルのメッセージ */
.bubble.file { display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 300px; text-decoration: none; color: inherit; } .bubble.file .fi-ic { font-size: 30px; } .bubble.file .fi-tx { display: flex; flex-direction: column; min-width: 0; } .bubble.file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .bubble.file small { opacity: .75; font-size: 11.5px; }

/* ✍️ 文字のかざり・🔗 プレビュー・🌐 翻訳・🤖 まとめ */
.bubble code.ic { font: 12.5px/1.4 ui-monospace, Menlo, monospace; background: rgba(127,127,127,.18); padding: 1px 5px; border-radius: 5px; }
.lp-card { display: flex; flex-direction: column; gap: 2px; max-width: 300px; margin-top: 4px; padding: 8px 11px; border-radius: 12px; border: 1px solid var(--line, #ddd); border-left: 4px solid var(--accent, #6366f1); background: var(--card, #fff); color: inherit; text-decoration: none; font-size: 13px; }
.lp-card small { opacity: .7; font-size: 11px; } .lp-card b { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .lp-card span { opacity: .8; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.m.me .lp-card { margin-left: auto; }
.m-tr { max-width: 300px; margin-top: 4px; padding: 6px 10px; border-radius: 10px; background: rgba(99,102,241,.1); font-size: 13px; white-space: pre-wrap; } .m.me .m-tr { margin-left: auto; }
.sum-box { white-space: pre-wrap; line-height: 1.7; }

/* 🗺️ すごろく: 止まったマスでできること */
 

/* ⏳ 画面を切りかえるときの読みこみ中 */
.navwait { position: fixed; inset: 0; z-index: 99999; pointer-events: none; }
.navwait .nw-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; opacity: 0; transition: opacity .2s; padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box; }
.navwait .nw-bar i { display: block; height: 3px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-hi, var(--accent))); box-shadow: 0 0 10px var(--accent); border-radius: 0 3px 3px 0; }
.navwait.bar .nw-bar { opacity: 1; }
.navwait.bar .nw-bar i { animation: nwBar 8s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes nwBar { 0% { width: 0; } 10% { width: 35%; } 40% { width: 70%; } 100% { width: 92%; } }
.navwait .nw-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: 0; transition: opacity .25s; }
.navwait.screen .nw-screen { opacity: 1; pointer-events: auto; }
.nw-logo { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.nw-logo b { font: 800 30px/1 var(--font); color: var(--on-accent, #fff); width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-hi, var(--accent))); box-shadow: 0 10px 28px -8px var(--accent); animation: nwPulse 1.4s ease-in-out infinite; }
.nw-logo span { position: absolute; inset: 0; border-radius: 50%; border: 3px solid transparent; border-top-color: var(--accent); animation: nwSpin 1.1s linear infinite; }
.nw-logo span:nth-child(2) { inset: 8px; border-top-color: transparent; border-right-color: var(--accent-hi, var(--accent)); opacity: .7; animation-duration: 1.6s; animation-direction: reverse; }
.nw-logo span:nth-child(3) { inset: -8px; border-top-color: transparent; border-left-color: var(--accent); opacity: .35; animation-duration: 2.4s; }
.nw-t { margin: 6px 0 0; font-weight: 700; color: var(--text); font-size: 15px; }
.nw-tip { margin: 0; max-width: 300px; padding: 0 16px; text-align: center; font-size: 13px; color: var(--muted); min-height: 1.4em; opacity: 0; transition: opacity .4s; }
.navwait.slow .nw-tip { opacity: 1; }
@keyframes nwSpin { to { transform: rotate(360deg); } }
@keyframes nwPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(.92); } }
@media (prefers-reduced-motion: reduce) { .nw-logo span, .nw-logo b { animation: none; } .navwait.bar .nw-bar i { animation: none; width: 70%; } }
/* ⏳ ページの中の読みこみ中（ロゴのアニメーション） */
.vload { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 16px; min-height: 45vh; color: var(--muted); font-weight: 700; font-size: 14px; animation: vlIn .3s .12s both; }
.vload p { margin: 0; text-align: center; }
.vload.sm { min-height: 0; padding: 22px 8px; gap: 4px; font-size: 13px; }
.vload.sm .nw-logo { transform: scale(.62); margin: -14px; }
@keyframes vlIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sg3d-load { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.sg3d-load p { margin: 0; }
.sg3d-load .nw-logo b { color: #fff; }

/* 🐢 低速回線モード: 写真はタップで表示 */
.bubble.img-ph { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 160px; padding: 14px 16px; border: 1px dashed var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; text-align: left; }
.bubble.img-ph small { font-weight: 500; opacity: .7; font-size: 11.5px; }

/* 🐞 画面のエラー（運営） */
.je-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; } .je-row summary { cursor: pointer; display: flex; flex-direction: column; gap: 2px; } .je-row summary small { color: var(--muted); font-size: 12px; } .je-row pre { white-space: pre-wrap; font-size: 11px; max-height: 200px; overflow: auto; background: var(--surface-3); padding: 8px; border-radius: 8px; }

/* 📊 利用状況 */
.st-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; } .st-head h1 { margin: 0; flex: 1; font-size: 22px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.st-kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; } .st-kpi small { display: block; color: var(--muted); font-size: 12px; } .st-kpi b { font-size: 26px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.st-cols { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 18px; } .st-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; gap: 2px; }
.st-col i { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; } .st-cols.two .st-col { flex-direction: row; align-items: flex-end; } .st-cols.two .st-col i { width: 50%; } .st-cols.two .st-col i.b { background: #8b5cf6; }
.st-cols.two .st-col small { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; } .st-cols.two { margin-bottom: 20px; }
.st-col b { font-size: 11px; } .st-col small { font-size: 10.5px; color: var(--muted); } .st-cols.hrs { height: 110px; }
.st-leg span { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin: 0 4px 0 10px; vertical-align: middle; } .st-leg span.b { background: #8b5cf6; }
.st-bar { display: grid; grid-template-columns: 9em 1fr auto; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; } .st-bar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .st-bar i { display: block; height: 10px; background: var(--accent-soft, var(--accent)); border-radius: 6px; } .st-bar b { font-size: 12.5px; }

/* ❓ 使い方ツアー */
.tour { text-align: center; padding: 4px 4px 0; } .tour-e { font-size: 54px; line-height: 1.1; margin: 4px 0 6px; } .tour h3 { margin: 0 0 8px; font-size: 18px; } .tour p { margin: 0 auto; max-width: 420px; color: var(--muted); line-height: 1.7; font-size: 14px; min-height: 6.8em; }
.tour-dots { display: flex; justify-content: center; gap: 6px; margin: 14px 0; } .tour-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); } .tour-dots i.on { background: var(--accent); width: 20px; border-radius: 4px; }
.tour-btns { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }


/* 文字がパッパッとならないように: ページを開いたときの「上から順番に出てくる」動きはやめる（すぐ全部出す）。画面の切りかえアニメーションも使わない（左のバーに残像が出たため） */
.page > *, .page > *:nth-child(n) { animation: none !important; }

.st-tbl { width: 100%; border-collapse: collapse; font-size: 13px; } .st-tbl th, .st-tbl td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; } .st-tbl th:first-child, .st-tbl td:first-child { text-align: left; } .st-tbl th { color: var(--muted); font-weight: 600; font-size: 12px; }
.card-body:has(> .st-tbl) { overflow-x: auto; }

/* ⚡ 長いページは、画面に見えていないカードを見えるまで描かない（iPad の描く手間をへらす）。はみ出すメニューがあるカードは対象外 */
body:is([data-page="home"],[data-page="profile"],[data-page="points"],[data-page="members"],[data-page="report"],[data-page="stats"]) .page .card:not(:has(.pop, [data-pop], select, details[open])) { content-visibility: auto; contain-intrinsic-size: auto 260px; }

/* チャットなど画面いっぱいのページでは、下の著作権の一行を出さない（画面が上下に動いてしまうため） */
body:is([data-page="chat"],[data-page="ai"],[data-page="vivaai"],[data-page="ticket"],[data-page="sugoroku"],[data-page="world"]) .site-foot { display: none; }

/* 🗺️ すごろくの全体マップ */
.sgmap-m { align-items: stretch; }
.sgmap { background: var(--surface); color: var(--text); border-radius: 18px; width: min(1000px, 96vw); max-height: 92vh; display: flex; flex-direction: column; margin: auto; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.sgmap-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; } .sgmap-h > span { flex: 1; color: var(--muted); font-size: 13px; }
.sgmap-legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 14px; font-size: 12px; color: var(--muted); } .sgmap-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; } .sgmap-legend i.st { border: 2px solid #fbbf24; width: 8px; height: 8px; } .sgmap-legend i.me { background: rgba(239,68,68,.4); border: 2px solid #ef4444; width: 8px; height: 8px; }
.sgmap-wrap { overflow: auto; padding: 0 10px; flex: 1; -webkit-overflow-scrolling: touch; } .sgmap-wrap canvas { display: block; margin: 0 auto; cursor: pointer; }
.sgmap-tip { padding: 8px 14px; margin: 0; font-size: 12px; }


.bubble.voice .vt-btn { display: block; margin-top: 6px; border: 0; border-radius: 999px; padding: 4px 10px; font-size: 12px; background: rgba(255,255,255,.12); color: inherit; cursor: pointer; } .bubble.voice .vt-out { margin-top: 6px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; }

.ai-ibtn.rec, [data-dict].rec { color: #ef4444; animation: fireGlow 1.2s infinite; }

/* 🫥 Shift 3回で 周りを 消す（layout.php の vz-hide） */
html.vz-hide .side, html.vz-hide .mobile-bar, html.vz-hide .hub-tabs, html.vz-hide .site-foot, html.vz-hide .ship-clock { display: none !important; }
html.vz-hide .shell { grid-template-columns: minmax(0, 1fr) !important; }
html.vz-hide .main { padding-bottom: 16px !important; }

/* 📣 お知らせの 本文（# ## ### と - ） */
.ann-body { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.75; }
.ann-body p { margin: 4px 0; }
.ann-body ul { margin: 4px 0; padding-left: 1.4em; list-style: disc; }
.ann-body .ah1, .ann-body .ah2, .ann-body .ah3 { color: var(--text); font-weight: 700; margin: 10px 0 2px; line-height: 1.4; }
.ann-body .ah1 { font-size: 18px; } .ann-body .ah2 { font-size: 16px; } .ann-body .ah3 { font-size: 14.5px; }

/* ===== 🤖 AI の ページを 見やすく（2026-10-10）: VIVA先生（.ai-*）と VIVA AI（.va-*）。読む 列は 760px までの 1本・答えは 列いっぱい・文字は 16px ===== */
.ai-thread { padding: 20px 16px 12px; gap: 22px; min-height: 0; }
.ai-turn { width: min(760px, 100%); margin: 0 auto; gap: 12px; }
.ai-turn .ai-bub.me { max-width: 78%; font-size: 15.5px; line-height: 1.7; padding: 10px 16px; border-radius: 18px 18px 6px 18px; }
.ai-t-row { gap: 12px; }
.ai-t-row .ai-t-av { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; }
.ai-t-row .ai-bub.bot { flex: 1 1 auto; max-width: 100%; min-width: 0; padding: 0; }
.ai-turn .ai-a { font-size: 16px; line-height: 1.9; padding: 14px 18px; border-radius: 6px 18px 18px 18px; }
.ai-a .ai-h { font-size: 18px; line-height: 1.5; margin: 18px 0 6px; padding-left: 10px; }
.ai-a > .ai-h:first-child { margin-top: 2px; }
.ai-a .ai-gap { height: 10px; }
.ai-a .ai-li { gap: 10px; margin: 6px 0; }
.ai-a .ai-li.num > span { width: 1.7em; height: 1.7em; font-size: 12.5px; margin-top: 3px; }
.ai-a .ai-tbl-wrap { margin: 10px 0; }
.ai-a .ai-tbl { font-size: 15px; }
.ai-a .ai-tbl td, .ai-a .ai-tbl th { padding: 8px 14px; }
.ai-st { font-size: 12px; margin: 8px 0 0 4px; }
.ai-src { margin-top: 10px; }
.ai-top { margin-bottom: 10px; }
.ai-top-t b { font-size: 21px; }
.ai-top-t small { font-size: 13px; }
.ai-tabs a { padding: 8px 14px; font-size: 15px; }
.ai-bar { font-size: 14px; padding: 10px 16px; }
.ai-composer { width: min(760px, calc(100% - 24px)); margin: 6px auto 8px; border-radius: 22px; padding: 8px 10px 8px 12px; }
.ai-composer .ai-inrow .textarea { font-size: 16.5px; line-height: 1.6; padding: 4px 6px; min-height: 40px; }
.ai-tools { gap: 8px; margin-top: 2px; }
.ai-tools .ai-ibtn { min-width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }
.ai-composer .ai-send { width: 44px; height: 44px; border-radius: 14px; font-size: 18px; }
.ai-empty { max-width: 640px; gap: 10px; }
.ai-hello-g { font-size: clamp(24px, 3.2vw, 32px) !important; line-height: 1.3; }
@media (max-width: 640px) {
  .ai-thread { padding: 14px 10px 10px; gap: 18px; }
  .ai-turn .ai-a { padding: 12px 14px; font-size: 16px; }
  .ai-t-row .ai-t-av { display: none; }
  .ai-turn .ai-bub.me { max-width: 88%; }
  .ai-composer { width: calc(100% - 16px); margin: 6px auto 8px; } .ai-tools { gap: 6px; } .ai-tools .ai-ibtn { min-width: 36px; height: 36px; }
}

/* VIVA AI */
.va-card .card-body { padding: 0; }
.va-log { padding: 22px 16px 14px; gap: 14px; }
.va-log > * { width: min(760px, 100%); margin-left: auto; margin-right: auto; }
.va-log > .va-bub.me { margin-right: max(0px, calc((100% - 760px) / 2)); width: auto; max-width: min(78%, 600px); }
.va-log > .va-bub.bot { margin-left: max(0px, calc((100% - 760px) / 2)); width: auto; max-width: min(100%, 760px); }
.va-bub { font-size: 16px; line-height: 1.85; padding: 12px 16px; }
.va-bub.me { font-size: 15.5px; line-height: 1.7; border-radius: 18px 18px 6px 18px; }
.va-bub.bot { border-radius: 6px 18px 18px 18px; border: 1px solid var(--line); }
.va-hello { text-align: left; max-width: 760px; padding: 26px 4px 10px; }
.va-hello-ic { font-size: 30px; width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); margin-bottom: 12px; }
.va-hello > b { display: block; font-size: 22px; line-height: 1.4; }
.va-hello p { font-size: 15px; line-height: 1.8; margin: 8px 0 0; }
.va-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; justify-content: stretch; margin-top: 18px; }
.va-chips .btn { justify-content: flex-start; text-align: left; white-space: normal; height: auto; min-height: 46px; padding: 10px 14px; font-size: 14.5px; line-height: 1.45; border-radius: 14px; }
.va-form { width: min(760px, calc(100% - 24px)); margin: 6px auto 4px; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); box-shadow: 0 6px 24px -16px rgba(0, 0, 0, .5); }
.va-form:focus-within { border-color: var(--accent-line, var(--accent)); box-shadow: 0 0 0 3px var(--accent-soft); }
.va-form .textarea { border: 0; background: transparent; box-shadow: none; font-size: 16.5px; line-height: 1.6; padding: 8px 6px; min-height: 44px; }
.va-form .textarea:focus { outline: none; box-shadow: none; }
.va-form .btn-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; flex: none; }
.va-form #vaGo { height: 44px; padding: 0 18px; border-radius: 14px; font-size: 15px; flex: none; }
#vaPrev, .va-card .card-body > .faint { width: min(760px, calc(100% - 24px)); margin-left: auto; margin-right: auto; }
.va-card .card-body > .faint:last-child { margin-bottom: 12px; }
@media (max-width: 640px) {
  .va-log { padding: 14px 10px 10px; }
  .va-chips { display: flex; flex-wrap: wrap; gap: 6px; } .va-chips .btn { min-height: 38px; padding: 8px 12px; font-size: 14px; border-radius: 999px; }
  .va-form { width: calc(100% - 16px); }
}
@media (min-width: 761px) { .ai-pane { height: calc(100dvh - 192px); } }   /* VIVA先生: 上の 見出しと タブの 分を 引いて 入力欄が 画面に おさまるように */
@media (max-width: 760px) { html:not(.kb-open) .ai-pane { height: calc(100dvh - 252px); } }   /* スマホ: 下の メニューに 入力欄が かくれないように */
/* VIVA AI の 答えの 箇条書き: 「・」と 文を 横に ならべる（VIVA先生と 同じ） */
.va-bub .ai-li { display: flex; gap: 10px; margin: 6px 0; }
.va-bub .ai-li > span { flex: none; min-width: 1.4em; color: var(--accent-hi, var(--accent)); font-weight: 700; }
.va-bub .ai-li.num > span { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; margin-top: 3px; background: color-mix(in srgb, var(--accent) 18%, transparent); }
.va-bub .ai-p { margin: 0; } .va-bub .ai-gap { height: 8px; } .va-bub .ai-h { font-weight: 700; font-size: 17px; margin: 12px 0 4px; }
/* 上の タブ（VIVA AI・VIVA先生 など）が 見出しの ラベルより 下に もぐらないように: .page-head は z-index 30 なので それより 上に。すけない 背景と 下線も つける */
.hub-tabs { z-index: 40; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
html[data-design=glass] .hub-tabs { background: color-mix(in srgb, var(--bg) 88%, transparent) !important; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
