:root {
  --ink: #FBF8F1;
  --ink2: #FFFFFF;
  --paper: #23262B;
  --paperDim: #756F63;
  --brass: #C0821F;
  --teal: #24886F;
  --clay: #B5503A;
  --line: #E4DECF;
  --blue: #4F6DAA;
  --inset: #F1EBDC;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--paper);
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  font-size: 16px;
}
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, textarea {
  width: 100%;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  font-size: 15px;
  margin-bottom: 10px;
  font-family: 'Manrope', sans-serif;
}
::placeholder { color: #756F6388; }

.btn-primary {
  background: var(--brass);
  color: var(--ink);
  border: none;
  border-radius: 6px;
  padding: 13px 24px;
  font-size: 17px;
  font-weight: 700;
}
.btn-primary:disabled { background: var(--line); color: var(--paperDim); cursor: default; }
.btn-ghost {
  background: transparent;
  color: var(--paperDim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 15px;
}

/* ---------- Marketing ---------- */
.nav {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 6vw;
}
.nav-actions { display: flex; align-items: center; gap: 12px; }
.auth-area { display: flex; align-items: center; gap: 10px; }
.nav-signup { padding: 10px 18px; }
.user-chip { font-size: 14px; color: var(--paperDim); display: flex; align-items: center; gap: 10px; }
.brand { font-family: 'IBM Plex Mono', monospace; letter-spacing: 3px; font-size: 18px; display: flex; align-items: center; gap: 12px; }
.brand-mark { flex-shrink: 0; }
.brand span { color: var(--brass); }

/* ---------- Auth modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 18, 12, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-box {
  background: var(--ink2); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; width: 100%; max-width: 380px; position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 22px; color: var(--paperDim); line-height: 1;
}
.modal-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.modal-tab {
  background: none; border: none; padding: 10px 4px; margin-right: 20px; font-size: 15px;
  color: var(--paperDim); border-bottom: 2px solid transparent; font-weight: 600;
}
.modal-tab.active { color: var(--paper); border-bottom-color: var(--brass); }
.auth-error {
  background: var(--inset); border: 1px solid var(--clay); color: var(--clay);
  border-radius: 6px; padding: 10px 12px; font-size: 13px; margin-bottom: 14px;
}

.hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px; padding: 40px 6vw 70px; flex-wrap: wrap;
}
.hero-copy { max-width: 560px; }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 2.5px; color: var(--brass); margin-bottom: 18px; }
.hero h1 { font-size: 61px; line-height: 1.05; margin: 0 0 20px; font-weight: 800; }
.lede { font-size: 19px; color: var(--paperDim); line-height: 1.6; margin-bottom: 30px; max-width: 480px; }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-note { font-size: 14px; color: var(--paperDim); }
.hero-dial { display: flex; align-items: center; justify-content: center; min-width: 260px; }

.section-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 13px; letter-spacing: 2.5px;
  color: var(--paperDim); padding: 0 6vw; margin-bottom: 22px;
}
.problem { padding: 50px 0; border-top: 1px solid var(--line); }
.problem-grid { padding: 0 6vw; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.problem-item { border: 1px solid var(--line); border-radius: 8px; padding: 18px; font-size: 17px; }
.problem-item span { display: block; font-family: 'IBM Plex Mono', monospace; color: var(--clay); font-size: 14px; margin-bottom: 8px; }

.steps { padding: 60px 0; border-top: 1px solid var(--line); }
.step-row { display: flex; gap: 24px; padding: 0 6vw; margin-bottom: 34px; align-items: flex-start; }
.step-num { font-family: 'IBM Plex Mono', monospace; font-size: 28px; color: var(--teal); font-weight: 600; min-width: 34px; }
.step-body h3 { margin: 0 0 6px; font-size: 21px; }
.step-body p { margin: 0; color: var(--paperDim); font-size: 17px; line-height: 1.6; max-width: 520px; }

.pricing { padding: 60px 0 80px; border-top: 1px solid var(--line); }
.pricing-grid { padding: 0 6vw; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.price-card { border: 1px solid var(--line); border-radius: 10px; padding: 24px; }
.price-card.featured { border-color: var(--brass); background: var(--ink2); }
.price-name { font-size: 15px; color: var(--paperDim); margin-bottom: 8px; }
.price-amount { font-family: 'IBM Plex Mono', monospace; font-size: 35px; font-weight: 600; margin-bottom: 16px; }
.price-amount span { font-size: 14px; color: var(--paperDim); font-family: 'Manrope', sans-serif; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 18px; font-size: 15px; color: var(--paperDim); }
.price-card li { padding: 6px 0; border-top: 1px solid var(--line); }
.price-card li:first-child { border-top: none; }
.price-btn { width: 100%; text-align: center; }
.price-btn:disabled { opacity: 0.6; }
.trial-note { font-size: 14px; color: var(--teal); font-weight: 600; margin-bottom: 16px; }

.foot { text-align: center; padding: 30px; color: var(--paperDim); font-size: 14px; border-top: 1px solid var(--line); }

/* ---------- App ---------- */
.app-shell { max-width: 760px; margin: 0 auto; padding: 32px 20px; }
.app-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 10px; }
.app-brand { font-family: 'IBM Plex Mono', monospace; font-size: 14px; letter-spacing: 3px; color: var(--brass); }
.app-tagline { font-size: 18px; color: var(--paperDim); margin-top: 2px; }
.app-stage-tabs { display: flex; gap: 14px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--paperDim); }
.stage-tab.active { color: var(--brass); border-bottom: 2px solid var(--brass); padding-bottom: 4px; }

.card { background: var(--ink2); border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 18px; }
.card.center { display: flex; align-items: center; justify-content: center; }
.card-title { font-size: 21px; font-weight: 600; margin-bottom: 4px; }
.card-sub { font-size: 15px; color: var(--paperDim); margin-bottom: 20px; }
.card-label { font-size: 14px; color: var(--paperDim); letter-spacing: 1px; margin-bottom: 12px; }
.field-label { font-size: 14px; color: var(--paperDim); display: block; margin: 10px 0 6px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } .hero h1 { font-size: 45px; } }

.schedule-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.schedule-row:last-child { border-bottom: none; }
.schedule-row .mins { font-family: 'IBM Plex Mono', monospace; color: var(--paperDim); }

.cat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cat-btn { border-radius: 20px; padding: 8px 16px; font-size: 15px; font-weight: 600; background: transparent; color: var(--paper); }
.cat-btn.active-cat { color: var(--ink); }

.timer-idle { font-size: 15px; color: var(--paperDim); }
.timer-active { display: flex; align-items: center; gap: 16px; }
.timer-clock { font-family: 'IBM Plex Mono', monospace; font-size: 33px; color: var(--brass); }
.timer-label { font-size: 15px; color: var(--paperDim); }
.stop-btn { margin-left: auto; background: var(--clay); color: var(--ink); border: none; border-radius: 6px; padding: 10px 18px; font-weight: 700; font-size: 15px; }

.log-row { display: flex; justify-content: space-between; font-size: 15px; padding: 5px 0; }
.log-dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 8px; }

.analysis-text { font-size: 17px; line-height: 1.7; white-space: pre-wrap; }

.weekly-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .weekly-grid { grid-template-columns: repeat(2, 1fr); } }
.weekly-cell { border: 1px solid var(--line); border-radius: 8px; padding: 14px; text-align: center; }
.weekly-val { font-family: 'IBM Plex Mono', monospace; font-size: 26px; font-weight: 600; }
.weekly-label { font-size: 13px; color: var(--paperDim); margin-top: 4px; }

/* ---------- Calendar day view ---------- */
.cal-grid { position: relative; margin-left: 64px; border-top: 1px solid var(--line); }
.cal-hour-row { position: relative; height: 56px; border-bottom: 1px solid var(--line); }
.cal-hour-label {
  position: absolute; left: -64px; top: -8px; width: 54px; text-align: right;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--paperDim);
}
.cal-block {
  position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 8px 12px;
  font-size: 14px; font-weight: 600; color: #FBF8F1; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.cal-block .cal-time { font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500; opacity: 0.9; display: block; margin-top: 2px; }
.cal-empty { font-size: 15px; color: var(--paperDim); }

/* ---------- To-do list ---------- */
.todo-input-row { display: flex; gap: 10px; margin-bottom: 14px; }
.todo-input-row input { margin-bottom: 0; }
.todo-input-row button { white-space: nowrap; }
.todo-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.todo-row:last-child { border-bottom: none; }
.todo-check {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--line);
  flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: var(--ink2);
}
.todo-check.done { background: var(--teal); border-color: var(--teal); color: #FBF8F1; font-size: 13px; font-weight: 700; }
.todo-text { flex: 1; }
.todo-text.done { text-decoration: line-through; color: var(--paperDim); }
.todo-del { background: none; border: none; color: var(--paperDim); font-size: 18px; line-height: 1; cursor: pointer; padding: 4px; }
.todo-empty { font-size: 14px; color: var(--paperDim); }

.draft-box { background: var(--inset); border: 1px solid var(--line); border-radius: 6px; padding: 14px; font-size: 15px; line-height: 1.6; white-space: pre-wrap; margin-top: 12px; }
