:root {
  --pink-50: #fff0f8;
  --pink-100: #ffe0f2;
  --pink-200: #ffc2e6;
  --pink-300: #ff9bd6;
  --pink-400: #ff6cc4;
  --pink-500: #f947af;
  --pink-600: #d92b95;
  --noir-300: #4a4150;
  --noir-400: #241b2b;
  --purple-accent: #8a3fc9;
  --amber-400: #ffb648;
  --amber-600: #d98a1a;
  --mint-400: #7fd9c4;
  --ink: #5a3358;
  --ink-soft: #8a6a89;
  --card-bg: rgba(255, 255, 255, 0.72);
  --card-border: rgba(255, 255, 255, 0.9);
  --shadow: 0 18px 40px -12px rgba(150, 40, 120, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overscroll-behavior-y: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 8%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0) 35%),
    radial-gradient(circle at 85% 12%, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 30%),
    linear-gradient(160deg, #fff0f8 0%, #ffd6ef 20%, #ffb0dd 40%, #ff7fc4 62%, #3a1830 100%);
  position: relative;
  overflow-x: hidden;
}

/* ---------- ambient sparkle / hearts field ---------- */

.sparkle-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.sparkle-field .bit {
  position: absolute;
  opacity: 0.5;
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.6));
  animation: bob ease-in-out infinite;
}

.sparkle-field .bit svg {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.28; }
  50% { transform: translateY(-18px) rotate(8deg); opacity: 0.65; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

/* ---------- shared card look ---------- */

.lock-card, .calendar-card, .history-card, .predict-card, .storm-card, .jobs-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: relative;
  z-index: 1;
}

/* ---------- logo ---------- */

.logo-drip {
  width: 76px;
  height: 98px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 8px 14px rgba(217, 43, 149, 0.35));
}

.logo-drip svg { width: 100%; height: 100%; display: block; }

.logo-drip.small { width: 42px; height: 54px; margin: 0; flex-shrink: 0; }

.app-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin: 4px 0 2px;
  background: linear-gradient(90deg, var(--pink-600), var(--noir-400));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

.app-title.small { font-size: 1.05rem; text-align: left; margin: 0; }

.app-subtitle {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin: 0 0 22px;
  font-style: italic;
}

.app-subtitle.small { text-align: left; margin: 1px 0 0; font-size: 0.68rem; }

/* ---------- lock screen ---------- */

.lock-screen {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-screen[hidden] { display: none; }

.lock-card {
  width: 100%;
  max-width: 360px;
  padding: 36px 28px 30px;
  text-align: center;
}

.pin-form { position: relative; }

.pin-dots {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 6px 0 10px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--pink-400);
  background: transparent;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pin-dot.filled {
  background: linear-gradient(135deg, var(--pink-400), var(--noir-400));
  transform: scale(1.1);
}

.pin-dot.shake { animation: shakeDot 0.4s; }

@keyframes shakeDot {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.pin-input-hidden {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  opacity: 0;
  font-size: 16px; /* prevents iOS zoom on focus */
  border: none;
  background: transparent;
}

.pin-error {
  min-height: 18px;
  font-size: 0.78rem;
  color: var(--pink-600);
  margin: 4px 0 0;
}

.spooky-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 0;
  opacity: 0.9;
}

.spooky-row svg { width: 30px; height: 30px; display: block; }
.spooky-row svg.deco-bat { width: 26px; height: 16px; }

/* ---------- tab bar ---------- */

.tab-bar {
  display: flex;
  gap: 6px;
  padding: 0 4px 16px;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  padding: 10px 2px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.76rem;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(217,43,149,0.1);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--pink-500), var(--noir-400));
  color: #fff;
  box-shadow: 0 4px 12px rgba(217,43,149,0.35);
}

.tab-btn:active { transform: scale(0.97); }

/* ---------- app shell ---------- */

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 90px;
  min-height: 100vh;
  min-height: 100dvh;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 20px;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.main-content[hidden] {
  display: none;
}

/* ---------- predicted period card ---------- */

.predict-card {
  padding: 16px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,214,239,0.85), rgba(214,183,255,0.85));
}

.predict-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pink-600);
  font-weight: 700;
}

.predict-date {
  margin: 4px 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.predict-sub {
  margin: 2px 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ---------- calendar ---------- */

.calendar-card { padding: 18px 14px 16px; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
}

.month-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.7);
  color: var(--pink-600);
  font-size: 1.2rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(217,43,149,0.18);
}

.nav-btn:active { transform: scale(0.92); }

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  color: var(--ink-soft);
  font-weight: 700;
  padding: 0 2px 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}

.day-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-cell.empty { visibility: hidden; }

.day-btn {
  width: 78%;
  height: 78%;
  border: none;
  background: transparent;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  font-weight: 600;
}

.day-btn:active { transform: scale(0.9); }

.day-cell.today .day-btn {
  box-shadow: inset 0 0 0 2px var(--pink-500);
}

.day-cell.selecting-start .day-btn,
.day-cell.range-start .day-btn,
.day-cell.range-end .day-btn,
.day-cell.single-day .day-btn {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-400));
  color: #fff;
  box-shadow: 0 4px 10px rgba(217,43,149,0.4);
}

.day-cell.range-mid .day-btn {
  background: transparent;
  color: var(--pink-600);
  font-weight: 700;
}

/* the connecting pill bar behind range days */
.day-cell.range-start::after,
.day-cell.range-mid::after,
.day-cell.range-end::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 66%;
  background: linear-gradient(90deg, rgba(255,140,205,0.35), rgba(255,140,205,0.5));
  z-index: 1;
}

.day-cell.range-start::after { left: 50%; right: 0; border-radius: 999px 0 0 999px; }
.day-cell.range-mid::after { left: 0; right: 0; }
.day-cell.range-end::after { left: 0; right: 50%; border-radius: 0 999px 999px 0; }

.day-cell.predicted .day-btn {
  box-shadow: inset 0 0 0 2px var(--noir-400);
  color: var(--noir-400);
}

.select-hint {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin: 12px 0 2px;
}

/* ---------- storm tracker ---------- */

.storm-current { padding: 20px 20px 18px; text-align: center; }

.storm-location {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--pink-600);
  text-transform: uppercase;
}

.storm-now-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.storm-icon { font-size: 3rem; line-height: 1; }

.storm-temp-block { text-align: left; }

.storm-temp {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.storm-desc {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-soft);
  margin-top: 2px;
}

.storm-sub {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.storm-gauge-card { padding: 18px 22px 20px; text-align: center; }

.storm-gauge-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--pink-600);
}

.gauge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-svg { width: 100%; max-width: 240px; height: auto; }

.gauge-zones {
  display: flex;
  justify-content: space-between;
  width: 100%;
  max-width: 200px;
  margin-top: -6px;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.storm-pressure-value {
  margin: 4px 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--ink);
}

.storm-pressure-trend {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.scale-heading {
  margin: 16px 0 6px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: left;
}

.pressure-scale {
  display: flex;
  gap: 6px;
}

.scale-chip {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 7px 2px 8px;
  border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.scale-chip-label {
  font-size: 0.7rem;
  font-weight: 800;
}

.scale-chip-range {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.scale-chip-note {
  font-size: 0.56rem;
  color: var(--ink-soft);
}

.scale-chip-low {
  background: rgba(255,108,196,0.12);
  box-shadow: inset 0 -3px 0 var(--pink-400);
}
.scale-chip-low .scale-chip-label { color: var(--pink-600); }

.scale-chip-normal {
  background: rgba(255,224,242,0.55);
  box-shadow: inset 0 -3px 0 var(--pink-200);
}
.scale-chip-normal .scale-chip-label { color: var(--ink-soft); }

.scale-chip-high {
  background: rgba(193,155,255,0.16);
  box-shadow: inset 0 -3px 0 var(--noir-400);
}
.scale-chip-high .scale-chip-label { color: var(--noir-400); }

.scale-chip.current {
  transform: scale(1.06);
  box-shadow: inset 0 -3px 0 var(--pink-500), 0 0 0 2px var(--pink-500), 0 4px 10px rgba(217,43,149,0.25);
}

.storm-gauge-explain {
  margin: 12px 0 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
}

.storm-gauge-explain em { color: var(--pink-600); font-style: normal; font-weight: 700; }

.storm-forecast-card { padding: 18px 18px 8px; }

.storm-forecast-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.storm-day-list { display: flex; flex-direction: column; }

.storm-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 8px 12px 12px;
  border-top: 1px solid rgba(217, 43, 149, 0.12);
  border-left: 4px solid transparent;
  border-radius: 10px;
}

.storm-day-row:first-child { border-top: none; }

.storm-day-date { font-size: 0.85rem; font-weight: 700; color: var(--ink); }

.storm-day-temp { font-size: 0.74rem; color: var(--ink-soft); margin-top: 2px; }

.storm-day-right { text-align: right; }

.storm-day-drop { font-size: 0.72rem; color: var(--ink-soft); }

.storm-day-risk { font-size: 0.76rem; font-weight: 700; margin-top: 2px; }

.storm-day-row.risk-low { border-left-color: var(--mint-400); }
.storm-day-row.risk-low .storm-day-risk { color: var(--mint-400); }

.storm-day-row.risk-moderate { border-left-color: var(--amber-400); background: rgba(255,182,72,0.08); }
.storm-day-row.risk-moderate .storm-day-risk { color: var(--amber-600); }

.storm-day-row.risk-high { border-left-color: var(--pink-500); background: rgba(249,71,175,0.08); }
.storm-day-row.risk-high .storm-day-risk { color: var(--pink-600); }

/* ---------- scraper (jobs) ---------- */

.jobs-card { padding: 20px 18px 18px; }

.jobs-title {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.jobs-intro {
  margin: 0 0 14px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.jobs-file-btn {
  display: block;
  text-align: center;
  padding: 22px 16px;
  border-radius: 18px;
  border: 2px dashed var(--pink-300);
  background: rgba(255, 255, 255, 0.45);
  color: var(--pink-600);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.jobs-file-btn small {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  color: var(--ink-soft);
}

.jobs-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.jobs-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid var(--card-border);
  box-shadow: var(--shadow);
}

.jobs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.jobs-thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(90, 51, 88, 0.75);
  color: #fff;
  font-size: 0.78rem;
  line-height: 22px;
}

.jobs-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px 18px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-500), var(--noir-400));
  box-shadow: 0 10px 22px -8px rgba(217, 43, 149, 0.6);
}

.jobs-btn:active { transform: translateY(1px); }
.jobs-btn:disabled { opacity: 0.5; }

.jobs-btn.secondary {
  color: var(--pink-600);
  background: #fff;
  border: 2px solid var(--pink-200);
  box-shadow: none;
}

.jobs-label {
  display: block;
  margin: 14px 0 5px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.jobs-input {
  width: 100%;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--pink-200);
  border-radius: 12px;
  outline: none;
}

.jobs-input:focus { border-color: var(--pink-400); }

.jobs-textarea { resize: vertical; min-height: 58px; }

.jobs-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 4px;
  font-size: 0.9rem;
  color: var(--ink);
}

.jobs-toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--pink-500);
  flex-shrink: 0;
}

.jobs-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.jobs-note.warn { background: #fff3dc; color: var(--amber-600); border: 1px solid #ffe0ad; }
.jobs-note.err { background: rgba(249, 71, 175, 0.1); color: var(--pink-600); border: 1px solid var(--pink-200); }

.jobs-done-card { text-align: center; }

.jobs-done-emoji { margin: 4px 0 0; font-size: 2.4rem; line-height: 1; }

.jobs-done-msg {
  margin: 8px 0 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.jobs-spin {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -3px;
  animation: jobsSpin 0.8s linear infinite;
}

@keyframes jobsSpin { to { transform: rotate(360deg); } }

/* ---------- email (cold outreach) ---------- */

.email-body-textarea { min-height: 220px; line-height: 1.5; }

.email-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid var(--pink-200);
  border-radius: 12px;
  gap: 10px;
}

.email-queue-info { flex: 1; min-width: 0; }

.email-queue-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.email-queue-addr {
  font-size: 0.74rem;
  color: var(--ink-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-queue-status {
  font-size: 1.1rem;
  min-width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.email-queue-remove {
  border: none;
  background: none;
  color: var(--pink-300);
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
}

.email-queue-remove:active { color: var(--pink-600); }

.email-counter {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  font-style: italic;
  margin: 4px 0 0;
}

/* Desktop-only wide layout for the Email tab (Sophie only uses this tab from
   her laptop, never her phone). `.app-wide` is toggled on `.app` by app.js
   whenever the Email tab is the active one, and only does anything above this
   breakpoint - on an actual phone the tab still looks exactly like the others. */
@media (min-width: 900px) {
  .app.app-wide {
    max-width: 1200px;
  }

  #panelEmail:not([hidden]) {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    column-gap: 20px;
    row-gap: 16px;
    align-items: start;
  }

  #panelEmail > .jobs-card:nth-of-type(1) { grid-column: 1; grid-row: 1 / span 2; }
  #panelEmail > .jobs-card:nth-of-type(2) { grid-column: 2; grid-row: 1; }
  #panelEmail > .jobs-card:nth-of-type(3) { grid-column: 2; grid-row: 2; }
  #panelEmail > .email-counter,
  #panelEmail > #emailSendAllBtn,
  #panelEmail > #emailProgress {
    grid-column: 1 / -1;
  }

  #panelEmail #emailSendAllBtn {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .app-wide .email-body-textarea { min-height: 420px; }

  #panelEmail .email-queue {
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
  }
}

/* ---------- calendar tab (two-week grid + to-do) ---------- */

.calendar-tab { width: 100%; }

.calendar-tab-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Matches the breakpoint the Email tab's .app-wide layout uses, so both
   tabs' containers switch to their wide layout at the same point and end
   up the same width (see .app.app-wide above). */
@media (min-width: 900px) {
  .calendar-tab-layout {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
  }

  .task-calendar-card { flex: 1 1 640px; max-width: 760px; }
  .todo-card { flex: 0 0 360px; }
}

.task-calendar-card { padding: 18px 14px 16px; }

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

.task-day-cell {
  min-height: 86px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.task-day-cell.today {
  box-shadow: inset 0 0 0 2px var(--purple-accent);
}

.task-day-num {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink);
}

.task-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.task-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
  background: rgba(138, 63, 201, 0.1);
  border-radius: 6px;
  padding: 2px 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-accent);
  flex-shrink: 0;
}

.task-chip.urgent {
  background: rgba(217, 138, 26, 0.12);
}

.task-chip.urgent::before {
  background: var(--amber-600);
}

.todo-card { padding: 20px 18px 18px; }

.todo-text-input { margin-top: 2px; }

.todo-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.todo-today-btn {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 10px 14px;
  font-size: 0.78rem;
}

.todo-date-input { flex: 1; min-width: 0; }

.todo-add-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--pink-500), var(--noir-400));
  box-shadow: 0 6px 14px -6px rgba(217, 43, 149, 0.6);
}

.todo-add-btn:active { transform: scale(0.93); }

.todo-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  border-left: 4px solid transparent;
  background: rgba(255, 255, 255, 0.5);
}

.todo-row.urgent {
  border-left-color: var(--amber-600);
  background: rgba(255, 182, 72, 0.1);
  box-shadow: 0 0 0 1px rgba(217, 138, 26, 0.18), 0 0 14px rgba(217, 138, 26, 0.25);
}

.todo-check {
  width: 20px;
  height: 20px;
  accent-color: var(--purple-accent);
  flex-shrink: 0;
}

.todo-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.todo-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.todo-row.completed .todo-text {
  text-decoration: line-through;
  opacity: 0.5;
}

.todo-date {
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 1px;
}

.todo-flame {
  border: none;
  background: none;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.15s ease;
}

.todo-row:hover .todo-flame,
.todo-row:focus-within .todo-flame,
.todo-row.urgent .todo-flame {
  opacity: 1;
}

.todo-delete {
  border: none;
  background: rgba(217, 43, 149, 0.08);
  color: var(--pink-600);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.todo-delete:active { transform: scale(0.9); }

/* ---------- history ---------- */

.history-card { padding: 18px 18px 6px; }

.history-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
}

.history-list { display: flex; flex-direction: column; }

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  border-top: 1px solid rgba(217, 43, 149, 0.12);
}

.history-row:first-child { border-top: none; }

.history-dates { font-size: 0.85rem; font-weight: 600; }

.history-duration { font-size: 0.72rem; color: var(--ink-soft); }

.history-delete {
  border: none;
  background: rgba(217,43,149,0.08);
  color: var(--pink-600);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.history-delete:active { transform: scale(0.9); }

.empty-state {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
  padding: 16px 8px 20px;
}

/* ---------- logout / footer ---------- */

.logout-link {
  display: block;
  margin: 22px auto 0;
  background: none;
  border: none;
  font-size: 0.7rem;
  color: rgba(90, 51, 88, 0.45);
  text-decoration: underline;
}

.secret-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 0.58rem;
  letter-spacing: 0.02em;
  color: rgba(90, 51, 88, 0.18);
  padding: 6px 0 18px;
  user-select: none;
}

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: rgba(90, 51, 88, 0.92);
  color: #fff;
  font-size: 0.78rem;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 50;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 480px) {
  .app { padding-top: 32px; }
}

/* ---------- peanut mascot ---------- */
.peanut-mascot {
  position: fixed;
  right: 14px;
  bottom: 0;
  z-index: 40;
  /* The hat is a separate element that pokes up above this box's own top
     edge (negative top%), so hiding this box needs to travel further than
     its own height (100%) - otherwise the hat stays poking into view even
     after the body has fully slid off-screen. */
  transform: translateY(140%);
  transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  pointer-events: none;
}

.peanut-mascot.peeking {
  transform: translateY(6%);
  pointer-events: auto;
  animation: peanut-wiggle 2.6s ease-in-out infinite;
}

.peanut-mascot.peeking.speaking {
  animation-play-state: paused;
}

.peanut-mascot .peanut-body {
  display: block;
  filter: drop-shadow(0 6px 10px rgba(90, 51, 88, 0.25));
}

.peanut-hat {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 84%;
  height: auto;
  z-index: 2;
}

@keyframes peanut-wiggle {
  0%, 100% { transform: translateY(6%) rotate(0deg); }
  25% { transform: translateY(6%) rotate(-4deg); }
  75% { transform: translateY(6%) rotate(4deg); }
}

.peanut-bubble {
  position: absolute;
  right: -6px;
  bottom: 100%;
  margin-bottom: 140px;
  min-width: 140px;
  max-width: 200px;
  background: #fff;
  border: 2px solid var(--pink-300);
  border-radius: 30px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--pink-600);
  box-shadow: 0 8px 18px rgba(90, 51, 88, 0.18);
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.peanut-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 22px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 2px solid var(--pink-300);
  border-bottom: 2px solid var(--pink-300);
  transform: rotate(45deg);
}

.peanut-mascot.speaking .peanut-bubble {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
  .peanut-mascot .peanut-body { width: 136px; height: auto; }
  .peanut-bubble { max-width: 180px; font-size: 0.78rem; }
}
