/* Cloud Pavilion — console prototype styles */
:root {
  --ink-0: #07090d;
  --ink-1: #0b0f14;
  --ink-2: #11161d;
  --ink-3: #18202a;
  --ink-4: #222c38;
  --line: #1f2833;
  --line-2: #2a3542;
  --paper: #f5f3ee;
  --text: #e9e6df;
  --text-2: #a7adb6;
  --text-3: #6d7682;
  --canopy: #ff5a36;      /* brand: the lit column */
  --canopy-2: #ff7a5c;
  --canopy-ink: #2a0f08;
  --sky: #8cc8ff;
  --ok: #3ddc97;
  --warn: #ffb020;
  --bad: #ff4d6a;
  --idle: #6d7682;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 10px 30px rgba(0,0,0,.35), 0 1px 0 rgba(255,255,255,.03) inset;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink-1);
  color: var(--text);
  font: 14px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
::selection { background: color-mix(in srgb, var(--canopy) 35%, transparent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 10px; border: 2px solid var(--ink-1); }

/* ---------- shell: the frame (sidebar, header, the content surface) is console/frame.css ---------- */
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand svg { width: 28px; height: 28px; }
.brand .word { font-weight: 600; letter-spacing: -.01em; font-size: 15px; }
.brand .word span { color: var(--text-3); font-weight: 500; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; width: 320px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; color: var(--text-3); cursor: text;
}
.search kbd, kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--text-2); background: var(--ink-1); }
.search kbd { margin-left: auto; }
.iconbtn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--ink-2); border: 1px solid var(--line); position: relative; }
.iconbtn svg { width: 17px; height: 17px; }
.iconbtn .ping { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--canopy); color: var(--canopy-ink); font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--ink-1); }
.avatars { display: flex; }
.avatars span { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--ink-1); margin-left: -8px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #111; }
.view { flex: 1; overflow: auto; min-height: 0; }
.page { padding: 26px 28px 60px; max-width: 1400px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.1; letter-spacing: -.02em; margin: 0; font-weight: 600; }
.page-head h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: var(--canopy-2); letter-spacing: 0; }
.page-head p { margin: 6px 0 0; color: var(--text-2); max-width: 680px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }

.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--control); background: var(--ink-3); font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--line-3); }
.btn svg { width: 16px; height: 16px; }
/* White text needs the deeper orange: 5.1:1 (the bright canopy gives 3.1:1). */
.btn.primary { background: var(--canopy-fill); border-color: var(--canopy-fill); color: var(--on-fill); box-shadow: 0 6px 20px color-mix(in srgb, var(--canopy) 25%, transparent); }
.btn.primary:hover { background: var(--canopy-fill-2); border-color: var(--canopy-fill-2); }
.btn.ghost { background: transparent; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ok); }
.btn.bad { background: transparent; border-color: color-mix(in srgb, var(--bad) 35%, transparent); color: var(--bad-2); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { height: 30px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.chip.on { background: var(--paper); color: var(--ink-1); border-color: var(--paper); font-weight: 600; }
.chip .n { color: var(--text-3); }
.chip.on .n { color: color-mix(in srgb, var(--ink-1) 55%, var(--paper)); }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 22px; }
.stat { background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--text-3); font-size: 12px; }
.stat .v { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.stat .v small { font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing: 0; }

/* ---------- state pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 9px 2px 7px; border-radius: 20px; border: 1px solid; white-space: nowrap; }
.pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.working { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.pill.working i { animation: pulse 1.4s infinite; }
.pill.needs { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.pill.needs i { animation: pulse 1s infinite; }
.pill.idle { color: var(--text-2); border-color: var(--line-2); }
.pill.idle i { background: var(--idle); }
.pill.asleep { color: var(--text-3); border-color: var(--line); }
.pill.asleep i { background: transparent; border: 1.5px solid var(--text-3); }
.pill.waking { color: var(--sky); border-color: color-mix(in srgb, var(--sky) 35%, transparent); background: color-mix(in srgb, var(--sky) 7%, transparent); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* ---------- agent grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s; position: relative; }
.card:hover { border-color: var(--line-3); transform: translateY(-2px); }
.card.needs { border-color: color-mix(in srgb, var(--warn) 45%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 6%, transparent); }
.card .thumb { height: 196px; position: relative; overflow: hidden; background: #0d1218; border-bottom: 1px solid var(--line); }
.card .thumb .scaler { position: absolute; left: 0; top: 0; width: 1280px; height: 760px; transform-origin: 0 0; pointer-events: none; }
.card .thumb.asleep .scaler { filter: grayscale(1) brightness(.35); }
.card .thumb .sleepmask { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); font-size: 12px; gap: 6px; }
.card .thumb .sleepmask svg { width: 22px; height: 22px; opacity: .7; }
.card .body { padding: 12px 14px 14px; }
.card .row { display: flex; align-items: center; gap: 8px; }
.card .name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.card .task { color: var(--text-2); font-size: 13px; margin: 6px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 38px; }
.card .meta { display: flex; gap: 12px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.card .meta svg { width: 13px; height: 13px; }
.brainbadge { margin-left: auto; font-size: 11px; font-family: var(--mono); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; }
.card .ask { position: absolute; left: 10px; right: 10px; top: 10px; background: color-mix(in srgb, var(--ink-1) 92%, var(--warn)); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 10px; padding: 8px 10px; font-size: 12.5px; display: flex; gap: 8px; align-items: center; backdrop-filter: blur(6px); }
.card .ask b { color: var(--warn); font-weight: 600; }
.card.new { display: grid; place-items: center; min-height: 300px; border-style: dashed; background: transparent; color: var(--text-2); text-align: center; }
.card.new .plus { width: 46px; height: 46px; border-radius: 14px; background: var(--ink-3); display: grid; place-items: center; margin: 0 auto 10px; border: 1px solid var(--line-2); }
.card.new .plus svg { width: 22px; height: 22px; }

/* ---------- desktop (shared by thumb + agent view) ---------- */
.desk { position: absolute; inset: 0; overflow: hidden; background:
  radial-gradient(1200px 600px at 80% -10%, color-mix(in srgb, var(--canopy) 18%, transparent), transparent 60%),
  radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--sky) 14%, transparent), transparent 60%),
  linear-gradient(180deg, #121925, #0b0f14); }
.desk .menubar { height: 26px; background: rgba(8,10,14,.75); display: flex; align-items: center; gap: 16px; padding: 0 12px; font-size: 12px; color: #cfd3da; backdrop-filter: blur(10px); }
.desk .menubar .r { margin-left: auto; display: flex; gap: 14px; color: #9aa3ad; font-family: var(--mono); font-size: 11.5px; }
.win { position: absolute; background: #0f141b; border: 1px solid #2a3542; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,.5); overflow: hidden; display: flex; flex-direction: column; }
.win.focus { border-color: #44546a; box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px rgba(255,90,54,.25); }
.win .tb { height: 30px; flex: none; display: flex; align-items: center; gap: 7px; padding: 0 10px; background: #151c25; border-bottom: 1px solid #222c38; font-size: 12px; color: #aab2bd; cursor: grab; user-select: none; }
.win .tb .dots { display: flex; gap: 6px; margin-right: 6px; }
.win .tb .dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a4552; }
.win .tb .dots i:nth-child(1) { background: #ff5f57; } .win .tb .dots i:nth-child(2) { background: #febc2e; } .win .tb .dots i:nth-child(3) { background: #28c840; }
.win .tb .t { flex: 1; text-align: center; margin-right: 50px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win .wc { flex: 1; min-height: 0; overflow: hidden; position: relative; }
.term { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; color: #cdd6e0; padding: 10px 12px; height: 100%; overflow: auto; background: #0a0e13; }
.term .p { color: var(--ok); } .term .d { color: #6d7682; } .term .y { color: var(--warn); } .term .c { color: var(--canopy-2); } .term .s { color: var(--sky); }
.term .cursor { display: inline-block; width: 7px; height: 14px; background: #cdd6e0; vertical-align: -2px; animation: pulse 1s steps(1) infinite; }
.term input { background: transparent; border: 0; outline: 0; color: #e9e6df; font-family: var(--mono); font-size: 12.5px; width: 70%; }
.browser .url { height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 10px; background: #121821; border-bottom: 1px solid #222c38; }
.browser .url .bar { flex: 1; background: #0a0e13; border: 1px solid #222c38; border-radius: 7px; height: 22px; font-family: var(--mono); font-size: 11.5px; color: #9aa3ad; display: flex; align-items: center; padding: 0 8px; gap: 6px; }
.browser .url .bar .lock { color: var(--ok); }
.site { padding: 26px 30px; background: #f5f3ee; color: #111; height: calc(100% - 32px); overflow: hidden; }
.site h2 { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1; margin: 18px 0 10px; letter-spacing: -.01em; }
.site .nav2 { display: flex; gap: 16px; font-size: 12px; color: #555; align-items: center; }
.site .nav2 b { color: #111; margin-right: auto; }
.site .cta { display: inline-block; margin-top: 12px; background: #111; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 12px; }
.site .cards3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 22px; }
.site .cards3 div { height: 80px; border-radius: 10px; background: #e6e2d9; }
.editor { display: grid; grid-template-columns: 170px 1fr; height: 100%; font-family: var(--mono); font-size: 12px; }
.editor .tree { background: #0c1117; border-right: 1px solid #1f2833; padding: 8px 0; color: #8e98a4; }
.editor .tree div { padding: 2px 12px; white-space: nowrap; }
.editor .tree .on { background: #18202a; color: #e9e6df; }
.editor .code { padding: 10px 14px; color: #cdd6e0; line-height: 1.6; white-space: pre; overflow: hidden; }
.code .k { color: #ff8a65; } .code .s { color: #a5e3b5; } .code .f { color: var(--sky); } .code .cm { color: #5d6773; }
.sheet { padding: 0; height: 100%; background: #0d1218; font-size: 12px; }
.sheet table { border-collapse: collapse; width: 100%; }
.sheet td, .sheet th { border: 1px solid #1f2833; padding: 5px 8px; text-align: left; white-space: nowrap; }
.sheet th { background: #121821; color: #8e98a4; font-weight: 500; }
.chart { padding: 14px; height: 100%; background: #0d1218; }
.dock { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; padding: 7px 9px; background: rgba(15,20,27,.7); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; backdrop-filter: blur(14px); }
.dock .app { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; position: relative; border: 0; }
.dock .app.run::after { content: ""; position: absolute; bottom: -5px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: #cfd3da; }
.dock .app svg { width: 20px; height: 20px; }
.dock .sep { width: 1px; background: rgba(255,255,255,.1); margin: 4px 2px; }

/* ---------- agent view ---------- */
.agentview { display: grid; grid-template-columns: 1fr 360px; height: 100%; min-height: 0; }
.agentview .stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.agentbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.agentbar .ttl { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.agentbar .sub { color: var(--text-3); font-size: 12.5px; display: flex; gap: 12px; }
.agentbar .sp { flex: 1; }
.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; padding: 10px 12px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs button.on { color: var(--text); border-bottom-color: var(--canopy); }
.screenwrap { flex: 1; min-height: 0; padding: 16px; display: flex; }
.screen { flex: 1; position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line-2); background: #000; }
.screen .ctl { position: absolute; top: 34px; right: 10px; z-index: var(--z-float); display: flex; gap: 6px; }
.screen .ctl .tag { font-size: 11.5px; font-family: var(--mono); padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.12); color: #cfd3da; display: flex; gap: 6px; align-items: center; }
.screen .ctl .tag.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }
.screen.control { box-shadow: 0 0 0 2px var(--canopy); }
.winstrip { display: flex; gap: 8px; padding: 0 16px 14px; overflow-x: auto; flex: none; }
.winstrip button { display: flex; align-items: center; gap: 8px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.winstrip button.on { border-color: var(--line-2); color: var(--text); background: var(--ink-3); }
.winstrip .ico { font-size: 14px; }

.side { display: flex; flex-direction: column; min-height: 0; background: var(--ink-0); }
.side h3 { margin: 0; font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 16px 16px 8px; }
.feed { flex: 1; overflow: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.ev { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 13px; color: var(--text-2); }
.ev .ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--ink-3); font-size: 11px; }
.ev .ic svg { width: 13px; height: 13px; }
.ev b { color: var(--text); font-weight: 600; }
.ev time { display: block; color: var(--text-3); font-size: 11.5px; font-family: var(--mono); }
.ev.msg .bubble { background: var(--ink-3); border: 1px solid var(--line); padding: 8px 10px; border-radius: 10px; color: var(--text); }
.ev.me .bubble { background: color-mix(in srgb, var(--canopy) 10%, transparent); border-color: color-mix(in srgb, var(--canopy) 30%, transparent); }
.approval { background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 9%, transparent), color-mix(in srgb, var(--warn) 3%, transparent)); border: 1px solid color-mix(in srgb, var(--warn) 38%, transparent); border-radius: 12px; padding: 12px; }
.approval .h { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--warn); font-weight: 600; }
.approval .q { margin: 8px 0; color: var(--text); font-size: 13.5px; }
.approval pre { margin: 8px 0; background: var(--ink-0); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; color: var(--text); white-space: pre-wrap; word-break: break-all; }
.approval .why { color: var(--text-3); font-size: 12px; }
.approval .acts { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.approval.done { border-color: var(--line); background: var(--ink-2); opacity: .75; }
.composer { border-top: 1px solid var(--line); padding: 12px; }
.composer .box { background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; }
.composer textarea { width: 100%; background: transparent; border: 0; outline: 0; resize: none; height: 44px; color: var(--text); }
.composer .row { display: flex; gap: 6px; align-items: center; }
.composer .row .sp { flex: 1; }

/* ---------- lists / tables ---------- */
.panel { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 18px; }
.panel .ph { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel .ph h2 { margin: 0; font-size: 15px; font-weight: 600; }
.panel .ph p { margin: 0; color: var(--text-3); font-size: 12.5px; }
.panel .ph .sp { flex: 1; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; color: var(--text-3); font-size: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td b { color: var(--text); font-weight: 600; }
.tag2 { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--ink-3); border: 1px solid var(--line-2); color: var(--text-2); font-family: var(--mono); white-space: nowrap; }
.tag2.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.tag2.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.tag2.c { color: var(--canopy-2); border-color: color-mix(in srgb, var(--canopy) 30%, transparent); }
.masked { font-family: var(--mono); letter-spacing: .1em; color: var(--text-3); }
.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: start; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { background: var(--ink-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.tile .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; font-weight: 700; }
.tile h4 { margin: 2px 0 0; font-size: 14.5px; }
.tile p { margin: 0; color: var(--text-2); font-size: 13px; flex: 1; }
.tile .foot { display: flex; align-items: center; gap: 8px; }
.tile.soon { opacity: .6; }
.codeblock { background: var(--ink-0); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--code-text); white-space: pre; overflow: auto; margin: 0; }

/* gate diagram */
.gate { display: grid; grid-template-columns: 1fr auto 1.1fr auto 1fr; align-items: center; gap: 10px; padding: 22px 16px; }
.gate .box { border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; background: var(--ink-1); }
.gate .box h5 { margin: 0 0 6px; font-size: 13px; }
.gate .box p { margin: 0; font-size: 12px; color: var(--text-3); }
.gate .box.mid { border-color: color-mix(in srgb, var(--canopy) 50%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--canopy) 10%, transparent), color-mix(in srgb, var(--canopy) 2%, transparent)); }
.gate .arrow { color: var(--text-3); font-family: var(--mono); font-size: 12px; text-align: center; }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); z-index: var(--z-dialog); display: flex; }
.drawer { margin-left: auto; width: 440px; height: 100%; background: var(--ink-1); border-left: 1px solid var(--line-2); display: flex; flex-direction: column; animation: slidein .2s ease-out; }
.drawer .dh { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer .dh h2 { margin: 0; font-size: 16px; }
.drawer .db { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0 } }
.modal { margin: auto; width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow: auto; background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.98); opacity: 0 } }
.modal .mh { padding: 20px 22px 0; display: flex; align-items: center; gap: 12px; }
.modal .mh h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.modal .mb { padding: 18px 22px; }
.modal .mf { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.steps { display: flex; gap: 6px; padding: 14px 22px 0; }
.steps span { flex: 1; height: 3px; border-radius: 3px; background: var(--ink-4); }
.steps span.on { background: var(--canopy); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.field input[type=text], .field select, .field textarea { width: 100%; background: var(--ink-2); border: 1px solid var(--control); border-radius: 9px; padding: 9px 11px; outline: 0; }
.field input:focus, .field textarea:focus { border-color: var(--canopy); }
.opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opts.two-c { grid-template-columns: repeat(2, 1fr); }
.opt { text-align: left; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.opt:hover { border-color: var(--line-3); }
.opt.on { border-color: var(--canopy); background: color-mix(in srgb, var(--canopy) 6%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--canopy) 12%, transparent); }
.opt .oi { font-size: 20px; }
.opt b { font-size: 14px; }
.opt span { color: var(--text-3); font-size: 12.5px; }
.note { font-size: 12.5px; color: var(--text-2); background: var(--ink-2); border: 1px solid var(--line); border-left: 3px solid var(--sky); border-radius: 8px; padding: 10px 12px; }
.note.warn { border-left-color: var(--warn); }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.check input { margin-top: 3px; accent-color: var(--canopy); }
.check span { color: var(--text-3); display: block; font-size: 12px; }

.palette { margin: 10vh auto auto; width: min(620px, calc(100vw - 32px)); background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; animation: pop .15s ease-out; }
.palette input { width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 16px; outline: 0; }
.palette .res { max-height: 380px; overflow: auto; padding: 6px; }
.palette .it { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.palette .it.on, .palette .it:hover { background: var(--ink-3); color: var(--text); }
.palette .it .k { margin-left: auto; color: var(--text-3); font-size: 12px; }
.palette .grp { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px 4px; }

.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 10px; z-index: var(--z-toast); }
.toast { width: 360px; background: var(--ink-2); border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: var(--elev-2); display: flex; gap: 10px; animation: cp-toast-in var(--dur-3) var(--ease-emph); }
.toast.warn { box-shadow: inset 2px 0 0 var(--warn), var(--elev-2); }
.toast .ti { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); flex: none; }
.toast .ti svg { width: 16px; height: 16px; }
.toast b { display: block; font-size: 13.5px; }
.toast p { margin: 2px 0 8px; color: var(--text-2); font-size: 12.5px; }

/* ---------- entry (key generation) ---------- */
/* The page scrolls at every size: a centred grid over a fixed box clipped whatever didn't fit (the lower half of
   "Create a pavilion" at 1280×800, tour r4). Flex with auto margins centres when there is room and starts at the top when
   there isn't, so nothing is pushed above the fold. */
.entry { position: fixed; inset: 0; z-index: var(--z-entry); display: flex; overflow-y: auto; overscroll-behavior: contain; padding: 40px 0; box-sizing: border-box; background:
  radial-gradient(900px 500px at 70% 0%, color-mix(in srgb, var(--canopy) 22%, transparent), transparent 65%),
  radial-gradient(900px 600px at 0% 100%, color-mix(in srgb, var(--sky) 12%, transparent), transparent 60%), var(--ink-0); }
.entry .inner { width: min(560px, calc(100% - 32px)); margin: auto; flex: none; text-align: center; }
.entry .mark { width: 84px; height: 84px; margin: 0 auto 22px; }
.entry .mark .col2 { animation: wake 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes wake { 0%,100% { opacity: 1 } 50% { opacity: .45 } }
.entry h1 { font-size: 44px; line-height: 1.02; letter-spacing: -.03em; margin: 0; font-weight: 600; }
.entry h1 em { font-family: var(--serif); font-weight: 400; color: var(--canopy-2); }
.entry p.lede { color: var(--text-2); font-size: 16px; margin: 14px auto 26px; max-width: 470px; }
.keybox { text-align: left; background: color-mix(in srgb, var(--ink-1) 80%, transparent); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; color: var(--text-2); min-height: 132px; }
.keybox .l { display: flex; gap: 10px; padding: 3px 0; }
.keybox .l .ok { color: var(--ok); }
.keybox .fp { color: var(--paper); letter-spacing: .04em; }
.entry .acts { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.entry .fine { color: var(--text-3); font-size: 12px; margin-top: 16px; }

.empty { color: var(--text-3); text-align: center; padding: 40px 10px; font-size: 13px; }
.hide { display: none !important; }

@media (max-width: 1100px) {
  .agentview { grid-template-columns: 1fr; }
  .agentview .side { display: none; }
  .two, .three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 780px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  .search { width: auto; flex: 1; }
  .page { padding: 18px 16px 50px; }
  .opts { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; }
}
.field label.check { display: flex; margin: 0; }
