:root {
  color-scheme: dark;
  --bg-deep: #07061a;
  --bg-mid: #191340;
  --bg-lift: #2f2867;
  --text-hi: #ffffff;
  --text-mid: rgba(255, 255, 255, 0.72);
  --text-low: rgba(255, 255, 255, 0.5);
  --accent: oklch(0.78 0.11 285);
  --strict: oklch(0.74 0.11 32);
  --gentle: oklch(0.8 0.08 200);
  --good: oklch(0.8 0.09 150);
  --warning: oklch(0.75 0.11 32);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 35% 0%, #322b72 0, #171335 34%, #060513 74%);
  color: var(--text-hi);
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

input::placeholder {
  color: inherit;
  opacity: 0.4;
}

.app-shell {
  width: 100vw;
  height: 100dvh;
  display: block;
  padding: 0;
}

.app-surface {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: radial-gradient(125% 100% at 18% -5%, #514499 0%, #2f2867 36%, #191340 68%, #0a0722 100%);
  position: relative;
}

.blob {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.blob.one {
  width: 300px;
  height: 300px;
  right: -80px;
  top: -20px;
  background: radial-gradient(circle, rgba(138, 120, 255, 0.32), transparent 70%);
  filter: blur(46px);
}

.blob.two {
  width: 280px;
  height: 280px;
  left: -90px;
  bottom: 110px;
  background: radial-gradient(circle, rgba(176, 128, 240, 0.24), transparent 70%);
  filter: blur(54px);
}

.scroll {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 720px;
  align-self: center;
  padding: calc(18px + env(safe-area-inset-top)) clamp(16px, 4vw, 28px) 26px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  position: relative;
  z-index: 1;
  transition: filter 0.25s, transform 0.25s;
  scrollbar-width: none;
}

.scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.scroll.dimmed {
  filter: brightness(0.5) saturate(0.8);
  transform: scale(0.985);
}

.between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.label-cap,
.card-title,
.sheet-section-label,
.detail-field-label {
  font-size: 10.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-low);
  font-weight: 600;
}

.h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-top: 4px;
}

.header-link,
.save-link,
.review-exit {
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  background: transparent;
  padding: 0;
}

.save-link {
  color: #191340;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.72));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card,
.glass-card {
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 17px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 12px 30px rgba(0, 0, 0, 0.26);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.strategy-strip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 7px 13px;
  cursor: pointer;
}

.mantra-tag {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.56);
  font-weight: 500;
  font-style: italic;
  margin-top: 12px;
  letter-spacing: 0.01em;
}

.next-banner,
.arc-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(178, 150, 255, 0.24), rgba(178, 150, 255, 0.07));
  border: 1px solid rgba(178, 150, 255, 0.4);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), 0 10px 26px rgba(0, 0, 0, 0.22);
  margin-top: 4px;
}

.next-label,
.accent-label {
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.next-text {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.habit-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 2px;
}

.today-card {
  display: flex;
  align-items: center;
  gap: 13px;
  cursor: pointer;
  border-radius: 20px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 12px 30px rgba(0, 0, 0, 0.26);
}

.today-name {
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.today-action-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-mid);
  font-weight: 500;
}

.tone-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  background: currentColor;
}

.tone-strict { color: var(--strict); }
.tone-direct { color: var(--accent); }
.tone-gentle { color: var(--gentle); }

.tone-text {
  font-weight: 600;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: oklch(0.84 0.11 65);
  background: rgba(255, 190, 120, 0.13);
  border: 1px solid rgba(255, 190, 120, 0.3);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.streak-pill.reset {
  color: var(--text-low);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.state-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-top: 7px;
}

.state-label.done { color: var(--good); }
.state-label.missed { color: var(--warning); }
.state-label.skip,
.state-label.na { color: var(--text-low); }

.glyph {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  color: transparent;
  font-size: 16px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glyph.done {
  color: oklch(0.5 0.15 285);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.55));
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 3px 8px rgba(0, 0, 0, 0.22);
}

.glyph.missed {
  border-color: rgba(240, 150, 150, 0.4);
}

.glyph.skip {
  color: rgba(255, 255, 255, 0.5);
  border-style: dashed;
  background: rgba(255, 255, 255, 0.06);
}

.glyph.na {
  background: transparent;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
}

.from-sunday,
.review-nudge,
.today-campaign {
  border-radius: 15px;
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.from-sunday {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 6px;
}

.from-sunday-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.from-sunday-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

.from-sunday-text {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  line-height: 1.35;
}

.today-campaign {
  display: flex;
  flex-direction: column;
  gap: 11px;
  border-radius: 18px;
  cursor: pointer;
  margin-top: 6px;
}

.progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, oklch(0.78 0.11 285), oklch(0.85 0.09 245));
  box-shadow: 0 0 10px rgba(178, 150, 255, 0.5);
}

.goal-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.goal-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.goal-text {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-nudge {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 2px;
}

.review-nudge-label {
  font-size: 9.5px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.review-nudge-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}

.calm-footer {
  font-size: 11px;
  color: var(--text-low);
  text-align: center;
  margin-top: 10px;
  letter-spacing: 0.02em;
}

.signal-card {
  background: rgba(178, 150, 255, 0.12);
  border-color: rgba(178, 150, 255, 0.3);
}

.signal-text {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

.change-item,
.insight-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.4;
}

.change-arrow {
  font-weight: 800;
  flex-shrink: 0;
}

.change-arrow.up { color: var(--good); }
.change-arrow.down { color: var(--warning); }
.change-arrow.flat { color: var(--accent); }

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.week-day {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-low);
  letter-spacing: 0.02em;
}

.week-day.today {
  color: var(--accent);
  font-weight: 800;
}

.row-label {
  font-size: 14px;
  color: var(--text-hi);
  font-weight: 600;
}

.status-word {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-low);
}

.status-word.strong { color: var(--good); }
.status-word.slipping { color: var(--warning); }

.pct {
  font-size: 12px;
  color: var(--text-mid);
  font-weight: 700;
}

.pct.weak {
  color: var(--warning);
}

.week-cell,
.grid-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.week-cell.done,
.grid-cell.done {
  background: linear-gradient(150deg, oklch(0.82 0.11 285), oklch(0.66 0.13 285));
  border: 0;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.28);
}

.week-cell.missed,
.grid-cell.missed {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(240, 150, 150, 0.4);
}

.week-cell.skip,
.grid-cell.skip {
  background: rgba(255, 255, 255, 0.05);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.32);
}

.week-cell.na {
  background: rgba(255, 255, 255, 0.03);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.16);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  color: var(--text-low);
  flex-wrap: wrap;
  margin-top: 3px;
  font-weight: 500;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  display: inline-block;
  margin-left: 8px;
}

.swatch.first { margin-left: 0; }
.swatch.done { background: linear-gradient(150deg, oklch(0.82 0.11 285), oklch(0.66 0.13 285)); }
.swatch.missed { background: rgba(255,255,255,0.04); border: 1px solid rgba(240,150,150,0.38); }
.swatch.skip { background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.3); }
.swatch.future,
.swatch.na { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); }

.banner {
  font-size: 12.5px;
  color: #191340;
  font-weight: 700;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7));
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 8px 20px rgba(0, 0, 0, 0.25);
}

.arc-hero {
  gap: 14px;
  padding: 22px 20px;
  border-radius: 24px;
}

.arc-day-line {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.arc-day-big {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.arc-day-unit {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-mid);
}

.arc-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.purpose-goal {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.16;
}

.purpose-mantra {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
  font-style: italic;
  font-weight: 500;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.constraint {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px 11px;
}

.meta-dim {
  font-size: 11px;
  color: var(--text-mid);
  font-weight: 600;
}

.grid-wrap,
.pixel-wrap {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
}

.pixel-wrap { gap: 5px; }

.grid-cell {
  border-radius: 3px;
}

.grid-cell.future {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

.pixel-cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
}

.pixel-cell.future {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pixel-cell.count-1 {
  background: oklch(0.72 0.1 285 / 0.34);
  border: 0;
}

.pixel-cell.count-2 {
  background: oklch(0.75 0.11 285 / 0.66);
  border: 0;
}

.pixel-cell.count-3 {
  background: linear-gradient(150deg, oklch(0.85 0.11 285), oklch(0.68 0.13 285));
  border: 0;
  box-shadow: 0 0 6px rgba(178, 150, 255, 0.5);
}

.trend-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.streak-hero {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(255, 190, 120, 0.16), rgba(255, 190, 120, 0.04));
  border: 1px solid rgba(255, 190, 120, 0.3);
}

.streak-hero-num {
  font-size: 38px;
  font-weight: 800;
  color: oklch(0.84 0.11 65);
  letter-spacing: -0.03em;
  line-height: 1;
  flex-shrink: 0;
}

.streak-row,
.milestone-row,
.lib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.streak-row-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}

.streak-cur {
  font-size: 17px;
  font-weight: 800;
  color: oklch(0.84 0.11 65);
}

.streak-unit,
.streak-best {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-low);
}

.milestone-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-low);
  border: 1.5px dashed rgba(255, 255, 255, 0.2);
}

.milestone-marker.done {
  color: oklch(0.5 0.15 285);
  background: rgba(255, 255, 255, 0.92);
  border: 0;
}

.milestone-marker.next {
  color: var(--accent);
  border-style: solid;
  border-color: var(--accent);
}

.step-dots {
  display: flex;
  gap: 6px;
}

.step-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.step-dot.done { background: rgba(255,255,255,0.85); }
.step-dot.active { background: var(--accent); }

.ritual-stage {
  min-height: 300px;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.2);
  padding: 24px 20px;
}

.step-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.insight-lead {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.insight-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 6px;
  flex-shrink: 0;
}

.hint-copy {
  font-size: 11px;
  color: var(--text-low);
  font-style: italic;
  margin-top: auto;
}

.subtle {
  font-size: 11.5px;
  color: var(--text-low);
  line-height: 1.45;
}

.input,
.detail-name {
  width: 100%;
  color: var(--text-hi);
  outline: none;
  font-family: inherit;
}

.input {
  font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  padding: 14px 15px;
}

.commit-input {
  font-size: 22px;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  padding: 8px 0;
}

.chips,
.seg-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.chip,
.seg,
.small-chip {
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 600;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chip {
  font-size: 12.5px;
  padding: 12px 14px;
  text-align: center;
}

.small-chip,
.seg {
  font-size: 11.5px;
  padding: 9px 13px;
}

.chip.active,
.seg.active,
.small-chip.active {
  color: #191340;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.62));
  border-color: rgba(255, 255, 255, 0.6);
}

.nav-row {
  display: flex;
  gap: 10px;
  margin-top: 2px;
}

.nav-btn,
.primary-btn,
.secondary-btn,
.danger-btn {
  border-radius: 14px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-btn,
.secondary-btn {
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.nav-btn {
  flex: 0 0 auto;
  padding: 15px 22px;
}

.primary-btn {
  flex: 1;
  padding: 15px;
  color: #191340;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.72));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 8px 18px rgba(0, 0, 0, 0.22);
}

.campaign-card {
  background: rgba(178, 150, 255, 0.1);
  border-color: rgba(178, 150, 255, 0.28);
  cursor: pointer;
}

.campaign-name-static {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.campaign-mantra-static {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
  font-weight: 500;
}

.create-row {
  display: flex;
  gap: 10px;
}

.create-btn,
.create-btn-alt,
.action-btn-primary,
.action-btn {
  flex: 1;
  text-align: center;
  padding: 13px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.create-btn,
.action-btn-primary {
  color: #191340;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.72));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 6px 16px rgba(0, 0, 0, 0.2);
}

.create-btn-alt,
.action-btn {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.filter-chip {
  font-size: 11px;
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.filter-chip.active {
  color: #191340;
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.7);
}

.lib-row {
  cursor: pointer;
  gap: 10px;
}

.lib-name {
  font-size: 14.5px;
  font-weight: 500;
}

.lib-name.archived {
  color: var(--text-low);
  text-decoration: line-through;
}

.lib-meta {
  font-size: 10.5px;
  color: var(--text-low);
  margin-top: 2px;
}

.state-chip {
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.state-chip.pinned {
  color: #191340;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.65));
  border-color: rgba(255, 255, 255, 0.6);
}

.state-chip.paused,
.state-chip.archived {
  color: var(--text-low);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.detail-name {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  padding: 4px 0;
  margin-top: 4px;
}

.field-input {
  font-size: 15px;
  color: var(--text-hi);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  padding: 11px 13px;
  width: 100%;
  outline: none;
}

.tone-example {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.82);
  font-style: italic;
  font-weight: 500;
  margin-top: 2px;
}

.danger-btn {
  padding: 15px;
  color: var(--warning);
  background: rgba(220, 120, 120, 0.08);
  border: 1px solid rgba(220, 120, 120, 0.3);
}

.tab-bar {
  display: flex;
  background: rgba(20, 15, 45, 0.5);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  z-index: 1;
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

.tab-bar.hidden {
  display: none;
}

.tab {
  flex: 1;
  text-align: center;
  padding: 15px 0 calc(18px + env(safe-area-inset-bottom));
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-low);
  cursor: pointer;
  font-weight: 700;
  border-top: 2px solid transparent;
  margin-top: -1px;
}

.tab.active {
  color: var(--text-hi);
  border-top-color: rgba(255, 255, 255, 0.85);
}

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 16, 0.66);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10;
  animation: fade 0.2s ease;
}

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 22px calc(28px + env(safe-area-inset-bottom));
  border-top-left-radius: 34px;
  border-top-right-radius: 34px;
  background: linear-gradient(180deg, rgba(70, 60, 124, 0.98), rgba(30, 24, 62, 0.99));
  backdrop-filter: blur(40px) saturate(160%);
  -webkit-backdrop-filter: blur(40px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 0;
  box-shadow: 0 -30px 60px rgba(0, 0, 0, 0.5);
  animation: sheet-up 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  align-self: center;
  margin-bottom: 4px;
}

.sheet-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sheet-sub {
  font-size: 11.5px;
  color: var(--text-mid);
  margin-top: 2px;
}

.reminder-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 11px;
  white-space: nowrap;
}

.state-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 15px;
  border-radius: 13px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.state-opt.active {
  color: #191340;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.7));
  border-color: rgba(255, 255, 255, 0.6);
}

.scale-row {
  display: flex;
  gap: 7px;
}

.scale-btn {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.scale-btn.active {
  color: oklch(0.42 0.14 285);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.62));
  border-color: rgba(255, 255, 255, 0.6);
}

.lock-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 13px 14px;
  border-radius: 14px;
  background: rgba(220, 120, 120, 0.09);
  border: 1px solid rgba(220, 120, 120, 0.32);
}

.mantra-box {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  font-style: italic;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  padding: 13px 15px;
  line-height: 1.35;
}

.auth-card {
  margin: auto 0;
}

.auth-title {
  font-size: 30px;
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.auth-copy {
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.45;
}

.auth-error {
  font-size: 12px;
  color: var(--warning);
  min-height: 18px;
}

.auth-switch {
  color: var(--accent);
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.loading {
  margin: auto;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
}

@keyframes sheet-up {
  from { transform: translateY(103%); }
  to { transform: translateY(0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (min-width: 900px) {
  .tab-bar {
    justify-content: center;
  }

  .tab {
    max-width: 240px;
  }
}
