:root {
  --bg: #15111a;
  --surface: #201a26;
  --raised: #2a2231;
  --line: #3b3043;
  --text: #eee6ec;
  --muted: #a898a6;
  --accent: #c9a45c;
  --accent-ink: #1b1408;
  --ok: #73b18e;
  --warn: #e0ab45;
  --bad: #d75a6e;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0;
  line-height: 1.15;
}
h1 {
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}
h2 {
  font-size: 1.45rem;
}
h3 {
  font-size: 1.15rem;
}
@media (max-width: 440px) {
  h1 {
    font-size: 1.3rem;
  }
  .top-in {
    gap: 8px;
  }
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.num {
  font-variant-numeric: tabular-nums;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
header.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-in h1 {
  flex: 1;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}
.pill.gold {
  border-color: var(--accent);
  color: var(--accent);
}
.pill.ok {
  border-color: var(--ok);
  color: var(--ok);
}
.pill.warn {
  border-color: var(--warn);
  color: var(--warn);
}
.pill.bad {
  border-color: var(--bad);
  color: var(--bad);
}

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card.flat {
  background: transparent;
}
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (min-width: 620px) {
  .grid4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.tile {
  background: var(--raised);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tile .big {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1;
}
.tile .label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.bar {
  height: 8px;
  border-radius: 99px;
  background: var(--line);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}

.item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 8px;
  background: var(--raised);
  border-left: 3px solid var(--line);
}
.item.s-todo {
  border-left-color: var(--muted);
}
.item.s-wait {
  border-left-color: var(--warn);
}
.item.s-ok {
  border-left-color: var(--ok);
}
.item.s-back {
  border-left-color: var(--bad);
}
.item.rule {
  border-left-color: var(--accent);
}
.item .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}
.item .acts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.title {
  font-weight: 600;
}
.pre {
  white-space: pre-wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--raised);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.2;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.danger {
  border-color: var(--bad);
  color: var(--bad);
  background: transparent;
}
.btn.ghost {
  background: transparent;
}
.btn.sm {
  padding: 5px 10px;
  font-size: 0.84rem;
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.safe {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

label.f {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.88rem;
  color: var(--muted);
}
input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 1rem;
}
textarea {
  min-height: 84px;
  resize: vertical;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}
.check input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 3px;
  accent-color: var(--accent);
}
.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.days label {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text);
}
.scale {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.scale button {
  padding: 8px 2px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.82rem;
}
.scale button.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}

.banner {
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.banner.stop {
  background: color-mix(in srgb, var(--bad) 22%, var(--surface));
  border: 1px solid var(--bad);
}
.banner.slow {
  background: color-mix(in srgb, var(--warn) 18%, var(--surface));
  border: 1px solid var(--warn);
}
.banner .txt {
  flex: 1;
  min-width: 200px;
}
.notice {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.notice:last-child {
  border-bottom: 0;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 8px;
  flex: none;
}
.dot.read {
  background: transparent;
  border: 1px solid var(--line);
}

nav.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabs-in {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
}
.tabs-in button {
  flex: 1;
  background: none;
  border: 0;
  padding: 12px 4px 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  border-top: 2px solid transparent;
}
.tabs-in button.on {
  color: var(--accent);
  border-top-color: var(--accent);
}
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 99px;
  background: var(--bad);
  color: #fff;
  font-size: 0.72rem;
  line-height: 18px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(5, 3, 8, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
@media (min-width: 620px) {
  .overlay {
    align-items: center;
  }
}
.modal {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 30;
  background: var(--raised);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: calc(100% - 32px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
th,
td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
}
.scroll {
  overflow-x: auto;
}
details > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
}
.center {
  max-width: 520px;
  margin: 10vh auto 0;
}
.practice-bar {
  background: var(--accent);
  color: var(--accent-ink);
}
.practice-bar .top-in {
  padding: 6px 16px;
  gap: 8px;
  flex-wrap: wrap;
}
.practice-bar .lbl {
  flex: 1;
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 150px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  color: var(--muted);
}
.seg button.on {
  background: var(--accent);
  color: var(--accent-ink);
}
.practice-bar .seg {
  border-color: var(--accent-ink);
}
.practice-bar .seg button {
  color: var(--accent-ink);
}
.practice-bar .seg button.on {
  background: var(--accent-ink);
  color: var(--accent);
}
.practice-bar .btn {
  background: transparent;
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}
.timer {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.drill-steps {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px;
  white-space: pre-wrap;
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  cursor: pointer;
}
.chip.cur {
  border-color: var(--accent);
  color: var(--accent);
}
.chip.done {
  border-color: var(--ok);
}
.steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.stepnum {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.step.done .stepnum {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--accent-ink);
}
.step.done > .body > .title {
  color: var(--muted);
}
.step.warn .stepnum {
  border-color: var(--warn);
  color: var(--warn);
}
.step > .body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.say {
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 0 8px 8px 0;
  font-style: italic;
}
.bigstep {
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 600;
}
ul {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hr {
  height: 1px;
  background: var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: rise 0.2s ease-out;
  }
  @keyframes rise {
    from {
      transform: translate(-50%, 8px);
      opacity: 0.4;
    }
  }
}
details.how > summary {
  font-size: 0.82rem;
  color: var(--accent);
  margin-left: 26px;
}
details.how > p {
  margin: 4px 0 0 26px;
  color: var(--text);
}
.item.col {
  flex-direction: column;
}
.item.col .acts {
  justify-content: flex-start;
}
.crit.skipped {
  opacity: 0.55;
}
details.group {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
details.group > summary {
  color: var(--text);
}
.choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.choices button {
  min-height: 48px;
  padding: 6px 3px;
  line-height: 1.15;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
}
.choices button.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 700;
}
.sticky-actions {
  position: sticky;
  bottom: -18px;
  background: var(--surface);
  padding: 10px 0 2px;
  border-top: 1px solid var(--line);
  margin-top: -4px;
}
.path-list {
  margin: 2px 0 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.goal-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.goal-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.goal-list .mark {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.goal-list li.done .mark {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--accent-ink);
}
.goal-list li.done .txt {
  color: var(--muted);
}
.goal-list li.skip .txt {
  color: var(--muted);
  text-decoration: line-through;
}
dl.words {
  margin: 6px 0 0 26px;
  display: grid;
  gap: 2px 0;
}
dl.words dt {
  font-weight: 600;
  margin-top: 6px;
}
dl.words dd {
  margin: 0;
  color: var(--muted);
}
.steps-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
