/* Atlas: light, Muse-style mobile chat. */
@font-face {
  font-family: "Inter";
  src: url("inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
#app[hidden], #offline-guide[hidden], .view[hidden] { display: none !important; }
#offline-guide { max-height: 100dvh; overflow: auto; max-width: 26rem; margin: auto; padding: 2rem 1.25rem; line-height: 1.5; }
#offline-guide img { border-radius: 12px; }
#offline-guide p { color: var(--muted); }
#offline-guide summary { padding: 0.65rem 0; cursor: pointer; }
:root {
  color-scheme: light;
  --bg: #fcfcfc;
  --surface: #ffffff;
  --raised: #f2f2f3;
  --line: rgba(0, 0, 0, 0.075);
  --ink: #111214;
  --muted: #6e6f73;
  --accent: #1f6fe5;
  --bubble: #e9eaec;
  --mine: #cce4fe;
  --glass: rgba(255, 255, 255, 0.86);
  --shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
  --app-height: 100dvh;
  --head: 138px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-size: 16px;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
button, textarea, input { font: inherit; color: inherit; }
button {
  border: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.12s var(--ease), transform 0.12s var(--ease);
}
button:active:not(:disabled) { transform: scale(0.96); }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

#app {
  position: absolute;
  inset-inline: 0;
  top: var(--app-top, 0px);
  height: var(--app-height);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
}
.view {
  grid-row: 1;
  grid-column: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d6d6d8 transparent;
}

/* Header floats over the content, like Muse. */
.top {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
}
.top::before {
  content: "";
  position: absolute;
  inset: 0 calc(50% - 50vw) -22px;
  z-index: -1;
  background: linear-gradient(var(--bg) 0, var(--bg) 45%, rgba(252, 252, 252, 0.85) 70%, rgba(252, 252, 252, 0));
}
.top > * { pointer-events: auto; }
.disc {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
}
.nav, .capsule {
  margin-top: 4px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.nav { width: 46px; height: 46px; }
.nav svg { stroke-width: 1.9; }
.capsule {
  justify-self: end;
  display: flex;
  align-items: center;
  height: 46px;
  padding: 0 3px;
  border-radius: 23px;
}
.capsule > button {
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  border-radius: 20px;
}
.capsule #more svg { width: 20px; }

.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 6px;
  border-radius: 24px;
}
.halo {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, #ffffff 0, #f6f6f7 60%, #eeeef0 100%);
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}
.name-pill {
  position: relative;
  z-index: 1;
  margin-top: -13px;
  display: grid;
  justify-items: center;
  padding: 3px 11px 4px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  line-height: 1.2;
}
.name-pill b { font-size: 14px; font-weight: 650; letter-spacing: -0.01em; }
.name-pill small { font-size: 12px; color: var(--muted); white-space: nowrap; }
.name-pill small:empty { display: none; }
.name-pill:has(small:not(:empty)) { padding: 4px 14px 5px; }

/* Conversation */
#messages {
  max-width: 720px;
  min-height: 100%;
  margin: auto;
  padding: var(--head) 16px 10px;
  display: flex;
  flex-direction: column;
  justify-content: safe flex-end;
  gap: 8px;
}
.message {
  margin: 0;
  max-width: min(82%, 540px);
  padding: 10px 15px 11px;
  border-radius: 21px;
  font-size: 16px;
  line-height: 1.38;
  letter-spacing: -0.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message.user { align-self: flex-end; background: var(--mine); color: #0b1a2b; }
.message.assistant, .message.typing { align-self: flex-start; background: var(--bubble); color: var(--ink); }
.message.user + .message.assistant,
.message.user + .message.typing,
.message.assistant + .message.user { margin-top: 8px; }
.message.typing { display: flex; gap: 5px; padding: 15px 17px; }
.message.typing i { width: 7px; height: 7px; border-radius: 50%; background: #646569; animation: dot 1.1s ease-in-out infinite; }
.message.typing i:nth-child(2) { animation-delay: 0.15s; }
.message.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { opacity: 0.35; transform: none; } 30% { opacity: 1; transform: translateY(-2px); } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.message.fresh { animation: rise 0.28s var(--ease); transform-origin: bottom left; }
.message.user.fresh { transform-origin: bottom right; }
.empty {
  margin: auto 0 4px;
  align-self: center;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 270px;
}
.empty b { display: block; color: var(--ink); font-size: 28px; font-weight: 650; letter-spacing: -0.035em; line-height: 1.1; margin-bottom: 6px; }
.empty span { display: block; font-size: 15.5px; }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0 2px; width: 100%; }
.starters button {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 112px;
  padding: 12px 13px 13px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.07);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  text-align: left;
  color: var(--ink);
  transition: transform 0.18s var(--ease), box-shadow 0.18s;
}
.starters .tile { width: 32px; height: 32px; border-radius: 10px; margin-bottom: 9px; }
.starters .tile svg { width: 17px; height: 17px; }
.starters b { font-size: 14.5px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.starters small { color: var(--muted); font-size: 12.5px; }

/* Dock: message pill + tab bar */
.dock {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-row: 2;
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 6px max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  display: grid;
  gap: 10px;
}
#composer {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 50px;
  padding: 3px 4px;
  background: var(--surface);
  border: 1px solid rgba(0, 0, 0, 0.085);
  border-radius: 25px;
  box-shadow: var(--shadow);
}
#composer:focus-within { border-color: rgba(0, 0, 0, 0.16); }
#draft {
  flex: 1;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  max-height: 120px;
  margin: 0;
  padding: 10px 2px;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 16px;
  line-height: 22px;
  caret-color: var(--accent);
}
#draft::placeholder { color: #9a9ba0; }
#draft:focus-visible { outline: 0; }
.plain {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2b2c30;
}
#prompts svg { stroke-width: 1.9; width: 21px; }
#mic { color: #8b8c91; }
#mic svg { width: 20px; }
#mic.listening { color: var(--accent); background: #e7f0ff; }
#send {
  flex: none;
  width: 38px;
  height: 38px;
  margin: 2px 2px 2px 0;
  background: var(--ink);
  color: #fff;
  animation: pop-in 0.2s var(--ease);
}
#send svg { width: 18px; height: 18px; stroke-width: 2.4; }
#send:disabled { display: none; }
@keyframes pop-in { from { transform: scale(0.6); opacity: 0; } }
.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  height: 60px;
  padding: 5px;
  border-radius: 30px;
  background: rgba(244, 244, 245, 0.94);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.tabs button { display: grid; place-items: center; border-radius: 25px; color: #1d1e21; }
.tabs button[aria-pressed="true"] { background: #e3e4e7; }
.tabs svg { width: 23px; height: 23px; }
.dock[data-tab]:not([data-tab="chat"]) #composer { display: none; }

/* Pages: Ideas, Checklist, Settings */
.page { padding: var(--head) 0 16px; }
.page > * { max-width: 720px; margin-inline: auto; }
.page h2 { margin: 2px auto 8px; padding: 0 20px; font-size: 22px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; }
.idea {
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 20px;
  text-align: left;
}
.idea + .idea { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.idea b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.3; }
.idea span { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; line-height: 1.42; }
.tile { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.tile svg { width: 21px; height: 21px; stroke-width: 1.9; }
.tone-blue { background: #e6f0ff; color: #1f6fe5; }
.tone-violet { background: #efe9ff; color: #6a43d8; }
.tone-green { background: #e3f6ea; color: #1d8a4b; }
.tone-amber { background: #fff1dc; color: #c26a00; }
.tone-rose { background: #ffe7ea; color: #cf3049; }
.group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 16px auto 2px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 650;
}
.group-title i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.group-title span { color: var(--ink); }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.go { width: 44px; height: 44px; margin: 4px 10px 0 0; display: grid; place-items: center; border-radius: 50%; color: #a3a4a8; }
.go svg { width: 18px; height: 18px; stroke-width: 2.1; }
.task {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 11px 20px;
  text-align: left;
}
.task .box {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1.6px solid #5c5d62;
  border-radius: 5px;
  display: grid;
  place-items: center;
  transition: background-color 0.15s, border-color 0.15s;
}
.task .box svg { width: 14px; height: 14px; stroke-width: 2.8; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.2s var(--ease); }
.task[aria-pressed="true"] .box { background: var(--ink); border-color: var(--ink); }
.task[aria-pressed="true"] .box svg { opacity: 1; transform: none; }
.task b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.task span { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.task[aria-pressed="true"] b { color: var(--muted); text-decoration: line-through; text-decoration-color: #b4b5b9; }
.progress { padding: 0 20px; color: var(--muted); font-size: 14px; margin-top: -2px; }
.card {
  margin: 0 16px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
  overflow: hidden;
}
@media (min-width: 752px) { .card { margin-inline: auto; } }
.card-label { margin: 18px auto 8px; padding: 0 20px; font-size: 13px; font-weight: 600; color: var(--muted); }
.row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px 10px 14px;
  text-align: left;
}
.row + .row { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.row b { display: block; font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.row small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; }
.row .value { display: flex; align-items: center; gap: 2px; color: var(--muted); font-size: 15px; white-space: nowrap; }
.row .value svg { width: 16px; height: 16px; color: #b0b1b5; stroke-width: 2.2; }
.row .thumb { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; }
.row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.row .thumb.pic { background: var(--raised); }
.row .thumb.pic img { width: 26px; height: 26px; }

/* Sheets */
dialog {
  color: var(--ink);
  width: min(calc(100% - 24px), 420px);
  max-height: min(78dvh, 600px);
  padding: 18px 16px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.18);
  overflow: auto;
  overscroll-behavior: contain;
}
dialog::backdrop { background: rgba(17, 18, 20, 0.28); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 10px 4px; }
.sheet-head h1 { font-size: 19px; letter-spacing: -0.03em; line-height: 1.15; margin: 0; }
.close { width: 36px; height: 36px; background: var(--raised); }
.close svg { width: 15px; height: 15px; stroke-width: 2.2; }
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 12px 10px;
  gap: 12px;
  border-radius: 12px;
  min-height: 46px;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.choice + .choice { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.marker { color: var(--accent); font-size: 14px; font-weight: 600; white-space: nowrap; }
.subtext { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 6px 12px; }
.label { margin: 14px 6px 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 4px 0 2px; border-radius: 14px; background: var(--raised); }
.seg button { min-height: 40px; border-radius: 10px; font-size: 15px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1); }
.about-img { display: block; width: 64px; height: 64px; object-fit: contain; margin: 4px auto 16px; border-radius: 16px; }
#notice {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 136px);
  animation: rise 0.25s var(--ease);
  transform: translateX(-50%);
  padding: 9px 15px;
  border-radius: 18px;
  background: #1c1c1e;
  color: #fff;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  width: max-content;
  max-width: 88%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
#notice:empty { display: none; }

@media (min-width: 700px) {
  :root { --head: 152px; }
  .top { padding-top: 22px; }
  .dock { padding-bottom: 22px; }
  #messages { padding-inline: 8px; }
}
@media (max-width: 599px) {
  dialog:not(.drawer) { margin: auto auto max(12px, env(safe-area-inset-bottom)); animation: sheet-up 0.3s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
}
@media (max-width: 359px) {
  .capsule > button { padding: 0 6px; }
  .top { padding-inline: 12px; }
}
@media (max-height: 560px) {
  :root { --head: 100px; }
  .halo { width: 56px; height: 56px; }
  .name-pill { margin-top: -10px; }
  .tabs { height: 50px; }
  .dock { gap: 6px; padding-bottom: 6px; }
}
@media (hover: hover) and (pointer: fine) {
  .allow:not(:disabled):hover { background: #0f68dc; }
  .deny:not(:disabled):hover { background: #e4e5e8; }
  .follow button:hover { background: #f4f4f5; }
  button:not(:disabled):hover { background-color: rgba(0, 0, 0, 0.045); }
  .identity:hover, .identity:hover .name-pill { background-color: transparent !important; }
  .identity:hover .name-pill { background-color: var(--glass) !important; }
  .tabs button[aria-pressed="true"]:hover { background: #e3e4e7; }
  #send:not(:disabled):hover { background: #2c2d31; }
  .starters button:hover { background: #f4f4f5; }
  .seg button[aria-pressed="true"]:hover { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Header capsule: call controls swap in during a voice call. */
#mute, #hangup { display: none; }
#app[data-call] #call { display: none; }
#app[data-call] #mute, #app[data-call] #hangup { display: flex; }
#hangup { background: #ff3b30; color: #fff; margin-left: 2px; }
#hangup svg { stroke-width: 1.9; }
#mute[aria-pressed="true"] { background: var(--ink); color: #fff; }
#call svg, #mute svg { width: 20px; height: 20px; }
.halo { position: relative; transition: transform 0.45s var(--ease); }
.halo::before, .halo::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(31, 111, 229, 0.35);
  opacity: 0;
  pointer-events: none;
}
#app[data-call] .halo { transform: scale(1.12); }
#app[data-call] .halo::before { animation: ring 2.2s ease-out infinite; }
#app[data-call] .halo::after { animation: ring 2.2s ease-out 1.1s infinite; }
@keyframes ring { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(1.7); } }
#app[data-call] .name-pill small { color: var(--accent); font-variant-numeric: tabular-nums; }
#app[data-call] .dock::before {
  content: "";
  display: block;
  height: 3px;
  margin: 0 30%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: hum 1.6s ease-in-out infinite;
}
@keyframes hum { 50% { opacity: 0.25; transform: scaleX(0.6); } }

/* Reply attachments */
.attach {
  align-self: flex-start;
  width: min(88%, 380px);
  margin-top: -2px;
  padding: 5px;
  border-radius: 22px;
  background: var(--bubble);
  overflow: hidden;
}
.attach.fresh { animation: rise 0.34s var(--ease) 0.06s backwards; transform-origin: top left; }
.attach > * + * { margin-top: 5px; }
.att-head { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 8px 10px 6px; }
.att-head .tile { width: 34px; height: 34px; border-radius: 10px; }
.att-head .tile svg { width: 18px; height: 18px; }
.att-head b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.att-head small { display: block; color: var(--muted); font-size: 13px; }
.att-page {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 18px 16px 30px;
  border-radius: 17px;
  background: #fff;
  text-align: left;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.att-page b { font-size: 17px; letter-spacing: -0.02em; }
.att-page span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.quote, .slip, .route, .facts, .steps, .habits, .costbar, .legend { background: #fff; border-radius: 17px; }
.quote { position: relative; display: grid; gap: 4px; padding: 6px; background: transparent; }
.leg { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 15px; background: #fff; }
.leg small { display: block; color: var(--muted); font-size: 12.5px; }
.leg b { font-size: 22px; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.token { display: flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border-radius: 20px; background: var(--raised); font-size: 14.5px; font-weight: 600; }
.coin { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #fff; font-style: normal; font-size: 11.5px; font-weight: 700; }
.flip { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px; display: grid; place-items: center; border-radius: 11px; background: #fff; border: 3px solid var(--bubble); }
.flip svg { width: 15px; height: 15px; stroke-width: 2.3; }
.facts { display: grid; grid-template-columns: auto auto; margin: 0; padding: 4px 14px; }
.facts dt, .facts dd { margin: 0; padding: 9px 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { text-align: right; font-weight: 600; }
.facts dt:not(:first-child), .facts dt:not(:first-child) + dd { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 16px 14px; }
.node { display: grid; justify-items: center; gap: 1px; text-align: center; }
.node .coin { width: 34px; height: 34px; font-size: 14px; margin-bottom: 4px; }
.node small { color: var(--muted); font-size: 12px; }
.node b { font-size: 14px; }
.line { position: relative; height: 2px; margin-bottom: 30px; background: repeating-linear-gradient(90deg, #c9cacd 0 6px, transparent 6px 11px); }
.line i { position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: #1d8a4b; box-shadow: 0 0 0 4px rgba(29, 138, 75, 0.15); animation: travel 2.4s var(--ease) infinite; }
@keyframes travel { from { left: 0; } 80%, to { left: calc(100% - 10px); } }
.steps { margin: 0; padding: 6px 14px 6px 14px; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 11px; padding: 8px 0; font-size: 14.5px; }
.steps li + li { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.steps li::before { content: counter(s); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--raised); font-size: 12px; font-weight: 700; color: var(--muted); }
.slip { display: grid; gap: 10px; padding: 16px 16px 14px; }
.slip-out { display: grid; }
.slip-out small { color: var(--muted); font-size: 13px; }
.slip-out b { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.slip input[type=range] {
  --fill: 14%;
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  background: transparent;
  touch-action: pan-y;
  outline: 0;
  cursor: pointer;
}
.slip input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(31, 111, 229, 0.35), 0 1px 6px rgba(0, 0, 0, 0.22); }
.slip input::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--fill), #e4e5e8 var(--fill)); }
.slip input::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--fill), #e4e5e8 var(--fill)); }
.slip input::-webkit-slider-thumb { appearance: none; width: 26px; height: 26px; margin-top: -10px; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
.slip input::-moz-range-thumb { width: 26px; height: 26px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22); }
.slip-tip { margin: 0; font-size: 13.5px; font-weight: 600; }
.slip-tip[data-level=ok] { color: #1d8a4b; }
.slip-tip[data-level=tight] { color: #c26a00; }
.slip-tip[data-level=wide] { color: #cf3049; }
.costbar { display: flex; gap: 3px; height: 14px; padding: 0; overflow: hidden; background: transparent; border-radius: 7px; margin: 4px 8px 2px; }
.costbar i { border-radius: 3px; transform-origin: left; animation: grow 0.7s var(--ease) backwards; }
.costbar i:nth-child(2) { animation-delay: 0.1s; }
.costbar i:nth-child(3) { animation-delay: 0.2s; }
@keyframes grow { from { transform: scaleX(0); } }
.legend { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; margin: 0; padding: 6px 14px; }
.legend dt { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; font-weight: 600; white-space: nowrap; }
.legend dt::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.legend dd { margin: 0; padding: 8px 0; color: var(--muted); font-size: 13.5px; }
.legend dt:not(:first-child), .legend dt:not(:first-child) + dd { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.habits { margin: 0; padding: 4px 14px; list-style: none; }
.habits li { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 14.5px; font-weight: 550; }
.habits li + li { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.habits svg { width: 18px; height: 18px; color: #1f6fe5; }
.consent { padding: 12px; border-radius: 17px; background: #fff; }
.consent:has(.consent-done), .consent:has(.consent-note) { padding: 0; background: transparent; }
.consent-head { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; }
.consent-head .tile { width: 30px; height: 30px; border-radius: 9px; }
.consent-head .tile svg { width: 17px; height: 17px; }
.consent-head b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.consent-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.consent-list { margin: 10px 0 12px; padding: 2px 12px; border-radius: 13px; background: var(--raised); list-style: none; }
.consent-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.consent-list li + li { border-top: 1px solid rgba(0, 0, 0, 0.06); }
.consent-list li::before { content: ""; flex: none; width: 15px; height: 15px; border: 1.5px solid #8b8c91; border-radius: 4px; }
.consent-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-row button { height: 44px; border-radius: 22px; font-size: 15.5px; font-weight: 600; }
.deny { background: #eeeff1; }
.allow { background: #1877f2; color: #fff; }
.consent-done { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px 10px; border-radius: 15px; background: #fff; color: #1d8a4b; font-size: 14px; font-weight: 600; text-align: left; animation: rise 0.3s var(--ease); }
.consent-done svg { width: 18px; height: 18px; stroke-width: 2.4; }
.consent-done svg:last-child { width: 15px; height: 15px; color: #b0b1b5; }
.consent-note { margin: 6px; font-size: 13.5px; color: var(--muted); }
.react {
  position: absolute;
  right: -6px;
  bottom: -10px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(16, 24, 40, 0.16);
  animation: pop-in 0.3s var(--ease) 0.15s backwards;
}
.react svg { width: 14px; height: 14px; stroke-width: 2.3; }
.message.user { position: relative; }
.message.user:has(.react) { margin-bottom: 6px; }

/* Checklist, Muse-style */
.hint { margin: 6px auto 4px; padding: 0 20px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.show-more { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 20px 12px; color: #8b8c91; font-size: 15px; }
.show-more svg { width: 20px; height: 20px; stroke-width: 2.6; }
#checklist hr { border: 0; border-top: 1px solid rgba(0, 0, 0, 0.07); margin: 8px auto; }
.create-title { margin: 14px auto 4px; padding: 0 20px; font-size: 16px; font-weight: 650; }
.create { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 20px; text-align: left; font-size: 15.5px; }
.create svg:last-child { width: 20px; height: 20px; color: #9a9ba0; }
.create[aria-pressed="true"] svg:last-child { color: #1d8a4b; stroke-width: 2.4; }
.add-own { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 4px 8px 4px 20px; }
.add-own > svg { color: #9a9ba0; }
.add-own input { min-width: 0; height: 44px; border: 0; background: transparent; font-size: 15.5px; outline: 0; }
.add-own button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; }
.add-own button svg { width: 19px; height: 19px; }

/* Library */
#library { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 12px; padding: 6px 16px 10px; }
.doc { display: grid; gap: 8px; padding: 0; text-align: left; }
.doc .paper {
  display: grid;
  align-content: start;
  gap: 6px;
  aspect-ratio: 3 / 3.4;
  padding: 14px 13px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 70%, transparent);
  mask-image: linear-gradient(#000 70%, transparent);
}
.doc .paper b { font-size: 14px; letter-spacing: -0.015em; }
.doc .paper span { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.doc-foot { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: center; padding: 0 2px; }
.doc-foot .tile { width: 30px; height: 30px; border-radius: 9px; }
.doc-foot .tile svg { width: 16px; height: 16px; }
.doc-foot b { display: block; font-size: 14px; font-weight: 600; }
.doc-foot small { display: block; font-size: 12px; color: var(--muted); }

/* Replies stream in line by line. */
.message > span { display: block; }
.message.assistant.fresh > span {
  -webkit-mask-image: linear-gradient(#000 40%, transparent 60%);
  mask-image: linear-gradient(#000 40%, transparent 60%);
  -webkit-mask-size: 100% 260%;
  mask-size: 100% 260%;
  animation: stream 0.9s cubic-bezier(0.4, 0, 0.3, 1) both;
}
@keyframes stream { from { -webkit-mask-position: 0 100%; mask-position: 0 100%; } to { -webkit-mask-position: 0 0; mask-position: 0 0; } }
.follow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.follow.fresh { animation: rise 0.35s var(--ease) 0.5s backwards; }
.follow button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px 0 10px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  font-size: 14px;
  color: var(--ink);
}
.follow svg { width: 16px; height: 16px; color: var(--accent); stroke-width: 2; }

/* Muse call: the mascot takes the stage, controls stack on the right. */
.halo { transform-origin: 50% 0; }
.name-pill { transition: transform 0.45s var(--ease); }
#app[data-call] .halo { transform: scale(1.9); }
#app[data-call] .name-pill { transform: translateY(72px); }
#app[data-call] #messages { padding-top: calc(var(--head) + 84px); transition: padding 0.45s var(--ease); }
#app[data-call] .top::before {
  bottom: -175px;
  background: linear-gradient(var(--bg) 0, var(--bg) 76%, rgba(252, 252, 252, 0.85) 88%, rgba(252, 252, 252, 0));
  transition: bottom 0.45s var(--ease);
}
#app[data-call] #messages { padding-top: calc(var(--head) + 150px); }
#app[data-call] .capsule { flex-direction: column; height: auto; padding: 3px; gap: 2px; }
#app[data-call] #hangup { order: -1; margin: 0; }
#app[data-call] #more { display: none; }

/* Conversations drawer slides in from the left. */
dialog.drawer {
  margin: 0 auto 0 0;
  width: min(86vw, 340px);
  height: 100dvh;
  max-height: none;
  border-radius: 0 26px 26px 0;
  padding: calc(env(safe-area-inset-top) + 18px) 14px 16px;
  animation: slide 0.32s var(--ease);
}
@keyframes slide { from { transform: translateX(-100%); } }
.new-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--raised);
  font-size: 16px;
  font-weight: 600;
}
.new-chat svg { width: 20px; height: 20px; stroke-width: 2.1; }

/* Press feedback everywhere, like a native app. */
button { -webkit-tap-highlight-color: transparent; }
.starters button:active, .follow button:active, .doc:active, .idea:active, .task:active, .create:active, .new-chat:active,
.consent-row button:active, .consent-done:active, .att-page:active, .tabs button:active, .capsule button:active, .round:active {
  transform: scale(0.96);
  transition: transform 0.08s;
}
.message { transition: transform 0.2s var(--ease); }
.message:active { transform: scale(0.985); }

/* Live progress card while Atlas works. */
.work {
  align-self: flex-start;
  width: min(78%, 320px);
  padding: 13px 14px 12px;
  border-radius: 20px;
  background: var(--bubble);
}
.work.fresh { animation: rise 0.3s var(--ease); }
.work-head { display: flex; align-items: center; gap: 10px; }
.work-head b { font-size: 15px; font-weight: 600; background: linear-gradient(90deg, var(--ink) 30%, #a6a7ab 50%, var(--ink) 70%) 0 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 1.6s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: -150% 0; } }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(31, 111, 229, 0.2); border-top-color: var(--accent); animation: turn 0.8s linear infinite; }
@keyframes turn { to { transform: rotate(1turn); } }
.work ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.work li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); opacity: 0; animation: step-in 0.3s var(--ease) var(--d) forwards; }
.work li i { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid #c4c5c9; color: #fff; animation: step-done 0.25s var(--ease) calc(var(--d) + 0.38s) forwards; }
.work li svg { width: 11px; height: 11px; stroke-width: 3; opacity: 0; animation: fade-in 0.2s calc(var(--d) + 0.4s) forwards; }
.work li span { animation: ink 0.2s calc(var(--d) + 0.38s) forwards; }
@keyframes step-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes step-done { to { background: #1d8a4b; border-color: #1d8a4b; } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes ink { to { color: var(--ink); } }

/* Hold menu */
.veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(245, 245, 247, 0.62);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: fade-in-veil 0.18s ease-out;
}
@keyframes fade-in-veil { from { opacity: 0; } }
.ghost { position: fixed; margin: 0; box-shadow: 0 10px 30px rgba(16, 24, 40, 0.14); animation: lift 0.22s var(--ease); }
@keyframes lift { from { transform: scale(0.97); } 60% { transform: scale(1.02); } }
.pop { position: fixed; display: grid; gap: 8px; width: 236px; animation: pop-in 0.24s var(--ease); }
.pop.user { justify-items: end; transform-origin: top right; }
.pop.assistant { transform-origin: top left; }
.react-row { display: flex; gap: 2px; padding: 5px; border-radius: 26px; background: #fff; box-shadow: 0 8px 28px rgba(16, 24, 40, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.react-row button { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.react-row button:nth-child(1) { color: #e5304c; }
.react-row button:nth-child(2) { color: #1f6fe5; }
.react-row button:nth-child(3) { color: #e08a00; }
.react-row button:nth-child(4) { color: #6a43d8; }
.react-row button[aria-pressed="true"] { background: var(--raised); }
.react-row svg { width: 21px; height: 21px; stroke-width: 2.1; }
.pop-list { width: 100%; overflow: hidden; border-radius: 16px; background: rgba(255, 255, 255, 0.96); box-shadow: 0 8px 28px rgba(16, 24, 40, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.06); }
.pop-list button { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 15px; font-size: 16px; text-align: left; }
.pop-list button + button { border-top: 1px solid rgba(0, 0, 0, 0.07); }
.pop-list svg { width: 19px; height: 19px; }
.react svg { color: inherit; }
.react:has(use[href="#i-heart"]) { color: #e5304c; }
.react:has(use[href="#i-flame"]), .react:has(use[href="#i-bang"]) { color: #6a43d8; }
@media (prefers-reduced-motion: reduce) {
  .work li, .work li i, .work li svg, .work li span { animation-duration: 0.01s; }
  .work-head b, .spin { animation: none; }
  .work-head b { color: var(--ink); }
}
@media (hover: hover) and (pointer: fine) {
  .starters button:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08); transform: translateY(-1px); }
  .react-row button:hover, .pop-list button:hover { background: var(--raised); }
}
@media (min-width: 640px) {
  .starters { grid-template-columns: repeat(4, 1fr); }
  .empty { max-width: none; }
}

/* Control-only glass. Plain canvas, content and mascot intentionally unchanged. */
:root {
  --control-glass: rgba(255, 255, 255, .66);
  --control-rim: rgba(36, 45, 60, .10);
  --control-light: rgba(255, 255, 255, .96);
  --control-shadow: 0 6px 18px rgba(27, 39, 58, .07), 0 1px 3px rgba(27, 39, 58, .035);
}
:is(.nav, .capsule, #composer, .tabs) {
  background: linear-gradient(160deg, rgba(255,255,255,.58), rgba(255,255,255,.08) 45%, rgba(228,234,242,.16)), var(--control-glass);
  border: 1px solid var(--control-rim);
  box-shadow: inset 0 1px 0 var(--control-light), inset 0 -1px 0 rgba(100,115,135,.055), var(--control-shadow);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
  backdrop-filter: blur(16px) saturate(115%);
}
.tabs {
  background-color: rgba(235,239,245,.68);
}
.tabs button {
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), transform .12s var(--ease);
}
.tabs button[aria-pressed="true"] {
  background: linear-gradient(160deg, rgba(255,255,255,.95), rgba(255,255,255,.52));
  box-shadow: inset 0 1px 0 var(--control-light), inset 0 0 0 1px rgba(255,255,255,.72), 0 2px 6px rgba(34,47,66,.10);
  color: var(--ink);
}
#composer:focus-within {
  border-color: rgba(31,111,229,.38);
  box-shadow: inset 0 1px 0 var(--control-light), var(--control-shadow), 0 0 0 2px rgba(31,111,229,.08);
}
#draft::placeholder { color: var(--muted); }
@media (hover:hover) and (pointer:fine) {
  .capsule > button:hover, .nav:hover { background-color: rgba(255,255,255,.86); }
  .tabs button:not([aria-pressed="true"]):hover { background-color: rgba(255,255,255,.40); }
}
@media (prefers-reduced-transparency:reduce), (prefers-contrast:more) {
  :is(.nav, .capsule, #composer, .tabs) {
    background: var(--surface);
    border-color: var(--muted);
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none;
  }
  .tabs button[aria-pressed="true"] { background: var(--raised); box-shadow: inset 0 0 0 1px var(--muted); }
}
@media (prefers-reduced-motion:reduce) {
  .tabs button { transition: none; }
}

/* Consistent guide attachments: one readable surface, compact facts and explicit approvals. */
.attach { width:min(100%,400px); padding:14px; border:1px solid var(--line); background:var(--surface); border-radius:22px; }
.attach .att-head { padding:0 0 12px; }
.attach .att-head .tile { width:30px; height:30px; }
.attach .att-head b { font-size:15px; }
.attach .att-head small { font-size:12px; }
.attach .quote { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding:0; margin-top:0; }
.attach .leg { min-width:0; display:grid; justify-content:start; gap:9px; padding:12px; background:var(--raised); border-radius:14px; }
.attach .leg b { font-size:23px; line-height:1.25; }
.attach .leg small { font-size:12px; }
.attach .token { width:fit-content; padding:0; gap:6px; background:none; font-size:12px; }
.attach .coin { width:20px; height:20px; font-size:10px; }
.attach .flip { width:28px; height:28px; margin:-14px; border:3px solid var(--surface); border-radius:50%; background:var(--raised); }
.attach .flip svg { transform:rotate(-90deg); width:12px; height:12px; }
.attach .facts { margin:10px 0 0; padding:0; background:none; border-radius:0; grid-template-columns:minmax(0,1fr) auto; column-gap:12px; }
.attach .facts dt, .attach .facts dd { font-size:13px; padding:7px 0; font-variant-numeric:tabular-nums; }
.attach .consent { margin-top:10px; padding:12px 0 0; border-top:1px solid var(--line); border-radius:0; background:none; }
.attach .consent-head { gap:8px; }
.attach .consent-head .tile { width:26px; height:26px; }
.attach .consent-head b { font-size:14px; }
.attach .consent-list { background:none; margin:8px 0 10px; padding:0; }
.attach .consent-list li { padding:6px 0; font-size:13px; }
.attach .consent-row button { min-height:44px; }
@media (max-width:359px) {
 .attach { padding:12px; }
 .attach .leg { padding:10px; }
 .attach .facts { column-gap:8px; }
}

/* Topic-specific content uses the same surface hierarchy. */
.attach .route { background:var(--raised); padding:14px 12px; border-radius:14px; }
.attach .steps, .attach .habits, .attach .legend { background:transparent; padding-inline:0; border-radius:0; }
.attach .steps { margin-top:10px; }
.attach .steps li { padding:9px 0; font-size:14px; }
.attach .steps li::before { flex:none; }
.attach .slip { background:var(--raised); padding:16px; border-radius:14px; }
.attach .slip-out b { font-size:28px; line-height:1.3; }
.attach .slip input[type=range] { height:44px; }
.attach .legend { grid-template-columns:minmax(0,1fr); }
.attach .legend dt { padding:10px 0 0; border-top:0; }
.attach .legend dd { padding:3px 0 10px 17px; border-top:0; }
.attach .legend dt:not(:first-child) { border-top:1px solid var(--line); }
.attach .habits li { padding:12px 0; font-size:14px; }
.attach .habits svg { flex:none; }
.attach .att-page { padding:14px; border:1px solid var(--line); box-shadow:none; border-radius:14px; }
.attach .consent-done { min-height:44px; padding:8px 0; font-size:14px; }
@media(min-width:700px) {
 .attach .legend { grid-template-columns:auto minmax(0,1fr); column-gap:16px; }
 .attach .legend dt, .attach .legend dd { padding:10px 0; }
 .attach .legend dt:not(:first-child) + dd { border-top:1px solid var(--line); }
}
/* Wallet habits above are the exact three checklist items; do not repeat them. */
.attach:has(.habits) .consent-list { display:none; }
.attach:has(.habits) .consent-row { margin-top:12px; }

/* Keyboard decision feedback and normal-text contrast, local candidate v5. */
.consent-row .allow { background:#1769d2; color:#fff; }
.consent-note:focus-visible { outline:2px solid var(--accent); outline-offset:3px; border-radius:4px; }

.add-own input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; border-radius:4px; }

/* Keyboard message actions use the same menu as pointer actions. */
.message[role="button"]:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.react-row button[aria-checked="true"] { background:var(--raised); }
