
/* Layout: quiet light sidebar + one large rounded panel (reference: Arena).
   Views: Home (start) · Projects (previous projects grid) · Project (chat left, live website preview right).
   Project top bar follows the 10Web reference: name menu, history, Code editor, WordPress, fullscreen, Publish. */
:root {
  --bg: #FAFAF8; --panel: #FCFCFA; --card: #FFFFFF; --soft: #F3F2EE;
  --line: #E8E7E2; --line-strong: #DAD9D3;
  --fg: #1B1B19; --muted: #6B6A64; --faint: #A3A29B;
  --ink: #161615; --ink-fg: #FFFFFF;
  --blue: #2F5BEA; --blue-soft: #E9EEFD;
  --ok: #2F7D4F; --warn: #A3620A;
  --shadow: 0 1px 2px rgba(27,27,25,.05), 0 5px 17px rgba(27,27,25,.07);
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161614; --panel: #1A1A18; --card: #20201E; --soft: #262623;
    --line: #2D2D2A; --line-strong: #3A3A36; --fg: #ECEAE4; --muted: #A4A29A; --faint: #74726C;
    --ink: #ECEAE4; --ink-fg: #161614; --blue: #7C9BFF; --blue-soft: #1F2644; --ok: #6CC795; --warn: #E0A54A;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 5px 17px rgba(0,0,0,.3); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161614; --panel: #1A1A18; --card: #20201E; --soft: #262623;
  --line: #2D2D2A; --line-strong: #3A3A36; --fg: #ECEAE4; --muted: #A4A29A; --faint: #74726C;
  --ink: #ECEAE4; --ink-fg: #161614; --blue: #7C9BFF; --blue-soft: #1F2644; --ok: #6CC795; --warn: #E0A54A;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 5px 17px rgba(0,0,0,.3); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; border-radius: 5px; }
svg.i { width: 15.5px; height: 15.5px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { position: relative; }

[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 8.5px); top: 50%; transform: translateY(-50%);
  background: var(--ink); color: var(--ink-fg); font: 11px/1 var(--sans); padding: 7.5px 10.5px; border-radius: 6px;
  white-space: nowrap; z-index: 30; box-shadow: var(--shadow); pointer-events: none;
}

/* ---------- Frame ---------- */
.app { position: relative; display: grid; grid-template-columns: clamp(190px, var(--side-w, 227px), 40vw) minmax(0, 1fr); height: 100%; padding: 8.5px 8.5px 8.5px 0; }
.app.closed { grid-template-columns: 60px minmax(0, 1fr); padding-left: 0; }
.app.closed .side { visibility: visible; align-items: center; gap: 5px; padding: 10.5px 5px 7px; overflow: visible; }
.app.closed .side-top { justify-content: center; width: 100%; margin-bottom: 12px; }
.app.closed .brand-name, .app.closed .brand .brand-mark, .app.closed .new > span, .app.closed .nav-item > span, .app.closed .side-label, .app.closed .recent, .app.closed .side-empty, .app.closed .plan-card, .app.closed .account-btn > span:not(.avatar) { display: none; }
.app.closed .brand { display: none; }
.app.closed .collapse-side { display: inline-grid; margin: 0; }
.app.closed .new, .app.closed .nav-item { justify-content: center; width: 42px; height: 38px; padding: 0; }
.app.closed .side-menu, .app.closed .agency-menu { width: 42px; }
.app.closed .side-divider { display: none; }
.app.closed .new .i, .app.closed .nav-item .i { width: 18px; height: 18px; }
.app.closed .account, .app.closed .account-btn { width: 42px; padding: 0; justify-content: center; }
.app.closed .side [data-tip]::after { left: calc(100% + 8px); }

.side { display: flex; flex-direction: column; gap: 5px; padding: 10.5px 12px 7px 19px; min-height: 0; overflow-y: auto; }
.side > * { flex-shrink: 0; }
.side-top { display: flex; align-items: center; height: 38px; margin-bottom: 19px; }
.brand { display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; padding: 3.5px 5px 3.5px 0; border-radius: 7px; }
.brand-mark { width: 19px; height: 19px; }
.brand-name { font: 500 18px/1 var(--serif); letter-spacing: -.02em; }
.brand .i { width: 12px; height: 12px; color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 0; border-radius: 7.5px; background: transparent; color: var(--muted); }
.icon-btn:hover { background: var(--soft); color: var(--fg); }
.icon-btn[aria-pressed="true"] { background: var(--soft); color: var(--fg); }
.side-top .icon-btn { margin-left: auto; }

.new { display: flex; align-items: center; gap: 8.5px; height: 36px; padding: 0 10.5px; width: 100%; border: 1px solid transparent; border-radius: 8.5px; background: transparent; text-align: left; font: 14px var(--sans); }
.new:hover, .new[aria-current="page"] { background: var(--soft); }
.side-menu, .agency-menu { display: grid; gap: 5px; }
.side-divider { height: 1px; margin: 8px 10.5px 3px; background: var(--line); }
.nav-item[draggable="true"] { cursor: grab; }
.nav-item[draggable="true"]:active { cursor: grabbing; }
.nav-item.dragging { opacity: .44; }
.nav-item.drag-over { box-shadow: inset 0 2px 0 var(--blue); }
.nav-item { display: flex; align-items: center; gap: 8.5px; height: 32.5px; padding: 0 10.5px; width: 100%; border: 0; border-radius: 7.5px; background: transparent; text-align: left; font: 14px var(--sans); color: var(--fg); }
.nav-item .i { color: var(--muted); }
.nav-item:hover, .nav-item[aria-current="page"] { background: var(--soft); }
.nav-item .count { margin-left: auto; font: 11px var(--sans); color: var(--faint); }

.side-label { display: flex; align-items: center; margin: 19px 10.5px 3.5px; font-size: 11px; color: var(--faint); }
.side-label button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 11px; padding: 2px 5px; border-radius: 5px; }
.side-label button:hover { background: var(--soft); color: var(--fg); }
.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.recent button.r-open { display: flex; align-items: center; gap: 8.5px; width: 100%; text-align: left; border: 0; background: transparent; padding: 6px 10.5px; border-radius: 7px; font-size: 12px; color: var(--muted); }
.recent button span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent button:hover, .recent button[aria-current="true"] { background: var(--soft); color: var(--fg); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

.side-spacer { flex: 1; }
.account { position: relative; }
.account-btn { display: flex; align-items: center; gap: 10.5px; width: 100%; padding: 7px; border: 0; border-radius: 8.5px; background: transparent; text-align: left; }
.account-btn:hover { background: var(--soft); }
.avatar { width: 32.5px; height: 32.5px; border-radius: 50%; flex: none; display: grid; place-items: center; background: #3D4A42; color: #E3EEE7; font: 500 11px var(--sans); }
.account-name { display: block; font-size: 12px; font-weight: 500; }
.account-mail { display: block; font-size: 11px; color: var(--muted); }

/* Popovers and menus */
.pop { position: absolute; z-index: 25; min-width: 189px; background: var(--card); border: 1px solid var(--line); border-radius: 10.5px; box-shadow: var(--shadow); padding: 5px; }
.pop.up { left: 0; right: 0; bottom: calc(100% + 5px); }
.pop.down { top: calc(100% + 5px); left: 0; }
.pop.down.right { left: auto; right: 0; }
.pop-label { font-size: 10.5px; color: var(--faint); padding: 5px 7px 3.5px; }
.pop-row { display:flex; align-items:center; justify-content:space-between; padding-right:3px; }
.pop-row .pop-label { padding:5px 7px 3.5px; }
.appearance-toggle { width:30px; height:30px; display:grid; place-items:center; border:0; border-radius:7px; background:transparent; color:var(--muted); }
.appearance-toggle:hover { background:var(--soft); color:var(--fg); }
.appearance-toggle .i { width:17px; height:17px; }
.pop hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.pop-item { display: flex; align-items: center; gap: 8.5px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8.5px; border-radius: 7px; font-size: 12px; color: var(--fg); text-decoration: none; }
.pop-item:hover, .pop-item[aria-current="true"], .pop-item[aria-checked="true"] { background: var(--soft); }
.pop-item .i { color: var(--muted); width: 14px; height: 14px; }
.pop-item small { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.pop-item.danger { color: #B3261E; }
.pop-item.danger .i { color: #B3261E; }
.pop-opt { display: grid; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8.5px; border-radius: 7px; }
.pop-opt:hover, .pop-opt[aria-checked="true"] { background: var(--soft); }
.pop-opt span { font-size: 11px; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3.5px; padding: 3px; background: var(--soft); border-radius: 7.5px; }
.seg button { height: 27.5px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.pop-search { display: flex; align-items: center; gap: 7px; padding: 0 8.5px; height: 32.5px; margin: 2px 2px 5px; border: 1px solid var(--line); border-radius: 7.5px; background: var(--soft); }
.pop-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 12px; }
.pop-search .i { width: 14px; height: 14px; color: var(--muted); }
.pop-list { max-height: 241px; overflow-y: auto; display: grid; gap: 1px; }
.switcher { width: 275px; }
.ver-pop { width: 292.5px; }
.ver-row { display: grid; grid-template-columns: 32.5px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 7px 8.5px; border-radius: 7px; }
.ver-row:hover { background: var(--soft); }
.ver-row b { font: 400 14px var(--serif); }
.ver-row .what { min-width: 0; font-size: 12px; }
.ver-row .what small { display: block; color: var(--faint); font-size: 11px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.mini-btn { border: 1px solid var(--line); background: var(--card); border-radius: 6px; height: 24px; padding: 0 8.5px; font-size: 11px; }
.mini-btn:hover { background: var(--soft); }

/* ---------- Main panel ---------- */
.main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 7px; padding: 10.5px 14px; min-height: 55px; }
.open-side { display: none; }
.mode { display: inline-flex; align-items: center; gap: 5px; height: 31px; padding: 0 8.5px; border: 0; border-radius: 7.5px; background: transparent; font: 14px var(--serif); max-width: 241px; }
.mode:hover { background: var(--soft); }
.mode .i { width: 12px; height: 12px; color: var(--muted); }
.mode span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 5px; }
.plain-btn { display: inline-flex; align-items: center; gap: 7px; height: 29px; padding: 0 8.5px; border: 0; border-radius: 7px; background: transparent; color: var(--fg); font-size: 13px; }
.plain-btn:hover { background: var(--soft); }
.plain-btn .i { color: var(--muted); }
.outline-btn { display: inline-flex; align-items: center; gap: 7px; height: 31px; padding: 0 12px; border: 1px solid var(--line); border-radius: 7.5px; background: var(--card); font-size: 12px; white-space: nowrap; }
.outline-btn:hover { border-color: var(--line-strong); }
.outline-btn[aria-pressed="true"] { background: var(--soft); border-color: var(--line-strong); }
.ink-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 31px; padding: 0 14px; border: 0; border-radius: 7.5px; background: var(--ink); color: var(--ink-fg); font-size: 12px; white-space: nowrap; }
.ink-btn:hover { opacity: .9; }
.code-btn { display: inline-flex; align-items: center; gap: 7px; height: 32.5px; padding: 0 12px; margin-left: 3.5px; border: 1px solid var(--line); border-radius: 8.5px; background: var(--soft); font-size: 13px; }
.code-btn:hover { border-color: var(--line-strong); }
.code-btn[aria-pressed="true"] { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }
.code-btn .i { width: 14.5px; height: 14.5px; }

.banner { position: absolute; top: 50px; right: 15.5px; z-index: 2; display: flex; align-items: center; gap: 12px; height: 44.5px; padding: 0 7px 0 8.5px; border: 1px solid var(--line); border-radius: 10.5px; background: var(--card); font-size: 13px; box-shadow: var(--shadow); }
.banner a { color: var(--fg); font-size: 12px; display: inline-flex; align-items: center; gap: 3.5px; padding: 5px 8.5px; border-radius: 7px; border: 1px solid var(--line); text-decoration: none; }
.banner a:hover { background: var(--soft); }

/* ---------- Home ---------- */
.home { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34.5px 20.5px 103px; }
.hero { font: 400 clamp(27.5px, 3.4vw, 38px)/1.15 var(--serif); letter-spacing: -.02em; margin: 0 0 29px; text-align: center; text-wrap: balance; }
.hero em { font-style: italic; }
.composer { width: min(653.5px, 100%); border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 14px 10.5px 15.5px; display: grid; gap: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.composer:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow); }
.composer-in { display: flex; gap: 10.5px; align-items: flex-start; }
.composer-in .i { color: var(--muted); width: 19px; height: 19px; margin-top: 2px; }
.composer textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; font-size: 14.5px; line-height: 1.5; min-height: 55px; max-height: 172px; }
.composer textarea::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; gap: 7px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 34.5px; padding: 0 12px 0 10.5px; border: 1px solid var(--line); border-radius: 859px; background: var(--card); font-size: 13px; }
.pill:hover { background: var(--soft); }
.round { display: inline-grid; place-items: center; width: 34.5px; height: 34.5px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--fg); }
.round:hover { background: var(--soft); }
.round:disabled { opacity: .45; cursor: default; }
.composer-row .end { margin-left: auto; display: flex; gap: 7px; align-items: center; }
.model { display: inline-flex; align-items: center; gap: 5px; height: 31px; padding: 0 8.5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; }
.model:hover { background: var(--soft); color: var(--fg); }
.model .i { width: 12px; height: 12px; }
.attached { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 5px 0 3.5px; border: 1px solid var(--line); border-radius: 7px; font-size: 11px; color: var(--muted); background: var(--card); }
.chip i { width: 22.5px; height: 17px; border-radius: 4.5px; display: block; }
.chip button { border: 0; background: transparent; color: var(--faint); padding: 0 2px; }
.chip.sel { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); padding-left: 8.5px; }
.chip.sel button { color: var(--blue); }

.promo { position: absolute; right: 15.5px; bottom: 15.5px; width: 249.5px; z-index: 2; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 10.5px; box-shadow: var(--shadow); display: grid; gap: 8.5px; }
.promo-art { height: 110px; border-radius: 7px; background: #EDEBE4; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; padding: 10.5px; }
.promo-art i { display: block; border-radius: 3px; }
.promo h3 { margin: 3.5px 0 0; font: 400 18px/1.2 var(--serif); letter-spacing: -.01em; }
.promo p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.promo .ink-btn, .promo .outline-btn { width: 100%; justify-content: center; height: 34.5px; }
.side-promos { display:grid; gap:8px; max-height:45vh; overflow-y:auto; width:100%; }
.side .promo { position:relative; inset:auto; width:100%; padding:9px; border-radius:10px; gap:7px; }
.promo-image { display:block; width:100%; height:92px; border-radius:7px; object-fit:cover; background:var(--soft); }
.promo-placeholder { display:grid; place-items:center; height:92px; border-radius:7px; background:var(--soft); color:var(--muted); font-size:24px; }
.promo-hide-x { position:absolute; z-index:1; top:13px; right:13px; display:grid; place-items:center; width:25px; height:25px; border:0; border-radius:50%; background:rgba(255,255,255,.92); color:#555; }
.promo-hide-x .i { width:14px; height:14px; }
.side .promo h3 { margin:2px 0 0; font-size:16px; }
.side .promo p { font-size:12px; }
.side .promo .ink-btn, .side .promo .outline-btn { height:32px; }
.promo-admin { padding:0 20px 18px; display:grid; gap:14px; }
.promo-admin-head { display:flex; justify-content:space-between; align-items:center; gap:12px; border-bottom:1px solid var(--line); padding:14px 0 10px; }
.promo-admin-head .cb-title { padding:0; }
.toggle-line { display:flex; align-items:center; gap:8px; color:var(--fg); font-size:13px; }
.toggle-line input { accent-color:var(--fg); }
.promo-rule-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.promo-admin .promo-rule-grid label, .promo-editor > label:not(.toggle-line) { display:grid; gap:6px; color:var(--muted); font-size:12px; }
.promo-admin input:not([type="checkbox"]) { width:100%; min-width:0; height:36px; border:1px solid var(--line); border-radius:8px; background:var(--soft); color:var(--fg); padding:0 10px; font:13px var(--sans); }
.promo-admin .hint { margin:0; }
.promo-admin-list { display:grid; gap:12px; }
.promo-editor { display:grid; gap:11px; padding:14px; border:1px solid var(--line); border-radius:10px; background:var(--panel); }
.promo-editor header { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.promo-editor header b { font-size:13px; }
.promo-editor .danger { color:#B3261E; }
@media(max-width:650px) { .promo-rule-grid { grid-template-columns:1fr; } .promo-admin { padding:0 14px 16px; } }

/* ---------- Projects page ---------- */
.projects-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-gutter: stable; padding: 7px 24px 34.5px; }
.projects-in { max-width: 946px; margin: 0 auto; }
.projects-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20.5px 0 17px; }
.projects-head .projects-title { margin: 0; }
.projects-head .ink-btn { flex: none; }
.projects-title { font: 400 clamp(24px, 3vw, 32.5px)/1.15 var(--serif); letter-spacing: -.02em; margin: 20.5px 0 17px; }
.filters { display: flex; align-items: center; gap: 8.5px; flex-wrap: wrap; margin-bottom: 17px; }
.filters .seg { width: 241px; }
.search-field { display: flex; align-items: center; gap: 7px; height: 34.5px; padding: 0 10.5px; border: 1px solid var(--line); border-radius: 8.5px; background: var(--card); width: min(275px, 100%); margin-left: auto; }
.search-field input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.search-field .i { width: 14px; height: 14px; color: var(--muted); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(223.5px, 1fr)); gap: 14px; }
.pcard { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease; }
.pcard:hover, .pcard:focus-within { border-color: var(--line-strong); box-shadow: var(--shadow); }
.pcard-open { position: absolute; inset: 0; border: 0; background: transparent; border-radius: 12px; }
.pthumb { height: 129px; padding: 10.5px; display: grid; gap: 5px; grid-template-rows: auto 1fr auto; }
.pthumb .bar { height: 7px; display: flex; justify-content: space-between; align-items: center; }
.pthumb .bar i { display: block; height: 3.5px; width: 22%; border-radius: 2px; background: currentColor; opacity: .35; }
.pthumb .hero { border-radius: 5px; margin: 0; text-align: left; font: inherit; min-height: 0; }
.pthumb .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; height: 22.5px; }
.pthumb .row3 i { display: block; border-radius: 3.5px; }
.pmeta { display: flex; align-items: flex-start; gap: 7px; padding: 10.5px 12px 12px; }
.pname { font: 400 15.5px/1.25 var(--serif); letter-spacing: -.01em; }
.psub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.pmeta .wrap { margin-left: auto; position: relative; z-index: 2; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); }
.status-chip.pub::before { background: var(--ok); }
.empty { padding: 41.5px 0; text-align: center; color: var(--muted); }

/* ---------- Project workspace ---------- */
.project { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, clamp(300px, var(--chat-w, 42%), calc(100% - 380px))) minmax(0, 1fr); border-top: 1px solid var(--line); }
.project.full { grid-template-columns: minmax(0, 1fr); }
.project.full .chat { display: none; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 0 5px; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.status.busy::before { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.swap { display: none; }

.chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 19px 20.5px 17px; }
.thread-in { max-width: 550.5px; margin: 0 auto; display: flex; flex-direction: column; gap: 19px; }
.day { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 11px; margin: 0; }
.day::before, .day::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { display: grid; gap: 7px; }
.msg.me { justify-items: end; }
.bubble { max-width: 86%; background: var(--soft); border-radius: 14px; padding: 8.5px 14px; font-size: 14px; line-height: 1.5; }
.meta { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--faint); }
.meta .i { width: 13px; height: 13px; }
.say { font-size: 14px; line-height: 1.65; }
.say p { margin: 0 0 10.5px; }
.say p:last-child { margin: 0; }
.say b { font-weight: 600; }
.say ul { margin: 0 0 10.5px; padding: 0; list-style: none; display: grid; gap: 3.5px; }
.say li { padding-left: 19px; position: relative; }
.say li::before { content: ""; position: absolute; left: 6px; top: .72em; width: 3.5px; height: 3.5px; border-radius: 50%; background: var(--faint); }

.code { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); padding: 14px 15.5px 10.5px; font: 11px/1.75 var(--mono); }
.code pre { margin: 0; white-space: pre; overflow-x: auto; max-height: 129px; transition: max-height .25s ease; }
.code.open pre { max-height: 550.5px; }
.code .copy { position: absolute; top: 8.5px; right: 8.5px; }
.code .more { display: flex; align-items: center; gap: 5px; margin: 3.5px 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.code .more:hover { color: var(--fg); }
.code.open .more .i { transform: rotate(180deg); }
.code .k { color: var(--faint); }
.code .s { color: var(--ok); }

.run { border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.run-head { display: flex; align-items: baseline; gap: 8.5px; padding: 10.5px 14px 3.5px; }
.run-head b { font: 400 14.5px var(--serif); }
.run-head span { margin-left: auto; font-size: 11px; color: var(--faint); }
.steps { list-style: none; margin: 0; padding: 3.5px 0 8.5px; }
.step { display: flex; align-items: center; gap: 10.5px; padding: 5px 14px; font-size: 13px; color: var(--muted); animation: in .25s ease both; }
.step .ico { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; color: var(--ok); border: 1px solid var(--line); flex: none; }
.step .ico .i { width: 10.5px; height: 10.5px; stroke-width: 2.2; }
.step.pending .ico { color: var(--warn); }
.step.pending .ico .i { animation: spin 1s linear infinite; }
.step.stopped .ico { color: var(--faint); }
.step code { font: 11px var(--mono); background: var(--soft); padding: 1px 5px; border-radius: 4.5px; color: var(--fg); }
.step .delta { margin-left: auto; font-size: 11px; color: var(--faint); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes in { from { opacity: 0; transform: translateY(3px); } }

/* Modification card (reference: 10Web) */
.mod { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 8px 10px 9px; display: grid; gap: 6px; }
.mod.selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.mod-top { display: flex; align-items: center; font-size: 12px; color: var(--muted); }
.mod-top button { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; border: 0; background: transparent; color: var(--fg); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; padding: 2px 3.5px; border-radius: 5px; }
.mod-top button:hover { background: var(--soft); }
.mod-top .i { width: 13px; height: 13px; }
.mod p { margin: 0; font-size: 13px; line-height: 1.4; }
.mod-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mod-actions .blue-btn, .mod-actions .outline-btn { height: 29px; padding: 0 10px; font-size: 11.5px; }
.mod-actions .i { width: 13px; height: 13px; }
.blue-btn { display: inline-flex; align-items: center; gap: 7px; height: 32.5px; padding: 0 12px; border: 0; border-radius: 7.5px; background: var(--blue); color: #FFFFFF; font-size: 12px; }
.blue-btn:hover { opacity: .92; }
:root[data-theme="dark"] .blue-btn, :root:not([data-theme="light"]) .blue-btn { color: #0F1530; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .blue-btn { color: #FFFFFF; } }
:root[data-theme="light"] .blue-btn { color: #FFFFFF; }

.dock { padding: 0 20.5px 15.5px; }
.dock-in { max-width: 550.5px; margin: 0 auto; display: grid; gap: 8.5px; }
.dock .composer { width: 100%; }
.dock .composer textarea { min-height: 44.5px; font-size: 14px; }
.q-pill { display: inline-flex; align-items: center; gap: 8.5px; width: fit-content; height: 36px; padding: 0 10.5px 0 14px; border: 1px solid var(--line); border-radius: 10.5px; background: var(--card); font-size: 13px; }
.q-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--fg); }
.q-pill:hover { border-color: var(--line-strong); }
.q-pill .i { width: 13px; height: 13px; color: var(--muted); }
.q { border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.q-head { display: flex; align-items: flex-start; gap: 10.5px; padding: 14px 15.5px 5px; }
.q-count { font-size: 11px; color: var(--muted); }
.q-text { margin: 3.5px 0 0; font: 400 18px/1.3 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.q-head .icon-btn { margin-left: auto; }
.q-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 15.5px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; font-size: 13.5px; }
.q-opt:hover, .q-opt[aria-checked="true"] { background: var(--soft); }
.q-num { width: 22.5px; height: 22.5px; border-radius: 6px; display: grid; place-items: center; flex: none; font-size: 11px; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.q-opt[aria-checked="true"] .q-num { background: var(--ink); border-color: var(--ink); color: var(--ink-fg); }
.q-opt input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; }
.q-opt input::placeholder { color: var(--faint); }
.q-foot { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 10.5px 15.5px; border-top: 1px solid var(--line); }
.q-foot .pager { display: flex; align-items: center; gap: 3.5px; font-size: 12px; color: var(--muted); }
.q-foot .acts { margin-left: auto; display: flex; gap: 7px; }
.stop-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.note { font-size: 11px; color: var(--faint); text-align: center; }

/* Right side: preview or code */
.right { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pv { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.project-tabs { display: flex; align-items: center; gap: 5px; flex: 1; max-width: 460px; min-width: 0; overflow-x: auto; margin: 0 8px; scrollbar-width: thin; }
.project-tab { cursor: pointer; display: flex; align-items: center; min-width: 0; max-width: 190px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--muted); }
.project-tab-open { min-width: 0; height: 100%; padding: 0 7px 0 11px; border: 0; background: transparent; color: inherit; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-tab-open:hover { color: var(--fg); }
.project-tab-close { display: grid; place-items: center; width: 24px; height: 24px; flex: none; margin-right: 3px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); font-size: 16px; line-height: 1; }
.project-tab-close:hover { background: var(--line); color: var(--fg); }
.project-tab-add { width: 29px; height: 29px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--muted); font-size: 19px; line-height: 1; }
.project-tab-add:hover { background: var(--soft); color: var(--fg); }
.pv-bar { display: flex; align-items: center; gap: 7px; padding: 10.5px 12px; flex-wrap: wrap; }
.devices { display: flex; gap: 2px; padding: 3px; border-radius: 8.5px; background: var(--soft); }
.devices button { width: 32.5px; height: 27.5px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.devices button[aria-pressed="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.devices .i { width: 14.5px; height: 14.5px; }
.route-wrap { position: relative; flex: 1; min-width: 137.5px; }
.route { appearance: none; -webkit-appearance: none; width: 100%; height: 34.5px; border: 0; border-radius: 8.5px; background: var(--soft); padding: 0 31px 0 12px; font-size: 13px; }
.route-wrap .i { position: absolute; right: 10.5px; top: 11px; width: 12px; height: 12px; color: var(--muted); pointer-events: none; }
.spin .i { animation: spin .6s linear; }
.canvas { flex: 1; min-height: 0; overflow: auto; background: var(--bg); padding: 0 12px 12px; display: flex; justify-content: center; }
.device { container-type: inline-size; width: 100%; height: fit-content; min-height: 100%; background: #F9F9F9; color: #111; border: 1px solid var(--line); border-radius: 8.5px; overflow: hidden; box-shadow: var(--shadow); position: relative; transition: width .3s ease; }
.device.tablet { width: 72%; }
.device.mobile { width: 275px; max-width: 100%; }
.device.selecting { cursor: crosshair; }
.chrome { display: flex; align-items: center; gap: 5px; padding: 7px 10.5px; border-bottom: 1px solid #E8E8E8; background: #FFFFFF; }
.chrome i { width: 7px; height: 7px; border-radius: 50%; background: #DADADA; display: block; }
.chrome span { flex: 1; margin-left: 7px; text-align: center; font: 9.5px var(--mono); color: #8A8A8A; background: #F2F2F2; border-radius: 5px; padding: 3px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-box { position: absolute; z-index: 5; border: 1.5px dashed #2F6FEB; background: rgba(47,111,235,.07); pointer-events: none; border-radius: 3px; }
.sel-box.locked { border-style: solid; background: rgba(47,111,235,.12); }
.sel-tag { position: absolute; left: -2px; top: -22px; background: #1F6FEB; color: #FFFFFF; font: 9.5px/1 var(--sans); padding: 4.5px 7px; border-radius: 4.5px; white-space: nowrap; }

/* Code pane */
.cp { display: flex; flex-direction: column; flex: 1; min-height: 0; min-width: 0; }
.cp-bar { display: flex; align-items: center; gap: 7px; padding: 10.5px 12px; border-bottom: 1px solid var(--line); }
.cp-banner { display: flex; align-items: center; gap: 8.5px; padding: 7px 12px; background: var(--blue-soft); color: var(--blue); font-size: 12px; }
.cp-banner button { margin-left: auto; border: 0; background: transparent; color: inherit; text-decoration: underline; font-size: 12px; }
.cp-body { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: clamp(130px, var(--tree-w, 189px), calc(100% - 240px)) minmax(0, 1fr); }
.tree { border-right: 1px solid var(--line); padding: 8.5px 7px; overflow-y: auto; font-size: 12px; }
.tree .pop-search { margin: 0 0 7px; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 10.5px; }
.tree > ul { padding: 0; }
.tree .dir { color: var(--faint); padding: 4.5px 7px; font-size: 11px; }
.tree button { width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 7px; border-radius: 6px; display: flex; align-items: center; gap: 7px; font: 11px var(--mono); }
.tree button:hover, .tree button[aria-current="true"] { background: var(--soft); }
.tree .mod-dot { margin-left: auto; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.editor { min-width: 0; display: flex; flex-direction: column; background: var(--card); }
.editor-tabs { display: flex; border-bottom: 1px solid var(--line); }
.editor-tabs span { padding: 8.5px 14px; font: 11px var(--mono); color: var(--fg); border-right: 1px solid var(--line); background: var(--panel); }
.editor pre { margin: 0; flex: 1; overflow: auto; padding: 12px 0; font: 11px/1.75 var(--mono); counter-reset: ln; }
.editor .l { display: block; padding-right: 17px; white-space: pre; }
.editor .l::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 38px; padding-right: 14px; text-align: right; color: var(--faint); }
.editor .l.add { background: color-mix(in srgb, var(--ok) 12%, transparent); }
.editor .l.del { background: color-mix(in srgb, #B3261E 10%, transparent); text-decoration: line-through; text-decoration-color: color-mix(in srgb, #B3261E 40%, transparent); }

.toast { position: fixed; left: 50%; bottom: calc(20.5px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 14px); background: var(--ink); color: var(--ink-fg); padding: 8.5px 14px; border-radius: 8.5px; font-size: 12px; opacity: 0; transition: opacity .2s ease, transform .2s ease; pointer-events: none; z-index: 60; max-width: calc(100% - 27.5px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .banner { display: none; }
  .project { grid-template-columns: minmax(0, 1fr); }
  .project .right { display: none; }
  .project.show-right .chat { display: none; }
  .project.show-right .right { display: flex; }
  .swap { display: inline-flex; }
  .chat { border-right: 0; }
  .cp-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tree { border-right: 0; border-bottom: 1px solid var(--line); max-height: 146px; }
}
@media (max-width: 860px) {
  .app, .app.closed { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .app.closed .side { visibility: visible; }
  .side { position: fixed; z-index: 40; inset: 0 auto 0 0; width: min(249.5px, 86vw); background: var(--bg); border-right: 1px solid var(--line); transform: translateX(-100%); transition: transform .25s ease; padding-top: calc(10.5px + env(safe-area-inset-top, 0px)); }
  .app.drawer .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); }
  .open-side, .app.closed .open-side { display: inline-grid; }
  .collapse-side { display: none; }
  .main { border-radius: 0; border: 0; min-height: 100%; }
  .topbar { padding: 8.5px 8.5px; gap: 2px; flex-wrap: nowrap; }
  .topbar .mode { max-width: 101.5px; padding: 0 5px; }
  .topbar .top-right { gap: 3.5px; }
  .swap { padding: 0 8.5px; }
  .swap span { display: none; }
  .code-btn { margin-left: 0; padding: 0 9.5px; }
  .ink-btn { padding: 0 10.5px; }
  .home { justify-content: flex-start; padding: 27.5px 14px 41.5px; }
  .thread { padding: 14px 14px 10.5px; }
  .dock { padding: 0 10.5px 10.5px; }
  .projects-body { padding: 3.5px 14px 27.5px; }
  .filters .seg { width: 100%; }
  .search-field { margin-left: 0; width: 100%; }
  .hide-sm { display: none !important; }
  .pop.down.right { right: -8px; }
  .switcher, .ver-pop { width: min(275px, calc(100vw - 20.5px)); }
  [data-tip]:hover::after { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }


/* ================= Real-app additions ================= */
.notice { margin: 0 16px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--soft); font-size: 12.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.notice code, .pop-note code { font: 11.5px var(--mono); background: var(--card); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.notice-err { padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, #B3261E 35%, var(--line)); background: color-mix(in srgb, #B3261E 8%, var(--card)); color: var(--fg); font-size: 13px; line-height: 1.5; }
.pop-note { margin: 2px 8px 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.side-empty { margin: 8px 12px; font-size: 12.5px; color: var(--faint); line-height: 1.5; }
.model-label { font-size: 11.5px; color: var(--faint); margin-right: 4px; text-transform: capitalize; }
.say.muted { color: var(--muted); font-size: 12.5px; }
.md-code { margin: 0 0 10px; padding: 10px 12px; border-radius: 8px; background: var(--soft); border: 1px solid var(--line); font: 12px/1.6 var(--mono); overflow-x: auto; }
.chip img { width: 22px; height: 17px; object-fit: cover; border-radius: 4px; display: block; }
.step.fail { color: var(--fg); }
.step.fail .ico { color: #B3261E; }
.step .lbl { min-width: 0; overflow-wrap: anywhere; }
.live-now { display: flex; align-items: center; gap: 8px; padding: 6px 14px 12px; font-size: 12.5px; color: var(--muted); font-style: italic; }
.live-now span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#live-text:empty { display: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--fg); animation: spin .8s linear infinite; flex: none; }
.spinner.sm { width: 11px; height: 11px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Project cards: initial on a tinted block (no screenshots stored yet) */
.pthumb { height: 118px; padding: 12px; display: grid; place-items: center; position: relative; grid-template-rows: none; }
.pthumb .pinit { font: 400 44px/1 var(--serif); letter-spacing: -.02em; }
.pthumb .pver { position: absolute; right: 10px; bottom: 8px; font-size: 11px; opacity: .7; }

/* Preview frame */
.canvas { padding: 0 12px 12px; align-items: stretch; }
.device { display: flex; flex-direction: column; height: 100%; min-height: 0; container-type: normal; background: #fff; }
.device.tablet { width: 768px; max-width: 100%; }
.device.mobile { width: 390px; max-width: 100%; }
.device iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; display: block; }
.pv-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 82%, transparent); z-index: 4; text-align: center; padding: 20px; }
.pv-overlay[hidden] { display: none; }
.pv-box { display: grid; justify-items: center; gap: 10px; color: var(--muted); font-size: 13px; max-width: 320px; }
.pv-error { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 6; max-height: 60%; overflow: auto; background: var(--card); border: 1px solid color-mix(in srgb, #B3261E 40%, var(--line)); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 13px; display: grid; gap: 8px; }
.pv-error pre { margin: 0; white-space: pre-wrap; font: 11.5px/1.5 var(--mono); color: var(--muted); max-height: 160px; overflow: auto; }
.pv-error-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vbanner { display: flex; align-items: center; gap: 10px; margin: 0 12px 8px; padding: 7px 12px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); font-size: 12.5px; }
.vbanner[hidden] { display: none; }
.vbanner button { margin-left: auto; border: 0; background: transparent; color: inherit; text-decoration: underline; font-size: 12.5px; }

/* Code editor */
.editor { position: relative; }
.editor-tabs { align-items: center; }
.editor-actions { margin-left: auto; display: flex; gap: 6px; padding-right: 10px; }
.editor-actions[hidden] { display: none; }
#file-edit { flex: 1; width: 100%; border: 0; outline: none; resize: none; background: var(--card); color: var(--fg); padding: 14px 16px; font: 12px/1.7 var(--mono); tab-size: 2; white-space: pre; overflow: auto; }
.editor-img { flex: 1; display: grid; place-items: center; padding: 20px; background: var(--soft); overflow: auto; }
.editor-img img { max-width: 100%; max-height: 100%; }
.editor-img[hidden], #file-edit[hidden], #file-code[hidden] { display: none; }
.cp-banner[hidden] { display: none; }
.tree button span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ================= Settings, connected agents ================= */
.build-types { display:flex; gap:10px; justify-content:center; margin:0 auto 20px; }
.build-type { display:flex; align-items:center; gap:12px; text-align:left; padding:12px 16px; min-width:220px; border:1px solid var(--line); border-radius:12px; color:var(--fg); background:var(--card); cursor:pointer; }
.build-type .i { width:21px; height:21px; color:var(--muted); }
.build-type span { display:grid; gap:3px; }
.build-type b { font-size:13px; font-weight:600; }
.build-type small { font-size:11px; color:var(--muted); }
.build-type.selected { border-color:var(--fg); box-shadow:0 0 0 1px var(--fg); }
.stack-picker { width:min(440px,calc(100% - 28px)); margin:-6px auto 18px; display:grid; gap:6px; color:var(--muted); font-size:12px; text-align:left; }
.stack-picker select { width:100%; height:40px; padding:0 12px; border:1px solid var(--line); border-radius:10px; color:var(--fg); background:var(--card); font:inherit; font-size:13px; }
.stack-picker small { font-size:11px; }
.runtime-actions { display:flex; align-items:center; gap:7px; }
.runtime-actions[hidden] { display:none; }
.runtime-network { display:flex; align-items:center; gap:5px; color:var(--muted); font-size:11px; white-space:nowrap; }
.runtime-log { padding:9px 13px; border-bottom:1px solid var(--line); background:var(--soft); }
.runtime-log[hidden] { display:none; }
.runtime-log > div { display:flex; align-items:center; justify-content:space-between; font-size:12px; }
.runtime-log pre { max-height:140px; overflow:auto; white-space:pre-wrap; margin:7px 0 0; font:11px/1.5 var(--mono); color:var(--muted); }
.integration-in { max-width:920px; display:grid; gap:18px; }
.integration-intro { margin:-9px 0 18px; color:var(--muted); font-size:14px; }
.integration-list { display:grid; gap:12px; }
.integration-card { display:flex; align-items:center; gap:18px; min-height:92px; padding:20px 22px; border:1px solid var(--line); border-radius:15px; background:var(--card); }
.integration-card > div { flex:1; min-width:0; }
.integration-card h2 { margin:0 0 5px; font-size:15px; font-weight:600; }
.integration-card p { margin:0; color:var(--muted); font-size:13px; line-height:1.5; }
.integration-icon { width:48px; height:48px; display:grid; place-items:center; flex:none; border-radius:12px; color:var(--fg); background:var(--soft); font-size:23px; }
.integration-icon .i { width:22px; height:22px; }
.integration-icon.wp { color:#2870c8; }
.integration-soon { margin:26px 0 0; font-size:17px; font-weight:500; }
.integration-card.disabled { opacity:.78; }
.coming-tag { flex:none; padding:7px 10px; border-radius:99px; background:var(--soft); color:var(--muted); font-size:11px; }
@media(max-width:600px) { .build-types { flex-direction:column; } .build-type { width:100%; } .integration-card { flex-wrap:wrap; padding:16px; } .integration-card > div { flex:1 1 calc(100% - 70px); } .integration-card > button,.coming-tag { margin-left:66px; } }
.settings-in { max-width: 760px; display: grid; gap: 18px; }
.card-box { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.card-box > h2 { margin: 0; padding: 20px 22px 4px; font: 500 18px/1.25 var(--sans); letter-spacing: -.01em; }
.card-sub { margin: 0; padding: 0 22px 16px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); }
.agent-row, #row-builtin { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-top: 1px solid var(--line); }
.ag-ava { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; flex: none; font: 500 15px var(--serif); color: var(--fg); background: var(--soft); }
.ag-ava .i { width: 17px; height: 17px; color: var(--muted); }
.ag-main { min-width: 0; flex: 1; }
.ag-name { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ag-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; line-height: 1.45; }
.ag-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.disconnect { height: 32px; padding: 0 14px; border: 1px solid #D9742B; border-radius: 9px; background: transparent; color: #C25E16; font-size: 13px; }
.disconnect:hover { background: color-mix(in srgb, #D9742B 10%, transparent); }
.agent-empty { padding: 18px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip-soft { font-size: 11.5px; font-weight: 400; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.chip-soft.ok { color: var(--ok); } .chip-soft.warn { color: var(--warn); }
.keyform { padding: 14px 22px 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.keyform label { font-size: 12.5px; color: var(--muted); }
.keyrow { display: flex; gap: 8px; flex-wrap: wrap; }
.keyrow input { flex: 1; min-width: 220px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); padding: 0 12px; font: 13px var(--mono); }
.keyrow input:disabled { opacity: .55; }
.hint { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.hint code, .steps2 code, #connect-panel p code { font: 11.5px var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; }
.tabs2 { display: flex; gap: 2px; padding: 4px 18px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs2 button { height: 36px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; }
.tabs2 button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.ctab { padding: 18px 22px; display: grid; gap: 14px; font-size: 13px; line-height: 1.6; }
.ctab[hidden] { display: none; }
.ctab p { margin: 0; color: var(--muted); }
.steps2 { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--muted); }
.steps2 strong { color: var(--fg); font-weight: 500; }
.copyrow { display: flex; gap: 10px; align-items: flex-start; }
.copyrow code, .copyrow pre { flex: 1; min-width: 0; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); font: 12px/1.6 var(--mono); overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.copyrow .outline-btn { height: 34px; flex: none; }
.tokenform { display: flex; gap: 8px; flex-wrap: wrap; }
.tokenform input { flex: 1; min-width: 180px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); padding: 0 12px; }
.tokenbox { margin: 0 22px 18px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--soft); display: grid; gap: 8px; font-size: 13px; }
.tokenbox[hidden] { display: none; }
.statusline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 10px 12px; background: var(--soft); border-radius: 9px; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); }
.toolsbox { margin: 0 22px 18px; font-size: 13px; color: var(--muted); }
.toolsbox summary { cursor: pointer; padding: 6px 0; }
.toolsbox ul { margin: 6px 0 10px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.toolsbox code { font: 11.5px var(--mono); background: var(--soft); border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px; }

.approval { position: relative; z-index: 8; display: grid; flex: none; background: var(--ink); color: var(--ink-fg); }
.approval[hidden] { display: none; }
.approval-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 18px; font-size: 13px; border-bottom: 1px solid color-mix(in srgb, var(--ink-fg) 20%, transparent); }
.approval-row small { opacity: .7; }
.approval-actions { display: flex; gap: 8px; }
.approval .ink-btn { background: var(--ink-fg); color: var(--ink); height: 32px; }
.approval .outline-btn { background: transparent; color: var(--ink-fg); border-color: color-mix(in srgb, var(--ink-fg) 40%, transparent); height: 32px; }
@media (max-width: 860px) {
  .agent-row, #row-builtin { flex-wrap: wrap; }
  .ag-actions { width: 100%; justify-content: flex-end; }
  .copyrow { flex-direction: column; } .copyrow .outline-btn { align-self: flex-end; }
}

/* Taking a screenshot for an agent while the preview pane is hidden. The frame is laid out inside the viewport but
   invisible and behind everything: browsers stop rendering cross-origin frames that are off screen, which would hang the capture. */
.project.capturing .right { display: flex !important; position: fixed; left: 0; top: 0; width: 1300px; height: 900px; z-index: -1; opacity: 0; pointer-events: none; }
.project.capturing #cp { display: none !important; }
.project.capturing #pv { display: flex !important; }

/* ---------- Resizable panes ---------- */
.resizer { position: absolute; top: 0; bottom: 0; width: 11px; margin-left: -5.5px; cursor: col-resize; z-index: 20; touch-action: none; outline: none; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px; background: transparent; transition: background .12s; }
.resizer:hover::after, .resizer:focus-visible::after, .resizer.active::after { background: color-mix(in srgb, var(--fg) 28%, transparent); }
.resizer.active::after { background: var(--fg); }
#rs-chat { left: clamp(300px, var(--chat-w, 42%), calc(100% - 380px)); }
#rs-tree { left: clamp(130px, var(--tree-w, 189px), calc(100% - 240px)); }
.side-rs { left: clamp(190px, var(--side-w, 227px), 40vw); top: 8.5px; bottom: 8.5px; }
.app.closed .side-rs, .project.full #rs-chat { display: none; }
body.resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.resizing iframe { pointer-events: none; }
@media (max-width: 1100px) { #rs-chat { display: none; } #rs-tree { display: none; } }
@media (max-width: 860px) { .side-rs { display: none; } }

/* ---------- One-click install (Publish menu) ---------- */
#pub-sites { display: grid; }
.pub-result { margin: 4px 8px 6px; padding: 9px 11px; border-radius: 9px; background: var(--soft); font-size: 12px; line-height: 1.5; color: var(--muted); display: grid; gap: 6px; }
.pub-result strong { color: var(--fg); font-weight: 500; } .pub-result strong.bad { color: #B3261E; }
.pub-result a { color: var(--fg); text-decoration: underline; text-underline-offset: 2px; }
.pub-links { display: flex; gap: 4px; flex-wrap: wrap; }
.pub-result .mini-btn { justify-self: start; }
.spin-dot { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.pop-item:disabled { opacity: .5; cursor: default; }

/* ---------- Accounts, settings sections, billing ---------- */
.settings-in { width: 100%; max-width: 980px; display:grid; grid-template-columns:210px minmax(0,1fr); grid-template-rows:auto 1fr; column-gap:34px; row-gap:8px; align-content:start; }
.settings-in > .projects-title { grid-column:1; grid-row:1; }
.settings-layout { display:contents; }
.settings-nav { grid-column:1; grid-row:2; display:grid; align-content:start; align-self:start; gap:4px; position:sticky; top:4px; }
.settings-nav button { text-align: left; height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; }
.settings-nav button:hover { background: var(--soft); color: var(--fg); }
.settings-nav button[aria-selected="true"] { background: var(--soft); color: var(--fg); font-weight: 500; }
.settings-nav button[hidden] { display: none; }
.settings-main { grid-column:2; grid-row:1 / span 2; min-width:0; padding-top:20.5px; }
.spanel { display: grid; gap: 18px; }
.spanel[hidden] { display: none; }
.sp-head h2 { margin: 0; font: 500 22px/1.2 var(--sans); letter-spacing: -.015em; }
.sp-head p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.sp-note { padding: 18px 22px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.sp-note p { margin: 0; }
.pref-card { padding-bottom: 18px; }
.pref-card .card-sub { margin: 5px 22px 14px; }
.pref-theme { width: min(360px, calc(100% - 44px)); margin: 0 22px; }
.cb-title { margin: 0; padding: 18px 22px 2px; font: 500 15px/1.3 var(--sans); }
.acct-form { display: grid; gap: 7px; padding: 10px 22px 20px; max-width: 520px; }
.acct-form label { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.acct-form #acct-email-wrap { display: grid; gap: 7px; }
.acct-form input, .auth-form input { height: 38px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); padding: 0 12px; font: 14px var(--sans); color: var(--fg); width: 100%; box-sizing: border-box; }
.acct-form input:focus, .auth-form input:focus { outline: 2px solid color-mix(in srgb, var(--fg) 30%, transparent); outline-offset: 1px; background: var(--card); }
.acct-actions { margin-top: 10px; display: flex; gap: 8px; }
.form-msg { margin: 4px 0 0; font-size: 12.5px; color: var(--ok); } .form-msg.bad { color: #B3261E; }
.danger-box { border-color: color-mix(in srgb, #B3261E 30%, var(--line)); }
.danger-btn { height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid #B3261E; background: #B3261E; color: #fff; font-size: 13px; cursor: pointer; }
.danger-btn:disabled { opacity: .6; cursor: default; }

/* billing, laid out like a plain settings page: label, card, label, card */
.bl-label { margin: 8px 0 -8px; font-size: 14px; color: var(--muted); }
.bl-card, .bl-details { padding: 0; }
.bl-row { padding: 18px 22px; font-size: 15px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bl-row strong { font-weight: 500; }
.bl-in { padding: 18px 22px; border-top: 1px solid var(--line); }
.bl-in h4 { margin: 0 0 6px; font: 500 15px var(--sans); color: var(--fg); }
.bl-in p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.bl-upsell { display: flex; gap: 22px; justify-content: space-between; align-items: flex-start; padding: 18px 22px 20px; border-top: 1px solid var(--line); }
.bl-upsell h4 { margin: 0 0 4px; font: 500 15px var(--sans); }
.bl-upsell p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 460px; }
.bl-cta { display: grid; gap: 8px; justify-items: center; flex: none; }
.bl-cta small { font-size: 12px; color: var(--muted); }
.bl-cta .ink-btn { height: 40px; padding: 0 18px; font-size: 14px; border-radius: 9px; }
.bl-usage { padding: 8px 22px; display: grid; }
.bl-usage div { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; color: var(--muted); }
.bl-usage b { font-weight: 500; color: var(--fg); }
.bl-usage .full b { color: #B3261E; }
.bl-bar { height: 4px; border-radius: 4px; background: var(--soft); margin: -4px 0 6px; overflow: hidden; }
.bl-bar i { display: block; height: 100%; background: var(--fg); border-radius: 4px; } .bl-bar.full i { background: #B3261E; }
.bl-foot { padding: 14px 22px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.bl-details .bl-in { padding: 18px 22px; }
.bl-details h4 { margin: 0 0 4px; font: 500 15px var(--sans); }
.bl-details p { margin: 0; font-size: 14px; color: var(--muted); }
.bl-details .bl-card-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.chip-soft.test { background: #FFF4E5; color: #7a4a00; }

/* sidebar plan card and account */
.plan-card { margin: 0 4px 6px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-card[hidden] { display: none; }
.plan-card b { font-size: 13px; font-weight: 500; display: block; } .plan-card span { font-size: 11px; color: var(--muted); display: block; }
.plan-btn { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: var(--ink); color: var(--ink-fg); font-size: 12px; cursor: pointer; }
.billing-banner { background: #7a2a12; }
body.accounts .pop-signout-show { display: flex; }

/* sign in */
.app.auth-mode { grid-template-columns: minmax(0, 1fr); padding: 0; }
.app.auth-mode .side, .app.auth-mode .side-rs, .app.auth-mode .scrim { display: none; }
.app.auth-mode .main { border-radius: 0; }
.auth-view { flex: 1; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.auth-view[hidden] { display: none; }
.auth-card { width: min(420px, 100%); min-height: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 26px; box-shadow: var(--shadow); transition: min-height .24s ease; }
.auth-brand { display: flex; align-items: center; gap: 7px; margin-bottom: 22px; }
.auth-card h1 { margin: 0 0 6px; font: 400 28px/1.15 var(--serif); letter-spacing: -.02em; }
.auth-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.auth-tabs { padding: 0; margin-bottom: 18px; }
.auth-tabs button { flex: 1; }
.auth-form { display: grid; gap: 6px; }
.auth-form label { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.auth-form .ink-btn.wide { width: 100%; height: 42px; font-size: 14.5px; border-radius: 10px; margin-top: 14px; }
.auth-form[hidden] { display: none; }
.auth-card.auth-transition-out > :not(.auth-brand) { animation: auth-out .12s ease both; }
.auth-card.auth-transition-in > :not(.auth-brand) { animation: auth-in .26s cubic-bezier(.2,.75,.2,1) both; }
@keyframes auth-out { to { opacity: 0; transform: translateX(-10px); } }
@keyframes auth-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) { .auth-card, .auth-card.auth-transition-out > :not(.auth-brand), .auth-card.auth-transition-in > :not(.auth-brand) { animation: none; transition: none; } }
.link-btn { border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 8px 0 0; cursor: pointer; justify-self: center; }
.link-btn:hover { color: var(--fg); }
.auth-error { margin: 14px 0 0; padding: 9px 12px; border-radius: 9px; background: color-mix(in srgb, #B3261E 10%, transparent); color: #B3261E; font-size: 13px; }
.auth-note { margin: 14px 0 0; padding: 9px 12px; border-radius: 9px; background: var(--soft); color: var(--muted); font-size: 13px; }
.auth-error[hidden], .auth-note[hidden] { display: none; }

/* dialogs */
.modal-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(20,20,18,.45); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); overflow-y: auto; }
.modal-back[hidden] { display: none; }
.modal-card { position: relative; width: min(760px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); max-height: calc(100vh - 40px); overflow-y: auto; }
.modal-card h2 { margin: 0 0 6px; font: 400 26px/1.15 var(--serif); letter-spacing: -.02em; }
.modal-card p { color: var(--muted); font-size: 14px; line-height: 1.55; margin: 0 0 16px; }
.modal-x { position: absolute; top: 12px; right: 12px; }
.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.plan-opt { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; align-content: start; }
.plan-opt.rec { border-color: var(--fg); }
.plan-opt h3 { margin: 0; font: 500 16px var(--sans); display: flex; gap: 8px; align-items: center; }
.plan-opt .price { font: 400 28px/1 var(--serif); } .plan-opt .price small { font: 12px var(--sans); color: var(--muted); }
.plan-opt ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); display: grid; gap: 5px; }
.plan-opt .ink-btn, .plan-opt .outline-btn { width: 100%; height: 38px; justify-content: center; }
.price-compare-scroll { width:100%; overflow-x:auto; }
.price-compare { min-width:670px; border:1px solid var(--line); border-radius:14px; background:var(--card); overflow:hidden; }
.price-compare-head, .price-compare-row { display:grid; grid-template-columns:minmax(165px,1.25fr) repeat(3,minmax(125px,1fr)); align-items:stretch; }
.price-compare-head { padding:14px 14px 12px; gap:8px; background:var(--soft); }
.price-compare-label { color:var(--muted); font-size:13px; }
.price-compare-plan { display:grid; gap:8px; justify-items:center; align-content:start; padding:10px 8px; border:1px solid transparent; border-radius:12px; }
.price-compare-plan.recommended { border-color:var(--line); background:var(--card); }
.price-compare-plan.power { border-color:color-mix(in srgb, var(--fg) 35%, var(--line)); background:color-mix(in srgb, var(--fg) 90%, var(--card)); color:var(--card); }
.price-compare-plan strong { font-size:15px; }
.price-compare-plan > span { font-size:18px; }
.price-compare-plan small { margin-left:3px; color:var(--muted); font-size:11px; }
.price-compare-plan.power small { color:inherit; opacity:.7; }
.price-compare-plan button { width:100%; min-height:32px; padding:5px 7px; justify-content:center; font-size:12px; }
.price-compare-plan.power .outline-btn { border-color:rgba(255,255,255,.35); background:var(--card); color:var(--fg); }
.price-compare-dash { color:var(--muted); }
.price-compare-row { min-height:44px; padding:10px 18px; border-top:1px solid var(--line); text-align:center; font-size:13px; }
.price-compare-row > div { display:grid; align-content:center; }
.price-compare-row .price-compare-label { text-align:left; }
.price-compare-foot { margin:0; padding:12px 18px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.price-compare.in-modal { min-width:700px; }
.price-compare.in-modal .price-compare-label { font-size:12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .settings-in { grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto; row-gap:12px; }
  .settings-in > .projects-title { grid-column:1; grid-row:1; margin-bottom:0; }
  .settings-nav { grid-column:1; grid-row:2; }
  .settings-main { grid-column:1; grid-row:3; padding-top:0; }
  .settings-nav { display: flex; overflow-x: auto; position: static; gap: 2px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
  .settings-nav button { flex: none; height: 34px; padding: 0 12px; }
  .bl-upsell { flex-direction: column; } .bl-cta { justify-items: start; }
  .plans-grid { grid-template-columns: minmax(0, 1fr); }
  .auth-card { padding: 24px 20px 20px; }
}
#acct-body { display: grid; gap: 18px; }

.plug-banner { background: #FFF4E5; color: #6b4300; align-items: flex-start; line-height: 1.45; }
.plug-banner button { margin-left: 0; white-space: nowrap; font-weight: 500; }
.plug-banner span { flex: 1; }

.pv-play { margin-top: 14px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--ink); color: var(--ink-fg); display: inline-grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.18); transition: transform .15s ease; }
.pv-play:hover { transform: scale(1.06); }
.pv-play[hidden] { display: none; }
.pv-play .i { width: 24px; height: 24px; }

.pthumb { overflow: hidden; }
.pthumb .pshot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: var(--card); }
.pthumb .pver { z-index: 1; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--card) 85%, transparent); opacity: 1; }

.recent li { position: relative; display: flex; align-items: center; }
.recent li .r-open { flex: 1; min-width: 0; padding-right: 28px; }
.recent .r-pin { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--faint); opacity: 0; cursor: pointer; padding: 0; }
.recent .r-pin .i { width: 13px; height: 13px; }
.recent li:hover .r-pin, .recent .r-pin:focus-visible, .recent li.pinned .r-pin { opacity: 1; }
.recent li.pinned .r-pin { color: var(--fg); }
.recent li.pinned .r-pin .i { fill: currentColor; }
.recent .r-pin:hover { background: var(--line); color: var(--fg); }

/* ---------- Tabs above the preview, tool panels, Domains ---------- */
.rtabs { display: flex; align-items: center; gap: 4px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; flex: none; }
.rtab { display: flex; align-items: center; border: 1px solid transparent; border-radius: 9px; color: var(--muted); }
.rtab.on { background: var(--soft); border-color: var(--line); color: var(--fg); }
.rtab:not(.on):hover { background: var(--soft); }
.rtab-open { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 0; background: transparent; color: inherit; font-size: 13px; white-space: nowrap; border-radius: 9px; }
.rtab-open .i { width: 15px; height: 15px; }
.rtab-x { display: grid; place-items: center; width: 22px; height: 22px; margin-right: 5px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); padding: 0; }
.rtab-x .i { width: 13px; height: 13px; }
.rtab-x:hover { background: var(--line); color: var(--fg); }
.rtab-add { width: 30px; height: 30px; flex: none; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 19px; line-height: 1; }
.rtab-add:hover { background: var(--soft); color: var(--fg); }
.rtool { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 28px; }
.rtool[hidden] { display: none; }
#rtool-new { max-width: 640px; width: 100%; margin: 0 auto; padding-top: 28px; }
.rtool-list { display: grid; gap: 2px; margin-top: 14px; }
.rtool-item { display: flex; align-items: center; gap: 14px; text-align: left; border: 0; border-radius: 10px; background: transparent; padding: 10px 12px; color: var(--fg); }
.rtool-item:hover, .rtool-item:focus-visible { background: var(--soft); }
.rtool-item b { display: block; font-weight: 500; font-size: 14px; }
.rtool-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.rtool-ic { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.rtool-ic .i { width: 18px; height: 18px; }
.dom { max-width: 720px; display: grid; gap: 16px; }
.dom h2 { margin: 0; font: 500 22px/1.2 var(--serif); }
.dom-sub { margin: -10px 0 0; }
.dom-card { padding: 18px 20px; display: grid; gap: 12px; }
.dom-card h3 { margin: 0; font: 500 15px/1.3 var(--sans); }
.dom-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dom-actions { display: flex; gap: 8px; }
.dom-actions button[disabled], .dom-form button[disabled] { opacity: .5; cursor: not-allowed; }
.dom-url { font-size: 15px; font-weight: 500; color: var(--fg); }
a.dom-url[href] { text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dom-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dom-addr { flex: 1; min-width: 200px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--card); padding-right: 10px; }
.dom-addr input { flex: 1; min-width: 0; height: 36px; border: 0; background: transparent; padding: 0 10px; font: inherit; font-size: 13px; color: var(--fg); outline: none; }
.dom-addr:focus-within { border-color: var(--line-strong); }
.dom-addr span { color: var(--muted); font-size: 13px; }
.dom-note, .dom-msg { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--soft); font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.dom-item { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.dom-recs { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; font-size: 12px; }
.dom-rec { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; padding: 8px 10px; background: var(--card); align-items: center; }
.dom-rec-h { background: var(--soft); color: var(--muted); }
.dom-rec code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.dom-val { cursor: copy; }

.rshell { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; overflow: hidden; }
.rshell[hidden] { display: none; }
.rshell-bar { display: flex; align-items: center; gap: 8px; flex: none; }
.rshell-spacer { flex: 1; }
.rshell-state { font-size: 12px; color: var(--muted); }
.rshell-note { font-size: 12px; color: var(--muted); line-height: 1.5; padding: 8px 10px; background: var(--soft); border-radius: 9px; flex: none; }
.rshell-term { flex: 1; min-height: 0; background: #161614; border-radius: 10px; padding: 8px 6px 4px 10px; overflow: hidden; }
.rshell-term .xterm { height: 100%; }

/* ---------- Admin panel and support ---------- */
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.adm-tile { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 14px 16px; display: grid; gap: 4px; }
.adm-tile b { font: 500 24px/1.1 var(--serif); }
.adm-tile span { font-size: 12px; color: var(--muted); }
.adm-bars { display: flex; align-items: flex-end; gap: 3px; height: 90px; padding: 8px 22px 18px; }
.adm-bars i { flex: 1; min-height: 2px; background: var(--ink); border-radius: 2px 2px 0 0; opacity: .75; }
.adm-chip { display: inline-block; font-style: normal; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); }
.adm-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.adm-bar input[type=search], .adm-bar select, .adm-ctl select, .adm-inline input, .acct-form select { height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); padding: 0 10px; font-size: 13px; color: var(--fg); }
.acct-form select { width: 100%; height: 38px; }
.adm-bar input[type=search] { flex: 1; min-width: 180px; }
.adm-table { padding: 0; }
.adm-row { display: grid; grid-template-columns: 52px minmax(0, 2.2fr) minmax(0, 1.6fr) 120px minmax(0, 1fr) 150px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 18px; border: 0; border-top: 1px solid var(--line); background: transparent; font-size: 13px; color: var(--fg); }
.adm-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.adm-row { cursor: pointer; } button.adm-row:hover { background: var(--soft); }
.adm-h { color: var(--muted); font-size: 12px; border-top: 0; }
.adm-row.adm-c { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.8fr) 80px 80px 90px 150px; }
.adm-row.adm-t { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 150px minmax(0, 1.6fr); }
.adm-row.adm-a { grid-template-columns: 150px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 2fr); }
.adm-row.adm-a > span { white-space: normal; }
.adm-row.adm-s2 { grid-template-columns: 52px minmax(0, 3fr) 110px 150px; }
.adm-row code { font-size: 11px; color: var(--muted); }
.adm-st { font-style: normal; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); text-transform: capitalize; }
.adm-st.open { background: color-mix(in srgb, #D9822B 18%, var(--card)); } .adm-st.solved { background: color-mix(in srgb, #3C9A5F 18%, var(--card)); } .adm-st.pending { background: color-mix(in srgb, #4C7BD9 15%, var(--card)); }
.adm-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #D9822B; }
.adm-detail { padding: 18px 22px 20px; display: grid; gap: 14px; margin-top: 4px; }
.adm-detail h4 { margin: 4px 0 -6px; font: 500 14px var(--sans); }
.adm-dh { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.adm-ctl { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-thread { display: grid; gap: 10px; }
.adm-msg { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--card); }
.adm-msg.customer { background: var(--soft); }
.adm-msg.note { background: color-mix(in srgb, #E5B93C 16%, var(--card)); border-style: dashed; }
.adm-msg.system { background: transparent; color: var(--muted); font-size: 12px; }
.adm-mh { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.adm-mh b { color: var(--fg); font-weight: 500; }
.adm-mt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.adm-reply textarea, .adm-detail textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); padding: 10px 12px; font: 14px var(--sans); resize: vertical; }
.adm-inline { display: flex; gap: 8px; flex-wrap: wrap; } .adm-inline input { flex: 1; min-width: 140px; }
.adm-consent { border-top: 1px solid var(--line); padding-top: 12px; }
.adm-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.adm-file { border: 1px solid var(--line); background: var(--soft); border-radius: 7px; padding: 3px 9px; font: 12px ui-monospace, Menlo, monospace; cursor: pointer; }
.adm-code { max-height: 340px; overflow: auto; background: #161614; color: #ecebe6; border-radius: 10px; padding: 12px; font: 12px/1.5 ui-monospace, Menlo, monospace; white-space: pre; }
.adm-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.adm-steps code, .sp-note code { font: 12px ui-monospace, Menlo, monospace; background: var(--soft); padding: 1px 6px; border-radius: 5px; }
@media (max-width: 860px) { .adm-row, .adm-row.adm-c, .adm-row.adm-t, .adm-row.adm-a, .adm-row.adm-s2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .adm-h { display: none; } }

.adm-warn { padding: 11px 14px; border-radius: 10px; background: color-mix(in srgb, #D9822B 16%, var(--card)); border: 1px solid color-mix(in srgb, #D9822B 35%, var(--line)); font-size: 13px; line-height: 1.5; margin-bottom: 14px; }
.adm-warn code { font: 12px ui-monospace, Menlo, monospace; }

.admin-body { display: flex; flex-direction: column; min-height: 100vh; height: 100vh; }
.admin-root { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.admin-root > .view { flex: 1; }
.adm-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); }
.adm-top-r { display: flex; align-items: center; gap: 12px; }
.admin-root .open-side { display: none; }

.dom-log summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
.dom-log .adm-code { max-height: 260px; margin-top: 6px; white-space: pre-wrap; }

/* ---------- usage charts and meters ---------- */
.u-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart { margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 14px 16px 10px; display: grid; gap: 8px; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; color: var(--muted); }
.chart figcaption b { color: var(--fg); font-weight: 500; font-size: 15px; } .chart figcaption small { color: var(--muted); font-weight: 400; font-size: 11px; }
.chart svg { width: 100%; height: 130px; display: block; overflow: visible; }
.ch-bar { fill: var(--fg); opacity: .78; } .ch-hit { fill: transparent; } .ch-hit:hover + .ch-bar, .ch-bar:hover { opacity: 1; }
.ch-base { stroke: var(--line-strong, var(--line)); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-x { fill: var(--muted); font-size: 10.5px; }
.ch-empty, .ch-note { margin: 0; font-size: 12px; color: var(--muted); }
.ch-table summary { cursor: pointer; font-size: 11.5px; color: var(--muted); }
.ch-table table, .u-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ch-table th, .ch-table td, .u-table th, .u-table td { text-align: left; padding: 6px 4px; border-top: 1px solid var(--line); } .u-table th { color: var(--muted); font-weight: 400; border-top: 0; } .u-table th, .u-table td { padding: 10px 18px; }
.chart-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--ink-fg); font-size: 12px; padding: 5px 9px; border-radius: 7px; white-space: nowrap; }
.chart-tip[hidden] { display: none; }
.u-limits { padding: 6px 22px; } .u-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13.5px; } .u-row:first-child { border-top: 0; }
.u-meter { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); } .u-meter em { font-style: normal; }
.u-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; border: 1px solid var(--line); } .u-bar i { display: block; height: 100%; background: var(--fg); opacity: .8; border-radius: 99px; } .u-bar i.near { background: #D9822B; opacity: 1; } .u-bar i.full { background: #B3261E; opacity: 1; }
.u-recent { list-style: none; margin: 0; padding: 6px 22px; } .u-recent li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 160px; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; } .u-recent li:first-child { border-top: 0; } .u-recent time { color: var(--muted); font-size: 12px; text-align: right; }
.adm-row.u-apps { grid-template-columns: minmax(0, 1.4fr) 150px 80px 90px 80px; } .adm-row.u-proj { grid-template-columns: minmax(0, 1.6fr) 80px 90px minmax(0, 1.2fr); }
.adm-tile small { color: var(--muted); font-size: 11px; }
@media (max-width: 860px) { .u-row { grid-template-columns: 1fr; gap: 6px; } .u-recent li { grid-template-columns: 1fr auto; } .u-recent time { display: none; } }
.adm-row.u-adm-apps { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.4fr) 90px 150px 80px 140px; } .adm-row.u-adm-top { grid-template-columns: minmax(0, 1.8fr) 80px 90px 90px 70px 90px; }
.ch-plot { position: relative; } .ch-peak { position: absolute; right: 0; top: -2px; font-size: 10.5px; color: var(--muted); } .ch-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-top: 4px; } .chart svg { height: 110px; margin-top: 12px; }

/* the card's menu must not be clipped by the card */
.pcard { overflow: visible; }
.pcard .pthumb { border-radius: 11px 11px 0 0; }
.pcard:has(.pop:not([hidden])) { z-index: 20; }
.pcard .pop { min-width: 200px; } .pcard .pop-item { white-space: nowrap; }

/* ---- Storage and Secrets tabs ---- */
.stor-kind { display: flex; gap: 8px; flex-wrap: wrap; }
.stor-kind .outline-btn.on { background: var(--soft); border-color: var(--fg); }
.stor-parts { display: grid; gap: 4px; margin: 10px 0 4px; }
.stor-parts > div, .stor-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.stor-files { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stor-file { padding: 7px 10px; border-bottom: 1px solid var(--line); }
.stor-file:last-child { border-bottom: 0; }
.stor-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stor-act { display: flex; gap: 6px; }
.stor-act .outline-btn { height: 26px; padding: 0 9px; font-size: 11.5px; display: inline-flex; align-items: center; text-decoration: none; }

/* ---- announcement card ---- */
.ann { z-index: 70; width: 320px; max-width: calc(100vw - 24px); box-sizing: border-box; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 12px 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .14); }
.ann:not(.ann-static) { position: fixed; animation: ann-in .25s ease-out; }
.ann-bottom-right { right: 20px; bottom: 20px; } .ann-bottom-left { left: 20px; bottom: 20px; } .ann-top-right { right: 20px; top: 20px; } .ann-top-left { left: 20px; top: 20px; }
.ann-center { left: 50%; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .28), 0 12px 40px rgba(0, 0, 0, .2); }
.ann-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; margin-bottom: 12px; background: var(--soft); }
.ann-title { margin: 0 4px 4px; font: 500 20px var(--serif, Georgia, serif); color: var(--fg); }
.ann-text { margin: 0 4px 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.ann-watch, .ann-hide { display: flex; align-items: center; justify-content: center; width: 100%; height: 42px; border-radius: 10px; font: 500 14px var(--sans); text-decoration: none; cursor: pointer; box-sizing: border-box; }
.ann-watch { background: var(--fg); color: var(--bg, #fff); border: 1px solid var(--fg); margin-bottom: 8px; }
.ann-hide { background: transparent; color: var(--fg); border: 1px solid var(--line-strong, var(--line)); }
@keyframes ann-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ann-center:not(.ann-static) { animation: none; }
@media (prefers-reduced-motion: reduce) { .ann:not(.ann-static) { animation: none; } }
.ann-form { display: grid; gap: 8px; max-width: 520px; }
.ann-form label { font-size: 12.5px; color: var(--muted); }
.ann-form textarea { min-height: 64px; }
.ann-prev { margin-top: 14px; display: flex; justify-content: flex-start; padding: 16px; background: var(--soft); border-radius: 12px; }
.ann-form .toggle-line { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--fg); }
.ann-form input[type="checkbox"] { width: auto; height: auto; flex: none; }

/* ---- setup alert next to the profile (hover or focus for the full message) ---- */
.cred-alert { display: contents; }
.cred-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); z-index: 5; }
.cred-btn { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: #b45309; cursor: help; padding: 0; }
.cred-btn .i { width: 14px; height: 14px; }
.cred-btn:hover, .cred-btn:focus-visible { background: var(--soft); }
.cred-tip { display: none; position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 80; box-sizing: border-box; padding: 12px 14px; background: var(--card); border: 1px solid var(--line-strong, var(--line)); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, .16); font-size: 12.5px; line-height: 1.5; color: var(--fg); text-align: left; }
.cred-tip strong { display: block; margin-bottom: 4px; font-size: 13px; }
.cred-tip span { color: var(--muted); }
.cred-tip code { font-size: 11.5px; background: var(--soft); border-radius: 5px; padding: 1px 4px; }
.cred-alert:hover .cred-tip, .cred-alert:focus-within .cred-tip { display: block; }
.cred-alert[hidden] { display: none; }
.app.closed .cred-alert { display: none; }
.account-btn { padding-right: 40px; }

/* ---- Publish menu for web apps ---- */
.pubw-addr { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pubw-url { font: 500 13px var(--mono, monospace); color: var(--fg); word-break: break-all; text-decoration: none; }
a.pubw-url[href]:hover { text-decoration: underline; }
.pubw-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pubw-open { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; text-decoration: none; }
.pubw-links { display: flex; gap: 14px; margin-top: 10px; }
.linklike { border: 0; background: transparent; padding: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; }
.linklike:hover { color: var(--fg); }
.pubw-wp { margin-top: 10px; display: grid; gap: 6px; }
.pubw-cred { font-size: 12px; display: grid; gap: 3px; }
.pubw-cred span { display: inline-block; width: 64px; color: var(--muted); }
.pubw-cred code { font: 12px var(--mono, monospace); background: var(--soft); border-radius: 5px; padding: 1px 5px; word-break: break-all; }

/* ---- GitHub ---- */
.gh-card-box { width: min(560px, 100%); }
.gh-who { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.gh-who img { border-radius: 50%; }
.gh-who b { display: block; }
.gh-filter { width: 100%; box-sizing: border-box; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); padding: 0 10px; font: inherit; font-size: 13px; color: var(--fg); margin-bottom: 8px; }
.gh-repos { display: grid; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.gh-repos button { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 9px 12px; color: var(--fg); }
.gh-repos button:last-child { border-bottom: 0; }
.gh-repos button:hover { background: var(--soft); }
.gh-repos small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.gh-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.acct-form .toggle-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--fg); }
.acct-form .toggle-line input[type="checkbox"] { width: auto; height: auto; flex: none; margin: 0; }
.dep-job { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; background: var(--soft); }
.dep-job.error { border-color: #d9a3a3; }
.dep-job.ready { border-color: #9cc9ab; }
.dep-job pre { max-height: 220px; overflow: auto; margin: 8px 0 0; font-size: 11.5px; white-space: pre-wrap; }
.gh-repos button.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--fg); }

/* ---- the AI agents options, shown on the Integrations page ---- */
.int-agents { margin: 18px 0 8px; display: grid; gap: 14px; }
.int-agents-head { display: flex; align-items: center; justify-content: space-between; }
.int-agents-head h2 { margin: 0; font: 400 22px/1.2 var(--serif); letter-spacing: -.01em; }

/* ---------- what to do with the attached images ---------- */
.image-intent { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 2px 0; }
.image-intent .ask { font-size: 12px; color: var(--muted); margin-right: 2px; }
.image-intent .opt { position: relative; height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 859px; background: var(--card); color: var(--ink, inherit); font-size: 12.5px; cursor: pointer; }
.image-intent .opt:hover { background: var(--soft); }
.image-intent .opt[aria-checked="true"] { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.image-intent .opt:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.image-intent .opt::after { content: attr(data-hint); position: absolute; left: 0; bottom: calc(100% + 8px); width: 230px; padding: 8px 10px; border-radius: 9px; background: #1d1d1b; color: #fff; font-size: 12px; line-height: 1.4; text-align: left; white-space: normal; pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity .12s, transform .12s; z-index: 20; }
.image-intent .opt:hover::after, .image-intent .opt:focus-visible::after { opacity: 1; transform: none; }
.image-intent.need { animation: intent-nudge .35s; }
.image-intent.need .ask { color: var(--blue); font-weight: 600; }
@keyframes intent-nudge { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .image-intent.need { animation: none; } }

/* ---------- Agency workspace and client portal ---------- */
.agency-in { max-width: 1020px; }
.agency-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:20px; margin:22px 0 24px; }
.agency-heading .projects-title { margin:0; }
.agency-sub { margin:5px 0 0; color:var(--muted); font-size:13px; }
.eyebrow { color:var(--faint); font-size:10px; font-weight:600; letter-spacing:.12em; margin-bottom:5px; }
.agency-portal-link { color:var(--agency-accent,var(--muted)); text-decoration:none; font-size:12px; padding:7px 10px; border:1px solid var(--line); border-radius:8px; }
.agency-portal-link:hover { background:var(--soft); }
.agency-tabs { display:flex; gap:5px; border-bottom:1px solid var(--line); margin-bottom:18px; }
.agency-tabs button { position:relative; border:0; background:none; color:var(--muted); padding:9px 12px 11px; font-size:12.5px; }
.agency-tabs button[aria-selected="true"] { color:var(--fg); font-weight:600; }
.agency-tabs button[aria-selected="true"]::after { content:""; position:absolute; bottom:-1px; left:10px; right:10px; height:2px; border-radius:2px; background:var(--agency-accent,var(--fg)); }
.agency-panel { padding-bottom:32px; }
.agency-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; margin:0 0 27px; }
.agency-stats article,.agency-lead,.agency-client-card,.agency-settings-card { background:var(--card); border:1px solid var(--line); border-radius:12px; }
.agency-stats article { display:grid; gap:3px; padding:13px 15px; }
.agency-stats article span,.agency-stats article small { color:var(--muted); font-size:11.5px; }
.agency-stats article b { font-size:22px; font-weight:500; letter-spacing:-.03em; }
.agency-section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.agency-section-head h2,.agency-settings-card h2 { margin:0; font:500 18px/1.3 var(--sans); }
.agency-section-head p,.agency-settings-card>p { color:var(--muted); margin:3px 0 0; font-size:12px; }
.agency-actions { display:flex; gap:7px; }
.agency-leads,.agency-client-list { display:grid; gap:8px; }
.agency-lead { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto auto; gap:10px; align-items:center; padding:12px 14px; }
.agency-lead-title { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.agency-lead-title b,.agency-client-info>b { font-size:13px; font-weight:600; }
.agency-lead-title span,.agency-lead-meta,.agency-lead-main>p { color:var(--muted); font-size:11.5px; }
.agency-lead-meta { display:flex; flex-wrap:wrap; gap:4px; margin-top:3px; }
.agency-lead-meta a { color:inherit; text-decoration:none; }
.agency-lead-main>p { margin:5px 0 0; }
.agency-due { color:var(--warn); font-weight:600; }
.agency-lead-value { text-align:right; min-width:82px; }
.agency-lead-value b,.agency-client-price b { display:block; font-size:12.5px; font-weight:600; }
.agency-lead-value small,.agency-client-price span { color:var(--muted); font-size:10.5px; }
.agency-lead select,.agency-form input,.agency-form textarea,.agency-form select,.agency-settings-form input,.portal-login input,.portal-shell input { min-width:0; width:100%; border:1px solid var(--line); border-radius:7px; background:var(--bg); padding:7px 9px; font-size:12px; }
.agency-lead select { width:auto; min-width:98px; }
.agency-lead .outline-btn,.agency-actions .outline-btn,.agency-actions .ink-btn,.agency-client-card .outline-btn { white-space:nowrap; font-size:11.5px; min-height:31px; padding:0 10px; }
.agency-empty { text-align:center; padding:48px 20px; border:1px dashed var(--line-strong); border-radius:12px; }
.agency-empty>span { display:grid; place-items:center; width:35px; height:35px; margin:0 auto 10px; border-radius:10px; background:var(--soft); color:var(--agency-accent,var(--muted)); font-size:18px; }
.agency-empty h3 { margin:0; font-size:14px; font-weight:600; }
.agency-empty p { margin:5px auto 14px; max-width:340px; color:var(--muted); font-size:12px; }
.agency-client-card { display:flex; align-items:center; gap:12px; padding:12px 14px; }
.agency-client-avatar,.agency-preview-logo { display:grid; place-items:center; flex:none; width:36px; height:36px; border-radius:10px; color:#fff; background:var(--agency-accent,#687363); font-weight:600; }
.agency-client-info { min-width:0; display:grid; flex:1; gap:2px; }
.agency-client-info span,.agency-client-info small { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:11.5px; }
.agency-client-price { min-width:90px; text-align:right; }
.agency-settings-card { max-width:660px; padding:20px; }
.agency-settings-card>p { margin:4px 0 20px; }
.agency-settings-form { display:grid; gap:13px; }
.agency-settings-form label,.agency-form label,.portal-login label,.portal-shell label { display:grid; gap:5px; font-size:11.5px; font-weight:500; }
.agency-settings-form input[type=color] { width:54px; height:34px; padding:3px; }
.agency-settings-form input[type=number] { max-width:140px; }
.agency-settings-form small,.agency-form label small { color:var(--muted); font-size:10.5px; font-weight:400; }
.agency-settings-form .ink-btn { justify-self:start; margin-top:4px; }
.agency-preview { display:flex; gap:10px; align-items:center; padding-top:18px; margin-top:20px; border-top:1px solid var(--line); }
.agency-preview>div:last-child { display:grid; gap:2px; font-size:12px; }
.agency-preview span { color:var(--muted); font-size:10.5px; }
.agency-dialog { width:min(590px,calc(100% - 24px)); max-height:calc(100% - 24px); overflow-y:auto; border:1px solid var(--line); border-radius:15px; padding:22px; color:var(--fg); background:var(--panel); box-shadow:var(--shadow); }
.agency-dialog::backdrop { background:rgba(20,20,18,.38); backdrop-filter:blur(2px); }
.agency-dialog-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:15px; }
.agency-dialog-head h2 { margin:0; font:500 21px/1.2 var(--sans); }
.agency-form>p,.agency-dialog>p { margin:0 0 15px; color:var(--muted); font-size:12px; }
.agency-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.agency-form .span-two { grid-column:1/-1; }
.agency-form textarea { resize:vertical; }
.agency-form select[multiple] { height:88px; }
.agency-form-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:18px; }
.agency-dialog>label { display:grid; gap:5px; margin:10px 0; font-size:11px; font-weight:600; }
.agency-dialog>label input { width:100%; min-width:0; border:1px solid var(--line); background:var(--bg); color:var(--fg); border-radius:7px; padding:8px 9px; font-size:12px; }
.agency-error { color:var(--warn); }
.app.client-portal-mode { grid-template-columns:minmax(0,1fr); padding:0; }
.app.client-portal-mode .side,.app.client-portal-mode .side-rs,.app.client-portal-mode .scrim { display:none; }
.app.client-portal-mode .main { border:0; border-radius:0; }
.client-portal { min-height:100%; background:var(--bg); }
.portal-login { display:grid; gap:12px; width:min(370px,calc(100% - 36px)); margin:10vh auto; padding:26px; border:1px solid var(--line); border-radius:16px; background:var(--card); box-shadow:var(--shadow); }
.portal-login .agency-preview-logo { margin-bottom:2px; }
.portal-login h1 { margin:0; font:400 26px/1.2 var(--serif); }
.portal-login>p { color:var(--muted); font-size:12px; margin:0; }
.portal-login form { display:grid; gap:12px; margin-top:6px; }
.portal-shell { min-height:100vh; }
.portal-shell>header { height:58px; display:flex; align-items:center; gap:10px; padding:0 max(24px,calc((100% - 900px)/2)); border-bottom:1px solid var(--line); background:var(--panel); }
.portal-shell>header .agency-preview-logo { width:30px; height:30px; border-radius:8px; }
.portal-shell>header .link-btn { margin-left:auto; }
.portal-shell>main { max-width:900px; margin:46px auto; padding:0 22px 40px; }
.portal-shell h1 { margin:0; font:400 32px/1.2 var(--serif); }
.portal-shell main>p { margin:7px 0 22px; color:var(--muted); }
.portal-sites { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin-bottom:22px; }
.portal-sites article { display:grid; gap:9px; padding:17px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.portal-sites h2 { margin:0; font-size:15px; font-weight:500; }
.portal-sites p,.portal-sites .hint { margin:0; color:var(--muted); font-size:12px; }
.portal-sites .ink-btn { justify-self:start; text-decoration:none; }
.portal-state { color:var(--agency-accent); font-size:10.5px; }
.portal-shell .agency-settings-card { margin-top:20px; }
@media (max-width:720px) {
  .agency-stats { grid-template-columns:1fr; gap:7px; }
  .agency-stats article { grid-template-columns:1fr auto; align-items:center; }
  .agency-stats article small { grid-column:1/-1; }
  .agency-section-head { align-items:flex-start; flex-direction:column; }
  .agency-lead { grid-template-columns:1fr auto; gap:8px; }
  .agency-lead-value { grid-column:2; grid-row:1; }
  .agency-lead select { grid-column:1; grid-row:2; }
  .agency-lead .outline-btn { grid-column:2; grid-row:2; }
  .agency-client-card { flex-wrap:wrap; }
  .agency-client-price { margin-left:auto; }
  .agency-client-card .outline-btn { margin-left:auto; }
  .agency-form-grid { grid-template-columns:1fr; }
  .agency-form .span-two { grid-column:auto; }
  .agency-heading { margin-top:14px; }
  .portal-shell>main { margin:32px auto; }
}
.project-scope select { height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--fg); padding: 0 28px 0 10px; font: 12px var(--sans); }
.agency-project-list { display: grid; gap: 10px; }
.agency-project-card { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px 18px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.agency-project-card b,.agency-project-card span { display:block; }
.agency-project-card span { margin-top:4px; color:var(--muted); font-size:12px; }
.agency-project-card > div:last-child { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.agency-back { padding:0; margin:0 0 7px; }
@media (max-width:700px) { .agency-project-card { align-items:flex-start; flex-direction:column; } .agency-project-card > div:last-child { justify-content:flex-start; } }

.agency-compose { width:min(690px,100%); }
.agency-compose-close { position:absolute; top:14px; right:14px; font-size:22px; }
.agency-compose .build-types { margin:18px 0; }
.agency-compose .composer { margin-top:0; }

.composer-more-wrap { position:relative; }
.composer-more { min-width:170px; }
.composer-more .pop-item { white-space:nowrap; }
.agency-compose-note { margin-left: 3px; font-size: 12px; }
@media (max-width: 560px) { .agency-compose-note { display: none; } }

.agency-password-row { display:flex; gap:8px; align-items:center; }
.agency-password-row input { min-width:0; flex:1; }
.agency-password-row .outline-btn { flex:none; white-space:nowrap; }

.portal-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:24px 0 30px; }
.portal-stats article { border:1px solid var(--line); border-radius:12px; padding:16px; background:var(--card); }
.portal-stats span,.portal-stats small { display:block; color:var(--muted); }
.portal-stats b { display:block; margin:5px 0; font-size:25px; }
.portal-stats b.portal-email { font-size:15px; overflow-wrap:anywhere; }
.portal-section > div:first-child h2 { margin-bottom:2px; }
.portal-section > div:first-child p { margin-top:0; color:var(--muted); }
@media (max-width:700px) { .portal-stats { grid-template-columns:1fr; } }

.agency-client-more { position:relative; }
.agency-client-more .icon-btn { border:1px solid var(--line); }
.agency-client-more .pop { min-width:172px; }

/* ---------- model picker ---------- */
.model-pick { position: relative; display: inline-flex; }
.model-pick .pop.up { left: auto; right: 0; width: 270px; }
button.model-label { border: 0; background: transparent; cursor: pointer; padding: 4px 6px; border-radius: 7px; text-transform: none; }
button.model-label:hover, button.model-label[aria-expanded="true"] { background: var(--soft); color: var(--muted); }
button.model-label::after { content: ' \25BE'; font-size: 9px; }
.model-pick .pop-opt b { font-weight: 600; font-size: 13px; }

/* ---------- bot traps ---------- */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.cf-slot:empty { display: none; }
.cf-slot { margin: 6px 0 2px; min-height: 65px; }

/* ---------- confirm-your-email banner ---------- */
.verify-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 12px; max-width: min(640px, calc(100vw - 24px)); padding: 9px 10px 9px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow); font-size: 13px; line-height: 1.4; }
.verify-banner[hidden] { display: none; }
.verify-banner button { flex: none; height: 28px; padding: 0 12px; border: 1px solid var(--line-strong, var(--line)); border-radius: 8px; background: var(--soft); cursor: pointer; font-size: 12.5px; }
.verify-banner button:disabled { opacity: .6; cursor: default; }

/* ---------- which AI pays ---------- */
.ai-source { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.ai-source select { max-width: 560px; }
#buy-ai { text-decoration: none; display: inline-flex; width: fit-content; }

/* ---------- branding card ---------- */
.brand-pick { display: grid; gap: 4px; }
.bp-row { display: flex; gap: 8px; align-items: center; }
.bp-row input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.bp-row input[data-key] { width: 210px; font-family: var(--mono); }
.bp-preview { display: flex; gap: 14px; align-items: center; padding: 12px 0 2px; }
.bp-link { color: var(--blue); font-weight: 500; }

/* ---------- a connected agent is in use ---------- */
.agent-live { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin-bottom: 6px; border-radius: 9px; background: var(--blue-soft); color: var(--blue); font-size: 12.5px; }
.agent-live[hidden] { display: none; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: pulse-dot 1.1s ease-in-out infinite; flex: none; }
@keyframes pulse-dot { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
button.model-label.connected { color: var(--ok); }
button.model-label.connected::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--ok); vertical-align: 1px; }
button.model-label.working::before { animation: pulse-dot 1.1s ease-in-out infinite; }
.conn-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--ok); }
.pop-head { padding: 8px 8.5px 3px; font-size: 11px; letter-spacing: .02em; color: var(--faint); text-transform: uppercase; }
