/* 話す英語日記 — Listen English News / Speak English Diary(iOS)の見た目を Web に落とし込む。
   Ink/Theme: 淡い空色の紙(paper)、白い角丸パネル(card 18pt)、太い見出し、青 1 色(accent)、チップ色。
   タブバーだけ Liquid Glass(iloveswiftui.pages.dev の作法)。 */
:root {
  --paper: #edf2fc; --card: #ffffff; --chip: #e8f0fd;
  --ink: #000000; --muted: rgba(60, 60, 67, .6); --faint: rgba(60, 60, 67, .3); --rule: rgba(60, 60, 67, .29);
  --accent: #2660e6; --on-accent: #ffffff; --highlight: rgba(38, 96, 230, .13);
  --good: #33ad66; --bad: #e6544d; --rec: #eb4d4d; --orange: #ff9500;
  --role-s: #2b7deb; --role-v: #e6544d; --role-o: #299e6b; --role-c: #ed9421; --role-m: #8c919e;
  --glass: rgba(255, 255, 255, .5); --glass-edge: rgba(255, 255, 255, .95); --glass-shadow: rgba(17, 17, 22, .3); --bubble: rgba(142, 142, 147, .28);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0f1c; --card: #1a2130; --chip: #293347;
    --ink: #ffffff; --muted: rgba(235, 235, 245, .6); --faint: rgba(235, 235, 245, .3); --rule: rgba(84, 84, 88, .65);
    --accent: #639eff; --on-accent: #0a0f1c; --highlight: rgba(99, 158, 255, .2);
    --glass: rgba(26, 33, 48, .62); --glass-edge: rgba(255, 255, 255, .22); --glass-shadow: rgba(0, 0, 0, .6); --bubble: rgba(142, 142, 147, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0f1c; --card: #1a2130; --chip: #293347;
  --ink: #ffffff; --muted: rgba(235, 235, 245, .6); --faint: rgba(235, 235, 245, .3); --rule: rgba(84, 84, 88, .65);
  --accent: #639eff; --on-accent: #0a0f1c; --highlight: rgba(99, 158, 255, .2);
  --glass: rgba(26, 33, 48, .62); --glass-edge: rgba(255, 255, 255, .22); --glass-shadow: rgba(0, 0, 0, .6); --bubble: rgba(142, 142, 147, .22);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro JP", "Hiragino Sans", "Helvetica Neue", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; font-size: 17px; line-height: 1.5; touch-action: manipulation;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
.wrap { max-width: 672px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* ---------------- Liquid Glass(タブバーとプレイヤーだけ) ---------------- */
.liquid {
  position: relative; background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.6) brightness(1.03); -webkit-backdrop-filter: blur(18px) saturate(1.6) brightness(1.03);
  box-shadow: 0 18px 44px -18px var(--glass-shadow), inset 0 0 16px -8px rgba(255, 255, 255, .9),
    inset 1.5px 1.5px 1px -1px var(--glass-edge), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, .45);
}

/* ---------------- 見出し(largeTitle black + subheadline) ---------------- */
.page-head { padding: 14px 0 6px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-head h1 { font-size: 34px; font-weight: 900; letter-spacing: .3px; line-height: 41px; }
.page-head .sub { font-size: 15px; color: var(--muted); margin-top: 2px; }
.streak { display: inline-flex; align-items: center; gap: 5px; background: var(--card); border-radius: 999px; padding: 6px 10px; font-size: 15px; font-weight: 700; color: var(--orange); white-space: nowrap; margin-top: 6px; }
.streak svg { width: 16px; height: 16px; }
.back { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; color: var(--accent); padding: 12px 0 2px; }
.back::before { content: "‹"; font-size: 30px; line-height: 1; margin-top: -5px; }

/* ---------------- タブバー: Liquid Glass(iPhone: 下に浮く / Mac: 左のサイドバー) ---------------- */
.gnav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  display: flex; align-items: center; gap: 4px; padding: 7px; border-radius: 999px; white-space: nowrap; touch-action: none;
}
.gnav .bubble {
  position: absolute; top: 6px; bottom: 6px; left: 0; width: 0; border-radius: 999px; pointer-events: none;
  background: linear-gradient(120deg, rgba(142, 142, 147, .34), rgba(142, 142, 147, .16) 55%, rgba(142, 142, 147, .28));
  box-shadow: 0 8px 18px -10px rgba(17, 17, 22, .35), inset 0 0 10px -5px rgba(255, 255, 255, .8), inset 1.2px 1.2px 1px -1px rgba(255, 255, 255, .75), inset -1.2px -1.2px 1px -1px rgba(255, 255, 255, .4);
  backdrop-filter: blur(1px) saturate(1.3); -webkit-backdrop-filter: blur(1px) saturate(1.3);
  transition: transform .45s cubic-bezier(.22, 1.4, .36, 1), width .45s cubic-bezier(.22, 1.4, .36, 1);
}
.gnav .bubble::before { content: ""; position: absolute; inset: 0; border-radius: inherit; backdrop-filter: blur(4px) brightness(1.12) saturate(1.4); -webkit-backdrop-filter: blur(4px) brightness(1.12) saturate(1.4);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 92%); mask: radial-gradient(closest-side, transparent 60%, #000 92%); }
.gnav .tab { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 22px; border-radius: 999px;
  color: var(--ink); border: 0; background: transparent; cursor: pointer; font-size: 10px; font-weight: 600; letter-spacing: .02em; transition: color .25s; }
.gnav .tab svg { width: 24px; height: 24px; display: block; }
.gnav .tab[aria-current="page"] { color: var(--accent); }
@media (hover: hover) { .gnav .tab:hover { color: var(--accent); } }
@media (max-width: 760px) { .gnav { left: 12px; right: 12px; transform: none; justify-content: space-between; gap: 0; } .gnav .tab { flex: 1; padding: 8px 2px; } }

/* ---------------- 白い角丸パネル(Card 18pt / padding 16) ---------------- */
.panel { background: var(--card); border-radius: 18px; padding: 16px; margin: 0 0 12px; }
.panel.liquid { background: var(--glass); }
.group-label { font-size: 17px; font-weight: 600; padding: 8px 0 8px; }
.panel-title { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.panel-title h2 { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--muted); }
.panel-title .k { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); color: var(--card); font-size: 11px; font-weight: 800; }
.panel-title svg { width: 14px; height: 14px; }
.panel-title .right { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 7px; background: var(--chip); color: var(--muted); }
.chip.blue { color: var(--accent); }
.chip.fill { background: var(--accent); color: var(--on-accent); }
.chip.good { background: var(--good); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 14px 18px;
  font-weight: 600; font-size: 17px; cursor: pointer; background: var(--accent); color: var(--on-accent); width: 100%; white-space: nowrap; transition: opacity .15s, transform .15s; }
.btn svg { width: 18px; height: 18px; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.secondary { background: var(--chip); color: var(--accent); border-radius: 999px; width: auto; padding: 10px 14px; font-size: 15px; }
.btn.gray { background: var(--chip); color: var(--ink); }
.btn.small { width: auto; padding: 8px 14px; font-size: 15px; border-radius: 999px; }
.btn.ghost { background: none; color: var(--accent); width: auto; padding: 4px 2px; font-size: 13px; font-weight: 600; }
.btn.danger { color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 15px; color: var(--muted); line-height: 1.6; }
.seg { display: inline-flex; background: rgba(120, 120, 128, .12); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pills .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pill { border: 0; border-radius: 999px; padding: 7px 12px; font-size: 14px; font-weight: 600; background: var(--chip); color: var(--accent); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.notice { color: var(--bad); font-size: 13px; margin: 0 4px 12px; }
.notice.ok { color: var(--accent); }
.hr { border: 0; border-top: .5px solid var(--rule); margin: 12px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--chip); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.working { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 17px; font-weight: 500; padding: 4px 0; }
details.fold summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; margin-top: 10px; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: "▸ "; }
details.fold[open] summary::before { content: "▾ "; }
details.fold p { font-size: 14px; color: var(--muted); margin-top: 6px; white-space: pre-wrap; }
.mode { display: inline-flex; background: rgba(120, 120, 128, .12); border-radius: 9px; padding: 2px; margin-bottom: 12px; }
.mode button { border: 0; background: none; padding: 5px 14px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.mode button[aria-pressed="true"] { background: var(--card); font-weight: 600; box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.status { font-size: 13px; color: var(--muted); margin-top: 8px; }
.status.rec { color: var(--rec); }

/* 日記の箱(chip 色の角丸 14、右下にマイク 52) */
.diary-box { position: relative; }
.diary-box textarea, .ja-edit { width: 100%; min-height: 150px; resize: vertical; border: 0; border-radius: 14px; padding: 12px 70px 12px 12px;
  font: inherit; font-size: 18px; font-weight: 500; line-height: 1.5; background: var(--chip); color: var(--ink); }
.ja-edit { padding-right: 12px; min-height: 100px; }
.diary-box textarea:focus, .ja-edit:focus { outline: 0; box-shadow: 0 0 0 2px var(--accent); }
.diary-box.listening textarea { box-shadow: 0 0 0 2px rgba(235, 77, 77, .6); }
.mic { position: absolute; right: 10px; bottom: 10px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mic svg { width: 22px; height: 22px; }
.mic[aria-pressed="true"] { background: var(--rec); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(235, 77, 77, .5); } 50% { box-shadow: 0 0 0 12px rgba(235, 77, 77, 0); } }
.count { font-size: 12px; color: var(--faint); text-align: right; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* 英文(EnglishTextView: 単語ごと、役割の下線 2.5pt と頭文字、読み上げ中は青いピル) */
.diff { font-size: 17px; line-height: 1.8; }
.diff del { background: rgba(230, 84, 77, .14); color: var(--bad); text-decoration: line-through; border-radius: 4px; padding: 0 2px; }
.diff ins { background: rgba(51, 173, 102, .16); color: var(--good); text-decoration: none; border-radius: 4px; padding: 0 2px; font-weight: 600; }
.english { font-size: 19px; font-weight: 500; line-height: 1.6; }
.english .w { display: inline-block; border-radius: 5px; padding: 0 2px; margin: 0 1px 0 -2px; transition: background .12s; vertical-align: top; }
.english .w.on { background: var(--accent); color: var(--on-accent); }
.english.roles { line-height: 1.3; }
.english.roles .w { padding-bottom: 14px; position: relative; border-radius: 5px 5px 0 0; }
.english.roles .w::before { content: ""; position: absolute; left: 2px; right: 2px; top: 1.6em; height: 2.5px; background: transparent; }
.english.roles .w[data-role="S"]::before { background: var(--role-s); } .english.roles .w[data-role="V"]::before { background: var(--role-v); }
.english.roles .w[data-role="O"]::before { background: var(--role-o); } .english.roles .w[data-role="C"]::before { background: var(--role-c); }
.english.roles .w[data-role="M"]::before { background: var(--role-m); }
.english.roles .w.start::after { content: attr(data-role); position: absolute; left: 2px; top: calc(1.6em + 3px); font-size: 10px; font-weight: 900; line-height: 1; }
.english.roles .w.start[data-role="S"]::after { color: var(--role-s); } .english.roles .w.start[data-role="V"]::after { color: var(--role-v); }
.english.roles .w.start[data-role="O"]::after { color: var(--role-o); } .english.roles .w.start[data-role="C"]::after { color: var(--role-c); }
.english.roles .w.start[data-role="M"]::after { color: var(--role-m); }
.english.roles .w.on::before { background: transparent; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 12px; background: var(--chip); border-radius: 10px; padding: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; color: #fff; font-style: normal; font-size: 10px; font-weight: 900; }
.ja-text { font-size: 15px; color: var(--muted); white-space: pre-wrap; line-height: 1.7; }
.notes { margin: 0; padding-left: 0; list-style: none; }
.notes li { font-size: 15px; line-height: 1.6; margin: 6px 0; }
.toggle-sv { border: 0; background: none; color: var(--accent); border-radius: 6px; font-size: 14px; font-weight: 900; padding: 3px 7px; cursor: pointer; }
.toggle-sv[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* 練習プレイヤー(PlayerCard: 大きな再生、進み具合、0.7/1.0、くり返し) */
.player-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.play { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.play svg { width: 24px; height: 24px; }
.progress { flex: 1; min-width: 120px; height: 4px; background: rgba(120, 120, 128, .2); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.repeat { border: 0; background: var(--chip); color: var(--accent); border-radius: 8px; padding: 7px 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.repeat[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* 一覧(EntryRow / ArchiveRow: 白いカード 14、サムネ、chevron) */
.entry-row, .story-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 14px; gap: 10px; align-items: center; padding: 12px 14px; margin: 0 0 8px; background: var(--card); border-radius: 14px; color: var(--ink); }
.entry-row .idx { width: 40px; height: 40px; border-radius: 10px; background: var(--chip); color: var(--accent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.entry-row .text, .story-row .headline { font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.entry-row .meta, .story-row .ds { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.entry-row .arw, .story-row .arw { color: var(--faint); font-size: 16px; font-weight: 700; justify-self: end; }
.story-row img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--chip); display: block; }
.story-row .idx, .story-row .cat { display: none; }
.side .entry-row { background: var(--chip); }
.cal-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-bar b { font-size: 18px; font-weight: 900; }
.cal-bar button { border: 0; background: none; color: var(--accent); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 22px; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; }
.cal-grid .dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); }
.cal-grid button { border: 0; background: none; color: var(--ink); height: 38px; border-radius: 50%; font-size: 15px; font-weight: 500; cursor: pointer; font-variant-numeric: tabular-nums; }
.cal-grid button.written { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.cal-grid button.today { box-shadow: inset 0 0 0 2px var(--faint); font-weight: 700; }
.cal-grid button.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-grid button.sel:not(.written) { background: var(--chip); }

/* ニュース(LeadPanel: 画像が上いっぱい、見出し 26 heavy) */
.story-card { display: block; color: inherit; padding: 0; overflow: hidden; }
.story-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--chip); display: block; border-radius: 0; }
.story-card .details { padding: 16px; }
.story-card .headline { font-size: 26px; font-weight: 900; line-height: 1.2; margin: 12px 0; }
.reader img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--chip); display: block; }
.topic { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 3px 7px; }
.levels { display: flex; gap: 4px; margin-left: auto; }
.levels span { font-size: 10px; font-weight: 700; color: var(--accent); background: var(--chip); border-radius: 5px; padding: 2px 5px; }
.bands { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin-top: 10px; background: var(--chip); }
.bands i { display: block; height: 100%; }
.reader .headline { font-size: 26px; font-weight: 900; line-height: 1.2; margin: 12px 0 6px; }
.sent { padding: 8px 10px; border-radius: 12px; font-size: 19px; font-weight: 500; line-height: 1.6; cursor: pointer; margin: 2px -10px; transition: background .2s; }
.sent.playing { background: var(--highlight); }
.sent .w.on { background: var(--accent); color: var(--on-accent); border-radius: 5px; padding: 0 2px; }
.sent .ja { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.player { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); margin-top: 12px; padding: 10px 12px; border-radius: 999px; }
.grammar h3 { font-size: 15px; font-weight: 700; margin: 10px 0 2px; }
.grammar p { font-size: 14px; color: var(--muted); line-height: 1.6; }

/* 設定(リスト) */
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-top: .5px solid var(--rule); font-size: 17px; }
.setting:first-of-type { border-top: 0; padding-top: 0; }
.switch { appearance: none; width: 51px; height: 31px; border-radius: 16px; background: rgba(120, 120, 128, .32); position: relative; cursor: pointer; margin: 0; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); }
.switch:checked { background: var(--good); }
.switch:checked::after { left: 22px; }

/* ---------------- Mac / PC: サイドバー + 2 列 ---------------- */
.cols { display: block; }
@media (min-width: 900px) {
  body { padding-bottom: 40px; padding-left: 232px; }
  .wrap { max-width: 1080px; padding: 0 36px; }
  .gnav { left: 14px; top: 14px; bottom: 14px; right: auto; transform: none; width: 204px; border-radius: 22px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 2px; padding: 20px 10px; }
  .gnav::before { content: "話す英語日記"; display: block; font-size: 15px; font-weight: 900; padding: 4px 12px 16px; }
  .gnav .bubble { top: 0; bottom: auto; left: 10px; right: 10px; width: auto; height: 0; border-radius: 12px; transition: transform .35s cubic-bezier(.22, 1.2, .36, 1), height .35s; }
  .cal-links { display: flex; gap: 8px; flex-wrap: wrap; }
  .gnav .bubble::before { -webkit-mask: none; mask: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .gnav .tab { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 12px; border-radius: 12px; font-size: 15px; font-weight: 500; }
  .gnav .tab svg { width: 20px; height: 20px; }
  .gnav .tab[aria-current="page"] { font-weight: 600; }
  .page-head { padding-top: 26px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 20px; align-items: start; }
  .cols > .side { position: sticky; top: 20px; }
  .player { position: static; }
}
@media (prefers-reduced-motion: reduce) { .gnav .bubble, .btn { transition: none; } }

/* ---------------- 追加: カレンダーの丸、シート、単語カード ---------------- */
.cal-grid button { width: 38px; height: 38px; margin: 0 auto; display: block; }
.gnav .bubble { top: 0; }
@media (max-width: 899px) { .gnav .bubble { top: 6px; } }
.ja-btn { border: 0; background: var(--chip); color: var(--accent); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; margin-left: 6px; vertical-align: middle; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--chip); color: var(--accent); display: inline-grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.small { width: 32px; height: 32px; background: none; color: var(--faint); }
.icon-btn.small svg { width: 16px; height: 16px; }
.sheet-back { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0); display: flex; align-items: flex-end; justify-content: center; transition: background .25s; }
.sheet-back.show { background: rgba(0, 0, 0, .35); }
.sheet { width: 100%; max-width: 560px; margin: 0; border-radius: 22px 22px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .9, .3, 1); max-height: 85vh; overflow: auto; }
.sheet-back.show .sheet { transform: none; }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto 14px; }
.word-head { font-size: 28px; font-weight: 900; letter-spacing: -.01em; }
.word-head.big { font-size: 40px; }
.word-meaning { font-size: 22px; font-weight: 700; margin-top: 8px; }
.word-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; margin-top: 12px; background: var(--chip); }
.example { font-size: 16px; margin-top: 12px; line-height: 1.6; }
.stage-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--chip); gap: 2px; }
.stage-bar i { display: block; height: 100%; min-width: 4px; }
.stage-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; }
.stage-legend span { display: inline-flex; align-items: center; gap: 5px; }
.stage-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.stage-legend b { color: var(--muted); font-variant-numeric: tabular-nums; }
.word-row .idx { border: 0; cursor: pointer; }
.word-row .idx svg { width: 18px; height: 18px; }
.word-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
.study-card { border-radius: 28px; padding: 28px 20px; min-height: 360px; display: flex; align-items: center; justify-content: center; text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; }
.study-card .face { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.study-card .face .row { width: 100%; }
.study-card .example, .study-card .face > p { text-align: left; width: 100%; }
.study-card .word-img { max-height: 160px; }
@media (min-width: 900px) { .sheet { border-radius: 22px; margin-bottom: 24px; } .sheet-back { align-items: center; } .sheet { transform: scale(.96); opacity: 0; transition: transform .2s, opacity .2s; } .sheet-back.show .sheet { transform: none; opacity: 1; } }

/* ライトモードのガラスは白く・軽く(黒っぽく見えないように)。 */
:root { --glass: rgba(255, 255, 255, .78); --glass-shadow: rgba(17, 17, 22, .16); --bubble: rgba(142, 142, 147, .16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass: rgba(26, 33, 48, .62); --glass-shadow: rgba(0, 0, 0, .6); } }
:root[data-theme="dark"] { --glass: rgba(26, 33, 48, .62); --glass-shadow: rgba(0, 0, 0, .6); }
.gnav .bubble { background: linear-gradient(120deg, rgba(142, 142, 147, .26), rgba(142, 142, 147, .12) 55%, rgba(142, 142, 147, .2)); }
.liquid { box-shadow: 0 12px 32px -14px var(--glass-shadow), inset 0 0 0 .5px rgba(255, 255, 255, .6), inset 1.5px 1.5px 1px -1px rgba(255, 255, 255, .9), inset -1.5px -1.5px 1px -1px rgba(255, 255, 255, .4); }

/* ---------------- 細部: 角丸の体系と、プレイヤーの配置 ----------------
   パネル 18 / 中の要素(画像・入力欄・箱) 12 / コントロール(セグメント) 9 / チップ・ピル 999 / 主ボタン 14 */
.panel { border-radius: 18px; }
.reader img, .story-card img, .word-img, .diary-box textarea, .ja-edit, .legend, .entry-row .idx { border-radius: 12px; }
.story-card { border-radius: 18px; }
.story-card img { border-radius: 0; }
.entry-row, .story-row { border-radius: 14px; }
.story-row img { border-radius: 8px; }
.player { position: static; border-radius: 18px; padding: 14px 16px; margin-top: 12px; }
.player .row.between { display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 14px; align-items: center; }
.player .play { grid-row: 1 / span 2; }
.player .seg, .player label.row { justify-self: start; }
.player label.row { gap: 10px; }
@media (max-width: 899px) { .player { position: sticky; bottom: calc(86px + env(safe-area-inset-bottom)); } }
.reader .headline, .story-card .headline, .page-head h1, .word-head { color: var(--ink); }
.group-label { font-size: 15px; font-weight: 700; color: var(--ink); padding: 10px 4px 8px; }
.back { font-weight: 500; }
.seg { border-radius: 9px; }
.seg button { border-radius: 7px; }
.player-card { gap: 12px; }
.player-card .seg { margin-left: auto; }
