:root {
  --color-primary-accent: #ff7443;
  --color-brand-primary: #ff491d;
  --color-background: #fffefd;
  --color-surface: #fffdfc;
  --color-border: #efe1dc;
  --text-primary: #3d302c;
  --text-secondary: #756865;
  --text-user: #fff8f3;
  --border-subtle: #fed2ab;
  --color-subtle-highlight: #fff1e8;
}

* { box-sizing: border-box; }
/* Reset native button chrome (iOS Safari in particular applies its own
   padding/background/border to <button> unless this is set, which can throw
   off flex sizing in ways desktop/Chrome-based tooling never reproduces). */
button { -webkit-appearance: none; appearance: none; margin: 0; }

html, body {
  margin: 0;
  padding: 0;
  background: #ebe4e0;
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text-primary);
  height: 100%;
}

.device-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  /* Highest-priority override: some mobile WebViews (embedded app shells,
     older Android/iOS WKWebView builds) don't support dvh at all and
     silently keep the broken 100vh value above. --app-vh is set from JS in
     app.js using window.visualViewport (or innerHeight as fallback), which
     works in every environment JS runs in — the one truly universal source
     of the real visible viewport height. */
  min-height: calc(var(--app-vh, 1vh) * 100);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.phone {
  position: relative;
  width: 393px;
  height: 852px;
  background: var(--color-surface);
  border-radius: 55px;
  box-shadow: 0 30px 60px -20px rgba(61,48,44,0.35), 0 0 0 12px #111, 0 0 0 14px #333;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dynamic-island {
  position: absolute;
  top: 11px;
  left: 50%;
  transform: translateX(-50%);
  width: 126px;
  height: 37px;
  background: #000;
  border-radius: 20px;
  z-index: 50;
}

.statusbar {
  height: 47px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 24px 6px;
  color: var(--text-primary);
}
.statusbar-time { font-size: 15px; font-weight: 600; font-family: 'Inter'; }
.statusbar-icons { display: flex; align-items: center; gap: 5px; color: var(--text-primary); }

/* ---------- app screens (welcome / sign in / chatbot) ---------- */
.app-screen { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.app-screen[hidden] { display: none; }

/* welcome-screen is just a viewport/window: it never resizes anything
   inside it, it only ever scrolls if the scaled composition (below) is
   taller than the space actually available. */
.welcome-screen { position: relative; align-items: center; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.welcome-screen::-webkit-scrollbar { width: 0; }

/* .welcome-composition (logo/artwork/headline/CTA, all still authored at
   their original fixed px sizes — font-size, margins, padding, none of
   that changed) is rendered at its native 393x786 reference size always,
   then scaled as a single visual unit via transform:scale. A fixed
   aspect-ratio on the outer box alone isn't enough — it only keeps the
   container's own shape constant while its pixel-sized children stay flat,
   which is exactly what let the relationship between them drift on
   mobile. transform:scale instead scales every child together (fonts,
   gaps, image, everything) by the same factor, so the composition is
   pixel-proportionally identical to the reference at any width — it's a
   uniform zoom, not a reflow. --welcome-scale is set once in app.js from
   the actual rendered width (393 on the desktop/laptop canvas → scale 1,
   i.e. no visual change there at all) and kept in sync on resize.
   .welcome-scale-wrap reserves exactly the *scaled* height in the normal
   layout flow (transform doesn't otherwise affect layout sizing, so
   without this there'd be leftover empty space below the visually-shrunk
   composition); flex-shrink:0 keeps it at that full scaled height even if
   it doesn't fit, so .welcome-screen scrolls to it instead of compressing
   it. */
.welcome-scale-wrap {
  width: 100%;
  height: calc(786px * var(--welcome-scale, 1));
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}
.welcome-composition {
  position: relative;
  width: 393px;
  height: 786px;
  flex-shrink: 0;
  transform: scale(var(--welcome-scale, 1));
  transform-origin: top center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.welcome-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; z-index: 0; }
.welcome-logo {
  position: relative; z-index: 1; margin-top: 44px; display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.welcome-logo-title { margin: 0; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 36px; line-height: 34px; color: var(--text-primary); }
.welcome-logo-title b { color: var(--color-primary-accent); font-weight: 800; }
.welcome-logo-tagline { margin: 0; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 13px; line-height: 18px; color: var(--text-secondary); text-transform: uppercase; }

.welcome-content {
  position: relative; z-index: 1; margin-top: auto; width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 0 32px 48px;
}
.welcome-heading { margin: 0; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 30px; line-height: 37.5px; letter-spacing: -0.75px; color: var(--text-primary); text-align: center; }
.welcome-subtext { margin: 0; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-secondary); text-align: center; }
.welcome-cta {
  width: 100%; border: none; border-radius: 9999px; background: var(--color-primary-accent); color: #fff;
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 16px; line-height: 20px; letter-spacing: 0.16px;
  padding: 16px 24px; cursor: pointer;
  box-shadow: 0px 4px 6px -1px rgba(0,0,0,0.1), 0px 2px 4px -2px rgba(0,0,0,0.1);
}
.welcome-cta:active { background: var(--color-brand-primary); }
.welcome-caption { margin: 0; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-secondary); text-align: center; }

.signin-screen { background: var(--color-surface); }
.signin-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 64px 24px 40px; display: flex; flex-direction: column; }
.signin-header { display: flex; flex-direction: column; gap: 12px; }
.signin-title { margin: 0; font-family: 'Manrope', sans-serif; font-weight: 600; font-size: 28px; line-height: 34px; letter-spacing: -0.28px; color: var(--text-primary); }
.signin-subtitle { margin: 0; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-secondary); }

.signin-card { margin-top: 38px; background: var(--color-surface); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.signin-field { display: flex; flex-direction: column; gap: 8px; }
.signin-label { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-primary); }
.signin-input {
  width: 100%; box-sizing: border-box; background: var(--color-background); border: 1px solid #d7c2b9; border-radius: 16px;
  padding: 17px; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-primary);
  outline: none;
}
.signin-input::placeholder { color: var(--text-secondary); }
.signin-password-wrap { position: relative; }
.signin-password-wrap .signin-input { padding-right: 49px; }
.signin-eye-btn { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 0; cursor: pointer; display: flex; }
.signin-forgot-row { display: flex; justify-content: flex-end; }
.signin-link { font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; line-height: 20px; color: var(--text-secondary); cursor: pointer; }
.signin-error {
  margin: -8px 0 0; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 14px; line-height: 20px; color: #d64545;
}
.signin-error[hidden] { display: none; }
.signin-submit {
  width: 100%; border: none; border-radius: 16px; background: var(--color-primary-accent); color: var(--color-background);
  font-family: 'Inter', sans-serif; font-weight: 600; font-size: 16px; line-height: 20px; letter-spacing: 0.16px;
  padding: 16px 24px; cursor: pointer; box-shadow: 0px 1px 1px rgba(0,0,0,0.05);
}
.signin-submit:active { background: var(--color-brand-primary); }

.signin-divider { margin-top: 32px; display: flex; align-items: center; padding: 0 8px; }
.signin-divider::before, .signin-divider::after { content: ''; flex: 1; height: 1px; background: #d7c2b9; }
.signin-divider span { padding: 0 16px; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 14px; line-height: 20px; color: var(--text-secondary); }

.signin-social { margin-top: 16px; display: flex; flex-direction: column; gap: 16px; }
.signin-social-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--color-background); border: 1px solid #d7c2b9; border-radius: 16px; padding: 15px 25px; cursor: pointer;
  font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-primary);
  box-shadow: 0px 1px 1px rgba(0,0,0,0.05);
}

.signin-footer { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.signin-create { margin: 0; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 16px; line-height: 24px; color: var(--text-secondary); text-align: center; }
.signin-legal { margin: 0; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 13px; line-height: 18px; color: var(--text-secondary); text-align: center; opacity: 0.8; padding: 0 16px; }

.chatbot-screen { min-height: 0; position: relative; }

.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 16px;
  background: var(--color-surface);
  border-bottom: 0.8px solid var(--color-border);
  position: relative;
  z-index: 20;
}
.icon-btn {
  background: none;
  border: none;
  padding: 8px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:active { background: var(--color-border); }

.topbar-center { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.brand { margin: 0; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 22px; line-height: 28px; color: var(--text-primary); }
.brand b { color: var(--color-primary-accent); font-weight: 700; }
.tagline { margin: 0; font-family: 'Manrope', sans-serif; font-size: 12px; line-height: 16px; font-weight: 700; letter-spacing: 0.72px; color: var(--text-secondary); text-transform: uppercase; }

.mode-dropdown-wrap { position: relative; width: 100%; display: flex; justify-content: center; min-width: 0; }
.mode-pill {
  display: flex; align-items: center; gap: 6px;
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 5px 12px;
  font-family: 'Inter', sans-serif; font-weight: 500; font-size: 12.5px; line-height: 18px;
  color: var(--text-primary);
  cursor: pointer;
  max-width: 220px;
  min-width: 0;
}
.mode-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary-accent); flex-shrink: 0; }
.mode-pill span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-pill svg { flex-shrink: 0; transition: transform .15s; }
.mode-pill[aria-expanded="true"] svg { transform: rotate(180deg); }

.avatar-btn {
  width: 40px; height: 40px; border-radius: 20px; border: none; padding: 1px; background: none; cursor: pointer; flex-shrink: 0; overflow: hidden;
}
.avatar-btn img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- Mode + Tone popover (anchored overlay, never pushes chat layout) ---------- */
.mode-popover {
  position: fixed;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 12px 30px -8px rgba(61,48,44,0.25);
  z-index: 46;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}
.mode-popover[hidden] { display: none; }

/* Blocks/covers the topbar, chat and composer while the popover is open, so
   the underlying screen isn't interactable until the user explicitly closes it. */
.mode-popover-backdrop {
  position: absolute; inset: 0; z-index: 44; background: transparent;
  display: none;
}
.mode-popover-backdrop.open { display: block; }
.mode-popover-section { display: flex; flex-direction: column; gap: 4px; }
.mode-popover-label { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: var(--color-primary-accent); font-family: 'Inter'; }
.mode-popover-divider { height: 1px; background: var(--color-border); margin: 2px 0; flex-shrink: 0; }

.mode-option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  background: none; border: none; border-radius: 12px; padding: 8px; cursor: pointer; text-align: left;
}
.mode-option:hover, .mode-option:active { background: var(--color-subtle-highlight); }
.mode-option.active { background: var(--color-subtle-highlight); }
.mode-option-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mode-option-title { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 14px; line-height: 20px; color: var(--text-primary); }
.mode-option-byline { font-family: 'Inter', sans-serif; font-weight: 400; font-size: 12.5px; line-height: 17px; color: var(--text-secondary); white-space: normal; word-break: break-word; }
.mode-option-check {
  flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mode-option.active .mode-option-check { background: var(--color-primary-accent); }
.mode-option.active .mode-option-check::after {
  content: ''; width: 8px; height: 5px; border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(-45deg) translateY(-1px);
}

/* ---------- Today's Plan right-side drawer ---------- */
.drawer-fab {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 41;
  width: 16px; height: 80px;
  background: var(--color-primary-accent);
  border: none; border-radius: 16px 0 0 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.drawer-fab:active { background: var(--color-brand-primary); }

.drawer-backdrop {
  position: absolute; inset: 0; background: rgba(61,48,44,0.18); z-index: 42;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.today-drawer {
  /* A right-edge panel — anchored flush to the screen's right side and
     spanning its full height, NOT a centered floating card. Width is
     capped well short of the full screen (the Figma-reduced target),
     sized to the card's own content via updateDrawerSizing in app.js, so
     the chat stays visible on the left. */
  position: absolute; top: 0; right: 0; bottom: 0;
  /* Always leaves at least 48px of chat visible on the left, regardless of
     phone width — a plain min(100%, Npx) cap isn't enough on its own, since
     at some of our tested widths Npx alone still ends up ~= 100%. */
  width: min(calc(100% - 48px), 380px);
  background: var(--color-surface);
  border-radius: 24px 0 0 24px;
  box-shadow: -6px 0 30px -6px rgba(61,48,44,0.2);
  z-index: 43;
  display: flex; flex-direction: column;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.today-drawer.open { transform: translateX(0); }

.today-drawer-header {
  flex-shrink: 0; display: flex; align-items: center; justify-content: flex-end;
  padding: 16px 16px 4px;
}
.today-drawer-close { background: none; border: none; padding: 4px; margin: -4px; border-radius: 9999px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.today-drawer-close svg { width: 12px; height: 12px; }
.today-drawer-close:active { background: var(--color-border); }

.today-drawer-body {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
  /* Left/right padding is set by JS (updateDrawerSizing in app.js): targets
     ~36-40px where the panel has room, shrinking toward a small floor if it
     doesn't — the card itself always sizes to fit inside whatever's left
     (see .card's own width:100%/max-width:320 rule below), so the panel
     never scrolls or extends horizontally. Equal top/bottom padding here,
     plus vertical centering, balances the space above/below the card when
     its content is shorter than the panel — "safe" falls back to
     top-aligned (scrollable, nothing clipped) once content overflows. */
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 24px;
  justify-content: center;
  justify-content: safe center;
}
.today-drawer-body .card { border: 1px solid var(--color-border); }
.today-drawer-body::-webkit-scrollbar { width: 0; height: 0; }
.today-drawer-divider { height: 1px; background: var(--color-border); flex-shrink: 0; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.chat::-webkit-scrollbar { width: 0; }

.date-header { display: flex; justify-content: center; }
.date-header span {
  background: #fff5e8; color: var(--text-secondary); font-size: 14px; padding: 4px 12px; border-radius: 9999px;
}
.date-header:first-of-type span { background: var(--text-user); }

.unread-divider { display: flex; align-items: center; justify-content: center; padding: 8px 0; }
.unread-divider::before, .unread-divider::after { content: ''; flex: 1; height: 1px; background: #efe1dc; }
.unread-divider span {
  color: var(--text-secondary); font-size: 14px; font-weight: 500; line-height: 20px;
  padding: 0 16px; white-space: nowrap;
}

.row { display: flex; width: 100%; gap: 4px; align-items: flex-end; }
.row.user { justify-content: flex-end; }
.row.bot { justify-content: flex-start; }

.bot-avatar {
  width: 32px; height: 32px; border-radius: 9999px; background: var(--color-primary-accent);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 6px;
}
.bot-avatar img { width: 100%; height: 100%; object-fit: contain; }
.bot-avatar.spacer { visibility: hidden; }

.bubble {
  position: relative;
  padding: 14px 16px;
  font-size: 16px;
  line-height: 24px;
  word-break: break-word;
  white-space: pre-line;
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

.bubble.user {
  max-width: 260px;
  background: var(--color-primary-accent);
  color: var(--text-user);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  border-radius: 18px 4px 18px 18px;
}
.bubble.bot {
  max-width: 280px;
  background: var(--color-background);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(92,61,28,0.08);
  border-radius: 4px 18px 18px 18px;
}

.quick-starters {
  display: flex; flex-direction: column; gap: 12px; width: 198px; flex-shrink: 0; padding: 16px 8px 16px;
}
.qs-chip {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; border-bottom: 1px solid var(--color-background);
  color: var(--text-primary); font-family: 'Inter'; font-weight: 400; font-size: 16px; line-height: 24px;
  padding: 0 0 12px; cursor: pointer; text-align: left;
}
.qs-chip:last-child { border-bottom: none; padding-bottom: 0; }
.qs-icon { flex-shrink: 0; width: 24px; height: 24px; }
.qs-label { flex: 1; }

.image-msg {
  position: relative;
  display: inline-block;
  max-width: 225px;
  flex-shrink: 0;
}
.image-msg-inner {
  display: block;
  border-radius: 4px 18px 18px 18px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(92,61,28,0.08);
}
.image-msg img {
  display: block; width: auto; height: auto; max-width: 225px; max-height: 260px;
  -webkit-user-drag: none; user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

.chip-row { display: flex; gap: 12px; flex-wrap: wrap; }
.chip {
  background: var(--color-surface); border: 1px solid var(--border-subtle); border-radius: 9999px; padding: 9px 16px;
  font-family: 'Manrope'; font-weight: 600; font-size: 15px; color: var(--color-primary-accent); cursor: pointer;
}
.chip:active { background: var(--border-subtle); }
.chip.selected { background: var(--color-primary-accent); color: #fff; }

/* Cards */
.card[hidden] { display: none; }
.card {
  width: 100%;
  max-width: 320px;
  background: var(--color-background);
  border: 1px solid var(--color-background);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card-head { display: flex; align-items: center; gap: 16px; }
.card-head .ic { width: 48px; height: 48px; border-radius: 9999px; background: #fff1e8; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.card-head h3 { margin: 0; font-family: 'Manrope', sans-serif; font-size: 20px; line-height: 24px; font-weight: 600; color: var(--color-primary-accent); }
.card-head p { margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }
.card-head.compact { gap: 8px; }
.card-head.compact .ic { width: 18px; height: 18px; background: none; border-radius: 0; font-size: 16px; }

.card-date { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 17px; }

.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 16px; }
.timeline-bar { width: 4px; height: 16px; border-radius: 9999px; background: var(--color-primary-accent); margin-top: 4px; flex-shrink: 0; }
.timeline-time { width: 64px; flex-shrink: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); padding-top: 4px; }
.timeline-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.timeline-body h4 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 400; color: var(--text-primary); }
.timeline-body p { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.timeline-body h4.done { text-decoration: line-through; color: #9ca3af; }

.check {
  width: 20px; height: 20px; border-radius: 5px; border: 1.5px solid var(--color-border); background: var(--color-background);
  flex-shrink: 0; cursor: pointer; margin-top: 2px; display: flex; align-items: center; justify-content: center; padding: 0;
}
.check.checked { background: var(--color-primary-accent); border-color: var(--color-primary-accent); }
.check.checked::after { content: ''; width: 10px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translateY(-1px); }

.hr { height: 1px; background: var(--color-background); border: none; margin: 0; }

.section-label { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--color-primary-accent); }

.task-list, .habit-list { display: flex; flex-direction: column; gap: 16px; }
.task-item { display: flex; gap: 16px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--color-background); }
.task-item .arrow { color: #4f46e5; font-size: 12px; margin-top: 4px; }
.task-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.task-body h4 { margin: 0; font-size: 16px; line-height: 24px; font-weight: 400; color: var(--text-primary); }
.task-body h4.done { text-decoration: line-through; color: #9ca3af; }
.task-body p { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }

.habit-item { display: flex; gap: 16px; align-items: center; }
.habit-dash { width: 8px; height: 2px; margin-left: 4px; background: var(--color-primary-accent); flex-shrink: 0; }
.habit-item span { flex: 1; font-size: 16px; line-height: 24px; font-weight: 400; }
.habit-item span.done { text-decoration: line-through; color: #9ca3af; }

.route-group { display: flex; flex-direction: column; gap: 16px; }
.route-group-label { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--color-primary-accent); }
.route-step { display: flex; gap: 16px; align-items: flex-start; }
.route-marker { flex-shrink: 0; width: 16px; display: flex; align-items: center; justify-content: center; margin-top: 4px; }
.route-marker-chevron { color: #4f46e5; font-size: 14px; line-height: 1; }
.route-marker-dash { width: 8px; height: 2px; margin-left: 4px; background: var(--color-primary-accent); }
.route-marker-diamond { width: 8px; height: 8px; background: #14b8a6; transform: rotate(45deg); }
.route-step h4 { margin: 0 0 2px; font-size: 16px; line-height: 24px; font-weight: 400; color: var(--text-primary); }
.route-step p { margin: 0; font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.route-step .due { display: block; margin-top: 0; font-size: 14px; font-style: italic; font-weight: 500; color: var(--text-secondary); }

.next-move-card { display: flex; flex-direction: column; gap: 4px; }
.next-move-card .move-title { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--text-primary); margin: 0; }
.next-move-card .move-why { font-size: 16px; line-height: 24px; color: var(--text-primary); margin: 0; }

.quote-block {
  border-left: 2px solid var(--color-primary-accent); padding-left: 14px; font-style: italic; font-weight: 500; font-size: 14px; line-height: 18px; color: var(--text-secondary);
}
.quote-block cite { display: block; margin-top: 4px; font-style: normal; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--color-primary-accent); }

.summary-group { display: flex; flex-direction: column; gap: 10px; }
.summary-group-label { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; color: var(--color-primary-accent); }
.summary-line { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; line-height: 24px; }
.summary-line .mark { flex-shrink: 0; margin-top: 4px; font-size: 13px; }
.summary-group.done .mark::before { content: '✓'; color: #16a34a; }
.summary-group.kept .mark::before { content: '●'; color: var(--color-primary-accent); font-size: 8px; }
.summary-group.moved .mark::before { content: '→'; color: var(--color-primary-accent); }
.summary-line .txt strong { display: block; font-weight: 400; color: var(--text-primary); }
.summary-line .txt span { display: block; font-size: 13px; line-height: 18px; color: var(--text-secondary); margin-top: 1px; }

.thinking-bubble {
  background: var(--color-background); box-shadow: 0 2px 4px rgba(92,61,28,0.08); border-radius: 4px 18px 18px 18px;
  padding: 12px 16px; display: flex; align-items: center; gap: 8px;
}
.thinking-bubble .label { font-size: 13.5px; color: var(--text-secondary); font-style: italic; font-family: 'Inter'; }
.thinking-bubble .dots { display: flex; gap: 4px; }
.thinking-bubble .dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-primary-accent); animation: bounce 1.2s infinite; }
.thinking-bubble .dots span:nth-child(2) { animation-delay: .15s; }
.thinking-bubble .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.reaction-badge {
  position: absolute; bottom: -10px; left: 6px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 9999px; font-size: 13px; padding: 2px 6px; box-shadow: 0 2px 6px rgba(61,48,44,0.12); cursor: pointer; line-height: 1.3;
}

.reaction-popup {
  position: fixed; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: 9999px; padding: 6px 8px; display: flex; gap: 6px; box-shadow: 0 8px 20px -6px rgba(61,48,44,0.3); z-index: 100;
  animation: pop .12s ease-out;
}
.reaction-popup button { border: none; background: none; font-size: 20px; cursor: pointer; padding: 2px; line-height: 1; transition: transform .1s; }
.reaction-popup button:hover, .reaction-popup button:active { transform: scale(1.25); }

.composer-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--color-surface);
  border-top: 1px solid var(--color-background);
}
.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px 28px;
}
.icon-circle {
  width: 40px; height: 40px; border-radius: 9999px; background: var(--text-user); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.icon-circle:active { background: var(--border-subtle); }
@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(255,129,63,.5); }
  70% { box-shadow: 0 0 0 8px rgba(255,129,63,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,129,63,0); }
}
.composer-field {
  flex: 1; min-width: 0; height: 48px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 9999px; display: flex; align-items: center; padding: 0 6px 0 17px; gap: 8px;
}
.composer-icon { display: block; flex-shrink: 0; }
.emoji-icon { width: 28px; height: 20px; }
.composer-field input {
  flex: 1; border: none; background: none; outline: none; font-family: 'Nunito', sans-serif; font-size: 14px; line-height: 18px; color: var(--text-primary); min-width: 0; cursor: pointer; caret-color: transparent;
}
.composer-field input::placeholder { color: var(--text-secondary); }
.mic-btn { background: none; border: none; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 9999px; }
.mic-btn.listening { background: #fff1e8; animation: pulse-ring 1s ease-out infinite; }
.send-btn {
  width: 48px; height: 48px; border-radius: 9999px; background: var(--color-primary-accent); opacity: .45; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 4px 6px rgba(61,48,44,0.05); transition: opacity .15s;
}
.send-btn.active { opacity: 1; }
.send-btn:active { background: var(--color-brand-primary); }

.home-indicator { position: relative; flex-shrink: 0; padding: 8px 0 6px; display: flex; justify-content: center; }
.home-indicator::after { content: ''; width: 134px; height: 5px; border-radius: 3px; background: #000; opacity: .8; }

@media (max-width: 430px) {
  html, body { overflow: hidden; }
  .device-wrap { padding: 0; }
  .phone { width: 100vw; height: 100vh; height: 100dvh; height: calc(var(--app-vh, 1vh) * 100); border-radius: 0; box-shadow: none; }
  /* No mobile-specific override for .today-drawer here — it deliberately
     inherits the exact same width formula used on the laptop reference
     (see .today-drawer above), so the panel's proportion is identical on
     both, not a separately-tuned mobile value. */
}
