/* AppMint AI Studio — one dark workspace, one accent. */
:root {
  --bg: #07090d;
  --bg-2: #0c1016;
  --panel: #10151d;
  --panel-2: #151b25;
  --line: #1f2733;
  --line-2: #2a3442;
  --text: #e8edf4;
  --muted: #8b97a8;
  --dim: #5d6878;
  --accent: #c8f031;
  --accent-ink: #0b1000;
  --accent-soft: rgba(200, 240, 49, .12);
  --violet: #8b7bff;
  --hot: #ff6b2c;
  --ok: #3ddc97;
  --warn: #ffb547;
  --err: #ff5d6c;
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.hidden { display: none !important; }
::selection { background: rgba(200, 240, 49, .3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #232c39; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ── buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text); font-weight: 600; font-size: 13px; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { background: #1b2230; border-color: #364153; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 0 0 1px rgba(200,240,49,.4), 0 8px 24px -8px rgba(200,240,49,.55); }
.btn.primary:hover { background: #d6ff47; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel-2); color: var(--text); }
.btn.icon { width: 36px; padding: 0; justify-content: center; }
.btn svg { width: 16px; height: 16px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.pill.hot { background: linear-gradient(90deg, #ff6b2c, #ff3d6e); color: #fff; box-shadow: 0 0 18px -4px rgba(255,90,60,.8); }
.pill.soft { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

/* ── top bar ── */
.topbar { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-bottom: 1px solid var(--line); background: rgba(7,9,13,.85); backdrop-filter: blur(12px); position: relative; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 16px; }
.brand .mark { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 210deg, #c8f031, #3ddc97, #8b7bff, #c8f031); display: grid; place-items: center; color: #07090d; font-weight: 800; font-size: 15px; }
.topbar .sep { width: 1px; height: 22px; background: var(--line-2); }
.proj-name { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 5px 8px; font-weight: 600; max-width: 260px; }
.proj-name:hover, .proj-name:focus { border-color: var(--line-2); outline: none; background: var(--panel); }
.topbar .grow { flex: 1; }
.privacy { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; padding: 0 10px; height: 30px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; flex: none; }
/* A crowded header (signed in, an app open) keeps the shield and its tooltip, not four wrapped lines. */
@media (max-width: 1500px) { body.in-ws .privacy .pv-words { display: none; } }
.privacy svg { width: 13px; height: 13px; color: var(--ok); }
.ai-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12.5px; }
.ai-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--err); box-shadow: 0 0 10px var(--err); }
.ai-chip.ready .dot { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* ── home ── */
.home { position: relative; min-height: calc(100% - 56px); overflow-x: hidden; }
.mesh { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mesh::before, .mesh::after { content: ""; position: absolute; width: 900px; height: 900px; border-radius: 50%; filter: blur(120px); opacity: .32; animation: drift 22s ease-in-out infinite alternate; }
.mesh::before { background: radial-gradient(circle, #c8f031 0%, transparent 60%); top: -480px; left: -200px; }
.mesh::after { background: radial-gradient(circle, #6b5bff 0%, transparent 60%); top: -380px; right: -260px; animation-delay: -11s; }
@keyframes drift { to { transform: translate(140px, 90px) scale(1.15); } }
.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 55% at 50% 30%, #000 30%, transparent 75%); }
.hero { position: relative; max-width: 860px; margin: 0 auto; padding: 72px 20px 32px; text-align: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(16,21,29,.7); font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.hero h1 { font-family: var(--display); font-size: clamp(34px, 6vw, 62px); line-height: 1.02; letter-spacing: -.035em; margin: 0 0 16px; font-weight: 700; }
.hero h1 .glow { background: linear-gradient(92deg, #c8f031 0%, #3ddc97 45%, #8b7bff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { color: var(--muted); font-size: clamp(15px, 2vw, 18px); max-width: 640px; margin: 0 auto 30px; }
.composer-big { position: relative; text-align: left; border-radius: 20px; padding: 2px; background: linear-gradient(135deg, rgba(200,240,49,.55), rgba(61,220,151,.25) 40%, rgba(139,123,255,.55)); box-shadow: 0 30px 80px -30px rgba(139,123,255,.45), 0 20px 60px -40px rgba(200,240,49,.5); }
.composer-big .inner { background: #0b0f15; border-radius: 18px; padding: 14px; }
.composer-big textarea { width: 100%; min-height: 96px; max-height: 300px; resize: none; background: transparent; border: 0; outline: none; font-size: 16.5px; line-height: 1.55; color: var(--text); }
.composer-big textarea::placeholder { color: #5f6b7c; }
.composer-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 11px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.seg button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.chip { height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(16,21,29,.6); color: var(--muted); font-size: 12.5px; }
.chip:hover { color: var(--text); border-color: #3a4658; }
.attach-thumb { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 4px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; }
.attach-thumb img { width: 22px; height: 22px; object-fit: cover; border-radius: 5px; }

.section { position: relative; max-width: 1120px; margin: 0 auto; padding: 18px 20px 40px; }
.section h2 { font-family: var(--display); font-size: 20px; letter-spacing: -.01em; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { position: relative; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); padding: 16px; cursor: pointer; transition: border-color .15s, transform .15s; min-height: 118px; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: #3a4658; transform: translateY(-2px); }
.card .t { font-weight: 650; font-size: 15px; }
.card .m { color: var(--dim); font-size: 12px; }
.card .x { position: absolute; top: 10px; right: 10px; opacity: 0; }
.card:hover .x { opacity: 1; }
.card.import { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.card.import svg { width: 26px; height: 26px; color: var(--accent); }

.why { position: relative; max-width: 1120px; margin: 10px auto 0; padding: 30px 20px 80px; }
.why h2 { font-family: var(--display); font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -.03em; text-align: center; margin: 0 0 10px; }
.why .lead { text-align: center; color: var(--muted); max-width: 720px; margin: 0 auto 30px; font-size: 16px; }
.compare { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.compare th, .compare td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
.compare tr:last-child td { border-bottom: 0; }
.compare th { font-family: var(--display); font-size: 13px; color: var(--muted); font-weight: 600; background: var(--bg-2); }
.compare td.us { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.compare th.us { color: var(--accent); background: rgba(200,240,49,.08); }
.compare td.them { color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 22px; }
.feature { border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2)); padding: 18px; }
.feature b { display: block; font-family: var(--display); font-size: 16px; margin-bottom: 6px; }
.feature span { color: var(--muted); font-size: 13.5px; }
.footnote { color: var(--dim); font-size: 12px; text-align: center; margin-top: 18px; }

/* ── workspace ── */
.ws { display: grid; grid-template-columns: minmax(340px, 410px) 1fr; height: calc(100% - 56px); }
.chat { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-2); min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 100%; }
.msg.user { align-self: flex-end; background: #1a2230; border: 1px solid var(--line-2); padding: 10px 13px; border-radius: 14px 14px 4px 14px; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.msg.ai { color: #d5dce6; }
.msg.ai .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }
.msg.ai .who .av { width: 20px; height: 20px; border-radius: 6px; background: conic-gradient(from 210deg, #c8f031, #3ddc97, #8b7bff, #c8f031); }
.md p { margin: 0 0 8px; } .md ul, .md ol { margin: 0 0 8px; padding-left: 20px; } .md li { margin: 2px 0; }
.md h1, .md h2, .md h3 { font-size: 14px; margin: 10px 0 6px; font-family: var(--display); }
.md code { font-family: var(--mono); font-size: 12px; background: #1a2230; padding: 1px 5px; border-radius: 5px; }
.md pre { background: #0a0e14; border: 1px solid var(--line); padding: 10px; border-radius: 10px; overflow-x: auto; font-size: 12px; }
.md pre code { background: transparent; padding: 0; }
.plan-card { border: 1px solid rgba(200,240,49,.35); background: linear-gradient(180deg, rgba(200,240,49,.06), transparent 70%), var(--panel); border-radius: var(--radius); padding: 14px; }
.plan-card .h { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; margin-bottom: 8px; }
.plan-card .body { max-height: 340px; overflow-y: auto; font-size: 13px; }
.plan-card .acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.plan-card textarea { width: 100%; min-height: 70px; margin-top: 10px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.activity { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 12px 14px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim); }
.step .ic { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; }
.step.on { color: var(--text); } .step.on .ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done { color: var(--muted); } .step.done .ic { border-color: var(--ok); background: var(--ok); }
.step.done .ic::after { content: ""; width: 7px; height: 4px; border-left: 2px solid #07090d; border-bottom: 2px solid #07090d; transform: rotate(-45deg) translate(1px,-1px); }
.step.bad .ic { border-color: var(--warn); }
@keyframes spin { to { transform: rotate(360deg); } }
.ticker { margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px; }
.ticker span { padding: 2px 7px; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); animation: pop .3s ease; }
.ticker span.new { border-color: rgba(200,240,49,.5); color: var(--accent); }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
.result { border-radius: var(--radius); padding: 12px 14px; border: 1px solid rgba(61,220,151,.35); background: rgba(61,220,151,.07); }
.result.bad { border-color: rgba(255,181,71,.35); background: rgba(255,181,71,.07); white-space: pre-wrap; }
.repair { font-size: 12.5px; color: var(--muted); border-left: 2px solid var(--warn); padding: 4px 0 4px 10px; }
.repair code { display: block; margin-top: 4px; font-family: var(--mono); font-size: 11.5px; color: #e9c891; white-space: pre-wrap; max-height: 90px; overflow: hidden; }
.usage-line { font-size: 11px; color: var(--dim); text-align: right; }
.chat-input { padding: 12px; border-top: 1px solid var(--line); background: var(--bg-2); }
.chat-box { border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); padding: 10px; transition: border-color .15s, box-shadow .15s; }
.chat-box:focus-within { border-color: rgba(200,240,49,.5); box-shadow: 0 0 0 4px rgba(200,240,49,.08); }
.chat-box textarea { width: 100%; min-height: 44px; max-height: 220px; resize: none; background: transparent; border: 0; outline: none; font-size: 14px; }
.chat-box .row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.working-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 8px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.working-bar .spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.tabs { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tab { height: 32px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.tab.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.tab .badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; display: inline-grid; place-items: center; padding: 0 5px; }
.stage { flex: 1; position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #121a26 0%, var(--bg) 60%); display: flex; align-items: center; justify-content: center; }
.stage .dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px); background-size: 22px 22px; }
.device { position: relative; transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), border-radius .35s; background: #000; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px #2b3442, 0 0 0 10px #0d1117, 0 0 0 11px #2b3442; }
.device.phone { width: 390px; height: min(800px, calc(100% - 60px)); border-radius: 46px; overflow: hidden; }
.device.tablet { width: min(820px, calc(100% - 60px)); height: min(1000px, calc(100% - 60px)); border-radius: 28px; overflow: hidden; }
.device.desktop { width: calc(100% - 40px); height: calc(100% - 40px); border-radius: 12px; overflow: hidden; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9), 0 0 0 1px #2b3442; }
.device iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.device .notch { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 110px; height: 30px; background: #000; border-radius: 20px; z-index: 2; pointer-events: none; }
.device.tablet .notch, .device.desktop .notch { display: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); z-index: 1; pointer-events: none; }
.stage-empty .big { font-family: var(--display); font-size: 22px; color: var(--text); margin-bottom: 6px; }
.building-veil { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(7,9,13,.55); backdrop-filter: blur(3px); border-radius: inherit; }
.building-veil .ring { width: 54px; height: 54px; border-radius: 50%; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.stage-tools { position: absolute; top: 12px; right: 14px; z-index: 4; display: flex; gap: 6px; }
.errbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 4; max-width: min(640px, calc(100% - 40px)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #1f1416; border: 1px solid rgba(255,93,108,.45); color: #ffd3d8; font-size: 13px; box-shadow: 0 12px 40px -10px rgba(0,0,0,.8); }
.errbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.code { flex: 1; display: grid; grid-template-columns: 250px 1fr; min-height: 0; }
.explorer { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px 6px; font-size: 13px; background: var(--bg-2); }
.explorer .head { display: flex; align-items: center; justify-content: space-between; padding: 4px 8px 8px; color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tree-item { display: flex; align-items: center; gap: 6px; height: 27px; padding: 0 8px; border-radius: 7px; color: #b9c3d1; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.tree-item:hover { background: var(--panel); }
.tree-item.on { background: var(--panel-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.tree-item.dir { color: var(--muted); font-weight: 600; }
.tree-item .fresh { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: auto; flex: none; box-shadow: 0 0 8px var(--accent); }
.tree-item svg { width: 14px; height: 14px; flex: none; opacity: .75; }
.editor-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor-head { height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.editor-head .live { margin-left: auto; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.editor-head .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
#editor { flex: 1; min-height: 0; overflow: hidden; }
#editor .cm-editor { height: 100%; font-size: 13px; }
#editor .cm-scroller { font-family: var(--mono); }
.binary-view { padding: 30px; color: var(--muted); }
.binary-view img { max-width: 100%; max-height: 60vh; border-radius: 10px; border: 1px solid var(--line); background: repeating-conic-gradient(#1a1f28 0 25%, #12161d 0 50%) 50% / 16px 16px; }

/* ── modals ── */
.modal-bg { position: fixed; inset: 0; background: rgba(3,5,8,.7); backdrop-filter: blur(6px); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 40px 120px -20px rgba(0,0,0,.9); }
.modal .mh { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; }
.modal .mh h3 { margin: 0; font-family: var(--display); font-size: 19px; }
.modal .mb { padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal .mf { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding: 0 20px 20px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); outline: none; }
.field textarea { height: auto; min-height: 80px; padding: 10px 12px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(200,240,49,.55); box-shadow: 0 0 0 4px rgba(200,240,49,.08); }
.field .hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
.field .hint a { color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.note { font-size: 12.5px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; }
.note svg { width: 16px; height: 16px; flex: none; color: var(--ok); margin-top: 1px; }
.err-text { color: var(--err); font-size: 13px; }
.progress { height: 8px; border-radius: 8px; background: var(--bg); overflow: hidden; border: 1px solid var(--line); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--ok)); transition: width .3s; }
.icon-pick { display: flex; align-items: center; gap: 12px; }
.icon-pick canvas, .icon-pick img { width: 64px; height: 64px; border-radius: 16px; border: 1px solid var(--line-2); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; background: #1a2230; border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; font-size: 13px; box-shadow: 0 20px 50px -10px rgba(0,0,0,.8); animation: fade .2s; }
.toast.err { border-color: rgba(255,93,108,.5); color: #ffd3d8; }

/* ── responsive ── */
.mobile-tabs { display: none; }
@media (max-width: 960px) {
  .ws { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mobile-tabs { display: flex; gap: 4px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
  .ws[data-m="chat"] .main, .ws[data-m="app"] .chat { display: none; }
  .chat { border-right: 0; min-height: 0; }
  .code { grid-template-columns: 1fr; grid-template-rows: 160px 1fr; }
  .explorer { border-right: 0; border-bottom: 1px solid var(--line); }
  .device.phone { width: min(390px, calc(100% - 30px)); }
  .privacy, .topbar .hide-sm { display: none; }
  .topbar { gap: 8px; padding: 0 10px; }
  body.in-ws .brand > span:last-child { display: none; }
  .proj-name { flex: 1 1 0; min-width: 0; width: 0; max-width: none; }
  body.in-ws .topbar .grow { display: none; }
  body.in-ws #aiChipText { display: none; }
  .ai-chip { padding: 0 11px; }
  #undoBtn { display: none; }
  #buildApkBtn { padding: 0 11px; }
  .chat-box .row .seg button { padding: 0 8px; }
  .hero { padding-top: 44px; }
  .row2 { grid-template-columns: 1fr; }
  .compare th, .compare td { padding: 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 520px) {
  .topbar .pill.hot { display: none; }
  #buildApkBtn svg { display: none; }
}
/* On a phone the preview IS the phone: no frame, full bleed. */
@media (max-width: 960px) {
  #deviceSeg { display: none; }
  .device.phone, .device.tablet, .device.desktop { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
  .device .notch { display: none; }
  .tabs { overflow-x: auto; }
}

/* ── project thumbnails, next-step chips, how-it-works ── */
.card .top { display: flex; align-items: center; gap: 12px; }
.thumb { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 19px; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.next-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.next-chips .chip { height: 30px; font-size: 12px; }
.how { position: relative; max-width: 1120px; margin: 0 auto; padding: 10px 20px 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how .step-card { border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--bg-2)); padding: 18px; overflow: hidden; position: relative; min-height: 200px; }
.how .num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.how h3 { font-family: var(--display); font-size: 18px; margin: 4px 0 6px; }
.how p { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.viz-chat { display: flex; flex-direction: column; gap: 6px; }
.viz-chat span { align-self: flex-end; background: #1a2230; border: 1px solid var(--line-2); border-radius: 12px 12px 3px 12px; padding: 7px 10px; font-size: 12px; max-width: 90%; }
.viz-chat i { align-self: flex-start; font-style: normal; font-size: 12px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.viz-chat i::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.viz-phone { width: 104px; height: 150px; margin: 0 auto; border-radius: 20px; background: #06140d; box-shadow: 0 0 0 5px #0d1117, 0 0 0 6px #2b3442, 0 20px 40px -10px rgba(0,0,0,.8); padding: 14px 9px; display: flex; flex-direction: column; gap: 6px; }
.viz-phone b { height: 8px; width: 60%; border-radius: 4px; background: #e7fff2; opacity: .85; margin-bottom: 4px; }
.viz-phone u { height: 22px; border-radius: 7px; background: rgba(255,255,255,.06); text-decoration: none; position: relative; }
.viz-phone u:nth-child(3) { background: rgba(61,220,151,.22); box-shadow: inset 0 0 0 1px #3ddc97; animation: glow 2.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: inset 0 0 0 1px #c8f031; background: rgba(200,240,49,.18); } }
.viz-ship { display: flex; gap: 10px; justify-content: center; align-items: center; padding-top: 6px; }
.viz-ship .file { width: 70px; height: 86px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 13px; position: relative; }
.viz-ship .file::after { content: "signed ✓"; position: absolute; bottom: 8px; font-size: 9px; color: var(--ok); font-weight: 600; }
.viz-ship .file.apk { color: var(--accent); }
.viz-ship .file.aab { color: var(--violet); }
@media (max-width: 860px) { .how { grid-template-columns: 1fr; } }

/* comparison table → stacked cards on phones */
@media (max-width: 700px) {
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare thead { display: none; }
  .compare { background: transparent; border: 0; }
  .compare tr { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 12px; overflow: hidden; }
  .compare td { border-bottom: 0; padding: 10px 14px; }
  .compare td:first-child { font-family: var(--display); font-weight: 700; font-size: 15px; padding-top: 14px; }
  .compare td.us::before { content: "AppMint AI Studio"; display: block; font-size: 11px; color: var(--accent); font-weight: 700; letter-spacing: .03em; margin-bottom: 2px; }
  .compare td.them::before { content: "Lovable · Replit · Bolt"; display: block; font-size: 11px; color: var(--dim); font-weight: 700; letter-spacing: .03em; margin-bottom: 2px; }
}

/* ── attachments ── */
#heroThumb, #chatThumb { display: contents; }
.attach-thumb { max-width: 100%; }
.attach-thumb.pending { opacity: .7; }
.attach-thumb .att-ic { width: 22px; height: 22px; display: grid; place-items: center; font-size: 14px; }
.attach-thumb .att-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-thumb small { color: var(--dim); font-size: 11px; }
.att-toggle { height: 20px; padding: 0 7px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 600; }
.att-toggle.on { border-color: rgba(200,240,49,.5); color: var(--accent); background: var(--accent-soft); }
.composer-big.drop .inner, .chat-box.drop { box-shadow: 0 0 0 2px var(--accent) inset; background: #0f1508; }
.msg-att { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chat-box .row { flex-wrap: wrap; }

/* ── GitHub panel ── */
.steps-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; display: grid; gap: 6px; }
.steps-list b { color: var(--text); }
.gh-repo { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.gh-repo svg { width: 18px; height: 18px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── AI budget meter ── */
.budget { width: 100%; display: block; position: relative; margin-bottom: 8px; padding: 5px 10px 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--dim); font-size: 11.5px; text-align: left; overflow: hidden; }
.budget:hover { color: var(--muted); border-color: var(--line-2); }
.budget i { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.budget i.hot { background: linear-gradient(90deg, var(--warn), var(--err)); }

/* ── live writing ── */
.live-write { margin-top: 12px; border-radius: 10px; border: 1px solid rgba(200,240,49,.35); background: #0a0e14; overflow: hidden; }
.lw-head { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px; font-weight: 600; color: var(--accent); border-bottom: 1px solid var(--line); }
.lw-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
.live-write pre { margin: 0; padding: 8px 10px; font: 11px/1.45 var(--mono); color: #c9d4e2; max-height: 210px; overflow: hidden; white-space: pre-wrap; word-break: break-all; }
.tree-item .writing { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 1px 6px; animation: blink 1.2s infinite; }
.tree-item.live { color: var(--text); }
.next-label { font-size: 12px; color: var(--dim); align-self: center; margin-right: 2px; }

/* ── drawn plan (PlanScreens port) ── */
.plan-view { display: flex; flex-direction: column; gap: 12px; }
.ps-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; }
.ps { margin: 0; flex: none; width: 136px; scroll-snap-align: start; }
.ps-phone { position: relative; width: 136px; height: 236px; border-radius: 20px; padding: 5px; background: #05070a; box-shadow: 0 0 0 1px #2b3442, 0 14px 30px -12px rgba(0,0,0,.8); }
.ps-notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 34px; height: 8px; border-radius: 6px; background: #05070a; z-index: 1; }
.ps-body { height: 100%; border-radius: 16px; padding: 20px 8px 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.ps-title { font: 700 10.5px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-text { display: flex; flex-direction: column; gap: 3px; }
.ps-text i { height: 3px; border-radius: 2px; opacity: .45; }
.ps-input { height: 18px; border: 1px solid; border-radius: 6px; font-size: 7.5px; padding: 0 5px; display: flex; align-items: center; opacity: .9; white-space: nowrap; overflow: hidden; }
.ps-list { display: flex; flex-direction: column; gap: 4px; }
.ps-list > div { height: 18px; border-radius: 6px; display: flex; align-items: center; gap: 5px; padding: 0 5px; }
.ps-list b { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ps-list i { height: 3px; flex: 1; border-radius: 2px; opacity: .5; }
.ps-image { height: 46px; border-radius: 8px; flex: none; }
.ps-row { display: flex; gap: 4px; }
.ps-row span { flex: 1; height: 14px; border-radius: 6px; }
.ps-box { min-height: 24px; border-radius: 8px; font-size: 7.5px; padding: 4px 6px; opacity: .95; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ps-button { height: 20px; border-radius: 8px; font: 700 8px/20px var(--sans); text-align: center; margin-top: auto; white-space: nowrap; overflow: hidden; }
.ps figcaption { margin-top: 8px; font-size: 12px; line-height: 1.35; }
.ps figcaption b { display: block; font-family: var(--display); }
.ps figcaption span { color: var(--muted); font-size: 11.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ps-palette { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.ps-palette span { display: inline-flex; align-items: center; gap: 5px; }
.ps-palette i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.plan-card .body { max-height: none; }

/* ── VS Code-style explorer ── */
.explorer { padding: 0; }
.explorer .head { padding: 10px 10px 6px 14px; }
.vs-acts { display: inline-flex; gap: 2px; }
.vs-acts button { width: 24px; height: 22px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; }
.vs-acts button:hover { background: var(--panel-2); color: var(--text); }
#tree { padding-bottom: 20px; }
.vs-row { display: flex; align-items: center; gap: 5px; height: 24px; padding-left: calc(8px + var(--d) * 14px); padding-right: 8px; font-size: 13px; color: #c5cfdc; cursor: pointer; user-select: none; white-space: nowrap; }
.vs-row:hover { background: #18202b; }
.vs-row.on { background: #1d2a3a; color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.vs-row.live { color: var(--text); }
.vs-row .vs-name { overflow: hidden; text-overflow: ellipsis; }
.vs-row .fresh, .vs-row .writing { margin-left: auto; }
.chev { width: 14px; height: 14px; flex: none; position: relative; }
.chev::before { content: ""; position: absolute; left: 4px; top: 3px; width: 5px; height: 5px; border-right: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; }
.chev.open::before { transform: rotate(45deg); left: 4px; top: 2px; }
.chev.none::before { display: none; }
.vs-ic { width: 16px; flex: none; text-align: center; font: 700 9.5px/16px var(--mono); }
.vs-ic.folder { height: 12px; border-radius: 2px; background: #c09553; position: relative; }
.vs-ic.folder::before { content: ""; position: absolute; left: 0; top: -2px; width: 7px; height: 3px; border-radius: 2px 2px 0 0; background: #c09553; }
.vs-ic.folder.open { background: #dcb67a; }
.vs-kids { position: relative; }
.vs-kids::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(15px + var(--d) * 14px); width: 1px; background: #2a3442; }
.vs-tabs { display: flex; overflow-x: auto; background: var(--bg-2); border-bottom: 1px solid var(--line); min-height: 35px; scrollbar-width: none; }
.vs-tabs::-webkit-scrollbar { display: none; }
.vs-tab { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 12px; height: 35px; font-size: 12.5px; color: var(--muted); border-right: 1px solid var(--line); cursor: pointer; white-space: nowrap; }
.vs-tab.on { background: var(--bg); color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }
.vs-tab-x { width: 18px; height: 18px; border: 0; border-radius: 4px; background: transparent; color: var(--dim); font-size: 15px; line-height: 1; opacity: .6; }
.vs-tab:hover .vs-tab-x, .vs-tab.on .vs-tab-x { opacity: 1; }
.vs-tab-x:hover { background: var(--panel-2); color: var(--text); }
.vs-menu { position: fixed; z-index: 70; min-width: 180px; padding: 4px; border-radius: 8px; background: #1b2230; border: 1px solid var(--line-2); box-shadow: 0 16px 40px -8px rgba(0,0,0,.8); display: flex; flex-direction: column; }
.vs-menu button { text-align: left; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; font-size: 13px; color: var(--text); }
.vs-menu button:hover { background: #26324a; }

/* ── phone bottom bar, usage panel, celebration ── */
.bottom-nav { display: none; }
body:not(.has-app) #buildApkBtn { display: none; }
@media (max-width: 960px) {
  .ws { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: calc(100% - 56px); }
  .ws > .chat, .ws > .main { grid-row: 1; grid-column: 1; min-height: 0; }
  .ws[data-m="chat"] .main, .ws[data-m="app"] .chat, .ws[data-m="code"] .chat { display: none; }
  .ws[data-m="app"] .main, .ws[data-m="code"] .main { display: flex; }
  .ws .main > .tabs { display: none; }
  .bottom-nav { display: grid; grid-template-columns: repeat(3, 1fr); grid-row: 2; border-top: 1px solid var(--line); background: #090c11; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
  .bn { position: relative; height: 54px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
  .bn span { font-size: 20px; line-height: 1; filter: grayscale(.4); }
  .bn.on { background: var(--panel-2); color: var(--text); }
  .bn.on span { filter: none; }
  .bn-dot { position: absolute; top: 8px; right: calc(50% - 22px); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
  .stage-tools { top: 10px; }
  .chat-log { padding: 14px 12px 8px; }
  .msg.user { font-size: 15px; }
  .msg.ai, .result { font-size: 15px; }
  .chat-box textarea { font-size: 16px; }
  .step { font-size: 14.5px; }
  .chip { height: 38px; font-size: 13.5px; }
}
.budget b { float: right; color: var(--accent); font-weight: 600; }
.usage-hero { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.usage-hero > div { border-radius: 12px; background: var(--bg); border: 1px solid var(--line); padding: 12px; text-align: center; }
.usage-hero b { display: block; font: 700 20px/1.2 var(--display); }
.usage-hero span { font-size: 11.5px; color: var(--muted); }
.usage-steps { display: grid; gap: 8px; }
.usage-steps > div { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 13px; }
.usage-steps i { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--ok)); }
.usage-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-height: 260px; overflow-y: auto; font-size: 12.5px; }
.ut-head, .ut-row { display: grid; grid-template-columns: 56px 1fr 64px 64px 78px; gap: 8px; padding: 7px 10px; }
.ut-head { background: var(--bg-2); color: var(--dim); font-weight: 700; position: sticky; top: 0; }
.ut-row { border-top: 1px solid var(--line); }
.ut-row span:nth-child(n+3) { text-align: right; font-family: var(--mono); font-size: 11.5px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 1.8s cubic-bezier(.2,.6,.4,1) forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .6; } }

/* Wide children (the drawn plan's screen strip, code) must scroll inside their column, never widen the page. */
.ws { grid-template-columns: minmax(340px, 410px) minmax(0, 1fr); }
.chat, .chat-log, .main, .msg, .plan-card, .activity, .chat-input { min-width: 0; }
.plan-view, .ps-strip { max-width: 100%; }
@media (max-width: 960px) {
  .ws { grid-template-columns: minmax(0, 1fr); }
  html, body { overflow-x: hidden; }
}
@media (max-width: 960px) {
  /* The preview stays laid out at real phone size while another section is shown: hiding it with
     display:none gave the app a 0px-wide window, and every live check measured that instead. */
  .ws[data-m="chat"] .main { display: flex; position: fixed; left: -200vw; top: 56px; width: 100vw; height: calc(100% - 56px - 66px); visibility: hidden; pointer-events: none; }
}

.paused { border: 1px solid rgba(139,123,255,.45); background: rgba(139,123,255,.08); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.paused details summary { cursor: pointer; font-size: 12px; color: var(--dim); }
.paused pre { white-space: pre-wrap; font: 11px/1.4 var(--mono); color: var(--muted); max-height: 160px; overflow: auto; margin: 6px 0 0; }

/* ── resizable panels + explorer drawer ── */
.ws { position: relative; grid-template-columns: var(--chat-w, 410px) minmax(0, 1fr); }
.ws-resize { position: absolute; top: 0; bottom: 0; left: calc(var(--chat-w, 410px) - 3px); width: 6px; cursor: col-resize; z-index: 6; }
.ws-resize:hover, .ws-resize.drag, .vs-resize:hover, .vs-resize.drag { background: rgba(200,240,49,.35); }
.code { grid-template-columns: var(--exp-w, 250px) minmax(0, 1fr); }
.explorer { position: relative; display: flex; flex-direction: column; }
#tree { flex: 1; overflow-y: auto; }
.vs-resize { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; z-index: 3; }
.vs-search { padding: 0 10px 8px; }
.vs-search input { width: 100%; height: 30px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg); padding: 0 10px; font-size: 12.5px; outline: none; }
.vs-search input:focus { border-color: rgba(200,240,49,.5); }
.files-toggle { display: none; height: 28px; padding: 0 10px; font-size: 12px; }
.drawer-bg { display: none; }
@media (max-width: 960px) {
  .ws-resize { display: none; }
  .code { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .files-toggle { display: inline-flex; }
  .explorer { position: fixed; z-index: 45; left: 0; top: 56px; bottom: calc(66px + env(safe-area-inset-bottom)); width: var(--drawer-w, min(84vw, 340px)); max-width: calc(100vw - 30px);
    border-right: 1px solid var(--line-2); box-shadow: 20px 0 60px -10px rgba(0,0,0,.8); transform: translateX(-102%); transition: transform .22s cubic-bezier(.2,.8,.2,1); }
  .code.drawer-open .explorer { transform: none; }
  .code.drawer-open .drawer-bg { display: block; position: fixed; inset: 56px 0 66px; z-index: 44; background: rgba(0,0,0,.45); }
  .vs-resize { right: -10px; width: 20px; }
  .vs-resize::after { content: ""; position: absolute; top: 50%; left: 7px; width: 6px; height: 46px; margin-top: -23px; border-radius: 4px; background: #3a4658; }
  .vs-row { height: 34px; font-size: 14px; }
  .vs-search input { height: 38px; font-size: 15px; }
}
@media (max-width: 960px) { .ws { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; } }
#tree { overflow-x: hidden; }

/* ── agent narration ── */
.agent-say { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #c3cddb; }
.agent-say .av { width: 18px; height: 18px; border-radius: 6px; flex: none; margin-top: 2px; background: conic-gradient(from 210deg, #c8f031, #3ddc97, #8b7bff, #c8f031); }
.agent-say .md p { margin: 0; }
.tool-log { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.tl { display: flex; align-items: center; gap: 8px; animation: pop .25s ease; }
.tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.tl:last-child { color: var(--text); }
.ask { border: 1px solid rgba(200,240,49,.45); border-radius: var(--radius); padding: 12px 14px; background: rgba(200,240,49,.06); }

/* the agent's to-do list (update_plan) */
.agent-plan { margin: 8px 0; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; background: rgba(255,255,255,.03); font-size: 13px; }
.agent-plan .ap-head { font-weight: 700; color: #e7edf6; margin-bottom: 6px; }
.agent-plan .ap-item { display: flex; gap: 8px; align-items: flex-start; color: #c3cddb; padding: 2px 0; min-width: 0; overflow-wrap: anywhere; }
.agent-plan .ap-box { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid #5b6678; display: grid; place-items: center; font-size: 11px; line-height: 1; margin-top: 1px; }
.agent-plan .done { color: #8a96a8; text-decoration: line-through; }
.agent-plan .done .ap-box { background: #3ddc97; border-color: #3ddc97; color: #08121f; }
.agent-plan .in_progress .ap-box { border-color: #c8f031; color: #c8f031; }
.agent-plan .in_progress { color: #fff; font-weight: 600; }
.agent-plan .dropped { color: #6b7686; }

/* extra tools (MCP) */
.mcp-list { display: grid; gap: 8px; }
.mcp-row { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; min-width: 0; }
.mcp-row .hint { overflow-wrap: anywhere; }
.mcp-row .acts { display: flex; gap: 6px; justify-content: flex-end; }

/* open on my phone */
.phone-btn { position: relative; gap: 6px; }
.live-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 3px rgba(61,220,151,.25); }
.phone-wrap { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.phone-qr { background: #fff; border-radius: 14px; padding: 6px; line-height: 0; flex: none; }
.phone-qr svg { width: 200px; height: 200px; max-width: 60vw; max-height: 60vw; }
.phone-steps { flex: 1 1 200px; min-width: 0; font-size: 14px; line-height: 1.7; }
.phone-status { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.phone-status .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #5b6678; }
.phone-status .dot.on { background: #3ddc97; }
.phone-status .dot.wait { background: #c8f031; animation: pulse 1.2s infinite; }
.phone-errs { display: grid; gap: 4px; }
@keyframes pulse { 50% { opacity: .35; } }

/* backend + keys */
.be { display: grid; gap: 12px; min-width: 0; }
.be-hero { display: flex; gap: 12px; align-items: flex-start; }
.be-ic { font-size: 30px; line-height: 1; }
.be-hero p { margin: 4px 0 0; color: #aab6c8; }
.be-list { display: grid; gap: 6px; }
.be-row { display: grid; text-align: left; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); color: inherit; cursor: pointer; }
.be-row:hover { border-color: #c8f031; }
.be-row small, .be-ok small { color: #8a96a8; overflow-wrap: anywhere; }
.be-ok { display: flex; gap: 10px; align-items: center; }
.be-ok .dot { width: 10px; height: 10px; border-radius: 50%; background: #3ddc97; flex: none; }
.be-more summary { cursor: pointer; font-weight: 600; }
.be-log { max-height: 220px; overflow: auto; font-size: 12px; background: #070a10; border-radius: 10px; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.be-tables { white-space: pre-wrap; font-family: ui-monospace, monospace; font-size: 12px; overflow-wrap: anywhere; }
.be-h { margin: 4px 0 0; }
.be-sep { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 4px 0; width: 100%; }
.be-steps { margin: 6px 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; line-height: 1.5; }
.be-steps a { overflow-wrap: anywhere; }
.sec-row { border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; min-width: 0; }
.sec-row summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.sec-row summary small { flex-basis: 100%; color: #8a96a8; }
.sec-row input { min-width: 0; flex: 1; }
.pill.on { background: rgba(61,220,151,.15); color: #3ddc97; }
.pill.warn { background: rgba(255,184,77,.15); color: #ffb84d; }
.ok-text { color: #3ddc97; font-size: 13px; }
.ok-text:empty, .err-text:empty { display: none; }
.secrets-card { display: grid; gap: 10px; border: 1px solid rgba(255,184,77,.35); }
.live-dot.warn { background: #ffb84d; box-shadow: 0 0 0 3px rgba(255,184,77,.25); }
#backendBtn { position: relative; gap: 6px; }

.msg-detail { margin-top: 6px; font-size: 12px; opacity: .8; }
.msg-detail summary { cursor: pointer; }
.msg-detail pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; font-size: 11.5px; }

.agent-notes { font-size: 13px; color: #c3cddb; margin: 6px 0; }
.agent-notes summary { display: flex; gap: 8px; align-items: center; cursor: pointer; list-style: none; }
.agent-notes summary::-webkit-details-marker { display: none; }
.agent-notes summary .av { width: 16px; height: 16px; border-radius: 6px; flex: none; background: conic-gradient(from 210deg, #c8f031, #3ddc97, #8b7bff, #c8f031); }
.agent-notes .an-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.agent-notes .an-all { display: grid; gap: 6px; margin-top: 8px; padding-left: 24px; }
.repair .msg-detail { display: block; }

/* ── Save online (backend) panel, 2026-10-08 redesign: one guided flow, phone-first ── */
.be-modal { width: min(600px, 100%); }
.be { gap: 16px; }
.be .hint { color: var(--muted); font-size: 13px; margin: 0; }
.be-h { font-family: var(--display); font-size: 16px; margin: 4px 0 -4px; }
.be-stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.be-stepper li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--dim); font-size: 12.5px; min-width: 0; }
.be-stepper li b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.be-stepper li span { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font-weight: 700; font-size: 12px; }
.be-stepper li.now { color: var(--text); border-color: rgba(200,240,49,.45); background: var(--accent-soft); }
.be-stepper li.now span { background: var(--accent); color: var(--accent-ink); }
.be-stepper li.done { color: var(--ok); }
.be-stepper li.done span { background: rgba(61,220,151,.18); color: var(--ok); }
.be-hero { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 18px 12px 6px; }
.be-hero .be-ic { font-size: 46px; line-height: 1; filter: drop-shadow(0 8px 24px rgba(139,123,255,.35)); }
.be-hero h4 { margin: 4px 0 0; font-family: var(--display); font-size: 20px; }
.be-hero p { margin: 0; color: var(--muted); max-width: 440px; line-height: 1.55; }
.be-benefits { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.be-benefits span { padding: 6px 12px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.btn.be-big { height: 50px; width: 100%; justify-content: center; font-size: 15.5px; font-weight: 700; border-radius: 14px; }
.btn.be-small { height: 32px; font-size: 12.5px; }
.be-row-inline { display: flex; gap: 8px; }
.be-row-inline input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: inherit; }
.be-more summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 0; }
.be-more[open] summary { margin-bottom: 8px; }
.be-projs { display: grid; gap: 8px; }
.be-proj { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--bg-2); color: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.be-proj:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.be-proj:disabled { cursor: progress; opacity: .95; }
.be-proj-ic { font-size: 26px; }
.be-proj-main { display: grid; min-width: 0; }
.be-proj-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-proj-main small { color: var(--muted); }
.be-proj .pill { white-space: nowrap; }
.be-prog { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); }
.be-card { border: 1px dashed var(--line-2); border-radius: 16px; padding: 12px 14px; display: grid; gap: 12px; }
.be-card summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; list-style: none; }
.be-card summary::-webkit-details-marker { display: none; }
.be-plus { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.be-2col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.be-empty { padding: 14px; border-radius: 12px; background: var(--bg-2); color: var(--muted); text-align: center; font-size: 13.5px; }
.be-loading { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; padding: 8px 0; }
.be-status { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(61,220,151,.12), rgba(61,220,151,.03)); border: 1px solid rgba(61,220,151,.3); }
.be-status small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-ok-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ok); color: #06140d; font-weight: 800; font-size: 17px; }
.be-data { display: grid; gap: 8px; }
.be-table-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg-2); }
.be-table { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; background: none; border: 0; color: inherit; text-align: left; cursor: pointer; }
.be-table:hover { background: rgba(255,255,255,.02); }
.be-t-ic { font-size: 20px; }
.be-t-main { display: grid; min-width: 0; }
.be-t-main small { color: var(--muted); }
.be-rows { border-top: 1px solid var(--line); padding: 10px; display: grid; gap: 6px; }
.be-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.be-grid { border-collapse: collapse; width: 100%; font-size: 13px; }
.be-grid th { text-align: left; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.be-grid td { padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,.04); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.be-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.be-check { list-style: none; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--bg-2); display: grid; gap: 6px; font-size: 13.5px; }
.be-check li { display: flex; gap: 8px; align-items: flex-start; }
.be-check li span { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(61,220,151,.18); color: var(--ok); }
.be-check li.fail span { background: rgba(255,93,108,.18); color: var(--err); }
.be-keys { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.be .spinner, .btn .spinner { width: 14px; height: 14px; border-width: 2px; flex: none; }

/* Phones: every dialog becomes a bottom sheet with thumb-size controls. */
@media (max-width: 600px) {
  .modal-bg { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet .22s cubic-bezier(.16,1,.3,1); }
  .modal .mh { padding: 18px 16px 4px; position: sticky; top: 0; background: var(--panel); z-index: 1; }
  .modal .mh::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); transform: translateX(-50%); }
  .modal .mb { padding: 8px 16px 20px; }
  .be-stepper li { justify-content: center; padding: 8px 6px; }
  .be-stepper li b { font-size: 11.5px; }
  .be-2col { grid-template-columns: 1fr; }
  .be-proj .pill { grid-column: 2 / -1; justify-self: start; }
  .be-actions .btn { flex: 1; justify-content: center; }
  .field input, .field select, .field textarea, .be-row-inline input { height: 46px; font-size: 16px; }
}
@keyframes sheet { from { transform: translateY(24px); opacity: 0; } }
.spinner { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; flex: none; }

.errbar .err-more { height: 28px; font-size: 12px; padding: 0 8px; }

/* "completely free" reassurance */
.free-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 18px auto 0; max-width: 720px; }
.free-strip span { padding: 7px 13px; border-radius: 99px; background: rgba(61,220,151,.1); border: 1px solid rgba(61,220,151,.3); color: #c9f5e2; font-size: 13px; white-space: nowrap; }
.free-strip b { color: #3ddc97; }
.free-note { text-align: center; color: var(--muted); font-size: 13px; margin: 10px auto 0; max-width: 560px; padding: 0 8px; }
.free-box { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(61,220,151,.14), rgba(200,240,49,.06)); border: 1px solid rgba(61,220,151,.35); font-size: 13.5px; }
.free-box b { color: #3ddc97; font-size: 14.5px; }
.free-box span { color: #c9d6e6; }
@media (max-width: 600px) { .free-strip span { font-size: 12.5px; padding: 6px 11px; } }

/* No apps yet: one full row — a wide "first app" card + the two open cards, no empty gap */
.cards.empty { display: flex; flex-wrap: wrap; }
.cards.empty > .card { flex: 1 1 240px; }
.cards.empty > .start-card { flex: 2.2 1 440px; }
.start-card { flex-direction: row; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid rgba(200,240,49,.35);
  background: radial-gradient(120% 140% at 0% 0%, rgba(200,240,49,.14), transparent 55%), radial-gradient(120% 140% at 100% 100%, rgba(139,123,255,.16), transparent 55%), var(--panel); }
.start-card:hover { border-color: var(--accent); }
.start-card .sc-ic { font-size: 40px; line-height: 1; flex: none; filter: drop-shadow(0 6px 18px rgba(200,240,49,.35)); }
.start-card .sc-main { display: grid; gap: 6px; min-width: 0; }
.start-card .t { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--text); }
.start-card .m { color: var(--muted); font-size: 13.5px; }
.start-card .sc-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.start-card .chip { font-size: 12.5px; }
@media (max-width: 600px) { .start-card { flex-direction: column; text-align: center; align-items: center; } .start-card .sc-ideas { justify-content: center; } }

/* Closed Test Pro partner link (disclosed as Partner everywhere) */
.partner-link { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgba(139,123,255,.08); border: 1px solid rgba(139,123,255,.3); color: #cfd6e4; font-size: 12.5px; line-height: 1.45; text-decoration: none; text-align: left; }
.partner-link:hover { border-color: var(--violet); color: var(--text); }
.partner-link b { color: var(--text); }
.pl-tag { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: rgba(139,123,255,.2); color: #b9b0ff; margin-top: 1px; }
.play-guide .partner-link { margin-top: 6px; }

/* the real AppMint icon */
.brand .mark-img { width: 32px; height: 32px; border-radius: 9px; flex: none; display: block; }
/* Closed Test Pro partner card — same "PARTNER AD" chip as the phone app */
.ctp { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(59,130,246,.07); border: 1px solid rgba(59,130,246,.28); text-align: left; }
.ctp img { width: 40px; height: 40px; border-radius: 50%; flex: none; }
.ctp-main { display: grid; gap: 3px; min-width: 0; font-size: 12.5px; line-height: 1.45; color: #c3cddb; }
.ctp-main b { color: var(--text); font-size: 13px; }
.ctp-chip { justify-self: start; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 6px; background: #3D2E0A; color: #FDE68A; }
.ctp-links a { color: #7fb4ff; text-decoration: none; font-weight: 600; }
.ctp-links a:hover { text-decoration: underline; }

/* AppMint for Android banner (bottom of the studio home) */
.app-banner { display: flex; align-items: center; gap: 18px; max-width: 1080px; margin: 34px auto 48px; padding: 20px 22px; border-radius: 22px;
  background: radial-gradient(120% 160% at 0% 0%, rgba(61,220,151,.16), transparent 55%), radial-gradient(120% 160% at 100% 100%, rgba(139,123,255,.14), transparent 55%), var(--panel);
  border: 1px solid rgba(61,220,151,.3); }
.app-banner img { width: 72px; height: 72px; border-radius: 18px; flex: none; background: #e8f7ef; }
.app-banner .ab-main { display: grid; gap: 4px; flex: 1; min-width: 0; }
.app-banner .ab-main b { font-family: var(--display); font-size: 19px; }
.app-banner .ab-main span { color: var(--muted); font-size: 14px; }
.app-banner .ab-play { display: inline-flex; align-items: center; gap: 10px; flex: none; padding: 9px 16px 9px 12px; border-radius: 12px; background: #000; border: 1px solid #5f6368; color: #fff; text-decoration: none; }
.app-banner .ab-play:hover { border-color: #fff; }
.app-banner .ab-play span { display: grid; line-height: 1.1; font-size: 17px; font-weight: 600; }
.app-banner .ab-play small { font-size: 9.5px; letter-spacing: .06em; font-weight: 500; }
@media (max-width: 720px) {
  .app-banner { flex-direction: column; text-align: center; margin: 24px 16px 40px; }
  .app-banner .ab-play { align-self: center; }
}

/* SEO content (visible, plain words) */
.h1-kicker { display: block; font-size: 15px; font-family: var(--sans); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.seo-make, .seo-faq { max-width: 1080px; margin: 40px auto 0; padding: 0 16px; }
.seo-make h2, .seo-faq h2 { font-family: var(--display); font-size: 24px; margin: 0 0 16px; }
.make-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.make-grid div { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.make-grid b { font-size: 15px; }
.make-grid span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.seo-faq details { border-bottom: 1px solid var(--line); padding: 14px 4px; }
.seo-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.seo-faq summary::after { content: "+"; color: var(--accent); font-weight: 700; flex: none; }
.seo-faq details[open] summary::after { content: "–"; }
.seo-faq summary::-webkit-details-marker { display: none; }
.seo-faq p { color: var(--muted); margin: 10px 0 0; line-height: 1.6; font-size: 14px; }

#aiModelTyped { margin-top: 8px; }

.pics-note { margin-top: 8px; font-size: 12.5px; color: #c9f5e2; background: rgba(61,220,151,.08); border: 1px solid rgba(61,220,151,.25); border-radius: 10px; padding: 8px 10px; }
.pics-note:empty { display: none; }
.pics-note.no { color: #ffd9a8; background: rgba(255,184,77,.08); border-color: rgba(255,184,77,.3); }

/* Connect your AI — wide two-column dialog (steps left, reassurance right); one column on phones */
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.modal.ai-modal { width: min(940px, 100%); }
.ai-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ai-main, .ai-side { display: grid; gap: 14px; min-width: 0; }
.ai-side { padding: 14px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); }
.ai-step { display: grid; gap: 8px; }
.ai-step-h { display: flex; align-items: center; gap: 8px; }
.ai-n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 12px; flex: none; }
.ai-provs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ai-prov { min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font: 600 13px/1.25 var(--sans); text-align: left; cursor: pointer; }
.ai-prov:hover { border-color: #3a4658; }
.ai-prov[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ai-step input, .ai-step select { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: inherit; outline: none; }
.ai-step input:focus, .ai-step select:focus { border-color: rgba(200,240,49,.55); }
.ai-row { display: flex; gap: 8px; }
.ai-row select { flex: 1; min-width: 0; }
.ai-tools { justify-content: center; }
@media (max-width: 760px) {
  .ai-grid { grid-template-columns: 1fr; }
  .ai-side { padding: 0; background: none; border: 0; }
  .ai-provs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.ai-step .linkish { justify-self: start; background: none; border: 0; padding: 2px 0; color: var(--muted); font: 600 12.5px/1.3 var(--sans); text-decoration: underline; cursor: pointer; }
.ai-step .linkish:hover { color: var(--text); }
.ai-step input[hidden] { display: none; }

/* Google's sticky anchor ad gets its own strip instead of covering the chat box / phone tabs
   (js/ad-space.js measures it; 0 when no anchor ad is showing). */
body { box-sizing: border-box; padding-top: var(--ad-top, 0px); padding-bottom: var(--ad-bottom, 0px); }
.toast { bottom: calc(20px + var(--ad-bottom, 0px)); }

/* ── Visual edit (tap anything in the app) ── */
.edit-btn.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.pick-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
  border-radius: 99px; background: rgba(139,123,255,.16); border: 1px solid rgba(139,123,255,.55); color: #e3deff; font-size: 13px; font-weight: 600; white-space: nowrap; backdrop-filter: blur(8px); }
.pick-hint .btn { height: 28px; padding: 0 12px; border-radius: 99px; }
.pick-panel { position: absolute; right: 16px; bottom: 16px; z-index: 6; width: min(380px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 10px; padding: 14px;
  border-radius: var(--radius); background: var(--panel); border: 1px solid rgba(139,123,255,.55); box-shadow: 0 18px 50px -12px rgba(0,0,0,.85); }
.pp-head { display: flex; align-items: center; gap: 8px; }
.pp-head b { flex: 1; min-width: 0; overflow-wrap: anywhere; font-family: var(--display); }
.pp-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-row input:not([type=color]) { flex: 1; min-width: 0; height: 36px; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 10px; }
.pp-row.colours label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.pp-row input[type=color] { width: 36px; height: 30px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); }
.pp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-ask { display: flex; flex-direction: column; gap: 8px; }
.pp-ask textarea { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.pp-ask .btn { align-self: flex-end; }
@media (max-width: 960px) { .pick-panel { left: 12px; right: 12px; bottom: 12px; width: auto; max-height: 60%; overflow-y: auto; } .pick-hint { font-size: 12px; } }

/* ── Visual edit v2: inspector, selection, change list, drawing, colours ── */
.pick-panel { width: min(420px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; overscroll-behavior: contain; }
.pick-hint { background: rgba(28,24,52,.94); max-width: calc(100% - 24px); }
.pick-hint > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pick-hint .btn { flex: none; color: #e3deff; }
.pp-selrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 12px; min-width: 0; }
.pp-crumbs .crumb { border: 0; background: transparent; color: var(--muted); padding: 2px 4px; border-radius: 6px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-crumbs .crumb:not(.now):hover { color: var(--text); background: var(--panel-2); }
.pp-crumbs .crumb:not(:last-child)::after { content: "\203A"; margin-left: 6px; color: var(--dim); }
.pp-crumbs .crumb.now { color: #cfc8ff; font-weight: 700; }
.pp-nav { display: inline-flex; gap: 4px; }
.pp-mini { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 99px; }
.pp-mini.on, .pp-toggle.on { background: var(--violet); border-color: var(--violet); color: #fff; }
.pp-row.end { justify-content: flex-end; }
.pp-style { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 10px; background: rgba(139,123,255,.05); }
.pp-style > summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.pp-style > summary small { font-weight: 500; color: var(--muted); }
.pp-style[open] > summary { margin-bottom: 8px; }
.pp-style > .pp-row, .pp-style > .pp-shared, .pp-style > .hint { margin-top: 8px; }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.pp-field { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.pp-field select { height: 32px; min-width: 0; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px; padding: 0 6px; font-size: 13px; color: var(--text); }
.pp-field.colour { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 6px; }
.pp-field.colour > span { flex-basis: 100%; }
.pp-field input[type=color] { width: 44px; height: 30px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); }
.pp-field input[type=range] { width: 100%; accent-color: var(--violet); }
.pp-seg button { height: 26px; padding: 0 10px; font-size: 14px; }
.pp-toggles { display: flex; gap: 6px; }
.pp-toggle { height: 30px; min-width: 40px; padding: 0 10px; font-weight: 700; }
.pp-toggle:first-child { font-style: italic; font-family: Georgia, serif; }
.pp-shared { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(255,181,71,.08); border: 1px solid rgba(255,181,71,.35); font-size: 12.5px; color: #ffd9a0; }
.pp-shared .check { margin-top: 2px; color: var(--text); }
.pp-askbox { position: relative; }
.pp-askbox textarea { padding-right: 40px; }
.pp-askbox .mic-btn { position: absolute; right: 6px; top: 6px; }
.pp-ask .pp-row { flex-wrap: wrap; }
.mic-btn.on { background: var(--err); border-color: var(--err); color: #fff; animation: micpulse 1.2s ease infinite; }
@keyframes micpulse { 50% { box-shadow: 0 0 0 6px rgba(255,93,108,.25); } }
.edit-tray { position: absolute; left: 16px; top: 60px; z-index: 6; width: min(360px, calc(100% - 32px)); padding: 8px; border-radius: 14px; background: var(--panel); border: 1px solid rgba(200,240,49,.5); box-shadow: 0 18px 50px -12px rgba(0,0,0,.85); display: flex; flex-direction: column; gap: 6px; }
.et-head { display: flex; align-items: center; gap: 8px; }
.et-count { flex: 1; text-align: left; border: 0; background: transparent; font-weight: 700; font-size: 13px; color: var(--text); padding: 4px 6px; }
.et-head .btn { height: 32px; }
.et-list { margin: 0; padding: 0 0 0 22px; max-height: 180px; overflow-y: auto; font-size: 12.5px; color: var(--muted); }
.et-list li { padding: 2px 0; }
.et-list li > * { vertical-align: middle; }
.et-list li .btn { width: 22px; height: 22px; margin-left: 4px; }
.stage-fab { display: none; }
.draw-bg { position: fixed; inset: 0; z-index: 46; background: rgba(3,5,8,.82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 12px; }
.draw-box { width: min(980px, 100%); height: min(calc(100dvh - 24px), 940px); display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: 0 40px 120px -20px rgba(0,0,0,.9); }
.draw-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.draw-head b { font-family: var(--display); font-size: 16px; }
.draw-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.draw-tools, .draw-cols, .draw-acts { display: flex; gap: 4px; align-items: center; }
.draw-tool { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 50px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 16px; line-height: 1; gap: 2px; }
.draw-tool small { font-size: 10px; color: var(--muted); }
.draw-tool.on { border-color: var(--violet); background: rgba(139,123,255,.2); }
.draw-col { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); }
.draw-col.on { outline: 2px solid var(--accent); outline-offset: 2px; }
.draw-acts .btn { height: 34px; }
.draw-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: repeating-conic-gradient(#11161e 0 25%, #0c1016 0 50%) 0 0 / 20px 20px; border-radius: 12px; }
.draw-canvas { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; border-radius: 8px; box-shadow: 0 10px 40px -10px #000; background: #fff; }
.draw-words { position: absolute; z-index: 2; width: 200px; height: 34px; border-radius: 8px; border: 2px solid var(--violet); background: #fff; color: #111; padding: 0 8px; transform: translateY(-50%); }
.draw-foot { display: flex; gap: 10px; align-items: flex-end; }
.draw-ask { position: relative; flex: 1; }
.draw-wish { width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 40px 8px 10px; resize: none; }
.draw-ask .mic-btn { position: absolute; right: 6px; top: 6px; }
.draw-btns { display: flex; gap: 8px; }
.cs-list { display: flex; flex-direction: column; gap: 6px; }
.cs-row { border: 1px solid var(--line-2); border-radius: 12px; padding: 8px 10px; }
.cs-row > summary { display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.cs-row > summary b { text-transform: capitalize; }
.cs-row[open] > summary { margin-bottom: 8px; }
.cs-dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); flex: none; vertical-align: middle; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(30px, 1fr)); gap: 6px; margin-bottom: 8px; }
.cs-sw { height: 30px; border-radius: 8px; border: 2px solid transparent; }
.cs-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--violet); }
.cs-target { text-transform: capitalize; }
.cs-hex { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 12px; padding: 6px 10px; }
.cs-hex input[type=color] { width: 40px; height: 30px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); }
.cs-h { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
.chat-box .mic-btn { flex: none; }
@media (max-width: 960px) {
  .pick-panel { left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; border-radius: 18px 18px 0 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
  .pp-field select { height: 38px; font-size: 15px; }
  .pp-ask .pp-row .btn { flex: 1; }
  .stage-fab { display: flex; position: absolute; right: 12px; bottom: 12px; z-index: 5; gap: 8px; }
  .stage-fab .btn { height: 40px; border-radius: 99px; background: var(--panel); box-shadow: 0 8px 24px -8px #000; }
  .stage-fab .btn.on { background: var(--violet); border-color: var(--violet); color: #fff; }
  .edit-tray { left: 12px; right: 12px; width: auto; top: 56px; }
  .pick-hint { max-width: calc(100% - 24px); }
  .draw-bg { padding: 0; }
  .draw-box { height: 100dvh; border-radius: 0; padding: 10px; }
  .draw-tool { min-width: 44px; }
  .draw-foot { flex-direction: column; align-items: stretch; }
  .draw-btns .btn { flex: 1; height: 42px; }
}

/* ── Plan first ── */
.plan-card.change-plan { border-color: rgba(139,123,255,.5); background: linear-gradient(180deg, rgba(139,123,255,.08), transparent 70%), var(--panel); }
.plan-card.change-plan .body { max-height: 420px; }
details.plan-card > summary { cursor: pointer; list-style: none; }

/* ── Free AI keys ── */
.free-keys { border: 1px solid rgba(61,220,151,.4); background: linear-gradient(180deg, rgba(61,220,151,.07), transparent 80%); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.free-keys > summary { cursor: pointer; font-weight: 700; color: var(--ok); }
.fk-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 6px; }
.fk-card { border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.fk-card.on { border-color: var(--ok); }
.fk-head { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; background: none; border: 0; }
.fk-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fk-why { color: var(--muted); font-size: 12.5px; }
.fk-body { padding: 0 12px 12px; }
.fk-body .steps-list { margin: 4px 0 10px; padding-left: 20px; }
.fk-open { text-decoration: none; }
.free-ok { color: var(--ok); font-size: 12.5px; margin-top: 6px; }
.free-note .linkish { color: var(--accent); font-weight: 600; }

/* ── Ready-made app templates ── */
.tpl-section .lead { color: var(--muted); margin: -6px 0 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tpl-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.tpl-card:hover, .tpl-card:focus-visible { border-color: #3a4658; transform: translateY(-2px); }
.tpl-art { height: 92px; border-radius: 11px; display: grid; place-items: center; font-size: 44px; }
.tpl-card b { font-size: 15px; }
.tpl-card span { color: var(--muted); font-size: 12.5px; }
.tpl-card.busy { opacity: .6; pointer-events: none; }

/* ── Dashboard ── */
.dash-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.dash-bar input[type=search] { flex: 1 1 200px; min-width: 0; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); }
.dash-bar select { height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 10px; }
.backup-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 13px; }
.backup-note span { flex: 1 1 260px; }
.backup-note.warn { border-color: rgba(255,181,71,.5); background: rgba(255,181,71,.07); color: #ffe2b0; }
.backup-note .btn { height: 30px; }
.pcard { position: relative; display: flex; flex-direction: column; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; min-width: 0; }
.pcard:hover, .pcard:focus-visible { border-color: #3a4658; transform: translateY(-2px); }
.pc-shot { position: relative; height: 178px; overflow: hidden; background: radial-gradient(ellipse at 50% 120%, #1a2332 0%, var(--bg-2) 70%); display: flex; justify-content: center; }
.pc-phone { margin-top: 16px; width: 124px; height: 230px; border-radius: 18px; border: 3px solid #2c3646; background: #fff; overflow: hidden; box-shadow: 0 14px 34px -14px rgba(0,0,0,.9); transition: transform .25s; }
.pcard:hover .pc-phone { transform: translateY(-6px); }
.pc-phone img { display: block; width: 100%; height: auto; }
.pc-letter { height: 100%; display: grid; place-items: center; font: 700 48px var(--display); color: #fff; }
.pc-star { position: absolute; top: 8px; left: 8px; width: 30px; height: 30px; border-radius: 99px; border: 0; background: rgba(7,9,13,.55); color: var(--muted); font-size: 16px; opacity: 0; transition: opacity .15s; }
.pc-star.on { color: #ffd23f; opacity: 1; }
/* Always visible (2026-10-11, owner: people could not find edit/delete): it used to appear only on hover. */
.pc-more { position: absolute; top: 8px; right: 8px; background: rgba(7,9,13,.55); color: #fff; opacity: 1; }
.pcard:hover .pc-star, .pcard:focus-within .pc-star { opacity: 1; }
@media (hover: none) { .pc-star, .pc-more { opacity: 1; } }
.pc-info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.pc-info .t { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.pc-info .m { color: var(--dim); font-size: 12px; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.pc-badges:empty { display: none; }
.pcard-empty { grid-column: 1 / -1; color: var(--muted); padding: 18px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ── "Your database is asleep" ── */
.dbwake { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 5; width: min(620px, calc(100% - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 12px; border-radius: 12px; background: #1f1a0e; border: 1px solid rgba(255,181,71,.5); color: #ffe2b0; font-size: 13px; box-shadow: 0 12px 40px -10px rgba(0,0,0,.8); }
.dbwake span { flex: 1 1 260px; min-width: 0; }
.dbwake .btn { height: 30px; }

/* Toasts stack (app.js toast): one column above the bottom edge, newest last. A toast is words only:
   taps go through it to the button underneath (it covered Connect right after "address removed", TC-401). */
.toast-box { position: fixed; left: 50%; bottom: calc(20px + var(--ad-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast-box .toast { position: static; transform: none; pointer-events: none; max-width: 100%; text-align: center; }

/* ── "Put it online" sheet (js/publish-ui.js) ── */
.pub { display: flex; flex-direction: column; gap: 14px; }
.pub-lead { margin: 0; color: #c9d6e6; font-size: 14.5px; }
.pub-slug { display: flex; align-items: center; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); overflow: hidden; }
.pub-slug:focus-within { border-color: rgba(200,240,49,.55); box-shadow: 0 0 0 4px rgba(200,240,49,.08); }
.pub-slug .pre, .pub-slug .suf { color: var(--dim); font-size: 13px; padding: 0 2px 0 12px; white-space: nowrap; }
.pub-slug .suf { padding: 0 12px 0 0; }
.field .pub-slug input { flex: 1; min-width: 60px; height: 100%; border: 0; border-radius: 0; background: transparent; padding: 0 2px; box-shadow: none; font-weight: 600; }
.pub-check { font-size: 13px; margin-top: 6px; overflow-wrap: anywhere; }
.pub-check.good { color: var(--ok); }
.pub-check.good b { color: var(--text); }
.pub-check.bad { color: var(--warn); }
.pub-prog { display: grid; gap: 6px; }
.pub-err { display: grid; gap: 8px; justify-items: start; }
.pub-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pub-grow { flex: 1; }
.pub-live { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(61,220,151,.14), rgba(200,240,49,.06)); border: 1px solid rgba(61,220,151,.35); }
.pub-live.small { padding: 12px; }
.pub-live-title { font-weight: 700; font-size: 15px; color: var(--ok); }
.pub-url { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; color: var(--text); }
.pub-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pub-actions a.btn { text-decoration: none; }
.pub-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.pub-row .hint { font-size: 12.5px; color: var(--muted); }
.pub-more summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.pub-more[open] { display: grid; gap: 10px; }
.pub-more p { margin: 6px 0 0; }
.note.warn { border-color: rgba(255,181,71,.4); color: #ffd79a; }
.note.bad { border-color: rgba(255,93,108,.4); color: #ffb3bb; }
.btn.pub-danger { color: var(--err); }
.pub-danger-solid { background: rgba(255,93,108,.16); border-color: rgba(255,93,108,.5); color: #ffb3bb; }
.pub-confirm { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,93,108,.35); background: rgba(255,93,108,.06); display: grid; gap: 8px; }
.pub-confirm p { margin: 0; }
.pub-own { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--bg-2); }
.pub-own h4 { margin: 0; font-family: var(--display); font-size: 16px; }
.pub-own p { margin: 0; }
.pub-inline { display: flex; gap: 8px; }
.pub-inline input { flex: 1; min-width: 0; }
.pub-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.pub-rec { margin-top: 8px; display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: #070a10; border: 1px solid var(--line); }
.pub-rec-row { display: grid; grid-template-columns: 80px 1fr 28px; align-items: center; gap: 8px; }
.pub-rec-row .k { color: var(--dim); font-size: 12.5px; }
.pub-rec-row code { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; color: var(--accent); }
.pub-rec-row .btn.icon { width: 28px; height: 28px; padding: 0; justify-content: center; }
.pub-rec-hint { grid-column: 2 / 4; color: var(--dim); font-size: 11.5px; margin-top: -4px; }
.pub-plan { font-size: 13px; color: var(--ok); font-weight: 600; }
.pub-ticks { display: grid; gap: 6px; }
.pub-tick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.pub-tick .dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line-2); }
.pub-tick.on { color: var(--text); }
.pub-tick.on .dot { background: rgba(61,220,151,.18); border-color: rgba(61,220,151,.5); color: var(--ok); }
@media (max-width: 520px) {
  .pub-row { flex-direction: column; align-items: stretch; }
  .pub-slug .pre { display: none; }
  .field .pub-slug input { padding-left: 12px; }
}

/* AI settings: AppMint AI (signed in) */
.ai-appmint { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 14px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--accent); background: var(--panel-2, var(--panel)); }
.ai-appmint p { margin: 4px 0; }
.ai-appmint-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Phone width: every workspace button stays on screen (Get app included). */
@media (max-width: 440px) {
  #wsActions { gap: 2px !important; }
  #wsActions .btn { padding-left: 7px; padding-right: 7px; min-width: 0; }
  #wsActions .btn.icon { width: 32px; padding: 0; }
}

/* Phones: a dialog's buttons stay visible — toasts move to the top while a dialog is open. */
@media (max-width: 640px) { body:has(.modal-bg) .toast-box { top: calc(12px + env(safe-area-inset-top)); bottom: auto; } }

/* ── 2026-10-12 layout fixes (owner: "flaws on different screens") ─────────────────────────── */
/* Phone preview: a real status-bar strip holds the camera notch, so the app starts BELOW it — as it
   does on a phone (the shell keeps content out of the status bar). Before, the notch sat on top of
   the app's first line ("Monday, October 1…"). */
.device .statusbar { display: none; }
.device.phone .statusbar { display: flex; position: absolute; top: 0; left: 0; right: 0; height: 40px; align-items: center; justify-content: space-between; padding: 4px 30px 0; background: #000; color: #fff; font: 600 13px/1 system-ui, -apple-system, "Segoe UI", sans-serif; z-index: 2; pointer-events: none; }
.device.phone .statusbar .sb-icons { display: inline-flex; gap: 5px; }
.device.phone .statusbar svg { width: 14px; height: 14px; }
.device.phone .notch { top: 9px; width: 96px; height: 24px; z-index: 3; }
.device.phone iframe { position: absolute; top: 40px; left: 0; height: calc(100% - 40px); }
@media (max-width: 960px) {
  .device.phone .statusbar { display: none; }
  .device.phone iframe { position: static; top: auto; height: 100%; }
}
/* Top bar: occasional tools in one "More" menu (never wraps). */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; position: relative; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary .chev { width: 14px; height: 14px; transition: transform .15s; }
.more-menu[open] > summary .chev { transform: rotate(180deg); }
.more-menu .more-dot { display: none; }
.more-menu:has(#keysDot:not(.hidden)) .more-dot { display: block; }
.more-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); box-shadow: 0 20px 50px -10px rgba(0,0,0,.7); z-index: 20; }
.more-pop .btn { justify-content: flex-start; width: 100%; height: 36px; gap: 10px; position: relative; }
.more-pop .btn svg { width: 16px; height: 16px; flex: none; }
.more-pop .live-dot { top: 50%; right: 10px; transform: translateY(-50%); }
/* "Connect AI" not set up yet is a to-do, not an error: neutral dot, no red glow. */
.ai-chip .dot { background: var(--muted); box-shadow: none; }
/* Composer: Send always sits at the right end of the row. Where the chat column is too narrow for
   the mode switch AND the buttons (most laptops), the switch takes its own full-width line above them
   instead of wrapping Send onto a line of its own or squeezing the labels to "Jus…". */
.chat-box { container-type: inline-size; }
.chat-box .row { flex-wrap: nowrap; min-width: 0; }
.chat-box .row #modeSeg button { white-space: nowrap; }
.chat-box .row #chatSend { flex: none; margin-left: auto; }
@container (max-width: 470px) {
  .chat-box .row { flex-wrap: wrap; row-gap: 8px; }
  .chat-box .row #modeSeg { order: -1; flex: 1 1 100%; display: flex; }
  .chat-box .row #modeSeg button { flex: 1 1 0; padding: 0 6px; }
}

/* ══ Design pass 2026-10-12 ══════════════════════════════════════════════════════════════════════
   Customer feedback: "too complex", "looks made by AI". Rules for every studio screen:
   no glow, no gradient text, lime only on the ONE main button, flat 1px borders, one type scale. */
:root { --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; }
.btn.primary { box-shadow: none; font-weight: 600; }
.btn.primary:hover { background: #d4f550; }
.btn { font-weight: 500; }
.pill.hot { background: #2a1a12; color: #ffb38a; box-shadow: none; border: 1px solid #4a2a1a; }
.ai-chip .dot, .ai-chip.ready .dot, .tree-item .fresh { box-shadow: none; }
.hero h1 .glow { background: none; -webkit-background-clip: border-box; background-clip: border-box; color: var(--accent); }
.hero h1 { font-family: var(--sans); letter-spacing: -.03em; font-weight: 700; }

/* Connect your AI: one short form */
.ai-modal { width: min(560px, calc(100vw - 32px)) !important; max-width: 560px !important; }
.ai-tabs { display: flex; width: 100%; margin-bottom: var(--s4); }
.ai-tabs button { flex: 1; height: 34px; font-size: 13px; }
.ai-pane { display: flex; flex-direction: column; gap: var(--s4); }
.ai-field { display: flex; flex-direction: column; gap: 6px; }
.ai-field > label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ai-field select, .ai-field input { width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg); }
.ai-field .hint { font-size: 12.5px; }
.ai-row { display: flex; gap: var(--s2); }
.ai-row select { flex: 1; min-width: 0; }
.ai-lead { margin: 0; color: var(--muted); }
.ai-lead span { color: var(--text); }
.ai-acts { display: flex; gap: var(--s2); }
.ai-adv { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.ai-adv > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ai-adv[open] > summary { margin-bottom: var(--s3); }
.ai-controls { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s3); }
.free-keys { border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s3) var(--s4); background: transparent; }
.free-keys > summary { cursor: pointer; font-size: 13px; color: var(--text); font-weight: 500; }
.studio-pill { text-decoration: none; background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 99px; }
.studio-pill:hover { border-color: var(--muted); }
@media (max-width: 520px) { .studio-pill { display: none; } }
/* Home hero, design pass: no kicker/eyebrow/pill row; the partner card is its own quiet row. */
.hero .sub { max-width: 52ch; margin-left: auto; margin-right: auto; }
.free-note { color: var(--muted); font-size: 13.5px; }
.partner-row { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.partner-row .ctp { max-width: 560px; margin: 0 auto; }
/* The hidden attribute always wins (flex/inline-flex rules above must not show hidden panes/buttons). */
[hidden] { display: none !important; }
.ai-pane .linkish { align-self: flex-start; background: none; border: 0; padding: 0; height: auto; width: auto; color: var(--muted); font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ai-pane .linkish:hover { color: var(--text); }
/* Top bar links (owner 2026-10-12): Pricing + the AppMint Android app, everywhere except inside a project. */
.top-links { display: flex; gap: 4px; margin-left: 8px; }
.top-links a { color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500; padding: 6px 10px; border-radius: var(--r-sm); }
.top-links a:hover { color: var(--text); background: var(--panel); }
body.in-ws .top-links { display: none; }
@media (max-width: 640px) { .top-links a:last-child { display: none; } }
@media (max-width: 420px) { .top-links { display: none; } }
/* Home, design pass: no drifting colour blobs, no glowing gradient border, no highlighted link. */
.mesh { display: none; }
.composer-big { background: var(--line-2); padding: 1px; border-radius: 16px; box-shadow: none; }
.composer-big .inner { border-radius: 15px; background: var(--panel); }
.composer-big:focus-within { background: rgba(200,240,49,.55); }
.free-note .linkish { color: var(--text); font-weight: 500; background: none; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
/* A project with no app yet: nothing old shows through the phone frame. */
.device.is-empty iframe { visibility: hidden; }
/* Composer, design pass: attach · mic · mode ▾ … Send on one line; no glow; quiet usage line. */
.mode-sel { height: 32px; padding: 0 28px 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b97a8' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; color: var(--text); font-size: 13px; appearance: none; -webkit-appearance: none; cursor: pointer; min-width: 0; }
.chat-box .row { flex-wrap: nowrap !important; }
.chat-box:focus-within { box-shadow: none; border-color: var(--line-2); }
.chat-box { background: var(--panel); }
.budget { border: 0; background: none; padding: 0 2px 8px; color: var(--dim); }
.budget i { display: none; }
.budget b { color: var(--muted); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic, .bn .ic { width: 16px; height: 16px; flex: none; }

/* ── Top bar, reviewer pass 2026-10-12 (wrapping at 1280, cut chips, phones) ── */
.topbar .btn, .ai-chip, .cloud-btn, .cloud-chip, .studio-pill, .top-links a { white-space: nowrap; }
.topbar { min-width: 0; }
.cloud-av { background: var(--panel-2); color: var(--text); font-weight: 700; border: 1px solid var(--line-2); }
.cloud-chip { max-width: 240px; }
.cloud-btn.signed { max-width: 220px; }
#aiChipText { overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
/* Inside a project the bar holds the most: account = avatar only, AI chip = dot + short text. */
@media (max-width: 1600px) { body.in-ws .cloud-btn.signed .cloud-email { display: none; } body.in-ws .cloud-btn.signed { padding: 0 4px; } }
@media (max-width: 1360px) { body.in-ws #aiChipText { max-width: 96px; } body.in-ws .cloud-chip { max-width: 170px; } }
@media (max-width: 1180px) { body.in-ws #aiChipText, body.in-ws .cloud-chip .cc-text { display: none; } body.in-ws .cloud-chip { padding: 0 9px; } }
/* Phones: the studio badge stays (it is the way back to the studio home); undo stays as an icon. */
@media (max-width: 960px) { #undoBtn { display: inline-flex !important; } }
@media (max-width: 520px) {
  .studio-pill { display: inline-flex !important; }
  .brand > span:last-child { display: none; }
  .top-links { display: flex !important; margin-left: 2px; }
  .top-links a:last-child { display: none; }
  .top-links a { padding: 6px 6px; }
  .cloud-btn.signed .cloud-email { display: none; }
  .cloud-btn.signed { padding: 0 4px; }
  #aiChipText { max-width: 92px; }
}
/* Text-link buttons everywhere (they fell back to the browser's grey button in dialogs). */
.linkish { background: none; border: 0; padding: 0; height: auto; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--text); }
.wo-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 7px; }
.wo-now { font-size: 12px; color: var(--muted); }
/* Get app, reviewer pass: name + ID + button above the fold; the rest folded. */
.ga-name { display: flex; flex-direction: column; gap: var(--s2); flex: 1; min-width: 0; }
.ga-more { border-top: 1px solid var(--line); padding-top: var(--s3); }
.ga-more > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.ga-more[open] > summary { margin-bottom: var(--s3); }
.ga-perm { margin: 0; }
.icon-pick canvas { width: 72px; height: 72px; border-radius: 16px; flex: none; }
.btn.accent-line { border-color: rgba(200,240,49,.55); color: var(--accent); background: transparent; font-weight: 600; }
.btn.accent-line:hover { background: rgba(200,240,49,.08); }
.team-another > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.team-another[open] > summary { margin-bottom: var(--s3); }

/* ── Edit mode, reviewer pass 2026-10-12: overlays never sit on the app being edited ── */
.device { transition: width .35s cubic-bezier(.2,.8,.2,1), height .35s cubic-bezier(.2,.8,.2,1), border-radius .35s, transform .3s ease, margin .3s ease; }
@media (min-width: 961px) {
  .pick-hint { top: auto; bottom: 14px; }
  .stage:has(.pick-hint:not(.hidden)) .device.phone { height: min(800px, calc(100% - 120px)); transform: translateY(-26px); }
  /* the edit panel docks beside the phone when there is room */
  .stage:has(.pick-panel:not(.hidden)) .device { transform: translateX(min(-220px, calc((100% - 860px) / -2))); }
  .stage:has(.pick-panel:not(.hidden)):has(.pick-hint:not(.hidden)) .device.phone { transform: translate(min(-220px, calc((100% - 860px) / -2)), -26px); }
  .pick-panel { top: 16px; bottom: 16px; max-height: none; }
}
@media (max-width: 960px) {
  /* a strip under the app holds Edit / Colours and the hint */
  .device.phone, .device.tablet, .device.desktop { height: calc(100% - 58px) !important; }
  .stage-fab { bottom: 9px; right: 10px; }
  .stage-fab .btn { height: 40px; }
  .pick-hint { top: auto; bottom: 9px; left: 10px; transform: none; max-width: calc(100% - 230px); background: var(--panel); }
  .pick-hint > span .hide-sm { display: none; }
}
@media (max-width: 960px) { .stage { align-items: flex-start; } }
/* Home, reviewer pass: steps as one plain row, compare as one link, 3-column templates. */
.steps-row { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); max-width: 1040px; margin: 0 auto; padding: var(--s6) 20px; }
.steps-row li { counter-increment: s; display: flex; flex-direction: column; gap: 4px; }
.steps-row li::before { content: counter(s); font-size: 12px; font-weight: 700; color: var(--accent); }
.steps-row b { font-size: 15px; }
.steps-row span { color: var(--muted); font-size: 13.5px; }
.how { display: block; }
.why-link { max-width: 1040px; margin: 0 auto; padding: var(--s5) 20px; }
.why-link a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.tpl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.count { color: var(--dim); font-size: 14px; font-weight: 500; margin-left: 6px; }
.card.start-card { min-height: 0; }
@media (max-width: 760px) { .steps-row { grid-template-columns: 1fr; gap: var(--s3); padding: var(--s5) 16px; } .tpl-grid { grid-template-columns: 1fr 1fr !important; } }
/* Workspace, reviewer pass. */
body.on-code-tab #deviceSeg, body.on-code-tab #editBtn, body.on-code-tab #coloursBtn, body.on-code-tab #phoneBtn, body.on-code-tab #reloadBtn { display: none !important; }
.ai-reason { margin: 0 0 var(--s4); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--panel-2); color: var(--text); font-size: 13.5px; }
.ai-signin-hint { margin: 0 0 var(--s4); }
.msg.ai.welcome, .msg.ai:first-child { border-color: var(--line-2); }

/* ── Final sweep, reviewer pass 2026-10-12 ── */
/* one heading font, one accent */
h1, h2, h3, h4, .modal .mh h3, .brand, .section h2 { font-family: var(--sans); }
.modal .mh h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.edit-btn.on, .stage-fab .btn.on, #editBtn.on { background: var(--panel-2) !important; border-color: rgba(200,240,49,.55) !important; color: var(--accent) !important; }
.pick-hint { background: var(--panel) !important; border-color: var(--line-2) !important; color: var(--text); }
.pick-hint .btn { color: var(--text) !important; }
input[type=range] { accent-color: var(--accent); }
/* calm focus ring everywhere */
:focus-visible { outline: 2px solid rgba(200,240,49,.55); outline-offset: 2px; }
.btn:focus:not(:focus-visible), .ai-chip:focus:not(:focus-visible) { outline: none; box-shadow: none; }
/* dialogs and sheets never taller than the screen */
.modal { max-height: calc(100dvh - 32px); overflow-y: auto; }
@media (max-width: 640px) { .modal { max-height: calc(100dvh - 12px); } }
/* home leftovers */
.seo-faq { max-width: 1040px !important; margin-left: auto !important; margin-right: auto !important; padding-left: 20px; padding-right: 20px; }
.card.import { min-height: 0 !important; padding: var(--s4) var(--s5); justify-content: flex-start; }
.partner-row .ctp a, .ctp a { color: var(--muted); }
.partner-row .ctp { background: transparent; border-color: var(--line); }
.ctp-chip { background: transparent !important; color: var(--dim) !important; border: 1px solid var(--line-2); }
@media (max-width: 520px) { .composer-big textarea { min-height: 80px; padding-bottom: 8px; } .hero h1 { font-size: 32px; } }
.pp-morestyle { margin-top: var(--s2); }
.pp-morestyle > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.pp-crumbs { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.pp-crumbs .crumb.now { font-weight: 600; }
.pp-crumbs button.crumb { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; font-size: 12.5px; }
/* Home sections share the .section column (they started 40px further right). */
.steps-row, .why-link, .seo-faq { max-width: 1120px !important; padding-left: 20px !important; padding-right: 20px !important; }
/* Inside a project the top bar never carries the site links (phones ran out of room). */
body.in-ws .top-links { display: none !important; }
@media (max-width: 520px) { body.in-ws .studio-pill { display: none !important; } }
