@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("/fonts/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+200C-200D, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* Nsinika · warm neutrals in black and white: a cream (or warm charcoal)
   ground, translucent panels with hairline borders; buttons are black on
   light and white on dark, with no hue. */
:root {
  --ground: #262624;
  --text: #faf9f5;
  --muted: #c2c0b6;
  --faint: #9c9a92;
  --glass: rgba(48, 48, 46, 0.72);
  --glass-soft: rgba(48, 48, 46, 0.5);
  --glass-hover: rgba(250, 249, 245, 0.07);
  --line: rgba(222, 220, 209, 0.14);
  --line-soft: rgba(222, 220, 209, 0.09);
  --bubble: #141413;
  --accent: #faf9f5;
  --on-accent: #141413;
  --send: var(--accent);
  --on-send: var(--on-accent);
  --focus: #faf9f5;
  --sheen: rgba(250, 249, 245, 0.05);
  --glow: rgba(250, 249, 245, 0.06);
  --grid: rgba(222, 220, 209, 0.045);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --menu: rgba(48, 48, 46, 0.98);
  --blur: 24px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
  --ground: #faf9f5;
  --text: #141413;
  --muted: #5e5d59;
  --faint: #73726c;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.6);
  --glass-hover: rgba(31, 30, 29, 0.05);
  --line: rgba(31, 30, 29, 0.13);
  --line-soft: rgba(31, 30, 29, 0.08);
  --bubble: #f0eee6;
  --accent: #141413;
  --on-accent: #faf9f5;
  --send: var(--accent);
  --on-send: var(--on-accent);
  --focus: #141413;
  --sheen: rgba(255, 255, 255, 0.9);
  --glow: rgba(31, 30, 29, 0.04);
  --grid: rgba(31, 30, 29, 0.05);
  --shadow: 0 12px 32px rgba(31, 30, 29, 0.07);
  --menu: rgba(255, 255, 255, 0.98);
  color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ground: #faf9f5;
  --text: #141413;
  --muted: #5e5d59;
  --faint: #73726c;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-soft: rgba(255, 255, 255, 0.6);
  --glass-hover: rgba(31, 30, 29, 0.05);
  --line: rgba(31, 30, 29, 0.13);
  --line-soft: rgba(31, 30, 29, 0.08);
  --bubble: #f0eee6;
  --accent: #141413;
  --on-accent: #faf9f5;
  --send: var(--accent);
  --on-send: var(--on-accent);
  --focus: #141413;
  --sheen: rgba(255, 255, 255, 0.9);
  --glow: rgba(31, 30, 29, 0.04);
  --grid: rgba(31, 30, 29, 0.05);
  --shadow: 0 12px 32px rgba(31, 30, 29, 0.07);
  --menu: rgba(255, 255, 255, 0.98);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ground); color: var(--text);
  font: 15px/1.55 Inter, Vazirmatn, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at 50% -120px, var(--glow), transparent 70%);
}
.bg::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 64px 64px; background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 55% at 50% 0%, #000 30%, transparent 100%);
}
/* In a chat the grid goes: it stays on the home page only. */
body.chatting .bg::before { display: none; }
.glass {
  background: var(--glass); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--sheen), var(--shadow);
  -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}
.glass-soft {
  background: var(--glass-soft); border: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.grow { flex: 1; }
.fa { font-family: Vazirmatn, Inter, Vazirmatn, sans-serif; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* --- Shell: rail + main ---------------------------------------------------- */
.shell { display: flex; gap: 16px; padding: 16px; min-height: 100vh; }
.rail {
  position: sticky; top: 16px; align-self: flex-start; height: calc(100vh - 32px); min-height: 420px;
  flex: 0 0 64px; border-radius: 22px; padding: 14px 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.rail-mark img { display: block; width: 34px; height: 34px; object-fit: contain; }
.rail-gap { height: 14px; }
.ibtn {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 12px;
  border: 0; background: transparent; color: var(--faint); cursor: pointer; text-decoration: none;
}
.ibtn:hover { background: var(--glass-hover); color: var(--text); }
.ibtn.on { background: var(--glass-hover); color: var(--text); }
.ibtn[aria-disabled="true"] { cursor: default; opacity: 0.55; }
/* Signed out: an empty avatar where the account avatar will be. */
.ibtn.signin {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; color: var(--muted);
  background: var(--glass-hover); border: 1px solid var(--line);
}
.ibtn.signin:hover { color: var(--text); border-color: var(--muted); }
/* The switch shows the theme it goes to: a moon in light, a sun in dark. */
.theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: block; }
:root[data-theme="dark"] .theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: none; }
}
.ibtn[aria-disabled="true"]:hover { background: transparent; color: var(--faint); }
.main {
  flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: 40px 24px 24px;
}
.main > * { width: 100%; max-width: 820px; }

/* --- Phone: the rail becomes a bar along the top ---------------------------- */
@media (max-width: 720px) {
  .shell { flex-direction: column; padding: 10px; gap: 10px; }
  .rail {
    position: sticky; top: 10px; z-index: 10; height: auto; min-height: 0; width: 100%; flex-basis: auto;
    flex-direction: row; padding: 8px 10px; border-radius: 18px;
  }
  .rail .ibtn[aria-disabled="true"], .rail-gap { display: none; }
  .main { padding: 20px 6px; }
}

/* --- Hero ------------------------------------------------------------------ */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.eyebrow {
  font-size: 12px; color: var(--muted); padding: 3px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass-soft);
}
.hero h1 { margin: 0; font-size: clamp(32px, 5.4vw, 52px); line-height: 1.05; font-weight: 600; letter-spacing: -0.045em; }
.hero p { margin: 0; max-width: 620px; color: var(--muted); }
body.chatting .hero, body.chatting .ways, body.chatting .starters, body.chatting .panels { display: none; }
body.chatting .main { padding-top: 24px; }

/* --- Composer --------------------------------------------------------------- */
.composer { border-radius: 22px; padding: 14px 14px 12px 18px; }
.composer textarea {
  width: 100%; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font: 16px/1.6 Inter, Vazirmatn, system-ui, sans-serif; min-height: 64px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { border-color: var(--muted); }
.composer-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--glass-soft); color: var(--muted); font: 500 12px Inter, Vazirmatn, sans-serif;
}
.pill[aria-disabled="true"] { cursor: default; }
.hint { font-size: 12px; color: var(--faint); }
@media (max-width: 480px) { .hint { display: none; } }
.send {
  width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--send); color: var(--on-send); display: flex; align-items: center; justify-content: center;
}
.send:hover { opacity: 0.88; }
.send:disabled { opacity: 0.5; cursor: default; }

/* --- Starters and ways ------------------------------------------------------ */
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  min-height: 38px; border: 1px solid var(--line); background: var(--glass-soft); color: var(--muted);
  font: 13px Inter, Vazirmatn, sans-serif; padding: 0 14px; border-radius: 999px; cursor: pointer;
}
.chip:hover { color: var(--text); background: var(--glass-hover); }
.ways { display: flex; flex-wrap: wrap; gap: 12px; }
.way {
  flex: 1 1 220px; text-align: left; border-radius: 18px; padding: 18px; cursor: pointer; color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 4px;
}
.way:hover { background: var(--glass-hover); border-color: var(--line); }
.way-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.way-text { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* --- Panels (signed in) ----------------------------------------------------- */
.panels { display: flex; flex-wrap: wrap; gap: 16px; max-width: 1120px !important; margin-top: 10px; }
.panel { border-radius: 20px; padding: 16px; }
.panel h2 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.panel-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-meta { font-size: 12px; color: var(--faint); }
.sites { flex: 999 1 520px; min-width: 0; }
.side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 16px; }
.side .panel h2 { margin-bottom: 8px; }
.table-head {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); padding: 6px 10px;
  font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line-soft);
}
.empty { font-size: 13px; color: var(--muted); padding: 14px 10px 6px; line-height: 1.6; }
.side .empty { padding: 6px 0 2px; }
.meter { height: 6px; border-radius: 99px; background: var(--glass-hover); overflow: hidden; margin: 10px 0 8px; }
.meter-fill { width: 0; height: 100%; background: var(--accent); transition: width .4s ease; }
.site-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); padding: 9px 10px; align-items: center;
  font-size: 13px; border-bottom: 1px solid var(--line-soft);
}
.site-row:last-child { border-bottom: 0; }
.site-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-row a { color: inherit; text-decoration: none; }
.site-row a:hover { text-decoration: underline; }
.cell-sub { display: block; font-size: 11px; color: var(--faint); }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); margin-right: 6px; vertical-align: middle; }
.dot.on { background: var(--text); }
.ws-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; }
.ws-row .grow { flex: 1; }
.home-note { font-size: 12px; color: var(--faint); padding: 8px 10px 0; }

.foot { text-align: center; font-size: 12px; color: var(--faint); margin: 8px 0 0; }

/* --- Thread ----------------------------------------------------------------- */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.msg.user {
  align-self: flex-end; padding: 12px 14px; border-radius: 16px 16px 4px 16px;
  background: var(--bubble); border: 1px solid var(--line-soft);
}
.msg.note { align-self: flex-start; color: var(--muted); padding: 2px; }
.msg.note::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px;
  background: var(--faint); vertical-align: middle;
}
.banner { border-radius: 16px; padding: 12px 14px; font-size: 14px; color: var(--muted); }

/* --- Account (rail bottom) -------------------------------------------------- */
.account { position: relative; }
.account-btn { padding: 0; border: 0; background: transparent; border-radius: 50%; cursor: pointer; display: block; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font: 600 12px Inter, Vazirmatn, sans-serif; letter-spacing: 0.02em; color: var(--text);
  background: var(--glass-hover); border: 1px solid var(--line);
}
.account-btn:hover .avatar, .account-btn[aria-expanded="true"] .avatar { border-color: var(--muted); }
.avatar.big { width: 42px; height: 42px; font-size: 14px; }
.menu {
  position: absolute; left: calc(100% + 12px); bottom: 0; width: 280px; border-radius: 16px; padding: 8px;
  background: var(--menu); z-index: 20;
}
@media (max-width: 720px) { .menu { left: auto; right: 0; bottom: auto; top: calc(100% + 10px); } }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 8px 8px; }
.menu-who { min-width: 0; }
.menu-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-access { display: flex; align-items: center; gap: 8px; margin: 2px 8px 8px; font-size: 12px; color: var(--muted); }
.menu-access::before {
  content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--text);
}
.menu-access.closed::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 0; }
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text); font: 14px Inter, Vazirmatn, sans-serif; text-decoration: none; cursor: pointer;
}
.menu-item:hover { background: var(--glass-hover); }
.menu-item svg { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 14px; font-size: 14px; background: var(--menu);
}
@media (prefers-reduced-motion: no-preference) { .msg { animation: rise 0.2s ease-out; } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* === Landing (signed out) ==================================================
   Prompt-first hero, a slow grey glow behind the composer, example projects
   and how it works. Monochrome only. Every animation, transition and
   hidden-until-revealed state lives in the no-preference block at the end,
   so reduced motion (or no landing.js) shows everything still and in place. */
:root {
  --aurora-1: rgba(250, 249, 245, 0.10);
  --aurora-2: rgba(250, 249, 245, 0.07);
  --aurora-3: rgba(194, 192, 182, 0.06);
  --lift: 0 14px 30px rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --aurora-1: rgba(31, 30, 29, 0.08);
    --aurora-2: rgba(31, 30, 29, 0.06);
    --aurora-3: rgba(94, 93, 89, 0.05);
    --lift: 0 14px 30px rgba(0, 0, 0, 0.08);
  }
}
:root[data-theme="light"] {
  --aurora-1: rgba(31, 30, 29, 0.08);
  --aurora-2: rgba(31, 30, 29, 0.06);
  --aurora-3: rgba(94, 93, 89, 0.05);
  --lift: 0 14px 30px rgba(0, 0, 0, 0.08);
}
.main { overflow-x: clip; }
.hero { margin-top: clamp(8px, 9vh, 110px); }
.hero h1 { font-size: clamp(36px, 6.6vw, 68px); }

/* Composer stage and glow */
.stage { position: relative; isolation: isolate; }
.aurora { position: absolute; inset: -70px -40px; z-index: -1; pointer-events: none; }
.aurora span { position: absolute; border-radius: 50%; filter: blur(48px); }
.aurora span:nth-child(1) { width: 58%; height: 78%; left: 4%; top: 6%; background: radial-gradient(closest-side, var(--aurora-1), transparent); }
.aurora span:nth-child(2) { width: 52%; height: 72%; right: 2%; top: 18%; background: radial-gradient(closest-side, var(--aurora-2), transparent); }
.aurora span:nth-child(3) { width: 46%; height: 64%; left: 28%; top: 30%; background: radial-gradient(closest-side, var(--aurora-3), transparent); }
.composer textarea.ph-rtl:placeholder-shown { direction: rtl; }
body.chatting .aurora, body.chatting .showcase { display: none; }
#panels:not([hidden]) ~ .showcase { display: none; }

/* Showcase */
.main > .showcase { max-width: 1120px; }
.showcase { display: flex; flex-direction: column; gap: 72px; margin: 64px 0 24px; }
.show-block { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.show-head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 0 8px; }
.show-head h2 { margin: 0; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.15; font-weight: 600; letter-spacing: -0.035em; }

.marquee { width: 100%; overflow: hidden; padding: 6px 0 12px; }
.track { list-style: none; margin: 0; padding: 0 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { border-radius: 18px; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.card-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; margin-top: 8px; padding: 0 4px; }
.card-text { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 0 4px; }

/* Thumbnails: little grey wireframes, drawn in CSS */
.thumb {
  height: 128px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--glass-soft);
  padding: 12px; display: grid; gap: 7px; overflow: hidden;
}
.thumb i { display: block; border-radius: 5px; background: var(--line); }
.t-site { grid-template-columns: 1fr 1fr 1fr; grid-template-rows: 8px 1fr 22px; }
.t-site i:nth-child(1) { grid-column: 1 / -1; width: 40%; }
.t-site i:nth-child(2) { grid-column: 1 / -1; background: var(--bubble); border: 1px solid var(--line-soft); }
.t-shop { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.t-shop i { background: var(--bubble); border: 1px solid var(--line-soft); }
.t-dash { grid-template-columns: repeat(7, 1fr); align-items: end; }
.t-dash i { border-radius: 4px 4px 2px 2px; background: var(--muted); opacity: 0.35; }
.t-dash i:nth-child(1) { height: 30%; } .t-dash i:nth-child(2) { height: 52%; } .t-dash i:nth-child(3) { height: 44%; }
.t-dash i:nth-child(4) { height: 70%; } .t-dash i:nth-child(5) { height: 62%; } .t-dash i:nth-child(6) { height: 88%; opacity: 0.7; }
.t-dash i:nth-child(7) { height: 76%; }
.t-doc { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr 8px; }
.t-doc i:nth-child(1) { grid-row: 1 / 3; background: var(--bubble); border: 1px solid var(--line-soft); }
.t-doc i:nth-child(2), .t-doc i:nth-child(3) { background: var(--bubble); border: 1px solid var(--line-soft); }
.t-doc i:nth-child(4) { width: 70%; } .t-doc i:nth-child(5) { width: 45%; }
.t-rule { grid-template-rows: repeat(3, 1fr); }
.t-rule i { border-radius: 8px; background: var(--bubble); border: 1px solid var(--line-soft); }
.t-rule i:nth-child(2) { width: 82%; } .t-rule i:nth-child(3) { width: 60%; }

/* How it works */
.steps { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 980px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step { position: relative; border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 31px; right: -12px; width: 12px; height: 1px; background: var(--line);
}
.step-n {
  width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  font: 500 12px "JetBrains Mono", monospace; color: var(--muted); margin-bottom: 6px;
}
.step-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.step-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } .step::after { display: none; } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } .showcase { margin-top: 40px; gap: 56px; } }
.cta {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 12px;
  background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: 14px; text-decoration: none;
}
.cta:hover { opacity: 0.88; }

/* Motion: only for people who have not asked for less of it */
@media (prefers-reduced-motion: no-preference) {
  /* Staggered entrance */
  .hero > *, .stage, .starters, .ways { animation: enter 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero .eyebrow { animation-delay: 0.05s; }
  .hero h1 { animation-delay: 0.15s; }
  .hero p { animation-delay: 0.27s; }
  .stage { animation-delay: 0.4s; }
  .starters { animation-delay: 0.55s; }
  .ways { animation-delay: 0.68s; }

  /* The glow drifts and breathes, slowly */
  .aurora { animation: glow-in 2.4s ease-out 0.3s both; }
  .aurora span:nth-child(1) { animation: drift-a 22s ease-in-out infinite alternate; }
  .aurora span:nth-child(2) { animation: drift-b 27s ease-in-out infinite alternate; }
  .aurora span:nth-child(3) { animation: drift-c 31s ease-in-out infinite alternate; }

  /* Hover lift */
  .chip, .way, .card, .step, .cta { transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
  .chip:hover, .way:hover, .cta:hover { transform: translateY(-2px); }
  .card:hover, .step:hover { transform: translateY(-4px); box-shadow: var(--lift); border-color: var(--line); background: var(--glass-hover); }

  /* Scroll reveal (landing.js adds .js-reveal to <html> and .in to blocks) */
  .js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
  .js-reveal .reveal.in { opacity: 1; transform: none; }

  /* Marquee (landing.js doubles the cards and adds .is-marquee) */
  .marquee.is-marquee {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  }
  .is-marquee .track { display: flex; width: max-content; gap: 14px; padding: 0; animation: marquee 70s linear infinite; }
  .is-marquee .card { flex: 0 0 250px; margin: 0; }
  .is-marquee .track:hover { animation-play-state: paused; }
  .is-marquee .track:focus-within { animation-play-state: paused; }
}
@keyframes enter { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes glow-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drift-a { from { transform: translate(-6%, -4%) scale(1); } to { transform: translate(10%, 6%) scale(1.15); } }
@keyframes drift-b { from { transform: translate(6%, 4%) scale(1.1); } to { transform: translate(-10%, -6%) scale(0.95); } }
@keyframes drift-c { from { transform: translate(0, 6%) scale(0.9); } to { transform: translate(-4%, -8%) scale(1.2); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(calc(-50% - 7px)); } }

/* Connections panel: one row per NSIN product. */
.conn-row .grow > span { display: flex; flex-direction: column; }
.conn-row .cell-sub { margin-left: 0; }
.conn-btn {
  font: inherit; font-size: 12px; color: var(--text); background: transparent;
  border: 1px solid var(--line, rgba(127,127,127,.35)); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.conn-btn:hover { background: var(--glass-hover, rgba(127,127,127,.12)); }

/* Publish in the preview's header: the one filled button there. */
.preview-publish {
  font: inherit; font-size: 12px; font-weight: 600; color: var(--on-accent); background: var(--accent);
  border: 0; border-radius: 999px; padding: 4px 12px; margin-right: 6px; cursor: pointer;
}
.preview-publish:hover { opacity: .88; }

/* The publish card's build line. */
.build-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.build-line.ok { font-weight: 600; }
.build-line.bad { color: var(--text); }
.build-fix { margin-left: 6px; }

/* Background jobs: the Jobs tab of the side pane. */
.jobs-view { position: absolute; inset: 0; overflow: auto; padding: 6px 16px 16px; }
.jobs-view[hidden] { display: none; }
.seg button { display: inline-flex; align-items: center; gap: 4px; }
.seg .btn-spin { width: 10px; height: 10px; }
.seg-count:empty { display: none; }
.pill { white-space: nowrap; flex: 0 0 auto; }
body.previewing .hint { display: none; }
.jobs-head { margin: 14px 2px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); }
.job-card { margin: 0 0 8px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--glass-soft); overflow: hidden; transition: border-color 0.15s; }
.job-card:hover, .job-card.open { border-color: var(--line); }
.job-card.running { border-color: var(--line); }
.job-head { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; cursor: pointer; outline: none; }
.job-head.static { cursor: default; }
.job-head:focus-visible { box-shadow: inset 0 0 0 2px var(--line); border-radius: 14px; }
.job-main { flex: 1; min-width: 0; }
.job-title { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.job-title code { font: 12.5px "JetBrains Mono", ui-monospace, monospace; color: var(--text); background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.job-tag { flex: none; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.job-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-card.bad .job-sub { color: var(--text); }
.job-sub a { color: var(--text); }
.job-acts { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.job-chev { width: 8px; height: 8px; margin: 0 4px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg) translateY(-2px); transition: transform 0.15s; }
.job-card.open .job-chev { transform: rotate(-135deg) translate(-2px, 0); }
.job-state { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; display: inline-flex; align-items: center; justify-content: center; }
.job-state.ok::before { content: "✓"; font-size: 12px; font-weight: 700; color: var(--text); }
.job-state.bad::before { content: "!"; font-size: 10px; font-weight: 700; width: 14px; height: 14px; line-height: 13px; text-align: center; border-radius: 50%; background: var(--text); color: var(--ground); }
.job-state.off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--muted); }
.job-cmd-full { margin: 0 12px 8px 38px; font: 11.5px/1.5 "JetBrains Mono", ui-monospace, monospace; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-height: 120px; overflow: auto; }
.job-output {
  margin: 0 12px 12px 38px; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-soft);
  background: var(--ground); font: 11.5px/1.5 "JetBrains Mono", ui-monospace, monospace; white-space: pre-wrap; word-break: break-word;
}
.seg button:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--line); }
.seg button.fresh:not([aria-selected="true"]) { color: var(--text); animation: tab-blink 1.2s ease-in-out 3; }
.seg button.fresh:not([aria-selected="true"])::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text); margin-left: 2px; }
@keyframes tab-blink { 50% { background: var(--glass-hover); } }

/* Connect a code host. */
.gitc { max-width: 460px; }
.gitc-text { margin: 4px 2px 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.gitc-pick { display: grid; gap: 8px; }
.gitc-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-soft); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.gitc-opt:hover, .gitc-opt:focus-visible { border-color: var(--muted); }
.gitc-opt span { font-size: 12px; color: var(--muted); }
.gitc-token { display: grid; gap: 10px; }
.gitc-field { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.gitc-field[hidden] { display: none; }
.gitc-field input { font: inherit; font-size: 13px; color: var(--text); background: var(--glass-soft); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; }
.gitc-field input:focus-visible { border-color: var(--muted); }
.gitc-help { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.gitc-help a { color: var(--text); }
.gitc-acts { display: flex; align-items: center; gap: 8px; }
.gitc-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* Workspaces panel: per-row actions. */
.ws-acts { display: inline-flex; gap: 6px; margin-left: 10px; }
.ws-acts .conn-btn[disabled] { opacity: 0.5; }

/* Preview | Code switch and the code view. */
.seg { display: inline-flex; margin-left: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button { font: inherit; font-size: 12px; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.seg button[aria-selected="true"] { color: var(--on-accent); background: var(--accent); }
.code-view { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(150px, 30%) 1fr; }
.code-view[hidden] { display: none; }
.code-tree { overflow: auto; border-right: 1px solid var(--line-soft); padding: 6px 0; font-size: 12px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree-item { display: block; width: 100%; text-align: left; font: 12px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: transparent; border: 0; padding: 4px 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-item:hover { background: var(--glass-soft); }
.tree-item.on { background: var(--line); }
.tree-item.skipped { color: var(--muted); cursor: default; }
.tree-empty { padding: 4px 22px; color: var(--muted); font-size: 11px; }
.code-file { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.code-path { padding: 8px 12px; font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); border-bottom: 1px solid var(--line-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-path:empty::before { content: "Pick a file"; }
.code-text { flex: 1; margin: 0; overflow: auto; padding: 10px 12px; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; tab-size: 2; color: var(--text); }
.preview.coding .preview-reload, .preview.coding #preview-reload, .preview.coding #preview-open { visibility: hidden; }

/* The repository pill: the chat's workspace when it has no repository. */
#repo-btn .ws-icon { display: none; }
#repo-btn.in-ws .ws-icon { display: inline; }
#repo-btn.in-ws .repo-icon { display: none; }
#repo-btn.in-ws .repo-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.conn-acts { display: inline-flex; align-items: center; gap: 8px; }

/* Nsinika's confirm dialog (confirmBox in app.js). */
.ask-box {
  width: min(380px, calc(100vw - 32px)); margin: auto; padding: 20px 20px 16px; border-radius: 20px;
  color: var(--text); background: var(--menu, var(--glass));
  animation: ask-in .14s ease-out;
}
.ask-box::backdrop { background: rgba(0, 0, 0, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: ask-fade .14s ease-out; }
.ask-box.closing { animation: ask-out .12s ease-in forwards; }
.ask-box.closing::backdrop { animation: ask-fade .12s ease-in reverse forwards; }
.ask-box-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.ask-box-text { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.ask-box-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.ask-box-btn {
  font: inherit; font-size: 13px; padding: 7px 16px; border-radius: 999px; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid var(--line);
}
.ask-box-btn:hover { background: var(--glass-hover, rgba(127,127,127,.12)); }
.ask-box-btn:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
.ask-box-btn.ask-box-ok { font-weight: 600; color: var(--on-accent); background: var(--accent); border-color: transparent; }
.ask-box-btn.ask-box-ok:hover { opacity: .88; }
.ask-box-btn.ask-box-del { color: #fff; background: #d33a3a; }
@keyframes ask-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes ask-out { to { opacity: 0; transform: translateY(4px) scale(.98); } }
@keyframes ask-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ask-box, .ask-box::backdrop, .ask-box.closing { animation: none; } }

/* The side pane's toggle, top right of the chat while the pane is closed. */
.pane-toggle { position: fixed; top: 24px; right: 24px; z-index: 25; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border-radius: 12px; color: var(--muted); cursor: pointer; }
.pane-toggle:hover { color: var(--text); }
.pane-toggle[hidden], body.previewing .pane-toggle { display: none; }
.pane-toggle-text, #preview-close .close-back, #preview-close .close-text { display: none; }
/* Phone: a labelled pill in the top bar opens the pane; the pane's close is "‹ Chat", first in its header. */
@media (max-width: 720px) {
  .pane-toggle {
    top: 19px; right: 64px; width: auto; height: 36px; padding: 0 13px 0 11px; display: inline-flex; align-items: center; gap: 7px;
    border-radius: 999px; border: 1px solid var(--line); background: var(--accent); color: var(--on-accent); box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none; font: inherit; font-size: 13.5px; font-weight: 600;
  }
  .pane-toggle:hover { color: var(--on-accent); }
  .pane-toggle-text { display: inline; }
  #preview-close { order: -2; width: auto; padding: 0 12px 0 8px; gap: 4px; display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; }
  #preview-close .close-x { display: none; }
  #preview-close .close-back, #preview-close .close-text { display: inline; }
  .preview-head .preview-dot { display: none; }
}

/* --- Pages: Workspaces, Sites, Wallet (the rail) ------------------------------ */
body.paging #home > :not(#page) { display: none !important; }
body.paging .main { padding-top: 32px; }
.pg { max-width: 960px !important; display: flex; flex-direction: column; gap: 18px; }
.pg-head h1 { margin: 0; font-size: clamp(26px, 3.4vw, 32px); line-height: 1.15; font-weight: 600; letter-spacing: -0.035em; }
.pg-sub { margin: 6px 0 0; max-width: 620px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.pg-body { display: flex; flex-direction: column; gap: 16px; }
.pg-card .home-note { padding: 6px 0 0; line-height: 1.6; }
.pg-card .empty { padding: 8px 0 4px; }
.pg-btn { margin-top: 12px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.pg-ws .ws-row { padding: 10px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.pg-ws .ws-row:last-child { border-bottom: 0; }
.chat-link {
  display: block; max-width: 100%; margin-top: 2px; font-size: 12px; color: var(--faint);
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-link::before { content: "Chat: "; }
.chat-link:hover { color: var(--text); text-decoration: underline; }
.ws-row .grow { min-width: 0; }
.table-head.pg-sites, .site-row.pg-sites { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); }
.big-num { font-size: 34px; line-height: 1.1; font-weight: 600; letter-spacing: -0.03em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.big-unit { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; margin: 14px 0 4px; }
.bars span { flex: 1; min-height: 2px; background: var(--text); opacity: 0.78; border-radius: 3px 3px 1px 1px; }
.bars span.zero { opacity: 0.14; }
.bars-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); }
.entry-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr) auto 90px; gap: 12px; align-items: center;
  padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft);
}
.entry-row:last-of-type { border-bottom: 0; }
.entry-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-amt { font-variant-numeric: tabular-nums; color: var(--muted); }
.entry-amt.in { color: var(--text); font-weight: 600; }
.entry-after { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  body.paging .main { padding-top: 16px; }
  .entry-row { grid-template-columns: minmax(0, 1fr) auto; }
  .entry-row > .panel-meta { display: none; }
  .table-head.pg-sites { display: none; }
  .site-row.pg-sites { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 4px; }
  .site-row.pg-sites > :first-child { grid-column: 1 / -1; }
}

/* --- A chat on its way (openChat) ------------------------------------------- */
body.nav-busy::after {
  content: ""; position: fixed; top: 0; left: 0; z-index: 100; height: 2px; width: 30%;
  background: var(--text); animation: nav-busy 0.9s ease-in-out infinite;
}
body.nav-busy .thread, body.nav-busy .pg { opacity: 0.45; transition: opacity 0.15s ease 0.1s; }
@keyframes nav-busy { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { body.nav-busy::after { animation: none; width: 100%; opacity: 0.4; } }
.msg.user.sent-during { opacity: 0.9; }

/* A chat answers now: the Chats button pulses, with a dot. */
#chats-btn { position: relative; }
#chats-btn.live::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text); box-shadow: 0 0 0 2px var(--ground);
  animation: chat-live 1.4s ease-in-out infinite;
}
#chats-btn.live svg { animation: chat-live 1.4s ease-in-out infinite; }
@keyframes chat-live { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { #chats-btn.live::after, #chats-btn.live svg { animation: none; } }
