/* 単語の森 — 深緑 × クリーム × 金。静かな森の絵本の手触り */
:root {
  --moss: #1f3a2b;
  --pine: #2c5440;
  --fern: #4f7149;
  --sage: #dfe5cf;
  --cream: #f6efdc;
  --paper: #fffaf0;
  --gold: #c99a3a;
  --gold-ink: #7a5710;
  --bark: #3a2e22;
  --bark-2: #5c4c3a;
  --berry: #a3402f;
  --line: rgba(58, 46, 34, .14);
  --shadow: 0 14px 34px -14px rgba(31, 58, 43, .42), 0 2px 6px rgba(31, 58, 43, .08);
  --r-card: 26px;
  --r-btn: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);
  --t: 280ms;
  --f-en: 'Young Serif', 'Gentium Book Plus', Georgia, serif;
  --f-ipa: 'Gentium Book Plus', 'Charis SIL', 'Times New Roman', serif;
  --f-num: 'Gentium Book Plus', Georgia, serif;
  --f-head: 'Kiwi Maru', 'Zen Kaku Gothic New', serif;
  --f-body: 'Zen Kaku Gothic New', 'Hiragino Sans', sans-serif;
  --tab-h: 62px;
  --sb: env(safe-area-inset-bottom, 0px);
  --st: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
html { background: #16291f; }
body {
  font-family: var(--f-body); color: var(--bark); background:
    radial-gradient(circle at 20% 10%, rgba(201, 154, 58, .12), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(79, 113, 73, .35), transparent 45%), #16291f;
  line-break: strict; overflow: hidden; font-size: 15px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 24px; height: 24px; flex: none; }
.nowrap { white-space: nowrap; }
.kp { word-break: keep-all; overflow-wrap: normal; }
.nojs { padding: 40px 24px; color: var(--cream); font-size: 16px; }

.app {
  position: relative; height: 100dvh; width: 100%; max-width: 430px; margin: 0 auto;
  background: var(--cream); overflow: hidden; isolation: isolate;
}
@media (min-width: 600px) { .app { box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), 0 30px 80px rgba(0, 0, 0, .45); } }
.stage { position: absolute; inset: 0; }

/* ---------- 画面とナビバー ---------- */
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--cream); will-change: transform; }
.scr.push-in { animation: pushIn var(--t) var(--ease) both; }
.scr.push-out { animation: pushOut var(--t) var(--ease) both; }
.scr.pop-in { animation: popIn var(--t) var(--ease) both; }
.scr.pop-out { animation: popOut var(--t) var(--ease) both; z-index: 2; }
.scr.fade-in { animation: fadeIn 200ms ease both; }
.scr.rise-in { animation: riseIn 360ms var(--ease) both; z-index: 3; }
@keyframes pushIn { from { transform: translateX(100%); } }
@keyframes pushOut { to { transform: translateX(-28%); filter: brightness(.92); } }
@keyframes popIn { from { transform: translateX(-28%); filter: brightness(.92); } }
@keyframes popOut { to { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { transform: translateY(100%); } }

.nav {
  position: relative; z-index: 5; flex: none; height: calc(52px + var(--st)); padding: var(--st) 8px 0;
  display: grid; grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr); align-items: center;
  background: transparent; transition: background var(--t) ease, box-shadow var(--t) ease;
}
.nav.stuck { background: rgba(250, 245, 230, .96); box-shadow: 0 .5px 0 var(--line); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); }
.nav .ttl { font-family: var(--f-head); font-weight: 500; font-size: 17px; opacity: 0; transform: translateY(6px); transition: opacity 180ms ease, transform 180ms ease; white-space: nowrap; color: var(--moss); }
.nav.stuck .ttl, .nav.always .ttl { opacity: 1; transform: none; }
.nav .l, .nav .r { display: flex; align-items: center; gap: 2px; }
.nav .r { justify-content: flex-end; }
.nbtn { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; color: var(--pine); border-radius: 14px; padding: 0 8px; font-size: 16px; font-weight: 500; transition: transform 120ms ease, background 120ms; }
.nbtn:active { transform: scale(.92); background: rgba(44, 84, 64, .1); }
.nbtn.back { padding-left: 2px; }
.nbtn.back svg { width: 26px; height: 26px; }

.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 0 calc(var(--tab-h) + var(--sb) + 28px); }
.scr.notab .scroll { padding-bottom: calc(var(--sb) + 28px); }
.lt { margin: 2px 20px 10px; font-family: var(--f-head); font-weight: 500; font-size: 34px; line-height: 1.2; color: var(--moss); letter-spacing: .02em; font-feature-settings: "palt"; }
.eyebrow { margin: 0 20px; font-size: 13px; font-weight: 700; letter-spacing: .12em; color: var(--gold-ink); }

/* ---------- タブバー（機能層だけガラス） ---------- */
.tabbar {
  position: absolute; z-index: 20; left: 12px; right: 12px; bottom: calc(10px + var(--sb)); height: var(--tab-h);
  display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px; border-radius: 26px;
  background: rgba(252, 248, 236, .94); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 10px 30px -10px rgba(22, 41, 31, .45), inset 0 0 0 .5px rgba(255, 255, 255, .8), 0 0 0 .5px rgba(58, 46, 34, .12);
  transition: transform 320ms var(--ease), opacity 200ms;
}
.tabbar.hide { transform: translateY(140%); opacity: 0; pointer-events: none; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 20px; color: #5f5446; font-size: 11px; font-weight: 700; letter-spacing: .04em; transition: background 200ms, color 200ms, transform 120ms; }
.tab svg { width: 25px; height: 25px; }
.tab:active { transform: scale(.92); }
.tab.on { color: var(--moss); background: rgba(44, 84, 64, .12); }

/* ---------- 共通部品 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--r-btn); font-weight: 700; font-size: 16px; letter-spacing: .03em; transition: transform 140ms var(--ease), filter 140ms, box-shadow 140ms; user-select: none; }
.btn:active { transform: scale(.965); filter: brightness(.95); }
.btn.primary { background: var(--moss); color: #fffaf0; box-shadow: 0 10px 22px -10px rgba(31, 58, 43, .8), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.gold { background: var(--gold); color: #2a1f0e; }
.btn.ghost { background: rgba(44, 84, 64, .1); color: var(--moss); }
.btn.danger { background: rgba(163, 64, 47, .1); color: var(--berry); }
.btn.wide { width: 100%; }
.btn svg { width: 22px; height: 22px; }
.sec { margin: 26px 20px 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.sec-h h2 { margin: 0; font-family: var(--f-head); font-weight: 500; font-size: 20px; color: var(--moss); font-feature-settings: "palt"; }
.sec-h a, .sec-h button { font-size: 14px; font-weight: 700; color: var(--pine); min-height: 44px; display: inline-flex; align-items: center; }
.num { font-family: var(--f-en); font-variant-numeric: lining-nums tabular-nums; }
.p { margin: 0; font-size: 15px; line-height: 1.75; word-break: normal; overflow-wrap: break-word; color: var(--bark-2); }

/* ---------- 今日の復習 ---------- */
.today-date { margin: 4px 20px 0; font-size: 13px; font-weight: 700; color: var(--gold-ink); letter-spacing: .1em; }
.window { position: relative; margin: 6px 16px 0; border-radius: 30px; overflow: hidden; height: 236px; background: #a9b88f url(/app-development/apps/a066/img/forest-dawn.webp) center 62% / cover no-repeat; box-shadow: var(--shadow); }
.window::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); pointer-events: none; }
.plate { position: absolute; left: 14px; bottom: 14px; right: 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 16px 12px 18px; background: var(--paper); border-radius: 22px; box-shadow: 0 10px 26px -12px rgba(22, 41, 31, .6); }
.plate .big { display: flex; align-items: baseline; gap: 6px; line-height: 1; color: var(--moss); }
.plate .big b { font-family: var(--f-en); font-weight: 400; font-size: 58px; letter-spacing: -.02em; }
.plate .big span { font-family: var(--f-head); font-size: 18px; }
.plate .cap { font-size: 13px; font-weight: 700; color: var(--gold-ink); letter-spacing: .08em; margin-bottom: 6px; }
.plate .eta { text-align: right; font-size: 13px; color: var(--bark-2); line-height: 1.45; }
.plate .eta b { display: block; font-family: var(--f-en); font-weight: 400; font-size: 22px; color: var(--bark); }
.ledger { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ledger div { padding: 10px 0 9px; text-align: center; }
.ledger div + div { border-left: 1px solid var(--line); }
.ledger b { display: block; font-family: var(--f-num); font-weight: 400; font-size: 24px; line-height: 1.2; color: var(--moss); }
.ledger span { font-size: 12px; font-weight: 700; color: var(--bark-2); letter-spacing: .04em; }
.go { margin: 18px 20px 0; }
.go .btn { width: 100%; min-height: 58px; font-size: 17px; border-radius: 20px; }
.go .sub { display: block; margin-top: 8px; text-align: center; font-size: 13px; color: var(--bark-2); }

.done-card { position: relative; margin: 6px 16px 0; border-radius: 30px; overflow: hidden; background: var(--moss); color: var(--cream); box-shadow: var(--shadow); }
.done-card img { display: block; width: 100%; height: 210px; object-fit: cover; object-position: center 40%; }
.done-card .body { padding: 18px 20px 20px; }
.done-card h2 { margin: 0 0 6px; font-family: var(--f-head); font-weight: 500; font-size: 22px; line-height: 1.4; color: #fffaf0; font-feature-settings: "palt"; }
.done-card p { margin: 0 0 14px; font-size: 15px; color: #e9e2cc; }
.done-card .btn.gold { width: 100%; }

.forest { position: relative; border-radius: 24px; background: linear-gradient(#f9f3e2, #efe5c9); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.forest svg.map { display: block; width: 100%; height: auto; }
.legend { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 10px 12px 12px; background: var(--paper); border-top: 1px solid var(--line); }
.legend div { display: flex; flex-direction: column; align-items: center; gap: 0; }
.legend svg { width: 22px; height: 26px; }
.legend b { font-family: var(--f-num); font-weight: 400; font-size: 18px; line-height: 1.2; color: var(--moss); }
.legend span { font-size: 12px; font-weight: 700; color: var(--bark-2); }
.leg-none { width: 14px; height: 14px; border-radius: 50%; border: 2px dashed #9b8a70; margin: 6px 0; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 132px; padding: 12px 12px 10px; background: var(--paper); border-radius: 22px; box-shadow: inset 0 0 0 1px var(--line); }
.week .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.week .bar { width: 100%; max-width: 26px; border-radius: 9px 9px 4px 4px; background: linear-gradient(#5f8559, var(--pine)); min-height: 4px; transform-origin: bottom; animation: grow 600ms var(--ease) both; }
.week .col.t .bar { background: linear-gradient(#e0b65a, var(--gold)); }
.week .n { font-family: var(--f-num); font-size: 14px; color: var(--bark); line-height: 1; }
.week .d { font-size: 12px; font-weight: 700; color: var(--bark-2); }
@keyframes grow { from { transform: scaleY(0); } }

.stumble { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-w { display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 8px 14px; border-radius: 14px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); transition: transform 120ms; }
.chip-w:active { transform: scale(.96); }
.chip-w b { font-family: var(--f-en); font-weight: 400; font-size: 17px; color: var(--moss); }
.chip-w span { font-size: 13px; color: var(--bark-2); }

/* ---------- カード（学習） ---------- */
.study { background: radial-gradient(120% 70% at 50% 0%, #2f5a45 0%, var(--moss) 60%, #172d21 100%); color: var(--cream); }
.study .nav { color: var(--cream); }
.study .nbtn { color: #f3e9cf; }
.study .nbtn:active { background: rgba(255, 255, 255, .12); }
.study .nbtn[disabled] { color: #b9c2ae; cursor: default; }
.study .count { font-family: var(--f-num); font-size: 17px; color: #fff7e2; white-space: nowrap; }
.study .count small { font-family: var(--f-body); font-size: 13px; color: #d6dcc6; margin-left: 2px; }
.vine { position: relative; height: 6px; margin: 0 22px; border-radius: 3px; background: rgba(255, 255, 255, .14); flex: none; }
.vine i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #8fb36d, var(--gold)); transition: width 420ms var(--ease); }
.vine i::after { content: ""; position: absolute; right: -7px; top: -5px; width: 14px; height: 14px; border-radius: 0 50% 50% 50%; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 3px rgba(201, 154, 58, .25); }
.deck { position: relative; flex: 1; margin: 22px 20px 0; min-height: 0; perspective: 1400px; }
.card { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; transition: transform 380ms var(--ease), opacity 300ms; }
.card.back-peek { transform: translateY(14px) scale(.94); opacity: .7; pointer-events: none; }
.card.dragging { transition: none; cursor: grabbing; }
.card .flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 560ms var(--spring); }
.card.flipped .flip { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 30px; background: var(--paper); color: var(--bark); box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .6), 0 2px 0 rgba(255, 255, 255, .6) inset; display: flex; flex-direction: column; padding: 20px 22px 18px; overflow: hidden; }
.face::before { content: ""; position: absolute; inset: 8px; border-radius: 24px; border: 1px solid rgba(201, 154, 58, .45); pointer-events: none; }
.face.b { transform: rotateY(180deg); }
.face .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: relative; }
.tag { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.tag.lv { background: #e9efdc; color: var(--pine); }
.tag.new { background: #f3e2b8; color: #6b4b0c; }
.tag.rev { background: #e4ece4; color: var(--moss); }
.tag.again { background: #f4dcd4; color: #8a3324; }
.face .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; position: relative; }
.word { font-family: var(--f-en); font-size: 46px; line-height: 1.1; color: var(--moss); letter-spacing: -.005em; overflow-wrap: anywhere; }
.word.l { font-size: 38px; }
.word.xl { font-size: 32px; }
.ipa { font-family: var(--f-ipa); font-size: 19px; color: var(--bark-2); transition: background 300ms, color 300ms; border-radius: 8px; padding: 0 6px; }
.ipa.pulse { background: #f3e2b8; color: #4a3608; animation: ipaPulse 900ms ease 2; }
@keyframes ipaPulse { 50% { transform: scale(1.08); } }
.speak { width: 52px; height: 52px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--moss); color: #fffaf0; box-shadow: 0 8px 18px -8px rgba(31, 58, 43, .9); transition: transform 140ms var(--spring); }
.speak:active { transform: scale(.88); }
.speak.sm { width: 44px; height: 44px; }
.speak.playing { animation: ring 900ms ease infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(201, 154, 58, .6); } 100% { box-shadow: 0 0 0 16px rgba(201, 154, 58, 0); } }
.hint { position: relative; text-align: center; font-size: 13px; font-weight: 700; color: var(--bark-2); letter-spacing: .06em; }
.b-head { display: flex; align-items: center; gap: 12px; position: relative; margin-top: 4px; }
.b-head .w { font-family: var(--f-en); font-size: 28px; line-height: 1.15; color: var(--moss); overflow-wrap: anywhere; }
.b-head .ipa { font-size: 16px; padding: 0; }
.b-head .speak { margin-left: auto; }
.b-mid { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.b-foot { position: relative; display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px dashed rgba(201,154,58,.5); font-size: 12px; font-weight: 700; color: var(--bark-2); }
.b-foot span { white-space: nowrap; }
.pos { display: inline-block; margin-top: 0; font-size: 13px; font-weight: 700; color: var(--gold-ink); letter-spacing: .1em; position: relative; }
.meaning { position: relative; margin: 4px 0 0; font-family: var(--f-head); font-weight: 500; font-size: 25px; line-height: 1.45; color: var(--bark); word-break: keep-all; overflow-wrap: anywhere; font-feature-settings: "palt"; }
.orn { position: relative; display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--gold); }
.orn::before, .orn::after { content: ""; flex: 1; height: 1px; background: rgba(201, 154, 58, .55); }
.orn svg { width: 18px; height: 18px; }
.ex { position: relative; margin: 0; font-family: var(--f-ipa); font-style: italic; font-size: 18px; line-height: 1.5; color: var(--bark); }
.ex mark { background: linear-gradient(transparent 62%, rgba(201, 154, 58, .45) 62%); color: inherit; font-style: italic; }
.exja { position: relative; margin: 6px 0 0; font-size: 14px; line-height: 1.7; color: var(--bark-2); word-break: normal; }
.stamp { position: absolute; top: 26px; z-index: 4; padding: 6px 14px; border-radius: 12px; font-family: var(--f-head); font-weight: 500; font-size: 20px; letter-spacing: .1em; opacity: 0; transform: rotate(-10deg); pointer-events: none; }
.stamp.ok { left: 22px; background: var(--moss); color: #fffaf0; }
.stamp.ng { right: 22px; background: var(--berry); color: #fffaf0; transform: rotate(10deg); }

.answer { flex: none; padding: 18px 16px calc(14px + var(--sb)); }
.reveal { width: 100%; min-height: 58px; border-radius: 20px; background: var(--cream); color: var(--moss); font-family: var(--f-head); font-weight: 500; font-size: 18px; box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .6); }
.swipe-hint { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 0 6px; font-size: 13px; font-weight: 700; color: #dfe5cf; }
.swipe-hint svg { width: 18px; height: 18px; vertical-align: -4px; }
.grades { display: grid; gap: 8px; }
.grades.g4 { grid-template-columns: repeat(4, 1fr); }
.grades.g6 { grid-template-columns: repeat(3, 1fr); }
.g { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 64px; padding: 6px 4px; border-radius: 18px; background: #fbf5e4; color: var(--bark); transition: transform 140ms var(--spring), filter 140ms; animation: gIn 360ms var(--ease) both; }
.g:nth-child(2) { animation-delay: 40ms; } .g:nth-child(3) { animation-delay: 80ms; } .g:nth-child(4) { animation-delay: 120ms; } .g:nth-child(5) { animation-delay: 160ms; } .g:nth-child(6) { animation-delay: 200ms; }
@keyframes gIn { from { transform: translateY(16px); opacity: 0; } }
.g:active { transform: scale(.93); filter: brightness(.94); }
.g b { font-size: 14px; font-weight: 700; white-space: nowrap; }
.g span { font-family: var(--f-num); font-size: 13px; color: var(--bark-2); white-space: nowrap; }
.g.q0, .g.q1 { background: #f6dfd6; } .g.q0 b, .g.q1 b { color: #8a3324; }
.g.q2 { background: #f6e7d4; } .g.q2 b { color: #7a4512; }
.g.q5 { background: #dde8d4; } .g.q5 b { color: var(--moss); }
.g .qn { font-family: var(--f-en); font-size: 12px; color: var(--bark-2); }
.float-ivl { position: absolute; left: 50%; top: 30%; z-index: 9; transform: translate(-50%, 0); padding: 8px 16px; border-radius: 20px; background: var(--gold); color: #2a1f0e; font-weight: 700; font-size: 15px; white-space: nowrap; pointer-events: none; animation: floatUp 900ms var(--ease) both; }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.9); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -30px); } }

.sdone { display: flex; flex-direction: column; align-items: stretch; padding: 0 20px; }
.sdone .art { border-radius: 30px; overflow: hidden; margin-top: 4px; box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .7); }
.sdone .art img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.sdone h1 { margin: 22px 0 6px; font-family: var(--f-head); font-weight: 500; font-size: 26px; line-height: 1.4; color: #fffaf0; text-align: center; font-feature-settings: "palt"; }
.sdone .lead { margin: 0; text-align: center; font-size: 15px; color: #e1e6d3; }
.sdone .trio { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; background: #183225; border-radius: 20px; }
.sdone .trio div { padding: 12px 4px; text-align: center; }
.sdone .trio b { display: block; font-family: var(--f-en); font-weight: 400; font-size: 26px; color: #fff7e2; line-height: 1.2; }
.sdone .trio span { font-size: 12px; font-weight: 700; color: #d9dfca; }
.sdone .btns { display: grid; gap: 10px; }
.sdone .btn.ghost { background: #3a5a49; color: #fffaf0; }

/* ---------- 単語帳 ---------- */
.searchbar { position: sticky; top: 0; z-index: 3; padding: 4px 16px 10px; background: var(--cream); }
.sfield { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 13px; background: #ebe2c8; color: #5f5446; }
.sfield svg { width: 19px; height: 19px; }
.sfield input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 16px; color: var(--bark); }
.sfield input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.sfield input::placeholder { color: #6d604f; }
.sfield .clr { width: 44px; height: 42px; margin-right: -12px; display: none; align-items: center; justify-content: center; color: #6d604f; }
.sfield.has .clr { display: inline-flex; }
.sfield .clr svg { width: 18px; height: 18px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; margin-top: 10px; padding: 3px; border-radius: 12px; background: #ebe2c8; }
.seg button { min-height: 36px; border-radius: 9px; font-size: 13px; font-weight: 700; color: #5a4e40; white-space: nowrap; transition: background 200ms, color 200ms, box-shadow 200ms; }
.seg button.on { background: var(--paper); color: var(--moss); box-shadow: 0 2px 6px rgba(58, 46, 34, .16); }
.sortrow { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 13px; color: var(--bark-2); }
.sortrow button { min-height: 40px; font-weight: 700; color: var(--pine); display: inline-flex; align-items: center; gap: 4px; }
.lvh { position: sticky; top: var(--sticky, 136px); z-index: 2; display: flex; align-items: center; gap: 12px; padding: 12px 20px 8px; background: var(--cream); }
.lvh .nm { font-family: var(--f-head); font-weight: 500; font-size: 17px; color: var(--moss); white-space: nowrap; }
.lvh .en { font-family: var(--f-en); font-size: 13px; color: var(--gold-ink); white-space: nowrap; }
.lvh .pg { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--bark-2); white-space: nowrap; }
.lvh .pg i { display: block; width: 54px; height: 6px; border-radius: 3px; background: #e2d8bb; overflow: hidden; }
.lvh .pg i b { display: block; height: 100%; background: var(--pine); }
.lvh.letter .nm { font-family: var(--f-en); font-size: 20px; }
.rows { margin: 0 16px; background: var(--paper); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.row { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; min-height: 60px; padding: 8px 14px 8px 12px; position: relative; transition: background 120ms; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 52px; right: 0; height: 1px; background: var(--line); }
.row:active { background: #f1e8cf; }
.row .st { display: flex; align-items: center; justify-content: center; }
.row .st svg { width: 22px; height: 26px; }
.row .st .leg-none { width: 12px; height: 12px; margin: 0; }
.row .tx { min-width: 0; }
.row .w { display: flex; align-items: baseline; gap: 8px; }
.row .w b { font-family: var(--f-en); font-weight: 400; font-size: 19px; color: var(--moss); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .w i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--gold-ink); white-space: nowrap; }
.row .ja { font-size: 14px; color: var(--bark-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.row .due { font-size: 12px; font-weight: 700; color: var(--bark-2); white-space: nowrap; text-align: right;  font-family: var(--f-num);}
.row .due.now { color: #fffaf0; background: var(--pine); padding: 2px 8px; border-radius: 9px; }
.list.rail-on .rows { margin-right: 28px; }
.rail { position: absolute; right: 2px; top: 50%; z-index: 6; transform: translateY(-46%); display: flex; flex-direction: column; align-items: center; padding: 4px 0; touch-action: none; }
.rail button { width: 22px; height: 15px; font-size: 11px; font-weight: 700; color: var(--pine); line-height: 15px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 28px 0; }
.empty img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.empty h3 { margin: 18px 0 4px; font-family: var(--f-head); font-weight: 500; font-size: 19px; color: var(--moss); }
.empty p { margin: 0; font-size: 14px; color: var(--bark-2); word-break: normal; }

/* ---------- 単語詳細 ---------- */
.wd-hero { margin: 0 16px; padding: 22px 20px 20px; border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.wd-hero .lvl { font-size: 12px; font-weight: 700; color: var(--gold-ink); letter-spacing: .1em; }
.wd-hero .w { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.wd-hero .w h1 { margin: 0; font-family: var(--f-en); font-weight: 400; font-size: 40px; line-height: 1.1; color: var(--moss); overflow-wrap: anywhere; }
.wd-hero .w .speak { margin-left: auto; }
.wd-hero .ipa { display: inline-block; margin: 4px 0 0 -6px; }
.wd-hero .pos { margin-top: 12px; }
.wd-hero .meaning { font-size: 22px; margin-top: 2px; }
.wd-hero .exbox { margin-top: 16px; padding: 14px 16px; border-radius: 18px; background: #f3ecd6; }
.state { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: center; padding: 16px; border-radius: 24px; background: var(--moss); color: var(--cream); }
.state .tree { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 112px; border-radius: 18px; background: linear-gradient(#2b5040, #23432f); padding-bottom: 8px; }
.state .tree svg { width: 60px; height: 76px; }
.state .tree span { font-family: var(--f-head); font-size: 15px; color: #f4ebcf; }
.state dl { min-width: 0; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline; }
.state dt { font-size: 13px; color: #d4dbc4; white-space: nowrap; }
.state dd { margin: 0; font-family: var(--f-num); font-size: 17px; color: #fff7e2; text-align: right; white-space: nowrap; }
.state dd small { font-family: var(--f-body); font-size: 12px; color: #d4dbc4; margin-left: 2px; }
.hist { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.hist span { display: inline-flex; flex-direction: column; align-items: center; width: 40px; padding: 6px 0 5px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.hist b { font-family: var(--f-num); font-weight: 400; font-size: 18px; line-height: 1.1; }
.hist i { font-style: normal; font-size: 11px; font-weight: 700; color: var(--bark-2); }
.hist .bad b { color: var(--berry); } .hist .mid b { color: #7a4512; } .hist .good b { color: var(--pine); }
.actions { display: grid; gap: 10px; margin: 18px 20px 0; }

/* ---------- 記録 ---------- */
.night { position: relative; margin: 6px 16px 0; height: 200px; border-radius: 30px; overflow: hidden; background: #10241a url(/app-development/apps/a066/img/night.webp) center 70% / cover no-repeat; box-shadow: var(--shadow); }
.night .pl { position: absolute; left: 14px; right: 14px; bottom: 14px; display: grid; grid-template-columns: 1fr 1fr; background: #11281c; border-radius: 22px; color: var(--cream); }
.night .pl div { padding: 12px 16px; }
.night .pl div + div { border-left: 1px solid rgba(255, 255, 255, .14); }
.night .pl b { display: block; font-family: var(--f-en); font-weight: 400; font-size: 34px; line-height: 1.1; color: #f1c96b; }
.night .pl b small { font-family: var(--f-head); font-size: 15px; color: #f4ebcf; margin-left: 4px; }
.night .pl span { font-size: 12px; font-weight: 700; color: #d4dbc4; letter-spacing: .06em; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 16px 0; }
.kpi { padding: 12px 12px 10px; border-radius: 18px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.kpi b { display: block; font-family: var(--f-num); font-weight: 400; font-size: 24px; line-height: 1.15; color: var(--moss); }
.kpi span { font-size: 12px; font-weight: 700; color: var(--bark-2); }
.panel { padding: 14px 12px 10px; border-radius: 22px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.panel svg.chart { display: block; width: 100%; height: auto; }
.keys { display: flex; gap: 14px; justify-content: flex-end; padding: 0 6px 6px; font-size: 12px; font-weight: 700; color: var(--bark-2); }
.keys i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.moss { display: grid; grid-template-columns: 28px repeat(6, 1fr); gap: 5px; align-items: center; }
.moss .wd { font-size: 11px; font-weight: 700; color: var(--bark-2); text-align: center; }
.moss .c { aspect-ratio: 1; border-radius: 7px; background: #ece3c8; }
.moss .c.l1 { background: #c9d6a9; } .moss .c.l2 { background: #8fb06d; } .moss .c.l3 { background: #4f7a4a; } .moss .c.l4 { background: var(--moss); }
.moss .c.today { box-shadow: 0 0 0 2px var(--gold); }
.moss .c.fut { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.moss .mh { font-size: 11px; font-weight: 700; color: var(--bark-2); text-align: center; white-space: nowrap; }
.lvbars { display: grid; gap: 12px; }
.lvbar .t { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.lvbar .t b { font-family: var(--f-head); font-weight: 500; font-size: 15px; color: var(--moss); white-space: nowrap; }
.lvbar .t span { font-family: var(--f-num); font-size: 14px; color: var(--bark-2); white-space: nowrap; }
.lvbar .bar { display: flex; height: 12px; border-radius: 6px; background: #ece3c8; overflow: hidden; }
.lvbar .bar i { display: block; height: 100%; }
.lvbar .bar .g3 { background: var(--moss); } .lvbar .bar .g2 { background: #4f7a4a; } .lvbar .bar .g1 { background: #a7c27f; }

/* ---------- 設定 ---------- */
.group { margin: 22px 16px 0; }
.group > h3 { margin: 0 0 6px 6px; font-size: 13px; font-weight: 700; color: var(--bark-2); letter-spacing: .08em; }
.cells { background: var(--paper); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.cell { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; width: 100%; text-align: left; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 56px; right: 0; height: 1px; background: var(--line); }
.cell .ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--pine); color: #fffaf0; flex: none; }
.cell .ic svg { width: 19px; height: 19px; }
.cell .ic.au { background: var(--gold); color: #2a1f0e; }
.cell .ic.r { background: var(--berry); }
.cell .lb { flex: 1; min-width: 0; font-size: 16px; }
.cell .lb small { display: block; font-size: 13px; color: var(--bark-2); line-height: 1.5; word-break: normal; }
.cell .vl { font-size: 15px; color: var(--bark-2); white-space: nowrap; }
.cell .chev { width: 18px; height: 18px; color: #8d7f6a; }
a.cell:active, button.cell:active { background: #f1e8cf; }
.cell.danger .lb { color: var(--berry); font-weight: 700; }
.stepper { display: inline-flex; align-items: center; gap: 2px; border-radius: 12px; background: #ebe2c8; }
.stepper button { width: 44px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--moss); border-radius: 10px; }
.stepper button:active { background: #dfd3b2; }
.stepper button svg { width: 18px; height: 18px; }
.stepper b { min-width: 30px; text-align: center; font-family: var(--f-num); font-weight: 400; font-size: 18px; }
.mini-seg { display: inline-grid; grid-auto-flow: column; padding: 3px; border-radius: 11px; background: #ebe2c8; }
.mini-seg button { min-height: 34px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #5a4e40; white-space: nowrap; }
.mini-seg button.on { background: var(--paper); color: var(--moss); box-shadow: 0 2px 6px rgba(58, 46, 34, .16); }
.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; background: #d3c8aa; flex: none; transition: background 220ms; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform 260ms var(--spring); }
.switch[aria-checked="true"] { background: var(--pine); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.range { width: 100%; accent-color: var(--pine); height: 32px; }
.cell.col { flex-direction: column; align-items: stretch; gap: 2px; }
.cell.col .rl { display: flex; justify-content: space-between; align-items: center; }
.foot { margin: 10px 22px 0; font-size: 13px; color: var(--bark-2); line-height: 1.7; word-break: normal; }

/* ---------- 読み物（しくみ・アプリについて） ---------- */
.read { margin: 0 20px; }
.read h2 { margin: 26px 0 8px; font-family: var(--f-head); font-weight: 500; font-size: 20px; color: var(--moss); font-feature-settings: "palt"; }
.read p { margin: 0 0 10px; font-size: 15px; line-height: 1.85; color: var(--bark); word-break: normal; }
.formula { margin: 10px 0 14px; padding: 14px 16px; border-radius: 16px; background: var(--moss); color: #fff7e2; font-family: var(--f-ipa); font-size: 17px; line-height: 1.7; }
.formula small { display: block; font-family: var(--f-body); font-size: 13px; color: #d4dbc4; }
table.ivl { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
table.ivl th, table.ivl td { padding: 9px 8px; text-align: center; font-size: 14px; border-bottom: 1px solid var(--line); white-space: nowrap;  font-family: var(--f-num);}
table.ivl th { font-size: 12px; color: var(--bark-2); font-weight: 700; }
table.ivl td { font-family: var(--f-en); }
table.ivl td:first-child { font-family: var(--f-body); font-weight: 700; color: var(--moss); }
.about-art { display: block; width: 100%; height: 200px; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); }
.note { padding: 14px 16px; border-radius: 18px; background: #f3e2b8; color: #3f2e0a; font-size: 14px; line-height: 1.8; word-break: normal; }
.techs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.techs li { padding: 6px 12px; border-radius: 12px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 500; }

/* ---------- シート・トースト・スプラッシュ ---------- */
.overlay { position: absolute; inset: 0; z-index: 40; }
.overlay .scrim { position: absolute; inset: 0; background: rgba(16, 30, 22, .45); animation: fadeIn 220ms ease both; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: calc(8px + var(--sb)); padding: 10px 18px 18px; border-radius: 34px; background: rgba(252, 248, 236, .98); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); animation: sheetUp 380ms var(--spring) both; }
.sheet .grab { width: 38px; height: 5px; border-radius: 3px; background: #cbbf9f; margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 6px; font-family: var(--f-head); font-weight: 500; font-size: 20px; color: var(--moss); text-align: center; }
.sheet p { margin: 0 0 16px; font-size: 15px; color: var(--bark-2); text-align: center; word-break: normal; }
.sheet .btns { display: grid; gap: 10px; }
.overlay.out .scrim { animation: fadeOut 200ms ease both; }
.overlay.out .sheet { animation: sheetDown 220ms ease both; }
@keyframes sheetUp { from { transform: translateY(110%); } }
@keyframes sheetDown { to { transform: translateY(110%); } }
@keyframes fadeOut { to { opacity: 0; } }
.toast { position: absolute; z-index: 60; left: 50%; top: calc(14px + var(--st)); transform: translate(-50%, -140%); max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 18px; background: var(--moss); color: #fffaf0; font-size: 14px; font-weight: 500; line-height: 1.55; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .5); transition: transform 360ms var(--spring); word-break: normal; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); }

.splash { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--moss); color: var(--cream); transition: opacity 320ms ease; }
.splash img { width: 112px; height: 112px; border-radius: 26px; box-shadow: 0 20px 40px -14px rgba(0, 0, 0, .7); animation: pop 600ms var(--spring) both; }
.splash b { font-family: var(--f-head); font-weight: 500; font-size: 24px; letter-spacing: .2em; color: #fff7e2; }
.splash.out { opacity: 0; pointer-events: none; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }
.onb { position: absolute; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--moss); color: var(--cream); }
.onb .track { flex: 1; display: flex; transition: transform 420ms var(--ease); min-height: 0; }
.onb .slide { flex: 0 0 100%; display: flex; flex-direction: column; padding: calc(56px + var(--st)) 24px 0; }
.onb .slide img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 34px; box-shadow: 0 30px 50px -24px rgba(0, 0, 0, .7); }
.onb h2 { margin: 26px 0 8px; font-family: var(--f-head); font-weight: 500; font-size: 26px; line-height: 1.4; color: #fff7e2; font-feature-settings: "palt"; }
.onb p { margin: 0; font-size: 15px; line-height: 1.8; color: #e1e6d3; word-break: normal; }
.onb .skip { position: absolute; top: calc(8px + var(--st)); right: 12px; min-height: 44px; padding: 0 14px; color: #f3e9cf; font-weight: 700; z-index: 2; }
.onb .foot2 { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px calc(22px + var(--sb)); }
.dots { display: flex; gap: 8px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .3); transition: width 300ms var(--ease), background 300ms; }
.dots i.on { width: 24px; background: var(--gold); }

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

.forest .bare { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 8px 16px; border-radius: 14px; background: var(--paper); color: var(--moss); font-family: var(--f-head); font-size: 15px; white-space: nowrap; box-shadow: 0 6px 16px -8px rgba(31,58,43,.5); }
