/* =====================================================================
   見た目の土台（2026-09-29 参考画像「ホーム画面4案」のテイストに合わせ直し）
   - ライト＝B・D 案: ほぼ白の地、白いカード（髪の毛ほどの縁＋やわらかい影）、差し色は深い緑1色
   - ダーク＝A 案: 深い緑の地（ホームは写真）、曇りガラスのカード（うっすら白い縁）、差し色はミント
   - 浮いている物（フッター・ポップアップ・シート・ホームの板）だけ背景をぼかす。スクロールする一覧はぼかさない（軽くする）
   - 動き: 時間と曲線は motion.js と同じばね（--ease-smooth / --ease-bouncy）。押した瞬間に縮む
   - 動きを減らす／透明度を下げる／コントラストを上げる設定に合わせて控えめ・不透明にする
   ===================================================================== */
:root {
  --ease-smooth: linear(0, 0.0288, 0.0933, 0.1794, 0.27, 0.3633, 0.4489, 0.5301, 0.6005, 0.6645, 0.7183, 0.766, 0.8053, 0.8396, 0.8674, 0.8915, 0.9108, 0.9273, 0.9405, 0.9518, 0.9607, 0.9682, 0.9742, 0.9792, 0.9831, 0.9864, 0.989, 0.9912, 0.9929, 0.9943, 0.9954, 0.9963, 0.997, 0.9976, 0.9981, 0.9985, 0.9988, 0.999, 0.9992, 0.9994, 1);
  --ease-bouncy: linear(0, 0.0311, 0.1077, 0.2078, 0.3233, 0.4376, 0.5503, 0.6531, 0.7408, 0.8175, 0.8788, 0.9291, 0.9666, 0.995, 1.0148, 1.0272, 1.0344, 1.0374, 1.0374, 1.0353, 1.0319, 1.0277, 1.0234, 1.019, 1.0151, 1.0114, 1.0083, 1.0057, 1.0036, 1.0019, 1.0007, 0.9998, 0.9992, 0.9988, 0.9986, 0.9986, 0.9986, 0.9987, 0.9989, 0.999, 1);
  --t-smooth: 610ms;
  --t-bouncy: 690ms;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;

  /* 文字 */
  --ink: #17231d;
  --ink-2: #5d6a63;
  --ink-3: #8e9993;
  /* 差し色（深い緑1色）と、良い・悪いの色 */
  --accent: #1f6b48;
  --accent-2: #2f8f5b;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 107, 72, 0.08);
  --accent-glow: rgba(31, 107, 72, 0.45);
  --mint: #6fd3a8;
  --good: #2f8f5b;
  --bad: #c2462f;
  --gold: #e5a92c;
  --warm: #e38b1b;
  --warm-soft: #fff4e2;
  --tip-soft: #eef6f1;
  --advice: #6b7fd7;
  --advice-soft: #eef0fb;
  --slate: #3d5566;

  /* 板（カード）と浮いた板 */
  --card-fill: #ffffff;
  --card-line: rgba(23, 35, 29, 0.06);
  --glass-fill: rgba(255, 255, 255, 0.86);
  --glass-fill-2: rgba(255, 255, 255, 0.74);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --glass-rim: rgba(255, 255, 255, 0.9);
  --glass-rim-2: rgba(255, 255, 255, 0);
  --glass-edge: rgba(255, 255, 255, 0);
  --glass-sheen: 0;
  --glass-shadow: 0 1px 2px rgba(20, 40, 30, 0.04), 0 8px 22px -12px rgba(20, 40, 30, 0.18);
  --glass-shadow-lg: 0 2px 4px rgba(20, 40, 30, 0.05), 0 18px 40px -18px rgba(20, 40, 30, 0.3);
  --glass-blur: blur(20px) saturate(160%);
  --hair: rgba(23, 35, 29, 0.07);
  --dock-fill-solid: #ffffff;
  --thumb-fill: rgba(31, 107, 72, 0.08);
  --bar-fill: linear-gradient(90deg, var(--accent), var(--accent-2));
  --seg-bg: #eceee9;
  --seg-on: var(--accent);
  --seg-on-ink: #ffffff;
  --pill-on: #16302a;
  --pill-on-ink: #ffffff;
  --band: linear-gradient(160deg, #1b4234, #2d5849);
  --card-solid: #ffffff;

  /* 地 */
  --mesh-base: #f6f7f4;
  --mesh-1: transparent;
  --mesh-2: transparent;
  --mesh-3: transparent;
  --mesh-4: transparent;
  --grain: 0;

  --dock-h: 66px;
  --dock-gap: 10px;
  --dock-space: calc(var(--dock-h) + var(--dock-gap) * 2 + env(safe-area-inset-bottom, 0px) + 14px);
}

:root[data-theme="dark"] {
  --ink: #eef5f1;
  --ink-2: rgba(238, 245, 241, 0.7);
  --ink-3: rgba(238, 245, 241, 0.45);
  --accent: #6fd3a8;
  --accent-2: #8fe0bf;
  --accent-ink: #0c1f16;
  --accent-soft: rgba(111, 211, 168, 0.12);
  --accent-glow: rgba(111, 211, 168, 0.45);
  --good: #6fd89c;
  --bad: #ff8f7a;
  --gold: #f2c14e;
  --warm: #f2b45b;
  --warm-soft: rgba(242, 180, 91, 0.14);
  --tip-soft: rgba(111, 211, 168, 0.08);
  --advice: #aab8ff;
  --advice-soft: rgba(170, 184, 255, 0.12);
  --slate: #9fb8c8;
  --card-fill: rgba(255, 255, 255, 0.055);
  --card-line: rgba(255, 255, 255, 0.09);
  --glass-fill: rgba(30, 50, 41, 0.62);
  --glass-fill-2: rgba(20, 36, 29, 0.55);
  --glass-strong: rgba(24, 42, 34, 0.9);
  --glass-rim: rgba(255, 255, 255, 0.1);
  --glass-rim-2: rgba(255, 255, 255, 0.02);
  --glass-edge: rgba(255, 255, 255, 0.1);
  --glass-sheen: 0.18;
  --glass-shadow: 0 1px 1px rgba(0, 0, 0, 0.25), 0 14px 30px -18px rgba(0, 0, 0, 0.75);
  --glass-shadow-lg: 0 2px 2px rgba(0, 0, 0, 0.3), 0 22px 46px -20px rgba(0, 0, 0, 0.85);
  --hair: rgba(255, 255, 255, 0.08);
  --dock-fill-solid: #13231c;
  --thumb-fill: rgba(255, 255, 255, 0.07);
  --bar-fill: #ffffff;
  --seg-bg: rgba(255, 255, 255, 0.07);
  --seg-on: var(--accent);
  --seg-on-ink: #0c1f16;
  --pill-on: var(--accent);
  --pill-on-ink: #0c1f16;
  --band: linear-gradient(160deg, #122a21, #1d3d31);
  --card-solid: #16261f;
  --mesh-base: #0e1a15;
  --mesh-1: rgba(47, 110, 78, 0.34);
  --mesh-2: rgba(28, 64, 50, 0.45);
  --mesh-3: rgba(111, 211, 168, 0.06);
  --mesh-4: rgba(22, 48, 38, 0.5);
  --grain: 0.05;
}

/* ---------- 地（ホーム以外のタブの後ろ） ---------- */
.shell::before,
.shell::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.shell::before {
  background:
    radial-gradient(70% 45% at 10% 0%, var(--mesh-1), transparent 62%),
    radial-gradient(60% 40% at 100% 20%, var(--mesh-2), transparent 64%),
    radial-gradient(70% 46% at 80% 100%, var(--mesh-3), transparent 62%),
    radial-gradient(52% 38% at 0% 80%, var(--mesh-4), transparent 62%),
    var(--mesh-base);
}
.shell::after {
  background-image: url("/img/noise.svg");
  background-size: 180px 180px;
  opacity: var(--grain);
  mix-blend-mode: overlay;
}
.shell {
  background: var(--mesh-base);
  font-family: var(--font-ui);
}
.tab-panel {
  bottom: 0;
  z-index: 1;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
}
.tab-panel.page .page-inner,
.home-inner {
  padding-bottom: var(--dock-space);
}

/* ---------- 板 ---------- */
/* .lg＝浮いている板（背景をぼかす）／.lg-card＝一覧のカード（ぼかさない）。ライトは白いカード、ダークは曇りガラス */
.lg,
.lg-card {
  position: relative;
  isolation: isolate;
  border-radius: 22px;
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    0 0 0 1px var(--card-line),
    var(--glass-shadow);
}
.lg {
  background: linear-gradient(165deg, var(--glass-fill), var(--glass-fill-2));
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
.lg-card {
  background: var(--card-fill);
}
/* ダークだけ: 斜めに光が当たった縁と、上の方のわずかな光（A 案の曇りガラス） */
.lg::after,
.lg-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, var(--glass-edge), transparent 34%, transparent 70%, var(--glass-edge));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.lg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(120% 70% at 18% -10%, rgba(255, 255, 255, 0.4), transparent 60%);
  opacity: var(--glass-sheen);
  pointer-events: none;
}

/* 押した瞬間に縮み、離すとばねで戻る */
.press {
  transition: transform var(--t-bouncy) var(--ease-bouncy), box-shadow 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.press:active {
  transform: scale(0.96);
  transition: transform 90ms cubic-bezier(0.2, 0, 0.2, 1);
}

/* 選んでいる所の下をすべる粒（motion.js の slidingThumb） */
.lg-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  z-index: 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(20, 40, 30, 0.08), 0 4px 12px -6px rgba(20, 40, 30, 0.3);
  pointer-events: none;
  will-change: transform, width;
}
:where(:root[data-theme="dark"]) .lg-thumb {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

/* ---------- フッター（タブバー）: B・D は白い板、A は暗い曇りガラス。浮かせて角を丸く ---------- */
.tabbar {
  left: var(--dock-gap);
  right: var(--dock-gap);
  bottom: calc(var(--dock-gap) + env(safe-area-inset-bottom, 0px));
  height: var(--dock-h);
  max-width: 540px;
  margin: 0 auto;
  padding: 5px;
  border: 0;
  border-radius: 26px;
  background: linear-gradient(170deg, var(--glass-fill), var(--glass-fill-2));
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow:
    inset 0 1px 0 var(--glass-rim),
    0 0 0 1px var(--card-line),
    var(--glass-shadow-lg);
}
.tabbar .lg-thumb {
  top: 6px;
  bottom: 6px;
  border-radius: 18px;
  background: var(--thumb-fill);
  box-shadow: none;
}
.tabbar-item {
  position: relative;
  z-index: 1;
  gap: 3px;
  padding: 4px 2px;
  border-radius: 18px;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: color 240ms ease, transform var(--t-bouncy) var(--ease-bouncy);
}
:root[data-theme="dark"] .tabbar-item {
  color: rgba(238, 245, 241, 0.62);
}
.tabbar-item:active {
  transform: scale(0.92);
  transition: transform 90ms ease;
}
.tabbar-item svg {
  width: 23px;
  height: 23px;
  transition: transform var(--t-bouncy) var(--ease-bouncy), fill 240ms ease;
}
.tabbar-item[aria-current="page"] {
  color: var(--accent-2);
}
:root[data-theme="dark"] .tabbar-item[aria-current="page"] {
  color: var(--accent);
}
.tabbar-item[aria-current="page"] svg {
  transform: translateY(-1px) scale(1.06);
}
.tabbar-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* 真ん中の「AIに質問」: ライトは深い緑、ダークはミントの丸 */
.tabbar-ask {
  justify-content: center;
  padding: 0;
}
.tabbar-ask > span:last-child {
  display: none;
}
.tabbar-ask-circle {
  position: relative;
  width: 52px;
  height: 52px;
  margin: 0;
  border: 0;
  background: radial-gradient(120% 120% at 30% 15%, var(--accent-2), var(--accent) 60%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    0 10px 22px -10px var(--accent-glow);
  transition: box-shadow 300ms ease;
}
.tabbar-ask-circle svg {
  width: 25px;
  height: 25px;
  stroke: var(--accent-ink);
}

/* ---------- 共通: 見出し・ブランド ---------- */
.ui-brand {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 7px 14px 7px 11px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.ui-brand-mark {
  width: 19px;
  height: 19px;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-brand.lg {
  border-radius: 999px;
}

/* ---------- A: ホーム ---------- */
.home {
  background: transparent;
}
.home-bg {
  height: 70dvh;
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}
.home-inner {
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}
.home-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.home-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
}
.home-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.theme-ic-sun {
  display: none;
}
:root[data-theme="dark"] .theme-ic-sun {
  display: block;
}
:root[data-theme="dark"] .theme-ic-moon {
  display: none;
}
/* ライト/ダークを切り替える瞬間の溶け込み（home.js の View Transitions） */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
.home-avatar svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-linecap: round;
}
.home-avatar:focus-visible,
.mission-play:focus-visible,
.tile:focus-visible,
.wstats-more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* メニューはアバターから出てくる */
.home-menu {
  top: calc(62px + env(safe-area-inset-top, 0px));
  border: 0;
  border-radius: 22px;
  padding: 6px;
  background: linear-gradient(165deg, var(--glass-strong), var(--glass-fill));
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow-lg);
  transform-origin: calc(100% - 22px) -8px;
}
.home-menu-item {
  border-radius: 14px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 600;
}
.home-menu-item svg {
  stroke: var(--accent);
}
.home-menu-item:hover,
.home-menu-item:focus-visible {
  background: var(--accent-soft);
}
.home-hello {
  padding: 12dvh 4px 0;
}
.home-greeting {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.home-sub {
  margin: 8px 0 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
:root:not([data-theme="dark"]) .home-greeting,
:root:not([data-theme="dark"]) .home-sub {
  text-shadow: 0 1px 18px rgba(255, 255, 255, 0.55);
}
:root[data-theme="dark"] .home-greeting,
:root[data-theme="dark"] .home-sub {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5);
}
#home-mission {
  margin-top: 24px;
}
.mission-a {
  padding: 18px 18px 16px;
  border-radius: 30px;
  color: var(--ink);
}
.mission-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mission-texts {
  flex: 1;
  min-width: 0;
}
.mission-label {
  margin: 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.mission-title {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.mission-detail {
  margin: 5px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.mission-play {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 15%, var(--accent-2), var(--accent) 65%);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.45), 0 12px 24px -12px var(--accent-glow);
  cursor: pointer;
}
.mission-play svg {
  position: relative;
  width: 26px;
  height: 26px;
  margin-left: 3px;
}
.mission-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.mission-bar {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--hair);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.mission-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--ratio, 0) * 100%);
  min-width: 8px;
  border-radius: inherit;
  background: var(--bar-fill);
  transform-origin: left center;
  transition: width var(--t-smooth) var(--ease-smooth);
}
.mission-count {
  flex: none;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.shortcut-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.shortcut-row:empty {
  display: none;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  aspect-ratio: 1 / 1.04;
  padding: 8px 2px;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  font-family: var(--font-ui);
  cursor: pointer;
}
.tile-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.tile-icon svg {
  display: block;
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tile-label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
  white-space: nowrap;
}
#home-progress {
  margin-top: 26px;
}
.wstats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 4px 10px;
}
.wstats-title {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.wstats-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.wstats-more .chevron {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}
.wstats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.wstat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 13px 12px 12px;
  border-radius: 22px;
  color: var(--ink);
}
.wstat-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
}
.wstat-value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1px 6px;
  margin: 2px 0 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.wstat-value small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-2);
}
.wstat-delta {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--bad);
}
.wstat-delta.is-good {
  color: var(--good);
}
.wbars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  margin-top: 4px;
}
.wbar {
  flex: 1;
  height: calc(var(--h, 0.2) * 100%);
  border-radius: 3px;
  background: var(--hair);
  transform-origin: bottom;
}
.wbar.is-on {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
}
.wstats-note {
  margin: 10px 4px 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* ---------- B: 練習 ---------- */
.ui-page {
  color: var(--ink);
}
.ui-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ui-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.ui-seg,
.tn-switch {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--seg-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
.ui-seg::before,
.ui-seg::after,
.tn-switch::before,
.tn-switch::after {
  display: none;
}
.ui-seg .lg-thumb,
.tn-switch .lg-thumb {
  background: var(--seg-on);
  box-shadow: 0 4px 12px -6px var(--accent-glow);
}
.ui-seg-b {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 42px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: color 220ms ease;
}
.ui-seg-b[aria-selected="true"] {
  color: var(--seg-on-ink);
}
.ui-seg-b:focus-visible,
.ui-chip-warm:focus-visible,
.task-check:focus-visible,
.task-text:focus-visible,
.task-go:focus-visible,
.add-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.ui-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ui-date-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}
.ui-date {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}
.ui-chip-warm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: var(--warm-soft);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: pointer;
}
.ui-chip-warm svg {
  color: var(--warm);
}
.ui-chip-warm svg,
.tip-icon svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
}
.ui-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 20px;
  background: var(--tip-soft);
}
.tip-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: transparent;
  color: var(--accent-2);
}
.tip-icon svg {
  width: 24px;
  height: 24px;
}
.tip-main {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.tip-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-2);
}
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 10px 8px 10px 12px;
  border-radius: 24px;
  transition: opacity 300ms ease;
}
.task-check {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background 260ms ease, border-color 260ms ease, transform var(--t-bouncy) var(--ease-bouncy);
}
.task-check:active {
  transform: scale(0.86);
  transition: transform 90ms ease;
}
.task-check svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 360ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}
.task-check[aria-checked="true"] {
  border-color: transparent;
  background: radial-gradient(120% 120% at 30% 15%, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 6px 14px -6px rgba(20, 149, 95, 0.8);
}
.task-check[aria-checked="true"] svg {
  stroke-dashoffset: 0;
}
.task-check:disabled {
  cursor: default;
}
.task-thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 6px 14px -8px rgba(12, 60, 40, 0.5);
}
.task-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.task-thumb.is-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.task-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.task-title {
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.task-sub {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.4;
}
.task.is-done .task-title {
  color: var(--ink-3);
}
.task.is-done .task-thumb {
  filter: saturate(0.4);
  opacity: 0.7;
}
.task-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.task-go svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
span.task-go {
  cursor: inherit;
}
.add-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 24px -14px var(--accent-glow);
  cursor: pointer;
}
.add-button svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.add-form {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
}
.add-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}
:root[data-theme="dark"] .add-input {
  background: rgba(0, 0, 0, 0.25);
}
.add-ok,
.add-cancel {
  flex: none;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.add-ok {
  background: var(--accent);
  color: var(--accent-ink);
}
.add-cancel {
  background: transparent;
  color: var(--ink-2);
}
.ui-page .card,
.ui-data .card {
  border: 0;
  border-radius: 26px;
  background: var(--card-fill);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow);
  color: var(--ink);
}
.ui-page .card-title,
.ui-data .card-title {
  color: var(--ink);
}
.ui-page .card-note,
.ui-page .empty-state,
.ui-data .card-note,
.ui-data .empty-state {
  color: var(--ink-2);
}
.log-list {
  display: flex;
  flex-direction: column;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.log-item {
  padding: 12px 0;
  border-top: 1px solid var(--hair);
}
.log-date {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.log-text {
  margin: 3px 0 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
}

/* ---------- D: 分析「マイデータ」 ---------- */
.ui-data-head {
  padding: calc(22px + env(safe-area-inset-top, 0px)) 16px 0;
  background: var(--band);
  color: #ffffff;
}
.ui-data-title {
  max-width: 560px;
  margin: 0 auto;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.2;
}
.ui-data-tabs {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  max-width: 560px;
  margin: 12px auto 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}
.ui-data-tabs::before,
.ui-data-tabs::after {
  display: none;
}
.ui-data-tabs .lg-thumb {
  top: auto;
  bottom: 0;
  height: 3px;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: none;
}
.ui-data-tab {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: color 220ms ease;
}
.ui-data-tab[aria-selected="true"] {
  color: #ffffff;
}
.ui-data-tab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: -3px;
}
.ui-data #analysis-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ui-data .page-inner {
  padding-top: 14px;
}
.dcard {
  padding: 16px 16px;
  border: 0;
  border-radius: 26px;
  color: var(--ink);
}
.dcard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.dcard-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.dgoal-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dgoal-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--warm-soft);
  color: var(--warm);
}
.dgoal-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}
.dgoal-text {
  flex: 1;
  min-width: 0;
}
.dgoal-k {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.dgoal-t {
  margin: 2px 0 0;
  font-size: 14.5px;
  font-weight: 700;
}
.dgoal-t b {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.dgoal-set,
.dgoal-opt,
.dpill {
  position: relative;
  z-index: 1;
  flex: none;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
  transition: color 200ms ease;
}
.dgoal-set {
  background: var(--accent-soft);
  color: var(--accent);
}
.dgoal-opt {
  min-height: 42px;
  padding: 0 16px;
  font-size: 14px;
  background: var(--hair);
}
.dgoal-opt[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.dpill[aria-pressed="true"] {
  color: var(--pill-on-ink);
}
.dpills .lg-thumb {
  background: var(--pill-on);
  box-shadow: none;
}
.dgoal-set:focus-visible,
.dgoal-opt:focus-visible,
.dpill:focus-visible,
.dadvice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dgoal-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.dgoal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.dgoal-bar {
  position: relative;
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: var(--hair);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}
.dgoal-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--ratio, 0) * 100%);
  min-width: 9px;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left;
}
.dgoal-rest {
  flex: none;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.dgoal-rest b {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dgrid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.dstat-k {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.dstat-v {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 8px 0 0;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.dstat-date {
  width: 100%;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-2);
}
.dcrown {
  align-self: center;
  color: var(--gold);
  filter: drop-shadow(0 2px 4px rgba(214, 162, 28, 0.45));
}
.dcrown svg {
  display: block;
  width: 22px;
  height: 22px;
}
.ddelta {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.ddelta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ddelta.is-good {
  color: var(--good);
}
.ddelta.is-bad {
  color: var(--bad);
}
.dpills {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  gap: 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--hair);
}
.dpills .lg-thumb {
  top: 3px;
  bottom: 3px;
}
.dpill {
  min-height: 30px;
  padding: 0 9px;
  font-size: 11.5px;
}
.dchart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.dchart-grid {
  stroke: var(--hair);
  stroke-width: 1;
}
.dchart-ylab,
.dchart-xlab {
  fill: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
}
.dchart-area {
  fill: url(#dchart-grad);
}
.dchart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 4px 6px rgba(20, 149, 95, 0.35));
}
.dchart-dot {
  fill: var(--accent);
  stroke: var(--card-solid);
  stroke-width: 1.5;
}
.dchart-dot.is-last {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2.5;
}
.dchart-bubble {
  fill: var(--accent);
}
.dchart-bubble-t {
  fill: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
}
.drate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
}
.ddonut {
  flex: none;
  width: 56px;
  height: 56px;
}
.ddonut-bg,
.ddonut-fg {
  fill: none;
  stroke-width: 8;
}
.ddonut-bg {
  stroke: var(--hair);
}
.ddonut-fg {
  stroke: var(--accent-2);
  stroke-linecap: round;
}
.dgrid2 .drate:nth-child(2) .ddonut-fg {
  stroke: var(--slate);
}
.drate-text {
  min-width: 0;
}
.drate-text .dstat-k {
  font-size: 11px;
  line-height: 1.35;
}
.drate-v {
  margin: 3px 0 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.drate-v small {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}
.dadvice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
}
.dadvice-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: var(--advice-soft);
  color: var(--advice);
}
.dadvice-icon svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-linecap: round;
}
.dadvice-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dadvice-k {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
}
.dadvice-v {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}
.dadvice .chevron {
  flex: none;
  width: 18px;
  height: 18px;
  stroke: var(--ink-3);
}
.dlist-ul {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.dlist-li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--hair);
  font-size: 14px;
}
.dlist-date {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.dlist-v {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.dweek {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  height: 100px;
  margin-top: 12px;
}
.dweek-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.dweek-bar {
  width: 100%;
  max-width: 24px;
  height: calc(var(--h, 0.1) * 72px);
  border-radius: 8px 8px 4px 4px;
  background: var(--hair);
  transform-origin: bottom;
}
.dweek-bar.is-on {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}
.dweek-d {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.ui-data .stats .stat {
  background: var(--hair);
  border: 0;
  border-radius: 18px;
}
.ui-data .link-row,
.ui-page .link-row {
  border: 0;
  border-radius: 22px;
  background: var(--card-fill);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow);
  color: var(--ink);
}

/* ---------- 設定に合わせる ---------- */
@media (prefers-reduced-transparency: reduce) {
  .lg,
  .tabbar,
  .home-menu {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background: var(--mesh-base);
  }
}
@media (prefers-contrast: more) {
  .lg,
  .lg-card,
  .tabbar {
    background: var(--mesh-base);
    box-shadow: inset 0 0 0 1.5px var(--ink-3);
  }
}
@media (prefers-reduced-motion: reduce) {
  .press,
  .press:active,
  .tabbar-item,
  .tabbar-item svg,
  .task-check,
  .mission-bar-fill {
    transition: none !important;
  }
  .press:active {
    transform: none;
  }
}

/* ---------- ラウンド: 上の切り替え［スコア｜ターゲットナビ］（2026-09-30） ---------- */
.rnd {
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px var(--dock-space);
  font-family: var(--font-ui);
}
.rnd-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.rnd-h {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}
.rnd-pane[hidden] {
  display: none;
}
.tn-rec {
  margin-top: 16px;
}

/* ---------- ラウンド（ターゲットナビ）: リキッドガラス版 ---------- */
.tn {
  background: transparent;
  padding: 0;
  font-family: var(--font-ui);
}
.tn-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
}
.tn .tn-h {
  font-family: var(--font-ui);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}
.tn-switch {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: 999px;
}
.tn-switch-b {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-width: 0;
  min-height: 46px;
  padding: 2px 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color 220ms ease;
}
.tn-switch-b[aria-checked="true"] {
  background: transparent;
  color: var(--seg-on-ink);
  box-shadow: none;
}
.tn-switch-no {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.25;
}
.tn-switch-name {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  opacity: 0.8;
  white-space: nowrap;
}
.tn-switch-b:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.tn-switch-note {
  margin: 0 4px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
}
.tn-host {
  margin-top: 10px;
}
.tnx {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 答えの帯 */
.tnx-say {
  padding: 12px 16px 12px;
  border-radius: 28px;
}
.tnx-say-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tnx-say-k {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.tnx-say-k::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
}
.tnx-more {
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.tnx-say-live {
  position: relative;
  margin-top: 4px;
  overflow: hidden;
}
.tnx-say-v {
  display: grid;
  min-height: 2.5em;
  align-items: center;
  font-size: 23px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.tnx-say-v > * {
  grid-area: 1 / 1;
}
.tnx-say-line {
  display: block;
  text-wrap: balance;
}
.tnx-say-sub {
  margin: 4px 0 0;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tnx-warn {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--bad);
}

/* 図の舞台 */
.tnx-stage {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  padding: 6px;
}
.tnx-map {
  position: relative;
  display: flex;
  justify-content: center;
  border-radius: 24px;
  overflow: hidden;
}
.tnx-map .tn-svg {
  max-width: 300px;
}
.tnx-map.is-mini .tn-svg {
  max-width: 240px;
}
.tnx-stage.is-mini {
  padding: 4px;
}
.tnx-green-hit {
  position: absolute;
  border-radius: 50%;
  touch-action: none;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
}
.tnx-green-hit.is-dragging {
  cursor: grabbing;
}
.tnx-reset {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tnx-reset.is-inline {
  position: static;
  flex: none;
}
.tnx-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 6px;
  margin: -4px 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.tnx-hint-i {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.tnx-hint > span:nth-child(2) {
  margin-right: 10px;
}

/* 状況を選ぶ小窓 */
.tnx-pop {
  position: absolute;
  z-index: 5;
  width: min(280px, calc(100% - 16px));
  padding: 12px;
  border-radius: 24px;
  background: linear-gradient(165deg, var(--glass-strong), var(--glass-fill));
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: inset 0 1px 0 var(--glass-rim), var(--glass-shadow-lg);
}
.tnx-pop-t {
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}
.tnx-pop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.tnx-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 60px;
  padding: 6px 2px;
  border: 0;
  border-radius: 16px;
  background: var(--hair);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
}
.tnx-chip .tn-bdg {
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  font-size: 12px;
}
.tnx-chip[aria-pressed="true"] {
  background: var(--tn-k-badge);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 16px -8px var(--tn-k-badge);
}
.tnx-chip[aria-pressed="true"] .tn-bdg {
  background: rgba(255, 255, 255, 0.28);
}
.tnx-chip-name {
  white-space: nowrap;
}
.tnx-chip:focus-visible,
.tnx-dial-b:focus-visible,
.tnx-more:focus-visible,
.tnx-reset:focus-visible,
.tnx-sheet-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 距離の環 */
.tnx-dial {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 28px;
}
.tnx-dial-b {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--hair);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 var(--glass-rim);
}
.tnx-dial-b:disabled {
  opacity: 0.35;
  cursor: default;
}
.tnx-dial-mid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.tnx-dial-v {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}
.tnx-dial-n {
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.tnx-dial-l,
.tnx-dial-u {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.tnx-ruler-box {
  position: relative;
}
.tnx-ruler {
  display: flex;
  align-items: flex-start;
  height: 42px;
  padding: 0 calc(50% - 6px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  cursor: ew-resize;
}
.tnx-ruler::-webkit-scrollbar {
  display: none;
}
.tnx-ruler:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}
.tnx-tick {
  position: relative;
  flex: none;
  width: 12px;
  height: 100%;
  scroll-snap-align: center;
}
.tnx-tick::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  width: 1.5px;
  height: 10px;
  border-radius: 1px;
  background: var(--ink-3);
  transform: translateX(-50%);
}
.tnx-tick.is-mid::before {
  height: 15px;
  background: var(--ink-2);
}
.tnx-tick.is-major::before {
  height: 20px;
  width: 2px;
  background: var(--ink);
}
.tnx-tick-n {
  position: absolute;
  left: 50%;
  top: 25px;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tnx-ruler-mark {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 4px;
  height: 26px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  pointer-events: none;
}

/* 内訳のシート */
.tnx-scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(4, 16, 10, 0.32);
}
.tnx-sheet {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  z-index: 41;
  max-width: 560px;
  max-height: 80dvh;
  margin: 0 auto;
  padding: 10px 16px 18px;
  overflow-y: auto;
  border-radius: 34px;
  background: linear-gradient(165deg, var(--glass-strong), var(--glass-fill));
  -webkit-backdrop-filter: blur(34px) saturate(190%);
  backdrop-filter: blur(34px) saturate(190%);
  color: var(--ink);
  font-family: var(--font-ui);
  touch-action: pan-y;
}
.tnx-grabber {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 8px;
  border-radius: 3px;
  background: var(--ink-3);
}
.tnx-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tnx-sheet-t {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.tnx-sheet-x {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink-2);
  cursor: pointer;
}
.tnx-sheet-x svg {
  width: 16px;
  height: 16px;
}
.tnx-ic-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.tnx-sheet .tn-out {
  margin: 0 0 12px;
  background: var(--hair);
  border: 0;
  border-radius: 22px;
}
.tnx-sheet-note {
  margin-top: 4px;
}

/* ---------- AIに質問（チャット）: 見た目は今のまま。リッチメニューを廃止し、下にフッターを常に出す（2026-09-29 案A） ---------- */
/* 普段: 入力欄のすぐ下にフッター。文字を打つ間（入力欄にフォーカス）はフッターを隠し、キーボードの上に入力欄だけ */
.tab-panel-chat {
  position: relative;
  z-index: 1;
  background: var(--bg);
  padding-bottom: calc(var(--dock-h) + var(--dock-gap) * 2 + env(safe-area-inset-bottom, 0px));
  transition: padding-bottom var(--t-smooth) var(--ease-smooth);
}
.is-typing .tab-panel-chat {
  padding-bottom: 0;
}
.is-typing .tab-panel-chat .composer {
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.tabbar {
  transition: transform var(--t-smooth) var(--ease-smooth), opacity 200ms ease;
}
.is-typing .tabbar {
  transform: translateY(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}
/* チャットを開いている間は、真ん中の「AIに質問」を選択中に見せる */
.tabbar-ask[aria-current="page"] .tabbar-ask-circle {
  box-shadow:
    0 0 0 3px var(--dock-fill-solid),
    0 0 0 5px var(--accent),
    0 10px 22px -8px var(--accent-glow);
}
.chat-history {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chat-history svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
}
.chat-history:active {
  background: rgba(250, 245, 236, 0.1);
}
.chat-history:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.tab-panel-chat .header {
  padding-right: 56px;
}
.tab-panel-chat .header-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: reduce) {
  .tab-panel-chat,
  .tabbar {
    transition: none;
  }
}

/* 分析: 保存できなかった時の案内・上限まで読んだ時の断り書き */
.ui-data .card-note.is-error {
  color: var(--danger);
}
.ui-data .dnote {
  margin: 0 4px;
}

/* 練習: 保存の案内（一時保存した・保存できなかった） */
.practice-live:empty {
  display: none;
}
.practice-live.is-warn {
  color: var(--ink);
  font-weight: 600;
}

/* 分析 > スコア: ラウンドの判定（一覧の行を押すとそのラウンドに切り替わる） */
.djudge-head {
  margin: 10px 0 4px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
}
.djudge-h {
  margin: 16px 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}
.dlist-btn {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dlist-li:has(.dlist-btn) {
  padding: 0;
}
.dlist-btn {
  padding: 11px 8px;
  border-radius: 12px;
}
.dlist-btn[aria-pressed="true"] {
  background: var(--accent-soft);
}
.dlist-btn[aria-pressed="true"] .dlist-v {
  color: var(--accent);
}
.djudge-more {
  margin-top: 14px;
  border-top: 1px solid var(--hair);
}
.djudge-sum {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.djudge-sum::-webkit-details-marker {
  display: none;
}
.djudge-sum::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s var(--ease-smooth, ease);
}
.djudge-more[open] .djudge-sum::after {
  transform: rotate(225deg);
}

/* ---------- 段2の部品（records.css）を新テイストに ----------
   records.css は styles.css の役割変数（紺と金の配色）で塗っている。新 UI の中ではその変数を
   このファイルのトークンへ読み替える（ライト/ダークはトークン側で切り替わる）。金（--gold）は狙った所などの差し色としてそのまま */
.rnd,
.ui-page,
.ui-data,
.settings-page {
  --heading: var(--ink);
  --text: var(--ink);
  --text-muted: var(--ink-2);
  --green: var(--accent);
  --on-green: var(--accent-ink);
  --accent-text: var(--accent);
  --line: var(--hair);
  --surface: var(--card-fill);
  --surface-2: var(--seg-bg);
  --font-mincho: var(--font-ui);
}

/* ラウンド > ナビの中の切り替え（ベータ版｜完全版）は、上の［スコア｜ナビ］より一段小さく */
.rnd .tn-switch {
  padding: 2px;
}
.rnd .tn-switch-b {
  flex-direction: row;
  gap: 6px;
  min-height: 36px;
}
.rnd .tn-switch-no {
  font-size: 13px;
}
.rnd .tn-switch-name {
  font-size: 11px;
}

/* ラウンド > スコア: 外側の「スコア入力」の枠は外し（上の見出しと切り替えが同じ役）、ホールの箱をカードにする。
   入れ子が浅くなる分、390px 幅でも −／＋ がはみ出さない */
.rnd .card.rs {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.rnd .card.rs > .card-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.rnd .rs-hole {
  padding: 16px 14px;
  border: 1px solid var(--card-line);
  border-radius: 22px;
  background: var(--card-fill);
  box-shadow: var(--glass-shadow);
}
.rnd .rs-step {
  background: var(--seg-bg);
}
.rnd .rs-step-b {
  background: var(--card-fill);
}
.rnd .rs-dirs .rs-opt,
.rnd .rs-nav .rs-btn {
  white-space: nowrap;
}
.rnd .rs-dirs .rs-opt {
  font-size: 13px;
}
.rnd .rs-step {
  padding: 8px 8px 10px;
}
.rnd .rs-step-row {
  justify-content: space-between;
  gap: 2px;
  width: 100%;
}
.rnd .rs-step-v {
  font-size: 30px;
}

/* ---------- 設定ページ（settings.html）: 新テイスト（色の読み替えは上の段2の部品と同じ） ---------- */
body:has(> .settings-page) {
  background: var(--mesh-base);
}
.settings-page {
  font-family: var(--font-ui);
  color: var(--ink);
}
.settings-back {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.settings-page-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.settings-section-title {
  font-weight: 800;
}
.settings-row {
  border-color: var(--card-line);
  border-radius: 16px;
  background: var(--card-fill);
}
.settings-primary,
.settings-secondary {
  border-radius: 999px;
  font-weight: 700;
}
.settings-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.settings-primary:active {
  background: var(--accent-2);
}
.settings-secondary {
  border-color: var(--card-line);
  background: var(--card-fill);
  color: var(--ink);
}
.settings-page .theme-option span {
  border-radius: 999px;
}

/* ラウンド > スコア: 保存・確定の間（入力を止めている間）は薄く見せる */
.rs-body[inert] {
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

/* ラウンド > スコア: 「OB・池」は4文字なので少し広く・折り返さない */
.rnd .rs-ob {
  flex: 0 0 76px;
  white-space: nowrap;
  font-size: 14px;
}
