/* Atlas, "Graphite" look: near-black ground, thin borders, one bright accent, buttons with a little depth. Dark only. */
:root {
  color-scheme: dark;
  --bg: #0a0b0d; --bar: #0d0f12; --card: #121418; --raise: #171a20; --raise-2: #1d2127;
  --ink: #eceef2; --ink-2: #c9cdd6; --muted: #9ba1ad;
  --line: #23272e; --line-soft: #1c2026; --line-strong: #30353e;
  --accent: #5b9bff; --accent-ink: #0a0b0d; --accent-soft: #16233a;
  --warn: #ffb224; --warn-soft: #33270d; --danger: #ff8a80; --danger-soft: #3a1f22; --ok: #3ddc97;
  --radius: 14px; --r-btn: 11px;
  --card-bg: linear-gradient(180deg, #15181d, #101216);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 10px 24px -14px #000;
  --btn-bg: linear-gradient(180deg, #23272e, #1a1d23);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 2px 6px -2px #000;
  --shine: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 60%);
  --head-h: 58px;

  /* icons, drawn through a mask so they take the colour of the text around them */
  --i-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 3 10 14M21 3l-7 18-4-7-7-4z'/%3E%3C/svg%3E");
  --i-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9zM17 9a4 4 0 0 1 0 6'/%3E%3C/svg%3E");
  --i-phone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1 1 .4 1.9.7 2.8a2 2 0 0 1-.5 2.1L8.1 9.9a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.5 2.8.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E");
  --i-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E");
  --i-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 1 0-2.3 6.3M20 4v7h-7'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --i-mic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E");
  --i-spark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.2 6.8L21 11l-6.8 2.2L12 20l-2.2-6.8L3 11l6.8-2.2z'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15.5px/1.5 Inter, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif; -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 12px; margin: 0 0 10px; padding: 0 2px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
h2 .small { letter-spacing: .04em; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 4px; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
code { background: var(--raise); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); min-height: 1.2em; margin: 4px 0 0; }

/* ---------- top bar ---------- */
header { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: var(--head-h);
  padding: 0 16px; background: rgba(10, 11, 13, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand img { width: 34px; height: 34px; }
.head-right { display: flex; align-items: center; gap: 10px; }
#spend { font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); background: var(--btn-bg); border: 1px solid var(--line-strong); border-radius: var(--r-btn); box-shadow: var(--btn-shadow); cursor: pointer;
  transition: border-color .12s, filter .12s, transform .06s; -webkit-tap-highlight-color: transparent; }
button:hover, .btn:hover { border-color: #414753; filter: brightness(1.08); }
button:active, .btn:active { transform: translateY(1px); filter: brightness(.96); }
button:disabled { opacity: .5; cursor: default; transform: none; filter: none; }
button.primary, a.btn.primary { color: var(--accent-ink); background: var(--accent); background-image: var(--shine); border-color: transparent; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 20px -8px var(--accent); }
button.quiet { background: none; border-color: transparent; box-shadow: none; color: var(--muted); padding: 0 10px; }
button.quiet:hover { color: var(--ink); background: var(--raise); filter: none; }
button.danger { color: var(--danger); }
button.small { min-height: 32px; font-size: 12.5px; }
button:focus-visible, .btn:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a.btn { text-decoration: none; }
@media (pointer: coarse) { button, .btn { min-height: 44px; } button.small { min-height: 36px; } }

/* icons on the buttons that are used all day */
.draft [data-act="send"]::before, #ask-form button[type="submit"]::before, [data-act="read"]::before, #dg-read::before, [data-say-notice]::before, [data-say]::before,
a.btn[href^="tel:"]::before, [data-callmsg]::before, [data-act="chat"]::before, #dg-new::before, [data-aact="approve"]::before, #mic::before {
  content: ""; flex: none; width: 15px; height: 15px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.draft [data-act="send"], #ask-form button[type="submit"] { --i: var(--i-send); }
[data-act="read"], #dg-read, [data-say-notice], [data-say] { --i: var(--i-speaker); }
a.btn[href^="tel:"] { --i: var(--i-phone); }
a.btn[href^="tel:"]::before { background: var(--accent); }
[data-callmsg], [data-act="chat"] { --i: var(--i-chat); }
#dg-new { --i: var(--i-refresh); }
[data-aact="approve"] { --i: var(--i-check); }
#mic { --i: var(--i-mic); }

/* the "Sending on / paused" switch in the top bar */
.chip { min-height: 36px; border-radius: 999px; padding: 0 13px; font-size: 12.5px; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.chip[aria-pressed="true"] { background: var(--danger-soft); color: var(--danger); border-color: #6a3a3a; }
.chip[aria-pressed="true"]::before { background: var(--danger); box-shadow: none; }

/* ---------- sections bar: along the top on a computer, along the bottom on a phone ---------- */
nav#tabs { position: sticky; top: var(--head-h); z-index: 4; display: flex; justify-content: safe center; gap: 4px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none;
  background: rgba(10, 11, 13, .86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); }
nav#tabs::-webkit-scrollbar { display: none; }
nav#tabs button { position: relative; flex: 0 0 auto; min-height: 38px; padding: 0 13px; background: none; border-color: transparent; box-shadow: none; color: var(--muted); font-weight: 500; }
nav#tabs button svg { width: 17px; height: 17px; flex: none; }
nav#tabs button:hover { color: var(--ink); filter: none; }
nav#tabs button.on { background: var(--raise); border-color: #262a32; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); color: var(--accent); font-weight: 700; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

main { max-width: 860px; margin: 0 auto; padding: 18px 14px 80px; outline: none; }
section { margin-bottom: 24px; }

@media (max-width: 640px) {
  nav#tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr 1.3fr 1fr 1fr; justify-items: center; align-items: center; gap: 0;
    padding: 8px 6px calc(10px + env(safe-area-inset-bottom)); overflow: visible; background: rgba(13, 15, 18, .94); border-top: 1px solid var(--line-soft); border-bottom: 0; }
  nav#tabs button { flex-direction: column; gap: 2px; width: 64px; height: 50px; min-height: 0; padding: 0; border-radius: 14px; font-size: 11px; }
  nav#tabs button svg { width: 20px; height: 20px; }
  nav#tabs [data-tab="today"] { order: 1; }
  nav#tabs [data-tab="chats"] { order: 2; }
  nav#tabs [data-tab="ask"] { order: 3; }
  nav#tabs [data-tab="planner"] { order: 4; }
  nav#tabs [data-tab="goals"] { order: 5; }
  nav#tabs .long { display: none; }
  nav#tabs .short { display: inline; }
  .badge { position: absolute; top: -5px; right: -3px; border: 2px solid var(--bar); height: 20px; line-height: 16px; font-size: 10.5px; }

  /* the round talk button in the middle */
  /* the plain avatar, with no tile or circle behind it */
  nav#tabs [data-tab="ask"], nav#tabs [data-tab="ask"].on { width: 90px; height: 90px; margin-top: -42px; border: 0; border-radius: 0; background: none; box-shadow: none; overflow: visible; }
  nav#tabs [data-tab="ask"] svg, nav#tabs [data-tab="ask"] span { display: none; }
  nav#tabs [data-tab="ask"] .ask-face { display: block; width: 88px; height: 88px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); transition: transform .12s; }
  nav#tabs [data-tab="ask"].on .ask-face { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)) drop-shadow(0 0 12px rgba(91, 155, 255, .65)); }
  nav#tabs [data-tab="ask"]:active .ask-face { transform: scale(.94); }
  #atlas-fab, #ask-panel { display: none !important; }


  main { padding: 16px 12px calc(110px + env(safe-area-inset-bottom)); }
  .composer { bottom: calc(68px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .draft .actions .primary { flex: 1 1 auto; }
  #spend { font-size: 11.5px; white-space: nowrap; }
  header { padding: 0 12px; gap: 8px; }
  .head-right { gap: 8px; }
  .chip { padding: 0 11px; }
}

/* ---------- cards and rows ---------- */
.card { background: var(--card-bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--card-shadow); padding: 14px; margin-bottom: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 200px; min-width: 0; }
.item { padding: 11px 0; border-top: 1px solid var(--line-soft); }
.item:first-child { border-top: 0; padding-top: 0; }
.item:last-child { padding-bottom: 0; }
.item button.link, button.link { display: inline; min-height: 0; border: 0; background: none; box-shadow: none; padding: 0; color: var(--accent); font-weight: 600; font-size: inherit; text-align: start; cursor: pointer; }
.empty { color: var(--muted); padding: 6px 0; }

/* who it is: a round badge with initials, tinted by name */
.who-row { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 38px; height: 38px; border-radius: 50%; font-size: 13px; font-weight: 700; letter-spacing: 0; background: #1b2a44; color: #a9cbff; }
.avatar.av1 { background: #3a1f22; color: #ffa59c; }
.avatar.av2 { background: #14301f; color: #8fe3b0; }
.avatar.av3 { background: #33270d; color: #ffcf70; }
.avatar.av4 { background: #2a2140; color: #c9b4ff; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.danger { background: var(--danger-soft); color: var(--danger); }
.banner { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(255, 178, 36, .25); }
.banner.info { background: var(--accent-soft); color: #a9cbff; border-color: rgba(91, 155, 255, .28); }

/* ---------- fields ---------- */
input, textarea, select { font: inherit; color: var(--ink); background: var(--bar); border: 1px solid #2b3038; border-radius: var(--r-btn); padding: 9px 12px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: #7d8492; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 155, 255, .2); }
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
select { width: auto; max-width: 100%; min-height: 40px; }
input[type="checkbox"] { accent-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

/* ---------- a reply waiting for a decision ---------- */
.draft .who { font-weight: 600; font-size: 16px; }
.draft .summary { margin: 8px 0; color: var(--ink-2); }
.draft .summary.muted { font-size: 14px; margin: 6px 0; color: var(--muted); }
.draft .note { margin: 8px 0 0; font-size: 14px; color: var(--warn); }
.draft .actions { margin-top: 12px; }
.draft label { display: flex; align-items: center; gap: 6px; margin: 12px 0 5px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.draft label::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--i-spark) center / contain no-repeat; mask: var(--i-spark) center / contain no-repeat; }
.draft textarea { background: var(--raise); border-radius: 12px 12px 4px 12px; }
.orig { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 4px 12px 12px 12px; padding: 10px 12px; margin: 10px 0 8px; max-height: 280px; overflow-y: auto; color: var(--ink-2); }
.orig-msg + .orig-msg { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.orig-msg > div { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- sign-in ---------- */
.login { max-width: 360px; margin: 14vh auto 0; padding: 26px 22px; text-align: center; }
.login img { margin-bottom: 4px; }
.login label { text-align: left; }
.login button { width: 100%; margin-top: 16px; min-height: 46px; }

/* ---------- asking Atlas, and chats ---------- */
.talk { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 88%; padding: 10px 13px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); background-image: var(--shine); color: var(--accent-ink); border-radius: 14px 14px 4px 14px; font-weight: 500; }
.bubble.them { align-self: flex-start; background: var(--raise); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; }
.bubble .time { display: block; font-size: 11px; opacity: .75; margin-top: 3px; }
/* Atlas's own face beside what it says, and as a greeting before the first question */
#talk .bubble.them { position: relative; margin-left: 42px; max-width: calc(88% - 42px); }
#talk .bubble.them::before { content: ""; position: absolute; left: -42px; bottom: -3px; width: 34px; height: 34px; background: url("/atlas.svg") center / contain no-repeat; }
#talk:has(> .empty)::before { content: ""; display: block; width: 92px; height: 92px; margin: 22px auto 0; background: url("/atlas.svg") center / contain no-repeat; }
#talk > .empty { text-align: center; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 46px; }
.composer button { min-height: 46px; }
.mic.listening { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink); margin: 0; }
.switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.qr { display: block; width: 240px; max-width: 100%; border-radius: 10px; background: #fff; padding: 8px; margin: 10px 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { text-align: left; padding: 6px 8px 6px 0; border-top: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font-weight: 500; border-top: 0; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--raise-2); color: var(--ink); border: 1px solid var(--line-strong); padding: 11px 16px; border-radius: 12px;
  box-shadow: 0 16px 36px -10px #000; max-width: 90vw; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
#toast.show { opacity: 1; }
@media (prefers-reduced-motion: reduce) { #toast, button, .btn, input, textarea { transition: none; } }

code, p, .item, .bubble { overflow-wrap: anywhere; }

/* ---------- calls ---------- */
.call-who { font-weight: 600; }
.line-row input[type="time"] { width: auto; }
.line-row input[type="checkbox"] { width: auto; margin: 0; }
.line-row label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: inherit; color: var(--ink); }

/* ---------- small fits ---------- */
.spread > h2 { margin: 0; }
.spread:has(> h2) { margin-bottom: 10px; }
section:has(#dg-read) .card h3 { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
section:has(#dg-read) .card .item:first-of-type { border-top: 0; padding-top: 0; }
@media (max-width: 640px) {
  .draft .actions .primary { flex: 1 1 58%; }
  .draft .actions .primary + button { flex: 1 1 24%; }
  .draft .actions .quiet { min-height: 36px; font-size: 13px; }
}
#mic { width: 46px; padding: 0; font-size: 0; gap: 0; flex: none; }
#mic::before { width: 20px; height: 20px; }
.composer textarea { flex: 1 1 auto; }
.composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
.login { width: calc(100% - 28px); }

/* ---------- Ask from anywhere, on tablets and computers: Atlas floats in the corner and opens a panel ---------- */
nav#tabs .ask-face { display: none; }
#atlas-fab { position: fixed; right: 18px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 8; width: 76px; height: 76px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#atlas-fab img { width: 72px; height: 72px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .75)); transition: transform .15s, filter .15s; }
#atlas-fab:hover { filter: none; }
#atlas-fab:hover img { transform: translateY(-3px) scale(1.04); }
#atlas-fab:active { transform: none; }
#atlas-fab[aria-expanded="true"] img { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .75)) drop-shadow(0 0 14px rgba(91, 155, 255, .7)); }
#ask-panel { position: fixed; right: 20px; bottom: calc(102px + env(safe-area-inset-bottom)); z-index: 8; display: flex; flex-direction: column; width: min(420px, calc(100vw - 40px)); height: min(640px, calc(100dvh - 130px));
  background: linear-gradient(180deg, #15181d, #101216); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 30px 70px -18px #000; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 14px; border-bottom: 1px solid var(--line-soft); }
.panel-head .grow { flex: 1 1 auto; line-height: 1.25; }
.panel-head button { min-height: 34px; }
.panel-head button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
#panel-close { font-size: 22px; line-height: 1; padding: 0 9px; }
#panel-talk { flex: 1 1 auto; overflow-y: auto; margin: 0; padding: 14px; }
#panel-talk .bubble.them { position: relative; margin-left: 42px; max-width: calc(92% - 42px); }
#panel-talk .bubble.them::before { content: ""; position: absolute; left: -42px; bottom: -3px; width: 34px; height: 34px; background: url("/atlas.svg") center / contain no-repeat; }
#panel-talk .bubble.me { max-width: 92%; }
#panel-form { position: static; padding: 10px 12px 12px; background: none; border-top: 1px solid var(--line-soft); }
#panel-mic, #panel-form button[type="submit"] { width: 46px; padding: 0; gap: 0; flex: none; }
#panel-mic::before, #panel-form button[type="submit"]::before, #panel-aloud::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
#panel-mic { --i: var(--i-mic); }
#panel-form button[type="submit"] { --i: var(--i-send); }
#panel-aloud { --i: var(--i-speaker); padding: 0 9px; }
.suggest { display: flex; width: 100%; justify-content: flex-start; margin-top: 8px; font-weight: 500; text-align: start; }
@media (prefers-reduced-motion: reduce) { #atlas-fab img { transition: none; } }

/* ---------- the Ask screen: the message box stays at the bottom of the page ---------- */
#ask-form { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; max-width: 860px; margin: 0 auto; padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line-soft); }
section:has(#ask-form) { padding-bottom: 84px; }
/* the floating Atlas is not needed on the Ask screen itself */
body:has(nav#tabs [data-tab="ask"].on) #atlas-fab, body:has(nav#tabs [data-tab="ask"].on) #ask-panel { display: none !important; }
@media (max-width: 640px) {
  /* sits on top of the bottom bar, with room underneath for the round Atlas button */
  #ask-form { bottom: calc(68px + env(safe-area-inset-bottom)); padding: 10px 12px 56px; }
  section:has(#ask-form) { padding-bottom: 124px; }
}

/* errands */
.errand a { color: var(--accent); }
.errand .opt { padding: 10px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.errand .opt.best { border: 1px solid var(--line-strong, var(--line)); border-radius: 12px; background: var(--raise, transparent); padding: 12px; }
.errand .best-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.errand .facts { color: var(--ink); margin-top: 6px; }
.errand .check { color: var(--warn); margin-top: 4px; }
.errand details { margin-top: 6px; }
.errand summary { cursor: pointer; color: var(--muted); font-size: 13px; padding: 6px 0; min-height: 32px; }
.errand details.others > summary { color: var(--accent); font-weight: 600; font-size: 14px; }
.errand details p { margin: 4px 0; }
a.btn.primary:hover { filter: brightness(1.06); }

/* ---------- People and their categories ---------- */
.picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pick { min-height: 34px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pick b { font-weight: 600; opacity: .7; margin-left: 5px; }
.pick[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.person { display: flex; align-items: center; gap: 10px; }
.person input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 0; }
.person .who { flex: 1 1 140px; min-width: 0; }
.person .who strong, .person .who .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.person select { flex: 0 1 190px; min-width: 120px; }
.person select.placed { border-color: var(--accent); color: var(--accent); }
#people-bulk { position: sticky; top: calc(var(--head-h) + 56px); z-index: 3; margin-top: 12px; align-items: center; gap: 10px; flex-wrap: wrap; border-color: var(--accent); }
#cat-manage summary { cursor: pointer; font-weight: 700; }
.cat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cat-row strong { flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; }
.cat-row input { flex: 1 1 220px; }
@media (max-width: 640px) {
  #people-bulk { top: var(--head-h); }
  .person select { flex-basis: 132px; }
  .cat-row strong { flex-basis: 100%; }
  .cat-row input { flex-basis: 100%; }
}

/* ---------- the lock screen ---------- */
#lock .login button.quiet { margin-top: 8px; }

/* ---------- Setup: sections that fold shut ---------- */
.fold-all { display: flex; justify-content: flex-end; gap: 4px; margin: -4px 0 8px; }
section.folds { margin-bottom: 10px; }
section.folds > h2 { margin: 0; padding: 0; }
section.folds:not(.folded) > h2 { margin-bottom: 10px; }
section.folds:not(.folded) { margin-bottom: 22px; }
h2 .fold { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--ink-2); -webkit-tap-highlight-color: transparent; }
h2 .fold:hover { border-color: var(--line-strong); color: var(--ink); }
h2 .fold:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h2 .fold svg { flex: none; color: var(--muted); transition: transform .15s; }
h2 .fold[aria-expanded="true"] { color: var(--accent); border-color: var(--line-strong); }
h2 .fold[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
section.folded > :not(h2) { display: none !important; }
@media (prefers-reduced-motion: reduce) { h2 .fold svg { transition: none; } }

/* ---------- attaching photos and files to a message ---------- */
.attach { flex: none; width: 46px; padding: 0; }
.attach::before { content: ""; display: block; width: 22px; height: 22px; margin: auto; background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.attach[data-attach="file"] { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5l-8.6 8.6a5.5 5.5 0 0 1-7.8-7.8l8.9-8.9a3.7 3.7 0 0 1 5.2 5.2l-8.8 8.8a1.8 1.8 0 0 1-2.6-2.6l8.1-8.1"/></svg>'); }
.attach[data-attach="camera"] { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 8h3l1.6-2.5h6.8L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z"/><circle cx="12" cy="13.2" r="3.4"/></svg>'); }
.tray { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 0; }
.tray[hidden] { display: none; }
.chip-file { display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 4px 4px 6px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--raise); font-size: 13px; }
.chip-file img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.chip-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-file button { min-height: 28px; padding: 0 8px; }
.sent-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.sent-files img { max-width: 140px; max-height: 140px; border-radius: 8px; }
#ask-panel .tray { padding: 6px 12px 0; }

/* ---------- Planner ---------- */
.rich p { margin: 0 0 8px; }
.rich ul { margin: 0 0 8px; padding-left: 20px; }
.rich li { margin: 0 0 5px; }
.rich a { word-break: break-all; }
.job .rich { margin-top: 8px; }

/* ---------- Fitness ---------- */
.fit-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fit-stats .card { padding: 12px 14px; }
.fit-stats .big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.fit-week { margin-top: 12px; }
.fit-week .pick.done { color: var(--ok); }
.exercise .sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 8px 0; }
.exercise .set { display: flex; align-items: center; gap: 6px; }
.exercise .set input { min-height: 40px; padding: 0 8px; text-align: center; min-width: 0; }
.exercise .set span:first-child { width: 12px; }
.exercise.logged > .spread strong { color: var(--ok); }
.bests .spread { padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 84px; margin-top: 6px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bars span { width: 100%; max-width: 44px; background: var(--accent); border-radius: 5px 5px 0 0; opacity: .85; }
.bars small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
details.fold-in > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 6px 2px; }
details.fold-in > form { margin-top: 8px; }
@media (max-width: 640px) {
  .fit-stats { grid-template-columns: 1fr 1fr; }
  .fit-stats .card:last-child { grid-column: 1 / -1; }
  .exercise .sets { grid-template-columns: 1fr 1fr; }
}

/* ---------- the morning page ---------- */
.morning .mdate { font-size: 20px; font-weight: 800; }
.morning .mweather { margin-top: 8px; }
.morning-part { margin-top: 14px; }
.morning-part h3 { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mline { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); align-items: baseline; }
.mline:last-child { border-bottom: 0; }
.mtime { flex: none; min-width: 52px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }

/* ---------- getting around: the menu button, the side menu, and the tabs under the bar ---------- */
nav#tabs .short { display: none; }
#menu { flex: none; width: 40px; min-height: 40px; padding: 0; margin-right: 2px; background: none; border-color: transparent; box-shadow: none; color: var(--ink-2); }
#menu:hover { color: var(--ink); background: var(--raise); }
#scrim { position: fixed; inset: 0; z-index: 19; background: rgba(0, 0, 0, .6); }
#side { position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); display: flex; flex-direction: column; background: var(--bar); border-right: 1px solid var(--line); box-shadow: 18px 0 40px -12px #000; overflow-y: auto; padding: 10px 10px calc(16px + env(safe-area-inset-bottom)); }
#side[hidden], #scrim[hidden] { display: none; }
.side-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 12px; }
.side-head strong { flex: 1; font-size: 17px; }
#side button { justify-content: flex-start; width: 100%; background: none; border-color: transparent; box-shadow: none; text-align: left; }
#side .side-group { min-height: 48px; gap: 12px; padding: 0 12px; font-size: 15.5px; font-weight: 650; color: var(--ink); }
#side .side-group svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
#side .side-leaf { min-height: 40px; padding: 0 12px 0 44px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
#side button:hover { background: var(--raise); }
#side button.on { background: var(--accent-soft); color: var(--accent); }
#side button.on svg { color: var(--accent); }
#side-close { width: 40px !important; justify-content: center !important; font-size: 22px; }
#subtabs { max-width: 860px; margin: 14px auto 0; padding: 0 14px; }
#subtabs[hidden] { display: none; }
#subtabs + main { padding-top: 12px; }
@media (max-width: 640px) { #subtabs { padding: 0 12px; margin-top: 12px; } }

/* ---------- Goals ---------- */
.goals { display: grid; gap: 12px; margin-top: 12px; }
.goal .goal-title { font-size: 16px; }
.goal .goal-pct { font-size: 20px; font-weight: 800; color: var(--accent); }
.goal .bar { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--raise-2); overflow: hidden; }
.goal .bar span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s; }
.goal.done .bar span { background: var(--ok); }
.goal-part { margin-top: 14px; }
.goal-part h3 { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.gstep { padding: 5px 0; border-bottom: 1px solid var(--line-soft); gap: 10px; }
.gstep:last-child { border-bottom: 0; }
.gstep.met > span:first-child { color: var(--ok); }
.gcheck { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; margin: 0; font-size: inherit; color: var(--ink); cursor: pointer; }
.gcheck input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; }
.gcheck.met span:first-of-type { color: var(--muted); text-decoration: line-through; }
.goal-part.coach { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.goal-number input { min-height: 40px; }

@media (max-width: 640px) { nav#tabs .short { display: inline; } nav#tabs .long { display: none; } }

/* ---------- the morning page: weather now and later, suggestions ---------- */
.mweather { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--raise); }
.wnow { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: flex-start; }
.wbig { font-size: 19px; font-weight: 800; }
.wwear { flex: 1 1 200px; }
.wlater { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.morning-part.msuggest { padding: 10px 12px; border: 1px solid var(--accent); border-radius: 12px; background: var(--accent-soft); }
.morning-part.msuggest h3 { color: var(--accent); }
.morning-part.msuggest .mline { border-color: rgba(91, 155, 255, .18); }

.morning-part h3 { display: flex; align-items: center; justify-content: space-between; }
.hide-part { min-height: 24px !important; width: 26px; padding: 0; font-size: 15px; opacity: .35; }
.hide-part:hover, .hide-part:focus-visible { opacity: 1; }
.mtime { min-width: 62px; }

/* ---------- Ask: history ---------- */
.day-line { align-self: stretch; display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day-line::before, .day-line::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }
.bubble a { color: inherit; text-decoration: underline; word-break: break-all; }
.bubble.them a { color: var(--accent); }

.note-did { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--accent); border-radius: 4px; background: var(--accent-soft); color: var(--ink-2); }

/* ---------- Settings, About you ---------- */
.about-row textarea { min-height: 40px; resize: vertical; }
.card a.btn { text-decoration: none; white-space: nowrap; }

/* A kept voice note in a chat: its player, and the button that turns it into words. */
.voice-note { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.voice-note audio { height: 34px; max-width: 100%; }

/* The picture of a filled-in booking page on its approval card. */
.booking-shot { display: block; width: 100%; max-height: 320px; object-fit: cover; object-position: top; border-radius: 10px; border: 1px solid var(--line, #2a2d33); margin: 8px 0; }

/* The home's temperature on the top bar: white while the heating is off, red while it is heating. */
#home-temp { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: #fff; margin-right: 8px; white-space: nowrap; }
#pause { white-space: nowrap; }
@media (max-width: 420px) { #home-temp { margin-right: 4px; } .head-right { gap: 6px; } }
#home-temp.heating { color: #ff4d4d; }

/* My day */
.day-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 2px 0 14px; }
.day-title { font-size: 22px; font-weight: 600; }
.day-part h2 .muted { font-weight: 400; text-transform: none; letter-spacing: 0; }
.mline.warn .grow > span:first-child, .mline.warn .mtime { color: var(--warn); }
.day-settings summary { cursor: pointer; }

/* Favourites in the Chats list */
.fav { color: #f2b43c; }

/* Choosing one account in Chats and Calls: one row that scrolls sideways on a phone */
.scope-picks { flex-wrap: nowrap; overflow-x: auto; margin: 0 0 10px; padding-bottom: 2px; scrollbar-width: none; }
.scope-picks .pick { flex: none; }

/* The small × that dismisses a line on My day, in its top corner. */
.mline.has-x { position: relative; padding-right: 24px; }
.day-x { position: absolute; top: 2px; right: -4px; background: none; border: 0; box-shadow: none; min-height: 0; min-width: 0; padding: 2px 8px; font-size: 17px; line-height: 1; color: var(--muted, #8b9099); cursor: pointer; }
.day-x:hover, .day-x:focus-visible { color: var(--text, #e8e9eb); }
