:root {
  --ink: #e8eaed;
  --muted: #9ca3af;
  --page: #050505;
  --panel: #0d0d0d;
  --line: #292929;
  --accent: #4cff58;
  --cell0: #161b22;
  --cell1: #0e4429;
  --cell2: #007a32;
  --cell3: #21c345;
  --cell4: #4cff58;
  --missed: #ff2f2f;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(ellipse at 50% -25%, #182618 0, transparent 42rem), var(--page); font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 1060px; margin: auto; padding: 24px; }
.topbar { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 20px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #05220c; background: var(--accent); }
.date-label { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; }
.sync-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 12px 14px; border: 1px solid #ffffff12; border-radius: 12px; background: #ffffff05; }
.sync-bar .eyebrow { margin-bottom: 3px; }
#syncStatus { margin: 0; color: var(--muted); font-size: 12px; }
#syncStatus[data-state="success"] { color: var(--accent); }
#syncStatus[data-state="warning"] { color: #ffbf4c; }
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-button, .year-controls button, .task-menu { border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #ffffff08; padding: 7px 10px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 72px 0 40px; }
.eyebrow { margin: 0 0 8px; color: #73dd82; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 72px); line-height: .98; letter-spacing: -3px; }
.hero em { color: #87ed96; font-family: Georgia, serif; font-weight: 400; }
.hero-copy { max-width: 515px; color: var(--muted); font-size: 17px; }
.daily-score { min-width: 140px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff06; }
.daily-score span, .daily-score small, .stats span, .stats small { display: block; color: var(--muted); font-size: 12px; }
.daily-score strong { display: block; margin: 3px 0; font-size: 30px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stats article, .workspace { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 16px 40px #0000003a; }
.stats article { padding: 17px; }
.stats strong { display: block; margin: 4px 0; font-size: 22px; }
.workspace { margin-top: 24px; padding: 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 22px; }
.year-controls { display: flex; gap: 7px; }
.year-controls button:hover, .icon-button:hover, .task-menu:hover { border-color: var(--accent); }
.calendar-help { margin: 20px 0 15px; color: var(--muted); font-size: 12px; }
.activity-wrap { overflow-x: auto; padding: 6px 2px 12px; }
.activity-calendar { display: grid; grid-template-columns: 33px repeat(var(--activity-weeks, 53), 14px); grid-template-rows: 22px repeat(7, 14px); gap: 4px; min-width: var(--activity-width, 1004px); align-items: center; }
.month-label { grid-row: 1; color: #c6cbd1; font-size: 11px; cursor: pointer; text-decoration: none; }
.month-label:hover { color: var(--accent); text-decoration: underline; }
.weekday-label { color: #b9bec5; font-size: 10px; text-align: right; padding-right: 2px; }
.activity-day { display: grid; width: 14px; height: 14px; place-items: center; border: 0; border-radius: 2px; color: #aeb7b1; background: var(--cell0); font: inherit; font-size: 7px; font-weight: 700; line-height: 1; transition: transform .12s, outline-color .12s; }
.activity-day.outside-range { background: transparent; }
.activity-day:hover { outline: 1px solid #d5ffe0; outline-offset: 2px; transform: scale(1.18); }
.activity-day.level-1 { background: var(--cell1); }
.activity-day.level-2 { background: var(--cell2); }
.activity-day.level-3 { background: var(--cell3); color: #012a0b; }
.activity-day.level-4 { color: #022508; background: var(--cell4); box-shadow: 0 0 8px #4cff5890; }
.activity-day.level-missed { color: #2a0000; background: var(--missed); box-shadow: 0 0 7px #ff2f2f80; }
.activity-day.today { outline: 1px solid #d5ffe0; outline-offset: 1px; }
.activity-day.selected { outline: 2px solid #ffffff; outline-offset: 2px; transform: scale(1.12); }
.activity-day span { display: block; transform: scale(.82); }
.task-workspace { padding-bottom: 20px; }
.task-list { display: grid; gap: 9px; margin-top: 18px; }
.task-row { display: flex; align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #ffffff04; }
.task-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 8px; background: #ffffff0b; }
.task-content { min-width: 0; flex: 1; }
.task-content strong, .task-content small { display: block; }
.task-content small { color: var(--muted); font-size: 11px; }
.today-check { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--muted); background: transparent; }
.today-check.done { border-color: #258636; color: #04210b; background: var(--accent); font-weight: 800; }
.habit-actions { display: flex; gap: 10px; margin-top: 16px; }
.primary-button, .quiet-button { border: 0; border-radius: 9px; padding: 9px 13px; font-weight: 750; }
.primary-button { color: #04210b; background: var(--accent); }
.quiet-button { color: var(--muted); background: #ffffff08; }
dialog { width: min(420px, calc(100vw - 30px)); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #111; box-shadow: 0 20px 80px #000; }
dialog::backdrop { background: #000b; }
dialog form { display: grid; gap: 9px; padding: 15px; }
dialog h2 { margin: 0 0 10px; }
.sync-dialog-copy { margin: -3px 0 7px; color: var(--muted); font-size: 12px; }
dialog label { color: var(--muted); font-size: 13px; }
dialog input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); background: #070707; }
.color-palette { display: flex; gap: 9px; margin: 3px 0 2px; padding: 0; border: 0; }
.color-palette legend { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.color-palette label { display: grid; cursor: pointer; }
.color-palette .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.color-palette input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-palette i { display: block; width: 24px; height: 24px; border: 2px solid transparent; border-radius: 999px; background: var(--swatch); box-shadow: 0 0 0 1px #ffffff23, 0 0 5px var(--swatch); filter: saturate(1.18) brightness(.92); }
.color-palette input:checked + i { border-color: #ffffff; box-shadow: 0 0 0 3px var(--swatch), 0 0 9px var(--swatch); }
.color-palette input:focus-visible + i { outline: 2px solid #ffffff; outline-offset: 3px; }
.color-palette .custom-color-radio { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-palette #goalCustomColor { position: relative; width: 26px; height: 26px; padding: 0; border: 2px solid #ffffff52; border-radius: 999px; opacity: 1; background: transparent; cursor: pointer; }
.color-palette #goalCustomColor:hover, .color-palette #goalCustomColor:focus-visible { border-color: #ffffff; box-shadow: 0 0 8px #ffffff75; }
.color-intensity { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; color: var(--muted); font-size: 12px; }
.color-intensity output { color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.color-intensity input { grid-column: 1 / -1; padding: 0; accent-color: var(--accent); }
.dialog-close { position: absolute; top: 9px; right: 12px; border: 0; color: var(--muted); background: transparent; font-size: 23px; }
body.light { --ink: #1c201e; --muted: #657268; --page: #f6f7f5; --panel: #fff; --line: #d8ded8; --cell0: #ebedf0; background: radial-gradient(ellipse at 50% -25%, #ddf4df 0, transparent 42rem), var(--page); }
@media (max-width: 650px) { .app-shell { padding: 14px; } .date-label { display: none; } .sync-bar { align-items: start; flex-direction: column; } .sync-actions { width: 100%; } .sync-actions button { flex: 1; } .hero { align-items: start; flex-direction: column; padding: 55px 0 32px; } .daily-score { width: 100%; } .stats { grid-template-columns: 1fr; } .workspace { padding: 16px; } .section-heading { align-items: start; flex-direction: column; } .year-controls { width: 100%; } .year-controls button { flex: 1; min-height: 44px; } .activity-wrap { margin: 0 -8px; padding: 8px 8px 14px; overscroll-behavior-x: contain; scroll-snap-type: x proximity; } .activity-calendar { grid-template-columns: 28px repeat(var(--activity-weeks, 53), 20px); grid-template-rows: 24px repeat(7, 20px); gap: 4px; min-width: var(--activity-mobile-width, 880px); } .activity-day { width: 20px; height: 20px; font-size: 7px; } .month-label { font-size: 10px; } .weekday-label { font-size: 9px; } }

.goal-dashboard { margin: 32px 0 24px; overflow: hidden; border: 1px solid #315436; border-radius: 18px; background: linear-gradient(145deg, #121c14 0%, #0c110d 46%, #080a08 100%); box-shadow: 0 18px 45px #00000052; }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 18px 22px 16px; border-bottom: 1px solid #ffffff13; }
.dashboard-header h1 { margin: 0; color: #f2f7f2; font-size: clamp(23px, 4vw, 32px); letter-spacing: -1.2px; }
.details-link { display: inline-flex; align-items: center; gap: 8px; color: #b8f8c0; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.details-link:hover { color: var(--accent); }
.details-link span { font-size: 18px; line-height: 1; }
.dashboard-toolbar { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(400px, 1.2fr); gap: 20px; padding: 15px 22px; border-bottom: 1px solid #ffffff13; }
.goal-title { min-width: 0; }
.goal-title label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.goal-title select { width: 100%; border: 0; padding: 0; color: var(--ink); background: transparent; font-size: 22px; font-weight: 750; outline: none; }
.goal-title p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.goal-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.goal-stat { display: grid; align-content: center; min-height: 68px; padding: 10px 13px; border: 1px solid #ffffff10; border-radius: 12px; background: #ffffff05; }
.goal-stat strong { color: #e7ffe9; font-size: 25px; font-weight: 800; line-height: 1.1; }
.goal-stat span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.goal-stat small { margin-top: 5px; color: var(--health, var(--accent)); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; letter-spacing: .02em; }
.goal-chart-panel { padding: 16px 22px; }
.chart-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.chart-heading h2 { margin: 0; color: #f2f7f2; font-size: 18px; }
.chart-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.chart-range { color: #d3d9d4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; white-space: nowrap; }
.chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; align-items: start; }
.goal-graph { min-width: 0; margin: 0; padding-bottom: 3px; }
.goal-graph svg { display: block; width: 100%; min-width: 0; height: auto; overflow: visible; }
.goal-checklist { display: grid; gap: 7px; min-width: 0; padding-left: 18px; border-left: 1px solid #ffffff13; }
.checklist-heading { margin-bottom: 3px; }
.checklist-heading .eyebrow { margin-bottom: 3px; font-size: 9px; }
.checklist-heading h3 { margin: 0; color: #eef5ef; font-size: 14px; }
.checklist-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 7px; align-items: center; width: 100%; border: 1px solid #ffffff12; border-radius: 9px; padding: 8px; color: var(--ink); background: #ffffff04; text-align: left; }
.checklist-item:hover:not(:disabled) { border-color: var(--goal-color); background: #ffffff09; }
.checklist-item:disabled { cursor: default; opacity: .45; }
.checklist-item.done { border-color: color-mix(in srgb, var(--goal-color) 58%, transparent); background: color-mix(in srgb, var(--goal-color) 10%, transparent); }
.checklist-mark { display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--goal-color); border-radius: 6px; color: #041005; background: transparent; font-size: 13px; font-weight: 900; }
.checklist-item.done .checklist-mark { background: var(--goal-color); }
.checklist-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 700; }
.checklist-item small { grid-column: 2; margin-top: -4px; color: var(--muted); font-size: 10px; }
.graph-open { display: block; color: inherit; }
.graph-open:hover { filter: brightness(1.14); }
.graph-frame { fill: #05070580; stroke: #ffffff20; stroke-width: 1; }
.graph-grid { fill: none; stroke: #ffffff14; stroke-width: 1; stroke-dasharray: 3 5; }
.graph-axis-line, .graph-tick { stroke: #ffffff36; stroke-width: 1; }
.graph-axis { fill: #98a19a; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.graph-axis-title { fill: #aeb7af; font: 11px Inter, ui-sans-serif, system-ui, sans-serif; font-weight: 700; letter-spacing: .04em; }
.graph-plan { fill: none; stroke: #bac2c9; stroke-width: 1.15; stroke-dasharray: 5 5; opacity: .78; }
.graph-goal { fill: none; stroke: var(--series); stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; filter: saturate(1.2) brightness(1.12) drop-shadow(0 0 3px var(--series)); }
.graph-point { fill: var(--series); stroke: #061008; stroke-width: .7; }
.graph-controls { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 9px; padding-top: 9px; border-top: 1px solid #ffffff12; }
.series-toggle { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #ffffff12; border-radius: 999px; padding: 5px 9px; color: #d1d8d2; background: #ffffff05; font-size: 11px; }
.series-toggle:hover { border-color: var(--series); }
.series-toggle i { width: 16px; height: 3px; border-radius: 5px; background: var(--series); box-shadow: 0 0 5px var(--series); }
.series-toggle small { color: inherit; font-size: 9px; opacity: .65; }
.plan-key { color: #c3cbd0; font-size: 11px; }
.plan-key::before { display: inline-block; width: 16px; height: 2px; margin-right: 6px; content: ""; vertical-align: middle; background: repeating-linear-gradient(90deg, #bac2c9 0 4px, transparent 4px 7px); }
.series-toggle[aria-pressed="false"] { color: #667068; text-decoration: line-through; }
.series-toggle[aria-pressed="false"] i { opacity: .25; }
.goal-progress { height: 5px; background: #ffffff0b; }
.goal-progress span { display: block; height: 100%; min-width: 2px; background: var(--accent); box-shadow: 0 0 10px #4cff58b0; transition: width .2s ease; }
.goal-empty { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 23px; }
.goal-empty h1 { margin: 0; font-size: 24px; }
.level-inactive { background: var(--missed) !important; box-shadow: 0 0 8px #ff2f2f85; }
.activity-day.level-inactive { color: #3a0000; }
.task-title { display: flex; min-width: 0; flex: 1; align-items: center; gap: 11px; border: 0; padding: 0; color: inherit; background: transparent; text-align: left; }
.task-icon { position: relative; }
.task-icon::after { position: absolute; right: 3px; bottom: 3px; width: 5px; height: 5px; border-radius: 999px; content: ""; background: var(--goal-color, var(--accent)); box-shadow: 0 0 6px var(--goal-color, var(--accent)); }
.task-title:hover strong { color: var(--accent); }
.today-check:disabled { cursor: default; opacity: .45; }
.today-check.missed { border-color: #ff3b42; color: #450003; background: var(--missed); font-weight: 800; }
.date-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-fields label { display: grid; gap: 5px; }
.check-option { display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; }
.check-option input { width: auto; accent-color: var(--accent); }
.reminder-fields { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: 10px; }
.reminder-fields > label:last-child { display: grid; gap: 5px; }
.reminder-popup { position: fixed; right: 20px; bottom: 20px; z-index: 20; display: flex; align-items: start; justify-content: space-between; gap: 20px; width: min(360px, calc(100vw - 40px)); padding: 16px; border: 1px solid var(--accent); border-radius: 12px; color: var(--ink); background: #101710; box-shadow: 0 14px 40px #00000080, 0 0 18px #4cff5860; }
.reminder-popup p, .reminder-popup strong, .reminder-popup span { display: block; }
.reminder-popup p { margin: 0 0 3px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .11em; }
.reminder-popup span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.reminder-popup button { border: 0; color: var(--muted); background: transparent; font-size: 22px; line-height: 1; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.dialog-actions .primary-button { margin-left: auto; }
.danger-button { color: #ff9b9b; }
.empty-tasks { margin: 18px 0 0; color: var(--muted); }
@media (max-width: 780px) { .dashboard-header, .chart-heading { align-items: start; flex-direction: column; } .dashboard-toolbar { grid-template-columns: 1fr; gap: 18px; } .goal-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); } .chart-layout { grid-template-columns: 1fr; } .goal-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 12px; padding-left: 0; border-top: 1px solid #ffffff13; border-left: 0; } .checklist-heading { grid-column: 1 / -1; } .goal-chart-panel, .dashboard-toolbar, .dashboard-header { padding-right: 18px; padding-left: 18px; } .reminder-fields { grid-template-columns: 1fr; } }

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

@media (max-width: 480px) {
  .brand { font-size: 18px; }
  .icon-button, .primary-button, .quiet-button, .today-check, .task-menu { min-height: 44px; }
  .goal-dashboard { margin-top: 22px; border-radius: 14px; }
  .dashboard-header, .dashboard-toolbar, .goal-chart-panel { padding-right: 14px; padding-left: 14px; }
  .dashboard-header h1 { font-size: 25px; }
  .goal-summary { gap: 6px; }
  .goal-stat { min-height: 64px; padding: 9px; }
  .goal-stat strong { font-size: 21px; }
  .goal-stat span, .goal-stat small { font-size: 9px; }
  .chart-range { white-space: normal; }
  .goal-checklist { grid-template-columns: 1fr; }
  .checklist-heading { grid-column: auto; }
  .task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; }
  .task-title { grid-column: 1 / -1; min-height: 44px; }
  .today-check { grid-column: 1 / 3; }
  .task-menu { grid-column: 3; min-width: 44px; }
  .date-fields { grid-template-columns: 1fr; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .primary-button { width: 100%; margin-left: 0; }
  dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); margin: 10px; overflow-y: auto; }
  dialog form { padding: 14px; }
  .reminder-popup { right: 10px; bottom: 10px; width: calc(100vw - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
