/* 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; }

  /* Atlas himself floats over every screen (#atlas-fab); the bar's Ask opens the whole conversation */
  nav#tabs { grid-template-columns: repeat(5, 1fr); }


  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: 110px; height: 110px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
#atlas-fab img { width: 104px; height: 104px; 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(136px + env(safe-area-inset-bottom)); z-index: 8; display: flex; flex-direction: column; width: min(420px, calc(100vw - 40px)); height: min(640px, calc(100dvh - 164px));
  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; }
/* Atlas can be dragged anywhere on the screen; where he was left is remembered (see app.js) */
#atlas-fab { touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#atlas-fab.dragging img { transform: scale(1.1); filter: drop-shadow(0 14px 20px rgba(0, 0, 0, .8)); transition: none; }
#atlas-fab img { pointer-events: none; -webkit-user-drag: none; }
#panel-full { padding: 0 9px; }
#panel-screen { margin-top: 2px; }
@media (max-width: 640px) {
  #atlas-fab { right: 12px; bottom: calc(80px + env(safe-area-inset-bottom)); width: 92px; height: 92px; }
  #atlas-fab img { width: 90px; height: 90px; }
  /* on a phone the panel is a sheet over the lower part of the screen, whatever the screen */
  #ask-panel { left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(72px + env(safe-area-inset-bottom)) !important; width: auto; height: min(72dvh, 600px); }
  #atlas-fab[aria-expanded="true"] { display: none; } /* the sheet has its own close button */
}
.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 12px; }
  section:has(#ask-form) { padding-bottom: 84px; }
}

/* 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="menu"] { --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>'); }
/* the paperclip opens a small menu: the camera, the phone's gallery, or any file */
#attach-menu { position: fixed; z-index: 12; display: flex; flex-direction: column; min-width: 210px; padding: 6px; background: #181b21; border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 18px 40px -12px #000; }
#attach-menu[hidden] { display: none; }
#attach-menu button { justify-content: flex-start; gap: 12px; border: 0; background: none; box-shadow: none; font-weight: 500; }
#attach-menu button:hover { background: var(--accent-soft); }
#attach-menu button::before { content: ""; flex: none; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
[data-pick="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>'); }
[data-pick="photo"] { --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"><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="8.5" cy="9.5" r="1.8"/><path d="M21 16l-5-5-9 9"/></svg>'); }
[data-pick="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="M6 3h9l4 4v14H6zM14 3v5h5"/></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. */
/* Clearing a line on My day: swipe it on a phone; on a computer a small × shows when the mouse is over it. */
.has-x { position: relative; touch-action: pan-y; }
.day-x { position: absolute; top: 3px; right: -2px; background: none; border: 0; box-shadow: none; min-height: 0; min-width: 0; padding: 1px 6px; font-size: 13px; line-height: 1; color: var(--muted, #8b9099); cursor: pointer; }
.day-x:hover, .day-x:focus-visible { color: var(--text, #e8e9eb); }
@media (hover: hover) { .mline.has-x { padding-right: 18px; } .day-x { opacity: 0; transition: opacity .12s; } .has-x:hover > .day-x, .day-x:focus-visible { opacity: 1; } }
@media (hover: none) { .has-x > .day-x { display: none; } }
/* Nutrition: the day's bars, the meal being checked, the week of meals and the shopping list. */
.nut-bars { display: grid; gap: 7px; margin-top: 12px; }
.nut-bar { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.nut-name { color: var(--muted); }
.nut-track { height: 8px; border-radius: 4px; background: var(--raise-2); overflow: hidden; }
.nut-track span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.nut-track span.over { background: var(--warn); }
.nut-num { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nut-draft { margin-top: 12px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--raise); }
.nut-items { margin-top: 8px; display: grid; gap: 6px; }
.nut-item { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)) 30px; gap: 5px; align-items: center; }
.nut-item.head { font-size: 12px; color: var(--muted); }
.nut-item label { margin: 0; min-width: 0; }
.nut-item label small { display: none; font-size: 11px; color: var(--muted); font-weight: 500; }
.nut-item input { width: 100%; min-width: 0; padding-left: 7px; padding-right: 5px; }
.nut-item button { min-height: 34px; min-width: 0; padding: 0; }
.nut-day { border-top: 1px solid var(--line-soft); padding: 8px 0; }
.nut-day > summary { cursor: pointer; }
.nut-day .item:first-of-type { border-top: 0; }
.nut-shop { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; padding: 6px 0; margin: 0; cursor: pointer; }
.nut-shop input { width: 20px; height: 20px; accent-color: var(--accent); }
.nut-shop.done span { text-decoration: line-through; color: var(--muted); }
.nut-tgt { display: grid; grid-template-columns: 1.3fr repeat(4, 1fr); gap: 8px; align-items: end; margin-bottom: 8px; }
.nut-tgt input { min-width: 0; }
@media (max-width: 620px) {
  .nut-item { grid-template-columns: repeat(5, minmax(0, 1fr)); padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
  .nut-item.head { display: none; }
  .nut-item label small { display: block; }
  .nut-item label:first-child { grid-column: 1 / 5; }
  .nut-item button { grid-row: 1; grid-column: 5; align-self: end; }
  .nut-tgt { grid-template-columns: 1fr 1fr; }
  .nut-tgt strong { grid-column: 1 / -1; }
}
.nut-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
/* Nutrition: a dish opens into its recipe. */
.nut-dish { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; min-height: 0; text-align: left; font-weight: 700; color: var(--ink); background: none; border: 0; box-shadow: none; }
.nut-dish:hover { color: var(--accent); filter: none; background: none; }
.nut-chev { color: var(--muted); font-size: 12px; }
.nut-recipe { margin-top: 8px; padding: 12px; border-radius: 12px; background: var(--raise); border: 1px solid var(--line-soft); }
.nut-rh { margin: 10px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.nut-ing { list-style: none; margin: 0; padding: 0; }
.nut-ing li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 4px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.nut-ing li:first-child { border-top: 0; }
.nut-amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.nut-steps { margin: 0; padding-left: 22px; }
.nut-steps li { padding: 4px 0; font-size: 14px; line-height: 1.45; }
/* Trips: each booking's checklist, notes and links. */
.trip-prep { margin: 2px 0 10px; padding: 8px 12px; border-radius: 10px; background: var(--raise); border: 1px solid var(--line-soft); }
.trip-prep > summary { cursor: pointer; }
.prep-h { margin: 12px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.prep-notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.trip-prep .nut-shop { grid-template-columns: 22px 1fr auto; }
/* Money: your own name for an account, edited in place. */
.bank-nick { width: auto; min-width: 0; max-width: 220px; padding: 2px 6px; min-height: 0; font-weight: 600; background: transparent; border-color: transparent; }
.bank-nick:hover, .bank-nick:focus { border-color: var(--line-strong); background: var(--raise); }

/* ---------- a reply waiting for approval: redraft it by typing or speaking ---------- */
.redo { margin-top: 8px; flex-wrap: nowrap; }
.redo input { flex: 1 1 auto; min-width: 0; }
.mic-i { width: 44px; padding: 0; gap: 0; flex: none; }
.mic-i::before { content: ""; flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i-mic) center / contain no-repeat; mask: var(--i-mic) center / contain no-repeat; }
.redo button[data-redo-go] { flex: none; }
.chat-acts { margin: 4px 0 12px; }
.chat-acts .btn, .chat-acts button { flex: 1 1 auto; justify-content: center; }

/* An agenda drafted for a meeting, folded under the day's events. */
.mprep { border-bottom: 1px solid var(--line-soft); padding: 5px 0; }
.mprep > summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: baseline; }
.mprep > summary::after { content: "▾"; margin-left: auto; color: var(--muted); }
.mprep[open] > summary::after { content: "▴"; }
.mprep .mtime { color: var(--accent); }

/* A My day line that takes you somewhere: the words are the button. */
.mline .mgo { all: unset; flex: 1; min-width: 0; cursor: pointer; display: block; }
.mline .mgo:hover > span[dir], .mline .mgo:focus-visible > span[dir] { text-decoration: underline; text-underline-offset: 3px; }
.mline .mgo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.mline .mgo-arrow { color: var(--accent); margin-left: 6px; font-weight: 600; }

/* Dragging an account along the row at the top of Chats and Calls. */
.scope-picks .pick { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.scope-picks.sorting { overflow-x: hidden; }
.scope-picks .pick.lifted { transform: scale(1.08); box-shadow: 0 6px 18px rgba(0, 0, 0, .45); border-color: var(--accent); z-index: 2; position: relative; }

/* Ask: the conversation scrolls in its own box; the options fold away under a small arrow. */
.ask-screen h2 { margin-bottom: 4px; }
.ask-fold { min-width: 36px; font-size: 16px; line-height: 1; padding: 4px 10px; }
.talk.boxed { overflow-y: auto; overscroll-behavior: contain; margin-bottom: 0; padding: 4px 4px 8px 0; border-top: 1px solid var(--line-soft); }
section.ask-screen:has(#ask-form) { padding-bottom: 0; }

/* Usage ring: how much of the month's AI allowance a user's Atlas has used. */
.ring { flex: none; vertical-align: middle; }
.ring circle { fill: none; }
.ring-bg { stroke: var(--line-strong); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.ring.high .ring-fg { stroke: var(--warn); }
.ring.full .ring-fg { stroke: var(--danger); }
.ring-text { fill: var(--ink); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
#spend:has(.ring) { display: inline-flex; align-items: center; gap: 5px; }
.usage-card { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--raise); }
#usage-pop { position: fixed; right: 10px; z-index: 60; width: min(300px, calc(100vw - 20px)); display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); box-shadow: 0 14px 30px -12px #000; }
#spend[role="button"] { cursor: pointer; padding: 4px; margin: -4px; border-radius: 50%; }

/* Fitness: the how-to video and stopwatch buttons, and the stopwatch itself. */
.fit-tools { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
a.btn.fit-video, button.fit-video { min-height: 30px; padding: 0 10px; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.fit-watch { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 16px; }
.fit-watch-card { width: min(340px, 100%); padding: 18px 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); text-align: center; }
.fit-watch-time { font-size: 56px; font-weight: 600; font-variant-numeric: tabular-nums; margin: 10px 0 14px; letter-spacing: .5px; }
.fit-watch-go { min-width: 120px; font-size: 17px; }

/* Speech trial: what each service heard, side by side; tap the ones that got it right. */
.speech-picks { display: grid; gap: 6px; margin-top: 6px; }
.speech-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 8px 10px; text-align: start; font-weight: 400; white-space: normal; }
.speech-pick.on { border-color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
.speech-none { justify-self: start; }
.speech-none.on { color: var(--danger); }

/* Send feedback: a small box over the screen. */
.fb-dialog { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(0, 0, 0, .6); padding: 16px; }
.fb-card { width: min(460px, 100%); padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--raise); }
.fb-card textarea { width: 100%; }

/* ---------- The welcome tour: Atlas's face leads a new user through what it does (tour.js). ---------- */
body.tour-open { overflow: hidden; }
.tour { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: radial-gradient(120% 80% at 50% 0%, #13213a 0%, var(--bg) 60%); color: var(--ink); animation: tr-fade .35s ease both; padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); }
.tour.leaving { animation: tr-fade .28s ease reverse both; }
.tour-skip { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 2; }
.tour-stage { flex: 1; display: grid; grid-template-rows: auto auto auto; justify-items: center; align-content: center; gap: 14px; max-width: 520px; width: 100%; margin: 0 auto; min-height: 0; }
.tour-guide { position: relative; width: 112px; height: 112px; }
.tour-face { width: 100%; height: 100%; filter: drop-shadow(0 10px 24px rgba(91, 155, 255, .35)); animation: tr-bob 3s ease-in-out infinite; transform-origin: 50% 80%; }
.tour-shadow { position: absolute; left: 22%; right: 22%; bottom: -10px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .45); filter: blur(4px); animation: tr-shadow 3s ease-in-out infinite; }
.tour-guide.hop { animation: tr-hop .6s cubic-bezier(.3, 1.6, .5, 1) both; }
.tour-guide.pose-wave .tour-face { animation: tr-wave 1.6s ease-in-out 2, tr-bob 3s ease-in-out 3.2s infinite; }
.tour-guide.pose-read .tour-face { animation: tr-tilt 2.4s ease-in-out infinite; }
.tour-guide.pose-write .tour-face { animation: tr-nod 1.2s ease-in-out infinite; }
.tour-guide.pose-listen .tour-face { animation: tr-pulse 1.4s ease-in-out infinite; }
.tour-guide.pose-tick .tour-face { animation: tr-nod .9s ease-in-out infinite; }
.tour-guide.pose-cheer .tour-face { animation: tr-jump 1s ease-in-out infinite; }
.tour-guide.pose-guard .tour-face { animation: tr-bob 3s ease-in-out infinite; }
.tour-guide.pose-finale { width: 150px; height: 150px; }
.tour-guide.pose-finale .tour-face { animation: tr-spin 1.2s cubic-bezier(.3, 1.4, .5, 1) both, tr-bob 3s ease-in-out 1.2s infinite; }
.tour-say { position: relative; max-width: 440px; padding: 12px 16px; border-radius: 16px; background: var(--raise); border: 1px solid var(--line-strong); box-shadow: 0 12px 30px -16px #000; min-height: 74px; cursor: default; }
.tour-say::before { content: ""; position: absolute; top: -8px; left: 50%; width: 14px; height: 14px; background: var(--raise); border-left: 1px solid var(--line-strong); border-top: 1px solid var(--line-strong); transform: translateX(-50%) rotate(45deg); }
.tour-say p { margin: 0; font-size: 16.5px; line-height: 1.5; }
.tour-art { width: 100%; display: grid; place-items: center; min-height: 190px; align-self: start; }
.tour-art.in > * { animation: tr-rise .5s ease both; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 520px; width: 100%; margin: 0 auto; }
.tour-dots { display: flex; gap: 7px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); cursor: pointer; transition: all .25s; }
.tour-dots span.on { width: 20px; border-radius: 4px; background: var(--accent); }
.tour-next { min-width: 110px; }

/* The pictures */
.tr-hello span, .tr-start span { font-size: 64px; display: inline-block; animation: tr-wave 1.4s ease-in-out infinite; transform-origin: 70% 80%; }
.tr-start span { animation: tr-twinkle 1.6s ease-in-out infinite; }
.tr-msgs, .tr-list, .tr-day { width: min(330px, 100%); display: grid; gap: 8px; }
.tr-msg, .tr-li, .tr-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); opacity: 0; animation: tr-slide .45s ease var(--d, 0s) both; font-size: 14px; }
.tr-msg b { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tr-msg b.wa { background: #25d366; }
.tr-msg b.em { background: #ea4335; }
.tr-msg b.sms { background: var(--accent); }
.tr-msg b.star { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }
.tr-msg.tr-key { border-color: var(--warn); background: var(--warn-soft); }
.tr-draft { position: relative; width: min(330px, 100%); padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); }
.tr-draft .tr-typed { margin: 8px 0 12px; min-height: 22px; font-size: 15px; }
.tr-typed::after { content: "▍"; margin-left: 1px; color: var(--accent); animation: tr-caret 1s steps(2) infinite; }
.typed .tr-typed::after { display: none; }
.tr-btns { display: flex; gap: 8px; justify-content: flex-end; }
.tr-btn { padding: 6px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 600; border: 1px solid var(--line-strong); }
.tr-btn.go { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.typed .tr-btn.go { animation: tr-press .5s ease .4s both; }
.tr-tick { position: absolute; left: 0; right: 0; bottom: -30px; text-align: center; color: var(--ok); font-size: 13.5px; font-weight: 600; opacity: 0; }
.typed .tr-tick { animation: tr-rise .4s ease .9s both; }
.tr-day-h { font-weight: 700; font-size: 18px; margin-bottom: 2px; }
.tr-row i { font-style: normal; color: var(--muted); font-size: 12.5px; min-width: 64px; }
.tr-row.warn { border-color: var(--warn); }
.tr-ask { display: grid; justify-items: center; gap: 14px; width: min(330px, 100%); }
.tr-mic { position: relative; width: 74px; height: 74px; display: grid; place-items: center; }
.tr-mic b { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 28px; }
.tr-mic span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); animation: tr-ripple 1.8s ease-out infinite; }
.tr-mic span:nth-child(2) { animation-delay: .6s; }
.tr-mic span:nth-child(3) { animation-delay: 1.2s; }
.tr-bubble { padding: 10px 14px; border-radius: 14px 14px 4px 14px; background: var(--accent-soft); border: 1px solid #2a4673; min-height: 42px; font-size: 15px; justify-self: end; }
.tr-li b { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line-strong); flex: none; position: relative; }
.tr-li b::after { content: "✓"; position: absolute; inset: -3px 0 0 2px; color: var(--ok); font-weight: 800; opacity: 0; animation: tr-check .3s ease calc(var(--d) + .5s) both; }
.tr-rings { display: flex; gap: 16px; }
.tr-ring { display: grid; justify-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.tr-ring svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.tr-ring circle { fill: none; stroke-width: 7; }
.tr-ring .bg { stroke: var(--line-strong); }
.tr-ring .fg { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 163.4; stroke-dashoffset: 163.4; animation: tr-fill 1.2s ease var(--d) forwards; }
.tr-safe { display: grid; justify-items: center; gap: 10px; }
.tr-shield { font-size: 54px; animation: tr-pulse 2s ease-in-out infinite; }
.tr-mask { position: relative; width: 220px; height: 38px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.tr-mask span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14.5px; }
.tr-mask .a { animation: tr-out .5s ease calc(var(--d, 0s) + 1s) both; }
.tr-mask .b { color: var(--accent); font-weight: 600; animation: tr-in .5s ease calc(var(--d, 0s) + 1.2s) both; }

@keyframes tr-fade { from { opacity: 0; } }
@keyframes tr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes tr-shadow { 0%, 100% { transform: scaleX(1); opacity: .8; } 50% { transform: scaleX(.8); opacity: .5; } }
@keyframes tr-hop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-26px) scale(1.06, .94); } 70% { transform: translateY(4px) scale(.96, 1.04); } 100% { transform: none; } }
@keyframes tr-wave { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(6deg); } }
@keyframes tr-tilt { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-8deg) translateX(-4px); } 70% { transform: rotate(8deg) translateX(4px); } }
@keyframes tr-nod { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(4px) rotate(4deg); } }
@keyframes tr-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes tr-jump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-18px) rotate(-6deg); } 60% { transform: translateY(-18px) rotate(6deg); } }
@keyframes tr-spin { from { transform: scale(.3) rotate(-200deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tr-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes tr-slide { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
@keyframes tr-caret { 50% { opacity: 0; } }
@keyframes tr-press { 40% { transform: scale(.9); } 100% { transform: scale(1); box-shadow: 0 0 0 6px rgba(91, 155, 255, .25); } }
@keyframes tr-ripple { from { transform: scale(.9); opacity: .8; } to { transform: scale(1.9); opacity: 0; } }
@keyframes tr-check { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: none; } }
@keyframes tr-fill { to { stroke-dashoffset: calc(163.4 * (1 - var(--p))); } }
@keyframes tr-out { to { opacity: 0; transform: translateY(-100%); } }
@keyframes tr-in { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
@keyframes tr-twinkle { 0%, 100% { transform: scale(1) rotate(0); } 50% { transform: scale(1.25) rotate(15deg); } }
.tour.still *, .tour.still *::before, .tour.still *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
@media (max-height: 640px) { .tour-guide { width: 84px; height: 84px; } .tour-art { min-height: 150px; } }

/* Connected services: the catalogue of services with an official connector. */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.conn-tile { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.conn-tile button, .conn-tile .tag { align-self: flex-start; margin-top: 4px; }

/* Planner: Tasks (tasks.js). */
.tk-modes { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; }
.tk-add { display: flex; gap: 8px; }
.tk-add input { flex: 1; min-width: 0; }
.tk-preview { min-height: 18px; margin: 4px 2px; color: var(--accent); }
.tk-filters { margin-bottom: 4px; }
.tk-h { font-size: 12.5px; color: var(--muted); margin: 14px 2px 6px; }
.tk-late, .tk-h.tk-late { color: var(--danger); }
.tk-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.tk-row { display: flex; gap: 10px; align-items: flex-start; }
button.tk-box { flex: none; width: 22px; height: 22px; min-height: 0; padding: 0; margin-top: 2px; border-radius: 6px; border: 2px solid var(--line-strong); background: none; box-shadow: none; font-size: 13px; }
button.tk-box.p1 { border-color: var(--accent); }
button.tk-box.p2 { border-color: var(--warn); }
button.tk-box.p3 { border-color: var(--danger); }
button.tk-box.on { background: var(--ok); border-color: var(--ok); color: #08130d; }
.tk-note { width: 22px; text-align: center; color: var(--warn); flex: none; }
button.tk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; text-align: start; gap: 1px; background: none; border: 0; box-shadow: none; padding: 0; min-height: 0; font-weight: 400; white-space: normal; height: auto; }
.tk-nav { margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.tk-grid { display: grid; grid-template-columns: 44px repeat(var(--n), minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
button.tk-gh { background: none; border: 0; border-radius: 0; box-shadow: none; min-height: 32px; padding: 4px 2px; font-size: 12px; font-weight: 400; color: var(--muted); }
button.tk-gh.today b { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 6px; }
.tk-gl { padding: 4px 4px; border-top: 1px solid var(--line); font-size: 10.5px; }
.tk-allday { border-top: 1px solid var(--line); border-left: 1px solid var(--line-soft); padding: 3px; min-height: 30px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tk-hours { position: relative; border-top: 1px solid var(--line); }
.tk-hours span { position: absolute; left: 4px; font-size: 10.5px; color: var(--muted); }
.tk-col { position: relative; border-top: 1px solid var(--line); border-left: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line-soft) 47px 48px); }
.tk-ev { position: absolute; border-radius: 7px; padding: 2px 5px; overflow: hidden; font-size: 11.5px; line-height: 1.3; background: var(--c); color: #fff; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; box-sizing: border-box; }
.tk-ev b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.tk-ev span { font-size: 10.5px; opacity: .85; }
.tk-ev.meet, .tk-chip.meet { background: #3d366f; color: #e7e3ff; cursor: default; }
.tk-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: ns-resize; touch-action: none; }
.tk-resize::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 26px; height: 3px; margin-left: -13px; border-radius: 2px; background: rgba(255, 255, 255, .65); }
.tk-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--danger); pointer-events: none; }
.tk-chip { font-size: 11px; line-height: 1.35; padding: 2px 5px; border-radius: 5px; background: var(--c); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.tk-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.tk-cell { min-height: 74px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px; display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: start; }
.tk-cell.out { opacity: .45; }
button.tk-num { align-self: center; background: none; border: 0; box-shadow: none; min-height: 0; padding: 0 6px; font-size: 12px; }
.tk-cell.today button.tk-num { background: var(--accent); color: var(--accent-ink); border-radius: 999px; }
.tk-over-drop { outline: 2px dashed var(--accent); outline-offset: -2px; }
.tk-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.tk-quad { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: var(--card); }
.tk-quad.a > strong { color: var(--danger); }
.tk-quad.b > strong { color: var(--accent); }
.tk-quad.c > strong { color: var(--warn); }
.tk-shade { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .45); display: none; }
.tk-shade.open { display: block; }
.tk-shade.open.aside { opacity: 0; pointer-events: none; }
.tk-panel { position: fixed; top: 0; bottom: 0; right: 0; z-index: 41; width: min(320px, 82vw); box-sizing: border-box; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top)) 12px calc(76px + env(safe-area-inset-bottom)); background: var(--raise); border-left: 1px solid var(--line-strong); transform: translateX(105%); transition: transform .22s ease, visibility .22s; visibility: hidden; }
.tk-panel.open { transform: none; visibility: visible; }
.tk-panel.open.aside { transform: translateX(105%); pointer-events: none; }
.tk-tabs button.on { color: var(--accent); border-bottom: 2px solid var(--accent); border-radius: 0; }
.tk-pool { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.tk-pool h4 { margin: 12px 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.tk-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 5px; padding: 8px 10px; border-radius: 8px; background: var(--c); color: #fff; font-size: 13.5px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: grab; }
.tk-bar span.grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-bar small { font-size: 10.5px; opacity: .85; white-space: nowrap; }
.tk-pfoot { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); max-height: 30vh; overflow-y: auto; }
.lifted { opacity: .35; }
.tk-ghost { position: fixed; z-index: 80; width: 180px; padding: 6px 10px; border-radius: 8px; background: var(--c); color: #fff; font-size: 13px; pointer-events: none; box-shadow: 0 10px 24px -8px #000; }
.tk-ghost b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-ghost span { font-size: 11.5px; }
.tk-over { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; justify-content: center; }
.tk-sheet { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; box-sizing: border-box; padding: 16px 14px calc(18px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; background: var(--raise); border: 1px solid var(--line-strong); }
.tk-sheet form > input, .tk-sheet textarea { width: 100%; box-sizing: border-box; }
.tk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.tk-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.tk-fields input, .tk-fields select { width: 100%; box-sizing: border-box; min-width: 0; }
.tk-sub { margin-bottom: 6px; }
@media (min-width: 1100px) {
  /* Wide screens: the panel stays beside the calendar. */
  body.tk-docked .tk-shade { display: none; }
  body.tk-docked main { margin-right: 340px; }
}

/* The lock button in the top bar. */
#lock-app { min-height: 0; padding: 6px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
#lock-app:hover { color: var(--ink); }

/* Planner: Shopping (shopping.js). */
.shop-row { display: flex; gap: 10px; align-items: center; }
.shop-row.got .tk-main span:first-child { text-decoration: line-through; opacity: .55; }
button.shop-box { width: 26px; height: 26px; margin-top: 0; }
