@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-0.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+932C;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-1.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+935B;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-2.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+523B;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-3.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+6628;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-4.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3080;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-5.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+4ECA, U+9332;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-6.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+76EE, U+898B;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-7.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+65E5;
}

@font-face {
  font-family: "Yuji Syuku Local";
  src: url("assets/YujiSyuku-fixed-8.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+3002, U+3066, U+3092;
}

:root {
  --aizome: #14233b;
  --aizome-2: #1e3650;
  --gofun: #f4f0e6;
  --washi: #e7dfd0;
  --bengara: #963f30;
  --matsuba: #50604a;
  --kincha: #c1a468;
  --sumi: #202927;
  --muted: #66706b;
  --line: rgba(77, 67, 52, .18);
  --panel: #f8f4eb;
  --shadow: rgba(10, 27, 41, .22);
  --header-art: url("assets/japanese-paisley-color.webp");
  --action-art: url("assets/japanese-paisley-color.webp");
  --monogram-art: url("assets/tanren-monogram-washi-v3.webp");
  --monogram-opacity: .28;
  --art-rail-width: clamp(24rem, 42vw, 40rem);
  --brush-font: "Yuji Syuku Local", "YuKyokasho", "Yu Kyokasho", "HGP教科書体", "UD デジタル 教科書体 N-R", "Yu Mincho", serif;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  background: var(--aizome);
  scroll-behavior: smooth;
}

html[data-theme="dark"] {
  color-scheme: dark;
  background: #08121c;
}

html[data-theme="light"] {
  color-scheme: light;
  background: #eee7da;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--sumi);
  background: var(--aizome);
  font-family: "Yu Gothic", "Yu Gothic UI", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-feature-settings: "palt" 1;
  line-height: 1.65;
}

body,
.app-panel,
.topbar,
.bottom-nav,
.exercise-card {
  transition: color .24s ease, background-color .24s ease, border-color .24s ease, box-shadow .24s ease;
}

button,
input,
select,
textarea { font: inherit; }

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(193, 164, 104, .62);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: .75rem;
  left: .75rem;
  z-index: 100;
  padding: .65rem 1rem;
  color: white;
  background: var(--aizome);
  border: 1px solid var(--kincha);
  transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.is-hidden { display: none !important; }

.app-frame {
  display: block;
  min-height: 100dvh;
}

.art-rail {
  position: relative;
  height: clamp(22rem, 43vw, 36rem);
  overflow: hidden;
  color: var(--gofun);
  background: var(--header-art) center / cover no-repeat var(--aizome);
}

.art-rail__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 24, 43, .84), rgba(10, 24, 43, .38) 42%, transparent 72%),
    linear-gradient(180deg, rgba(15, 29, 49, .04), rgba(15, 29, 49, .16) 48%, rgba(12, 24, 43, .92));
}

.art-rail__copy {
  position: absolute;
  inset: auto clamp(2rem, 5vw, 5rem) clamp(3rem, 8vh, 6rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  align-items: flex-start;
}

.art-title {
  margin: 0;
  font-family: var(--brush-font);
  font-size: clamp(2.8rem, 4.6vw, 4.8rem);
  font-weight: 400;
  letter-spacing: .06em;
  line-height: 1;
  direction: ltr;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-shadow: 0 .2rem .7rem rgba(8, 22, 38, .45);
}

.art-caption {
  max-width: none;
  margin: 0;
  padding-left: .85rem;
  color: rgba(255, 241, 213, .86);
  font-family: var(--brush-font);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 400;
  letter-spacing: .14em;
  line-height: 1.45;
  border-left: 2px solid rgba(210, 173, 98, .72);
  text-shadow: 0 .15rem .6rem rgba(8, 22, 38, .62);
}

.app-panel {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100dvh;
  padding-bottom: 5.8rem;
  background:
    radial-gradient(circle at 92% 8%, rgba(150, 63, 48, .08), transparent 23rem),
    linear-gradient(120deg, rgba(255, 255, 255, .3), transparent 32rem),
    var(--gofun);
}

.app-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: var(--monogram-art) center top / 48rem auto repeat;
  filter: saturate(.78) contrast(.98);
  opacity: var(--monogram-opacity);
  pointer-events: none;
}

.app-panel > * {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.4rem;
  padding: .7rem clamp(1rem, 4vw, 2.7rem);
  background: rgba(244, 240, 230, .91);
  border-bottom: 1px solid rgba(65, 58, 47, .1);
  backdrop-filter: blur(15px);
}

.topbar__tools {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.theme-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  padding: 2px;
  background:
    linear-gradient(135deg, rgba(193, 164, 104, .13), transparent 62%),
    rgba(231, 223, 208, .72);
  border: 1px solid rgba(77, 67, 52, .18);
  border-radius: 2px 2px .75rem 2px;
}

.theme-switch button {
  min-width: 3.25rem;
  min-height: 2rem;
  padding: .25rem .55rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 1px 1px .55rem 1px;
  font-family: inherit;
  font-size: .72rem;
  letter-spacing: .02em;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.theme-switch button:active { transform: translateY(1px) scale(.98); }
.theme-switch button[aria-pressed="true"] {
  color: #fff8ed;
  background: var(--matsuba);
  box-shadow: 0 .25rem .7rem rgba(20, 35, 59, .15);
}

.brand {
  display: flex;
  gap: .65rem;
  align-items: center;
  padding: 0;
  color: var(--sumi);
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.brand__seal {
  display: grid;
  width: 2.15rem;
  aspect-ratio: 1;
  place-items: center;
  color: #fff7e8;
  background: var(--bengara);
  font-family: "Yu Mincho", serif;
  border-radius: 2px;
}

.brand b,
.brand small { display: block; }
.brand b { font-family: "Yu Mincho", serif; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: .66rem; letter-spacing: .06em; }

.storage-state {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  color: var(--muted);
  font-size: .72rem;
}

.storage-state i {
  width: .42rem;
  aspect-ratio: 1;
  background: var(--matsuba);
  border-radius: 50%;
  box-shadow: 0 0 0 .2rem rgba(80, 96, 74, .12);
}

.view { display: none; }
.view.is-active { display: block; }

.mobile-hero { display: none; }

.home-intro,
.trial-notice,
.primary-actions,
.resume-card,
.previous-block,
.principle-strip,
.session-controls,
.preparation-card,
.exercise-jump,
.exercise-list,
.session-actions,
.summary-content,
.history-head,
.history-list,
.info-head,
.info-content {
  width: min(46rem, calc(100% - clamp(2rem, 8vw, 6rem)));
  margin-inline: auto;
}

.home-intro { padding: clamp(4rem, 8vw, 7rem) 0 1.8rem; }

.trial-notice {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-bottom: 1.2rem;
  padding: 1rem 1.1rem;
  background:
    linear-gradient(120deg, rgba(193, 164, 104, .13), transparent 60%),
    rgba(255, 252, 244, .78);
  border: 1px solid rgba(193, 164, 104, .4);
  border-left: .3rem solid var(--kincha);
  backdrop-filter: blur(12px);
}

.trial-notice .section-label { margin-bottom: .2rem; }
.trial-notice h2 { margin: 0; font-size: 1rem; }
.trial-notice p:last-child { margin: .3rem 0 0; color: var(--muted); font-size: .74rem; }
.trial-notice__actions { display: flex; gap: .4rem; }
.trial-notice__actions button {
  min-height: 2.65rem;
  padding: .4rem .7rem;
  color: var(--aizome);
  background: transparent;
  border: 1px solid rgba(20, 35, 59, .2);
  cursor: pointer;
}
.trial-notice__actions button:first-child { color: #fff8ed; background: var(--matsuba); }

.section-label {
  margin: 0 0 .65rem;
  color: #82622e;
  font-family: Georgia, "Yu Mincho", serif;
  font-size: .68rem;
  letter-spacing: .2em;
}

.section-label--light { color: #e6ca95; }

h1,
h2,
h3 {
  margin-top: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 600;
  text-wrap: balance;
}

.home-intro h1,
.history-head h1 {
  max-width: 10em;
  margin-bottom: 1.2rem;
  font-size: clamp(2.45rem, 6vw, 4.8rem);
  letter-spacing: -.06em;
  line-height: 1.17;
}

.home-intro > p:last-child,
.history-head > p:last-child {
  max-width: 35rem;
  color: var(--muted);
}

.primary-actions {
  display: grid;
  grid-template-columns: 1.45fr 1fr .65fr;
  gap: .8rem;
}

.button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 3.7rem;
  padding: .9rem 1.2rem;
  border: 0;
  border-radius: 2px 2px 1rem 2px;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.button:active { transform: translateY(1px) scale(.99); }
.button span,
.button small { display: block; }
.button small { margin-top: .18rem; opacity: .7; font-size: .72rem; }

.button--primary {
  color: #fff8ed;
  background:
    linear-gradient(100deg, rgba(16, 31, 51, .95), rgba(16, 31, 51, .62)),
    var(--action-art) left center / 240% auto no-repeat,
    var(--aizome);
  box-shadow: 0 .9rem 2rem rgba(20, 35, 59, .18);
  text-align: left;
}

.button--primary:hover { filter: brightness(1.08) saturate(1.04); }

.button--body-plan {
  color: #fff8ed;
  background:
    linear-gradient(100deg, rgba(28, 43, 57, .91), rgba(28, 43, 57, .64)),
    var(--action-art) center / 240% auto no-repeat,
    var(--aizome-2);
  border: 1px solid rgba(193, 164, 104, .34);
  box-shadow: 0 .8rem 1.8rem rgba(20, 35, 59, .14);
  text-align: left;
}

.button--body-plan:hover { filter: brightness(1.08) saturate(1.04); }

.button--quiet {
  color: var(--aizome);
  background: rgba(228, 221, 207, .72);
  border: 1px solid rgba(68, 60, 48, .12);
}

.button--outline {
  color: var(--aizome);
  background: transparent;
  border: 1px solid rgba(20, 35, 59, .3);
}

.button--finish {
  color: #fff8ed;
  background: var(--bengara);
  box-shadow: 0 .8rem 1.8rem rgba(150, 63, 48, .18);
}

.resume-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.2rem;
  padding: 1.1rem 1.25rem;
  color: #fff6e8;
  background:
    linear-gradient(90deg, rgba(17, 31, 48, .97), rgba(17, 31, 48, .58)),
    var(--action-art) right center / 240% auto no-repeat,
    var(--aizome);
  border: 1px solid rgba(193, 164, 104, .45);
  border-radius: 2px 2px 1rem 2px;
  cursor: pointer;
  box-shadow: 0 .85rem 2rem rgba(20, 35, 59, .16);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.resume-card:hover { filter: brightness(1.08) saturate(1.03); }
.resume-card:active { transform: translateY(1px) scale(.995); }
.resume-card small,
.resume-card b { display: block; }
.resume-card small { color: #dfc389; }

.previous-block { padding-top: clamp(4rem, 7vw, 6rem); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 { margin-bottom: 0; font-size: clamp(1.5rem, 3vw, 2rem); }
.section-heading time { color: var(--muted); font-variant-numeric: tabular-nums; }

.previous-list { display: grid; }

.previous-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) 1.3fr;
  gap: 1rem;
  padding: 1rem .2rem;
  border-bottom: 1px solid var(--line);
}

.previous-row b { font-family: "Yu Mincho", serif; font-weight: 600; }
.previous-row span { color: var(--muted); font-variant-numeric: tabular-nums; }

.principle-strip {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-top: 2.8rem;
  padding: 1.2rem 1.4rem;
  color: #f4ead8;
  background: var(--matsuba);
  border-left: .3rem solid var(--kincha);
}

.principle-strip p,
.principle-strip strong,
.principle-strip span { margin: 0; }
.principle-strip p { font-size: .72rem; letter-spacing: .1em; }
.principle-strip strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.principle-strip span { opacity: .8; font-size: .82rem; }

.session-art,
.summary-art {
  position: relative;
  display: flex;
  min-height: 15rem;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  overflow: hidden;
  padding: clamp(2rem, 6vw, 4rem);
  color: #fff5e5;
  background:
    linear-gradient(90deg, rgba(8, 16, 24, .95), rgba(8, 16, 24, .28)),
    url("assets/japanese-paisley-black-gold.webp") 57% center / cover;
}

.session-art::after,
.summary-art::after {
  content: "";
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(231, 205, 153, .36);
  pointer-events: none;
}

.session-art > *,
.summary-art > * { position: relative; z-index: 1; }
.session-art h1,
.summary-art h1 { margin-bottom: 0; color: #fff7e8; font-size: clamp(2.3rem, 5vw, 4rem); }
.session-clock { text-align: right; font-variant-numeric: tabular-nums; }
.session-clock time,
.session-clock b { display: block; }
.session-clock time { color: #dfc996; font-size: .8rem; }
.session-clock b { font-family: Consolas, monospace; font-size: 1.5rem; }
.session-clock__row { display: flex; gap: .8rem; align-items: center; justify-content: flex-end; margin-top: .2rem; }
.timer-reset {
  min-height: 2.25rem;
  padding: .3rem .65rem;
  color: #f6e8cc;
  background: rgba(11, 25, 39, .58);
  border: 1px solid rgba(230, 202, 149, .56);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.timer-reset:active { transform: translateY(1px); }
.timer-reset.is-armed { color: #fff8ea; background: var(--bengara); border-color: #e3b9a9; }

.session-controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem 1.5rem;
  align-items: center;
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
  background: rgba(255, 252, 244, .78);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.session-controls p { margin: 0; color: var(--muted); font-size: .78rem; }
.rir-control { display: flex; gap: 1rem; align-items: center; font-weight: 600; }
.rir-control > span:first-child { white-space: nowrap; }
.rir-inputs { display: inline-flex; gap: .35rem; align-items: center; }
.rir-inputs select {
  width: 3.2rem;
  padding: .35rem;
  color: var(--aizome);
  background: var(--gofun);
  border: 1px solid rgba(20, 35, 59, .25);
}

.preparation-card {
  margin-top: .8rem;
  padding: 1rem 1.1rem 1.1rem;
  background: rgba(255, 252, 244, .78);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.preparation-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.preparation-head .section-label { margin-bottom: .2rem; }
.preparation-head h2 { margin: 0; font-size: 1.2rem; }
.preparation-head > small { max-width: 20rem; color: var(--muted); font-size: .68rem; text-align: right; }
.preparation-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: .75rem; }
.preparation-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.preparation-group legend { margin-bottom: .35rem; color: var(--muted); font-size: .68rem; }
.preparation-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
.preparation-options--stretch { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.preparation-options button {
  min-height: 2.75rem;
  padding: .35rem .45rem;
  color: var(--sumi);
  background: rgba(228, 221, 207, .52);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.preparation-options button:active { transform: translateY(1px); }
.preparation-options button[aria-pressed="true"] { color: #fff8ed; background: var(--matsuba); border-color: var(--matsuba); }
.preparation-note { display: grid; gap: .3rem; margin-top: .75rem; color: var(--muted); font-size: .68rem; }
.preparation-note input { width: 100%; padding: .72rem .8rem; color: var(--sumi); background: var(--gofun); border: 1px solid var(--line); }

.exercise-jump {
  position: sticky;
  top: 4.4rem;
  z-index: 15;
  margin-top: .8rem;
  padding: .65rem .75rem .75rem;
  background: rgba(244, 240, 230, .94);
  border: 1px solid var(--line);
  box-shadow: 0 .55rem 1.4rem rgba(10, 27, 41, .09);
  backdrop-filter: blur(14px);
}
.exercise-jump__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; }
.exercise-jump__head b { font-family: "Yu Mincho", serif; font-size: .88rem; }
.exercise-jump__head small { color: var(--muted); font-size: .65rem; }
.exercise-jump__list {
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding-bottom: .12rem;
  scrollbar-color: rgba(193, 164, 104, .48) transparent;
  scrollbar-width: thin;
}
.jump-chip {
  flex: 0 0 auto;
  min-height: 2.85rem;
  padding: .42rem .72rem;
  color: var(--sumi);
  background: rgba(255, 252, 245, .74);
  border: 1px solid var(--line);
  border-radius: 2px 2px .65rem 2px;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.jump-chip:active { transform: translateY(1px); }
.jump-chip span,
.jump-chip small { display: block; }
.jump-chip span { font-size: .76rem; font-weight: 600; }
.jump-chip small { margin-top: .08rem; color: var(--muted); font-size: .61rem; }
.jump-chip.is-focus { border-color: rgba(150, 63, 48, .58); box-shadow: inset .18rem 0 var(--bengara); }
.jump-chip.is-complete { color: #27332b; background: rgba(127, 151, 118, .19); border-color: rgba(80, 96, 74, .3); }
.jump-chip--add { color: #6f5528; background: transparent; border-style: dashed; }

.exercise-list { padding-top: 1.4rem; }

.exercise-card {
  scroll-margin-top: 10rem;
  margin-bottom: 1rem;
  overflow: hidden;
  background: rgba(255, 252, 245, .91);
  border: 1px solid var(--line);
  border-radius: 2px 2px 1.25rem 2px;
  box-shadow: 0 .8rem 2rem rgba(30, 37, 35, .055);
  backdrop-filter: blur(12px);
}

.exercise-card.is-focus { border-left: .35rem solid var(--bengara); }
.exercise-card.is-done { box-shadow: inset 0 0 0 1px rgba(80, 96, 74, .28), 0 .8rem 2.2rem rgba(31, 42, 47, .08); }
.exercise-card.is-targeted { animation: target-card 1.45s ease; }

@keyframes target-card {
  0%, 100% { box-shadow: 0 .8rem 2rem rgba(30, 37, 35, .055); }
  28% { box-shadow: 0 0 0 .28rem rgba(193, 164, 104, .38), 0 1rem 2.5rem rgba(30, 37, 35, .12); }
}

.exercise-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.15rem .8rem;
}

.exercise-head h2 { margin-bottom: .2rem; font-size: 1.25rem; }
.exercise-head p { margin: 0; color: var(--muted); font-size: .75rem; }

.exercise-tools { display: flex; gap: .25rem; }
.icon-button {
  display: grid;
  min-width: 2.75rem;
  min-height: 2.75rem;
  place-items: center;
  color: var(--aizome);
  background: rgba(228, 221, 207, .6);
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.focus-button {
  grid-template-columns: 1.35rem auto;
  gap: .32rem;
  min-width: 4.9rem;
  padding-inline: .5rem;
  font-size: .72rem;
  font-weight: 600;
}
.focus-button svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.25; }
.focus-button[aria-pressed="true"] { color: #fff8e8; background: var(--bengara); }
.focus-button[aria-pressed="true"] svg { stroke-width: 1.6; }

.exercise-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .7rem;
  align-items: end;
  padding: 0 1.15rem .9rem;
}

.exercise-meta label { color: var(--muted); font-size: .72rem; }
.exercise-meta input {
  width: 5.7rem;
  margin-left: .35rem;
  padding: .3rem .45rem;
  background: var(--gofun);
  border: 1px solid var(--line);
}

.assist-toggle {
  min-height: 2.35rem;
  padding: .42rem .72rem;
  color: var(--muted);
  background: rgba(228, 221, 207, .45);
  border: 1px solid var(--line);
  cursor: pointer;
}

.assist-toggle::before {
  content: "";
  display: inline-block;
  width: .55rem;
  height: .55rem;
  margin-right: .42rem;
  background: currentColor;
  border-radius: 50%;
  opacity: .45;
}

.assist-toggle[aria-pressed="true"] { color: #fff8e8; background: var(--bengara); border-color: var(--bengara); }
.assist-toggle[aria-pressed="true"]::before { opacity: 1; }

.assist-note {
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .02em;
}

.sets { border-top: 1px solid var(--line); }

.set-row {
  display: grid;
  grid-template-columns: 2.15rem minmax(6rem, 1fr) minmax(5.4rem, .85fr) 4.4rem 3.1rem;
  gap: .55rem;
  align-items: center;
  min-height: 4.6rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
}

.set-row.is-complete { background: rgba(80, 96, 74, .08); }
.set-index { color: var(--muted); font-family: Consolas, monospace; font-size: .75rem; }
.number-field > small,
.load-heading > small {
  display: block;
  margin-bottom: .2rem;
  color: var(--muted);
  font-size: .62rem;
  letter-spacing: .03em;
}

.load-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 1.45rem;
  margin-bottom: .2rem;
}

.load-heading > small { margin-bottom: 0; }

.set-assist-toggle {
  min-width: 3.35rem;
  min-height: 1.65rem;
  padding: .15rem .45rem;
  color: var(--muted);
  background: rgba(228, 221, 207, .55);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
  cursor: pointer;
}

.set-assist-toggle[aria-pressed="true"] {
  color: #fff8e8;
  background: var(--bengara);
  border-color: var(--bengara);
}

.number-control {
  display: grid;
  grid-template-columns: 1.8rem minmax(2.5rem, 1fr) 1.8rem;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--gofun);
}

.bodyweight-control {
  display: grid;
  place-items: center;
  min-height: 2.7rem;
  color: var(--aizome);
  background: rgba(80, 96, 74, .08);
  border: 1px solid var(--line);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.number-control button {
  min-height: 2.5rem;
  padding: 0;
  color: var(--aizome);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.number-control input {
  width: 100%;
  min-width: 0;
  padding: .45rem .15rem;
  background: transparent;
  border: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.set-type {
  min-height: 2.55rem;
  padding: .3rem;
  color: var(--aizome);
  background: var(--gofun);
  border: 1px solid var(--line);
}

.complete-button {
  min-height: 2.7rem;
  color: var(--aizome);
  background: transparent;
  border: 1px solid rgba(20, 35, 59, .32);
  border-radius: 50%;
  cursor: pointer;
}

.set-row.is-complete .complete-button { color: white; background: var(--matsuba); border-color: var(--matsuba); }

.exercise-note {
  display: grid;
  gap: .35rem;
  padding: .9rem 1rem 0;
  color: var(--muted);
  font-size: .72rem;
}

.exercise-note textarea {
  width: 100%;
  min-height: 4.2rem;
  padding: .65rem .75rem;
  color: var(--aizome);
  background: var(--gofun);
  border: 1px solid var(--line);
  resize: vertical;
}

.exercise-foot {
  display: grid;
  gap: .7rem;
  padding: .8rem 1rem 1rem;
}

.exercise-foot__secondary {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  flex-wrap: wrap;
}

.text-button {
  padding: .35rem 0;
  color: #6f5528;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.exercise-done-button {
  min-height: 3rem;
  width: 100%;
  padding: .65rem 1rem;
  color: var(--matsuba);
  background: rgba(80, 96, 74, .07);
  border: 1px solid rgba(80, 96, 74, .42);
  font-weight: 700;
  cursor: pointer;
}

.exercise-done-button[aria-pressed="true"] { color: white; background: var(--matsuba); border-color: var(--matsuba); }

.session-actions {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: .8rem;
  padding: 1.5rem 0 2rem;
}

.summary-art {
  display: block;
  min-height: 20rem;
  background:
    linear-gradient(90deg, rgba(8, 16, 24, .9), rgba(8, 16, 24, .18)),
    url("assets/japanese-paisley-color.webp") 54% center / cover;
}

.summary-art p:last-child { color: rgba(255, 247, 231, .76); }
.summary-content { padding-top: 2rem; }
.summary-preparation { margin-bottom: 1.2rem; padding: 1rem 1.1rem; background: rgba(80, 96, 74, .09); border-left: .25rem solid var(--matsuba); }
.summary-preparation__head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: .65rem; }
.summary-preparation__head .section-label { margin: 0; }
.summary-preparation__head h2 { margin: 0; font-size: 1.15rem; }
.summary-preparation dl { display: grid; gap: .35rem; margin: 0; }
.summary-preparation dl div { display: grid; grid-template-columns: 7rem 1fr; gap: .7rem; }
.summary-preparation dt { color: var(--muted); font-size: .72rem; }
.summary-preparation dd { margin: 0; font-weight: 600; }
.summary-preparation > p { margin: .65rem 0 0; color: var(--muted); font-size: .76rem; }

.summary-item,
.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .6rem 1rem;
  padding: 1rem .2rem;
  border-bottom: 1px solid var(--line);
}

.summary-item h3,
.history-item h2 { margin: 0; font-size: 1rem; }
.summary-item p,
.history-item p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .78rem; }
.summary-item span { color: var(--matsuba); font-weight: 600; }
.summary-item .summary-exercise-note { margin-top: .25rem; padding-left: .65rem; border-left: 2px solid var(--kincha); }

.note-field { display: grid; gap: .45rem; margin: 1.6rem 0; }
.note-field span { color: var(--muted); font-size: .78rem; }
.note-field textarea {
  resize: vertical;
  padding: .9rem;
  background: rgba(255, 252, 244, .82);
  border: 1px solid var(--line);
}

.summary-content > .button { width: 100%; margin-bottom: .65rem; text-align: center; }

.history-head { padding: clamp(3rem, 7vw, 6rem) 0 1rem; }
.history-list { padding-bottom: 2rem; }
.history-item time { color: #7b5e2f; font-variant-numeric: tabular-nums; }
.empty-state { padding: 2rem 0; color: var(--muted); }
.empty-state h3 { margin-bottom: .35rem; color: var(--sumi); }
.empty-state p { margin: 0; }
.empty-state--previous { border-bottom: 1px solid var(--line); }

.info-head { padding: clamp(3rem, 7vw, 6rem) 0 1.4rem; }
.info-head h1 {
  max-width: 10em;
  margin: .8rem 0 1rem;
  font-size: clamp(2.35rem, 6vw, 4.4rem);
  letter-spacing: -.05em;
  line-height: 1.16;
}
.info-head > p:last-child { max-width: 36rem; color: var(--muted); }
.release-badge {
  display: inline-flex;
  min-height: 1.8rem;
  align-items: center;
  padding: .15rem .65rem;
  color: #fff8ed;
  background: var(--bengara);
  border-radius: 1px 1px .6rem 1px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.info-content {
  display: grid;
  gap: .85rem;
  padding-bottom: 2rem;
}

.info-card {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(15rem, .65fr);
  gap: 1.25rem 2rem;
  align-items: center;
  padding: 1.3rem 1.4rem;
  background: rgba(255, 252, 244, .8);
  border: 1px solid var(--line);
  border-radius: 2px 2px 1rem 2px;
  backdrop-filter: blur(12px);
}
.info-card .section-label { margin-bottom: .2rem; }
.info-card h2 { margin-bottom: .35rem; font-size: 1.25rem; }
.info-card p:last-child { margin: 0; color: var(--muted); font-size: .78rem; }
.info-card .button { width: 100%; }
.info-card--feedback {
  color: #f5ecdc;
  background:
    linear-gradient(100deg, rgba(8, 18, 28, .96), rgba(8, 18, 28, .68)),
    var(--action-art) center / cover no-repeat,
    var(--aizome);
  border-color: rgba(193, 164, 104, .45);
}
.info-card--feedback h2 { color: #fff8eb; }
.info-card--feedback p:last-child { color: rgba(245, 236, 220, .72); }
.info-card--feedback .button { border: 1px solid rgba(210, 173, 98, .42); }
.info-card--feedback .button.is-pending { filter: grayscale(.6); opacity: .76; }

.data-facts {
  display: grid;
  gap: .35rem;
  margin: 0;
}
.data-facts div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: .55rem .1rem;
  border-bottom: 1px solid var(--line);
}
.data-facts dt { color: var(--muted); font-size: .72rem; }
.data-facts dd { margin: 0; font-size: .76rem; font-weight: 700; }

.backup-actions { display: grid; gap: .55rem; }
.backup-actions .button { text-align: center; }
.info-card--version {
  display: flex;
  justify-content: space-between;
  padding-block: .8rem;
  color: var(--muted);
  background: transparent;
  border-style: dashed;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .72rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  padding: .45rem max(.75rem, env(safe-area-inset-right)) max(.45rem, env(safe-area-inset-bottom)) .75rem;
  background: rgba(244, 240, 230, .94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.bottom-nav button {
  display: grid;
  grid-template-columns: auto auto;
  gap: .45rem;
  place-content: center;
  min-height: 3.25rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.bottom-nav button.is-current { color: var(--aizome); font-weight: 600; }

.clipboard-fallback,
.download-helper {
  position: fixed;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.input-navigator {
  position: fixed;
  right: 1rem;
  bottom: 4.65rem;
  z-index: 45;
  display: grid;
  grid-template-columns: auto minmax(6rem, 1fr) auto;
  align-items: center;
  width: min(28rem, calc(100% - 2rem));
  padding: .4rem;
  color: #fff8eb;
  background: rgba(20, 35, 59, .96);
  border: 1px solid rgba(193, 164, 104, .65);
  box-shadow: 0 .8rem 2.2rem rgba(10, 27, 41, .24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(.7rem);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.input-navigator.is-visible { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.input-navigator button {
  min-height: 2.65rem;
  padding: 0 .7rem;
  color: #fff8eb;
  background: transparent;
  border: 1px solid rgba(230, 202, 149, .42);
  cursor: pointer;
}
.input-navigator button:disabled { opacity: .32; cursor: default; }
.input-navigator output { padding-inline: .5rem; overflow: hidden; font-size: .72rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }

.exercise-dialog {
  width: min(62rem, calc(100% - 1.2rem));
  max-height: min(54rem, calc(100dvh - 1rem));
  padding: 0;
  overflow: hidden;
  color: var(--sumi);
  background: var(--gofun);
  border: 1px solid rgba(193, 164, 104, .5);
  border-radius: 2px 2px 1.8rem 2px;
  box-shadow: 0 2rem 6rem rgba(5, 19, 31, .35);
}

.exercise-dialog::backdrop { background: rgba(8, 18, 29, .72); backdrop-filter: blur(4px); }
.dialog-card { max-height: inherit; overflow-y: auto; }
.dialog-art { height: 9rem; background: url("assets/japanese-paisley-color.webp") center 43% / cover; }
.dialog-head { display: flex; justify-content: space-between; padding: 1.2rem 1.2rem .5rem; }
.dialog-head h2 { margin-bottom: 0; }

.import-dialog {
  width: min(34rem, calc(100% - 1.2rem));
  padding: 0;
  color: var(--sumi);
  background: var(--gofun);
  border: 1px solid rgba(193, 164, 104, .5);
  border-radius: 2px 2px 1.4rem 2px;
  box-shadow: 0 2rem 6rem rgba(5, 19, 31, .4);
}
.import-dialog::backdrop { background: rgba(8, 18, 29, .76); backdrop-filter: blur(4px); }
.import-card { padding: 1.25rem; }
.import-card__head { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
.import-card__head h2 { margin-bottom: 0; font-size: 1.35rem; }
.import-card > p { color: var(--muted); font-size: .78rem; }
.import-preview { display: grid; gap: .25rem; margin: 1rem 0; }
.import-preview div {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: .65rem 0;
  border-bottom: 1px solid var(--line);
}
.import-preview dt { color: var(--muted); font-size: .74rem; }
.import-preview dd { margin: 0; font-size: .78rem; font-weight: 700; }
.import-card__actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: .6rem; margin-top: 1.2rem; }

.exercise-picker-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .25rem;
  margin: .5rem 1.2rem 1rem;
  padding: .25rem;
  background: rgba(193, 164, 104, .09);
  border: 1px solid var(--line);
  border-radius: 2px 2px .8rem 2px;
}

.exercise-picker-tabs button {
  min-height: 2.75rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 1px 1px .55rem 1px;
  cursor: pointer;
}

.exercise-picker-tabs button[aria-selected="true"] {
  color: #fff9ed;
  background: var(--aizome);
  box-shadow: 0 .35rem .9rem rgba(20, 35, 59, .16);
}

.body-picker { padding: 0 1.2rem 1rem; }

.body-picker__toolbar {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: .85rem;
}

.body-picker__toolbar h3 {
  margin: .1rem 0 0;
  font-family: "Yu Mincho", serif;
  font-size: 1.35rem;
}

.body-side-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 2px;
  background: rgba(228, 221, 207, .72);
  border: 1px solid var(--line);
  border-radius: 2px 2px .7rem 2px;
}

.body-side-switch button {
  min-width: 3.5rem;
  min-height: 2.5rem;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 1px 1px .5rem 1px;
  cursor: pointer;
}

.body-side-switch button[aria-pressed="true"] {
  color: #fff9ed;
  background: var(--matsuba);
}

.body-picker__layout {
  display: grid;
  grid-template-columns: minmax(15rem, 20rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.body-stage {
  position: sticky;
  top: .5rem;
  padding: .75rem;
  background:
    linear-gradient(rgba(255, 252, 244, .84), rgba(255, 252, 244, .84)),
    var(--monogram-art) center / 28rem auto;
  border: 1px solid var(--line);
  border-radius: 2px 2px 1.1rem 2px;
}

.body-figure {
  display: none;
  width: min(100%, 17rem);
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.body-figure.is-active { display: block; }

.body-figure__silhouette {
  fill: rgba(82, 91, 87, .13);
  stroke: rgba(73, 78, 75, .32);
  stroke-width: 1.5;
}

.body-region {
  cursor: pointer;
  outline: none;
}

.body-region > * {
  fill: rgba(80, 96, 74, .12);
  stroke: rgba(80, 96, 74, .46);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: fill .2s ease, stroke .2s ease, stroke-width .2s ease, filter .2s ease;
}

.body-region:hover > *,
.body-region:focus-visible > * {
  fill: rgba(61, 120, 151, .22);
  stroke: #3f83a7;
  stroke-width: 3;
}

.body-region.is-planned > * {
  fill: rgba(55, 142, 127, .56);
  stroke: #2f8374;
}

.body-region.is-selected > * {
  stroke: #3f83c5;
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(63, 131, 197, .42));
}

.body-region.is-secondary > * {
  fill: rgba(222, 170, 57, .68);
  stroke: #b77e10;
}

.body-region.is-primary > * {
  fill: rgba(186, 64, 49, .74);
  stroke: #9b3024;
}

.body-region.is-selected.is-primary > *,
.body-region.is-selected.is-secondary > * {
  stroke: #3f83c5;
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(63, 131, 197, .42));
}

.body-map-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .35rem .65rem;
  margin-top: .4rem;
  color: var(--muted);
  font-size: .68rem;
}

.body-map-legend span {
  display: inline-flex;
  gap: .35rem;
  align-items: center;
}

.body-map-legend i {
  width: .72rem;
  height: .72rem;
  border: 2px solid transparent;
  border-radius: 50%;
}

.legend-current { background: rgba(61, 131, 197, .15); border-color: #3f83c5 !important; }
.legend-primary { background: rgba(186, 64, 49, .74); }
.legend-secondary { background: rgba(222, 170, 57, .68); }
.legend-planned { background: rgba(55, 142, 127, .56); }

.body-results { min-width: 0; }
.body-coverage { min-height: 2.8rem; margin: 0 0 .6rem; color: var(--muted); font-size: .82rem; }

.body-exercise-list {
  display: grid;
  gap: .65rem;
}

.body-result-section {
  display: grid;
  gap: .45rem;
}

.body-result-section + .body-result-section { margin-top: 1rem; }

.body-result-section__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: .72rem;
  letter-spacing: .08em;
}

.body-exercise-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 3.25rem;
  overflow: hidden;
  background: rgba(255, 252, 244, .82);
  border: 1px solid var(--line);
  border-radius: 2px 2px .8rem 2px;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.body-exercise-card.is-preview {
  border-color: rgba(193, 164, 104, .72);
  box-shadow: 0 .6rem 1.5rem rgba(20, 35, 59, .1);
}

.body-exercise-preview {
  min-width: 0;
  min-height: 4.5rem;
  padding: .7rem .8rem;
  color: var(--sumi);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.body-exercise-preview b,
.body-exercise-preview small { display: block; }
.body-exercise-preview b { overflow: hidden; font-family: "Yu Mincho", serif; text-overflow: ellipsis; white-space: nowrap; }
.body-exercise-preview small { margin-top: .18rem; overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }

.body-exercise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin-top: .4rem;
}

.body-exercise-tags i {
  padding: .08rem .35rem;
  color: #fff9ef;
  background: var(--bengara);
  border-radius: 999px;
  font-size: .6rem;
  font-style: normal;
}

.body-exercise-tags i + i {
  color: #3f2d0b;
  background: #dfb95f;
}

.body-exercise-add {
  min-width: 3.25rem;
  min-height: 4.5rem;
  color: #fff9ed;
  background: var(--matsuba);
  border: 0;
  border-left: 1px solid var(--line);
  font-size: 1.35rem;
  cursor: pointer;
}

.body-builder-done {
  width: 100%;
  margin-top: 1rem;
  text-align: center;
}

.list-picker { padding-bottom: .5rem; }
.search-field { display: block; padding: .5rem 1.2rem 1rem; }
.search-field input { width: 100%; padding: .8rem; background: #fffaf0; border: 1px solid var(--line); }
.custom-exercise {
  margin: 0 1.2rem 1rem;
  padding: .9rem;
  background: rgba(193, 164, 104, .1);
  border: 1px solid rgba(193, 164, 104, .4);
}
.custom-exercise__head { display: flex; justify-content: space-between; margin-bottom: .65rem; }
.custom-exercise__head small { color: var(--bengara); font-weight: 700; letter-spacing: .08em; }
.custom-exercise > input { width: 100%; padding: .78rem; background: #fffaf0; border: 1px solid var(--line); }
.custom-exercise__regions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .5rem;
}
.custom-exercise__regions label {
  display: grid;
  gap: .2rem;
  color: var(--muted);
  font-size: .68rem;
}
.custom-exercise__regions select {
  min-width: 0;
  min-height: 2.65rem;
  padding: 0 .65rem;
  color: var(--sumi);
  background: #fffaf0;
  border: 1px solid var(--line);
}
.custom-exercise__actions { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .5rem; }
.custom-exercise__actions select,
.custom-exercise__actions button { min-height: 2.75rem; padding: 0 .75rem; border: 1px solid var(--line); }
.custom-exercise__actions select { background: #fffaf0; }
.custom-exercise__actions button { color: #fffaf0; background: var(--aizome); cursor: pointer; }
.catalog-list { padding: 0 1.2rem 1.4rem; }
.catalog-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: .9rem .15rem;
  color: var(--sumi);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
}
.catalog-button small { color: var(--muted); }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 5rem;
  z-index: 80;
  max-width: min(24rem, calc(100% - 2rem));
  padding: .8rem 1rem;
  color: #fff8e9;
  background: var(--aizome);
  border-left: 3px solid var(--kincha);
  opacity: 0;
  transform: translateY(1rem);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible { opacity: 1; transform: translateY(0); }

.theme-light {
  --header-art: url("assets/japanese-paisley-color.webp");
  --action-art: url("assets/japanese-paisley-color.webp");
  --monogram-art: url("assets/tanren-monogram-washi-v3.webp");
  --monogram-opacity: .28;
  color-scheme: light;
}

.theme-dark {
  --aizome: #08121c;
  --aizome-2: #152738;
  --gofun: #0d161f;
  --washi: #1a252f;
  --bengara: #a65345;
  --matsuba: #263a32;
  --kincha: #d2ad62;
  --sumi: #eee8dc;
  --muted: #a3aca8;
  --line: rgba(218, 190, 132, .18);
  --panel: #111b24;
  --shadow: rgba(0, 7, 13, .54);
  --header-art: url("assets/tanren-gokou-hero-black-gold-v2.webp");
  --action-art: url("assets/tanren-gokou-actions-black-gold-v2.webp");
  --monogram-art: url("assets/tanren-monogram-sumi-v3.webp");
  --monogram-opacity: .34;
  color-scheme: dark;
  background: #08121c;
}

.theme-dark .art-rail__shade {
  background:
    radial-gradient(circle at 71% 24%, rgba(209, 172, 97, .08), transparent 28%),
    linear-gradient(90deg, rgba(3, 8, 12, .94), rgba(3, 8, 12, .62) 34%, rgba(3, 8, 12, .08) 68%),
    linear-gradient(180deg, rgba(5, 12, 20, .06), rgba(5, 12, 20, .2) 46%, rgba(5, 12, 20, .94));
}
.theme-dark .art-rail,
.theme-dark .art-title,
.theme-dark .art-caption { color: #f4eadb; }

.theme-dark .app-panel {
  background:
    radial-gradient(circle at 91% 7%, rgba(178, 130, 61, .09), transparent 25rem),
    radial-gradient(circle at 14% 62%, rgba(53, 78, 70, .1), transparent 31rem),
    linear-gradient(135deg, rgba(255, 255, 255, .018), transparent 28rem),
    #0d161f;
}

.theme-dark .topbar {
  background: rgba(8, 18, 28, .9);
  border-bottom-color: rgba(210, 173, 98, .15);
  box-shadow: 0 .5rem 1.8rem rgba(0, 7, 13, .16);
}

.theme-dark .theme-switch {
  background:
    linear-gradient(135deg, rgba(210, 173, 98, .1), transparent 62%),
    rgba(18, 29, 38, .86);
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark .theme-switch button { color: #9ca7a3; }
.theme-dark .theme-switch button[aria-pressed="true"] {
  color: #14191a;
  background: var(--kincha);
  box-shadow: 0 .3rem .8rem rgba(0, 7, 13, .3);
}

.theme-dark .brand__seal { color: #151a1d; background: var(--kincha); }
.theme-dark .storage-state i { background: var(--kincha); box-shadow: 0 0 0 .2rem rgba(210, 173, 98, .13); }
.theme-dark .section-label,
.theme-dark .section-heading time,
.theme-dark .history-item time { color: var(--kincha); }

.theme-dark .button--primary {
  color: #f4eee2;
  background:
    linear-gradient(100deg, rgba(6, 15, 23, .96), rgba(10, 23, 35, .58)),
    var(--action-art) left center / 240% auto no-repeat,
    #172634;
  border: 1px solid rgba(210, 173, 98, .34);
  box-shadow: 0 1rem 2.4rem rgba(0, 7, 13, .32);
}
.theme-dark .button--primary:hover { filter: brightness(1.1) saturate(1.04); }
.theme-dark .button--body-plan {
  color: #f4eee2;
  background:
    linear-gradient(100deg, rgba(7, 16, 24, .94), rgba(9, 22, 33, .56)),
    var(--action-art) center / 240% auto no-repeat,
    #172634;
  border-color: rgba(210, 173, 98, .28);
  box-shadow: 0 .9rem 2rem rgba(0, 7, 13, .28);
}
.theme-dark .button--quiet {
  color: #d8d2c6;
  background: rgba(27, 39, 49, .78);
  border-color: rgba(210, 173, 98, .13);
}
.theme-dark .button--outline { color: #e8dfcf; border-color: rgba(210, 173, 98, .38); }
.theme-dark .button--outline:hover { background: rgba(210, 173, 98, .08); }
.theme-dark .button--finish { box-shadow: 0 .9rem 2.2rem rgba(81, 31, 25, .34); }

.theme-dark .previous-row,
.theme-dark .section-heading { border-color: var(--line); }
.theme-dark .principle-strip { background: #1b2c27; border-left-color: var(--kincha); }
.theme-dark .session-controls { background: rgba(17, 27, 36, .82); border-color: var(--line); }
.theme-dark .preparation-card { color: #eee8dc; background: rgba(17, 27, 36, .88); border-color: rgba(210, 173, 98, .2); }
.theme-dark .preparation-options button { color: #ddd6c9; background: rgba(35, 49, 59, .88); border-color: rgba(210, 173, 98, .16); }
.theme-dark .preparation-options button[aria-pressed="true"] { color: #11171b; background: var(--kincha); border-color: var(--kincha); }
.theme-dark .preparation-note input { color: #eee8dc; background: #0a131b; border-color: rgba(210, 173, 98, .2); }
.theme-dark .exercise-jump {
  color: #eee8dc;
  background: rgba(9, 18, 27, .94);
  border-color: rgba(210, 173, 98, .22);
  box-shadow: 0 .8rem 2rem rgba(0, 7, 13, .32);
}
.theme-dark .jump-chip { color: #eee8dc; background: rgba(28, 41, 51, .92); border-color: rgba(210, 173, 98, .19); }
.theme-dark .jump-chip.is-focus { border-color: rgba(210, 173, 98, .68); box-shadow: inset .18rem 0 var(--kincha); }
.theme-dark .jump-chip.is-complete { color: #dce8d8; background: rgba(69, 101, 83, .34); border-color: rgba(143, 164, 126, .4); }
.theme-dark .jump-chip--add { color: #d9bd83; background: transparent; border-color: rgba(210, 173, 98, .35); }
.theme-dark .rir-inputs select,
.theme-dark .exercise-meta input,
.theme-dark .number-control,
.theme-dark .set-type {
  color: #eee8dc;
  background: #0a131b;
  border-color: rgba(210, 173, 98, .2);
}

.theme-dark .exercise-card {
  background: rgba(17, 27, 36, .94);
  border-color: rgba(210, 173, 98, .17);
  box-shadow: 0 1rem 2.6rem rgba(0, 7, 13, .28);
}
.theme-dark .exercise-card.is-focus { border-left-color: var(--kincha); }
.theme-dark .exercise-card.is-done { box-shadow: inset 0 0 0 1px rgba(143, 164, 126, .28), 0 1rem 2.6rem rgba(0, 7, 13, .28); }
.theme-dark .icon-button {
  color: #d5c9b3;
  background: rgba(40, 53, 62, .78);
  border: 1px solid rgba(210, 173, 98, .12);
}
.theme-dark .focus-button svg { stroke-width: 1.7; stroke-linecap: square; }
.theme-dark .focus-button[aria-pressed="true"] { color: #11171b; background: var(--kincha); }
.theme-dark .set-row.is-complete { background: rgba(67, 99, 82, .19); }
.theme-dark .number-control button,
.theme-dark .complete-button { color: #d9bd83; }
.theme-dark .complete-button { border-color: rgba(210, 173, 98, .36); }
.theme-dark .set-row.is-complete .complete-button { color: #101814; background: #8fa47e; border-color: #8fa47e; }
.theme-dark .text-button { color: #d9bd83; }
.theme-dark .assist-toggle { color: #d5c9b3; background: rgba(40, 53, 62, .78); border-color: rgba(210, 173, 98, .2); }
.theme-dark .assist-toggle[aria-pressed="true"] { color: #11171b; background: var(--kincha); border-color: var(--kincha); }
.theme-dark .set-assist-toggle { color: #d5c9b3; background: rgba(40, 53, 62, .78); border-color: rgba(210, 173, 98, .24); }
.theme-dark .set-assist-toggle[aria-pressed="true"] { color: #11171b; background: var(--kincha); border-color: var(--kincha); }
.theme-dark .bodyweight-control { color: #dce8d8; background: rgba(67, 99, 82, .17); border-color: rgba(143, 164, 126, .3); }
.theme-dark .exercise-note textarea { color: #eee8dc; background: #0a131b; border-color: rgba(210, 173, 98, .2); }
.theme-dark .exercise-done-button { color: #aebf9f; background: rgba(67, 99, 82, .16); border-color: rgba(143, 164, 126, .42); }
.theme-dark .exercise-done-button[aria-pressed="true"] { color: #101814; background: #8fa47e; border-color: #8fa47e; }

.theme-dark .summary-content,
.theme-dark .history-list { color: var(--sumi); }
.theme-dark .summary-item span { color: #aebf9f; }
.theme-dark .summary-preparation { background: rgba(67, 99, 82, .16); border-left-color: var(--kincha); }
.theme-dark .note-field textarea {
  color: #eee8dc;
  background: #0a131b;
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark input::placeholder,
.theme-dark textarea::placeholder { color: #7f8b87; }

.theme-dark .bottom-nav {
  background: rgba(8, 18, 28, .94);
  border-top-color: rgba(210, 173, 98, .18);
  box-shadow: 0 -.6rem 1.8rem rgba(0, 7, 13, .18);
}
.theme-dark .bottom-nav button.is-current { color: var(--kincha); }
.theme-dark .input-navigator { background: rgba(6, 14, 22, .98); box-shadow: 0 1rem 2.6rem rgba(0, 4, 8, .48); }

.theme-dark .exercise-dialog {
  color: var(--sumi);
  background: #101a23;
  border-color: rgba(210, 173, 98, .38);
  box-shadow: 0 2rem 6rem rgba(0, 4, 8, .72);
}
.theme-dark .search-field input,
.theme-dark .custom-exercise > input,
.theme-dark .custom-exercise__actions select {
  color: #eee8dc;
  background: #09121a;
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark .custom-exercise { background: rgba(210, 173, 98, .055); border-color: rgba(210, 173, 98, .22); }
.theme-dark .exercise-picker-tabs,
.theme-dark .body-side-switch {
  background: rgba(18, 29, 38, .88);
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark .exercise-picker-tabs button,
.theme-dark .body-side-switch button { color: #a8b1ad; }
.theme-dark .exercise-picker-tabs button[aria-selected="true"] {
  color: #151a1d;
  background: var(--kincha);
}
.theme-dark .body-side-switch button[aria-pressed="true"] {
  color: #151a1d;
  background: var(--kincha);
}
.theme-dark .body-stage {
  background:
    linear-gradient(rgba(10, 19, 27, .84), rgba(10, 19, 27, .84)),
    var(--monogram-art) center / 28rem auto;
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark .body-figure__silhouette {
  fill: rgba(224, 217, 204, .08);
  stroke: rgba(224, 217, 204, .25);
}
.theme-dark .body-region > * {
  fill: rgba(169, 181, 172, .08);
  stroke: rgba(169, 181, 172, .38);
}
.theme-dark .body-region:hover > *,
.theme-dark .body-region:focus-visible > * {
  fill: rgba(61, 120, 151, .22);
  stroke: #62a6c9;
}
.theme-dark .body-region.is-planned > * {
  fill: rgba(55, 142, 127, .58);
  stroke: #65b5a6;
}
.theme-dark .body-region.is-secondary > * {
  fill: rgba(222, 170, 57, .7);
  stroke: #e0b34d;
}
.theme-dark .body-region.is-primary > * {
  fill: rgba(186, 64, 49, .78);
  stroke: #d26b5c;
}
.theme-dark .body-region.is-selected > *,
.theme-dark .body-region.is-selected.is-primary > *,
.theme-dark .body-region.is-selected.is-secondary > * {
  stroke: #58a9e3;
  stroke-width: 4;
  filter: drop-shadow(0 0 5px rgba(63, 131, 197, .48));
}
.theme-dark .body-exercise-card {
  background: rgba(17, 27, 36, .93);
  border-color: rgba(210, 173, 98, .18);
}
.theme-dark .body-exercise-card.is-preview { border-color: rgba(210, 173, 98, .68); }
.theme-dark .body-exercise-preview { color: #eee8dc; }
.theme-dark .body-exercise-add {
  color: #151a1d;
  background: var(--kincha);
  border-left-color: rgba(210, 173, 98, .22);
}
.theme-dark .custom-exercise__regions select {
  color: #eee8dc;
  background: #09121a;
  border-color: rgba(210, 173, 98, .2);
}
.theme-dark .custom-exercise__actions button { color: #11171b; background: var(--kincha); border-color: var(--kincha); }
.theme-dark .catalog-button { color: var(--sumi); border-bottom-color: var(--line); }
.theme-dark .toast { color: #151a1d; background: var(--kincha); border-left-color: #f3dca8; }
.theme-dark .trial-notice {
  background:
    linear-gradient(120deg, rgba(210, 173, 98, .08), transparent 62%),
    rgba(17, 27, 36, .88);
  border-color: rgba(210, 173, 98, .23);
  border-left-color: var(--kincha);
}
.theme-dark .trial-notice__actions button { color: #eee8dc; border-color: rgba(210, 173, 98, .22); }
.theme-dark .trial-notice__actions button:first-child { color: #14191a; background: var(--kincha); }
.theme-dark .empty-state h3 { color: var(--sumi); }
.theme-dark .info-card {
  background: rgba(17, 27, 36, .86);
  border-color: rgba(210, 173, 98, .17);
}
.theme-dark .info-card--feedback {
  background:
    linear-gradient(100deg, rgba(4, 10, 15, .97), rgba(8, 18, 28, .64)),
    var(--action-art) center / cover no-repeat,
    #08121c;
  border-color: rgba(210, 173, 98, .36);
}
.theme-dark .info-card--version { background: transparent; }
.theme-dark .data-facts div,
.theme-dark .import-preview div { border-bottom-color: rgba(210, 173, 98, .15); }
.theme-dark .import-dialog {
  color: var(--sumi);
  background: #0d161f;
  border-color: rgba(210, 173, 98, .35);
}

@media (max-width: 900px) {
  .app-frame { grid-template-columns: 1fr; }
  .app-panel::before { width: 100%; }
  .art-rail {
    position: relative;
    height: clamp(18rem, 39svh, 29rem);
    background-position: 58% center;
  }
  .art-rail__copy { inset: auto 1.6rem 1.8rem; }
  .art-title { font-size: clamp(2.7rem, 9vw, 4.2rem); }
  .art-caption { max-width: 12em; font-size: clamp(1.15rem, 3.8vw, 1.5rem); }
  .app-panel { min-height: auto; }
  .bottom-nav { right: auto; left: 0; width: 100%; min-width: 0; }
  .info-card { grid-template-columns: minmax(0, 1.25fr) minmax(13rem, .75fr); }
}

@media (max-width: 760px) {
  .body-picker__layout { grid-template-columns: 1fr; }
  .body-stage { position: relative; top: auto; }
  .body-figure { width: min(100%, 14.5rem); }
  .body-map-legend { max-width: 20rem; margin-inline: auto; }
}

@media (max-width: 620px) {
  .art-rail {
    height: 36svh;
    min-height: 16rem;
    background-position: 64% center;
  }
  .art-rail__copy { inset: auto 1.25rem 1.4rem; gap: .5rem; }
  .art-title { font-size: clamp(2.25rem, 11vw, 3.15rem); }
  .art-caption { font-size: clamp(1rem, 4.7vw, 1.25rem); }

  .topbar { min-height: 4rem; padding-inline: .75rem; }
  .topbar__tools { gap: .4rem; }
  .storage-state { font-size: .65rem; }
  .theme-switch button { min-width: 2.8rem; padding-inline: .4rem; }

  .home-intro,
  .trial-notice,
  .primary-actions,
  .resume-card,
  .previous-block,
  .principle-strip,
  .session-controls,
  .preparation-card,
  .exercise-jump,
  .exercise-list,
  .session-actions,
  .summary-content,
  .history-head,
  .history-list,
  .info-head,
  .info-content {
    width: calc(100% - 1.5rem);
  }

  .home-intro { padding-top: 3.2rem; }
  .trial-notice { grid-template-columns: 1fr; }
  .trial-notice__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .app-panel::before { background-size: 34rem auto; }
  .home-intro h1 { font-size: clamp(2.25rem, 13vw, 3.5rem); }
  .primary-actions { grid-template-columns: 1fr; }
  .button { min-height: 3.8rem; }

  .exercise-dialog {
    width: calc(100% - .6rem);
    max-height: calc(100dvh - .6rem);
  }
  .dialog-art { height: 6rem; }
  .dialog-head { padding: .9rem .85rem .35rem; }
  .exercise-picker-tabs { margin: .4rem .85rem .75rem; }
  .body-picker { padding-inline: .85rem; }
  .body-picker__toolbar { align-items: center; }
  .body-picker__toolbar h3 { font-size: 1.15rem; }
  .body-side-switch button { min-width: 3.2rem; }
  .body-stage { padding: .55rem; }
  .body-exercise-card { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .custom-exercise { margin-inline: .85rem; }

  .previous-row { grid-template-columns: 1fr; gap: .25rem; }
  .principle-strip { grid-template-columns: auto auto; }
  .principle-strip span { grid-column: 1 / -1; }

  .session-art,
  .summary-art {
    min-height: 13.5rem;
    padding: 1.8rem 1.25rem;
    background-position: 53% center;
  }
  .session-art h1,
  .summary-art h1 { font-size: 2.5rem; }
  .session-clock b { font-size: 1.2rem; }
  .session-clock__row { display: grid; gap: .35rem; }
  .timer-reset { min-height: 2rem; font-size: .65rem; }

  .session-controls { grid-template-columns: 1fr; }
  .preparation-head { align-items: start; }
  .preparation-head > small { max-width: 11rem; }
  .preparation-grid { grid-template-columns: 1fr; }
  .exercise-jump { top: 4rem; }
  .rir-control { justify-content: space-between; }

  .exercise-head { padding-inline: .85rem; }
  .exercise-meta { grid-template-columns: 1fr; padding-inline: .85rem; }
  .assist-toggle { width: 100%; }
  .set-row {
    grid-template-columns: 1.5rem minmax(0, 1fr) minmax(0, 1fr) 3rem;
    grid-template-rows: auto auto;
    gap: .3rem;
    padding-inline: .55rem;
  }
  .set-index { grid-row: 1 / 3; align-self: center; }
  .number-control { grid-template-columns: 2rem minmax(2rem, 1fr) 2rem; }
  .set-type { grid-column: 2 / 4; grid-row: 2; min-height: 2.25rem; font-size: .72rem; }
  .complete-button { grid-column: 4; grid-row: 1 / 3; min-height: 3.2rem; align-self: stretch; }
  .exercise-note,
  .exercise-foot { padding-inline: .75rem; }
  .session-actions { grid-template-columns: 1fr; }

  .summary-art { min-height: 18rem; }
  .info-head { padding-top: 2.8rem; }
  .info-head h1 { font-size: clamp(2.2rem, 12vw, 3.35rem); }
  .info-card { grid-template-columns: 1fr; padding: 1rem; }
  .info-card--version { display: flex; }
  .import-card__actions { grid-template-columns: 1fr; }
  .input-navigator { right: .75rem; bottom: 4.45rem; width: calc(100% - 1.5rem); }
  .input-navigator button { padding-inline: .55rem; font-size: .72rem; }
}

@media (max-width: 390px) {
  .brand small { display: none; }
  .storage-state { font-size: 0; }
  .storage-state i { width: .48rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .exercise-card.is-targeted { animation: none; }
}

@media print {
  .art-rail,
  .topbar,
  .bottom-nav,
  .session-actions,
  .trial-notice,
  .toast { display: none; }
  .app-frame { display: block; }
  .app-panel { padding: 0; }
}
