:root,
:root[data-theme="harbor"] {
  color-scheme: light;
  --bg: #f2f7f6;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --ink: #17201d;
  --muted: #65736d;
  --line: rgba(23, 32, 29, 0.1);
  --line-strong: rgba(23, 32, 29, 0.18);
  --blue: #0a84ff;
  --green: #2dbf7f;
  --orange: #ff9f45;
  --red: #ff5a52;
  --teal: #2bb8a8;
  --indigo: #5865d9;
  --purple: #9b5de5;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.12);
  --accent-glow: rgba(10, 132, 255, 0.24);
  --surface-tint: rgba(43, 184, 168, 0.08);
  --header-bg: rgba(242, 247, 246, 0.8);
  --body-wash: rgba(247, 252, 251, 0.82);
  --body-glow: rgba(43, 184, 168, 0.13);
  --hero-a: #12201f;
  --hero-b: #17465b;
  --hero-c: rgba(255, 138, 101, 0.34);
  --shadow: 0 18px 50px rgba(27, 44, 42, 0.12);
  --radius: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

:root[data-theme="orchard"] {
  --bg: #f5f8f1;
  --ink: #1d241c;
  --muted: #687064;
  --line: rgba(29, 36, 28, 0.11);
  --line-strong: rgba(29, 36, 28, 0.2);
  --blue: #2f8f5b;
  --green: #3fa46c;
  --orange: #caa33a;
  --red: #d95f76;
  --teal: #4aa89a;
  --indigo: #6173aa;
  --purple: #9b6aa8;
  --accent: #2f8f5b;
  --accent-soft: rgba(47, 143, 91, 0.13);
  --accent-glow: rgba(47, 143, 91, 0.24);
  --surface-tint: rgba(183, 201, 93, 0.09);
  --header-bg: rgba(245, 248, 241, 0.8);
  --body-wash: rgba(251, 253, 248, 0.82);
  --body-glow: rgba(183, 201, 93, 0.16);
  --hero-a: #1f2b20;
  --hero-b: #3d704b;
  --hero-c: rgba(217, 95, 118, 0.32);
  --shadow: 0 18px 50px rgba(37, 52, 35, 0.12);
}

:root[data-theme="sunrise"] {
  --bg: #fff8ef;
  --ink: #25201a;
  --muted: #766c60;
  --line: rgba(37, 32, 26, 0.11);
  --line-strong: rgba(37, 32, 26, 0.2);
  --blue: #3aa8d8;
  --green: #41a56d;
  --orange: #f59f00;
  --red: #ef6351;
  --teal: #2ab7a9;
  --indigo: #5d78d5;
  --purple: #a263c8;
  --accent: #e68a00;
  --accent-soft: rgba(245, 159, 0, 0.14);
  --accent-glow: rgba(245, 159, 0, 0.24);
  --surface-tint: rgba(58, 168, 216, 0.08);
  --header-bg: rgba(255, 248, 239, 0.82);
  --body-wash: rgba(255, 252, 246, 0.84);
  --body-glow: rgba(58, 168, 216, 0.14);
  --hero-a: #2d2519;
  --hero-b: #8b4e26;
  --hero-c: rgba(58, 168, 216, 0.32);
  --shadow: 0 18px 50px rgba(94, 67, 38, 0.12);
}

:root[data-theme="slate"] {
  --bg: #f3f6f8;
  --ink: #17202a;
  --muted: #64717d;
  --line: rgba(23, 32, 42, 0.11);
  --line-strong: rgba(23, 32, 42, 0.2);
  --blue: #2f80ed;
  --green: #33b686;
  --orange: #e5a03d;
  --red: #e85d5d;
  --teal: #5cc8a7;
  --indigo: #4f6f8f;
  --purple: #8d6ccf;
  --accent: #2f80ed;
  --accent-soft: rgba(47, 128, 237, 0.12);
  --accent-glow: rgba(47, 128, 237, 0.22);
  --surface-tint: rgba(92, 200, 167, 0.08);
  --header-bg: rgba(243, 246, 248, 0.82);
  --body-wash: rgba(250, 252, 253, 0.84);
  --body-glow: rgba(92, 200, 167, 0.13);
  --hero-a: #152331;
  --hero-b: #31526d;
  --hero-c: rgba(92, 200, 167, 0.3);
  --shadow: 0 18px 50px rgba(35, 48, 62, 0.12);
}

:root[data-theme="plum"] {
  --bg: #f8f4fa;
  --ink: #241d28;
  --muted: #736878;
  --line: rgba(36, 29, 40, 0.11);
  --line-strong: rgba(36, 29, 40, 0.2);
  --blue: #22a6b3;
  --green: #4caf7a;
  --orange: #f4a261;
  --red: #e76f51;
  --teal: #20b2aa;
  --indigo: #6c63d7;
  --purple: #8f5fbf;
  --accent: #8f5fbf;
  --accent-soft: rgba(143, 95, 191, 0.13);
  --accent-glow: rgba(143, 95, 191, 0.22);
  --surface-tint: rgba(34, 166, 179, 0.08);
  --header-bg: rgba(248, 244, 250, 0.82);
  --body-wash: rgba(253, 250, 255, 0.84);
  --body-glow: rgba(34, 166, 179, 0.14);
  --hero-a: #281a30;
  --hero-b: #553a70;
  --hero-c: rgba(244, 162, 97, 0.34);
  --shadow: 0 18px 50px rgba(57, 40, 68, 0.12);
}

:root[data-theme="paper"] {
  --bg: #f7f7f2;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: rgba(31, 41, 55, 0.11);
  --line-strong: rgba(31, 41, 55, 0.2);
  --blue: #3b82f6;
  --green: #6a994e;
  --orange: #d99b32;
  --red: #bc4749;
  --teal: #2f9c95;
  --indigo: #5661b3;
  --purple: #8f61a8;
  --accent: #1f2937;
  --accent-soft: rgba(106, 153, 78, 0.14);
  --accent-glow: rgba(106, 153, 78, 0.22);
  --surface-tint: rgba(106, 153, 78, 0.08);
  --header-bg: rgba(247, 247, 242, 0.82);
  --body-wash: rgba(253, 253, 249, 0.82);
  --body-glow: rgba(106, 153, 78, 0.12);
  --hero-a: #1f2937;
  --hero-b: #374151;
  --hero-c: rgba(188, 71, 73, 0.26);
  --shadow: 0 18px 50px rgba(31, 41, 55, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 12px),
    radial-gradient(circle at 92% 0%, var(--body-glow), transparent 34%),
    linear-gradient(180deg, var(--body-wash), var(--bg) 46%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  border: 0;
}

.app-shell {
  min-height: 100svh;
}

.phone-frame {
  width: min(100%, 520px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 0 14px calc(92px + var(--safe-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 0 10px;
  background: var(--header-bg);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: 0 14px 32px rgba(17, 17, 17, 0.045);
}

.title-row,
.section-head,
.metric-row,
.inline-row,
.toolbar,
.goal-top,
.block-row,
.score-row,
.tabbar,
.modal-head {
  display: flex;
  align-items: center;
}

.title-row,
.section-head,
.metric-row,
.goal-top,
.block-row,
.score-row,
.modal-head {
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.06;
  letter-spacing: 0;
}

h2 {
  font-size: 21px;
  line-height: 1.2;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  line-height: 1.35;
}

.tiny {
  font-size: 11px;
  color: var(--muted);
}

.toolbar {
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.primary-button,
.plain-button,
.danger-button {
  min-height: 42px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-button:active,
.primary-button:active,
.plain-button:active,
.danger-button:active,
.chip:active,
.tab:active {
  transform: scale(0.98);
}

.icon-button {
  width: 42px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 20px rgba(17, 17, 17, 0.06);
}

.icon-button svg,
.tab svg,
.empty-icon svg,
.field-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.primary-button,
.plain-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, white), var(--accent));
  color: white;
  box-shadow: 0 12px 24px var(--accent-glow);
}

.plain-button {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.68));
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 8px 18px rgba(17, 17, 17, 0.05);
}

.danger-button {
  color: var(--red);
  background: rgba(255, 59, 48, 0.09);
  border: 1px solid rgba(255, 59, 48, 0.18);
}

.view {
  display: none;
  animation: settle 220ms ease both;
}

.view.active {
  display: block;
}

@keyframes settle {
  from {
    transform: translateY(6px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.stack {
  display: grid;
  gap: 12px;
}

.section {
  padding-top: 8px;
}

.section-head {
  margin: 18px 2px 10px;
}

.card,
.metric-card,
.goal-card,
.review-card,
.form-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    linear-gradient(135deg, var(--surface-tint), transparent 64%),
    var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 16px 38px rgba(27, 31, 35, 0.08),
    0 2px 8px rgba(27, 31, 35, 0.045);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
}

.card,
.goal-card,
.review-card,
.form-card {
  padding: 14px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 178px;
  padding: 18px;
  color: white;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.13), transparent 34%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 12px),
    radial-gradient(circle at 78% 8%, var(--hero-c), transparent 30%),
    linear-gradient(135deg, var(--hero-a), var(--hero-b)),
    var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -42px 80px rgba(0, 0, 0, 0.16),
    0 22px 44px rgba(22, 36, 40, 0.22);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -58px;
  width: 190px;
  height: 190px;
  border: 34px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 42%, rgba(255, 255, 255, 0.07));
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
}

.score-ring {
  width: 104px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    conic-gradient(var(--green) calc(var(--score) * 1%), rgba(255, 255, 255, 0.18) 0);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 16px 34px rgba(0, 0, 0, 0.22);
}

.score-ring-inner {
  width: 76px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hero-a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.score-ring strong {
  font-size: 24px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hero-stat {
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-stat span,
.metric-card span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 13px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.76)),
    var(--surface-strong);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 10px 10px auto;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  opacity: 0.62;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.07);
  box-shadow: inset 0 1px 2px rgba(17, 17, 17, 0.08);
}

.progress-fill {
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--fill, var(--blue)), color-mix(in srgb, var(--fill, var(--blue)) 62%, white));
  box-shadow: 0 0 18px color-mix(in srgb, var(--fill, var(--blue)) 38%, transparent);
}

.week-strip,
.chips,
.days-row,
.color-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 1px 6px;
  scrollbar-width: none;
}

.week-strip::-webkit-scrollbar,
.chips::-webkit-scrollbar,
.days-row::-webkit-scrollbar,
.color-row::-webkit-scrollbar {
  display: none;
}

.chip,
.week-chip,
.day-chip,
.color-chip {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.chip,
.week-chip {
  padding: 0 12px;
}

.week-chip.active,
.chip.active,
.day-chip.active {
  color: white;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white), var(--accent));
  border-color: var(--accent);
  box-shadow: 0 8px 18px var(--accent-glow);
}

.week-chip.done {
  border-color: rgba(52, 199, 89, 0.42);
}

.day-chip {
  width: 42px;
}

.color-chip {
  width: 34px;
  border-color: rgba(17, 17, 17, 0.16);
}

.color-chip.active {
  outline: 3px solid var(--accent-soft);
  border-color: var(--ink);
}

.task-list,
.goal-list,
.block-list,
.review-list {
  display: grid;
  gap: 10px;
}

.task {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.78)),
    var(--surface-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(17, 17, 17, 0.055);
}

.task::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--task-color, var(--accent)), color-mix(in srgb, var(--task-color, var(--accent)) 45%, white));
  opacity: 0.92;
}

.check {
  width: 30px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  border: 1.5px solid var(--line-strong);
  background: white;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 12px rgba(17, 17, 17, 0.08);
}

.check.checked {
  color: white;
  border-color: var(--green);
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 72%, white), var(--green));
  box-shadow: 0 8px 18px rgba(52, 199, 89, 0.24);
}

.task-title {
  font-weight: 750;
  line-height: 1.25;
}

.task-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.task-days {
  grid-column: 2 / -1;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-day {
  min-width: 32px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.mini-day.done {
  color: white;
  border-color: var(--green);
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 72%, white), var(--green));
}

.goal-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 12px;
}

.goal-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--goal-color, var(--accent)), transparent);
}

.goal-top {
  align-items: flex-start;
}

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

.swatch {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 4px 12px color-mix(in srgb, var(--swatch) 34%, transparent);
}

.goal-name h3 {
  overflow-wrap: anywhere;
}

.goal-measures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.measure {
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(17, 17, 17, 0.045);
}

.measure span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-grid {
  display: grid;
  gap: 10px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  outline: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 1px 2px rgba(17, 17, 17, 0.035);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.4;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--accent) 58%, white);
  box-shadow:
    inset 0 1px 2px rgba(17, 17, 17, 0.035),
    0 0 0 4px var(--accent-soft);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius);
  background: rgba(17, 17, 17, 0.065);
  box-shadow: inset 0 1px 2px rgba(17, 17, 17, 0.08);
}

.segment {
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.segment.active {
  color: var(--ink);
  background: white;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 4px 10px rgba(17, 17, 17, 0.09);
}

.score-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(18px, 1fr));
  gap: 7px;
  align-items: end;
  height: 154px;
  padding: 12px 4px 2px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08)),
    repeating-linear-gradient(0deg, transparent 0 30px, rgba(17, 17, 17, 0.04) 30px 31px);
}

.score-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
}

.bar-fill {
  width: 100%;
  min-height: 4px;
  height: var(--height);
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bar-color) 68%, white), var(--bar-color));
  box-shadow: 0 0 14px color-mix(in srgb, var(--bar-color) 28%, transparent);
}

.score-bar span {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.review-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 10px;
}

.review-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--teal), transparent);
}

.review-grid {
  display: grid;
  gap: 8px;
}

.prompt-field textarea {
  min-height: 72px;
}

.block-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.78)),
    var(--surface-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 10px 22px rgba(17, 17, 17, 0.055);
}

.block-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--block-color), color-mix(in srgb, var(--block-color) 42%, white));
}

.block-type {
  display: inline-flex;
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(180deg, color-mix(in srgb, var(--block-color) 76%, white), var(--block-color));
  box-shadow: 0 8px 16px color-mix(in srgb, var(--block-color) 24%, transparent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.42)),
    var(--surface-tint);
  text-align: center;
}

.empty-icon {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 10px 22px var(--accent-glow);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100%, 520px);
  transform: translateX(-50%);
  justify-content: space-around;
  gap: 4px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 250, 248, 0.82));
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: 0 -14px 34px rgba(17, 17, 17, 0.08);
}

.tab {
  min-width: 0;
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 7px 3px 5px;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.tab.active {
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), var(--accent-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.theme-grid {
  display: grid;
  gap: 8px;
}

.theme-option {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto 1fr 28px;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.7));
  text-align: left;
  cursor: pointer;
}

.theme-option.active {
  border-color: color-mix(in srgb, var(--accent) 58%, white);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.8), var(--accent-soft));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 24px rgba(17, 17, 17, 0.06);
}

.theme-swatches {
  display: flex;
  align-items: center;
  isolation: isolate;
}

.theme-swatches span {
  width: 24px;
  height: 24px;
  margin-left: -7px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.1);
}

.theme-swatches span:first-child {
  margin-left: 0;
}

.theme-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.theme-copy strong,
.theme-copy span {
  overflow-wrap: anywhere;
}

.theme-copy strong {
  font-size: 14px;
}

.theme-copy span {
  color: var(--muted);
  font-size: 12px;
}

.theme-check {
  width: 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
}

.theme-check:empty {
  background: transparent;
}

.theme-check svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(17, 17, 17, 0.12), rgba(17, 17, 17, 0.34));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 520px);
  max-height: 88svh;
  margin: 0 auto;
  overflow: auto;
  padding: 14px 14px calc(18px + var(--safe-bottom));
  border-radius: 18px 18px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), transparent 28%),
    var(--bg);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 -22px 54px rgba(17, 17, 17, 0.18);
}

.hidden {
  display: none !important;
}

.boot-card {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--muted);
}

.boot-mark {
  width: 46px;
  aspect-ratio: 1;
  border-radius: 12px;
  background: conic-gradient(from 180deg, var(--blue), var(--green), var(--orange), var(--blue));
}

@media (min-width: 760px) {
  body {
    background:
      radial-gradient(circle at 24% 10%, var(--body-glow), transparent 32%),
      radial-gradient(circle at 92% 0%, var(--body-glow), transparent 34%),
      linear-gradient(180deg, var(--body-wash), var(--bg) 46%),
      var(--bg);
  }

  .phone-frame {
    padding-top: 8px;
  }
}

@media (max-width: 360px) {
  .phone-frame {
    padding-inline: 10px;
  }

  h1 {
    font-size: 28px;
  }

  .hero-grid,
  .two-col,
  .goal-measures {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 96px;
  }
}
