/* ============================================================
   Bullet Journal — Daybreak
   Paper/ink · Playfair Display + Lato · mobile column (375px)
   Ported from the Daybreak Auth Flow design system.
   ============================================================ */

* { box-sizing: border-box; }

:root {
  --c-blue:  oklch(0.53 0.105 252);
  --c-ink:   oklch(0.30 0.012 260);
  --c-green: oklch(0.55 0.095 156);
  --c-red:   oklch(0.55 0.135 27);
  --c-green-tint: oklch(0.95 0.03 156);

  --bg:        oklch(0.985 0.003 95);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.975 0.004 95);
  --border:    oklch(0.9 0.004 95);
  --border-strong: oklch(0.82 0.005 95);
  --text:      oklch(0.26 0.008 260);
  --text-2:    oklch(0.46 0.008 260);
  --text-3:    oklch(0.62 0.006 260);
  --paper:     oklch(0.99 0.006 95);
}

html, body { margin: 0; height: 100%; }
body {
  background: oklch(0.94 0.004 95);
  font-family: "Lato", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

/* ---- the phone column ---- */
.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font-family: "Lato", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px oklch(0 0 0 / 0.06);
}
.serif { font-family: "Playfair Display", Georgia, serif; }

.dotgrid {
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1.4px);
  background-size: 22px 22px;
}

/* ---- screen body ---- */
.scr {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 30px 34px 38px;
  min-height: 0;
}
.scr-top { padding-top: 8px; }

/* ---- brand eyebrow ---- */
.brand-row { display: flex; align-items: center; gap: 9px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c-ink); flex: none; }
.brand-name {
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-2);
}

/* ---- hero ---- */
.hero-mark {
  font-size: 44px; line-height: 1.04; font-weight: 500;
  letter-spacing: -0.02em; color: var(--text); margin: 0 0 14px;
}
.hero-mark.sm { font-size: 38px; }
.hero-mark em { font-style: italic; }
.hero-sub { color: var(--text-2); font-size: 15px; max-width: 250px; }
.spacer { flex: 1; min-height: 24px; }

/* ---- hairline fields ---- */
.fields { display: flex; flex-direction: column; gap: 22px; }
.line {
  display: flex; flex-direction: column; gap: 9px;
  border-bottom: 1.5px solid var(--border); padding-bottom: 9px;
  position: relative;
}
.line.active, .line:focus-within { border-bottom-color: var(--c-ink); }
.line label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-3);
}
.line .val { font-size: 16px; color: var(--text); }
.line .val.ph { color: var(--text-3); }
.line input {
  appearance: none; border: none; background: none; outline: none;
  font-family: "Lato", sans-serif; font-size: 16px; color: var(--text);
  padding: 0; width: 100%;
}
.line input::placeholder { color: var(--text-3); }
.line.has-eye input { padding-right: 28px; }
.line .eye {
  position: absolute; right: 0; bottom: 9px; color: var(--text-3); display: flex;
  background: none; border: none; cursor: pointer; padding: 0;
}

/* ---- buttons ---- */
.btn-ink {
  appearance: none; border: 1px solid var(--c-ink);
  background: var(--c-ink); color: var(--paper);
  font-family: "Lato", sans-serif; font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  padding: 15px; border-radius: 12px; text-align: center; cursor: pointer;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  white-space: nowrap;
}
.btn-ink:disabled { background: var(--surface-2); color: var(--text-3); border-color: var(--border); cursor: default; }
.btn-ghost {
  appearance: none; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-family: "Lato", sans-serif; font-size: 15px; font-weight: 700;
  padding: 14px; border-radius: 12px; cursor: pointer;
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 11px;
  white-space: nowrap;
}
.link {
  font-size: 13.5px; color: var(--text-3);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong);
  cursor: pointer; background: none; border: none; font-family: inherit;
}

/* clickable inline emphasis (Create an account, Sign in, etc.) */
.alt b, .resend b { color: var(--text); font-weight: 700; cursor: pointer; }
.alt b:hover, .resend b:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---- divider ---- */
.divider {
  display: flex; align-items: center; gap: 14px;
  color: var(--text-3); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.actions { display: flex; flex-direction: column; gap: 14px; }
.alt { text-align: center; font-size: 13.5px; color: var(--text-3); }

/* ---- back link ---- */
.backlink { display: inline-flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13.5px; cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
.backlink svg { width: 16px; height: 16px; }

/* ---- error banner ---- */
.err {
  font-size: 13.5px; color: var(--c-red);
  background: oklch(0.96 0.03 27); border: 1px solid color-mix(in oklch, var(--c-red) 30%, transparent);
  border-radius: 10px; padding: 10px 13px;
}

/* ============================================================
   Splash
   ============================================================ */
.splash { align-items: center; justify-content: center; text-align: center; gap: 0; }
.splash-mark { font-size: 54px; line-height: 1.0; font-weight: 500; letter-spacing: -0.02em; margin: 0; }
.splash-mark em { font-style: italic; }
.splash-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 26px;
  display: flex; align-items: center; gap: 10px;
}
.splash-eyebrow .brand-dot { width: 7px; height: 7px; }
.splash-loader { display: flex; gap: 7px; margin-top: 46px; }
.splash-loader i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); animation: pulse 1.2s ease-in-out infinite; }
.splash-loader i:nth-child(2) { animation-delay: 0.18s; }
.splash-loader i:nth-child(3) { animation-delay: 0.36s; }
@keyframes pulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); background: var(--c-green); } }

.caret { display: inline-block; width: 1.5px; height: 18px; background: var(--c-ink); vertical-align: -3px; margin-left: 1px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============================================================
   Icon medallions
   ============================================================ */
.medallion {
  width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  border: 1.5px solid var(--border); background: var(--surface);
}
.medallion svg { width: 32px; height: 32px; }
.medallion.ink { background: var(--c-ink); border-color: var(--c-ink); color: var(--paper); }
.medallion.green { background: var(--c-green-tint); border-color: color-mix(in oklch, var(--c-green) 35%, transparent); color: var(--c-green); }
.center-stack { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 22px; }
.center-stack .hero-mark { margin: 0; }
.center-stack .hero-sub { max-width: 260px; }
.email-pill {
  display: inline-block; font-weight: 700; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 12px; font-size: 14px;
}

/* ============================================================
   Verify — code boxes
   ============================================================ */
.code-row { display: flex; gap: 10px; justify-content: center; }
.code-box {
  width: 44px; height: 56px; border-radius: 12px;
  border: 1.5px solid var(--border);
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: var(--text);
  background: var(--surface);
}
.code-box.filled { border-color: var(--border-strong); }
.code-box.active { border-color: var(--c-ink); box-shadow: 0 0 0 3px color-mix(in oklch, var(--c-ink) 12%, transparent); }
.code-box .caret { height: 26px; }
/* hidden real input that drives the boxes */
.code-input { position: absolute; opacity: 0; pointer-events: none; }
.code-row.live { cursor: text; }
.resend { font-size: 13px; color: var(--text-3); text-align: center; }
.resend b { color: var(--text); }

/* ============================================================
   Profile confirm (Google)
   ============================================================ */
.avatar {
  width: 84px; height: 84px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  font-family: "Playfair Display", serif; font-size: 34px; color: var(--paper);
  background: var(--c-blue);
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border);
}
.gbadge { position: relative; }
.gbadge .gmark {
  position: absolute; right: -2px; bottom: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center;
  box-shadow: 0 1px 4px oklch(0 0 0 / 0.15);
}
.profile-card {
  width: 100%; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface-2); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; text-align: left;
}
.profile-card .pc-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.profile-card .pc-name { font-size: 17px; font-weight: 700; color: var(--text); }
.profile-card .pc-email { font-size: 14px; color: var(--text-2); }

.terms { font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.5; }
.terms b { color: var(--text-2); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ============================================================
   Today's Log (landed home)
   ============================================================ */
.home-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 8px; margin-bottom: 26px;
}
.home-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--paper);
  font-family: "Playfair Display", serif; font-size: 15px; background: var(--c-blue);
  border: none; cursor: pointer;
}
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: 42px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 28px oklch(0 0 0 / 0.12);
  min-width: 180px; padding: 6px; display: flex; flex-direction: column;
}
.menu .menu-name { padding: 9px 12px 7px; font-size: 13px; color: var(--text-3); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu .menu-name b { color: var(--text); font-weight: 700; display: block; font-size: 14px; }
.menu button {
  appearance: none; border: none; background: none; text-align: left;
  font-family: "Lato", sans-serif; font-size: 14px; color: var(--text);
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.menu button:hover { background: var(--surface-2); }

.datenav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.datenav .arrow {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; color: var(--text-2); flex: none; cursor: pointer;
}
.datenav .arrow svg { width: 18px; height: 18px; }
.datenav .dc { text-align: center; cursor: pointer; }
.datenav .dc .wd { font-size: 11px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; color: var(--text-3); }
.datenav .dc .dm { font-size: 26px; font-weight: 500; letter-spacing: -0.01em; margin-top: 2px; }
.datenav .dc .today-pill { display: inline-block; margin-top: 4px; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-green); }

.home-sec { margin-bottom: 24px; }
.home-sec-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 13px;
}
.meals-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.meal-cell {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  appearance: none; background: none; border: none; cursor: pointer;
  border-bottom: 1.5px solid var(--border); padding: 0 0 8px;
  transition: border-color 0.12s;
}
.meal-cell:hover, .meal-cell:focus-visible { border-bottom-color: var(--c-ink); outline: none; }
.meal-cell .ml { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.meal-cell .mv { font-size: 13.5px; color: var(--text); min-height: 18px; line-height: 1.3; word-break: break-word; }
.meal-cell .mv.empty { color: var(--text-3); }

.todo { display: flex; align-items: flex-start; gap: 13px; padding: 11px 0; border-bottom: 1px solid var(--border); position: relative; }
.todo .check {
  width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px;
  border: 2px solid var(--cat); display: grid; place-items: center;
  background: none; cursor: pointer; padding: 0;
}
.todo .check.on { background: var(--cat); }
.todo .check.on svg { width: 12px; height: 12px; stroke: var(--paper); }
.todo .tt { font-size: 15px; color: var(--text); }
.todo.done .tt { text-decoration: line-through; text-decoration-color: var(--cat); color: var(--text-3); }
.todo .tn { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.todo-body { flex: 1; min-width: 0; word-break: break-word; cursor: pointer; }
.todo .remove {
  opacity: 0; flex: none; background: none; border: none; cursor: pointer;
  color: var(--text-3); padding: 2px; margin-top: 1px; transition: opacity 0.12s;
}
.todo:hover .remove { opacity: 1; }
.todo .remove svg { width: 16px; height: 16px; }

.empty-todos { font-size: 14px; color: var(--text-3); padding: 6px 0 14px; font-style: italic; }

/* ---- add entry button (list page) ---- */
.add-entry-btn {
  margin-top: auto; flex: none;
  position: sticky; bottom: 24px; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px 20px;
  background: var(--c-ink); color: var(--paper);
  border: none; border-radius: 16px; cursor: pointer;
  font-family: "Lato", sans-serif; font-size: 16px; font-weight: 700; letter-spacing: 0.01em;
  white-space: nowrap; box-shadow: 0 12px 26px -14px oklch(0 0 0 / 0.5);
}
.add-entry-btn svg { width: 17px; height: 17px; }

/* ---- compose bottom sheet (page 2) ---- */
.compose-overlay { position: absolute; inset: 0; z-index: 30; }
.compose-scrim { position: absolute; inset: 0; background: oklch(0 0 0 / 0.28); animation: scrim-in 0.18s ease; }
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.compose-sheet {
  position: fixed;
  left: max(0px, calc(50vw - 210px));
  right: max(0px, calc(50vw - 210px));
  bottom: var(--kb-h, 0px);
  background: var(--paper); border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px -20px oklch(0 0 0 / 0.45);
  padding: 22px 28px calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 18px;
  animation: sheet-up 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.compose-field { padding-top: 36px; }
.compose-prompt {
  width: 100%; border: none; outline: none; background: transparent; resize: none;
  font-size: 40px; line-height: 1.12; font-weight: 500; font-style: italic;
  letter-spacing: -0.015em; color: var(--text); caret-color: var(--c-ink);
}
.compose-prompt::placeholder { color: var(--text-3); }

.compose-bar { display: flex; align-items: center; gap: 10px; }
.compose-pills { display: flex; gap: 8px; align-items: center; min-width: 0; flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface);
  font-family: "Lato", sans-serif; font-size: 13px; font-weight: 700; color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.pill:disabled { cursor: default; opacity: 0.85; }
.pill svg { width: 14px; height: 14px; color: var(--text-3); margin-left: -1px; flex: none; }
.pill .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--od); flex: none; }
.pill.cat { min-width: 0; }
.pill.cat .lab { overflow: hidden; text-overflow: ellipsis; }

.cat-pick { position: relative; min-width: 0; }
.type-pick { position: relative; }
.meal-pick { position: relative; }
.cat-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5;
  background: var(--paper); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 14px 34px -16px oklch(0 0 0 / 0.45); padding: 6px; min-width: 200px;
  display: flex; flex-direction: column; gap: 2px;
}
.cat-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer; border-radius: 9px; padding: 9px 11px;
  font-family: "Lato", sans-serif; font-size: 14px; font-weight: 600; color: var(--text);
}
.cat-opt:hover { background: var(--surface-2); }
.cat-opt.sel { background: var(--surface-2); }
.cat-opt .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--od); flex: none; }

.chat-send {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--c-ink); color: var(--paper);
  display: grid; place-items: center; cursor: pointer; border: none;
}
.chat-send:disabled { background: var(--surface-2); color: var(--text-3); cursor: default; }
.chat-send svg { width: 19px; height: 19px; }

.save-flash {
  text-align: center; font-size: 13px; color: var(--c-green); font-weight: 700;
  height: 18px; opacity: 0; transition: opacity 0.2s; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.save-flash.show { opacity: 1; }
.save-flash svg { width: 14px; height: 14px; }
