/* Wisps portal. Dark dashboard shell; colors are tokens so an operator's
   theme can be matched by changing them in one place. */
:root {
  --bg: #0b0b0c; --panel: #141415; --panel2: #18181a; --line: #262628; --line2: #2f2f32;
  --text: #ededee; --muted: #a1a1a6; --dim: #6e6e74;
  --accent: #3b4cf5; --accent-soft: #151838; --accent-text: #8d97ff; --accent-bg: #1c2160;
  --green: #3ecf8e; --amber: #f5b544; --red: #f2555a;
  --side-w: 276px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
code { font-size: 12.5px; color: #fff; }
.icon { flex: none; }
h1 { font-size: 38px; font-weight: 600; letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
h1.h1-sm { font-size: 32px; }
h2 { font-size: 22px; font-weight: 600; margin: 0; }
h3 { margin: 0; font-size: 18px; font-weight: 600; }
h4 { margin: 0 0 12px; font-size: 15px; font-weight: 600; display: flex; gap: 10px; align-items: center; }
.muted { color: var(--muted); } .dim { color: var(--dim); } .small { font-size: 13px; } .strong { font-weight: 600; }
.right { text-align: right; } .inline { display: inline-flex; gap: 8px; align-items: center; }

/* ---- shell ---- */
.top { height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.brand-logo { height: 26px; width: auto; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; }
.hdr-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hdr-btn { border: 1px solid var(--line2); border-radius: 999px; padding: 6px 14px; background: #121213; display: inline-flex; gap: 8px; align-items: center; }
.hdr-btn.primary { background: var(--accent-bg); border-color: var(--accent); border-radius: 8px; }
.menu-btn { display: none; color: var(--muted); }
.shell { display: flex; min-height: calc(100vh - 56px); }
.side { width: var(--side-w); flex: none; border-right: 1px solid var(--line); padding: 18px 16px; display: flex; flex-direction: column; gap: 2px; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
kbd { font-size: 11px; font-family: inherit; color: var(--dim); }
.nav { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: #d7d7da; font-size: 15px; width: 100%; text-align: left; }
a.nav:hover, button.nav:hover { background: #18181a; }
.nav.on { background: #1c1c1f; color: #fff; }
.nav .grow { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav .icon { color: #bdbdc2; }
.nav.accent, .nav.accent .icon { color: var(--accent-text); }
.nav-chev { color: var(--dim); display: flex; }
.count { font: 12px ui-monospace, monospace; color: var(--dim); }
.sep { height: 1px; background: var(--line); margin: 10px 0; }
.sec { font-size: 12px; color: var(--dim); padding: 6px 10px; }
.sub { margin: 2px 0 6px 21px; border-left: 1px solid var(--line2); padding-left: 10px; display: flex; flex-direction: column; gap: 1px; }
.sub .nav { font-size: 14px; padding: 7px 10px; color: var(--muted); }
.sub .nav.on { color: #fff; }
.side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.usage { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.usage i { flex: 1; height: 5px; border-radius: 9px; background: #2a2a2d; position: relative; }
.usage i::after { content: ""; position: absolute; inset: 0 96% 0 0; background: var(--accent); border-radius: 9px; }
.me { display: flex; gap: 10px; align-items: center; color: #d7d7da; padding: 0 6px; }
.av { width: 28px; height: 28px; border-radius: 50%; background: #222; display: grid; place-items: center; font-size: 11px; color: var(--muted); }

/* Menus and features that are not part of Wisps or not built yet. */
.is-disabled { opacity: .45; cursor: not-allowed; }
.is-disabled:hover { background: transparent !important; }
.soon { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--amber); border: 1px solid #5a4417; background: #2a2010; border-radius: 5px; padding: 1px 6px; vertical-align: 1px; }

main { flex: 1; min-width: 0; padding: 22px 40px 64px; }
.preview { border: 1px dashed #4a4f9a; color: #b9bdf5; background: #121430; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 18px; }

/* ---- common ---- */
.badge { font-size: 12px; font-weight: 600; background: var(--accent); color: #fff; border-radius: 5px; padding: 2px 7px; white-space: nowrap; }
.badge.outline { background: #171a3d; border: 1px solid var(--accent); color: var(--accent-text); font-size: 11px; padding: 1px 6px; }
.badge.lg { font-size: 14px; padding: 2px 8px; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.head-id { display: flex; gap: 16px; align-items: center; }
.lede { color: var(--muted); font-size: 17px; margin: 8px 0 22px; }
.lede.tight { margin: 4px 0 0; font-size: 15px; }
.h2sub { color: var(--muted); margin: 4px 0 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.card.pad { padding: 20px 22px; }
.btn { border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px; padding: 9px 14px; display: inline-flex; gap: 8px; align-items: center; font-weight: 500; white-space: nowrap; }
.btn:hover:not(.is-disabled):not(:disabled) { border-color: #45454a; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 6px 11px; font-size: 13px; }
.btn.danger { color: #ff9a9d; }
.btn.danger-solid { background: #b3262b; border-color: #b3262b; color: #fff; }
.link { color: var(--accent-text); font-weight: 500; display: inline-flex; gap: 6px; align-items: center; }
.link.plain { color: #c8c8cc; }
.link.muted { color: var(--dim); font-weight: 400; }
.link.small { font-size: 13px; }
.link:hover:not(.is-disabled) { text-decoration: underline; }
.icon-btn { color: var(--dim); display: inline-grid; place-items: center; padding: 3px; border-radius: 5px; }
.icon-btn:hover { color: #fff; background: #222; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 3px; font-size: 13px; color: var(--muted); gap: 2px; }
.seg span, .seg button { padding: 4px 10px; border-radius: 5px; }
.seg .on { background: #222225; color: #fff; }
.seg + h2 { margin-top: 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip { border: 1px solid var(--line2); border-radius: 99px; padding: 5px 12px 5px 6px; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; }
.plogo { --c: #888; width: 40px; height: 40px; border-radius: 9px; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); display: grid; place-items: center; font-weight: 700; font-size: 17px; flex: none; }
.plogo.xs { width: 18px; height: 18px; font-size: 9px; border-radius: 5px; }
.plogo.sm { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }
.plogo.md { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
.plogo.lg { width: 44px; height: 44px; font-size: 19px; border-radius: 10px; }
.plogo.xl { width: 52px; height: 52px; font-size: 22px; border-radius: 12px; }
.vlogo { --c: #888; width: 18px; height: 18px; border-radius: 5px; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); flex: none; display: inline-block; }
.vlogo.none { --c: #6e6e74; }
.st { display: inline-flex; gap: 7px; align-items: center; font-size: 14px; font-weight: 500; white-space: nowrap; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); }
.st-running i { background: var(--green); }
.st-starting i, .st-stopping i { background: var(--amber); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.empty { padding: 44px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty h3 { color: #fff; margin-top: 6px; }
.empty p { margin: 0 0 8px; }
.placeholder { padding: 36px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.placeholder.inner { padding: 18px; background: #121214; }
.placeholder p { margin: 0; }
.secthead { display: flex; justify-content: space-between; align-items: flex-end; margin: 34px 0 14px; }
.strip { margin-top: 16px; padding: 16px 22px; display: flex; align-items: center; gap: 30px; flex-wrap: wrap; color: #d7d7da; }
.strip > span { display: inline-flex; gap: 9px; align-items: center; }
.strip > span .icon, .strip > .icon { color: var(--green); }
.push { margin-left: auto; }

/* ---- labs ---- */
.lab { display: flex; gap: 20px; padding: 28px 30px; margin-bottom: 20px; }
.lab.hl { border-color: #3a44c8; box-shadow: 0 0 0 1px #3a44c8 inset; }
.lab-ic { width: 56px; height: 56px; border-radius: 9px; background: #23288a; display: grid; place-items: center; color: #9aa3ff; flex: none; }
.lab-body { flex: 1; min-width: 0; }
.lab-body h3 { font-size: 20px; display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.lab-body p { margin: 0; color: #c8c8cc; font-size: 16px; }
.lab-body small { display: block; color: var(--dim); margin-top: 14px; font-size: 14px; }
.lab-links { margin-top: 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.lab-act { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex: none; }
.toggle { display: flex; gap: 12px; align-items: center; font-weight: 500; }
.sw { width: 44px; height: 26px; border-radius: 99px; background: #3a3a3d; position: relative; display: inline-block; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #e8e8ea; transition: left .15s; }
.sw.on { background: var(--accent); }
.sw.on::after { left: 21px; background: #fff; }

/* ---- overview ---- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tile { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; }
.tile-name { font-size: 16px; font-weight: 600; }
.tile p { margin: 0; }
.ready { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: #c8c8cc; }
.ready li { display: flex; gap: 7px; align-items: center; }
.ready .icon { color: var(--green); }
.tile-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--dim); font-size: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
td { padding: 14px 20px; border-bottom: 1px solid var(--line); color: #d7d7da; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td a.strong:hover { text-decoration: underline; }

/* ---- sandbox ---- */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin: 22px 0 20px; color: var(--muted); font-size: 15px; overflow-x: auto; }
.tabs a { padding: 10px 0; white-space: nowrap; }
.tabs a.on { color: #fff; border-bottom: 2px solid #fff; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.side-cards { display: flex; flex-direction: column; gap: 16px; }
.side-cards p { margin: 0 0 10px; }
.checks { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 9px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks .icon { color: var(--green); }
.checks li.na { opacity: .45; }
.term { background: #0a0a0b; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: #d6d6da; min-height: 380px; overflow-x: auto; position: relative; }
.term > div:not(.term-note) { white-space: pre; }
.term-empty { display: grid; place-items: center; color: var(--dim); white-space: normal; font-family: inherit; }
.t-prompt { color: var(--green); } .t-dim { color: var(--dim); } .t-green { color: var(--green); }
.cursor { background: #d6d6da; animation: pulse 1.1s steps(1) infinite; }
.term-note { position: absolute; left: 16px; right: 16px; bottom: 12px; color: var(--dim); font: 12px Inter, system-ui, sans-serif; white-space: normal; display: flex; gap: 6px; align-items: center; }
.row-kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }

/* ---- claude ---- */
.claude { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: -10px; }
.select, .input { width: 100%; border: 1px solid var(--line2); background: var(--panel2); border-radius: 8px; padding: 10px 12px; }
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.seg-btns { align-self: flex-start; }
.step { display: flex; flex-direction: column; gap: 8px; }
.code { background: #0e0e10; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: flex-start; }
.code pre { margin: 0; flex: 1; font-size: 12.5px; line-height: 1.6; color: #d6d6da; white-space: pre-wrap; word-break: break-all; }
.examples { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.examples p { margin: 7px 0 0; }
.foot-row { display: flex; justify-content: space-between; align-items: center; }

/* ---- vaults ---- */
.vault-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.vault { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.vault-top { display: flex; gap: 10px; align-items: center; width: 100%; }
.vault-top .st { margin-left: auto; font-size: 13px; }
.vault p { margin: 0; }
.vault .row-kv { width: 100%; }

/* ---- overlays ---- */
.scrim { position: fixed; inset: 0; background: #000a; z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: #111113; border-left: 1px solid var(--line2); display: flex; flex-direction: column; z-index: 21; }
.drawer header, .drawer footer { padding: 18px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.drawer header { border-bottom: 1px solid var(--line); }
.drawer footer { border-top: 1px solid var(--line); }
.drawer-body { padding: 20px 24px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 24px; }
.lstep h4 { font-size: 15px; }
.num { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; font-size: 12px; }
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
.opt { border: 1px solid var(--line2); border-radius: 9px; padding: 10px 12px; background: #161618; display: flex; gap: 10px; align-items: center; text-align: left; }
.opt.col { flex-direction: column; align-items: flex-start; gap: 2px; }
.opt b { display: block; font-size: 14px; }
.opt span span, .opt.col span { display: block; color: var(--dim); font-size: 12px; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt.ghost { border-style: dashed; }
.opt:hover:not(.on) { border-color: #45454a; }
.hint { color: var(--dim); font-size: 12px; margin: 8px 0 0; display: flex; gap: 6px; align-items: center; }
.summary { padding: 14px 16px; display: flex; gap: 12px; align-items: center; background: #141416; }
.row { display: flex; gap: 10px; }
.row.end { justify-content: flex-end; }
.modal { position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100% - 32px)); background: #151517; border: 1px solid var(--line2); border-radius: 12px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal p { margin: 0; }
.scrim.top { z-index: 30; }
.setup { border: 1px dashed var(--line2); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.err { color: #ff9a9d; font-size: 13px; min-height: 1em; margin: -6px 0 0; }
#toasts { position: fixed; right: 20px; top: 70px; display: flex; flex-direction: column; gap: 10px; z-index: 40; }
.toast { background: #1b1b1e; border: 1px solid var(--line2); border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; width: min(380px, calc(100vw - 40px)); box-shadow: 0 10px 40px #000a; }
.toast b { display: block; }
.toast span { color: var(--muted); font-size: 13px; }
.toast a { color: var(--accent-text); }
.toast-ic { width: 22px; height: 22px; border-radius: 50%; background: #0f3b28; color: var(--green); display: grid; place-items: center; flex: none; }
.toast.err .toast-ic { background: #3b1213; color: var(--red); }

/* ---- narrow screens ---- */
@media (max-width: 1200px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .detail { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .hdr-actions { display: none; }
  .side { position: fixed; top: 56px; bottom: 0; left: 0; background: var(--bg); z-index: 10; transform: translateX(-100%); transition: transform .2s; overflow-y: auto; }
  body.menu-open .side { transform: none; }
  main { padding: 18px 16px 48px; }
  h1 { font-size: 30px; }
  .tiles, .vault-grid, .opts.two, .opts.three { grid-template-columns: 1fr; }
  .lab { flex-direction: column; padding: 22px; }
  .lab-act { align-items: flex-start; }
}
