/* デザイントークン（承認済み方針: 骨格は1つ・肌は交換可能）
   既定=OS追従。theme.ts が :root[data-theme] を立て、手動固定がメディアクエリを上書きする。
   将来の着せ替えテーマ（計器盤/紙面/庭）は data-theme の値を増やして同トークンを差し替える。 */

/* 構造トークン（テーマ非依存）: 角丸・タップ・トランジション */
:root {
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 9px;
  --tap: 44px;
  --tabbar-h: 58px; /* 下部タブの中身の高さ（safe-area は別途 body/tabbar が持つ） */
  --tr: 0.14s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* WKWebView は通常の rem 指定だけでは iOS の Dynamic Type を反映しない。
   main.tsx が -apple-system-body の実測値と標準値の差を --native-font-delta へ
   設定し、各 font-size へ加える。レイアウト計算にも反映されるため文字が正しく
   折り返され、rem の余白・カード幅は拡大しない。下部ナビを含むハイブリッドUIが
   操作不能にならないよう、差分は -3〜12px に収める。 */
:root[data-native='true'] {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root[data-native='true'] button,
:root[data-native='true'] input,
:root[data-native='true'] select {
  min-height: 44px;
}

:root[data-large-text='true'] .hero-main {
  padding-right: 0;
}
:root[data-large-text='true'] .hero-main .ringwrap {
  position: relative;
  align-self: flex-start;
  width: 100px;
  height: 100px;
}
:root[data-large-text='true'] .ringwrap svg { width: 100%; height: 100%; }
:root[data-large-text='true'] .hero-cta-sub {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.board-view:not(.is-managing) .tile.is-slot {
  min-height: 0;
  padding: 0.8rem;
}
.board-view:not(.is-managing) .tile.is-slot .tile-mid {
  display: none;
}
.preparation-hint,
.study-next-preview {
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--card);
}
.study-next-preview p { margin: 0.35rem 0; }
.deck-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; }
.deck-filters input { flex: 1; min-width: 12rem; }
.view-loading { min-height: 45vh; padding: 1.2rem; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--card); }
.view-loading-block { height: 6rem; margin-top: 1rem; border-radius: var(--radius); background: var(--surface-2); }

/* 色トークン（既定＝ライト。3階層サーフェス: ページ地 → カード → 隆起面） */
:root,
:root[data-theme='light'] {
  --bg: #eef1f5; /* ページ地。カード(#fff)より一段沈めて階層を作る */
  --card: #ffffff;
  --surface-2: #f5f8fc; /* 隆起面・選択面（藍寄りの中間層） */
  --ink: #1b1d20;
  --muted: #616a74;
  --hair: rgba(27, 33, 45, 0.13);
  --hair-soft: rgba(27, 33, 45, 0.07);
  --accent: #2d4b73; /* 藍 — 案B由来のニュートラルな知的色 */
  --accent-2: #3e6ea6; /* 明るい藍（グラデ・光用） */
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--card));
  --accent-ink: #ffffff;
  --ok: #2e7d4f;
  --danger: #b3392e;
  --danger-ink: #ffffff;
  --shadow-1: 0 1px 2px rgba(20, 28, 45, 0.07);
  --shadow-2: 0 8px 22px -14px rgba(20, 28, 45, 0.2);
  --shadow-3: 0 16px 34px -16px rgba(20, 28, 45, 0.28);
  --glow: radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--accent-2) 15%, transparent), transparent 60%);
  /* 箱分布: 単一色相（藍）の濃淡 = 苦手 → 定着 */
  --box1: #d9e0e9;
  --box2: #b4c4d7;
  --box3: #8ba6c2;
  --box4: #5d84ab;
  --box5: #2d4b73;
  --box-hi-ink: #ffffff; /* 濃い箱の上の文字色 */
  color-scheme: light;
}

/* ダーク: 黒一色にせず、わずかに青を含む面の階層を作る */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --card: #191e25;
    --surface-2: #212936;
    --ink: #e7e9ec;
    --muted: #99a1ab;
    --hair: rgba(233, 238, 245, 0.15);
    --hair-soft: rgba(233, 238, 245, 0.08);
    --accent: #6f9fd0;
    --accent-2: #8fb8e0;
    --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--card));
    --accent-ink: #0e1116;
    --ok: #5cb384;
    --danger: #e06c5f;
    --danger-ink: #0e1116;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
    --shadow-3: 0 18px 38px -16px rgba(0, 0, 0, 0.7);
    --glow: radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
    --box1: #2a323c;
    --box2: #37485c;
    --box3: #47617f;
    --box4: #5a81a9;
    --box5: #6f9fd0;
    --box-hi-ink: #0e1116;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0e1116;
  --card: #191e25;
  --surface-2: #212936;
  --ink: #e7e9ec;
  --muted: #99a1ab;
  --hair: rgba(233, 238, 245, 0.15);
  --hair-soft: rgba(233, 238, 245, 0.08);
  --accent: #6f9fd0;
  --accent-2: #8fb8e0;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, var(--card));
  --accent-ink: #0e1116;
  --ok: #5cb384;
  --danger: #e06c5f;
  --danger-ink: #0e1116;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 10px 24px -14px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 18px 38px -16px rgba(0, 0, 0, 0.7);
  --glow: radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 62%);
  --box1: #2a323c;
  --box2: #37485c;
  --box3: #47617f;
  --box4: #5a81a9;
  --box5: #6f9fd0;
  --box-hi-ink: #0e1116;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  font-size: calc(1rem + var(--native-font-delta, 0px));
  line-height: 1.6;
  /* ダブルタップ拡大を止める。タイルやボタンを続けて叩いたときに画面ごと拡大され、
     戻せなくなるのを防ぐ。スクロールとピンチは残るので拡大手段は失わない。 */
  touch-action: manipulation;
  padding:
    var(--safe-top)
    var(--safe-right)
    var(--safe-bottom)
    var(--safe-left);
}

/* body の safe-top は文書先頭の余白なので、スクロールすると本文と一緒に流れる。
   下端の fixed tabbar と同様に、上端も不透明な固定面で塞いでステータスバーと
   本文を分離する。env() が 0 の Web では高さ 0 となり、表示を変えない。 */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--safe-top);
  background: var(--bg);
  pointer-events: none;
}

.num,
.meta,
kbd {
  font-variant-numeric: tabular-nums;
}

.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.app-sidebar {
  padding: 1rem;
  border-right: 1px solid var(--hair-soft);
  display: flex;
  flex-direction: column;
  position: sticky; /* 本文が長くても配色トグル（side-foot）を画面内に保つ */
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.app-sidebar h1 {
  font-size: calc(1rem + var(--native-font-delta, 0px));
  margin: 0 0 1rem;
}

main {
  padding: 1rem 1.5rem;
  max-width: 860px;
}

h2 {
  font-size: calc(1rem + var(--native-font-delta, 0px));
  margin: 1rem 0 0.5rem;
}

.muted {
  color: var(--muted);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.meta {
  margin-left: 0.6em;
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
  font-weight: normal;
  color: var(--muted);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.deck-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.deck-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.3rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: transparent;
}

.deck-list .meta {
  display: block;
  margin-left: 0;
}

.side-foot {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 1rem;
}

.theme-toggle,
.side-guide {
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  color: var(--muted);
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: transparent;
  padding: 0.3rem 0.7rem;
}

.side-guide {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.side-guide span {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: calc(0.7rem + var(--native-font-delta, 0px));
  font-weight: 850;
}

.side-guide b {
  font-weight: 700;
}

.import input[type='text'],
.import textarea {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--card);
  color: inherit;
}

.import textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.actions button {
  padding: 0.45rem 1rem;
  margin-right: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

.actions button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.actions button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--danger-ink);
}

.actions button:disabled {
  opacity: 0.4;
  cursor: default;
}

.message.ok {
  color: var(--ok);
}

.message.error {
  color: var(--danger);
}

.ignored {
  min-width: 0;
}

.ignored-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.ignored-row {
  display: grid;
  grid-template-columns: max-content minmax(12rem, auto) minmax(0, 1fr);
  gap: 0.2rem 0.6rem;
  align-items: start;
  min-width: 0;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--hair-soft);
}

.ignored .line {
  color: var(--muted);
  white-space: nowrap;
}

.ignored .reason {
  color: #b3541e;
  overflow-wrap: anywhere;
}

.ignored .text {
  min-width: 0;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.items {
  list-style: none;
  padding: 0;
}

.items .item {
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid var(--hair-soft);
}

.item.card .front {
  font-weight: 600;
}

.item.card .reading,
.item.card .sep {
  color: var(--muted);
  margin: 0 0.4em;
}

.item.mcq .question {
  white-space: pre-wrap;
}

.item.mcq ol li.correct {
  font-weight: 600;
  color: var(--ok);
}

.item.mcq .explanation,
.drill .explanation {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: var(--muted);
  border-left: 3px solid var(--hair);
  padding-left: 0.6em;
  white-space: pre-wrap;
}

/* --- 学習画面（共通シェル） --- */

.study-layout {
  grid-template-columns: 1fr;
}

.study {
  width: 100%;
  min-width: 0;
  max-width: 680px;
  margin: 0 auto;
  padding-top: 2rem;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.study-head {
  position: sticky;
  top: var(--safe-top);
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--tap);
  margin-bottom: 1rem;
  padding: 0.2rem 0;
  background: var(--bg);
}

.study-head .study-exit {
  flex: 0 0 auto;
  white-space: nowrap;
}

.study-head .study-meta {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}

.study-head .study-title {
  color: var(--ink);
  font-weight: 650;
}

.study-head .study-progress {
  display: inline-block;
  margin-left: 0.35rem;
  white-space: nowrap;
}

.study-head button,
.study > button {
  min-height: var(--tap);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

.study .actions {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 1rem;
}

.study .actions button {
  min-height: 50px;
  padding: 0.65rem 1.4rem;
  margin: 0;
  font-size: calc(1.05rem + var(--native-font-delta, 0px));
  font-weight: 650;
}

.study kbd {
  display: none;
  font-size: 0.75em;
  opacity: 0.7;
  margin-left: 0.4em;
  font-family: inherit;
}

.study .result {
  font-size: calc(1.1rem + var(--native-font-delta, 0px));
}

.study .meta,
.study .muted {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}

.study .message,
.study .explanation {
  line-height: 1.7;
}

/* キー操作はPC Webの補助導線。タッチ端末では主ラベルから完全に分離する。 */
.keyboard-only,
.keyboard-hint {
  display: none;
}

.keyboard-hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
  text-align: center;
}

/* --- フラッシュカード --- */

.flashcard {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: 1.5rem;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  user-select: none;
}

.flashcard .front {
  font-size: calc(1.6rem + var(--native-font-delta, 0px));
  font-weight: 600;
}

.flashcard .front .reading,
.flashcard .back .reading {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
  font-weight: normal;
  color: var(--muted);
  margin-left: 0.4em;
}

.flashcard .back {
  font-size: calc(1.1rem + var(--native-font-delta, 0px));
  white-space: pre-wrap;
}

.flashcard .back .extras {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: var(--muted);
  margin-top: 0.5rem;
  white-space: pre-wrap;
}

.flashcard .hint {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
  color: var(--muted);
}

/* --- 選択式ドリル --- */

.drill .question {
  font-size: calc(1.15rem + var(--native-font-delta, 0px));
  white-space: pre-wrap;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
}

.drill .choices {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.drill .choice {
  width: 100%;
  min-height: 50px;
  text-align: left;
  padding: 0.7rem 0.95rem;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--card);
}

.drill .choice kbd {
  margin: 0 0.6em 0 0;
  color: var(--muted);
}

.drill .choice.sel {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.drill .choice.ans {
  border-color: var(--ok);
  box-shadow: inset 0 0 0 1px var(--ok);
}

.drill .choice.missel {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
}

.drill .choice.dim {
  opacity: 0.55;
}

.drill .choice:disabled {
  cursor: default;
}

.drill .verdict-area .message {
  font-weight: 600;
}

/* --- デッキ詳細の学習導線と箱分布 --- */

.deck-study {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.5rem 0 0.6rem;
  flex-wrap: wrap;
}

.deck-study button.primary {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.boxdist {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}

.boxdist .box {
  min-width: 1.6em;
  text-align: center;
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
  padding: 0.1em 0.2em;
  border-radius: 4px;
}

.boxdist .box-1 { background: var(--box1); }
.boxdist .box-2 { background: var(--box2); }
.boxdist .box-3 { background: var(--box3); }
.boxdist .box-4 { background: var(--box4); color: var(--box-hi-ink); }
.boxdist .box-5 { background: var(--box5); color: var(--box-hi-ink); }

/* --- 推薦プロンプト --- */

.prompt-box {
  margin-bottom: 0.8rem;
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  background: var(--card);
}

.prompt-box summary {
  cursor: pointer;
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}

.prompt-box pre {
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid var(--hair-soft);
  border-radius: 6px;
  background: var(--bg);
}

.prompt-box button {
  padding: 0.35rem 0.9rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

/* --- 今日（逆算プラン） --- */

.today {
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--card);
  padding: 0.8rem 1.1rem 1rem;
  margin-bottom: 1.4rem;
}

.today h2 {
  margin-top: 0;
}

.today .linklike {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  margin-left: 0.8em;
  padding: 0;
}

.exam-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.exam-form input {
  font: inherit;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--bg);
  color: inherit;
}

.exam-form input[type='number'] {
  width: 4.5em;
}

.exam-form button {
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

.plan-rows {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.plan-rows li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--hair-soft);
}

.plan-rows li:last-child {
  border-bottom: 0;
}

.plan-rows button.primary {
  padding: 0.3rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.plan-rows .row-title {
  font-weight: 600;
  font-size: calc(0.92rem + var(--native-font-delta, 0px));
}

/* --- ディクテーション --- */

.dictation-play {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.dictation-play button.primary {
  min-height: 50px;
  padding: 0.55rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.dictation-form {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.dictation-form .primary {
  min-height: 52px;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
}

.dictation-form .primary:disabled {
  cursor: default;
  opacity: 0.4;
}

.dictation-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  font: inherit;
  font-size: calc(1.15rem + var(--native-font-delta, 0px));
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--card);
  color: inherit;
}

.dictation-answer {
  margin: 0.5rem 0;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--hair-soft);
  border-radius: 8px;
  background: var(--card);
}

.dictation-typed {
  text-decoration: line-through;
  color: var(--danger);
}

/* --- 今日ヒーロー（計器盤×紙面の折衷） --- */

.today-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.2rem;
  align-items: start;
  margin: 0.3rem 0 1rem;
}

.today-hero .label {
  display: block;
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
  letter-spacing: 0.14em;
  color: var(--muted);
}

.today-hero .big {
  font-size: calc(2rem + var(--native-font-delta, 0px));
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.today-hero .big small {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.25em;
}

.today-hero .delta {
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  font-weight: 400;
  margin-left: 0.7em;
}

.today-hero .delta.up { color: var(--ok); }
.today-hero .delta.down { color: var(--danger); }

.spark { display: block; margin-top: 0.3rem; }
.spark-line { stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; }
.spark-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.spark-dot { fill: var(--accent); }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hero-today {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.ringwrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
}

.ring-track { stroke: color-mix(in srgb, currentColor 12%, transparent); }
.ring-fill { stroke: var(--accent); }

.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  font-weight: 600;
}

.hero-today-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
}

.grass {
  display: grid;
  grid-template-rows: repeat(7, 8px);
  grid-auto-flow: column;
  grid-auto-columns: 8px;
  gap: 2px;
}

.grass i {
  border-radius: 2px;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.grass .g1 { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.grass .g2 { background: color-mix(in srgb, var(--accent) 65%, transparent); }
.grass .g3 { background: var(--accent); }

/* --- レスポンシブ（スマホ幅） --- */

@media (max-width: 720px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .app-sidebar {
    position: static;
    height: auto;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--hair-soft);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
  }

  .app-sidebar h1 {
    margin: 0;
    flex: 1 1 100%;
  }

  .app-sidebar h2 {
    display: none;
  }

  .deck-list {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    flex: 1 1 auto;
  }

  .deck-list li {
    flex: none;
  }

  .deck-list button {
    margin-bottom: 0;
    white-space: nowrap;
  }

  .deck-list .meta {
    display: none;
  }

  .side-foot {
    margin-top: 0;
    padding-top: 0;
    flex: none;
  }
  .side-guide {
    width: 34px;
    min-height: 34px;
    justify-content: center;
    padding: 0.25rem;
  }
  .side-guide b {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  main {
    padding: 0.9rem 1rem 2rem;
  }

  .today-hero {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  .grass {
    grid-template-rows: repeat(7, 6px);
    grid-auto-columns: 6px;
  }

  .flashcard {
    min-height: 180px;
  }

  .plan-rows li {
    flex-wrap: wrap;
  }

  .exam-form input[type='text'] {
    flex: 1 1 100%;
  }
}

/* プリセット選択 */

.prompt-preset {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.prompt-preset-label,
.prompt-filter-note {
  flex: 1 0 100%;
}

.prompt-preset-label {
  font-weight: 700;
}

.prompt-preset select {
  font: inherit;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--bg);
  color: inherit;
}

/* --- ダッシュボード（土俵） --- */

.side-nav {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.side-nav button {
  min-height: var(--tap);
  flex: 1;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: transparent;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.side-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.side-nav button:disabled {
  background: color-mix(in srgb, var(--card) 45%, transparent);
  border-color: color-mix(in srgb, var(--hair) 65%, transparent);
  color: var(--muted);
  opacity: 0.42;
  cursor: not-allowed;
}

.dashboard .linklike,
.today .linklike {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  margin-left: 0.4em;
  padding: 0;
}

.dash-message { margin: 0.3rem 0; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.8rem;
  margin-top: 1.1rem;
}

.tile {
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  padding: 0.7rem 0.85rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: grab;
}

.tile.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 2.75rem;
  padding-right: 6.25rem;
}

.tile-tool {
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
  letter-spacing: 0.04em;
  color: var(--muted);
}

.tile-remove {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
}

.billing-usage {
  margin: 1rem 0 1.5rem;
  padding: 1.15rem;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: var(--card);
}

.billing-usage-head span {
  color: var(--muted);
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  letter-spacing: 0.12em;
}

.billing-usage-head h3 {
  margin: 0.15rem 0 1rem;
}

.billing-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1rem;
}

.billing-usage-item > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.billing-usage-item progress {
  width: 100%;
  accent-color: var(--accent);
}

.billing-usage > p {
  margin: 0.9rem 0 0;
  color: var(--muted);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.tile-deck {
  font-weight: 600;
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
  line-height: 1.4;
}

.tile-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5em;
  min-height: 1.4em;
}

.due-badge,
.new-badge {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  padding: 0.1em 0.5em;
  border-radius: 999px;
  white-space: nowrap;
}

.due-badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.new-badge {
  border: 1px solid var(--accent);
  color: var(--accent);
}

.tile-start {
  margin-top: auto;
  padding: 0.4rem 0;
  border-radius: 7px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.tile-start:disabled {
  opacity: 0.4;
}

.tile-add {
  border-style: dashed;
  background: transparent;
  justify-content: center;
  cursor: default;
}

.tile-add-open {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
  padding: 1.2rem 0;
}

.palette {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.palette select,
.palette button {
  font: inherit;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--bg);
  color: inherit;
}

.palette hr {
  border: 0;
  border-top: 1px solid var(--hair-soft);
  margin: 0.2rem 0;
}

/* --- エリア構成（学習/パッケージ/ツール） --- */

.area-head {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  font-weight: 600;
  margin: 1.2rem 0 0.5rem;
}

.learn-area {
  min-height: 120px;
  border: 1px dashed var(--hair);
  border-radius: 12px;
  padding: 0.7rem;
  margin-top: 0;
}

.learn-empty {
  margin: 0.5rem 0 0;
}

.source-areas {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.source-area {
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--card);
  padding: 0.7rem 1rem 0.5rem;
  height: 178px; /* 見出し + タイル1段の固定高。あふれは横スクロール */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.source-area h3 {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  font-weight: 600;
  margin: 0 0 0.5rem;
  flex: none;
}

.source-tiles {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding: 0.2rem 0.1rem 0.5rem;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.source-tiles {
  align-items: center;
}

.source-tile {
  flex: none;
  width: 118px;
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--bg);
  cursor: grab;
  scroll-snap-align: start;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.source-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.source-tile:active {
  cursor: grabbing;
  transform: translateY(0);
}

.source-tile .tile-icon {
  font-size: calc(1.7rem + var(--native-font-delta, 0px));
  line-height: 1;
}

.source-tile .tile-label {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  line-height: 1.3;
  text-align: center;
  padding: 0 0.4rem;
  color: var(--ink);
}

.source-tile.package {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg));
}

@media (prefers-reduced-motion: reduce) {
  .source-tile,
  .source-tile:hover {
    transition: none;
    transform: none;
  }
}

.deck-chooser {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--card);
}

.deck-chooser button {
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.deck-chooser button.linklike {
  border: 0;
  color: var(--muted);
}


/* パッケージ空枠 */

.slot-label {
  color: var(--muted);
  font-weight: 500;
}

.tile:has(.slot-actions) {
  border-style: dashed;
  background: transparent;
}

.slot-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: auto;
}

.slot-actions .linklike {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  padding: 0;
}

/* --- 取り込み・デッキ画面（役割分離） --- */

.side-nav-v {
  flex-direction: column;
}

.import-step {
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  padding: 0.9rem 1.1rem 1rem;
  margin-bottom: 1rem;
}

.import-step h2 {
  margin-top: 0;
}

.step-no {
  display: inline-grid;
  place-items: center;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8em;
  margin-right: 0.4em;
}

.import-step input[type='text'],
.import-step textarea {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--bg);
  color: inherit;
}

.import-step textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.copy-btn {
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.prompt-body pre {
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  white-space: pre-wrap;
  max-height: 260px;
  overflow: auto;
  padding: 0.6rem;
  border: 1px solid var(--hair-soft);
  border-radius: 6px;
  background: var(--bg);
}

.import-view .linklike,
.decks-view .linklike {
  border: 0;
  background: none;
  color: var(--accent);
  text-decoration: underline;
  padding: 0;
  font-size: inherit;
}

.deck-cards {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
}

.deck-card {
  width: 100%;
  text-align: left;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--card);
  padding: 0.7rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.deck-card-title {
  font-weight: 600;
}

.deck-detail-head button {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

.deck-srs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.6rem 0;
}

.deck-srs-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.deck-srs-row .row-title {
  font-size: calc(0.88rem + var(--native-font-delta, 0px));
  font-weight: 600;
  min-width: 10em;
}

.deck-manage {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}

.deck-manage .primary {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.worksheet-card {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--hair));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 58%),
    var(--card);
  box-shadow: var(--shadow-1);
}

.worksheet-intro {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
}

.worksheet-icon {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: calc(1.25rem + var(--native-font-delta, 0px));
}

.worksheet-intro h3 {
  margin: 0;
  font-size: calc(1rem + var(--native-font-delta, 0px));
}

.worksheet-intro p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}

.worksheet-controls {
  display: grid;
  grid-template-columns: minmax(13rem, 1.5fr) minmax(7rem, 0.7fr) minmax(9rem, 0.8fr);
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.worksheet-controls label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  font-weight: 650;
}

.worksheet-controls select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: calc(0.88rem + var(--native-font-delta, 0px));
}

.worksheet-controls select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.worksheet-action {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.worksheet-action .primary {
  min-height: var(--tap);
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  white-space: nowrap;
}

.card-editor {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.card-editor h3 {
  margin: 0 0 0.75rem;
}

.card-editor-grid,
.card-edit-row {
  display: grid;
  /* Use the actual content width, not the viewport (iPad keeps its sidebar). */
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 0.65rem;
  align-items: center;
}

.card-editor-grid > input,
.card-editor-grid > textarea,
.card-edit-row > input,
.card-edit-row > textarea {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.card-editor-grid > button,
.card-edit-row > .card-row-actions {
  grid-column: 1 / -1;
  justify-self: start;
  max-width: 100%;
}

.card-edit-row > .card-row-actions {
  flex-wrap: wrap;
}

.card-editor-grid textarea,
.card-edit-row textarea {
  resize: vertical;
}

.card-edit-row > .message {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
}

.card-manage-row {
  justify-content: space-between;
  gap: 1rem;
}

.card-content {
  min-width: 0;
}

.card-row-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .worksheet-controls {
    grid-template-columns: 1fr;
  }

  .worksheet-action {
    align-items: stretch;
    flex-direction: column;
  }

  .worksheet-action .primary {
    width: 100%;
  }

  .card-editor-grid,
  .card-edit-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .card-manage-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.danger-outline {
  padding: 0.45rem 1rem;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: transparent;
  color: var(--danger);
}

.confirm-delete {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: calc(0.88rem + var(--native-font-delta, 0px));
}

.confirm-delete .danger {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  border: 1px solid var(--danger);
  background: var(--danger);
  color: var(--danger-ink);
}

/* ---- シャドーイング ---- */

.shadow-actions {
  flex-wrap: wrap;
}

/* 自己評価は主要2動作を内容幅で保ち、幅不足時は末尾のスキップから次行へ送る。 */
.study .shadow-eval-actions {
  flex-wrap: wrap;
  gap: 0.65rem 0.8rem;
}

.study .shadow-eval-actions button {
  margin: 0;
  white-space: nowrap;
}

.study .shadow-eval-actions .shadow-eval-choice {
  flex: 0 0 auto;
}

.study .shadow-eval-actions .shadow-skip {
  flex: 0 1 auto;
}

.shadow-card .back {
  color: var(--muted);
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
}

.shadow-note {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}

.shadow-chart {
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--hair-soft);
  border-radius: 10px;
  background: var(--card);
}

.shadow-chart-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.8rem;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.shadow-chart canvas {
  width: 100%;
  display: block;
}

/* --- Pointer ドラッグ --- */

.tile-controls {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.tile-grip {
  border: 0;
  background: none;
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
  color: var(--muted);
  cursor: grab;
  touch-action: none; /* タッチのドラッグ開始点（本体はスクロール/タップ用のまま） */
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  user-select: none;
}

.tile-grip:active {
  cursor: grabbing;
}

.tile-remove-confirm p {
  margin: 0;
}

.tile {
  position: relative;
}

.tile.dragging {
  opacity: 0.4;
}

.learn-area.drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}

.drag-ghost {
  position: fixed;
  z-index: 50;
  transform: translate(-50%, -120%);
  pointer-events: none;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.35rem 0.7rem;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.4);
}

/* モバイル: グリッド/フレックスの min-content 連鎖でレイアウトビューポートが
   膨張しないよう、縮みを明示的に許可する */
.layout > main,
.layout > .app-sidebar {
  min-width: 0;
}

/* トレイのスクロール余地アフォーダンス */

.source-tray {
  position: relative;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tray-nav {
  position: absolute;
  top: 0;
  bottom: 0.5rem;
  width: 46px;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--ink);
  font-size: calc(1.5rem + var(--native-font-delta, 0px));
  cursor: pointer;
  padding: 0;
}

.tray-nav-right {
  right: 0;
  background: linear-gradient(to right, transparent, var(--card) 70%);
}

.tray-nav-left {
  left: 0;
  background: linear-gradient(to left, transparent, var(--card) 70%);
}

.tray-nav:hover {
  color: var(--accent);
}

/* --- ホーム（資格横断） --- */

.today-boards {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.today-boards li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--hair);
  border-radius: 10px;
  background: var(--card);
  padding: 0.55rem 0.8rem;
  flex-wrap: wrap;
}

.today-boards .row-title {
  font-weight: 600;
}

.board-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
  margin-top: 0.4rem;
  align-items: start; /* 作成パネル展開時に他カードを引き伸ばさない */
}

.board-card {
  position: relative;
  width: 100%;
  text-align: left;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  padding: 0.8rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 96px;
}

button.board-card:hover {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.board-card-name {
  font-weight: 650;
  font-size: calc(1.02rem + var(--native-font-delta, 0px));
}

.board-card .due-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
}

.board-card-add {
  border-style: dashed;
  justify-content: center;
  align-items: stretch;
}

/* --- ボード（資格単位） --- */

.board-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.board-head > button {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--hair);
  background: transparent;
}

.board-head h2 {
  margin: 0.2rem 0 0.5rem;
}

.board-view .exam-form {
  margin-bottom: 0.6rem;
}

.board-manage {
  margin-top: 1.6rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--hair-soft);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* --- 定着率（教材の定着 — 合格可能性ではない） --- */

.mastery {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.mastery > .meta {
  white-space: nowrap;
}

.mastery-bar {
  flex: 1 1 40px;
  max-width: 84px;
  height: 6px;
  border-radius: 3px;
  background: var(--hair-soft);
  overflow: hidden;
}

.mastery-bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
}

.pace-badge {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--danger);
  color: var(--danger);
  white-space: nowrap;
}

.pace-warn {
  color: var(--danger);
}

/* --- タイル画像（絵文字フォールバックと同寸で置換） --- */

.tile-icon-img {
  object-fit: contain;
  vertical-align: -0.2em;
}

.source-tile .tile-icon-img {
  width: 44px;
  height: 44px;
}

.tile-tool .tile-icon-img {
  vertical-align: -0.25em;
}

.board-create .tile-icon-img {
  vertical-align: -0.35em;
  margin-right: 0.2rem;
}

/* --- 立体感パス（2026-07-19 owner要望: タイルに深み） ---
   影は環境光(広く淡い)+接地(狭く濃い)の2層。面はごく薄い上光グラデーション。
   画像には落ち影で「置いてある」感を出す。 */

.tile,
.board-card,
.source-tile {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(15, 20, 30, 0.03));
  box-shadow:
    0 1px 2px rgba(15, 20, 30, 0.08),
    0 8px 20px -12px rgba(15, 20, 30, 0.25);
}

.tile-icon-img,
.tile-art-side .tile-icon,
.board-card-art {
  filter: drop-shadow(0 3px 4px rgba(15, 20, 30, 0.28));
}

.tile-mid {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tile-mid .tile-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tile-art-side {
  flex: none;
  line-height: 1;
}

.tile-art-side .tile-icon {
  font-size: calc(2.4rem + var(--native-font-delta, 0px));
}

.board-card {
  min-height: 120px;
  padding-right: 4.6rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

button.board-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 2px 3px rgba(15, 20, 30, 0.08),
    0 14px 28px -14px rgba(15, 20, 30, 0.35);
}

.board-card-art {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .board-card,
  .source-tile {
    transition: none;
  }
  button.board-card:hover,
  .source-tile:hover {
    transform: none;
  }
}

/* --- 選択シート（デッキ選択をオーバーレイ化: スマホで画面外に出る問題の根治） --- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 20, 0.42);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.deck-chooser.sheet {
  margin-top: 0;
  width: min(420px, 100%);
  max-height: 72vh;
  overflow-y: auto;
  flex-direction: column;
  align-items: stretch;
  padding: 0.9rem;
  border-radius: 14px;
  box-shadow: 0 18px 48px -18px rgba(10, 14, 20, 0.5);
}

.deck-chooser.sheet .sheet-title {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.deck-chooser.sheet button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.8rem; /* 44px級のタップターゲット */
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
}

.deck-chooser.sheet button.sheet-cancel {
  border-color: var(--hair);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  /* スマホはボトムシート */
  .sheet-backdrop {
    place-items: end stretch;
    padding: 0;
  }
  .deck-chooser.sheet {
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
  }
}

/* 空き枠の第2アクション: リンクをやめて押せるボタンに（スマホのタップ性） */
.slot-actions .tile-alt {
  width: 100%;
  min-height: 40px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: transparent;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: inherit;
}

/* --- 穴埋め --- */

.cloze .cloze-text {
  font-size: calc(1.15rem + var(--native-font-delta, 0px));
  line-height: 1.9;
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
}

.cloze mark {
  padding: 0 0.25em;
  border-radius: 4px;
  font-weight: 600;
  background: transparent;
}

.cloze mark.ok {
  color: var(--ok);
  box-shadow: inset 0 -2px 0 var(--ok);
}

.cloze mark.ng {
  color: var(--danger);
  box-shadow: inset 0 -2px 0 var(--danger);
}

.cloze form {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.cloze input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  font: inherit;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--card);
  color: inherit;
}

.cloze form .primary {
  min-height: 52px;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.cloze form .primary:disabled {
  opacity: 0.4;
}

.cloze-result .explanation {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
  color: var(--muted);
  border-left: 3px solid var(--hair);
  padding-left: 0.6em;
  white-space: pre-wrap;
}

/* --- 素材モード切替（手持ち教材 / 教材なし=AIが題材選び） --- */

.seed-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--hair);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  width: min(100%, 38rem);
}

.seed-toggle button {
  padding: 0.4rem 0.9rem;
  border: 0;
  background: transparent;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: var(--muted);
  line-height: 1.35;
}

.seed-toggle button + button {
  border-left: 1px solid var(--hair);
}

.seed-toggle button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.seed-context {
  display: grid;
  gap: 0.4rem;
  max-width: 46rem;
  margin: 0.25rem 0 0.85rem;
  padding: 0.85rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.seed-context label {
  font-weight: 700;
}

.seed-context .required {
  margin-left: 0.35rem;
  color: var(--danger);
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
}

.seed-context input {
  width: 100%;
}

.seed-context p {
  margin: 0;
}

.seed-note {
  border-left: 3px solid var(--danger);
  padding-left: 0.6em;
}

/* ============================================================
   視覚デザイン改修（2026-07-20）: 触りたくなる学習空間へ
   - ホーム: 「今日の学習」主役ヒーロー / 蓄積は二次情報 / 大型資格カード
   - 新規: オンボーディング（資格を選ぶ一本道）
   - ボード: 資格ヒーロー / タイルは教材名主役・状態強調 / ツール棚は一段弱く
   - モバイル: 下部固定タブバー
   既存トークン（radius / surface-2 / shadow / glow / accent-soft）を使用。
   ============================================================ */

/* 共有CTA（ホーム・ボード両方の「学習を始める」） */
.hero-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
  padding: 0.65rem 1.3rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-2);
  transition: transform var(--tr), box-shadow var(--tr);
}
.hero-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-3);
}
.hero-cta-label {
  font-weight: 700;
  font-size: calc(1rem + var(--native-font-delta, 0px));
}
.hero-cta-sub {
  font-size: calc(0.74rem + var(--native-font-delta, 0px));
  opacity: 0.88;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- 継続ユーザーのホームヒーロー --- */
.today-hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 1rem;
  align-items: stretch;
  margin: 0.2rem 0 1.3rem;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--card);
  background-image: var(--glow);
  box-shadow: var(--shadow-2);
}
.hero-main {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding-right: 0;
}
.hero-main .hero-count, .hero-main .hero-done { padding-right: 4.6rem; }
.hero-main .hero-cta-sub { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
:root[data-large-text='true'] .hero-main .hero-count,
:root[data-large-text='true'] .hero-main .hero-done { padding-right: 0; }
.hero-eyebrow {
  font-size: calc(0.7rem + var(--native-font-delta, 0px));
  letter-spacing: 0.16em;
  color: var(--muted);
}
.hero-count {
  font-size: calc(1.5rem + var(--native-font-delta, 0px));
  font-weight: 600;
  margin: 0;
  line-height: 1.15;
}
.hero-count strong {
  font-size: calc(2.3rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.hero-min {
  display: inline-block;
  white-space: nowrap;
  font-size: calc(0.95rem + var(--native-font-delta, 0px));
  color: var(--muted);
  margin-left: 0.6em;
  font-weight: 400;
}
.hero-done {
  font-size: calc(1.4rem + var(--native-font-delta, 0px));
  font-weight: 650;
  margin: 0.2rem 0 0;
}
.hero-sub {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}
.hero-main .ringwrap {
  position: absolute;
  top: 0;
  right: 0;
}
.hero-main .hero-cta {
  align-self: flex-start;
  margin-top: 0.2rem;
}
.home-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.home-secondary-action,
.board-manage-toggle {
  min-height: 44px;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}
.home-secondary-action:hover,
.home-secondary-action:focus-visible,
.board-manage-toggle:hover,
.board-manage-toggle:focus-visible,
.board-manage-toggle.active {
  color: var(--text);
  border-color: var(--accent);
}

.hero-aside {
  display: flex;
}
.stats-strip {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--hair-soft);
}
.stats-strip .label {
  font-size: calc(0.66rem + var(--native-font-delta, 0px));
  letter-spacing: 0.12em;
  color: var(--muted);
}
.strip-asset {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.asset-num {
  font-size: calc(1.3rem + var(--native-font-delta, 0px));
  font-weight: 650;
}
.asset-num small {
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
  color: var(--muted);
  margin-left: 0.2em;
  font-weight: 400;
}
.asset-num .delta {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  margin-left: 0.5em;
  font-weight: 500;
}
.asset-num .delta.up { color: var(--ok); }
.asset-num .delta.down { color: var(--danger); }
.strip-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
}

/* ほかに今日やること */
.today-boards .row-open {
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  font-weight: 600;
}

/* --- 新規ユーザー: オンボーディング --- */
.onboarding {
  max-width: 760px;
}
.board-package-picker {
  max-width: 760px;
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.board-package-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.board-package-picker-head h3 {
  margin: 0 0 0.25rem;
  font-size: calc(1.2rem + var(--native-font-delta, 0px));
}
.board-package-picker-head p {
  margin: 0;
  color: var(--muted);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  line-height: 1.5;
}
.board-package-picker-head .secondary {
  flex: 0 0 auto;
  min-height: 44px;
}
.onboarding-head h2 {
  font-size: calc(1.5rem + var(--native-font-delta, 0px));
  margin: 0.6rem 0 0.2rem;
}
.onboarding-head p {
  color: var(--muted);
  margin: 0 0 1.2rem;
}
.pkg-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}
.pkg-card {
  position: relative;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--hair);
  border-top: 3px solid var(--card-accent, var(--accent));
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
  transition: transform var(--tr), box-shadow var(--tr);
}
.pkg-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-3);
}
.pkg-card-art {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 10%, var(--surface-2));
}
.pkg-card-art img {
  filter: drop-shadow(0 3px 5px rgba(15, 20, 30, 0.25));
}
.pkg-card-art .tile-icon {
  font-size: calc(2.9rem + var(--native-font-delta, 0px));
  line-height: 1;
}
.pkg-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.pkg-card-name {
  font-size: calc(1.15rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.pkg-card-unofficial {
  width: fit-content;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  color: var(--muted);
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
  font-weight: 600;
  line-height: 1.4;
}
.pkg-card-desc {
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: var(--muted);
  line-height: 1.5;
}
.pkg-card-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}
.tool-chip {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--hair-soft);
  color: var(--muted);
}
.pkg-card-cta {
  align-self: center;
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
  font-weight: 600;
  color: var(--card-accent, var(--accent));
  white-space: nowrap;
}
.pkg-card-plain {
  grid-column: 1 / -1;
  margin-top: 0.9rem;
  box-shadow: var(--shadow-1);
}
.pkg-card-plain .pkg-card-art {
  width: 64px;
  height: 64px;
}
.pkg-card-plain .pkg-card-art .tile-icon {
  font-size: calc(2.2rem + var(--native-font-delta, 0px));
}
.qualification-name-notice {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
  line-height: 1.55;
}
.qualification-name-notice strong {
  color: var(--text);
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
}
.qualification-name-notice p {
  margin: 0.25rem 0 0;
}

/* --- 資格カード（画像を主役へ引き上げ・可読性のためのスクリム） --- */
.board-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.8rem;
  align-items: start;
}
.board-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 134px;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hair);
  border-top: 3px solid var(--card-accent, var(--accent));
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-2);
  transition: transform var(--tr), box-shadow var(--tr);
}
button.board-card:hover {
  transform: translateY(-2px);
  border-color: var(--hair);
  box-shadow: var(--shadow-3);
}
.board-card-art {
  position: absolute;
  right: -6px;
  bottom: -8px;
  width: 40%;
  max-width: 122px;
  z-index: 0;
  pointer-events: none;
}
.board-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(15, 20, 30, 0.22));
}
.board-card-art .tile-icon {
  font-size: calc(2.75rem + var(--native-font-delta, 0px));
  line-height: 1;
}
.board-card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, var(--card) 42%, transparent 84%);
  pointer-events: none;
}
.board-card-top,
.board-card-exam,
.board-card-foot {
  position: relative;
  z-index: 2;
}
.board-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.board-card-name {
  font-size: calc(1.1rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.today-pill {
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: var(--card-accent, var(--accent));
  color: #fff;
  font-weight: 600;
}
.board-card-exam {
  margin: 0;
}
.board-card-foot {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: auto;
  max-width: 68%;
}

/* --- ボードの資格ヒーローヘッダー --- */
.board-back {
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
  background: var(--card);
  margin-bottom: 0.6rem;
}
.board-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.9rem;
  border: 1px solid var(--hair);
  border-top: 3px solid var(--card-accent, var(--accent));
  border-radius: var(--radius-lg);
  background: var(--card);
  background-image: var(--glow);
  box-shadow: var(--shadow-2);
}
.board-hero-art {
  flex: none;
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  order: 2;
}
.board-hero-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(15, 20, 30, 0.22));
}
.board-hero-art .tile-icon {
  font-size: calc(3.5rem + var(--native-font-delta, 0px));
  line-height: 1;
}
.board-hero-body {
  flex: 1;
  min-width: 0;
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.board-hero-body h2 {
  font-size: calc(1.35rem + var(--native-font-delta, 0px));
  margin: 0;
}
.board-name-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.board-name-row h2 {
  overflow-wrap: anywhere;
}
.board-name-edit {
  flex: none;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  color: var(--muted);
  font-size: calc(0.76rem + var(--native-font-delta, 0px));
}
.board-name-edit:hover,
.board-name-edit:focus-visible {
  color: var(--text);
  border-color: var(--card-accent, var(--accent));
}
.board-name-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.board-name-form label {
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
  font-weight: 650;
  color: var(--muted);
}
.board-name-form input {
  flex: 1 1 14rem;
  min-width: 0;
}
.board-name-form button {
  flex: none;
}
.board-hero-meta {
  margin: 0;
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
  color: var(--muted);
}
.board-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}
.board-hero-done {
  font-weight: 600;
}
.board-view.is-managing .board-hero {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--hair));
}

/* --- 学習タイルの状態強調（DOM順は不変・スタイルのみ） --- */
.tile-deck {
  font-size: calc(1.02rem + var(--native-font-delta, 0px));
  font-weight: 650;
}
.tile.is-due {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--hair));
}
.tile.is-due::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
.tile.is-slot {
  box-shadow: none;
  background-image: none;
}

/* グリップ・×はホバー機のみ控えめ→ホバー/フォーカスで顕在化（タッチ機は常時表示） */
@media (hover: hover) {
  .tile-grip,
  .tile-remove {
    opacity: 0.32;
    transition: opacity var(--tr);
  }
  .tile:hover .tile-grip,
  .tile:hover .tile-remove,
  .tile:focus-within .tile-grip,
  .tile:focus-within .tile-remove {
    opacity: 1;
  }
}

/* --- ツール棚（学習エリアより一段弱い面） --- */
.source-area.tool-shelf {
  background: var(--surface-2);
  border-color: var(--hair-soft);
  box-shadow: none;
}
.tool-shelf .source-tile {
  background: var(--card);
}

/* --- 取り込み: 文脈バナー・接続・プレビュー成否 --- */
.import-view {
  --ai-accent: color-mix(in srgb, #7652ad 72%, var(--ink));
  --ai-soft: color-mix(in srgb, var(--ai-accent) 10%, var(--card));
}
.import-context {
  margin: 0 0 0.7rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid var(--hair-soft);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}
.import-route-picker {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.import-route-picker h2 {
  margin: 0.1rem 0 0.25rem;
  font-size: calc(1.15rem + var(--native-font-delta, 0px));
}
.route-eyebrow,
.panel-kicker {
  margin: 0;
  color: var(--flow-accent, var(--accent));
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.route-eyebrow {
  color: var(--accent);
}
.authoring-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.8rem;
}
.authoring-route {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 0.15rem 0.7rem;
  min-height: 150px;
  padding: 0.9rem;
  border: 2px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: inherit;
  text-align: left;
  transition:
    border-color var(--tr),
    background var(--tr),
    transform var(--tr),
    box-shadow var(--tr);
}
.authoring-route:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}
.authoring-route:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--route-accent) 34%, transparent);
  outline-offset: 2px;
}
.authoring-route.route-direct {
  --route-accent: var(--accent);
  --route-soft: var(--accent-soft);
}
.authoring-route.route-ai {
  --route-accent: var(--ai-accent);
  --route-soft: var(--ai-soft);
}
.authoring-route.selected {
  border-color: var(--route-accent);
  background: var(--route-soft);
  box-shadow: inset 0 0 0 1px var(--route-accent), var(--shadow-2);
}
.authoring-route.recommended:not(.selected) {
  border-color: color-mix(in srgb, var(--ai-accent) 52%, var(--hair));
  background: color-mix(in srgb, var(--ai-accent) 7%, var(--surface-2));
}
.authoring-route.advanced:not(.selected) {
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-2) 78%, var(--card));
}
.route-icon {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--route-soft);
  color: var(--route-accent);
  font-size: calc(1.3rem + var(--native-font-delta, 0px));
  font-weight: 800;
}
.selected .route-icon {
  background: var(--route-accent);
  color: var(--accent-ink);
}
.route-copy {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.route-copy strong {
  font-size: calc(1rem + var(--native-font-delta, 0px));
  line-height: 1.35;
}
.route-copy > span {
  color: var(--muted);
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
  line-height: 1.5;
}
.route-copy .route-recommendation,
.route-copy .route-advanced-label {
  align-self: flex-start;
  padding: 0.08rem 0.48rem;
  border-radius: 999px;
  color: var(--route-accent);
  background: color-mix(in srgb, var(--route-accent) 12%, transparent);
  font-size: calc(0.7rem + var(--native-font-delta, 0px));
  font-weight: 800;
  line-height: 1.45;
}
.route-copy .route-advanced-label {
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 10%, transparent);
}
.route-state {
  grid-column: 2;
  align-self: end;
  justify-self: start;
  margin-top: 0.4rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--route-accent) 10%, transparent);
  color: var(--route-accent);
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.selected .route-state {
  background: var(--route-accent);
  color: var(--accent-ink);
}
.import-workspace {
  --flow-accent: var(--accent);
  --flow-soft: var(--accent-soft);
  outline: none;
  scroll-margin-top: 1rem;
}
.import-workspace.route-ai {
  --flow-accent: var(--ai-accent);
  --flow-soft: var(--ai-soft);
}
.workflow-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}
.workflow-progress.route-ai {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.workflow-progress li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 42px;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--muted);
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  font-weight: 700;
  text-align: center;
}
.workflow-progress li.active {
  border-color: var(--flow-accent);
  background: var(--flow-soft);
  color: var(--flow-accent);
  box-shadow: inset 0 0 0 1px var(--flow-accent);
}
.workflow-progress li.completed {
  border-color: color-mix(in srgb, var(--flow-accent) 45%, var(--hair));
  color: var(--flow-accent);
}
.workflow-index {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
}
.active .workflow-index {
  background: var(--flow-accent);
  color: var(--accent-ink);
}
.completed .workflow-index {
  background: var(--flow-soft);
  color: var(--flow-accent);
}
.import-workspace .import-step {
  scroll-margin-top: 1rem;
}
.import-input-panel,
.import-preview-panel,
.import-ai-helper {
  border-top: 4px solid var(--flow-accent);
  box-shadow: var(--shadow-1);
}
.import-ai-helper {
  background: var(--ai-soft);
}
.direct-format-guide {
  margin: 0.8rem 0 1rem;
  padding: 0.8rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.direct-format-guide > p {
  margin: 0.25rem 0 0.65rem;
  color: var(--muted);
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
}
.direct-format-guide details + details {
  margin-top: 0.45rem;
}
.direct-format-guide summary {
  min-height: var(--tap);
  padding: 0.55rem 0;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.direct-format-guide pre {
  max-width: 100%;
  margin: 0 0 0.5rem;
  padding: 0.75rem;
  overflow-x: auto;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: calc(0.76rem + var(--native-font-delta, 0px));
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.import-workspace.route-ai .copy-btn,
.import-workspace.route-ai .seed-toggle button.active {
  border-color: var(--ai-accent);
  background: var(--ai-accent);
  color: var(--accent-ink);
}
.seed-fieldset {
  margin: 0 0 0.5rem;
  padding: 0;
  border: 0;
}
.seed-fieldset legend {
  margin-bottom: 0.35rem;
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.current-action,
.next-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.2rem 0.7rem;
  align-items: start;
  margin: 0.7rem 0 0.9rem;
  padding: 0.7rem 0.8rem;
  border-left: 4px solid var(--flow-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--flow-soft);
  font-size: calc(0.86rem + var(--native-font-delta, 0px));
}
.current-action strong,
.next-action strong {
  color: var(--flow-accent);
  white-space: nowrap;
}
.next-action.ready {
  border: 1px solid color-mix(in srgb, var(--ai-accent) 45%, var(--hair));
  border-left: 4px solid var(--ai-accent);
  background: color-mix(in srgb, var(--ai-accent) 16%, var(--card));
}
.import-field-label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.3rem 0 0.25rem;
  font-size: calc(0.86rem + var(--native-font-delta, 0px));
  font-weight: 700;
}
.import-field-label span {
  color: var(--muted);
  font-size: calc(0.75rem + var(--native-font-delta, 0px));
  font-weight: 500;
}
.import-confirm-action,
.import-save-action {
  display: flex;
  justify-content: flex-end;
}
.import-confirm-action button,
.import-save-action button {
  min-width: 12rem;
  margin-right: 0;
}
.import-save-action {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hair-soft);
}
.ai-return-guide {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  width: min(100%, 34rem);
  margin: -0.35rem auto 0.65rem;
  color: var(--muted);
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
  text-align: center;
}
.ai-return-guide > span:first-child {
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 800;
}
.ai-return-guide.ready {
  color: var(--ai-accent);
}
.ai-return-guide.ready > span:first-child {
  background: var(--ai-accent);
  color: var(--accent-ink);
}
.return-arrow {
  font-size: calc(1.25rem + var(--native-font-delta, 0px));
  font-weight: 800;
}
.import-complete {
  border: 2px solid color-mix(in srgb, var(--ok) 55%, var(--hair));
  background: color-mix(in srgb, var(--ok) 10%, var(--card));
  box-shadow: var(--shadow-2);
  scroll-margin-top: 20vh;
}
.import-complete .panel-kicker,
.import-complete h2 {
  color: var(--ok);
}
.step-connector {
  text-align: center;
  margin: 0.7rem 0 0;
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
}
.preview-pill {
  display: inline-block;
  font-size: calc(0.74rem + var(--native-font-delta, 0px));
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  margin: 0 0.5em;
  font-weight: 600;
  vertical-align: middle;
  white-space: nowrap;
}

.import-preview-panel h2 {
  overflow-wrap: anywhere;
}

.import-preview-panel h2 .meta {
  display: block;
  margin: 0.35rem 0 0;
}

.sanitized-notice {
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--hair));
  border-radius: 8px;
  background: color-mix(in srgb, var(--ok) 8%, var(--card));
  color: var(--text);
  font-size: calc(0.85rem + var(--native-font-delta, 0px));
}
.preview-pill.ok {
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
}
.preview-pill.warn {
  background: color-mix(in srgb, #b3541e 18%, transparent);
  color: #b3541e;
}
.preview-pill.err {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  color: var(--danger);
}

@media (max-width: 720px) {
  .authoring-routes {
    grid-template-columns: 1fr;
  }
  .authoring-route {
    min-height: 126px;
  }
  .workflow-progress {
    gap: 0.3rem;
  }
  .workflow-progress li {
    flex-direction: column;
    gap: 0.15rem;
    min-height: 62px;
    padding: 0.3rem 0.2rem;
    font-size: calc(0.68rem + var(--native-font-delta, 0px));
    line-height: 1.25;
  }
  .current-action,
  .next-action {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .import-confirm-action button,
  .import-save-action button {
    width: 100%;
    min-width: 0;
  }
  .ai-return-guide {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .ai-return-guide .return-arrow {
    display: none;
  }
  .ignored-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.12rem;
  }
}

/* ============ プラン・アカウント ============ */
.billing-view {
  display: grid;
  gap: 1rem;
  max-width: 820px;
  padding-bottom: 2rem;
}

.billing-head {
  position: relative;
  overflow: hidden;
  min-height: 180px;
  padding: 1.7rem 8rem 1.6rem 1.8rem;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--hair));
  border-radius: calc(var(--radius-lg) + 4px);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, var(--card)), var(--card) 68%);
  box-shadow: var(--shadow-2);
}

.billing-head::after {
  content: '';
  position: absolute;
  inset: auto -60px -100px auto;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 19%, transparent);
}

.billing-head .eyebrow {
  margin: 0 0 0.35rem;
  color: var(--accent);
  font-size: calc(0.7rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.13em;
}

.billing-head h2 {
  margin: 0;
  font-size: calc(clamp(1.45rem, 3vw, 2rem) + var(--native-font-delta, 0px));
  letter-spacing: -0.03em;
}

.billing-head p:last-child {
  max-width: 35rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}

.billing-orbit {
  position: absolute;
  top: 30px;
  right: 34px;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--hair));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
  box-shadow: 0 0 0 13px color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--accent);
  font-size: calc(2rem + var(--native-font-delta, 0px));
}

.billing-orbit::after {
  content: '';
  position: absolute;
  width: 118px;
  height: 48px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.billing-loading,
.billing-message,
.billing-current,
.billing-product,
.billing-web-note {
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.billing-loading {
  padding: 2.4rem 1rem;
  color: var(--muted);
  text-align: center;
}

.billing-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--hair));
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: calc(0.88rem + var(--native-font-delta, 0px));
}

.billing-notice > button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: calc(1.25rem + var(--native-font-delta, 0px));
  line-height: 1;
}

.billing-message {
  padding: 2rem;
  text-align: center;
}

.billing-message.compact {
  padding: 1.3rem;
}

.billing-message h3,
.billing-web-note h3 {
  margin: 0;
  font-size: calc(1rem + var(--native-font-delta, 0px));
}

.billing-message p,
.billing-web-note p {
  margin: 0.45rem auto 1rem;
  color: var(--muted);
  font-size: calc(0.86rem + var(--native-font-delta, 0px));
}

.billing-message-icon {
  margin: 0 auto 0.7rem;
  font-size: calc(2rem + var(--native-font-delta, 0px));
}

.billing-view button.primary,
.billing-view .button-link.primary,
.apple-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.billing-view button:disabled {
  cursor: default;
  opacity: 0.5;
}

.billing-view button.primary[aria-current='true']:disabled {
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--card));
  color: var(--accent);
  opacity: 1;
}

.apple-signin {
  min-width: 190px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--card);
}

.billing-signin-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.billing-local-signin {
  min-height: var(--tap);
  padding: 0.5rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 9%, var(--card));
  color: var(--ink);
  font-weight: 700;
}

.billing-current {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.15rem 1.35rem;
}

.billing-current > div {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.billing-current-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: calc(0.74rem + var(--native-font-delta, 0px));
  font-weight: 700;
  white-space: nowrap;
}

.billing-current strong {
  color: var(--accent);
  font-size: calc(1.45rem + var(--native-font-delta, 0px));
  letter-spacing: -0.03em;
}

.billing-current p {
  margin: 0;
  color: var(--muted);
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
  text-align: right;
}

.billing-current.pro {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--hair));
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--accent) 12%, var(--card)), var(--card));
}

.billing-products {
  display: grid;
  gap: 0.75rem;
}

.billing-product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
}

.billing-product-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  box-shadow: var(--shadow-2);
}

.billing-product-type {
  color: var(--accent);
  font-size: calc(0.64rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.1em;
}

.billing-product h3 {
  margin: 0.1rem 0 0;
  font-size: calc(1rem + var(--native-font-delta, 0px));
}

.billing-product p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
}

.billing-product-buy {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.billing-product-buy > strong {
  min-width: 5rem;
  text-align: right;
  white-space: nowrap;
}

.billing-restore {
  justify-self: center;
  min-height: var(--tap);
  padding: 0.4rem 1rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 700;
}

.billing-web-note {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem 1.6rem;
}

.billing-web-note p {
  margin-bottom: 0;
}

.billing-device-art {
  position: relative;
  height: 90px;
}

.device-phone,
.device-tablet {
  position: absolute;
  bottom: 0;
  display: block;
  border: 2px solid var(--accent);
  background: linear-gradient(160deg, var(--accent-soft), var(--card));
  box-shadow: var(--shadow-2);
}

.device-phone {
  left: 18px;
  z-index: 2;
  width: 42px;
  height: 78px;
  border-radius: 10px;
}

.device-tablet {
  right: 8px;
  width: 68px;
  height: 88px;
  border-radius: 11px;
}

.billing-footnote {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: calc(0.72rem + var(--native-font-delta, 0px));
  text-align: center;
}

.billing-web-required {
  padding: 1rem 1.2rem;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--hair));
  border-radius: var(--radius-lg);
  background: linear-gradient(120deg, var(--accent-soft), var(--card));
}

.billing-web-required strong {
  color: var(--accent);
  font-size: calc(1rem + var(--native-font-delta, 0px));
}

.billing-web-required p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: calc(0.84rem + var(--native-font-delta, 0px));
}

.billing-account {
  padding: 1.25rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.billing-account-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hair-soft);
}

.billing-account-head span {
  color: var(--accent);
  font-size: calc(0.64rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.12em;
}

.billing-account-head h3,
.billing-account h4 {
  margin: 0;
}

.billing-account-head h3 {
  font-size: calc(1.05rem + var(--native-font-delta, 0px));
}

.billing-account-head > strong {
  max-width: 55%;
  overflow: hidden;
  color: var(--muted);
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.billing-account > h4 {
  margin-top: 1rem;
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
}

.billing-session-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.billing-session {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.billing-session-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--card);
  color: var(--accent);
  font-weight: 800;
}

.billing-session strong,
.billing-session small {
  display: block;
}

.billing-session strong {
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
}

.billing-session strong span {
  margin-left: 0.45em;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: calc(0.62rem + var(--native-font-delta, 0px));
}

.billing-session small {
  color: var(--muted);
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
}

.billing-session button,
.billing-logout-all,
.billing-delete-reveal,
.billing-delete-confirm button,
.billing-legal button,
.billing-legal a {
  min-height: 38px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: calc(0.74rem + var(--native-font-delta, 0px));
  font-weight: 700;
}

.billing-session button {
  padding: 0.35rem 0.75rem;
}

.billing-logout-all {
  margin-top: 0.8rem;
  padding: 0.4rem 0.9rem;
}

.billing-danger {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hair-soft);
}

.billing-danger h4 {
  color: var(--danger);
  font-size: calc(0.82rem + var(--native-font-delta, 0px));
}

.billing-danger p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: calc(0.74rem + var(--native-font-delta, 0px));
}

.billing-danger p strong {
  color: var(--ink);
}

.billing-delete-reveal {
  margin-top: 0.75rem;
  padding: 0.4rem 0.9rem;
  border-color: color-mix(in srgb, var(--danger) 48%, var(--hair));
  color: var(--danger);
}

.billing-delete-confirm {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.billing-delete-confirm button {
  padding: 0.4rem 0.9rem;
}

.billing-delete-confirm button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--danger-ink);
}

.billing-legal {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.billing-legal button,
.billing-legal a {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.8rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: underline;
}

.web-access-gate {
  display: grid;
  min-height: 100vh;
  padding: 1.5rem;
  place-items: center;
  background:
    radial-gradient(circle at 76% 18%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 28rem),
    var(--bg);
}

.web-gate-card {
  width: min(100%, 520px);
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--hair);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow-3);
  text-align: center;
}

.web-gate-card .brand-lockup {
  justify-content: center;
  margin-bottom: 1.5rem;
}

.web-gate-card .eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.14em;
}

.web-gate-card h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: calc(clamp(1.5rem, 4vw, 2rem) + var(--native-font-delta, 0px));
}

.web-gate-card p {
  color: var(--muted);
  font-size: calc(0.88rem + var(--native-font-delta, 0px));
}

.web-gate-primary {
  display: inline-flex;
  min-height: var(--tap);
  align-items: center;
  justify-content: center;
  margin-top: 0.7rem;
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 750;
  text-decoration: none;
}

.web-gate-card nav {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
}

.web-gate-card nav button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: calc(0.7rem + var(--native-font-delta, 0px));
  text-decoration: underline;
}

.web-pro-shell {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2.5rem);
  background: var(--bg);
}

.web-pro-shell .billing-view {
  margin: 0 auto;
}

/* ============ バックアップ・解約後データ整理 ============ */
.data-management {
  display: grid;
  gap: 0.75rem;
  padding: 1.25rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

.data-management h3,
.data-management p {
  margin: 0;
}

.data-management h3 {
  font-size: calc(0.9rem + var(--native-font-delta, 0px));
}

.data-management p {
  color: var(--muted);
  font-size: calc(0.76rem + var(--native-font-delta, 0px));
}

.data-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.data-actions p {
  margin-top: 0.25rem;
}

.data-management button {
  min-height: var(--tap);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: calc(0.76rem + var(--native-font-delta, 0px));
  font-weight: 750;
}

.data-management button:disabled {
  cursor: default;
  opacity: 0.45;
}

.data-file-input {
  display: none;
}

.data-message {
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--hair));
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
}

.data-import-confirm,
.data-finalize {
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 32%, var(--hair));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 5%, var(--card));
}

.data-import-confirm > p,
.data-finalize > p {
  margin-top: 0.3rem;
}

.data-import-confirm > div,
.data-finalize > div {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.8rem;
}

.data-management button.danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--danger-ink);
}

.data-gate {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 2.5rem);
  background:
    radial-gradient(circle at 82% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 32rem),
    var(--bg);
}

.data-gate-card,
.data-management-blocking {
  width: min(100%, 820px);
  margin: 0 auto;
}

.data-gate-card {
  padding: 2rem;
  border: 1px solid var(--hair);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow-3);
  text-align: center;
}

.data-management-blocking {
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  box-shadow: var(--shadow-3);
}

.data-management-hero {
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--hair-soft);
}

.data-management-hero .brand-lockup {
  margin-bottom: 1.4rem;
}

.data-management-hero .eyebrow {
  color: var(--accent);
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
  font-weight: 800;
  letter-spacing: 0.13em;
}

.data-management-hero h1 {
  margin: 0.15rem 0 0.55rem;
  font-size: calc(clamp(1.45rem, 4vw, 2.1rem) + var(--native-font-delta, 0px));
}

.data-management-hero > p {
  max-width: 42rem;
  font-size: calc(0.86rem + var(--native-font-delta, 0px));
}

.data-management-hero > strong {
  display: block;
  margin-top: 0.65rem;
  color: var(--danger);
  font-size: calc(0.78rem + var(--native-font-delta, 0px));
}

.data-selection {
  padding: 1rem;
  border: 1px solid var(--hair-soft);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.data-selection > p {
  margin: 0.25rem 0 0.65rem;
}

.data-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.5rem;
  margin: 0.7rem 0;
}

.data-choice-list label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 58px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
}

.data-choice-list input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.data-choice-list strong,
.data-choice-list small {
  display: block;
}

.data-choice-list strong {
  overflow: hidden;
  font-size: calc(0.8rem + var(--native-font-delta, 0px));
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-choice-list small {
  color: var(--muted);
  font-size: calc(0.68rem + var(--native-font-delta, 0px));
}

/* --- モバイル下部タブバー（既定は非表示） --- */
.tabbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .pkg-card,
  .board-card,
  .hero-cta,
  .board-hero {
    transition: none;
  }
  .pkg-card:hover,
  button.board-card:hover,
  .hero-cta:hover {
    transform: none;
  }
}

/* ============ スマホ幅（≤720px）: 下部タブ + 積み上げ ============ */
@media (max-width: 720px) {
  /* 上部はアプリ名 + 配色トグルのスリムバー、縦ナビは下部タブへ */
  .app-sidebar {
    justify-content: space-between;
  }
  .app-sidebar h1 {
    flex: 1 1 auto;
    font-size: calc(0.95rem + var(--native-font-delta, 0px));
  }
  .side-nav-v {
    display: none;
  }
  .side-foot {
    margin: 0 0 0 auto;
    padding: 0;
    flex: none;
  }
  .theme-toggle {
    font-size: calc(0.72rem + var(--native-font-delta, 0px));
    padding: 0.28rem 0.55rem;
  }

  /* body が safe-bottom を持つため、ここでは safe-area を足さない（二重計上で下に空きが出る） */
  main {
    padding-bottom: calc(var(--tabbar-h) + 0.6rem);
  }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--hair);
    /* fixed はビューポート基準なので、ホームインジケータ分はこの要素自身で避ける */
    padding-bottom: var(--safe-bottom);
  }
  .tabbar .tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: var(--tabbar-h);
    padding: 0.35rem 0.2rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: calc(0.72rem + var(--native-font-delta, 0px));
  }

  .tile-grip,
  .tile-remove,
  .card-row-actions button {
    min-width: 44px;
    min-height: 44px;
  }

  .billing-usage-grid {
    grid-template-columns: 1fr;
  }

  .exam-form input,
  .exam-form button,
  .board-name-form input,
  .board-name-form button,
  .board-name-edit,
  .import-view input,
  .import-view select,
  .import-view button,
  .card-editor input,
  .card-editor button {
    min-height: 44px;
  }
  .tabbar .tab.active {
    color: var(--accent);
  }
  .tabbar .tab:disabled {
    opacity: 0.38;
  }
  .tab-icon {
    font-size: calc(1.6rem + var(--native-font-delta, 0px));
    line-height: 1;
  }

  /* ホーム・ボードの積み上げ */
  .today-hero {
    grid-template-columns: 1fr;
  }
  .hero-main {
    padding-right: 0;
  }
  .home-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .home-hero-actions .hero-cta,
  .home-secondary-action {
    width: 100%;
  }
  .pkg-cards {
    grid-template-columns: 1fr;
  }
  .pkg-card {
    grid-template-columns: auto 1fr;
  }
  .pkg-card-cta {
    display: none;
  }
  .board-package-picker {
    padding: 0.85rem;
  }
  .board-package-picker-head {
    align-items: stretch;
    flex-direction: column;
  }
  .board-package-picker-head .secondary {
    align-self: flex-start;
  }
  .board-cards {
    grid-template-columns: 1fr;
  }
  .board-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .board-hero-art {
    order: 0;
    width: 64px;
    height: 64px;
  }

  .billing-head {
    min-height: 168px;
    padding: 1.35rem 5.5rem 1.25rem 1.25rem;
  }
  .billing-orbit {
    top: 32px;
    right: 20px;
    width: 58px;
    height: 58px;
    font-size: calc(1.35rem + var(--native-font-delta, 0px));
  }
  .billing-orbit::after {
    width: 78px;
    height: 34px;
  }
  .billing-current {
    align-items: flex-start;
    flex-direction: column;
  }
  .billing-current p {
    text-align: left;
  }
  .billing-product {
    grid-template-columns: 44px 1fr;
    gap: 0.8rem;
  }
  .billing-product-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .billing-product-buy {
    grid-column: 1 / -1;
    justify-content: space-between;
    padding-top: 0.6rem;
    border-top: 1px solid var(--hair-soft);
  }
  .billing-web-note {
    grid-template-columns: 78px 1fr;
    gap: 0.8rem;
    padding: 1rem;
  }
  .billing-device-art {
    height: 70px;
  }
  .device-phone {
    left: 2px;
    width: 34px;
    height: 62px;
  }
  .device-tablet {
    right: 0;
    width: 54px;
    height: 68px;
  }
  .billing-account-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .billing-account-head > strong {
    max-width: 100%;
  }
  .billing-session {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .billing-session button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
  .billing-delete-confirm,
  .billing-legal {
    flex-wrap: wrap;
  }
  .data-actions {
    grid-template-columns: 1fr;
  }
  .data-actions button {
    justify-self: stretch;
  }
  .data-import-confirm > div,
  .data-finalize > div {
    align-items: stretch;
    flex-direction: column;
  }
}

/* 修正: 資格追加カードは画像スクリムの対象外にし、中身を前面へ
   （スクリムが追加ボタン/パッケージ選択の文字を覆って霞む不具合） */
.board-card-add::before {
  content: none;
}
.board-card-add {
  border-top-color: var(--hair);
}
.tile-add-open,
.board-package-picker {
  position: relative;
  z-index: 2;
}
.tile-add-open {
  color: var(--ink);
  font-weight: 600;
}

/* 学習中のキー表示は、マウスを主入力にするWebだけに出す。
   iPadへトラックパッドをつないだ場合も、WebViewではタッチ向け表示を維持する。 */
@media (hover: hover) and (pointer: fine) {
  .study kbd,
  .study .keyboard-only {
    display: inline;
  }

  .study .keyboard-hint {
    display: block;
  }
}

:root[data-native='true'] .study kbd,
:root[data-native='true'] .study .keyboard-only,
:root[data-native='true'] .study .keyboard-hint {
  display: none !important;
}

/* 学習画面は本文と回答操作を優先する。通常画面の下部タブ用余白は持ち込まない。 */
@media (max-width: 720px) {
  .study-layout main {
    width: 100%;
    min-width: 0;
    max-width: 100vw;
    padding: 0.5rem 0.75rem 1rem;
    overflow-x: clip;
  }

  .study {
    max-width: none;
    padding-top: 0.35rem;
    padding-bottom: 0.75rem;
    font-size: calc(1.0625rem + var(--native-font-delta, 0px));
    scroll-padding-bottom: calc(var(--safe-bottom) + 1rem);
  }

  .study-head {
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.35rem 0;
  }

  .study-head .study-exit {
    min-height: 48px;
    padding: 0.5rem 0.9rem;
    font-size: calc(1.05rem + var(--native-font-delta, 0px));
  }

  .study-head .study-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: calc(0.95rem + var(--native-font-delta, 0px));
    line-height: 1.35;
  }

  .study-head .study-progress {
    margin-left: 0;
    font-size: calc(1rem + var(--native-font-delta, 0px));
  }

  .flashcard {
    min-height: 14rem;
    gap: 1.15rem;
    padding: clamp(1.2rem, 5vw, 1.75rem);
    overflow-wrap: anywhere;
  }

  .flashcard .front {
    font-size: calc(clamp(1.85rem, 8vw, 2.35rem) + var(--native-font-delta, 0px));
    line-height: 1.35;
  }

  .flashcard .front .reading,
  .flashcard .back .reading {
    display: inline-block;
    font-size: calc(1.05rem + var(--native-font-delta, 0px));
  }

  .flashcard .back {
    font-size: calc(clamp(1.15rem, 5vw, 1.35rem) + var(--native-font-delta, 0px));
    line-height: 1.65;
  }

  .flashcard .back .extras,
  .flashcard .hint,
  .study .meta,
  .study .muted,
  .study .shadow-note {
    font-size: calc(0.95rem + var(--native-font-delta, 0px));
  }

  .study .actions {
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.85rem;
  }

  .study .actions button {
    min-height: 56px;
    margin: 0;
    padding: 0.75rem 1.05rem;
    font-size: calc(1.1rem + var(--native-font-delta, 0px));
    line-height: 1.35;
  }

  .study .study-answer-actions {
    flex-wrap: nowrap;
  }

  .study .study-answer-actions button {
    flex: 1 1 0;
    max-width: 12rem;
  }

  .drill .question,
  .cloze .cloze-text {
    margin-top: 0;
    padding: 1.05rem;
    font-size: calc(1.25rem + var(--native-font-delta, 0px));
    line-height: 1.75;
    overflow-wrap: anywhere;
  }

  .drill .choices {
    gap: 0.7rem;
  }

  .drill .choice {
    min-height: 56px;
    padding: 0.8rem 1rem;
    font-size: calc(1.08rem + var(--native-font-delta, 0px));
    line-height: 1.55;
    overflow-wrap: anywhere;
  }

  .cloze form,
  .dictation-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
  }

  .cloze input,
  .cloze form .primary,
  .dictation-input,
  .dictation-play button.primary {
    min-height: 56px;
    font-size: calc(1.0625rem + var(--native-font-delta, 0px));
  }

  .cloze form .primary {
    flex: 0 0 auto;
    padding-inline: 1rem;
  }

  .cloze form .primary,
  .dictation-form .primary {
    white-space: nowrap;
  }

  .dictation-play {
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
  }

  .dictation-answer,
  .study .message,
  .study .explanation {
    font-size: calc(1rem + var(--native-font-delta, 0px));
    line-height: 1.7;
    overflow-wrap: anywhere;
  }

  .listen-speed {
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .listen-speed button {
    min-width: 64px;
    min-height: 52px;
    padding: 0.55rem 0.75rem;
    font-size: calc(1rem + var(--native-font-delta, 0px));
  }

  .study .shadow-actions button {
    flex: 1 1 9rem;
    min-width: 0;
  }

  .study .shadow-eval-actions .shadow-eval-choice {
    flex: 1 1 8rem;
  }

  .study .shadow-eval-actions .shadow-skip {
    min-width: var(--tap);
    min-height: var(--tap);
  }
}

/* Manasole brand system: sunrise = easy start, stacked cards = durable memory. */
.brand-mark {
  --mark-size: 44px;
  position: relative;
  display: inline-block;
  width: var(--mark-size);
  height: var(--mark-size);
  flex: 0 0 var(--mark-size);
  overflow: hidden;
  border-radius: calc(var(--mark-size) * 0.28);
  background:
    radial-gradient(circle at 72% 16%, rgba(255, 255, 255, 0.13), transparent 24%),
    #17365f;
  box-shadow: 0 8px 24px -14px rgba(16, 43, 78, 0.75);
}

.brand-mark-small {
  --mark-size: 34px;
}

.brand-mark-large {
  --mark-size: 72px;
}

.brand-sun {
  position: absolute;
  z-index: 1;
  top: 17%;
  left: 50%;
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5bd58;
  box-shadow:
    0 0 0 calc(var(--mark-size) * 0.055) rgba(255, 255, 255, 0.16),
    0 0 calc(var(--mark-size) * 0.22) rgba(245, 189, 88, 0.38);
  transform: translateX(-50%);
}

.brand-card {
  position: absolute;
  z-index: 2;
  left: 50%;
  height: 15%;
  border-radius: 999px;
  background: #f8f3e9;
  box-shadow: 0 2px 0 rgba(9, 29, 54, 0.18);
  transform: translateX(-50%) rotate(-5deg);
}

.brand-card-back {
  bottom: 34%;
  width: 50%;
  opacity: 0.68;
}

.brand-card-mid {
  bottom: 22%;
  width: 63%;
  opacity: 0.84;
}

.brand-card-front {
  bottom: 10%;
  width: 76%;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: #17365f;
  text-decoration: none;
}

.brand-lockup.inverse {
  color: #fffaf0;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-name strong {
  font-family: 'Avenir Next', 'Helvetica Neue', sans-serif;
  font-size: 1.34rem;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.brand-name small {
  margin-top: 0.34rem;
  color: #77889a;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.brand-lockup.inverse .brand-name small {
  color: rgba(255, 250, 240, 0.64);
}

.brand-lockup.compact {
  gap: 0.55rem;
}

.brand-lockup.compact .brand-name strong {
  font-size: 1.08rem;
}

.app-brand {
  display: inline-flex;
  margin-bottom: 1rem;
  color: inherit;
  text-decoration: none;
}

.app-brand .brand-lockup {
  color: var(--ink);
}

.landing-page,
.legal-page {
  --lp-navy: #17365f;
  --lp-navy-deep: #0c2545;
  --lp-blue: #416c9f;
  --lp-gold: #f5bd58;
  --lp-cream: #f7f3eb;
  --lp-paper: #fffdf8;
  --lp-ink: #17304e;
  --lp-muted: #66788b;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', 'Yu Gothic', 'Noto Sans JP', sans-serif;
}

.landing-page {
  min-height: 100vh;
  overflow: hidden;
  background: var(--lp-cream);
  color: var(--lp-ink);
}

.landing-page *,
.landing-page *::before,
.landing-page *::after,
.legal-page *,
.legal-page *::before,
.legal-page *::after {
  box-sizing: border-box;
}

.landing-page a {
  color: inherit;
}

.lp-nav {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: 86px;
  margin: 0 auto;
  border-bottom: 1px solid rgba(23, 54, 95, 0.12);
}

.lp-logo-link {
  justify-self: start;
  text-decoration: none;
}

.lp-nav nav {
  display: flex;
  gap: 2rem;
}

.lp-nav nav a {
  position: relative;
  color: #425a74;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.lp-nav nav a::after {
  position: absolute;
  right: 0;
  bottom: -0.5rem;
  left: 0;
  height: 2px;
  background: var(--lp-gold);
  content: '';
  transform: scaleX(0);
  transition: transform 160ms ease;
}

.lp-nav nav a:hover::after,
.lp-nav nav a:focus-visible::after {
  transform: scaleX(1);
}

.lp-nav-cta {
  justify-self: end;
  padding: 0.66rem 1.08rem;
  border: 1px solid rgba(23, 54, 95, 0.26);
  border-radius: 999px;
  color: var(--lp-navy);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.landing-page .lp-nav-cta {
  color: var(--lp-navy);
}

.lp-nav-cta:hover {
  background: var(--lp-navy);
  color: #fff;
  transform: translateY(-1px);
}

.lp-main {
  max-width: none;
  padding: 0;
}

.lp-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(440px, 1.08fr);
  align-items: center;
  width: min(1180px, calc(100% - 48px));
  min-height: 720px;
  margin: 0 auto;
  padding: 72px 0 96px;
}

.lp-hero::before {
  position: absolute;
  top: 92px;
  left: -20vw;
  width: 42vw;
  height: 42vw;
  border: 1px solid rgba(23, 54, 95, 0.08);
  border-radius: 50%;
  content: '';
}

.lp-hero-copy {
  position: relative;
  z-index: 4;
  padding-left: clamp(0px, 2vw, 30px);
}

.lp-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.66rem;
  margin: 0 0 1.15rem;
  color: #49647f;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.13em;
}

.lp-eyebrow > span {
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--lp-gold);
}

.lp-hero h1 {
  margin: 0;
  color: var(--lp-navy-deep);
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 1.22;
}

.lp-hero h1 em {
  position: relative;
  color: var(--lp-navy);
  font-style: normal;
  white-space: nowrap;
}

.lp-hero h1 em::after {
  position: absolute;
  right: 0.05em;
  bottom: 0.04em;
  left: 0.05em;
  z-index: -1;
  height: 0.22em;
  border-radius: 99px;
  background: rgba(245, 189, 88, 0.7);
  content: '';
}

.lp-hero-lead {
  max-width: 580px;
  margin: 2rem 0 0;
  color: #536a80;
  font-size: clamp(0.96rem, 1.35vw, 1.08rem);
  line-height: 2;
}

.lp-hero-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 2.25rem;
}

.lp-primary-cta,
.lp-secondary-cta {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 750;
  text-decoration: none;
}

.lp-primary-cta {
  min-width: 280px;
  gap: 1.2rem;
  padding: 0.65rem 1.4rem;
  background: var(--lp-navy);
  box-shadow: 0 16px 32px -18px rgba(12, 37, 69, 0.7);
  color: #fff;
  transition:
    background 150ms ease,
    transform 150ms ease;
}

.landing-page .lp-primary-cta {
  color: #fff;
}

.lp-primary-cta:hover {
  background: #244e7d;
  transform: translateY(-2px);
}

.lp-primary-cta > span:last-child {
  font-size: 1.15rem;
}

.lp-store-cta {
  justify-content: space-between;
  text-align: left;
}

.lp-store-cta-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.lp-store-cta-copy small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 650;
}

.lp-store-cta-copy strong {
  margin-top: 0.2rem;
  color: #fff;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
}

.lp-secondary-cta {
  padding: 0 1.35rem;
  color: #52677c;
}

.landing-page .lp-secondary-cta {
  color: #344f69;
}

.lp-secondary-cta:hover {
  color: var(--lp-navy);
}

.lp-availability {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 1.7rem 0 0;
}

.lp-availability span {
  padding: 0.28rem 0.58rem;
  border: 1px solid rgba(23, 54, 95, 0.18);
  border-radius: 999px;
  color: #536a80;
  font-size: 0.68rem;
  font-weight: 700;
}

.lp-availability small {
  margin-left: 0.35rem;
  color: #7d8995;
  font-size: 0.68rem;
}

.lp-hero-visual {
  position: relative;
  min-height: 570px;
}

.lp-sun-halo {
  position: absolute;
  top: 8%;
  left: 9%;
  width: 460px;
  max-width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 43%, rgba(255, 249, 226, 0.94) 0 26%, rgba(245, 189, 88, 0.5) 27% 43%, rgba(245, 189, 88, 0.12) 44% 62%, transparent 63%);
  filter: blur(0.2px);
}

.lp-sun-halo::before,
.lp-sun-halo::after {
  position: absolute;
  inset: -14%;
  border: 1px solid rgba(65, 108, 159, 0.16);
  border-radius: 50%;
  content: '';
}

.lp-sun-halo::after {
  inset: -30%;
  border-color: rgba(65, 108, 159, 0.08);
}

.lp-product-shell {
  position: absolute;
  top: 54px;
  right: 26px;
  z-index: 3;
  width: min(520px, 88%);
  min-height: 500px;
  overflow: hidden;
  border: 7px solid #0d294b;
  border-radius: 29px;
  background: #eef2f6;
  box-shadow:
    0 35px 70px -30px rgba(12, 37, 69, 0.7),
    0 8px 20px -12px rgba(12, 37, 69, 0.5);
  transform: perspective(1200px) rotateY(-7deg) rotateX(2deg);
}

.lp-product-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 22px;
  background: var(--lp-navy-deep);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.68rem;
}

.lp-product-body {
  padding: 22px;
}

.lp-today-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 22px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 95% 5%, rgba(245, 189, 88, 0.2), transparent 38%),
    var(--lp-navy);
  box-shadow: 0 14px 28px -20px rgba(12, 37, 69, 0.7);
  color: #fff;
}

.lp-label {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lp-today-card p {
  margin: 0.25rem 0 0.85rem;
  font-size: 0.88rem;
}

.lp-today-card p strong {
  padding: 0 0.15em;
  font-size: 1.9rem;
}

.lp-today-card button {
  display: flex;
  width: 178px;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  color: var(--lp-navy);
  font-size: 0.72rem;
  font-weight: 750;
  pointer-events: none;
}

.lp-today-card button span {
  color: #7a8a99;
  font-size: 0.62rem;
}

.lp-ring {
  position: relative;
  display: grid;
  width: 72px;
  height: 72px;
  align-self: center;
  place-items: center;
  border: 7px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--lp-gold);
  border-right-color: var(--lp-gold);
  border-radius: 50%;
  transform: rotate(24deg);
}

.lp-ring span {
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  transform: rotate(-24deg);
}

.lp-stats-card {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px 18px;
  margin-top: 12px;
  padding: 14px 18px;
  border: 1px solid rgba(23, 54, 95, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 22px -20px rgba(12, 37, 69, 0.55);
}

.lp-stats-card > div:first-child {
  display: flex;
  flex-direction: column;
}

.lp-stats-card > div:first-child span {
  color: #7d8a97;
  font-size: 0.57rem;
}

.lp-stats-card strong {
  color: var(--lp-navy);
  font-size: 1.3rem;
}

.lp-stats-card strong small {
  font-size: 0.57rem;
}

.lp-spark {
  display: flex;
  height: 40px;
  align-items: end;
  gap: 5px;
}

.lp-spark i {
  width: 100%;
  border-radius: 3px 3px 1px 1px;
  background: #b7c8d9;
}

.lp-spark i:nth-child(1) { height: 18%; }
.lp-spark i:nth-child(2) { height: 29%; }
.lp-spark i:nth-child(3) { height: 27%; }
.lp-spark i:nth-child(4) { height: 46%; }
.lp-spark i:nth-child(5) { height: 54%; }
.lp-spark i:nth-child(6) { height: 51%; }
.lp-spark i:nth-child(7) { height: 70%; }
.lp-spark i:nth-child(8) { height: 92%; background: var(--lp-blue); }

.lp-streak {
  grid-column: 1 / -1;
  color: #708294;
  font-size: 0.57rem;
}

.lp-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 2px 8px;
  color: var(--lp-navy);
  font-size: 0.65rem;
  font-weight: 750;
}

.lp-board-title small {
  color: #91a0ae;
  font-weight: 500;
}

.lp-board-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 15px;
  min-height: 122px;
  padding: 14px;
  border: 1px solid rgba(23, 54, 95, 0.1);
  border-radius: 16px;
  background: #fff;
}

.lp-book-art {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #e6edf5;
}

.lp-book-art::before {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--lp-gold);
  content: '';
}

.lp-book-art span {
  position: absolute;
  bottom: 21px;
  left: 18px;
  width: 70px;
  height: 11px;
  border-radius: 8px;
  background: var(--lp-navy);
  transform: rotate(-6deg);
}

.lp-book-art span:nth-child(2) {
  bottom: 34px;
  width: 58px;
  background: #456e9c;
}

.lp-book-art span:nth-child(3) {
  bottom: 47px;
  width: 46px;
  background: #7994b2;
}

.lp-board-card > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.lp-today-pill {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eaf1f8;
  color: var(--lp-blue);
  font-size: 0.54rem;
  font-weight: 750;
}

.lp-board-card strong {
  overflow: hidden;
  color: var(--lp-navy);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-board-card small {
  color: #7e8d9a;
  font-size: 0.54rem;
}

.lp-progress {
  height: 5px;
  margin: 12px 0 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf0;
}

.lp-progress i {
  display: block;
  width: 68%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7295b9, var(--lp-navy));
}

.lp-float-card {
  position: absolute;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(23, 54, 95, 0.1);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 34px -22px rgba(12, 37, 69, 0.62);
  backdrop-filter: blur(9px);
  color: #536a80;
  font-size: 0.66rem;
  font-weight: 650;
}

.lp-float-card span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--lp-navy);
  color: #fff;
  font-size: 0.62rem;
}

.lp-float-ai {
  top: 105px;
  left: 0;
}

.lp-float-memory {
  right: 0;
  bottom: 35px;
}

.lp-float-memory span {
  background: var(--lp-gold);
  color: var(--lp-navy-deep);
}

.lp-promise {
  position: relative;
  display: grid;
  min-height: 460px;
  place-content: center;
  overflow: hidden;
  padding: 90px 24px;
  background: var(--lp-paper);
  text-align: center;
}

.lp-promise::before,
.lp-promise::after {
  position: absolute;
  top: 50%;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(23, 54, 95, 0.1);
  border-radius: 50%;
  content: '';
  transform: translateY(-50%);
}

.lp-promise::before {
  left: -130px;
}

.lp-promise::after {
  right: -130px;
}

.lp-promise p {
  margin: 0 0 1.25rem;
  color: #778898;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.lp-promise h2 {
  margin: 0;
  color: var(--lp-navy);
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(1.9rem, 4vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.55;
}

.lp-flow {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 120px 0 140px;
}

.lp-section-head {
  max-width: 650px;
  margin-bottom: 58px;
}

.lp-section-head > p {
  margin: 0 0 0.85rem;
  color: #8c7a55;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.lp-section-head h2 {
  margin: 0;
  color: var(--lp-navy);
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(2rem, 3.7vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.4;
}

.lp-section-head > span {
  display: block;
  margin-top: 1rem;
  color: #6f8192;
  font-size: 0.86rem;
}

.lp-flow-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  background: rgba(23, 54, 95, 0.13);
  list-style: none;
}

.lp-flow-list li {
  position: relative;
  min-height: 360px;
  padding: 34px;
  background: var(--lp-cream);
}

.lp-flow-no {
  color: #9c8a65;
  font-family: 'Avenir Next', sans-serif;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lp-flow-icon {
  position: relative;
  width: 120px;
  height: 110px;
  margin: 37px auto 32px;
}

.lp-flow-list h3 {
  margin: 0 0 0.85rem;
  color: var(--lp-navy);
  font-size: 1.05rem;
}

.lp-flow-list p {
  margin: 0;
  color: #6b7d8e;
  font-size: 0.81rem;
  line-height: 1.85;
}

.lp-flow-select {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 7px;
}

.lp-flow-select i {
  display: block;
  width: 29px;
  height: 76px;
  border: 2px solid var(--lp-navy);
  border-radius: 7px;
  background: #fff;
  box-shadow: 5px 6px 0 #dce5ee;
  transform: translateY(4px) rotate(-5deg);
}

.lp-flow-select i:nth-child(2) {
  height: 92px;
  border-color: #8f7340;
  background:
    radial-gradient(circle at 50% 25%, var(--lp-gold) 0 8px, transparent 9px),
    #fff;
  transform: translateY(0);
}

.lp-flow-select i:nth-child(3) {
  transform: translateY(4px) rotate(5deg);
}

.lp-flow-make i {
  position: absolute;
  border-radius: 9px;
}

.lp-flow-make i:first-child {
  inset: 10px 24px 12px 8px;
  border: 2px solid var(--lp-navy);
  background:
    linear-gradient(#c2cfdb 0 0) 15px 21px / 54px 3px no-repeat,
    linear-gradient(#c2cfdb 0 0) 15px 34px / 44px 3px no-repeat,
    linear-gradient(#c2cfdb 0 0) 15px 47px / 58px 3px no-repeat,
    #fff;
  box-shadow: 8px 9px 0 #dce5ee;
  transform: rotate(-5deg);
}

.lp-flow-make i:last-child {
  top: 4px;
  right: 4px;
  width: 34px;
  height: 34px;
  background: var(--lp-gold);
  box-shadow: 0 0 0 7px var(--lp-cream);
}

.lp-flow-learn {
  display: grid;
  place-items: center;
}

.lp-flow-learn i {
  display: block;
  width: 86px;
  height: 86px;
  border: 10px solid #d6e0e9;
  border-top-color: var(--lp-gold);
  border-right-color: var(--lp-navy);
  border-radius: 50%;
  transform: rotate(24deg);
}

.lp-flow-learn::after {
  position: absolute;
  color: var(--lp-navy);
  content: '24';
  font-family: 'Avenir Next', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
}

.lp-ai-flow {
  padding: 125px max(24px, calc((100vw - 1080px) / 2)) 135px;
  background: var(--lp-paper);
}

.lp-ai-flow .lp-section-head {
  max-width: 760px;
}

.lp-ai-workbench {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.55fr);
  gap: 48px;
  align-items: stretch;
}

.lp-ai-steps {
  display: grid;
  align-content: center;
  gap: 0;
  margin: 0;
  padding: 12px 0;
  list-style: none;
}

.lp-ai-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 18px 0;
}

.lp-ai-steps li:not(:last-child)::after {
  position: absolute;
  top: 54px;
  bottom: -10px;
  left: 20px;
  width: 1px;
  background: rgba(23, 54, 95, 0.17);
  content: '';
}

.lp-ai-steps li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(23, 54, 95, 0.2);
  border-radius: 50%;
  background: var(--lp-paper);
  color: var(--lp-navy);
  font-family: 'Avenir Next', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
}

.lp-ai-steps li:nth-child(3) > span {
  border-color: var(--lp-gold);
  background: var(--lp-gold);
  color: var(--lp-navy-deep);
}

.lp-ai-steps strong {
  display: block;
  color: var(--lp-navy);
  font-size: 0.9rem;
}

.lp-ai-steps p {
  margin: 0.35rem 0 0;
  color: #748596;
  font-size: 0.73rem;
  line-height: 1.65;
}

.lp-example {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) 76px minmax(0, 1.35fr);
  align-items: center;
  min-height: 430px;
  padding: 34px;
  border: 1px solid rgba(23, 54, 95, 0.1);
  border-radius: 26px;
  background:
    radial-gradient(circle at 75% 14%, rgba(245, 189, 88, 0.24), transparent 25%),
    #edf2f6;
  box-shadow: 0 28px 58px -42px rgba(12, 37, 69, 0.7);
}

.lp-example-source,
.lp-example-output {
  overflow: hidden;
  border: 1px solid rgba(23, 54, 95, 0.1);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 26px -24px rgba(12, 37, 69, 0.65);
}

.lp-example-source {
  padding-bottom: 18px;
}

.lp-example-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 1px solid #e4eaf0;
  color: var(--lp-navy);
  font-size: 0.7rem;
  font-weight: 800;
}

.lp-example-bar small {
  color: #8a98a6;
  font-size: 0.56rem;
  font-weight: 650;
}

.lp-example-source > p {
  margin: 16px 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed #d9e1e8;
  color: #6b7d8e;
  font-size: 0.68rem;
}

.lp-example-source > p:last-child {
  border-bottom: 0;
}

.lp-example-source strong {
  color: var(--lp-navy);
  font-size: 0.75rem;
}

.lp-ai-transform {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: var(--lp-navy);
}

.lp-ai-transform span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--lp-navy);
  box-shadow: 0 10px 18px -12px rgba(12, 37, 69, 0.8);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.lp-ai-transform i {
  margin: 0.42rem 0;
  color: #7e91a4;
  font-size: 1.2rem;
  font-style: normal;
}

.lp-ai-transform small {
  color: #7c8c9b;
  font-size: 0.5rem;
  text-align: center;
}

.lp-output-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
}

.lp-output-grid article {
  min-height: 112px;
  padding: 14px;
  border-radius: 10px;
  background: #f4f7fa;
}

.lp-output-grid article:nth-child(1) {
  background: var(--lp-navy);
}

.lp-output-grid article > span {
  color: #8798a9;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.lp-output-grid article:nth-child(1) > span,
.lp-output-grid article:nth-child(1) p {
  color: rgba(255, 255, 255, 0.65);
}

.lp-output-grid strong {
  display: block;
  margin-top: 1.15rem;
  color: var(--lp-navy);
  font-size: 0.78rem;
}

.lp-output-grid article:nth-child(1) strong {
  color: #fff;
}

.lp-output-grid p {
  margin: 0.3rem 0 0;
  color: #6f8192;
  font-size: 0.61rem;
}

.lp-ai-note {
  margin: 30px 0 0 calc(31% + 48px);
  color: #718293;
  font-size: 0.72rem;
  line-height: 1.8;
}

.lp-features {
  position: relative;
  padding: 125px max(24px, calc((100vw - 1080px) / 2)) 145px;
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(245, 189, 88, 0.16), transparent 22%),
    var(--lp-navy-deep);
}

.lp-features::before {
  position: absolute;
  top: -360px;
  right: -260px;
  width: 780px;
  height: 780px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: '';
}

.lp-section-head-light {
  position: relative;
  z-index: 2;
}

.lp-section-head-light h2 {
  color: #fffaf0;
}

.lp-section-head-light > p {
  color: var(--lp-gold);
}

.lp-feature-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.lp-feature-grid article {
  min-height: 250px;
  padding: 32px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.lp-feature-grid article > span {
  color: var(--lp-gold);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.lp-feature-grid h3 {
  margin: 3rem 0 0.9rem;
  color: #fff;
  font-size: 1.02rem;
}

.lp-feature-grid p {
  margin: 0;
  color: rgba(239, 244, 249, 0.67);
  font-size: 0.79rem;
  line-height: 1.9;
}

.lp-devices {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  width: min(1120px, calc(100% - 48px));
  min-height: 740px;
  margin: 0 auto;
  padding: 120px 0;
}

.lp-device-art {
  position: relative;
  min-height: 470px;
}

.lp-tablet-device {
  position: absolute;
  top: 30px;
  right: 46px;
  left: 0;
  height: 380px;
  padding: 10px;
  border-radius: 27px;
  background: #112f53;
  box-shadow: 0 32px 54px -30px rgba(12, 37, 69, 0.72);
  transform: rotate(-3deg);
}

.lp-tablet-device > div {
  height: 100%;
  padding: 32px;
  border-radius: 18px;
  background: #edf2f6;
}

.lp-tablet-device .brand-mark {
  margin-bottom: 30px;
}

.lp-tablet-device span {
  display: block;
  margin-bottom: 20px;
  color: var(--lp-navy);
  font-size: 1rem;
  font-weight: 750;
}

.lp-tablet-device i {
  display: block;
  width: 82%;
  height: 46px;
  margin-bottom: 10px;
  border: 1px solid #d4dee7;
  border-radius: 10px;
  background: #fff;
}

.lp-tablet-device i:nth-of-type(2) {
  width: 65%;
}

.lp-tablet-device i:nth-of-type(3) {
  width: 74%;
}

.lp-phone-device {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  width: 190px;
  height: 380px;
  padding: 8px;
  border-radius: 35px;
  background: #0a2342;
  box-shadow: 0 32px 54px -24px rgba(12, 37, 69, 0.78);
  transform: rotate(5deg);
}

.lp-phone-device > div {
  display: flex;
  height: 100%;
  flex-direction: column;
  align-items: center;
  padding: 38px 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 38%, rgba(245, 189, 88, 0.2), transparent 28%),
    var(--lp-navy);
  color: #fff;
}

.lp-phone-device .brand-mark {
  margin-bottom: 58px;
}

.lp-phone-device strong {
  font-size: 1.55rem;
}

.lp-phone-device span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.7rem;
}

.lp-phone-device button {
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  background: var(--lp-gold);
  color: var(--lp-navy-deep);
  font-size: 0.75rem;
  font-weight: 800;
  pointer-events: none;
}

.lp-device-copy {
  padding-left: clamp(20px, 6vw, 80px);
}

.lp-device-copy h2 {
  margin: 0;
  color: var(--lp-navy);
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.42;
}

.lp-device-copy > p:not(.lp-eyebrow) {
  margin: 1.7rem 0;
  color: #64788b;
  font-size: 0.9rem;
  line-height: 2;
}

.lp-device-copy ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  color: #52697f;
  font-size: 0.8rem;
  list-style: none;
}

.lp-device-copy li {
  position: relative;
  padding-left: 1.3rem;
}

.lp-device-copy li::before {
  position: absolute;
  top: 0.66em;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lp-gold);
  content: '';
}

.lp-final-cta {
  position: relative;
  display: flex;
  min-height: 610px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 100px 24px;
  background: var(--lp-paper);
  text-align: center;
}

.lp-final-sun {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(23, 54, 95, 0.09);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.lp-final-sun::before,
.lp-final-sun::after {
  position: absolute;
  border: 1px solid rgba(23, 54, 95, 0.07);
  border-radius: 50%;
  content: '';
}

.lp-final-sun::before {
  inset: 70px;
}

.lp-final-sun::after {
  inset: 150px;
  border: 0;
  background: rgba(245, 189, 88, 0.15);
}

.lp-final-cta > *:not(.lp-final-sun) {
  position: relative;
  z-index: 2;
}

.lp-final-cta > p {
  margin: 1.35rem 0 0.7rem;
  color: #8d7952;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.lp-final-cta h2 {
  margin: 0;
  color: var(--lp-navy);
  font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif;
  font-size: clamp(2.35rem, 5vw, 4.3rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 1.35;
}

.lp-store-launch {
  display: inline-flex;
  min-width: 290px;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-top: 2.3rem;
  padding: 0.75rem 1.6rem;
  border-radius: 16px;
  background: var(--lp-navy-deep);
  box-shadow: 0 16px 30px -18px rgba(12, 37, 69, 0.8);
  color: #fff;
}

.lp-store-launch small {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.62rem;
}

.lp-store-launch strong {
  margin-top: 0.18rem;
  color: #fff;
  font-size: 0.9rem;
}

.lp-store-download {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 2.3rem;
  padding: 0.85rem 1rem 0.85rem 1.25rem;
  border: 1px solid rgba(23, 54, 95, 0.12);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 38px -26px rgba(12, 37, 69, 0.72);
}

.lp-app-store-badge-link {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: transform 150ms ease;
}

.lp-app-store-badge-link:hover {
  transform: translateY(-2px);
}

.lp-app-store-badge {
  display: block;
  width: auto;
  height: 54px;
}

.lp-app-store-qr {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.35rem;
  color: #647487;
  font-size: 0.58rem;
  font-weight: 700;
}

.lp-app-store-qr img {
  display: block;
  width: 84px;
  height: 84px;
  border: 6px solid #fff;
  border-radius: 8px;
}

.lp-final-cta .lp-web-login {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 0 1.25rem;
  border: 1px solid rgba(23, 54, 95, 0.28);
  border-radius: 999px;
  color: var(--lp-navy);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.landing-page .lp-final-cta .lp-web-login {
  color: var(--lp-navy);
}

.lp-final-cta .lp-web-login:hover {
  background: #244e7d;
  color: #fff;
  transform: translateY(-2px);
}

.lp-final-cta > small {
  margin-top: 1rem;
  color: #84909b;
  font-size: 0.65rem;
}

.lp-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 110px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: var(--lp-navy-deep);
  color: rgba(255, 255, 255, 0.58);
}

.lp-footer .brand-lockup {
  color: #fff;
}

.lp-footer p,
.lp-footer nav {
  margin: 0;
  font-size: 0.7rem;
}

.lp-footer nav {
  display: flex;
  gap: 1rem;
}

.lp-footer nav a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.lp-footer nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.lp-footer > span {
  justify-self: end;
  font-size: 0.66rem;
}

/* ============ 法務・サポート ============ */
.legal-page {
  min-height: 100vh;
  background: var(--lp-cream);
  color: var(--lp-navy);
}

.legal-header,
.legal-content,
.legal-footer {
  width: min(100% - 40px, 860px);
  margin: 0 auto;
}

.legal-header {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(23, 54, 95, 0.12);
}

.legal-header > a:first-child {
  color: var(--lp-navy);
  text-decoration: none;
}

.legal-back,
.legal-header button {
  min-height: 40px;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(23, 54, 95, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--lp-navy);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.legal-content {
  max-width: 760px;
  padding: 64px 0 80px;
}

.legal-content h1 {
  margin: 0;
  font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.04em;
}

.legal-updated {
  margin: 0.5rem 0 3rem;
  color: #718092;
  font-size: 0.76rem;
}

.legal-content section {
  margin-top: 2.3rem;
}

.legal-content h2 {
  margin: 0 0 0.7rem;
  color: var(--lp-navy);
  font-size: 1.05rem;
}

.legal-content p,
.legal-content li {
  color: #465b71;
  font-size: 0.9rem;
  line-height: 1.95;
}

.legal-content a {
  color: var(--lp-blue);
  font-weight: 700;
}

.support-contact {
  padding: 1.5rem;
  border: 1px solid rgba(23, 54, 95, 0.12);
  border-radius: 20px;
  background: #fff;
}

.support-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid rgba(23, 54, 95, 0.15);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(51, 94, 139, 0.1), #fff 72%);
}

.support-guide span {
  color: var(--lp-blue);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.support-guide h2,
.support-guide p {
  margin: 0.25rem 0 0;
}

.support-guide button,
.support-guide .legal-primary-link {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--lp-navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.support-contact .legal-primary-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-right: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--lp-navy);
  color: #fff;
  text-decoration: none;
}

.legal-footer {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(23, 54, 95, 0.12);
  color: #718092;
  font-size: 0.68rem;
}

.legal-footer nav {
  display: flex;
  gap: 1rem;
}

.legal-footer a,
.legal-footer button {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-decoration: underline;
}

.legal-page-embedded {
  background: var(--bg);
  color: var(--ink);
}

.legal-page-embedded .legal-header,
.legal-page-embedded .legal-footer {
  border-color: var(--hair);
}

.legal-page-embedded .legal-header > a:first-child,
.legal-page-embedded .legal-content h1,
.legal-page-embedded .legal-content h2 {
  color: var(--ink);
}

.legal-page-embedded .legal-content p,
.legal-page-embedded .legal-content li,
.legal-page-embedded .legal-footer {
  color: var(--muted);
}

.legal-page-embedded .legal-header button,
.legal-page-embedded .support-contact,
.legal-page-embedded .support-guide {
  border-color: var(--hair);
  background: var(--card);
  color: var(--ink);
}

/* ============ 使い方ガイド ============ */
.guide-page .legal-header,
.guide-page .legal-footer {
  width: min(100% - 40px, 1060px);
}

.guide-content {
  max-width: 980px;
}

.legal-content .guide-hero {
  position: relative;
  overflow: hidden;
  margin-top: 0;
  padding: clamp(2rem, 5vw, 4rem);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 197, 79, 0.36), transparent 10rem),
    linear-gradient(135deg, #17365f, #244e7d 68%, #315d8d);
  box-shadow: 0 24px 55px rgba(23, 54, 95, 0.18);
  color: #fff;
}

.guide-hero::after {
  content: '';
  position: absolute;
  right: -55px;
  bottom: -85px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.guide-hero .guide-kicker {
  margin: 0;
  color: #ffd777;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.legal-content .guide-hero h1 {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  color: #fff;
}

.legal-content .guide-hero > p:not(.guide-kicker) {
  position: relative;
  z-index: 1;
  max-width: 42rem;
  margin: 1rem 0 0;
  color: rgba(255, 255, 255, 0.83);
  font-size: 0.95rem;
}

.guide-hero-route {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.6rem;
}

.guide-hero-route span {
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 750;
}

.guide-hero-route i {
  color: #ffd777;
  font-style: normal;
}

.guide-toc {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 1.25rem;
  margin: 1.25rem 0 3.5rem;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(23, 54, 95, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
}

.guide-toc > strong {
  padding-top: 0.25rem;
  color: var(--lp-navy);
  font-size: 0.76rem;
}

.guide-toc > div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.legal-content .guide-toc a {
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  background: rgba(51, 94, 139, 0.09);
  color: var(--lp-blue);
  font-size: 0.72rem;
  text-decoration: none;
}

.legal-content .guide-section {
  margin-top: 0;
  padding: 0 0 4.8rem;
  scroll-margin-top: 1.5rem;
}

.guide-section + .guide-section {
  padding-top: 4.5rem;
  border-top: 1px solid rgba(23, 54, 95, 0.12);
}

.guide-section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.7rem;
}

.guide-section-heading > span {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: var(--lp-navy);
  color: #fff;
  font-size: 0.77rem;
  font-weight: 850;
}

.guide-section-heading p,
.guide-section-heading h2 {
  margin: 0;
}

.guide-section-heading p {
  color: var(--lp-blue);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.legal-content .guide-section-heading h2 {
  margin-top: 0.15rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
  letter-spacing: -0.035em;
}

.guide-lead {
  max-width: 48rem;
  margin: -0.5rem 0 1.7rem;
}

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 0.78fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}

.guide-split-reverse {
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.08fr);
}

.guide-steps {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  counter-reset: guide-step;
  list-style: none;
}

.guide-steps li {
  position: relative;
  min-height: 46px;
  padding-left: 3.4rem;
  counter-increment: guide-step;
}

.guide-steps li::before {
  content: counter(guide-step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(51, 94, 139, 0.18);
  border-radius: 50%;
  background: rgba(51, 94, 139, 0.08);
  color: var(--lp-blue);
  font-size: 0.72rem;
  font-weight: 850;
}

.guide-steps strong,
.guide-steps span {
  display: block;
}

.guide-steps strong {
  color: var(--lp-navy);
  font-size: 0.9rem;
}

.guide-steps span {
  margin-top: 0.2rem;
  color: #52677d;
  font-size: 0.8rem;
  line-height: 1.8;
}

.guide-note,
.guide-warning {
  margin-top: 1.4rem;
  padding: 1rem 1.1rem;
  border-left: 4px solid var(--lp-blue);
  border-radius: 0 14px 14px 0;
  background: rgba(51, 94, 139, 0.08);
}

.guide-warning {
  border-left-color: #c9822f;
  background: rgba(201, 130, 47, 0.09);
}

.guide-note strong,
.guide-warning strong {
  color: var(--lp-navy);
  font-size: 0.8rem;
}

.legal-content .guide-note p,
.legal-content .guide-warning p {
  margin: 0.25rem 0 0;
  font-size: 0.76rem;
  line-height: 1.75;
}

.guide-figure {
  margin: 0;
}

.guide-figure img {
  display: block;
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border: 1px solid rgba(23, 54, 95, 0.12);
  border-radius: 24px;
  background: #eaf0f6;
  box-shadow: 0 18px 38px rgba(23, 54, 95, 0.14);
}

.guide-figure figcaption {
  margin-top: 0.65rem;
  color: #718092;
  font-size: 0.68rem;
  line-height: 1.65;
}

.guide-tab-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.7rem;
}

.guide-tab-grid article,
.guide-tool-grid article,
.guide-plan-grid article,
.guide-route-grid article {
  padding: 1rem;
  border: 1px solid rgba(23, 54, 95, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-tab-grid b,
.guide-tab-grid strong {
  display: block;
}

.guide-tab-grid b {
  margin-bottom: 0.55rem;
  font-size: 1.35rem;
}

.guide-tab-grid strong,
.guide-tool-grid strong,
.guide-plan-grid strong {
  color: var(--lp-navy);
  font-size: 0.82rem;
}

.legal-content .guide-tab-grid p,
.legal-content .guide-tool-grid p,
.legal-content .guide-plan-grid p {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.65;
}

.guide-concept-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0 2rem;
  padding: 1.2rem;
  border-radius: 18px;
  background: var(--lp-navy);
  color: #fff;
}

.guide-concept-map > div {
  display: grid;
  gap: 0.15rem;
  text-align: center;
}

.guide-concept-map small,
.guide-concept-map span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.65rem;
}

.guide-concept-map strong {
  color: #fff;
}

.guide-concept-map i {
  color: #ffd777;
  font-style: normal;
}

.guide-route-grid,
.guide-tool-grid,
.guide-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.guide-route-grid article {
  border-top: 4px solid var(--lp-blue);
}

.guide-route-grid article:last-child {
  border-top-color: #9375b7;
}

.guide-route-grid article > span,
.guide-plan-grid article > span {
  color: var(--lp-blue);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.legal-content .guide-route-grid h3,
.guide-split h3 {
  margin: 0.3rem 0 0.55rem;
  color: var(--lp-navy);
  font-size: 1rem;
}

.guide-route-grid code {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 0.4rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: #17365f;
  color: #fff;
  font-size: 0.7rem;
}

.guide-route-grid ol,
.guide-compact-steps {
  margin: 0.8rem 0 0;
  padding-left: 1.25rem;
}

.guide-format-reference {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(26, 62, 102, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-format-reference > summary {
  min-height: 44px;
  color: var(--lp-navy);
  font-weight: 850;
  cursor: pointer;
}

.legal-content .guide-format-reference > p {
  margin: 0.45rem 0 0.8rem;
  font-size: 0.78rem;
}

.guide-format-reference section + section {
  margin-top: 0.8rem;
}

.legal-content .guide-format-reference h4 {
  margin: 0 0 0.35rem;
  color: var(--lp-navy);
  font-size: 0.8rem;
}

.guide-format-reference pre {
  max-width: 100%;
  margin: 0;
  padding: 0.7rem;
  overflow-x: auto;
  border-radius: 10px;
  background: #17365f;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.legal-content .guide-route-grid li,
.legal-content .guide-compact-steps li {
  font-size: 0.76rem;
  line-height: 1.75;
}

.guide-check-list {
  display: grid;
  gap: 0.6rem;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.guide-check-list li {
  position: relative;
  padding-left: 1.45rem;
}

.guide-check-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--lp-blue);
  font-weight: 850;
}

.guide-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 2.2rem;
}

.guide-plan-grid {
  margin-top: 1.5rem;
}

.guide-plan-grid article:last-child {
  border-color: rgba(51, 94, 139, 0.24);
  background: linear-gradient(135deg, rgba(51, 94, 139, 0.11), rgba(255, 255, 255, 0.82));
}

.guide-plan-grid strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.95rem;
}

.legal-content .guide-small {
  margin: 0.8rem 0 0;
  color: #718092;
  font-size: 0.68rem;
}

.guide-faq {
  display: grid;
  gap: 0.65rem;
}

.guide-faq details {
  border: 1px solid rgba(23, 54, 95, 0.11);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.guide-faq summary {
  padding: 1rem 1.1rem;
  color: var(--lp-navy);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 750;
}

.legal-content .guide-faq p {
  margin: 0;
  padding: 0 1.1rem 1rem;
  font-size: 0.78rem;
  line-height: 1.75;
}

.legal-content .guide-support {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--lp-navy);
}

.guide-support span {
  color: #ffd777;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.legal-content .guide-support h2,
.legal-content .guide-support p {
  margin: 0.2rem 0 0;
  color: #fff;
}

.legal-content .guide-support h2 {
  font-size: 1.05rem;
}

.legal-content .guide-support p {
  max-width: 38rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  line-height: 1.7;
}

.legal-content .guide-support a {
  flex: 0 0 auto;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: #fff;
  color: var(--lp-navy);
  font-size: 0.74rem;
  text-decoration: none;
}

.legal-page-embedded .guide-toc,
.legal-page-embedded .guide-tab-grid article,
.legal-page-embedded .guide-tool-grid article,
.legal-page-embedded .guide-plan-grid article,
.legal-page-embedded .guide-route-grid article,
.legal-page-embedded .guide-format-reference,
.legal-page-embedded .guide-faq details {
  border-color: var(--hair);
  background: var(--card);
}

.legal-page-embedded .guide-section + .guide-section {
  border-color: var(--hair);
}

.legal-page-embedded .guide-steps strong,
.legal-page-embedded .guide-note strong,
.legal-page-embedded .guide-warning strong,
.legal-page-embedded .guide-tab-grid strong,
.legal-page-embedded .guide-tool-grid strong,
.legal-page-embedded .guide-plan-grid strong,
.legal-page-embedded .guide-route-grid h3,
.legal-page-embedded .guide-format-reference summary,
.legal-page-embedded .guide-format-reference h4,
.legal-page-embedded .guide-split h3,
.legal-page-embedded .guide-faq summary,
.legal-page-embedded .guide-toc > strong {
  color: var(--ink);
}

.legal-page-embedded .guide-steps span {
  color: var(--muted);
}

.landing-page a:focus-visible,
.legal-page a:focus-visible,
.legal-page button:focus-visible {
  outline: 3px solid var(--lp-gold);
  outline-offset: 4px;
}

@media (max-width: 980px) {
  .lp-nav {
    grid-template-columns: 1fr auto;
  }

  .lp-nav nav {
    display: none;
  }

  .lp-hero {
    grid-template-columns: 1fr;
    padding-top: 64px;
  }

  .lp-hero-copy {
    max-width: 720px;
    padding: 0;
  }

  .lp-hero-visual {
    min-height: 600px;
    margin-top: 20px;
  }

  .lp-product-shell {
    right: 50%;
    width: min(550px, 84%);
    transform: translateX(50%) perspective(1200px) rotateY(-4deg) rotateX(2deg);
  }

  .lp-float-ai {
    left: 4%;
  }

  .lp-float-memory {
    right: 4%;
  }

  .lp-flow-list {
    grid-template-columns: 1fr;
  }

  .lp-flow-list li {
    display: grid;
    min-height: 0;
    grid-template-columns: 56px 130px 1fr;
    align-items: center;
    gap: 12px;
  }

  .lp-flow-icon {
    margin: 0;
    transform: scale(0.74);
  }

  .lp-flow-list h3,
  .lp-flow-list p {
    grid-column: 3;
  }

  .lp-flow-list h3 {
    align-self: end;
    margin: 0 0 0.35rem;
  }

  .lp-flow-list p {
    align-self: start;
  }

  .lp-feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lp-ai-workbench {
    grid-template-columns: 1fr;
  }

  .lp-ai-steps {
    grid-template-columns: repeat(2, 1fr);
    gap: 4px 22px;
  }

  .lp-ai-steps li:not(:last-child)::after {
    content: none;
  }

  .lp-ai-note {
    margin-left: 0;
  }

  .lp-devices {
    grid-template-columns: 1fr;
  }

  .lp-device-art {
    max-width: 650px;
    width: 100%;
    margin: 0 auto 70px;
  }

  .lp-device-copy {
    max-width: 680px;
    padding-left: 0;
  }
}

@media (max-width: 680px) {
  .lp-nav {
    width: calc(100% - 32px);
    min-height: 72px;
  }

  .lp-nav .brand-name small {
    display: none;
  }

  .lp-nav-cta {
    padding: 0.55rem 0.8rem;
    font-size: 0.72rem;
  }

  .lp-hero {
    width: calc(100% - 36px);
    min-height: auto;
    padding: 50px 0 60px;
  }

  .lp-hero h1 {
    font-size: clamp(2.55rem, 13vw, 4rem);
    line-height: 1.28;
  }

  .lp-hero-lead br {
    display: none;
  }

  .lp-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .lp-primary-cta,
  .lp-secondary-cta {
    width: 100%;
  }

  .lp-availability small {
    width: 100%;
    margin: 0.25rem 0 0;
  }

  .lp-hero-visual {
    min-height: 480px;
    margin-top: 35px;
  }

  .lp-product-shell {
    top: 28px;
    width: 100%;
    min-height: 420px;
    border-width: 5px;
    border-radius: 23px;
    transform: translateX(50%);
  }

  .lp-product-top {
    min-height: 54px;
    padding: 0 16px;
  }

  .lp-product-top .brand-name {
    display: none;
  }

  .lp-product-body {
    padding: 15px;
  }

  .lp-today-card {
    padding: 16px;
  }

  .lp-today-card button {
    width: 145px;
  }

  .lp-board-card {
    grid-template-columns: 84px 1fr;
  }

  .lp-float-card {
    display: none;
  }

  .lp-promise {
    min-height: 400px;
  }

  .lp-flow {
    width: calc(100% - 32px);
    padding: 90px 0;
  }

  .lp-ai-flow {
    padding: 90px 18px 100px;
  }

  .lp-ai-steps {
    grid-template-columns: 1fr;
  }

  .lp-example {
    grid-template-columns: 1fr;
    gap: 18px;
    min-height: 0;
    padding: 18px;
  }

  .lp-ai-transform {
    flex-direction: row;
    justify-content: center;
    gap: 0.7rem;
  }

  .lp-ai-transform i {
    margin: 0;
    transform: rotate(90deg);
  }

  .lp-ai-transform small {
    max-width: 80px;
  }

  .lp-section-head {
    margin-bottom: 40px;
  }

  .lp-flow-list li {
    display: block;
    padding: 26px;
  }

  .lp-flow-icon {
    margin: 20px auto;
    transform: scale(0.82);
  }

  .lp-flow-list h3,
  .lp-flow-list p {
    grid-column: auto;
  }

  .lp-features {
    padding-top: 90px;
    padding-bottom: 100px;
  }

  .lp-feature-grid {
    grid-template-columns: 1fr;
  }

  .lp-feature-grid article {
    min-height: 210px;
    padding: 27px;
  }

  .lp-feature-grid h3 {
    margin-top: 2rem;
  }

  .lp-devices {
    width: calc(100% - 36px);
    min-height: auto;
    padding: 90px 0;
  }

  .lp-device-art {
    min-height: 365px;
    margin-bottom: 55px;
  }

  .lp-tablet-device {
    right: 35px;
    height: 300px;
  }

  .lp-tablet-device > div {
    padding: 23px;
  }

  .lp-tablet-device i {
    height: 34px;
  }

  .lp-phone-device {
    width: 142px;
    height: 288px;
    border-radius: 27px;
  }

  .lp-phone-device > div {
    padding: 27px 12px;
    border-radius: 21px;
  }

  .lp-phone-device .brand-mark {
    margin-bottom: 35px;
  }

  .lp-final-cta {
    min-height: 560px;
  }

  .lp-store-download {
    padding: 0.75rem 0.8rem 0.75rem 1rem;
    gap: 0.8rem;
  }

  .lp-app-store-badge {
    height: 48px;
  }

  .lp-app-store-qr img {
    width: 72px;
    height: 72px;
  }

  .lp-footer {
    display: flex;
    min-height: 170px;
    align-items: flex-start;
    justify-content: center;
    flex-direction: column;
    gap: 0.75rem;
  }

  .lp-footer > span {
    align-self: flex-start;
  }

  .lp-footer nav,
  .legal-footer {
    flex-wrap: wrap;
  }

  .legal-content {
    padding: 44px 0 60px;
  }

  .legal-footer {
    min-height: 130px;
    align-content: center;
    gap: 0.8rem;
  }
}

@media (max-width: 820px) {
  .guide-split,
  .guide-split-reverse {
    grid-template-columns: 1fr;
  }

  .guide-tab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-figure {
    width: min(100%, 420px);
    margin-inline: auto;
  }
}

@media (max-width: 680px) {
  .support-guide {
    align-items: stretch;
    flex-direction: column;
  }

  .support-guide button,
  .support-guide .legal-primary-link {
    align-self: flex-start;
  }

  .guide-content {
    width: min(100% - 28px, 980px);
  }

  .legal-content .guide-hero {
    padding: 1.6rem 1.25rem;
    border-radius: 22px;
  }

  .legal-content .guide-hero > p:not(.guide-kicker) {
    font-size: 0.82rem;
    line-height: 1.75;
  }

  .guide-hero-route {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-hero-route i {
    display: none;
  }

  .guide-hero-route span {
    text-align: center;
  }

  .guide-toc {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-bottom: 2.7rem;
  }

  .legal-content .guide-section {
    padding-bottom: 3.4rem;
  }

  .guide-section + .guide-section {
    padding-top: 3.3rem;
  }

  .guide-section-heading {
    gap: 0.8rem;
    margin-bottom: 1.35rem;
  }

  .guide-section-heading > span {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }

  .guide-tab-grid,
  .guide-tool-grid,
  .guide-route-grid,
  .guide-plan-grid {
    grid-template-columns: 1fr;
  }

  .guide-concept-map {
    grid-template-columns: 1fr;
  }

  .guide-concept-map i {
    text-align: center;
  }

  .guide-figure img {
    max-height: 520px;
    border-radius: 18px;
  }

  .legal-content .guide-support {
    align-items: stretch;
    flex-direction: column;
  }

  .legal-content .guide-support a {
    align-self: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page *,
  .landing-page *::before,
  .landing-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
