/* nova26 web core — layout + components. Phone-first. */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}
#app { display: flex; flex-direction: column; height: 100dvh; max-width: 560px; margin: 0 auto; }

/* header */
header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px calc(10px + env(safe-area-inset-top) * 0);
  padding-top: calc(12px + env(safe-area-inset-top));
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.brand .n26 { color: var(--primary); }
#biz-btn {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; padding: 8px 12px; font-size: 14px; font-weight: 600;
  min-width: 0;
}
#biz-btn .biz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#biz-btn .biz-tag { color: var(--ink-faint); font-weight: 400; font-size: 12px; }
#theme-btn {
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; width: 38px; height: 38px; font-size: 17px; flex: none;
}

/* business sheet */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40;
  display: none;
}
.sheet-backdrop.open { display: block; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--bg-elev); border-radius: 20px 20px 0 0;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .25s ease;
  max-width: 560px; margin: 0 auto;
  max-height: 70dvh; overflow-y: auto;
}
.sheet-backdrop.open + .sheet, .sheet.open { transform: translateY(0); }
.sheet h2 { margin: 8px 0 12px; font-size: 17px; }
.biz-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; color: var(--ink); text-align: left;
  padding: 13px 8px; border-bottom: 1px solid var(--line); font-size: 16px;
}
.biz-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex: none; }
.biz-row.current .biz-row-name { font-weight: 700; }
.biz-row .check { margin-left: auto; color: var(--primary); font-weight: 700; }

/* main + screens */
main { flex: 1; overflow-y: auto; padding: 12px 16px 16px; }
.screen { display: none; }
.screen.active { display: block; }

/* bottom nav — morphing dock (Muse spacing + Danny dock behavior), frosted glass */
#dock {
  display: flex; align-self: center; position: relative;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 5px; gap: 2px;
  margin: 8px 0 calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 8px 32px rgba(0,0,0,.4); z-index: 10;
  transition: border-radius .25s cubic-bezier(0.32, 0.72, 0, 1);
}
[data-theme="mustard"] #dock {
  background: rgba(250, 248, 242, 0.72);
  border-color: rgba(0, 0, 0, 0.08);
}
#dock > button {
  background: none; border: none; color: rgba(255,255,255,.55);
  width: 68px; height: 46px; border-radius: 999px;
  font-size: 23px; display: flex; align-items: center; justify-content: center;
  position: relative;
}
[data-theme="mustard"] #dock > button { color: var(--ink-faint); }
#dock > button.active { background: rgba(255,255,255,.14); color: #fff; }
[data-theme="mustard"] #dock > button.active { background: rgba(0,0,0,.07); color: var(--ink); }
#dock > button .badge {
  position: absolute; top: 6px; right: 12px;
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 999px; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; text-align: center;
}
#dock-menu {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) scale(.92);
  width: 240px; padding: 8px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px; box-shadow: 0 16px 48px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .24s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column; gap: 2px;
}
[data-theme="mustard"] #dock-menu { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); }
#dock.open #dock-menu { opacity: 1; transform: translateX(-50%) scale(1); pointer-events: auto; }
.dock-row {
  display: flex; align-items: center; gap: 14px;
  background: none; border: none; border-radius: 16px;
  color: #fff; font-size: 17px; padding: 12px 14px; text-align: left;
}
[data-theme="mustard"] .dock-row { color: var(--ink); }
.dock-row .ico { font-size: 22px; width: 30px; text-align: center; }
.dock-row:active { background: rgba(255,255,255,.1); }
[data-theme="mustard"] .dock-row:active { background: rgba(0,0,0,.06); }

/* chat form — iMessage style */
#chat-form { display: flex; gap: 8px; align-items: center; padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); background: var(--bg); position: sticky; bottom: 0; }
[data-theme="ketchup"] #chat-form { background: var(--chat-bg); }
#chat-plus {
  width: 37px; height: 37px; border-radius: 50%; flex: none;
  background: var(--input-bg); color: var(--ink); border: 1px solid var(--line);
  font-size: 24px; font-weight: 300; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.chat-field-wrap {
  flex: 1; display: flex; align-items: center;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 5px 3px 0; min-width: 0;
}
#chat-input {
  flex: 1; background: none; border: none; color: var(--ink);
  padding: 9px 4px 9px 16px; font-size: 17px; outline: none; min-width: 0;
}
#chat-input::placeholder { color: var(--ink-faint); }
#chat-mic {
  background: none; border: none; font-size: 19px;
  width: 36px; height: 36px; flex: none; opacity: .85;
}
#chat-send {
  display: none; width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--bubble-user); color: var(--bubble-user-ink); border: none;
  font-size: 18px; font-weight: 700; align-items: center; justify-content: center;
}
#chat-form.typing #chat-send { display: flex; }
#chat-form.typing #chat-mic { display: none; }

/* chat */
#chat-log { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 85%; padding: 10px 13px; border-radius: var(--radius); font-size: 15px; }
.msg.user { align-self: flex-end; background: var(--bubble-user); color: var(--bubble-user-ink); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--bubble-ai); border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.msg .who { font-size: 11px; font-weight: 700; color: var(--ink-faint); margin-bottom: 3px; }
.msg.typing { color: var(--ink-faint); }
#chat-form { display: flex; gap: 8px; padding: 10px 0 4px; position: sticky; bottom: 0; background: var(--bg); }
#chat-input {
  flex: 1; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-elev);
  color: var(--ink); padding: 12px 16px; font-size: 16px; outline: none;
}
#chat-input:focus { border-color: var(--primary); }
#chat-send:disabled { opacity: .5; }

/* approvals */
.appr-card {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.appr-kind {
  display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 8px;
}
.appr-kind.money { background: #FDE8C8; color: #8A5A00; }
.appr-kind.publish { background: #DCEAFD; color: #1D4FA3; }
.appr-kind.irreversible { background: #FBDCDC; color: #A31621; }
.appr-kind.generic { background: var(--bg-sunken); color: var(--ink-soft); }
[data-theme="ketchup"] .appr-kind.money { background: #4A3208; color: #F4C95D; }
[data-theme="ketchup"] .appr-kind.publish { background: #1E3A66; color: #A9C7F5; }
[data-theme="ketchup"] .appr-kind.irreversible { background: #5E1A1A; color: #FF9B9B; }
.appr-summary { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.appr-context { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; }
.appr-meta { font-size: 12px; color: var(--ink-faint); margin-bottom: 10px; }
.appr-actions { display: flex; gap: 10px; }
.appr-actions button { flex: 1; padding: 12px; border-radius: 12px; font-size: 16px; font-weight: 700; border: none; }
.btn-approve { background: var(--ok); color: #fff; }
.btn-deny { background: var(--bg-sunken); color: var(--danger); border: 1px solid var(--line) !important; }
.appr-decided { font-size: 13px; font-weight: 700; }
.appr-decided.approved { color: var(--ok); }
.appr-decided.denied { color: var(--danger); }
.empty { text-align: center; color: var(--ink-faint); padding: 48px 20px; font-size: 15px; }
.empty .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* checklist */
#checklist-form { display: flex; gap: 8px; margin-bottom: 12px; }
#checklist-input {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev);
  color: var(--ink); padding: 12px 14px; font-size: 16px; outline: none;
}
#checklist-add {
  background: var(--primary); color: var(--primary-ink); border: none; border-radius: 12px;
  font-weight: 700; font-size: 15px; padding: 0 18px;
}
.chk-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 8px; color: var(--ink); font-size: 15px; text-align: left;
}
.chk-box {
  width: 24px; height: 24px; border-radius: 8px; border: 2px solid var(--primary);
  flex: none; display: flex; align-items: center; justify-content: center;
  color: var(--primary-ink); font-weight: 800; font-size: 15px;
}
.chk-row.done .chk-box { background: var(--primary); }
.chk-row.done .chk-text { text-decoration: line-through; color: var(--ink-faint); }
.chk-text { flex: 1; }

/* misc */
.loading { text-align: center; color: var(--ink-faint); padding: 32px; }
.error { background: #FBDCDC; color: #A31621; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14px; }
[data-theme="ketchup"] .error { background: #5E1A1A; color: #FF9B9B; }
h1.screen-title { font-size: 22px; margin: 4px 0 12px; }
.sub { color: var(--ink-soft); font-size: 13px; margin: -8px 0 12px; }

/* ---- drawer (Muse-style left nav) ---- */
#menu-btn {
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; width: 38px; height: 38px; font-size: 17px; flex: none;
}
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 48;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 49;
  width: min(320px, 84vw);
  background: rgba(30, 30, 32, 0.72);
  border-right: 0.5px solid rgba(255, 255, 255, 0.12);
  transform: translateX(-102%); transition: transform .28s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex; flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  color: #fff;
}
[data-theme="mustard"] .drawer {
  background: rgba(250, 248, 242, 0.72);
  border-right-color: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 4px 12px;
}
.drawer-header .brand { font-size: 22px; }
#drawer-close {
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; width: 34px; height: 34px; font-size: 14px;
}
.drawer-section-label {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
  color: var(--ink-faint); padding: 14px 10px 6px;
}
#drawer-chats { overflow-y: auto; }
.drawer-row {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: none; border: none; color: var(--ink); text-align: left;
  padding: 11px 10px; border-radius: 10px; font-size: 15px; font-weight: 500;
}
.drawer-row .ico { font-size: 18px; width: 24px; text-align: center; flex: none; }
.drawer-row .drawer-row-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-row.current { background: var(--bg-sunken); font-weight: 700; }
.drawer-row .check { color: var(--primary); font-weight: 800; }
.drawer-badge {
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; min-width: 20px; height: 20px; line-height: 20px;
  text-align: center; padding: 0 6px;
}
.drawer-footer { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }

/* ---- iMessage-style chat ---- */
#screen-chat { display: none; flex-direction: column; height: 100%; background: var(--bg); }
#screen-chat.active { display: flex; }
[data-theme="ketchup"] #screen-chat { background: var(--chat-bg); }
[data-theme="ketchup"] #chat-form { background: var(--chat-bg); }
#chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 4px 2px 8px; gap: 2px; }
.msg {
  max-width: 74%; padding: 8px 13px; border-radius: 19px;
  font-size: 17px; line-height: 1.35; position: relative; z-index: 0;
  overflow-wrap: break-word;
}
.msg .who { display: none; }
.msg.user {
  align-self: flex-end; margin-left: auto;
  background: var(--bubble-user); color: var(--bubble-user-ink);
  border-bottom-right-radius: 5px;
}
.msg.ai {
  align-self: flex-start;
  background: var(--bubble-ai); color: var(--bubble-ai-ink);
  border-bottom-left-radius: 5px; border: none; box-shadow: none;
}
/* tails */
.msg.user::before, .msg.ai::before {
  content: ""; position: absolute; bottom: 0; z-index: -1;
  width: 14px; height: 14px;
}
.msg.user::before {
  right: -7px; background: var(--bubble-user);
  border-bottom-right-radius: 7px;
}
.msg.ai::before {
  left: -7px; background: var(--bubble-ai);
  border-bottom-left-radius: 7px;
}
.msg.user::after, .msg.ai::after {
  content: ""; position: absolute; bottom: 0; z-index: -1;
  width: 9px; height: 14px; background: var(--bg);
}
[data-theme="ketchup"] .msg.user::after,
[data-theme="ketchup"] .msg.ai::after { background: var(--chat-bg); }
.msg.user::after { right: -9px; border-bottom-right-radius: 7px; }
.msg.ai::after { left: -9px; border-bottom-left-radius: 7px; }
/* spacing: tighter between same-sender bubbles */
.msg.user + .msg.user, .msg.ai + .msg.ai { margin-top: 1px; }
.msg.user + .msg.ai, .msg.ai + .msg.user { margin-top: 9px; }
/* typing indicator keeps no tail */
.msg.typing::before, .msg.typing::after { display: none; }
.msg.typing { border-bottom-left-radius: 19px; }
/* modern: message entrance */
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg { animation: msg-in .18s ease-out; }
/* modern: streaming cursor */
.stream-cursor {
  display: inline-block; width: 8px; height: 17px; margin-left: 2px;
  background: var(--bubble-ai-ink); border-radius: 2px; vertical-align: -2px;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
/* modern: subtle depth on bubbles */
[data-theme="ketchup"] .msg.ai { box-shadow: 0 1px 3px rgba(0,0,0,.35); }
[data-theme="ketchup"] .msg.user { box-shadow: 0 1px 4px rgba(10,132,255,.25); }
/* modern: press states */
#chat-plus:active, #chat-mic:active, #chat-send:active { transform: scale(.92); }
#chat-plus, #chat-mic, #chat-send { transition: transform .12s ease; }
nav button { transition: background .15s ease, transform .12s ease; }
nav button:active { transform: scale(.94); }
.drawer-row { transition: background .15s ease; }
/* modern: input focus glow */
.chat-field-wrap:focus-within { border-color: var(--bubble-user); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bubble-user) 25%, transparent); }

/* attach menu — iOS frosted glass popup */
#attach-scrim {
  position: fixed; inset: 0; z-index: 60; display: none;
}
#attach-scrim.show { display: block; }
#attach-menu {
  position: fixed; z-index: 61; left: 12px;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: 280px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  padding: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: scale(0.92) translateY(10px); transform-origin: bottom left;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}
#attach-menu.show { opacity: 1; transform: none; pointer-events: auto; }
.attach-row {
  display: flex; align-items: center; gap: 16px;
  width: 100%; padding: 12px 14px;
  background: none; border: none; border-radius: 18px;
  color: #fff; font-size: 20px; text-align: left;
}
.attach-row:active { background: rgba(255, 255, 255, 0.1); }
.attach-ico {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  background: rgba(255, 255, 255, 0.12);
  display: flex; align-items: center; justify-content: center;
}
.attach-ico svg { width: 26px; height: 26px; stroke: #fff; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="mustard"] #attach-menu {
  background: rgba(250, 248, 242, 0.72);
  border-color: rgba(0, 0, 0, 0.08);
}
[data-theme="mustard"] .attach-row { color: var(--ink); }
[data-theme="mustard"] .attach-row:active { background: rgba(0, 0, 0, 0.06); }
[data-theme="mustard"] .attach-ico { background: rgba(0, 0, 0, 0.07); }
[data-theme="mustard"] .attach-ico svg { stroke: var(--ink); }
/* attachment bubbles in thread */
.msg .attachment-img { max-width: 220px; border-radius: 14px; display: block; }
.msg .attachment-file {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.12); border-radius: 10px; padding: 8px 12px; font-size: 15px;
}

/* preemption queue — frosted glass */
.queue-header { display: flex; align-items: center; justify-content: space-between; }
.queue-count {
  font-size: 13px; font-weight: 600; color: var(--ink);
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 5px 12px; color: #fff;
}
[data-theme="mustard"] .queue-count { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
#queue-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.queue-job {
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px; padding: 14px 16px; color: #fff;
}
[data-theme="mustard"] .queue-job { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.queue-job-top { display: flex; align-items: center; gap: 10px; }
.queue-status { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.queue-status.active { color: #0A84FF; animation: blink 1.2s ease-in-out infinite; }
.queue-status.done { color: #30D158; }
.queue-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-prio {
  font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 7px; flex: none;
  background: rgba(255,255,255,.14); color: #fff;
}
.queue-prio.p0 { background: #FF453A; color: #fff; }
.queue-prio.p2 { background: #FF9F0A; color: #fff; }
[data-theme="mustard"] .queue-prio { background: rgba(0,0,0,.08); color: var(--ink); }
[data-theme="mustard"] .queue-prio.p0 { background: #E63946; color: #fff; }
.queue-pct { font-size: 13px; font-weight: 600; opacity: .7; flex: none; min-width: 42px; text-align: right; }
.queue-bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.14); margin-top: 10px; overflow: hidden; }
[data-theme="mustard"] .queue-bar { background: rgba(0,0,0,.1); }
.queue-bar-fill { height: 100%; border-radius: 999px; background: #0A84FF; transition: width .3s linear; }
.queue-job.done .queue-bar-fill { background: #30D158; }
.queue-resume { font-size: 12px; opacity: .6; margin-top: 6px; }
.queue-inject-btn {
  width: 100%; margin-top: 14px; padding: 15px; border: none; border-radius: 20px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 17px; font-weight: 700;
}
.queue-inject-btn:active { transform: scale(.98); }
[data-theme="mustard"] .queue-inject-btn { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.queue-footer { font-size: 13px; opacity: .6; margin-top: 10px; text-align: center; color: var(--ink); }

/* swarm deploy — elastic stepper, frosted glass */
.swarm-card {
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px; padding: 18px; margin-top: 14px; color: #fff;
  text-align: center;
}
[data-theme="mustard"] .swarm-card { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.swarm-title { font-size: 17px; font-weight: 700; }
.swarm-sub { font-size: 13px; opacity: .6; margin-top: 2px; }
.elastic-stepper {
  display: flex; align-items: center; justify-content: center;
  margin: 16px auto 0; position: relative;
  background: rgba(0,0,0,.35); border-radius: 999px;
  border: 0.5px solid rgba(255,255,255,.1);
  width: 220px; height: 64px;
  transition: transform .18s cubic-bezier(0.34, 1.56, 0.64, 1);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
[data-theme="mustard"] .elastic-stepper { background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.08); }
.elastic-stepper.stretch-right { transform: scaleX(1.12) translateX(6px); }
.elastic-stepper.stretch-left { transform: scaleX(1.12) translateX(-6px); }
.stepper-btn {
  width: 56px; height: 64px; background: none; border: none;
  color: #fff; font-size: 28px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="mustard"] .stepper-btn { color: var(--ink); }
.stepper-track { flex: 1; display: flex; align-items: center; justify-content: center; }
.stepper-number {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
  transition: transform .15s ease;
}
[data-theme="mustard"] .stepper-number { background: rgba(0,0,0,.08); color: var(--ink); }
.elastic-stepper.stretch-right .stepper-number { transform: translateX(8px); }
.elastic-stepper.stretch-left .stepper-number { transform: translateX(-8px); }
.swarm-deploy-btn {
  margin-top: 14px; padding: 13px 32px; border: none; border-radius: 999px;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}
.swarm-deploy-btn:active { transform: scale(.96); }

/* progress toasts — stacking, dismissible, movable, frosted glass */
#toast-stack {
  position: fixed; top: calc(70px + env(safe-area-inset-top)); right: 12px; z-index: 70;
  display: flex; flex-direction: column; gap: 0; align-items: flex-end;
  cursor: grab; touch-action: none;
}
#toast-stack.dragging { cursor: grabbing; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(30, 30, 32, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 10px 8px 10px 10px; margin-top: -8px;
  color: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.45);
  max-width: 300px;
  transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1), opacity .2s ease, margin .25s ease;
  position: relative;
}
.toast:first-child { margin-top: 0; }
.toast.sliver { transform: scale(.94); opacity: .85; pointer-events: none; }
.toast.sliver-2 { transform: scale(.88); opacity: .7; }
.toast.leaving { transform: translateX(120%); opacity: 0; }
[data-theme="mustard"] .toast { background: rgba(250,248,242,.78); border-color: rgba(0,0,0,.08); color: var(--ink); }
.toast-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: #0A84FF; color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-stage { font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-bar { height: 3px; border-radius: 999px; background: rgba(255,255,255,.15); margin-top: 5px; overflow: hidden; }
[data-theme="mustard"] .toast-bar { background: rgba(0,0,0,.1); }
.toast-bar-fill { height: 100%; background: #0A84FF; border-radius: 999px; transition: width .3s linear; }
.toast-close {
  background: none; border: none; color: inherit; opacity: .5;
  font-size: 16px; width: 28px; height: 28px; flex: none; border-radius: 50%;
}
.toast-close:active { background: rgba(255,255,255,.12); }

/* pin + drag reorder (Jamie pattern) */
.reorder-item { position: relative; }
.reorder-handle {
  cursor: grab; opacity: .35; font-size: 16px; padding: 4px 6px;
  flex: none; touch-action: none; user-select: none; -webkit-user-select: none;
}
.reorder-item.dragging {
  background: rgba(50, 50, 54, 0.92) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
  border-radius: 16px; opacity: 1;
}
[data-theme="mustard"] .reorder-item.dragging { background: rgba(255,255,255,.95) !important; }
.reorder-item.drag-over { opacity: .4; filter: grayscale(.5); }
.reorder-gap {
  border-radius: 16px; margin: 4px 0;
  background: rgba(10,132,255,.12);
  border: 1.5px dashed rgba(10,132,255,.4);
}
.pin-btn {
  background: none; border: none; font-size: 15px; opacity: .3;
  padding: 4px; flex: none; border-radius: 8px;
}
.pin-btn.pinned { opacity: 1; }
.pin-btn:active { transform: scale(1.2); }

/* taste library — chrome-clearing photo swipe */
#screen-taste { padding: 0; overflow: hidden; }
.taste-viewer { height: 100%; display: flex; flex-direction: column; position: relative; }
.taste-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; z-index: 5;
  transition: opacity .25s ease, transform .25s ease;
}
.taste-back, .taste-grid {
  background: rgba(30,30,32,.72);
  border: .5px solid rgba(255,255,255,.12); color: #fff;
  width: 38px; height: 38px; border-radius: 50%; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
}
[data-theme="mustard"] .taste-back, [data-theme="mustard"] .taste-grid {
  background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink);
}
.taste-counter { font-size: 15px; font-weight: 600; color: var(--ink); transition: opacity .25s ease; }
.taste-stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 8px 16px; min-height: 0; }
.taste-card {
  width: 100%; max-width: 340px; aspect-ratio: 4/5; border-radius: 28px;
  background: linear-gradient(135deg, #2C2C2E, #1C1C1E);
  border: .5px solid rgba(255,255,255,.12);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px; color: #fff;
  transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1), filter .3s ease, opacity .3s ease;
  touch-action: pan-y;
}
.taste-card.swiping { /* perf: blur removed */ transform: scale(.96); }
.taste-caption { padding: 12px 24px 4px; transition: opacity .25s ease, transform .25s ease; }
.taste-title { font-size: 22px; font-weight: 700; color: var(--ink); }
.taste-sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.taste-rail {
  display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  overflow-x: auto; transition: opacity .25s ease, transform .25s ease;
}
.taste-thumb {
  width: 56px; height: 56px; border-radius: 14px; flex: none;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  transition: transform .2s ease, border-color .2s ease;
}
.taste-thumb.active { border: 2.5px solid #30D158; transform: scale(1.08); }
/* chrome clears during swipe */
.taste-viewer.swiping .taste-topbar,
.taste-viewer.swiping .taste-caption,
.taste-viewer.swiping .taste-rail { opacity: 0; transform: translateY(12px); pointer-events: none; }
.taste-viewer.swiping .taste-card { transform: scale(1.02); }

/* listening page — dot-matrix orb, distraction-free */
#listen-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: #000; display: none;
  flex-direction: column; align-items: center; justify-content: center;
}
#listen-overlay.show { display: flex; }
#orb-canvas { width: min(78vw, 340px); height: min(78vw, 340px); }
.orb-label {
  color: #8E8E93; font-size: 15px; margin-top: 18px;
  letter-spacing: .04em;
}
.orb-controls {
  display: flex; gap: 4px; margin-top: 26px;
  background: rgba(30,30,32,.72);
  border: .5px solid rgba(255,255,255,.12); border-radius: 999px; padding: 4px;
}
.orb-state {
  background: none; border: none; color: #8E8E93;
  font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: 999px;
}
.orb-state.active { background: #3A3A3C; color: #fff; }
#listen-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top)); right: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 17px;
}
.orb-transcript {
  position: absolute; bottom: calc(32px + env(safe-area-inset-bottom));
  left: 24px; right: 24px; text-align: center;
  color: #fff; font-size: 17px; line-height: 1.45;
  max-height: 22vh; overflow-y: auto;
}

/* my tasks — collapsing stack (Rauno pattern), frosted glass */
.task-stack { position: relative; height: 300px; margin-top: 14px; }
.task-card {
  position: absolute; left: 0; right: 0;
  background: rgba(30, 30, 32, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px; padding: 20px; color: #fff;
  box-shadow: 0 12px 36px rgba(0,0,0,.45);
  transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1), opacity .3s ease;
}
[data-theme="mustard"] .task-card { background: rgba(250,248,242,.78); border-color: rgba(0,0,0,.08); color: var(--ink); }
.task-card.front { z-index: 3; transform: translateY(0); }
.task-card.sliver-1 { z-index: 2; transform: translateY(-16px) scale(.96); opacity: .9; height: 44px; overflow: hidden; }
.task-card.sliver-2 { z-index: 1; transform: translateY(-28px) scale(.92); opacity: .7; height: 44px; overflow: hidden; }
.task-card.hidden { z-index: 0; transform: translateY(-36px) scale(.88); opacity: 0; pointer-events: none; }
.task-card.folding { transform: translateY(60px) scale(.94); opacity: 0; }
.task-title { font-size: 19px; font-weight: 700; }
.task-meta { font-size: 13px; opacity: .6; margin-top: 6px; }
.task-desc { font-size: 15px; margin-top: 10px; line-height: 1.45; opacity: .85; }
.task-actions { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 16px; }
.task-nav-btn {
  width: 48px; height: 48px; border-radius: 50%; border: .5px solid rgba(255,255,255,.12);
  background: rgba(30,30,32,.72);
  color: #fff; font-size: 22px;
}
[data-theme="mustard"] .task-nav-btn { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.task-done-btn {
  padding: 14px 36px; border-radius: 999px; border: none;
  background: #30D158; color: #fff; font-size: 16px; font-weight: 700;
}
.task-done-btn:active { transform: scale(.96); }
#task-add-form { display: flex; gap: 8px; margin-top: 18px; }
#task-add-form input {
  flex: 1; background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 12px 18px; color: #fff; font-size: 16px; outline: none;
}
[data-theme="mustard"] #task-add-form input { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
#task-add-form button {
  border: none; border-radius: 999px; padding: 12px 22px;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}

/* app builds — photo grid with press-to-focus (Raul pattern) */
.build-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-top: 14px; transition: opacity .3s ease, filter .3s ease;
}
.build-grid.dimmed { opacity: .35; filter: brightness(.6); }
.build-tile {
  aspect-ratio: 4/5; border-radius: 20px; overflow: hidden;
  background: rgba(30,30,32,.72);
  border: .5px solid rgba(255,255,255,.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; position: relative;
  transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1);
  touch-action: manipulation;
}
[data-theme="mustard"] .build-tile { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.build-tile:active { transform: scale(.96); }
.build-tile-emoji { font-size: 48px; }
.build-tile-name { font-size: 14px; font-weight: 700; margin-top: 10px; padding: 0 8px; text-align: center; }
.build-tile-status {
  font-size: 11px; font-weight: 700; margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.12);
}
.build-tile-status.live { background: #30D158; color: #fff; }
.build-tile-status.preview { background: #0A84FF; color: #fff; }
.build-preview {
  position: fixed; inset: 0; z-index: 75; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(0,0,0,.4);
}
.build-preview.show { display: flex; }
.build-preview-card {
  width: min(88vw, 360px); aspect-ratio: 4/5; border-radius: 28px;
  background: rgba(30,30,32,.85);
  border: .5px solid rgba(255,255,255,.15);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; padding: 24px; text-align: center;
  transform: scale(.9); opacity: 0;
  transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1), opacity .25s ease;
}
.build-preview.show .build-preview-card { transform: scale(1); opacity: 1; }
[data-theme="mustard"] .build-preview-card { background: rgba(250,248,242,.85); border-color: rgba(0,0,0,.1); color: var(--ink); }
.build-preview-emoji { font-size: 72px; }
.build-preview-name { font-size: 22px; font-weight: 700; margin-top: 14px; }
.build-preview-desc { font-size: 15px; opacity: .7; margin-top: 8px; line-height: 1.45; }
.build-preview-actions { display: flex; gap: 10px; margin-top: 20px; }
.build-preview-build {
  padding: 13px 28px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}
.build-preview-close {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); right: 20px;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 17px;
}

/* build anatomy — exploded component view (Paulius pattern) */
#anatomy-overlay {
  position: fixed; inset: 0; z-index: 78; display: none;
  flex-direction: column; align-items: center;
  background: #000; color: #fff;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
}
#anatomy-overlay.show { display: flex; }
.anat-head { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#anat-title { font-size: 18px; font-weight: 700; }
#anat-close {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 17px;
}
.anat-stack { position: relative; flex: 1; width: 100%; max-width: 340px; }
.anat-layer {
  position: absolute; left: 0; right: 0;
  transition: transform .45s cubic-bezier(0.32, 0.72, 0, 1);
  transform: translateY(calc(var(--li) * 92px));
}
.anat-layer.assembled { transform: translateY(calc(var(--li) * 14px)); }
.anat-layer-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(30,30,32,.85);
  border: .5px solid rgba(255,255,255,.14); border-radius: 18px;
  padding: 18px; font-size: 16px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.anat-layer.sel .anat-layer-card { border-color: var(--lc); box-shadow: 0 0 0 2px var(--lc); }
.anat-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--lc); flex: none; }
.anat-layer-label {
  font-size: 12px; opacity: .55; margin-top: 6px; padding-left: 40px;
}
.anat-detail {
  display: none; width: 100%; max-width: 340px; margin-top: 10px;
  background: rgba(30,30,32,.85); border: .5px solid rgba(255,255,255,.14);
  border-radius: 16px; padding: 14px 18px; font-size: 14px;
  flex-direction: column; gap: 4px;
}
.anat-detail.show { display: flex; }
.anat-detail span { opacity: .6; }
.anat-toggle {
  margin-top: 14px; padding: 14px 44px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}
.build-preview-anatomy {
  padding: 13px 28px; border-radius: 999px;
  border: .5px solid rgba(255,255,255,.2); background: transparent;
  color: #fff; font-size: 16px; font-weight: 700;
}
[data-theme="mustard"] .build-preview-anatomy { border-color: rgba(0,0,0,.2); color: var(--ink); }

/* unfolding tab bar (Joy pattern) — replaces the old morph dock */
#dock {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: auto; max-width: 94vw;
}
#dock-bar {
  display: flex; align-items: center; gap: 6px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 6px;
}
#dock-bar button {
  background: none; border: none; color: #fff;
  width: 52px; height: 44px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; position: relative;
}
#dock-bar button.active { background: rgba(255,255,255,.16); }
#dock-plus { background: rgba(255,255,255,.1) !important; }
#dock-tools {
  display: none;
  grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: rgba(30, 30, 32, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px; padding: 14px;
  transform: scale(.92); opacity: 0; transform-origin: bottom center;
  transition: transform .3s cubic-bezier(0.32, 1.4, 0.4, 1), opacity .25s ease;
}
#dock.tools-open #dock-tools {
  display: grid; transform: scale(1); opacity: 1;
}
.tool-cell {
  background: rgba(255,255,255,.07); border: none; border-radius: 18px;
  color: #fff; padding: 14px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  min-width: 88px;
}
.tool-cell .ico { font-size: 26px; }
.tool-cell:active { transform: scale(.94); }
/* remove old morph-dock styles */
#dock-menu, .dock-row { display: none !important; }

/* top pill nav (Renzo pattern) — stretches for search + notifications */
#top-pill {
  position: relative;
  display: flex; align-items: center; gap: 2px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px; padding: 5px;
  transition: all .35s cubic-bezier(0.32, 0.72, 0, 1);
  max-width: calc(100vw - 120px);
}
#top-pill button {
  background: none; border: none; color: #fff;
  height: 38px; min-width: 44px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 18px; padding: 0 8px; position: relative;
  transition: background .25s ease, min-width .3s ease;
}
#top-pill button.active { background: rgba(255,255,255,.16); }
#tp-biz .tp-biz-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #FF9F0A, #FF453A);
}
#tp-biz .tp-label { font-size: 14px; font-weight: 600; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-dot {
  position: absolute; top: 8px; right: 10px;
  width: 8px; height: 8px; border-radius: 50%; background: #FF9F0A;
}
/* search stretch */
#top-pill.searching { padding: 5px 8px; }
#top-pill.searching > button { display: none; }
#tp-search-field {
  display: none; align-items: center; gap: 8px; flex: 1;
  padding: 0 6px;
}
#top-pill.searching #tp-search-field { display: flex; }
#tp-search-field .ico { font-size: 17px; }
#tp-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: 16px; min-width: 0;
}
#tp-search-input::placeholder { color: rgba(255,255,255,.4); }
.tp-esc {
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,.5);
  border: .5px solid rgba(255,255,255,.2); border-radius: 6px; padding: 3px 7px;
}
/* notifications drop panel */
#tp-notifs {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: min(78vw, 300px);
  background: rgba(30, 30, 32, 0.85);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px; padding: 8px;
  max-height: 50vh; overflow-y: auto;
  transform: translateY(-8px); opacity: 0;
  transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1), opacity .25s ease;
}
#top-pill.notifs-open #tp-notifs { display: block; transform: translateY(0); opacity: 1; }
.tp-notif {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 14px; color: #fff; text-align: left;
  background: none; border: none; width: 100%; font-size: 14px;
}
.tp-notif:active { background: rgba(255,255,255,.08); }
.tp-notif-ico { font-size: 22px; flex: none; }
.tp-notif-body { flex: 1; min-width: 0; }
.tp-notif-title { font-weight: 700; font-size: 14px; }
.tp-notif-msg { opacity: .6; font-size: 13px; margin-top: 2px; }
.tp-notif-time { font-size: 11px; opacity: .4; margin-top: 4px; }
.tp-notif.unread .tp-notif-title::after {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #FF9F0A; margin-left: 6px; vertical-align: middle;
}
/* old header bits */
#biz-btn, #theme-btn, .brand { display: none !important; }

/* captain work — inline issue rows (CJ pattern) */
.cw-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.cw-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(30, 30, 32, 0.72);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px; padding: 12px 14px;
  animation: cw-in .25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes cw-in { from { opacity: 0; transform: translateY(-8px); } }
[data-theme="mustard"] .cw-row { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); }
.cw-key {
  font-size: 12px; font-weight: 700; color: #0A84FF; flex: none;
  min-width: 64px;
}
.cw-input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: 16px; min-width: 0;
}
[data-theme="mustard"] .cw-input { color: var(--ink); }
.cw-input::placeholder { color: rgba(255,255,255,.3); }
[data-theme="mustard"] .cw-input::placeholder { color: rgba(0,0,0,.3); }
.cw-prio {
  background: none; border: none; font-size: 16px; flex: none;
  padding: 4px; border-radius: 8px;
}
.cw-prio.p0 { color: #FF453A; }
.cw-prio.p1 { color: #FF9F0A; }
.cw-prio.p2 { color: #8E8E93; }
.cw-del {
  background: none; border: none; color: #8E8E93;
  font-size: 16px; flex: none; padding: 4px;
}
.cw-add {
  margin-top: 12px; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 22px;
}
[data-theme="mustard"] .cw-add { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.cw-send {
  margin-top: 20px; width: 100%; padding: 16px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 17px; font-weight: 700;
}
.cw-send:active { transform: scale(.98); }

/* notification clearing pile (Adrian pattern) */
#tp-notifs { min-height: 380px; }
.pile-count { font-size: 12px; font-weight: 700; color: rgba(255,255,255,.5); padding: 8px 12px 0; }
.pile-deck { position: relative; height: 220px; margin: 8px 4px; }
.pile-card {
  position: absolute; left: 0; right: 0; top: 0;
  background: rgba(50,50,54,.95);
  border: .5px solid rgba(255,255,255,.14); border-radius: 18px;
  padding: 16px; color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: transform .35s cubic-bezier(0.32, 0.72, 0, 1), opacity .3s ease;
}
.pile-card:nth-child(2) { transform: translateY(8px) scale(.97); opacity: .7; }
.pile-card:nth-child(3) { transform: translateY(16px) scale(.94); opacity: .4; }
.pile-card:nth-child(n+4) { display: none; }
.pile-card.toss-left { transform: translateX(-120%) rotate(-18deg) !important; opacity: 0; }
.pile-card.toss-right { transform: translateX(120%) rotate(18deg) !important; opacity: 0; }
.pile-card.toss-down { transform: translateY(80px) scale(.9) !important; opacity: 0; }
.pile-title { font-size: 16px; font-weight: 700; }
.pile-msg { font-size: 14px; opacity: .65; margin-top: 6px; line-height: 1.4; }
.pile-time { font-size: 11px; opacity: .4; margin-top: 8px; }
.pile-actions { display: flex; gap: 8px; padding: 4px; }
.pile-btn {
  flex: 1; background: rgba(255,255,255,.08); border: none; border-radius: 14px;
  color: #fff; padding: 12px 4px; font-size: 13px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pile-btn span { font-size: 20px; }
.pile-btn:active { transform: scale(.94); }
#pile-done { background: #30D158; }
.pile-boom {
  display: none; text-align: center; padding: 60px 20px;
  font-size: 32px; font-weight: 800; color: #fff;
}
.pile-boom span { font-size: 17px; font-weight: 600; opacity: .6; }
#tp-notifs.empty .pile-boom { display: block; }
#tp-notifs.empty .pile-deck, #tp-notifs.empty .pile-actions, #tp-notifs.empty .pile-count { display: none; }

/* my week — weekly calendar strip (Malik pattern) */
.week-strip {
  display: flex; gap: 6px; margin-top: 14px;
}
.week-day {
  flex: 1; background: rgba(30,30,32,.72);
  border: .5px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 10px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff; border: none; min-width: 0;
  transition: background .25s ease, transform .2s ease;
}
[data-theme="mustard"] .week-day { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
.week-day .wd { font-size: 11px; font-weight: 700; opacity: .5; }
.week-day .dn { font-size: 17px; font-weight: 700; }
.week-day .dots { display: flex; gap: 3px; height: 6px; }
.week-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: #0A84FF; }
.week-day.sel { background: #1C1C1E; transform: scale(1.05); }
[data-theme="mustard"] .week-day.sel { background: #1C1C1E; color: #fff; }
.week-day.today .dn { color: #FF9F0A; }
.week-card {
  margin-top: 12px;
  background: rgba(30, 30, 32, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px; padding: 18px; color: #fff;
  animation: week-in .3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes week-in { from { opacity: 0; transform: translateY(10px); } }
[data-theme="mustard"] .week-card { background: rgba(250,248,242,.78); border-color: rgba(0,0,0,.08); color: var(--ink); }
.week-card-title { font-size: 15px; font-weight: 700; opacity: .6; margin-bottom: 10px; }
.week-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: .5px solid rgba(255,255,255,.08);
  font-size: 16px;
}
[data-theme="mustard"] .week-item { border-top-color: rgba(0,0,0,.08); }
.week-item:first-of-type { border-top: none; }
.week-item .wi-ico { font-size: 20px; }
.week-item.done { opacity: .4; text-decoration: line-through; }
.week-empty { text-align: center; opacity: .4; padding: 12px; font-size: 15px; }
#week-add-form { display: flex; gap: 8px; margin-top: 14px; }
#week-add-form input {
  flex: 1; background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 12px 18px; color: #fff; font-size: 16px; outline: none;
}
[data-theme="mustard"] #week-add-form input { background: rgba(250,248,242,.72); border-color: rgba(0,0,0,.08); color: var(--ink); }
#week-add-form button {
  border: none; border-radius: 999px; padding: 12px 22px;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}

/* design screen — component layers (Marvin pattern) */
.dsg-picker { display: flex; gap: 8px; margin-top: 12px; }
.dsg-chip {
  flex: 1; padding: 10px 4px; border-radius: 999px;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 14px; font-weight: 600;
}
.dsg-chip.active { background: #0A84FF; border-color: #0A84FF; }
.dsg-stage { position: relative; margin-top: 14px; min-height: 300px; }
.dsg-preview {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: 20px;
}
.dsg-layers { position: relative; }
.dsg-layer {
  border-radius: 18px; padding: 16px; margin-bottom: 10px;
  border: 1.5px dashed rgba(255,255,255,.25);
  transition: transform .45s cubic-bezier(0.32, 0.72, 0, 1), opacity .3s ease;
  position: relative;
}
.dsg-layer .dsg-tag {
  position: absolute; top: -10px; left: 14px;
  font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: #1C1C1E; color: #fff; padding: 3px 10px; border-radius: 999px;
}
.dsg-layer[data-l="surface"] { border-style: solid; border-color: rgba(10,132,255,.5); }
.dsg-layer[data-l="wire"] { border-color: rgba(255,159,10,.5); }
.dsg-layer[data-l="blocks"] { border-color: rgba(191,90,242,.5); }
.dsg-layer[data-l="space"] { border-color: rgba(255,69,58,.5); }
.dsg-layer.sel { box-shadow: 0 0 0 2px #fff; }
.dsg-layer .wire-box {
  border: 1px solid rgba(255,159,10,.7); border-radius: 8px;
  padding: 8px; margin: 4px 0; font-size: 12px; color: rgba(255,255,255,.7);
}
.dsg-layer .block-rect {
  background: rgba(191,90,242,.35); border-radius: 8px;
  height: 34px; margin: 4px 0;
}
.dsg-layer .space-guide {
  border: 1px dotted rgba(255,69,58,.8); border-radius: 8px;
  padding: 14px; font-size: 12px; color: rgba(255,255,255,.6); text-align: center;
}
#dsg-stage.stacked .dsg-layers .dsg-layer { margin-bottom: -58px; opacity: .85; }
#dsg-stage.stacked .dsg-layer[data-l="wire"] { transform: translateY(6px) scale(.98); }
#dsg-stage.stacked .dsg-layer[data-l="blocks"] { transform: translateY(12px) scale(.96); }
#dsg-stage.stacked .dsg-layer[data-l="space"] { transform: translateY(18px) scale(.94); }
.dsg-toggle {
  margin-top: 14px; width: 100%; padding: 15px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
}
.dsg-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.dsg-ctl label { display: block; font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.dsg-ctl input[type="range"] { width: 100%; accent-color: #0A84FF; }
.dsg-ctl .dsg-swatches { display: flex; gap: 8px; }
.dsg-sw { width: 38px; height: 38px; border-radius: 50%; border: 2px solid transparent; }
.dsg-sw.sel { border-color: #fff; }
/* live demo components */
.demo-bubble {
  max-width: 260px; padding: 12px 16px; border-radius: 20px;
  background: #0A84FF; color: #fff; font-size: 16px;
}
.demo-card {
  width: 260px; border-radius: 20px; overflow: hidden;
  background: rgba(40,40,44,.9); color: #fff;
}
.demo-card .dc-body { padding: 16px; }
.demo-card .dc-title { font-size: 17px; font-weight: 700; }
.demo-card .dc-sub { font-size: 13px; opacity: .6; margin-top: 4px; }
.demo-btn {
  padding: 14px 40px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 17px; font-weight: 700;
}

/* news — missed-this-week bubbles + predictions */
.news-tabs { display: flex; gap: 8px; margin-top: 12px; }
.news-tab {
  flex: 1; padding: 11px; border-radius: 999px;
  background: rgba(30,30,32,.72); border: .5px solid rgba(255,255,255,.12);
  color: #fff; font-size: 14px; font-weight: 700;
}
.news-tab.active { background: #0A84FF; border-color: #0A84FF; }
.news-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.news-bubble {
  background: #fff; color: #111; border-radius: 18px;
  padding: 14px 16px; font-size: 16px; font-weight: 600; line-height: 1.35;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  animation: news-in .3s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes news-in { from { opacity: 0; transform: translateY(8px); } }
.news-bubble .nb-src { display: block; font-size: 12px; font-weight: 700; opacity: .45; margin-top: 8px; }
.news-bubble.pred { background: rgba(30,30,32,.85); color: #fff; border: .5px solid rgba(255,255,255,.12); }
.news-bubble.pred .nb-odds {
  display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px;
  background: #30D158; color: #fff; font-size: 13px; font-weight: 800;
}
.news-foot { margin-top: 14px; font-size: 12px; opacity: .45; color: #fff; text-align: center; line-height: 1.5; }

/* feed — scrolling news cards, Muse-style, bottom action button */
#screen-feed { padding-bottom: 110px; }
.feed-list { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.feed-card {
  background: rgba(30, 30, 32, 0.78);
  border: 0.5px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px; padding: 18px; color: #fff;
  animation: news-in .3s cubic-bezier(0.32, 0.72, 0, 1);
}
[data-theme="mustard"] .feed-card { background: rgba(250,248,242,.78); border-color: rgba(0,0,0,.08); color: var(--ink); }
.feed-card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.feed-emoji { font-size: 34px; }
.feed-source { font-size: 12px; font-weight: 700; opacity: .5; }
.feed-time { font-size: 12px; opacity: .4; margin-left: auto; }
.feed-headline { font-size: 17px; font-weight: 700; line-height: 1.35; }
.feed-summary { font-size: 14px; opacity: .65; margin-top: 8px; line-height: 1.45; display: none; }
.feed-card.open .feed-summary { display: block; }
.feed-bottom {
  position: fixed; left: 0; right: 0;
  bottom: calc(76px + env(safe-area-inset-bottom));
  padding: 12px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent);
  display: flex; justify-content: center;
  pointer-events: none;
}
.feed-ask {
  pointer-events: auto;
  padding: 15px 32px; border-radius: 999px; border: none;
  background: #0A84FF; color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(10,132,255,.4);
}
.feed-ask:active { transform: scale(.96); }

/* Projects — weighted priority (Jamie pin/reorder rows) */
.proj-bar { display: flex; gap: 8px; margin: 12px 0; }
.proj-mode, .proj-coordinate {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: inherit; font-size: 14px; cursor: pointer;
}
.proj-coordinate { background: rgba(88,166,255,.18); border-color: rgba(88,166,255,.35); font-weight: 600; }
.proj-list { display: flex; flex-direction: column; gap: 8px; }
.proj-row {
  display: flex; align-items: center; gap: 10px; padding: 12px;
  border-radius: 14px; border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  touch-action: pan-y;
}
.proj-row[data-pinned="1"] { border-color: rgba(255,200,80,.45); background: rgba(255,200,80,.08); }
.proj-row.dragging { opacity: .9; transform: scale(1.02); box-shadow: 0 8px 24px rgba(0,0,0,.4); z-index: 10; }
.proj-main { flex: 1; min-width: 0; }
.proj-name { font-weight: 600; font-size: 15px; }
.proj-stage {
  margin-top: 4px; font-size: 12px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.08);
  color: inherit; cursor: pointer;
}
.proj-priority {
  min-width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; background: rgba(88,166,255,.15); border: 1px solid rgba(88,166,255,.3);
}
.proj-pin { background: none; border: none; font-size: 18px; opacity: .35; cursor: pointer; padding: 4px; }
.proj-pin.active { opacity: 1; }
.reorder-handle { background: none; border: none; color: inherit; opacity: .4; font-size: 16px; cursor: grab; padding: 4px; touch-action: none; }

/* perf: skip layout/paint for hidden screens */
.screen:not(.active) { content-visibility: auto; contain-intrinsic-size: 0 800px; }
.screen.active { content-visibility: visible; }

/* Router — Jev policy panel */
.router-head { margin: 12px 0; }
.router-est-label { font-size: 11px; opacity: .6; letter-spacing: 1px; }
.router-est { font-size: 40px; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.router-assume { font-size: 11px; opacity: .55; }
.router-tabs { display: flex; gap: 8px; margin: 12px 0; }
.router-tab { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: inherit; font-weight: 600; cursor: pointer; }
.router-tab.active { background: rgba(88,166,255,.2); border-color: rgba(88,166,255,.5); }
.router-diagram-wrap { margin: 12px 0; text-align: center; }
.router-diagram { width: 100%; max-width: 380px; height: auto; }
.router-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.router-table th, .router-table td { padding: 14px 6px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); }
.router-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.03); }
.router-table th { font-size: 11px; font-weight: 700; opacity: .75; }
.rt-label { font-weight: 600; }
.rt-id { font-size: 10px; opacity: .5; font-family: monospace; }
.demo-badge { font-size: 10px; padding: 2px 6px; border-radius: 8px; background: rgba(255,200,80,.15); border: 1px solid rgba(255,200,80,.3); color: inherit; }
.router-fallback { margin: 12px 0; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); }
.rf-toggle { display: flex; align-items: center; gap: 12px; font-weight: 600; cursor: pointer; min-height: 44px; }
.rf-toggle input[type="checkbox"] { transform: scale(1.5); }
.rf-chain { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rf-link { padding: 4px 10px; border-radius: 16px; background: rgba(88,166,255,.12); border: 1px solid rgba(88,166,255,.3); font-size: 12px; }
.rf-arrow { opacity: .4; }
.rf-note { margin-top: 8px; font-size: 11px; opacity: .55; }
.router-save { width: 100%; padding: 14px; border-radius: 14px; border: none; background: rgba(88,166,255,.25); color: inherit; font-weight: 700; font-size: 15px; cursor: pointer; margin: 12px 0; }
.router-error { padding: 10px; border-radius: 10px; background: rgba(255,80,80,.12); border: 1px solid rgba(255,80,80,.3); margin: 8px 0; font-size: 13px; }
.router-invalid { padding: 10px; border-radius: 10px; background: rgba(255,200,80,.1); margin: 8px 0; font-size: 13px; }
.router-anim-toggle { margin-top: 8px; padding: 6px 12px; border-radius: 16px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: inherit; font-size: 12px; cursor: pointer; }

.router-error, .router-invalid { animation: router-slide-in .25s ease-out; }
@keyframes router-slide-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Taste vault */
.taste-vault-bar { margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); }
.tv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tv-row:last-child { margin-bottom: 0; }
.tv-label { font-size: 13px; font-weight: 600; }
.tv-opt { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .7; cursor: pointer; }
.tv-btn { padding: 8px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.07); color: inherit; font-size: 13px; cursor: pointer; }
.tv-btn.danger { border-color: rgba(255,80,80,.35); color: #ff8080; }
.tv-addform { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.tv-addform input { padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: inherit; font-size: 14px; }
.perf-low * {
  animation: none !important;
  transition: none !important;
}
.perf-low .keep-anim {
  animation: inherit !important;
  transition: inherit !important;
}