:root {
  color-scheme: dark;
  --bg: #17302b;
  --ink: #f8f5ed;
  --ink-muted: rgba(248, 245, 237, 0.67);
  --ink-faint: rgba(248, 245, 237, 0.44);
  --glass: rgba(9, 28, 25, 0.62);
  --glass-strong: rgba(8, 24, 21, 0.82);
  --glass-soft: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.1);
  --cream: #f4eee2;
  --coral: #ff9479;
  --lime: #b8df8f;
  --gold: #f1c76f;
  --mint: #93d6c3;
  --lilac: #cdb8e8;
  --danger: #ffb0a1;
  --radius: 8px;
  --shadow: 0 20px 58px rgba(2, 12, 10, 0.25);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family:
    "SF Pro Display",
    "PingFang SC",
    "MiSans",
    "Noto Sans SC",
    "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: -2;
  inset: 0;
  content: "";
  background-image: url("./assets/wallpaper.jpg");
  background-position: 58% 44%;
  background-size: cover;
  filter: saturate(0.78) contrast(1.02);
  transform: scale(1.015);
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(11, 30, 27, 0.22), rgba(7, 21, 19, 0.6)),
    linear-gradient(90deg, rgba(4, 17, 15, 0.32), transparent 48%, rgba(50, 35, 27, 0.16));
  pointer-events: none;
}

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

button {
  color: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 12px;
  color: #13251f;
  background: var(--cream);
  border-radius: var(--radius);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

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

.app-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100dvh;
}

.topbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 20px 28px 10px;
}

.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #18312a;
  background: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(2, 12, 10, 0.2);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.2;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--ink-muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
  background: rgba(6, 22, 19, 0.35);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.icon-button:hover {
  background: rgba(6, 22, 19, 0.55);
  border-color: rgba(255, 255, 255, 0.28);
}

.icon-button:active {
  transform: scale(0.96);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
}

main {
  flex: 1;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 14px 28px calc(126px + var(--safe-bottom));
}

.view {
  animation: view-in 280ms ease both;
}

.view[hidden] {
  display: none;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  min-height: 190px;
  padding: 24px 0 22px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.clock {
  display: block;
  margin: 6px 0 5px;
  color: var(--cream);
  font-size: 78px;
  font-variant-numeric: tabular-nums;
  font-weight: 420;
  letter-spacing: -0.06em;
  line-height: 0.98;
  text-shadow: 0 10px 30px rgba(2, 14, 12, 0.22);
}

.hero-caption {
  margin: 0;
  color: var(--ink-muted);
  font-size: 13px;
}

.score {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding-bottom: 11px;
}

.progress-ring {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  background:
    radial-gradient(circle closest-side, rgba(10, 28, 24, 0.8) 76%, transparent 77% 99%),
    conic-gradient(var(--lime) 0deg, var(--lime) var(--progress, 0deg), rgba(255, 255, 255, 0.18) var(--progress, 0deg));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(2, 13, 11, 0.2);
}

.progress-ring span {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 690;
}

.score p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
  white-space: nowrap;
}

.next-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: 100%;
  margin: 0 0 22px;
  padding: 13px 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.1);
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.next-band:hover {
  background: rgba(9, 30, 26, 0.76);
}

.next-band:active {
  transform: scale(0.995);
}

.next-label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--lime);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.next-label svg,
.next-band > svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.next-band > svg {
  color: var(--ink-muted);
}

.next-copy {
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-section {
  margin-top: 6px;
}

.section-heading {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 12px;
}

.section-heading.compact {
  align-items: center;
  margin: 0 0 18px;
}

.section-heading h1,
.section-heading h2 {
  margin: 2px 0 0;
  color: var(--cream);
  font-size: 23px;
  font-weight: 630;
  letter-spacing: -0.02em;
}

.section-heading h2 {
  font-size: 18px;
}

.quiet-button,
.text-button {
  padding: 0;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: 0;
}

.quiet-button:hover,
.text-button:hover {
  color: var(--ink);
}

.task-groups {
  display: grid;
  gap: 12px;
}

.task-group {
  overflow: hidden;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.08);
}

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.group-name {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.02em;
}

.group-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--group-color, var(--cream));
  background: color-mix(in srgb, var(--group-color, var(--cream)) 16%, transparent);
  border-radius: 6px;
}

.group-icon svg {
  width: 15px;
  height: 15px;
  stroke-width: 2;
}

.group-count {
  color: var(--ink-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.task-list {
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.task-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 43px;
  padding: 3px 14px 3px 13px;
  transition: background 160ms ease;
}

.task-row:hover {
  background: rgba(255, 255, 255, 0.035);
}

.task-row.is-highlighted {
  background: rgba(184, 223, 143, 0.12);
  box-shadow: inset 2px 0 var(--lime);
}

.check-button {
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  color: transparent;
  cursor: pointer;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.check-button svg {
  width: 13px;
  height: 13px;
  stroke-width: 2.8;
}

.check-button:hover {
  border-color: var(--cream);
}

.check-button:active {
  transform: scale(0.88);
}

.task-row.is-done .check-button {
  color: #183029;
  background: var(--lime);
  border-color: var(--lime);
}

.task-copy {
  min-width: 0;
}

.task-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-row.is-done .task-title {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.task-meta {
  display: block;
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 10px;
}

.task-time {
  color: var(--ink-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  padding: 28px 20px;
  color: var(--ink-muted);
  font-size: 13px;
  text-align: center;
}

.quick-add {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  padding: 11px 12px 11px 14px;
  background: rgba(7, 25, 21, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.quick-add > svg {
  width: 17px;
  height: 17px;
  color: var(--ink-muted);
}

.quick-add input {
  min-width: 0;
  padding: 5px 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.quick-add input::placeholder {
  color: var(--ink-faint);
}

.quick-add button {
  display: grid;
  width: 31px;
  height: 31px;
  padding: 0;
  place-items: center;
  color: #183029;
  cursor: pointer;
  background: var(--cream);
  border: 0;
  border-radius: 7px;
}

.quick-add button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.view-intro {
  padding: 32px 0 24px;
}

.view-intro h1 {
  max-width: 540px;
  margin: 5px 0 9px;
  color: var(--cream);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.view-intro > p:last-child {
  max-width: 500px;
  margin: 0;
  color: var(--ink-muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.horizon-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 4px;
  background: rgba(7, 25, 21, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
}

.horizon-tabs button {
  min-height: 36px;
  padding: 0 8px;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.horizon-tabs button:hover {
  color: var(--ink);
}

.horizon-tabs button.is-active {
  color: #183029;
  font-weight: 690;
  background: var(--cream);
}

.plan-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 17px 0 22px;
  border-bottom: 1px solid var(--line);
}

.plan-summary strong {
  color: var(--lime);
  font-size: 28px;
  font-weight: 520;
  letter-spacing: -0.04em;
}

.plan-summary p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.plan-timeline {
  position: relative;
  display: grid;
  gap: 0;
  margin-top: 6px;
}

.plan-item {
  position: relative;
  display: grid;
  grid-template-columns: 78px 18px minmax(0, 1fr);
  gap: 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.plan-period {
  padding-top: 2px;
  color: var(--ink-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}

.timeline-dot {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

.plan-item:not(:last-child) .timeline-dot::after {
  position: absolute;
  top: 12px;
  left: 4px;
  width: 1px;
  height: calc(100% + 75px);
  content: "";
  background: var(--line);
}

.plan-item.is-current .timeline-dot {
  background: var(--lime);
  border-color: var(--lime);
  box-shadow: 0 0 0 5px rgba(184, 223, 143, 0.1);
}

.plan-content h3 {
  margin: 0 0 5px;
  color: var(--cream);
  font-size: 15px;
  font-weight: 620;
  line-height: 1.4;
}

.plan-content p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.current-chip {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  color: #183029;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  vertical-align: 2px;
  background: var(--lime);
  border-radius: 4px;
}

.review-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 4px 0 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.review-stats > div {
  min-width: 0;
  padding: 18px 12px;
  text-align: center;
}

.review-stats > div + div {
  border-left: 1px solid var(--line-soft);
}

.review-stats span {
  display: block;
  color: var(--cream);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
  font-weight: 510;
}

.review-stats small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-panel {
  margin-bottom: 12px;
  padding: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.muted-label,
.autosave-label {
  color: var(--ink-faint);
  font-size: 10px;
}

.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  align-items: end;
  height: 130px;
  padding-top: 6px;
}

.week-day {
  display: grid;
  gap: 7px;
  align-items: end;
  justify-items: center;
  height: 100%;
}

.bar-track {
  position: relative;
  width: 100%;
  max-width: 28px;
  height: 94px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.bar-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 4px;
  background: var(--lime);
  border-radius: 4px;
  transition: height 320ms ease;
}

.week-day.is-today .bar-fill {
  background: var(--coral);
}

.week-day label {
  color: var(--ink-faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.week-day.is-today label {
  color: var(--cream);
}

.reflection-panel textarea {
  display: block;
  width: 100%;
  min-height: 104px;
  padding: 12px 13px;
  resize: vertical;
  color: var(--ink);
  line-height: 1.65;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  outline: 0;
}

.reflection-panel textarea::placeholder {
  color: var(--ink-faint);
}

.reflection-panel textarea:focus {
  border-color: rgba(255, 255, 255, 0.3);
}

.buffer-row {
  display: grid;
  gap: 16px;
}

.buffer-row strong {
  color: var(--gold);
  font-size: 30px;
  font-weight: 520;
  letter-spacing: -0.04em;
}

.buffer-row p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.6;
}

.buffer-meter {
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 3px;
}

.buffer-meter span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
}

.text-button {
  display: block;
  margin: 22px auto 4px;
  padding: 8px;
  color: var(--danger);
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
}

.review-actions .text-button {
  margin: 0;
  text-decoration: none;
}

.danger-text {
  color: rgba(255, 176, 161, 0.72);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 50%;
  bottom: calc(14px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 32px), 540px);
  padding: 6px;
  background: rgba(8, 25, 22, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(1, 10, 8, 0.35);
  backdrop-filter: blur(26px) saturate(1.2);
  transform: translateX(50%);
}

.bottom-nav button {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-height: 49px;
  padding: 6px 4px;
  color: var(--ink-muted);
  font-size: 9px;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 6px;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.bottom-nav button:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.bottom-nav button.is-active {
  color: var(--cream);
  background: rgba(255, 255, 255, 0.1);
}

.bottom-nav svg {
  width: 19px;
  height: 19px;
  stroke-width: 1.85;
}

.exit-lock {
  position: fixed;
  z-index: 80;
  top: max(17px, env(safe-area-inset-top));
  right: 20px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  color: var(--ink-muted);
  cursor: pointer;
  background: rgba(7, 20, 18, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

.exit-lock svg {
  width: 16px;
  height: 16px;
}

body.lock-mode .topbar,
body.lock-mode .bottom-nav,
body.lock-mode .quick-add {
  display: none;
}

body.lock-mode main {
  width: min(100%, 640px);
  padding: max(26px, env(safe-area-inset-top)) 26px calc(28px + var(--safe-bottom));
}

body.lock-mode .hero {
  min-height: 260px;
  align-items: center;
}

body.lock-mode .clock {
  font-size: 92px;
}

body.lock-mode .task-group,
body.lock-mode .next-band {
  background: rgba(7, 23, 20, 0.56);
}

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  align-items: end;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 10, 0.6);
  backdrop-filter: blur(6px);
}

.modal-sheet {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100dvh - 30px);
  margin: 0 auto;
  padding: 10px 20px calc(22px + var(--safe-bottom));
  overflow-y: auto;
  background: #f2ede3;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 -20px 70px rgba(2, 12, 10, 0.36);
  animation: sheet-in 220ms ease both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-handle {
  width: 35px;
  height: 4px;
  margin: 0 auto 16px;
  background: rgba(23, 48, 43, 0.18);
  border-radius: 2px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 19px;
}

.modal-header .section-kicker {
  color: rgba(23, 48, 43, 0.52);
}

.modal-header h2 {
  margin: 3px 0 0;
  color: #17302b;
  font-size: 24px;
  font-weight: 620;
  letter-spacing: -0.03em;
}

.modal-header .icon-button {
  color: #17302b;
  background: rgba(23, 48, 43, 0.06);
  border-color: rgba(23, 48, 43, 0.13);
  backdrop-filter: none;
}

.modal-header .icon-button:hover {
  background: rgba(23, 48, 43, 0.1);
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span {
  color: rgba(23, 48, 43, 0.65);
  font-size: 11px;
  font-weight: 650;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: #17302b;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(23, 48, 43, 0.14);
  border-radius: 6px;
  outline: 0;
}

.field input:focus,
.field select:focus {
  border-color: rgba(23, 48, 43, 0.5);
}

.field-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: 12px;
}

.primary-button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 45px;
  margin-top: 5px;
  color: var(--cream);
  font-weight: 640;
  cursor: pointer;
  background: #17302b;
  border: 0;
  border-radius: 6px;
}

.primary-button:hover {
  background: #20443b;
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.toast {
  position: fixed;
  z-index: 120;
  bottom: calc(88px + var(--safe-bottom));
  left: 50%;
  max-width: min(calc(100% - 36px), 430px);
  padding: 10px 14px;
  color: var(--cream);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  background: rgba(6, 22, 19, 0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 30px rgba(2, 12, 10, 0.28);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.toast[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .topbar {
    padding: 17px 18px 7px;
  }

  .brand-copy small {
    display: none;
  }

  main {
    padding: 9px 17px calc(112px + var(--safe-bottom));
  }

  .hero {
    min-height: 164px;
    padding: 19px 0 18px;
  }

  .clock {
    font-size: 65px;
  }

  .progress-ring {
    width: 66px;
    height: 66px;
  }

  .progress-ring span {
    font-size: 13px;
  }

  .score p {
    font-size: 10px;
  }

  .next-band {
    gap: 10px;
    padding: 12px 13px;
  }

  .next-label {
    font-size: 10px;
  }

  .next-copy {
    font-size: 13px;
  }

  .section-heading h1 {
    font-size: 21px;
  }

  .view-intro {
    padding: 22px 0 19px;
  }

  .view-intro h1 {
    font-size: 32px;
  }

  .horizon-tabs {
    gap: 2px;
  }

  .horizon-tabs button {
    padding: 0 3px;
    font-size: 11px;
  }

  .plan-item {
    grid-template-columns: 58px 14px minmax(0, 1fr);
    gap: 9px;
    padding: 16px 0;
  }

  .plan-summary {
    gap: 11px;
  }

  .plan-summary strong {
    font-size: 24px;
  }

  .review-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .review-stats > div:nth-child(3) {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .review-stats > div:nth-child(4) {
    border-top: 1px solid var(--line-soft);
  }

  .review-panel {
    padding: 16px;
  }

  .week-chart {
    gap: 7px;
  }

  body.lock-mode main {
    padding: max(22px, env(safe-area-inset-top)) 18px 20px;
  }

  body.lock-mode .hero {
    min-height: 220px;
  }

  body.lock-mode .clock {
    font-size: 76px;
  }
}

@media (max-width: 390px) {
  .hero {
    gap: 12px;
  }

  .clock {
    font-size: 58px;
  }

  .progress-ring {
    width: 60px;
    height: 60px;
  }

  .task-title {
    font-size: 13px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
