:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --surface: #ffffff;
  --soft: #f0eee7;
  --line: #ddd9cf;
  --text: #2b2a27;
  --sub: #6c6a63;
  --accent: #2f6fd6;
  --accent-bg: #e7f0fc;
  --accent-line: #9cc0f0;
  --ok: #2f7a12;
  --ok-bg: #e8f4dc;
  --ok-line: #9ccf6b;
  --warn: #8a5300;
  --warn-bg: #fbefd8;
  --warn-line: #f0b04a;
  --ng: #b0302f;
  --ng-bg: #fcebea;
  --ng-line: #ef9b9a;
  --ai: #5a4fc4;
  --ai-bg: #efedfe;
  --ai-line: #b5aef0;
  --star: #e8a400;
  /* 教科の色（国・算・理・社・英） */
  --kokugo: #b5443b;
  --math: #2f6fd6;
  --rika: #3b7d23;
  --shakai: #a8641a;
  --eigo: #6b4bb8;
  --radius: 14px;
  --font: 'M PLUS Rounded 1c', -apple-system, 'Hiragino Maru Gothic ProN', 'Hiragino Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
.boot { padding: 40vh 0; text-align: center; color: var(--sub); }

h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 18px; margin: 18px 0 8px; }
h3 { font-size: 16px; margin: 12px 0 6px; }
p { margin: 6px 0; }
.sub { color: var(--sub); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hidden { display: none !important; }

/* 部品 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.card.soft { background: var(--soft); border-color: transparent; }
.card.accent { background: var(--accent-bg); border-color: var(--accent-line); }
.card.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card.ng { background: var(--ng-bg); border-color: var(--ng-line); }
.card.ai { background: var(--ai-bg); border-color: var(--ai-line); }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 8px; background: var(--soft); color: var(--sub); white-space: nowrap; }
.tag.accent { background: var(--accent-bg); color: var(--accent); }
.tag.ok { background: var(--ok-bg); color: var(--ok); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.ng { background: var(--ng-bg); color: var(--ng); }
.tag.ai { background: var(--ai-bg); color: var(--ai); }

button, .btn {
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 46px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  touch-action: manipulation;
}
button:active, .btn:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; }
button.danger { color: var(--ng); border-color: var(--ng-line); }
button.ai, .btn.ai { color: var(--ai); border-color: var(--ai-line); background: var(--surface); }
button.ghost { border-color: transparent; background: transparent; color: var(--sub); }
button.block, .btn.block { width: 100%; }
button.big { min-height: 56px; font-size: 18px; }
a { color: var(--accent); }

input, select, textarea {
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
textarea { resize: none; }
label.field { display: block; margin: 10px 0; }
label.field > span { display: block; font-size: 13px; color: var(--sub); margin-bottom: 4px; }
.bar { height: 8px; border-radius: 5px; background: var(--soft); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.3s; }
.bar.ok > i { background: var(--ok-line); }
.bar.warn > i { background: var(--warn-line); }

/* ヘッダー */
.top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.top .back { min-height: 40px; padding: 6px 10px; border: none; background: transparent; color: var(--sub); }
.top .title { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.stars { color: var(--star); font-weight: 700; }

/* プロフィール選択 */
.who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.who button { flex-direction: column; min-height: 140px; font-size: 18px; font-weight: 700; }
.who .avatar { width: 72px; height: 72px; font-size: 44px; }

/* ノルマ */
.todo { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); width: 100%; text-align: left; justify-content: flex-start; }
.todo .check { font-size: 22px; flex: none; }
.todo .what { flex: 1; min-width: 0; }
.todo .what b { display: block; font-size: 15px; }
.todo.done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.todo.next { border-color: var(--accent-line); box-shadow: 0 0 0 2px var(--accent-bg); }
.menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.menu button { flex-direction: column; min-height: 92px; font-size: 14px; }
.menu button .icon { font-size: 30px; }

/* 解説 */
.explain p { line-height: 1.8; }
.point { background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 10px 0; }
.example { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.example .q { font-weight: 700; font-size: 17px; }
.example ol { margin: 6px 0; padding-left: 22px; }

/* 問題 */
.qbox { text-align: center; padding: 14px 4px 6px; }
.qbox .lead { color: var(--sub); font-size: 14px; }
.qbox .qtext { font-size: 24px; font-weight: 700; line-height: 1.7; word-break: break-word; }
.qbox .qtext.long { font-size: 17px; text-align: left; font-weight: 400; line-height: 1.8; }
.answer-row { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 10px 0; }
.answer-box { min-width: 60%; min-height: 54px; border: 2px solid var(--accent-line); border-radius: 12px; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 4px 10px; background: var(--surface); word-break: break-all; }
.answer-box.empty::after { content: ' '; }
.answer-box.ng { border-color: var(--ng-line); color: var(--ng); }
.answer-box.ok { border-color: var(--ok-line); color: var(--ok); }
.keypad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.keypad button { min-height: 54px; font-size: 22px; font-weight: 700; padding: 0; }
.keypad button.small { font-size: 15px; }
.keypad .blank { visibility: hidden; }
.choices { display: grid; gap: 8px; margin-top: 10px; }
.choices button { min-height: 56px; font-size: 18px; justify-content: flex-start; text-align: left; }
.choices button.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.choices button.ng { background: var(--ng-bg); border-color: var(--ng-line); color: var(--ng); }
.feedback { margin-top: 10px; }
.feedback ol { margin: 6px 0; padding-left: 22px; }

/* 分数 */
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: 0.85em; line-height: 1.1; margin: 0 2px; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.frac > span:last-child { padding: 0 3px; }

/* チャット */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.bubble { max-width: 88%; padding: 9px 12px; border-radius: 16px; line-height: 1.65; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent-bg); color: #163c7a; border-bottom-right-radius: 4px; }
.bubble.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.err { align-self: flex-start; background: var(--ng-bg); color: var(--ng); }
.bubble img { max-width: 180px; border-radius: 10px; display: block; margin-bottom: 4px; }
.bubble p { margin: 4px 0; }
.bubble ul, .bubble ol { margin: 4px 0; padding-left: 20px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.chips button { min-height: 36px; font-size: 13px; padding: 4px 10px; border-radius: 18px; white-space: nowrap; flex: none; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 8px 0 calc(env(safe-area-inset-bottom) + 4px); }
.composer .row textarea { min-height: 46px; max-height: 140px; border-radius: 22px; padding: 11px 14px; }
.composer .icon-btn { min-width: 46px; padding: 0; border-radius: 50%; font-size: 20px; }
.typing::after { content: '…'; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0.2; } }

/* オーバーレイ */
#overlay:empty { display: none; }
.cover { position: fixed; inset: 0; z-index: 50; background: rgba(245, 243, 238, 0.97); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cover .inner { max-width: 420px; width: 100%; text-align: center; }
.cover .big-icon { font-size: 64px; }
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px); max-height: 85dvh; overflow: auto; }
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%); background: #333; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 70; opacity: 0; pointer-events: none; transition: opacity 0.2s; max-width: 90vw; }
#toast.show { opacity: 1; }

/* PIN */
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 14px 0; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--accent); }
.pin-dots i.on { background: var(--accent); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 0 auto; }
.pinpad button { min-height: 60px; font-size: 24px; font-weight: 700; }

/* 結果 */
.result-head { text-align: center; padding: 10px 0; }
.result-head .emoji { font-size: 56px; }
.result-head .big { font-size: 26px; font-weight: 700; }
.mistake { border-top: 1px solid var(--line); padding: 8px 0; }

/* 保護者 */
.parent-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stat { background: var(--soft); border-radius: 10px; padding: 8px 10px; }
.stat .k { font-size: 12px; color: var(--sub); }
.stat .v { font-size: 20px; font-weight: 700; }
.card-sec { margin-top: 12px; }
.sec-k { font-size: 12px; color: var(--sub); margin-bottom: 4px; }
.lesson-tag { font-size: 13px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 2px; white-space: normal; }
.time-row { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.time-row button { flex: none; }
.alerts { margin: 6px 0 0; padding: 0; list-style: none; }
.alerts li { color: var(--ng); font-size: 13px; padding: 2px 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 46px 14px 1fr; gap: 0 6px; font-size: 14px; }
.timeline .tm { color: var(--sub); text-align: right; font-size: 13px; padding-top: 1px; }
.timeline .dot { display: flex; flex-direction: column; align-items: center; }
.timeline .dot i { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--line); }
.timeline .dot b { flex: 1; width: 2px; background: var(--line); margin-top: 2px; }
.timeline .ev { padding-bottom: 10px; min-width: 0; }
.timeline .ev details summary { cursor: pointer; }
.timeline .good .dot i { background: var(--ok-line); }
.timeline .warn .dot i { background: var(--warn-line); }
.timeline .bad .dot i { background: var(--ng); }
.timeline .bad .ev { color: var(--ng); }
.timeline .ai .dot i { background: var(--ai); }
.timeline .ai .ev { color: var(--ai); }
.timeline .muted .ev { color: var(--sub); font-size: 13px; }
.timeline .normal .dot i { background: var(--accent); }
table.items { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
table.items td, table.items th { border-bottom: 1px solid var(--line); padding: 4px; text-align: left; vertical-align: top; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: 13px; }
.cal .h { color: var(--sub); font-size: 12px; }
.cal button { min-height: 44px; padding: 0; border-radius: 9px; position: relative; font-size: 14px; }
.cal .done { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.cal .partial { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.cal .none { background: var(--soft); color: var(--sub); }
.cal .future { background: transparent; border-color: transparent; color: var(--line); }
.cal .alert::after { content: ''; position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--ng); }
.cal .today { outline: 2px solid var(--accent); }
.photo { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.unit { margin-bottom: 8px; }
.unit summary { list-style: none; cursor: pointer; }
.unit summary::-webkit-details-marker { display: none; }
.lesson-row { display: flex; align-items: center; gap: 8px; padding: 10px 4px; border-top: 1px solid var(--line); width: 100%; background: none; border-left: none; border-right: none; border-bottom: none; border-radius: 0; min-height: 48px; text-align: left; justify-content: flex-start; }
.code-big { font-size: 46px; font-weight: 700; letter-spacing: 14px; text-align: center; border: 3px dashed var(--line); border-radius: 14px; padding: 8px 0 8px 14px; background: var(--surface); }

/* ---------- 段階2（全教科） ---------- */

/* 教科のマーク */
.sj { display: inline-flex; flex: none; width: 24px; height: 24px; border-radius: 7px; font-size: 13px; font-weight: 700; color: #fff; align-items: center; justify-content: center; line-height: 1; }
.sj.big { width: 30px; height: 30px; font-size: 16px; }
.sj-kokugo { background: var(--kokugo); }
.sj-math { background: var(--math); }
.sj-rika { background: var(--rika); }
.sj-shakai { background: var(--shakai); }
.sj-eigo { background: var(--eigo); }
.tabs { display: flex; gap: 4px; margin-bottom: 4px; }
.tabs .sj-tab { flex: 1; min-height: 40px; padding: 4px 0; font-size: 14px; font-weight: 700; color: #fff; border: none; opacity: 0.38; }
.tabs .sj-tab.on { opacity: 1; }
.unit-no { min-width: 46px; white-space: nowrap; }

/* 文章（読解）と教科書 */
.passage { background: var(--soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.passage summary { cursor: pointer; }
.passage-body p { margin: 8px 0 0; line-height: 1.95; font-size: 16px; }
.passage .seg { cursor: pointer; border-radius: 4px; padding: 1px 0; }
.passage.poem .passage-body p { margin-top: 14px; line-height: 1.8; }
.passage.poem .passage-body span { display: block; padding: 2px 4px; }
.passage .seg.on { background: #fff3b0; box-shadow: inset 0 -2px var(--warn-line); }
.passage .seg.right { background: var(--ok-bg); box-shadow: inset 0 -2px var(--ok-line); }
.card.textbook { background: #fdf6e8; border-color: #e8cf9c; }
.emph { color: var(--kokugo); font-weight: 700; border-bottom: 2px solid currentColor; padding: 0 2px; }

/* 全部えらぶ・ならべかえ・ことば */
.check-btn.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.check-btn.on::before { content: '✔ '; }
.order-answer { min-height: 64px; border: 2px dashed var(--accent-line); border-radius: 12px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.order-pool { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.card-btn { min-height: 46px; padding: 6px 12px; font-size: 17px; }
.card-btn.used { visibility: hidden; }
.card-btn.picked { background: var(--accent-bg); border-color: var(--accent-line); }
.word-input { font-size: 22px; text-align: center; min-height: 54px; }

/* 英語: 読み上げ・つづり */
.speak { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.speak .speak-play { width: 52px; height: 52px; border-radius: 50%; background: var(--eigo); border-color: var(--eigo); color: #fff; font-size: 22px; padding: 0; }
.speak.big .speak-play { width: 92px; height: 92px; font-size: 38px; }
.speak .speak-slow { min-height: 44px; font-size: 14px; }
.speak .sub { flex-basis: 100%; text-align: center; }
.spell-box { display: flex; gap: 5px; justify-content: center; margin: 10px 0; min-height: 46px; flex-wrap: wrap; }
.spell-box span { width: 30px; height: 42px; border-bottom: 3px solid var(--text); font-size: 26px; font-weight: 700; text-align: center; }
.spell-box span.cur { border-color: var(--eigo); }
.spell-box.ok span { color: var(--ok); border-color: var(--ok-line); }
.spell-box.ng span { color: var(--ng); border-color: var(--ng-line); }
.alphapad .r { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.alphapad button { flex: 1; min-height: 46px; min-width: 0; padding: 0; font-size: 18px; max-width: 42px; }
.alphapad button.wide { max-width: 60px; flex: 1.4; font-size: 14px; }
.alphapad button.space { max-width: none; flex: 3; font-size: 14px; }
.alphapad button.ok-key { max-width: none; flex: 2; font-size: 16px; }

/* 手書き */
.ink { display: flex; justify-content: center; }
.ink-box { width: min(78vw, 300px); aspect-ratio: 1 / 1; border: 2px dashed var(--line); border-radius: 16px; overflow: hidden; background: linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat, linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat, #fff; }
.ink-canvas { width: 100%; height: 100%; display: block; touch-action: none; mix-blend-mode: multiply; }
.kanji-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.kanji-grid > div { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 3px; text-align: center; background: var(--surface); }
.kanji-grid > div.ng { background: var(--ng-bg); border-color: var(--ng-line); }
.kanji-grid img { width: 100%; display: block; border-radius: 6px; }
.kanji-grid .mk { position: absolute; top: 2px; right: 5px; font-weight: 700; }
.kanji-grid .ok .mk { color: var(--ok); }
.kanji-grid .ng .mk { color: var(--ng); }
.kanji-grid .right-char { font-size: 13px; color: var(--sub); }
.big-char { font-size: 30px; font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif; }
.self-ink img { width: 100%; max-width: 160px; border-radius: 8px; }
.self-ink .big-char { font-size: 90px; line-height: 1.4; }
.mini-ink { width: 44px; height: 44px; vertical-align: middle; border: 1px solid var(--line); border-radius: 6px; }

/* 記述・音声入力 */
.write-wrap { position: relative; }
.write-wrap textarea { width: 100%; padding-right: 54px; font-size: 16px; line-height: 1.7; }
.write-wrap .mic { position: absolute; right: 6px; bottom: 6px; }
.mic { min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
.mic.on { background: var(--ng-bg); border-color: var(--ng-line); animation: blink 1s infinite; }

/* 図 */
.figure-box { margin: 6px 0; }
svg.figure { width: 100%; height: auto; display: block; background: #eaf2f8; border-radius: 12px; border: 1px solid var(--line); }
svg.figure.plain { background: #fff; max-height: 260px; }
svg.figure.tappable .hit { cursor: pointer; }
svg.figure .hit.picked, svg.figure .hit.picked > :not([fill='transparent']) { fill: #ffe08a !important; stroke: var(--warn-line) !important; stroke-width: 2.5; }
svg.figure .hit.right, svg.figure .hit.right > :not([fill='transparent']) { fill: var(--ok-bg) !important; stroke: var(--ok) !important; stroke-width: 2.5; }

/* 教科書と順番（保護者） */
.order-row { border-top: 1px solid var(--line); padding: 6px 0; }
.order-row.focus { background: var(--warn-bg); border-radius: 8px; padding: 6px; }
.order-tools { margin-top: 2px; }
.order-tools button { min-height: 34px; min-width: 40px; padding: 2px 10px; font-size: 13px; }
.order-tools button.ghost { color: var(--accent); padding-left: 0; }
.week-grid th, .week-grid td { text-align: center; }

/* AI の返事を待っているあいだ（public/js/aiwait.js） */
.aiwait { background: var(--ai-bg); border: 1px solid var(--ai-line); border-radius: 12px; padding: 12px 14px; min-width: 240px; }
.chat > .aiwait { max-width: 92%; }
.aiwait-head { display: flex; align-items: center; gap: 6px; color: var(--ai); }
.aiwait-bot { font-size: 22px; animation: aiwait-bob 1.2s ease-in-out infinite; }
.aiwait-dots { display: inline-flex; gap: 3px; margin-left: 2px; }
.aiwait-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--ai); opacity: 0.25; animation: aiwait-dot 1.2s infinite; }
.aiwait-dots i:nth-child(2) { animation-delay: 0.2s; }
.aiwait-dots i:nth-child(3) { animation-delay: 0.4s; }
.aiwait-bar { height: 8px; background: #fff; border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.aiwait-fill { height: 100%; width: 0; background: var(--ai); border-radius: 4px; transition: width 0.25s linear; }
.aiwait-time { font-variant-numeric: tabular-nums; }
.aiwait-steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.aiwait-steps li { color: var(--sub); opacity: 0.55; padding-left: 22px; position: relative; }
.aiwait-steps li::before { content: '・'; position: absolute; left: 4px; }
.aiwait-steps li.now { color: var(--ai); opacity: 1; font-weight: 700; }
.aiwait-steps li.now::before { content: '▶'; font-size: 11px; top: 2px; }
.aiwait-steps li.done { color: var(--ok); opacity: 1; }
.aiwait-steps li.done::before { content: '✓'; }
.aiwait-slow { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--ai-line); }
.aiwait-slow p { margin: 0 0 6px; }
@keyframes aiwait-dot { 0%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@keyframes aiwait-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .aiwait-bot, .aiwait-dots i { animation: none; opacity: 1; } }

/* ごほうび（★ → お小遣い） */
.bar.star > i { background: var(--star); }
.reward-card { margin-top: 12px; background: #fff8e1; border-color: #f0d58a; }
.reward-card .reward-num { font-size: 22px; font-weight: 700; margin: 4px 0; }
.reward-card .bar { margin: 4px 0 6px; background: #fff; }
.rw-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.rw-yen { font-size: 24px; font-weight: 700; }
.rw-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.rw-days .wd { font-size: 11px; color: var(--sub); text-align: center; }
.rw-day { border: 1px solid var(--line); border-radius: 8px; background: var(--soft); padding: 3px 0; text-align: center; font-size: 11px; line-height: 1.3; min-height: 38px; cursor: pointer; font-family: inherit; color: var(--text); }
.rw-day b { display: block; font-size: 12.5px; color: var(--warn); }
.rw-day.alert { border: 2px solid var(--warn-line); }
.rw-day.off { background: var(--ng-bg); color: var(--ng); }
.rw-day.off b { color: var(--ng); text-decoration: line-through; }
.rw-day.future, .rw-day.blank { background: transparent; border-color: transparent; cursor: default; color: var(--sub); }
.rw-src { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; margin-top: 8px; }
.rw-paid { background: var(--ok-bg); color: var(--ok); border-radius: 10px; padding: 8px 10px; font-size: 13px; margin-top: 10px; }

/* 端末の登録（要件 6.4） */
.device-reg { max-width: 420px; margin: 30px auto 0; text-align: center; }
.device-reg .big-icon { font-size: 56px; }
.device-reg .field { text-align: left; }
.code-input { font-size: 26px; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; }
.code-show { font-size: 38px; font-weight: 700; letter-spacing: 6px; text-align: center; font-variant-numeric: tabular-nums; margin: 6px 0; }
.dev-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dev-row:first-child { border-top: none; }

/* 日報（要件 6.5） */
.finish-btn { background: #fff; border: 2px solid var(--accent); color: var(--accent); font-weight: 700; font-size: 17px; padding: 12px; border-radius: 14px; }
.rep-card .rep-text { white-space: pre-wrap; font-size: 14px; line-height: 1.65; margin: 8px 0 0; }
.rep-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.rep-stats div { background: var(--soft); border-radius: 8px; padding: 5px; text-align: center; font-size: 11px; color: var(--sub); }
.rep-stats b { display: block; font-size: 16px; color: var(--text); }
.rep-list { margin: 4px 0 0; padding-left: 18px; font-size: 14px; }
.url-text { flex: 1; min-width: 0; word-break: break-all; font-weight: 700; font-size: 14px; color: var(--accent); }
.cover-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; font-size: 24px; line-height: 1; padding: 0; }
