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