/* ============================================================
   Burrow — styles.css
   Fonts: Lora (headings/title) + Poppins (UI text)
   CSS variables used throughout for future font/theme switcher
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500&family=Poppins:wght@300;400;500;600&display=swap');

/* ── Design tokens ── */
:root {
  /* Fonts */
  --font-title:   'Lora', Georgia, serif;
  --font-ui:      'Poppins', system-ui, sans-serif;

  /* Palette */
  --cream:        #faf7f2;
  --paper:        #f5f0e8;
  --paper-dark:   #ede5d8;
  --ink:          #2c2416;
  --ink-mid:      #6b5d4a;
  --ink-light:    #8a7a66;
  --rule:         #d4c8b4;
  --shadow:       rgba(44,36,22,0.10);

  /* Accent colours */
  --squirrel:     #e8763a;
  --squirrel-bg:  #fde8d8;
  --squirrel-dk:  #c05820;
  --priority:     #3a7ae8;
  --priority-bg:  #dce8fd;
  --priority-dk:  #1a58c0;
  --todo:         #38a169;
  --todo-bg:      #d4eddf;
  --todo-dk:      #206040;
  --brain:        #9b59b6;
  --brain-bg:     #ecdff5;
  --brain-dk:     #6c3880;
  --time:         #e8c53a;
  --time-bg:      #fdf5d4;
  --time-dk:      #9a7c10;
  --defer:        #8a9bbf;
  --defer-bg:     #e4e9f5;
  --defer-dk:     #4a5a80;

  /* Spacing */
  --radius-sm:    6px;
  --radius-md:    10px;
  --radius-lg:    14px;
  --tap-min:      44px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--paper-dark);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior: none;
}

/* ── App shell ── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
  position: relative;
}

/* ── Header ── */
.app-header {
  background: var(--cream);
  border-bottom: 1px solid var(--rule);
  padding: 14px 16px 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.app-title {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}

.header-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.icon-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: none;
  background: transparent;
  color: var(--ink-mid);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background 0.15s;
}
.icon-btn:hover, .icon-btn:focus-visible { background: var(--paper); }
.icon-btn:active { background: var(--paper-dark); }

/* ── Day navigation ── */
.day-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-mid);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: background 0.15s;
}
.nav-btn:hover { background: var(--paper-dark); }
.nav-btn:active { background: var(--rule); }

.day-info {
  flex: 1;
  text-align: center;
}

.day-label {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  display: block;
  line-height: 1.2;
}

.back-to-today {
  font-size: 11px;
  color: var(--squirrel);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: inline-block;
  margin-top: 2px;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-ui);
}
.back-to-today:hover { text-decoration: underline; }
.back-to-today.hidden { visibility: hidden; pointer-events: none; }

/* ── Tab bar ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
  position: sticky;
  top: 112px;
  z-index: 40;
}

.tab-btn {
  flex: 1;
  height: var(--tap-min);
  border: none;
  background: transparent;
  color: var(--ink-light);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.tab-btn.active {
  color: var(--squirrel);
  border-bottom-color: var(--squirrel);
}

/* ── Main content ── */
.tab-content { display: none; padding: 0 0 120px; }
.tab-content.active { display: block; }

/* ── Section cards ── */
.section {
  border-bottom: 1px solid var(--rule);
  padding: 16px;
}
.section:last-child { border-bottom: none; }

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

.section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink-light);
}

.section-label.sq  { color: var(--squirrel); }
.section-label.pri { color: var(--priority); }
.section-label.td  { color: var(--todo); }
.section-label.br  { color: var(--brain); }
.section-label.tm  { color: var(--time-dk); }
.section-label.df  { color: var(--defer); }

/* ── Brain score ── */
.brain-score-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.brain-pip {
  flex: 1;
  height: var(--tap-min);
  border: 1.5px solid var(--rule);
  background: var(--paper);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-ui);
  color: var(--ink-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.brain-pip:hover { background: var(--brain-bg); border-color: var(--brain); color: var(--brain-dk); }
.brain-pip.selected { background: var(--brain); border-color: var(--brain); color: #fff; }

.brain-note {
  font-size: 12px;
  color: var(--ink-mid);
  font-style: italic;
  min-height: 18px;
  text-align: center;
}

/* ── Brain dump ── */
.brain-dump-area {
  width: 100%;
  min-height: 80px;
  background: var(--brain-bg);
  border: 1px solid var(--brain-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.brain-dump-area:focus { border-color: var(--brain); }
.brain-dump-area::placeholder { color: var(--ink-light); }

/* ── Squirrels ── */
.squirrel-list { list-style: none; }

.squirrel-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
  min-height: var(--tap-min);
}
.squirrel-item:last-child { border-bottom: none; }

.sq-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--squirrel);
  background: transparent;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sq-circle.done { background: var(--squirrel); }
.sq-circle.done::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.sq-body { flex: 1; min-width: 0; }

.sq-text {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
}
.sq-text.done { text-decoration: line-through; color: var(--ink-light); }

.sq-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.sq-time {
  font-size: 10px;
  color: var(--ink-light);
  letter-spacing: 0.03em;
}

.sq-outcome {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--squirrel-bg);
  color: var(--squirrel-dk);
}

.sq-add-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
}

.sq-input {
  flex: 1;
  height: var(--tap-min);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}
.sq-input:focus { border-color: var(--squirrel); }
.sq-input::placeholder { color: var(--ink-light); }

.add-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: 1.5px solid var(--squirrel);
  background: var(--squirrel-bg);
  color: var(--squirrel-dk);
  border-radius: var(--radius-md);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.add-btn:hover { background: var(--squirrel); color: #fff; }

/* ── Priorities ── */
.priority-list { list-style: none; }

.priority-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  min-height: var(--tap-min);
}

.pri-num {
  width: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--priority);
  flex-shrink: 0;
  margin-top: 12px;
  text-align: right;
}

.pri-check {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--priority);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 12px;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pri-check.done { background: var(--priority); }
.pri-check.done::after {
  content: '';
  width: 9px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.pri-input {
  flex: 1;
  min-height: var(--tap-min);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  resize: none;
  line-height: 1.4;
}
.pri-input:focus { border-color: var(--priority); background: var(--priority-bg); }
.pri-input::placeholder { color: var(--ink-light); }
.pri-input.done { text-decoration: line-through; color: var(--ink-light); }

/* ── To-do list ── */
.todo-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.todo-col-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--todo-dk);
  margin-bottom: 8px;
}

.todo-list { list-style: none; }

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  min-height: 36px;
}

.todo-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--todo);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  background: transparent;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.todo-check.done { background: var(--todo); border-color: var(--todo); }
.todo-check.done::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}

.todo-text {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
  word-break: break-word;
  cursor: pointer;
}
.todo-text.done { text-decoration: line-through; color: var(--ink-light); }

.carried-badge {
  font-size: 9px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--todo-bg);
  color: var(--todo-dk);
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 2px;
}

.todo-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  grid-column: 1 / -1;
}

.todo-input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 10px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}
.todo-input:focus { border-color: var(--todo); }
.todo-input::placeholder { color: var(--ink-light); }

/* ── Time blocks ── */
.timeblock-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.timeblock {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 10px;
}

.timeblock-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--time-dk);
  margin-bottom: 6px;
}

.timeblock-input {
  width: 100%;
  min-height: 60px;
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  resize: none;
  outline: none;
}
.timeblock-input::placeholder { color: var(--ink-light); }

/* ── Defer to tomorrow ── */
.defer-list { list-style: none; margin-bottom: 10px; }

.defer-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  min-height: 40px;
}
.defer-item:last-child { border-bottom: none; }

.defer-arrow {
  font-size: 14px;
  color: var(--defer);
  flex-shrink: 0;
  margin-top: 2px;
}

.defer-text {
  flex: 1;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}

.defer-remove {
  background: none;
  border: none;
  color: var(--ink-light);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.defer-remove:hover { color: var(--ink); }

.defer-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.defer-input {
  flex: 1;
  height: var(--tap-min);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 0.15s;
}
.defer-input:focus { border-color: var(--defer); }
.defer-input::placeholder { color: var(--ink-light); }

/* ── Notes tab ── */
.notes-pane { padding: 16px; }

.notes-topic-input {
  width: 100%;
  height: var(--tap-min);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.notes-topic-input:focus { border-color: var(--squirrel); }
.notes-topic-input::placeholder { color: var(--ink-light); font-family: var(--font-ui); font-size: 14px; font-weight: 400; }

.notes-body-input {
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.notes-body-input:focus { border-color: var(--squirrel); }
.notes-body-input::placeholder { color: var(--ink-light); }

/* ── Squirrel Log panel (bottom sheet on mobile) ── */
.panel-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,36,22,0.35);
  z-index: 100;
}
.panel-overlay.open { display: block; }

.squirrel-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--rule);
  max-height: 85vh;
  max-height: 85dvh;
  display: flex;
  flex-direction: column;
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
}
.squirrel-panel.open { transform: translateY(0); }

.panel-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 0;
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.panel-close {
  width: var(--tap-min);
  height: var(--tap-min);
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--ink-mid);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.panel-close:hover { background: var(--paper); }

.panel-tabs {
  display: flex;
  padding: 8px 16px 0;
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid var(--rule);
}

.panel-tab {
  flex: 1;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--ink-light);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.panel-tab.active {
  color: var(--squirrel);
  border-bottom-color: var(--squirrel);
}

.panel-body {
  overflow-y: auto;
  flex: 1;
  padding: 12px 16px;
  -webkit-overflow-scrolling: touch;
}

/* ── Squirrel log entries ── */
.log-entry {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.log-entry:last-child { border-bottom: none; }

.log-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.log-date {
  font-size: 11px;
  color: var(--ink-light);
}

.log-outcome {
  font-size: 10px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 20px;
  background: var(--squirrel-bg);
  color: var(--squirrel-dk);
}
.log-outcome.priority { background: var(--priority-bg); color: var(--priority-dk); }
.log-outcome.dropped  { background: var(--paper-dark);  color: var(--ink-light); }

.log-text {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
.log-text.open { color: var(--ink-mid); }

.log-empty {
  font-size: 13px;
  color: var(--ink-light);
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

/* ── Insights ── */
.insight-section { margin-bottom: 20px; }

.insight-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 10px;
}

.bar-chart { display: flex; flex-direction: column; gap: 6px; }

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-label {
  font-size: 11px;
  color: var(--ink-mid);
  width: 60px;
  flex-shrink: 0;
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 18px;
  background: var(--paper-dark);
  border-radius: 4px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--squirrel);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.bar-count {
  font-size: 11px;
  color: var(--ink-mid);
  width: 20px;
  text-align: left;
}

.outcome-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.outcome-chip {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  flex: 1;
  text-align: center;
}
.outcome-chip.acted  { background: var(--squirrel-bg); color: var(--squirrel-dk); }
.outcome-chip.pri    { background: var(--priority-bg); color: var(--priority-dk); }
.outcome-chip.drop   { background: var(--paper-dark);  color: var(--ink-mid); }
.outcome-chip.open   { background: var(--paper);       color: var(--ink-light);
                        border: 1px solid var(--rule); }

/* ── Calendar panel ── */
.cal-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--rule);
  z-index: 101;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32,0.72,0,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.cal-panel.open { transform: translateY(0); }

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
}

.cal-month-label {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.cal-nav {
  display: flex;
  gap: 4px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-nav-btn:hover { background: var(--paper-dark); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 12px 8px;
}

.cal-day-hdr {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-light);
  text-align: center;
  padding: 4px 0;
}

.cal-day {
  height: 38px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--ink-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 400;
  position: relative;
  transition: background 0.15s;
}
.cal-day:hover { background: var(--paper-dark); }
.cal-day.has-data { font-weight: 600; color: var(--ink); }
.cal-day.today { background: var(--squirrel-bg); color: var(--squirrel-dk); font-weight: 600; }
.cal-day.selected { background: var(--squirrel); color: #fff; font-weight: 600; }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { background: transparent; }

.cal-footer {
  padding: 8px 16px 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  gap: 12px;
}

.cal-today-btn {
  padding: 0 20px;
  height: 40px;
  border: 1.5px solid var(--squirrel);
  background: var(--squirrel-bg);
  color: var(--squirrel-dk);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.cal-today-btn:hover { background: var(--squirrel); color: #fff; }

/* ── Outcome modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44,36,22,0.45);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.outcome-modal {
  background: var(--cream);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

.outcome-prompt {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.outcome-squirrel-text {
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 16px;
  font-style: italic;
}

.outcome-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.outcome-btn {
  height: var(--tap-min);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  padding: 0 16px;
  transition: background 0.15s;
}
.outcome-btn:hover { background: var(--paper-dark); }
.outcome-btn.acted    { border-color: var(--squirrel); color: var(--squirrel-dk); }
.outcome-btn.priority { border-color: var(--priority); color: var(--priority-dk); }
.outcome-btn.dropped  { border-color: var(--rule);     color: var(--ink-mid); }
.outcome-btn.cancel   { color: var(--ink-light); font-weight: 400; }

/* ── Todo resolve modal ── */
.todo-modal-prompt {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 4px;
}

.todo-modal-text {
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 16px;
  font-style: italic;
}

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
  border-top: 1px solid var(--rule);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}

.bottom-nav-btn {
  flex: 1;
  height: var(--tap-min);
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  color: var(--ink-light);
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.bottom-nav-btn:hover { color: var(--squirrel); }
.bottom-nav-btn .nav-icon { font-size: 18px; line-height: 1; }

/* ── Login screen ── */
.login-screen {
  position: fixed;
  inset: 0;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  z-index: 500;
}

.login-logo {
  font-family: var(--font-title);
  font-size: 42px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-squirrel {
  font-size: 48px;
  margin-bottom: 16px;
  line-height: 1;
}

.login-tagline {
  font-size: 14px;
  color: var(--ink-mid);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 280px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.login-card-title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
}

.login-card-sub {
  font-size: 13px;
  color: var(--ink-mid);
  margin-bottom: 20px;
  line-height: 1.5;
}

.login-email-input {
  width: 100%;
  height: var(--tap-min);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: 0 14px;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s;
}
.login-email-input:focus { border-color: var(--squirrel); }
.login-email-input::placeholder { color: var(--ink-light); }

.login-submit-btn {
  width: 100%;
  height: var(--tap-min);
  border: none;
  background: var(--squirrel);
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.login-submit-btn:hover { background: var(--squirrel-dk); }
.login-submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.login-confirm {
  display: none;
  text-align: center;
  padding: 8px 0;
}
.login-confirm.visible { display: block; }

.login-confirm-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.login-confirm-title {
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.login-confirm-text {
  font-size: 13px;
  color: var(--ink-mid);
  line-height: 1.6;
}

.login-error {
  font-size: 12px;
  color: #c0392b;
  margin-top: 8px;
  display: none;
}
.login-error.visible { display: block; }

/* ── Sync status indicator ── */
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rule);
  flex-shrink: 0;
  transition: background 0.3s;
}
.sync-dot.syncing  { background: var(--time); }
.sync-dot.synced   { background: var(--todo); }
.sync-dot.error    { background: #e74c3c; }

.header-top .sync-dot { margin-right: 2px; }

/* ── User menu ── */
.user-btn {
  width: var(--tap-min);
  height: var(--tap-min);
  border: none;
  background: transparent;
  color: var(--ink-mid);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.15s;
}
.user-btn:hover { background: var(--paper); }

.user-menu {
  position: absolute;
  top: 56px;
  right: 12px;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px var(--shadow);
  z-index: 60;
  min-width: 160px;
  display: none;
}
.user-menu.open { display: block; }

.user-menu-email {
  font-size: 11px;
  color: var(--ink-light);
  padding: 10px 14px 6px;
  border-bottom: 1px solid var(--rule);
  word-break: break-all;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--ink);
  border: none;
  background: transparent;
  cursor: pointer;
}
.user-menu-item:hover { background: var(--paper); }

/* ── Utilities ── */
.hidden { display: none !important; }
.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;
}
