@import "tailwindcss/theme.css" layer(theme);
@import "tailwindcss/utilities.css" layer(utilities);

/* madarX design tokens — warm sand/cream glass palette + shadcn-compatible vars */
@theme {
  --color-background: #f6f3ed;
  --color-foreground: #111318;
  --color-card: #ffffff;
  --color-card-foreground: #111318;
  --color-popover: #ffffff;
  --color-popover-foreground: #111318;
  --color-primary: #111318;
  --color-primary-foreground: #ffffff;
  --color-secondary: #f1ece0;
  --color-secondary-foreground: #3f3a30;
  --color-muted: #ece8e0;
  --color-muted-foreground: #68707b;
  --color-accent: #c2452a;
  --color-accent-foreground: #ffffff;
  --color-destructive: #b91c1c;
  --color-destructive-foreground: #ffffff;
  --color-border: rgba(17,19,24,0.10);
  --color-input: rgba(17,19,24,0.10);
  --color-ring: rgba(17,19,24,0.32);
  --color-sand-50: #faf7f0;
  --color-sand-100: #f5f0e6;
  --color-sand-200: #ece4cf;
  --color-sand-300: #dcd2b3;
  --color-sand-400: #cdb78a;
  --color-bronze-500: #8a6d35; /* legacy — kept for migration, see --accent-500 */
  --color-bronze-600: #6e5527; /* legacy — kept for migration, see --accent-600 */
  --color-mars-500: #c2452a; /* legacy alias — use --accent-500 */
  --color-mars-600: #a83a22; /* legacy alias — use --accent-600 */
  /* Accent scale — Mars Red #C2452A */
  --accent-50:  #fdf2ef;
  --accent-100: #fbe5e0;
  --accent-200: #f5c4ba;
  --accent-300: #ec9a88;
  --accent-400: #de6a53;
  --accent-500: #c2452a;   /* brand mars — primary */
  --accent-600: #a83a22;   /* hover / pressed */
  --accent-700: #7c2b19;   /* dark emphasis */
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root{--ink:#111318;--muted:#68707b;--gold:#d4b77f;--glass:rgba(255,255,255,.78);--line:rgba(20,22,26,.09);--radius:14px;
  /* Marketplace brand tokens — see ai-docs/marketplace-brand.md */
  --mkt-tool-tint:#f3f1ec;
  --mkt-tool-ink:#3a3f47;
  --mkt-skill-tint:#e7f1f9;
  --mkt-skill-ink:#1f6c9f;
  --mkt-bundle-tint: var(--accent-50);    /* #fdf2ef — warm red-tinted cream */
  --mkt-bundle-ink:  var(--accent-700);   /* #7c2b19 — dark mars for readable text */
  /* Reserved for the future Agent Marketplace — declared but unused in Phase 1. */
  --mkt-agent-tint:#edf3ec;
  --mkt-agent-ink:#346538;
  /* Workflow kind — cool slate to read as "process / staged work" without
     stealing the eye from tool brand marks above. */
  --mkt-workflow-tint:#eef0f5;
  --mkt-workflow-ink:#3b4658;
  --mkt-installed:#111318;
  --mkt-accent:var(--accent-500);
  --mkt-divider:rgba(17,19,24,0.06);
  --mkt-divider-strong:rgba(17,19,24,0.09);
}*{box-sizing:border-box}html,body{overflow:hidden;height:100%;}body{margin:0;background:#15161a;color:var(--ink);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.chromeless-page{min-height:100vh;width:100vw;overflow:auto;background:#0F0F11;color:#E8E8E5}.visual-frame{height:100vh;min-height:720px;padding:10px;display:grid;grid-template-columns:80px 440px 1fr;gap:10px;background:#f4f4f3;overflow:hidden}.rail,.chat,.canvas{border:1px solid rgba(20,22,26,.07);background:#ffffff;box-shadow:none}.rail{border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:11px;padding:12px 7px}.logo{width:30px;height:30px;color:#111318;display:block;flex-shrink:0}.rail button{width:32px;height:32px;border:0;border-radius:10px;background:transparent;color:#69707a;cursor:pointer}.rail button.on,.rail button:hover{background:rgba(17,19,24,.08);color:#111318}.rail .ak{margin-top:auto;background:#fff;border:1px solid var(--line);font-size:11px}.chat{border-radius:22px;display:flex;flex-direction:column;overflow:hidden;min-width:0}.chat-top{padding:14px;border-bottom:1px solid rgba(17,19,24,.07);display:flex;gap:10px;align-items:center}.avatar{width:34px;height:34px;border-radius:12px;background:linear-gradient(135deg,#111318,#565d6b);color:#fff;display:grid;place-items:center;font-weight:700}.chat-top b{font-family:var(--font-mono-brand,'IBM Plex Mono',monospace);font-weight:500;letter-spacing:-.02em;}.chat small,.live-row small{display:block;color:var(--muted);font-size:11px}.meta{display:grid;grid-template-columns:1fr 1fr;padding:10px 13px;gap:7px;border-bottom:1px solid var(--line)}.meta span{border-radius:999px;background:#fff;border:1px solid var(--line);padding:7px 9px;font-size:11px;color:#59606b}.feed{flex:1;min-height:0;overflow:auto;padding:13px;display:flex;flex-direction:column;gap:11px}.msg{white-space:pre-wrap;border-radius:16px;padding:11px 12px;font-size:13px;line-height:1.4;background:#f4f5f7;border:1px solid rgba(22,24,28,.06)}.msg.agent{background:#ffffff}.msg.user{margin-left:28px;background:#111318;color:#fff;border-color:rgba(255,255,255,.08)}.msg.user a{color:var(--gold);text-decoration-color:rgba(212,183,127,.45)}.msg.user code{background:rgba(255,255,255,.10);color:#fff;padding:1px 5px;border-radius:5px;font-size:12px}.msg.user pre{background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.08);padding:9px 10px;border-radius:9px;margin:6px 0}.msg.user strong{color:#fff}.chips{display:flex;flex-wrap:wrap;gap:7px;padding:0 13px 12px}.chips button{padding:8px 10px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:12px;color:#515760;cursor:pointer}.composer{padding:12px 12px 12px;border-top:1px solid rgba(17,19,24,.08);display:flex;gap:8px;align-items:flex-end;background:rgba(255,255,255,.85)}.composer textarea{flex:1;border:1px solid rgba(20,22,26,.10);border-radius:14px;padding:11px 12px;background:#fff;min-width:0;resize:none;font-family:inherit;font-size:13px;line-height:1.5;transition:border-color .15s;}.composer textarea:focus{outline:0;border-color:rgba(20,22,26,.28);}.composer button,.actions button,.body>button{border:0;border-radius:14px;padding:10px 12px;background:#111318;color:#fff;font-weight:650;cursor:pointer}.send-btn{align-self:stretch;width:46px;padding:0;display:grid;place-items:center;border-radius:14px;flex-shrink:0;}.send-btn:disabled{opacity:.45;cursor:not-allowed;}.canvas{position:relative;border-radius:22px;overflow:hidden;background:rgba(255,255,255,.16)}.toolbar{position:absolute;top:12px;left:14px;right:14px;height:38px;border-radius:19px;background:rgba(255,255,255,.78);border:1px solid rgba(255,255,255,.8);display:flex;align-items:center;gap:18px;padding:0 14px;color:#4a5059;font-size:12px;z-index:3;box-shadow:0 10px 28px rgba(0,0,0,.10)}.toolbar b{color:#111318}.window{grid-column:span 6;min-height:250px;border-radius:17px;overflow:hidden;background:rgba(255,255,255,.92);border:1px solid rgba(255,255,255,.86);box-shadow:0 18px 48px rgba(32,34,38,.20)}.winbar{height:31px;padding:0 9px;display:flex;align-items:center;gap:7px;background:rgba(246,247,248,.78);border-bottom:1px solid var(--line)}.winbar i{width:10px;height:10px;border-radius:50%;display:inline-block}.winbar i:nth-child(1){background:#ff5f57}.winbar i:nth-child(2){background:#ffbd2e}.winbar i:nth-child(3){background:#28c840}.winbar b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;color:#5e646d}.winbar button{font-size:10px;padding:2px 5px;border:0;border-radius:6px;background:rgba(0,0,0,.05);color:#4d535c}.body{padding:15px}.kicker{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:#7b6747;font-weight:800}.body h3{margin:6px 0 10px;font-size:24px;letter-spacing:-.04em}.body p{color:#666d77}.live-row{display:flex;gap:8px;align-items:center;padding:8px 9px;border-radius:11px;background:#fafbfc;border:1px solid rgba(20,22,26,.06);margin:7px 0;font-size:12px}.live-row span{width:8px;height:8px;border-radius:50%;background:#6ad28a;flex:0 0 auto}.live-row span.warn{background:#f0b656}.live-row p{margin:0;min-width:0}.actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.actions button.secondary{background:#fff;color:#313740;border:1px solid var(--line)}@media(max-width:980px){.visual-frame{height:auto;min-height:100vh;grid-template-columns:64px 1fr}.canvas{grid-column:1/-1;min-height:740px}.chat{min-height:640px}.window{grid-column:span 12}}

/* Fresh-start dashboard: no agent/cron/cards rendered on the main workspace. */
.fresh-frame{background:#f4f4f3}
.visual-frame.frame-chat-hidden{grid-template-columns:64px 1fr;column-gap:22px;transition:grid-template-columns .55s cubic-bezier(.16,1,.3,1),column-gap .55s cubic-bezier(.16,1,.3,1);}
.visual-frame.frame-chat-hidden:has(.rail:hover),.visual-frame.frame-chat-hidden:has(.rail:focus-within){grid-template-columns:218px 1fr;}
.visual-frame.frame-chat-hidden .chat{display:none;}
.chat-restore-bubble{position:fixed;right:24px;bottom:24px;width:54px;height:54px;border-radius:999px;border:1px solid rgba(168,58,34,.55);background:var(--accent-500);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0;z-index:120;box-shadow:0 16px 36px rgba(194,69,42,.36),0 2px 8px rgba(17,19,24,.12),inset 0 1px 0 rgba(255,255,255,.18);transition:transform .18s cubic-bezier(.16,1,.3,1),background .16s,box-shadow .18s,border-color .16s;animation:chatRestoreBubbleIn .32s cubic-bezier(.16,1,.3,1) both;}
.chat-restore-bubble:hover{background:#a83a22;border-color:rgba(168,58,34,.75);box-shadow:0 14px 30px rgba(194,69,42,.40),0 2px 6px rgba(17,19,24,.10),inset 0 1px 0 rgba(255,255,255,.22);transform:translateY(-1px);}
.chat-restore-bubble:active{transform:translateY(0) scale(.97);}
.chat-restore-bubble:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 5px rgba(194,69,42,.55),0 14px 30px rgba(194,69,42,.36);}
.chat-restore-bubble::after{content:'';position:absolute;inset:-4px;border-radius:999px;border:1.5px solid rgba(194,69,42,.55);opacity:0;pointer-events:none;animation:chatRestoreBubblePulse 1.6s ease-out .3s 2;}
.chat-restore-bubble svg{transition:transform .18s cubic-bezier(.16,1,.3,1);animation:chatRestoreBubbleNudge 1.6s ease-in-out .3s 2;}
.chat-restore-bubble:hover svg{transform:translateX(1px);animation:none;}
.chat-restore-bubble:hover::after{animation:none;opacity:0;}
@keyframes chatRestoreBubbleIn{from{opacity:0;transform:translateY(8px) scale(.85);}to{opacity:1;transform:translateY(0) scale(1);}}
@keyframes chatRestoreBubblePulse{0%{opacity:0;transform:scale(.92);}15%{opacity:.6;}70%{opacity:0;transform:scale(1.45);}100%{opacity:0;transform:scale(1.45);}}
@keyframes chatRestoreBubbleNudge{0%,55%,100%{transform:translateX(0);}65%{transform:translateX(2.5px);}75%{transform:translateX(0);}85%{transform:translateX(1.5px);}95%{transform:translateX(0);}}
@media (prefers-reduced-motion:reduce){.chat-restore-bubble,.chat-restore-bubble::after,.chat-restore-bubble svg{animation:none;}}
.send-btn--stop{background:var(--accent-500) !important;color:#fff !important;cursor:pointer !important;animation:sendBtnStopPulse 1.4s ease-in-out infinite;opacity:1 !important;}
.send-btn--stop:hover{background:var(--accent-600) !important;}
@keyframes sendBtnStopPulse{0%,100%{box-shadow:0 0 0 0 rgba(194,69,42,.34);}50%{box-shadow:0 0 0 7px rgba(194,69,42,0);}}
.fresh-canvas{position:relative;border-radius:22px;overflow:hidden;background:#ffffff;}
.fresh-toolbar{position:absolute;top:2px;left:14px;right:14px;height:40px;border-radius:20px;background:linear-gradient(180deg,rgba(255,255,255,.86),rgba(255,255,255,.72));border:1px solid rgba(255,255,255,.85);display:flex;align-items:center;gap:8px;padding:0 8px 0 16px;color:#4a5059;font-size:12px;z-index:20;box-shadow:0 12px 32px rgba(17,19,24,.10),inset 0 1px 0 rgba(255,255,255,.65);}
.fresh-toolbar .tb-wordmark{font-family:var(--font-mono-brand,'IBM Plex Mono',monospace);font-size:13px;font-weight:500;letter-spacing:-.02em;color:#111318;display:inline-flex;align-items:center;gap:9px;line-height:1;}
.fresh-toolbar .tb-wordmark b{color:#C2452A;font-weight:500;}
.fresh-toolbar .tb-wordmark i{font-style:normal;font-size:9.5px;letter-spacing:.20em;text-transform:uppercase;color:#8a8f99;padding-left:9px;border-left:1px solid rgba(17,19,24,.14);font-family:ui-sans-serif,system-ui,sans-serif;font-weight:700;}
.fresh-toolbar .tb-wordmark + *{margin-left:auto;}
.tb-icon-btn{height:28px;min-width:28px;border:1px solid rgba(17,19,24,.08);border-radius:999px;background:rgba(255,255,255,.55);color:#4a5059;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 9px 0 8px;cursor:pointer;transition:background .16s,color .16s,transform .1s,box-shadow .16s,border-color .16s;}
.tb-icon-btn:hover,.tb-icon-btn.on{background:#fff;color:#111318;border-color:rgba(17,19,24,.12);box-shadow:0 4px 14px rgba(17,19,24,.08);}
.tb-icon-btn:active{transform:scale(.97);}
.tb-icon-btn span{min-width:16px;height:16px;border-radius:999px;background:#111318;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:800;line-height:1;padding:0 4px;}
.hermes-wrap{position:relative;display:inline-flex;z-index:60;}
.hermes-wrap:hover,.hermes-wrap:focus-within{z-index:80;}
.hermes-tooltip{position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%) translateY(-6px) scale(.97);transform-origin:top center;min-width:240px;max-width:320px;background:rgba(255,255,255,.97);backdrop-filter:blur(22px) saturate(140%);color:#111318;border:1px solid rgba(17,19,24,.08);border-radius:14px;padding:12px 14px;font-size:12px;line-height:1.4;box-shadow:0 22px 60px rgba(17,19,24,.18),inset 0 1px 0 rgba(255,255,255,.85);opacity:0;pointer-events:none;transition:opacity .16s ease,transform .16s cubic-bezier(.32,.72,0,1);z-index:70;}
.hermes-tooltip::before{content:'';position:absolute;top:-6px;left:50%;width:11px;height:11px;background:rgba(255,255,255,.97);border-left:1px solid rgba(17,19,24,.08);border-top:1px solid rgba(17,19,24,.08);transform:translateX(-50%) rotate(45deg);border-top-left-radius:3px;}
.hermes-wrap:hover .hermes-tooltip,.hermes-wrap:focus-within .hermes-tooltip{opacity:1;transform:translateX(-50%) translateY(0) scale(1);pointer-events:auto;}
.hermes-tooltip b{display:block;font-size:11.5px;font-weight:850;letter-spacing:-.01em;color:#111318;}
.hermes-tooltip small{display:block;color:#68707b;font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;margin-top:2px;}
.hermes-tooltip ul{margin:9px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:5px;}
.hermes-tooltip li{font-size:12px;color:#313740;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;position:relative;padding-left:13px;}
.hermes-tooltip li::before{content:'';position:absolute;left:0;top:50%;width:6px;height:6px;border-radius:50%;background:var(--accent-500);transform:translateY(-50%);box-shadow:0 0 0 2px rgba(194,69,42,.18);}
.runtime-menu-wrap{position:relative;display:flex;align-items:center;z-index:60;}
.runtime-menu-wrap:has(.runtime-menu-btn.on){z-index:80;}
.runtime-menu-btn{height:28px;min-width:28px;border:1px solid rgba(17,19,24,.08);border-radius:999px;background:rgba(255,255,255,.55);color:#4a5059;display:flex;align-items:center;justify-content:center;gap:6px;padding:0 9px 0 8px;cursor:pointer;transition:background .16s,color .16s,transform .1s,box-shadow .16s,border-color .16s;}
.runtime-menu-btn:hover,.runtime-menu-btn.on{background:#fff;color:#111318;border-color:rgba(17,19,24,.12);box-shadow:0 4px 14px rgba(17,19,24,.08);}
.runtime-menu-btn:active{transform:scale(.97);}
.runtime-menu-btn span{min-width:16px;height:16px;border-radius:999px;background:#111318;color:#fff;display:grid;place-items:center;font-size:10px;font-weight:800;line-height:1;padding:0 4px;}
.runtime-popover{position:absolute;top:calc(100% + 10px);right:0;left:auto;width:360px;max-height:520px;overflow:auto;border:1px solid rgba(17,19,24,.08);border-radius:16px;background:rgba(255,255,255,.97);backdrop-filter:blur(22px) saturate(140%);box-shadow:0 22px 60px rgba(17,19,24,.18),inset 0 1px 0 rgba(255,255,255,.85);padding:14px;display:flex;flex-direction:column;gap:12px;color:#111318;z-index:70;transform-origin:top right;animation:tbPopIn .18s cubic-bezier(.32,.72,0,1);}
.runtime-popover::before{content:'';position:absolute;top:-6px;right:14px;width:11px;height:11px;background:rgba(255,255,255,.97);border-left:1px solid rgba(17,19,24,.08);border-top:1px solid rgba(17,19,24,.08);transform:rotate(45deg);border-top-left-radius:3px;}
@keyframes tbPopIn{from{opacity:0;transform:translateY(-6px) scale(.97);}to{opacity:1;transform:translateY(0) scale(1);}}
.runtime-popover-head{display:flex;flex-direction:column;gap:6px;padding:2px 2px 0;}
.runtime-popover-head b{font-size:13px;font-weight:800;letter-spacing:-.01em;}
.runtime-popover-head small{font-size:11.5px;color:#68707b;}
.runtime-quick-links{display:flex;gap:6px;flex-wrap:wrap;margin-top:2px;}.runtime-quick-links a{border:1px solid rgba(17,19,24,.08);border-radius:999px;background:#fff;color:#313740;text-decoration:none;font-size:10.5px;font-weight:850;padding:5px 8px;}.runtime-quick-links a:hover{border-color:rgba(194,69,42,.28);color:#9a3325;box-shadow:0 4px 12px rgba(17,19,24,.07);}
.runtime-stats{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.runtime-stat{border:1px solid rgba(17,19,24,.07);border-radius:12px;background:#f7f8fa;padding:9px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;}
.runtime-stat span{font-size:11px;color:#68707b;}
.runtime-stat b{font-size:17px;font-weight:850;color:#111318;}
.runtime-section{border-top:1px solid rgba(17,19,24,.08);padding-top:10px;display:flex;flex-direction:column;gap:8px;}
.runtime-section-title{font-size:10px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.runtime-row{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;min-width:0;}
.runtime-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#313740;}
.runtime-row b{font-size:11px;color:#68707b;white-space:nowrap;}
.runtime-approval{display:grid;gap:7px;border:1px solid rgba(17,19,24,.07);border-radius:12px;background:#fafbfc;padding:9px;}
.runtime-approval>span{font-size:12px;line-height:1.35;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.runtime-approval>div{display:flex;gap:6px;}
.runtime-approval button{border:0;border-radius:999px;padding:5px 8px;background:#111318;color:#fff;font-size:11px;font-weight:800;cursor:pointer;}
.runtime-approval button.secondary{border:1px solid rgba(17,19,24,.12);background:#fff;color:#111318;}
.runtime-approval button:disabled{opacity:.45;cursor:not-allowed;}
.runtime-empty{border:1px dashed rgba(17,19,24,.14);border-radius:12px;padding:14px;text-align:center;font-size:12px;color:#68707b;background:#fafbfc;}
.fresh-workspace{position:absolute;inset:56px 14px 70px;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(260px,.55fr);gap:14px;align-items:stretch;}
.fresh-hero,.fresh-status{border:1px solid rgba(255,255,255,.80);background:rgba(255,255,255,.72);backdrop-filter:blur(18px);box-shadow:0 22px 64px rgba(37,36,34,.15);border-radius:28px;}
.fresh-hero{padding:44px;display:flex;flex-direction:column;justify-content:center;min-height:0;}
.fresh-hero small{letter-spacing:.18em;text-transform:uppercase;color:#8a6d35;font-weight:800;font-size:11px;}
.fresh-hero h1{font-size:clamp(52px,8vw,112px);line-height:.86;letter-spacing:-.085em;margin:12px 0 18px;max-width:760px;}
.fresh-hero p{max-width:650px;color:#555d68;font-size:16px;line-height:1.7;margin:0;}
.fresh-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:30px;}
.fresh-actions button{border:0;border-radius:16px;padding:12px 15px;background:#111318;color:#fff;font-weight:750;cursor:pointer;}
.fresh-actions button.secondary{background:#fff;color:#111318;border:1px solid rgba(20,22,26,.10);}
.fresh-status{padding:18px;display:grid;gap:12px;align-content:center;}
.fresh-status div{border:1px solid rgba(20,22,26,.07);background:linear-gradient(180deg,#fff,rgba(247,247,245,.88));border-radius:20px;padding:18px;}
.fresh-status b{display:block;font-size:48px;letter-spacing:-.06em;}
.fresh-status span{display:block;text-transform:uppercase;letter-spacing:.14em;color:#6c747f;font-size:11px;font-weight:800;}
@media(max-width:980px){.fresh-workspace{position:relative;inset:auto;margin:64px 12px 12px;grid-template-columns:1fr}.fresh-hero{padding:28px}.fresh-status{grid-template-columns:repeat(2,1fr)}}

.fresh-workspace{grid-template-columns:1fr;}
.fresh-hero.full-width{max-width:none;}

/* Collapsible primary navigation: compact by default, readable on hover/focus. */
.visual-frame{grid-template-columns:64px 440px 1fr;transition:grid-template-columns .55s cubic-bezier(.16,1,.3,1),column-gap .55s cubic-bezier(.16,1,.3,1);}
.visual-frame:has(.rail:hover),.visual-frame:has(.rail:focus-within){grid-template-columns:218px 440px 1fr;}
.rail{align-items:stretch;width:100%;overflow:hidden;transition:width .55s cubic-bezier(.16,1,.3,1),box-shadow .45s cubic-bezier(.16,1,.3,1),background-color .35s ease;background:rgba(255,255,255,.66);}
.rail:hover,.rail:focus-within{box-shadow:0 24px 70px rgba(37,36,34,.22);}
.logo-row{height:34px;display:flex;align-items:center;gap:0;padding-left:10px;}
.logo-row span{max-width:0;overflow:hidden;white-space:nowrap;opacity:0;transform:translateX(-6px);transition:max-width .55s cubic-bezier(.16,1,.3,1),opacity .22s ease-out,transform .3s cubic-bezier(.16,1,.3,1);font-family:var(--font-mono-brand,'IBM Plex Mono',monospace);font-size:13.5px;font-weight:500;letter-spacing:-.02em;color:#111318;padding-left:10px;}.logo-row span b{color:var(--accent-500);font-weight:500;}
.rail:hover .logo-row span,.rail:focus-within .logo-row span{max-width:160px;opacity:1;transform:translateX(0);transition:max-width .55s cubic-bezier(.16,1,.3,1),opacity .3s ease-out .2s,transform .38s cubic-bezier(.16,1,.3,1) .14s;}
.rail button{width:100%;height:38px;display:flex;align-items:center;gap:12px;justify-content:flex-start;padding:0 8px;border-radius:13px;white-space:nowrap;}
.rail button b{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;flex:0 0 32px;font-size:12px;}
.rail button span{opacity:0;transform:translateX(-8px);transition:opacity .18s ease-out,transform .3s cubic-bezier(.16,1,.3,1);color:#3e4650;font-size:13px;font-weight:750;}
.rail:hover button span,.rail:focus-within button span{opacity:1;transform:translateX(0);transition:opacity .28s ease-out .22s,transform .38s cubic-bezier(.16,1,.3,1) .16s;}
.rail button:hover b,.rail button.on b{background:rgba(17,19,24,.08);color:#111318;}
.rail .ak{margin-top:auto;background:rgba(255,255,255,.86);border:1px solid var(--line);font-size:11px;}
.rail .ak b{font-size:11px;}
@media(max-width:980px){.visual-frame,.visual-frame:has(.rail:hover),.visual-frame:has(.rail:focus-within){grid-template-columns:56px 1fr}.rail button span,.logo-row span{display:none}.chat{display:none}}

/* Live activity card (floating, non-intrusive) */
.live-card{position:absolute;bottom:20px;right:20px;left:auto;z-index:10;width:280px;background:rgba(255,255,255,.88);border:1px solid rgba(255,255,255,.95);border-radius:16px;backdrop-filter:blur(18px);box-shadow:0 8px 32px rgba(17,19,24,.14);overflow:hidden;}
.live-card-header{width:100%;display:flex;align-items:center;gap:10px;padding:12px 14px;background:transparent;border:0;cursor:pointer;text-align:left;}
.live-card-header:hover{background:rgba(17,19,24,.03);}
.live-card-header--static{cursor:default;}.live-card-header--static:hover{background:transparent;}
.live-dot{width:8px;height:8px;border-radius:50%;background:#111318;flex:0 0 8px;animation:livepulse 1.1s ease-in-out infinite;}
@keyframes livepulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.3;transform:scale(.65)}}
.live-card-label{flex:1;font-size:12px;font-weight:650;color:#111318;letter-spacing:-.01em;}
.live-card-toggle{font-size:16px;color:#6c747f;line-height:1;width:18px;text-align:center;}
.live-card-body{padding:0 14px 14px;max-height:260px;overflow-y:auto;font-size:12.5px;line-height:1.65;color:#3a4150;border-top:1px solid rgba(17,19,24,.07);}
.live-card-body p{margin:.35em 0;}.live-card-body ul,.live-card-body ol{padding-left:1.3em;margin:.35em 0;}
.live-card-body strong{font-weight:700;color:#111318;}
.live-card-body table{width:100%;border-collapse:collapse;margin:.4em 0;font-size:12px;}
.live-card-body th{padding:5px 9px;text-align:left;font-weight:700;color:#111318;border-bottom:2px solid rgba(17,19,24,.12);}
.live-card-body td{padding:4px 9px;border-bottom:1px solid rgba(17,19,24,.07);vertical-align:top;}

/* Artifact window controls */
.dot-close,.dot-minimize,.dot-zoom{cursor:pointer;transition:filter .15s ease;width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0;}
.dot-close:hover,.dot-minimize:hover,.dot-zoom:hover{filter:brightness(.6);}
/* Class-bound colors so dots stay correct when used in subsets (e.g. close+zoom only,
   as in the project library slide-over which has no minimize concept). */
.winbar .dot-close,.dot-close{background:#ff5f57;}
.winbar .dot-minimize,.dot-minimize{background:#ffbd2e;}
.winbar .dot-zoom,.dot-zoom{background:#28c840;}
.winbar-dl{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#6c747f;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0;}
.winbar-dl:hover{background:rgba(17,19,24,.08);color:#111318;}
.winbar-protect{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#6c747f;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0;}
.winbar-protect:hover{background:rgba(17,19,24,.08);color:#111318;}
.winbar-protect.on{background:#111318;color:#fff;}
.winbar-protect.on:hover{background:#1e222a;}
.winbar-protect:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.winbar-share{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#6c747f;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0;}
.winbar-share:hover{background:rgba(17,19,24,.08);color:#111318;}
.winbar-share:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.winbar-delete{display:grid;place-items:center;width:22px;height:22px;padding:0;border:0;border-radius:6px;background:transparent;color:#6c747f;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0;}
.winbar-delete:hover{background:rgba(192,57,43,.12);color:#c0392b;}
.winbar-delete:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}

/* Model picker */
.model-pill-wrap{position:relative;flex-shrink:0;}
.model-pill{display:flex;align-items:center;gap:5px;background:rgba(17,19,24,.06);border:1px solid rgba(17,19,24,.08);border-radius:999px;padding:4px 10px;cursor:pointer;transition:background .15s;}
.model-pill:hover{background:rgba(17,19,24,.10);}
.model-name{font-size:11px;font-weight:600;color:#111318;font-family:ui-monospace,monospace;letter-spacing:-.01em;}
.ctx-tokens{font-size:10px;color:#6b7280;background:rgba(17,19,24,.06);border-radius:999px;padding:1px 6px;}
.model-pill svg{color:#6b7280;flex-shrink:0;}
.model-dropdown{position:absolute;top:calc(100% + 6px);left:0;z-index:100;background:#fff;border:1px solid rgba(17,19,24,.10);border-radius:12px;box-shadow:0 8px 24px rgba(17,19,24,.12);padding:4px;margin:0;list-style:none;min-width:180px;max-height:360px;overflow-y:auto;}
.model-group{list-style:none;padding:0;margin:0;}
.model-group+.model-group{border-top:1px solid rgba(17,19,24,.07);margin-top:2px;padding-top:2px;}
.model-group>ul{list-style:none;margin:0;padding:0;}
.model-group-label{display:block;padding:5px 12px 2px;font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#9ca3af;pointer-events:none;}
.model-option{padding:6px 12px 6px 20px;font-size:12px;font-family:ui-monospace,monospace;font-weight:500;color:#111318;border-radius:8px;cursor:pointer;transition:background .12s;}
.model-option:hover{background:rgba(17,19,24,.06);}
.model-option.selected{background:rgba(17,19,24,.08);font-weight:700;}
.chat-actions{margin-left:auto;display:flex;gap:2px;position:relative;align-items:center;min-width:0;}
.chat-session-menu{position:relative;flex:0 0 auto;}
.sessions-dropdown{left:auto;right:0;width:312px;min-width:312px;max-width:min(312px,calc(100vw - 28px));max-height:360px;overflow-y:auto;overflow-x:hidden;}
.session-new-option{display:flex;align-items:center;gap:7px;font-weight:700;}
.session-new-option span{font-size:14px;line-height:1;display:inline-block;width:12px;text-align:center;}
.session-empty-option{opacity:.6;pointer-events:none;}
.session-option{display:grid;grid-template-columns:minmax(0,1fr) auto 18px;align-items:center;gap:8px;width:100%;min-width:0;}
.session-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;}
.session-tokens{font-size:10px;opacity:.55;white-space:nowrap;font-variant-numeric:tabular-nums;}
.session-delete-btn{width:18px;height:18px;border:0;border-radius:6px;background:transparent;color:inherit;opacity:.38;cursor:pointer;padding:0;font-size:12px;line-height:18px;display:grid;place-items:center;}
.session-delete-btn:hover{opacity:.8;background:rgba(17,19,24,.07);}

/* Typing indicator — animated three-dot bubble in chat feed */
.typing-indicator{display:flex;gap:5px;align-items:center;padding:10px 4px;min-height:0;background:none;border:none;box-shadow:none;}
.typing-indicator span{width:7px;height:7px;border-radius:50%;background:#b0b6bf;flex-shrink:0;animation:typing-bounce 1.1s ease-in-out infinite;}
.typing-indicator span:nth-child(2){animation-delay:.18s;}
.typing-indicator span:nth-child(3){animation-delay:.36s;}
@keyframes typing-bounce{0%,60%,100%{transform:translateY(0);opacity:.5;}28%{transform:translateY(-5px);opacity:1;}}
.msg--loading{display:flex;align-items:center;padding:12px 14px;color:#9ca3af;min-height:38px;}
.msg--streaming{opacity:.82;position:relative;}
.msg--streaming::after{content:'';display:inline-block;width:2px;height:1em;background:currentColor;opacity:.5;margin-left:2px;vertical-align:text-bottom;animation:cursor-blink .9s step-end infinite;}
@keyframes cursor-blink{0%,100%{opacity:.5;}50%{opacity:0;}}

/* Inline delete confirmation — replaces winbar controls in place */
.confirm-label{font-size:11.5px;font-weight:600;color:#111318;letter-spacing:-.01em;margin-right:2px;}
.confirm-cancel,.confirm-delete{font-size:11px;font-weight:650;padding:3px 11px;border-radius:8px;border:0;cursor:pointer;transition:background .15s,transform .1s;}
.confirm-cancel{background:rgba(17,19,24,.08);color:#3a4150;}
.confirm-cancel:hover{background:rgba(17,19,24,.14);}
.confirm-delete{background:var(--accent-500);color:#fff;margin-left:2px;}
.confirm-delete:hover{background:var(--accent-600);color:#fff;}
.confirm-cancel:active,.confirm-delete:active{transform:scale(.96);}

/* Fullscreen overlay — canvas-bound, rail + chat stay visible */
.artifact-fs{position:absolute;inset:0;z-index:9100;display:flex;flex-direction:column;background:#f8f7f5;backdrop-filter:blur(24px);overflow:hidden;transform-origin:center center;will-change:transform,opacity,border-radius;transition:transform 260ms cubic-bezier(.22,.8,.24,1),opacity 220ms ease,border-radius 260ms cubic-bezier(.22,.8,.24,1),box-shadow 260ms ease;}
.artifact-fs[data-phase="enter"]{transform:scale(.88) translateY(8px);opacity:0;border-radius:22px;box-shadow:0 30px 90px rgba(17,19,24,.18);}
.artifact-fs[data-phase="open"]{transform:scale(1) translateY(0);opacity:1;border-radius:0;box-shadow:0 0 0 rgba(17,19,24,0);}
.artifact-fs[data-phase="exit"]{transform:scale(.88) translateY(8px);opacity:0;border-radius:22px;box-shadow:0 30px 90px rgba(17,19,24,.16);pointer-events:none;}
.artifact-fs--docked{bottom:0;}
.artifact-fs-bar{flex:0 0 auto;background:rgba(246,247,248,.96);border-bottom:1px solid var(--line);position:relative;z-index:1;}
.artifact-fs-content{flex:1;overflow:hidden;position:relative;background:#f8f7f5;}
.artifact-fs-content iframe{width:100%;height:100%;border:0;display:block;background:#fff;}
.artifact-fs-content .win-md{height:100%;overflow-y:auto;padding:40px 56px;font-size:15px;line-height:1.75;}
body:has(.artifact-fs[data-phase="open"]){overflow:hidden;}
@media (prefers-reduced-motion: reduce){
  .artifact-fs{transition:opacity 120ms ease;}
  .artifact-fs[data-phase="enter"],.artifact-fs[data-phase="exit"]{transform:none;border-radius:0;}
}

/* macOS-style dock — spaces switcher + minimised artifact cards */
.artifact-dock{position:absolute;bottom:0;left:16px;display:flex;align-items:center;gap:10px;padding:7px 9px;border-radius:18px;background:rgba(255,255,255,.78);border:1px solid rgba(20,22,26,.08);box-shadow:none;backdrop-filter:blur(22px) saturate(160%);-webkit-backdrop-filter:blur(22px) saturate(160%);z-index:9000;max-width:calc(100% - 32px);height:56px;box-sizing:border-box;}

.dock-spaces{display:flex;align-items:center;gap:4px;height:42px;}
.dock-divider{width:1px;height:32px;background:rgba(17,19,24,.10);flex:0 0 1px;}
.dock-items{display:flex;align-items:center;gap:6px;height:42px;}

/* Space chip — a switchable workspace pill */
.space-chip{position:relative;display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 11px;border-radius:9px;background:transparent;cursor:pointer;font-size:11.5px;font-weight:600;color:#5a6470;letter-spacing:-.005em;transition:background .15s ease,color .15s ease,box-shadow .15s ease,transform .12s ease;user-select:none;border:1px solid transparent;}
.space-chip:hover{background:rgba(17,19,24,.045);color:#111318;}
.space-chip.is-active{background:#111318;color:#fff;box-shadow:0 1px 2px rgba(17,19,24,.18),inset 0 1px 0 rgba(255,255,255,.10);}
.space-chip.is-active:hover{background:#23262d;}
.space-chip.is-drop-target{box-shadow:0 0 0 2px #4a7dff,0 6px 16px rgba(74,125,255,.36);transform:translateY(-2px) scale(1.04);}
.space-chip.is-drop-target::after{content:'';position:absolute;inset:-4px;border-radius:11px;border:1.5px dashed rgba(74,125,255,.55);pointer-events:none;animation:chip-drop-pulse 1s ease-in-out infinite;}
@keyframes chip-drop-pulse{0%,100%{opacity:.4;transform:scale(1)}50%{opacity:.9;transform:scale(1.02)}}
.space-chip-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.space-chip-count{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 5px;border-radius:8px;font-size:10px;font-weight:700;background:rgba(17,19,24,.10);color:#5a6470;}
.space-chip.is-active .space-chip-count{background:rgba(255,255,255,.20);color:#fff;}
.space-chip-input{appearance:none;border:0;outline:0;background:transparent;color:inherit;font:inherit;width:90px;padding:0;letter-spacing:inherit;}
.space-chip.is-active .space-chip-input{color:#fff;caret-color:#fff;}

/* Inline delete button shown only while editing (double-click) and the space is empty */
.space-chip-action{appearance:none;width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;border:0;background:rgba(17,19,24,.06);color:#5a6470;cursor:pointer;padding:0;margin-left:4px;transition:background .14s ease,color .14s ease,transform .12s ease;}
.space-chip-action:hover{background:rgba(17,19,24,.14);color:#111318;transform:scale(1.08);}
.space-chip-action:active{transform:scale(.92);}
.space-chip-action--delete:hover{background:rgba(220,53,69,.14);color:#c0392b;}
.space-chip.is-active .space-chip-action{background:rgba(255,255,255,.16);color:rgba(255,255,255,.85);}
.space-chip.is-active .space-chip-action:hover{background:rgba(255,255,255,.28);color:#fff;}
.space-chip.is-active .space-chip-action--delete:hover{background:rgba(255,120,120,.32);color:#ffd9d9;}

.space-chip-menu{position:absolute;bottom:calc(100% + 6px);left:0;min-width:140px;padding:4px;border-radius:10px;background:rgba(255,255,255,.98);border:1px solid rgba(20,22,26,.10);box-shadow:0 14px 36px rgba(17,19,24,.20);backdrop-filter:blur(16px);z-index:9100;display:flex;flex-direction:column;gap:1px;animation:dock-preview-in .14s cubic-bezier(.32,.72,0,1) both;}
.space-chip-menu button{appearance:none;border:0;background:transparent;text-align:left;padding:7px 10px;border-radius:6px;font-size:11.5px;font-weight:600;color:#111318;cursor:pointer;}
.space-chip-menu button:hover:not(:disabled){background:rgba(17,19,24,.06);}
.space-chip-menu button:disabled{color:#9aa1ac;cursor:not-allowed;}

/* New space button */
.space-add{appearance:none;width:34px;height:34px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:1px dashed rgba(17,19,24,.20);color:#5a6470;cursor:pointer;transition:background .15s ease,color .15s ease,border-color .15s ease,transform .12s ease;}
.space-add:hover{background:rgba(17,19,24,.045);color:#111318;border-color:rgba(17,19,24,.32);transform:scale(1.04);}
.space-add:active{transform:scale(.94);}

/* Legacy canvas-dock kept as alias for old code paths (no-op now) */
.canvas-dock{display:none;}

.dock-item{position:relative;display:flex;align-items:flex-end;}

.dock-item{position:relative;display:flex;align-items:flex-end;}
.dock-card{width:56px;height:42px;border-radius:7px;cursor:pointer;padding:0;border:1px solid rgba(20,22,26,.12);background:#fff;position:relative;overflow:hidden;box-shadow:0 2px 8px rgba(17,19,24,.10),inset 0 1px 0 rgba(255,255,255,.6);transition:transform .18s cubic-bezier(.32,.72,0,1),box-shadow .18s ease;}
.dock-card:hover{transform:translateY(-6px) scale(1.04);box-shadow:0 12px 26px rgba(17,19,24,.22);}
.dock-card:active{transform:translateY(-2px) scale(.97);}
/* Tiny content snapshot rendered inside the dock card */
.dock-thumb{position:absolute;inset:0;pointer-events:none;overflow:hidden;background:#fff;border-radius:6px;}
.dock-thumb iframe{position:absolute;top:0;left:0;width:1200px;height:900px;border:0;transform:scale(.0467);transform-origin:top left;pointer-events:none;background:#fff;}
.dock-thumb .win-md{position:absolute;top:0;left:0;width:1200px;height:900px;padding:56px 72px;font-size:22px;line-height:1.5;color:#3a4150;transform:scale(.0467);transform-origin:top left;overflow:hidden;background:#fff;}
.dock-thumb .win-md h1{font-size:38px;line-height:1.1;margin:.2em 0 .25em;letter-spacing:-.02em;}
.dock-thumb .win-md h2{font-size:30px;line-height:1.15;margin:.4em 0 .2em;letter-spacing:-.01em;}
.dock-thumb .win-md h3{font-size:26px;margin:.4em 0 .15em;}
.dock-thumb .win-md p{margin:.4em 0;}
.dock-thumb .win-md ul,.dock-thumb .win-md ol{margin:.4em 0;padding-left:1.4em;}
.dock-thumb .win-md a{color:#1f4fff;text-decoration:underline;}
.dock-thumb .win-md table{width:100%;border-collapse:collapse;margin:.4em 0;font-size:18px;}
.dock-thumb .win-md th,.dock-thumb .win-md td{border-bottom:1px solid #e5e5e0;padding:6px 8px;text-align:left;}
.dock-thumb-empty{position:absolute;inset:0;display:grid;place-items:center;color:#9ca3af;font-size:9px;letter-spacing:.06em;text-transform:uppercase;}

/* Hover preview floating above the dock card */
.dock-preview{position:absolute;bottom:calc(100% + 12px);left:50%;transform:translateX(-50%);width:300px;height:220px;border-radius:14px;background:rgba(255,255,255,.96);border:1px solid rgba(255,255,255,.86);box-shadow:0 18px 48px rgba(32,34,38,.24),0 2px 6px rgba(17,19,24,.08);overflow:hidden;display:flex;flex-direction:column;backdrop-filter:blur(18px) saturate(150%);pointer-events:none;animation:dock-preview-in .16s cubic-bezier(.32,.72,0,1) both;z-index:9001;}
.dock-preview::after{content:'';position:absolute;bottom:-6px;left:50%;transform:translateX(-50%) rotate(45deg);width:12px;height:12px;background:rgba(255,255,255,.96);border-right:1px solid rgba(255,255,255,.86);border-bottom:1px solid rgba(255,255,255,.86);box-shadow:3px 3px 6px rgba(32,34,38,.10);}
@keyframes dock-preview-in{from{opacity:0;transform:translateX(-50%) translateY(6px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}
.dock-preview-title{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:8px 11px;border-bottom:1px solid var(--line);background:rgba(246,247,248,.78);}
.dock-preview-title b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;color:#3a4150;}
.dock-preview-body{flex:1;min-height:0;overflow:hidden;position:relative;background:#fff;}
.dock-preview-body.is-html iframe{position:absolute;top:0;left:0;width:1200px;height:880px;border:0;transform:scale(.25);transform-origin:top left;pointer-events:none;}
.dock-preview-body.is-md{padding:0;}
.dock-preview-body.is-md .win-md{height:100%;padding:10px 14px;font-size:11px;line-height:1.5;color:#3a4150;}
.dock-preview-body.is-md .win-md h1{font-size:1.15em;margin:.3em 0 .2em;}
.dock-preview-body.is-md .win-md h2{font-size:1.05em;margin:.35em 0 .2em;}
.dock-preview-body.is-md .win-md h3{font-size:.98em;margin:.3em 0 .15em;}

/* Move-to-space menu shown on right-clicking an artifact title bar */
.winbar-move-menu{position:fixed;min-width:170px;padding:5px;border-radius:11px;background:rgba(255,255,255,.98);border:1px solid rgba(20,22,26,.10);box-shadow:0 18px 44px rgba(17,19,24,.22);backdrop-filter:blur(18px);z-index:9200;display:flex;flex-direction:column;gap:1px;animation:dock-preview-in .14s cubic-bezier(.32,.72,0,1) both;}
.winbar-move-menu-label{padding:6px 10px 4px;font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#8a9099;}
.winbar-move-menu-empty{padding:4px 10px 8px;font-size:11px;color:#9aa1ac;font-style:italic;}
.winbar-move-menu button{appearance:none;border:0;background:transparent;text-align:left;padding:7px 10px;border-radius:6px;font-size:11.5px;font-weight:600;color:#111318;cursor:pointer;}
.winbar-move-menu button:hover{background:rgba(17,19,24,.06);}

/* Dock item context menu (right-click on a minimized artifact) */
.dock-item-menu{position:absolute;bottom:calc(100% + 10px);left:50%;transform:translateX(-50%);min-width:170px;padding:5px;border-radius:11px;background:rgba(255,255,255,.98);border:1px solid rgba(20,22,26,.10);box-shadow:0 18px 44px rgba(17,19,24,.22);backdrop-filter:blur(18px);z-index:9101;display:flex;flex-direction:column;gap:1px;animation:dock-preview-in .14s cubic-bezier(.32,.72,0,1) both;}
.dock-item-menu-label{padding:6px 10px 4px;font-size:10px;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:#8a9099;}
.dock-item-menu-empty{padding:4px 10px 8px;font-size:11px;color:#9aa1ac;font-style:italic;}
.dock-item-menu button{appearance:none;border:0;background:transparent;text-align:left;padding:7px 10px;border-radius:6px;font-size:11.5px;font-weight:600;color:#111318;cursor:pointer;}
.dock-item-menu button:hover{background:rgba(17,19,24,.06);}
.dock-item-menu-divider{height:1px;background:rgba(17,19,24,.08);margin:4px 4px;}

/* === Building card — shown while agent creates the first artifact === */
.building-card-wrap{position:absolute;inset:64px 14px 14px;animation:building-enter .38s cubic-bezier(.32,.72,0,1) both;}
@keyframes building-enter{from{opacity:0;transform:translateY(16px) scale(.982)}to{opacity:1;transform:translateY(0) scale(1)}}
.building-card{width:100%;height:100%;border-radius:22px;background:rgba(255,255,255,.92);border:1px solid rgba(255,255,255,.88);box-shadow:0 22px 64px rgba(32,34,38,.20);overflow:hidden;display:flex;flex-direction:column;position:relative;}
.building-card::before{content:'';position:absolute;inset:0;background:linear-gradient(108deg,transparent 34%,rgba(255,255,255,.52) 50%,transparent 66%);animation:card-sweep 2.6s ease-in-out infinite;pointer-events:none;z-index:10;}
@keyframes card-sweep{0%{transform:translateX(-120%)}100%{transform:translateX(230%)}}
.building-winbar{height:36px;flex:0 0 36px;display:flex;align-items:center;gap:8px;padding:0 12px;background:rgba(246,247,248,.90);border-bottom:1px solid rgba(20,22,26,.07);position:relative;z-index:11;}
.building-dots{display:flex;gap:6px;}
.building-dots span{width:10px;height:10px;border-radius:50%;}
.building-dots span:nth-child(1){background:rgba(255,95,87,.42);animation:bdot-breathe 1.9s ease-in-out infinite;}
.building-dots span:nth-child(2){background:rgba(255,189,46,.42);animation:bdot-breathe 1.9s ease-in-out infinite .28s;}
.building-dots span:nth-child(3){background:rgba(40,200,64,.42);animation:bdot-breathe 1.9s ease-in-out infinite .55s;}
@keyframes bdot-breathe{0%,100%{opacity:.32;transform:scale(.82)}50%{opacity:1;transform:scale(1)}}
.building-winbar-title{flex:1;font-size:12px;font-weight:650;color:#111318;letter-spacing:-.01em;}
.building-pill{display:flex;align-items:center;gap:5px;font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;background:rgba(17,19,24,.08);color:#111318;border-radius:999px;padding:4px 10px;}
.building-pill-dot{width:6px;height:6px;border-radius:50%;background:#111318;animation:livepulse 1.1s ease-in-out infinite;}
.building-body{flex:1;overflow:hidden;display:flex;flex-direction:column;}
.building-illustration{flex:1;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:40px 48px;}
.building-mesh{position:absolute;inset:-28px;background-image:linear-gradient(rgba(17,19,24,.032) 1px,transparent 1px),linear-gradient(90deg,rgba(17,19,24,.032) 1px,transparent 1px);background-size:28px 28px;animation:mesh-drift 14s linear infinite;}
@keyframes mesh-drift{from{transform:translate(0,0)}to{transform:translate(28px,28px)}}
.building-skeleton{position:relative;z-index:1;width:100%;max-width:560px;display:flex;flex-direction:column;gap:11px;}
.skel{border-radius:9px;background:linear-gradient(90deg,rgba(17,19,24,.055) 25%,rgba(17,19,24,.11) 50%,rgba(17,19,24,.055) 75%);background-size:200% 100%;animation:skel-sweep 1.6s ease-in-out infinite;}
.skel.hd{height:90px;border-radius:18px;width:100%;}
.skel.la{height:13px;width:88%;animation-delay:.12s;}
.skel.lb{height:13px;width:61%;animation-delay:.24s;}
.skel.lc{height:13px;width:75%;animation-delay:.09s;}
.skel.ld{height:13px;width:44%;animation-delay:.35s;}
@keyframes skel-sweep{0%{background-position:200% 0}100%{background-position:-200% 0}}
.feed-skeleton{display:flex;flex-direction:column;gap:11px;}
.msg--skel{display:flex;flex-direction:column;gap:8px;padding:14px 14px;background:linear-gradient(180deg,#fff,#f4f1eb);}
.msg.user.msg--skel{background:rgba(17,19,24,.78);}
.msg--skel .skel{background:linear-gradient(90deg,rgba(17,19,24,.06) 25%,rgba(17,19,24,.12) 50%,rgba(17,19,24,.06) 75%);background-size:200% 100%;}
.msg.user.msg--skel .skel{background:linear-gradient(90deg,rgba(255,255,255,.10) 25%,rgba(255,255,255,.22) 50%,rgba(255,255,255,.10) 75%);background-size:200% 100%;}
.sk-line{height:11px;border-radius:6px;}
.sk-line--w90{width:90%;}.sk-line--w85{width:85%;}.sk-line--w80{width:80%;}.sk-line--w70{width:70%;}.sk-line--w65{width:65%;}.sk-line--w55{width:55%;}.sk-line--w50{width:50%;}.sk-line--w40{width:40%;}
.canvas-board--skel{padding:0;overflow:hidden;}
.artifact-skel-wrap.artifact-skel-wrap{position:absolute;animation:none;transform:none;}
.artifact-skel-wrap--solo.artifact-skel-wrap--solo{left:16px;right:16px;top:16px;bottom:16px;width:auto;height:auto;min-height:280px;}
.artifact-skel-wrap .artifact-window{box-shadow:0 18px 48px rgba(32,34,38,.14);}
.artifact-skel-wrap .winbar{gap:8px;}
.artifact-skel-wrap .winbar i{opacity:.55;}
.sk-winbar-title{height:11px;width:42%;border-radius:6px;flex:1;max-width:240px;}
.sk-winbar-title--short{width:28%;max-width:160px;}
.sk-kind-badge{height:16px;width:54px;border-radius:999px;}
.artifact-skel-content{padding:20px 22px;display:flex;flex-direction:column;gap:11px;}
.sk-art-hero{height:96px;width:100%;border-radius:12px;margin-bottom:6px;animation-delay:.05s;}
.sk-art-block{height:140px;width:100%;border-radius:12px;margin:6px 0;animation-delay:.18s;}
.canvas-board--skel .sk-line{height:11px;border-radius:6px;}
@media(max-width:760px){
  .artifact-skel-wrap--solo.artifact-skel-wrap--solo{left:8px;right:8px;min-height:280px;}
}
.building-footer{flex:0 0 auto;padding:18px 24px;border-top:1px solid rgba(20,22,26,.07);background:rgba(248,247,245,.80);display:flex;flex-direction:column;gap:5px;}
.building-footer-label{font-size:10.5px;font-weight:800;letter-spacing:.13em;text-transform:uppercase;color:#8a9099;}
.building-footer-tool{font-size:14px;font-weight:650;color:#111318;letter-spacing:-.015em;}
.building-stream-text{font-size:12px;line-height:1.6;color:#555d68;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;margin-top:4px;}

/* Artifact kind badge (used in winbar) */
.artifact-kind-badge{font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;padding:2px 7px;border-radius:6px;background:rgba(17,19,24,.08);color:#6c747f;flex:0 0 auto;}
.artifact-kind-badge.html{background:#e8f4fd;color:#1a6fa8;}
.artifact-kind-badge.markdown{background:#f0fdf4;color:#166534;}

/* Canvas board — free-positioning surface for artifact windows (macOS-style) */
.canvas-board{position:absolute;inset:56px 0 70px;overflow:auto;overscroll-behavior:contain;z-index:1;transition:opacity .22s cubic-bezier(.32,.72,0,1),transform .22s cubic-bezier(.32,.72,0,1),filter .22s ease;}
.canvas-board--docked{padding-bottom:0;}

/* Space switching — outgoing fade-and-lift; incoming relies on artifact-enter keyframes */
.canvas.is-space-switching .canvas-board{opacity:0;transform:translate3d(0,8px,0) scale(.992);filter:blur(2px);pointer-events:none;}
.dock-items .dock-item{transition:opacity .18s ease,transform .18s cubic-bezier(.32,.72,0,1);}
.canvas.is-space-switching .dock-items .dock-item{opacity:0;transform:translateY(4px) scale(.94);pointer-events:none;}
@keyframes dock-item-enter{from{opacity:0;transform:translateY(8px) scale(.88);}to{opacity:1;transform:translateY(0) scale(1);}}
.canvas:not(.is-space-switching) .dock-items .dock-item{animation:dock-item-enter .28s cubic-bezier(.32,.72,0,1) both;}

/* Artifact window — absolutely positioned, draggable, focus-on-top */
.artifact-window-wrap{position:absolute;top:0;left:0;min-width:280px;min-height:180px;animation:artifact-enter .32s cubic-bezier(.32,.72,0,1) both;transition:transform .42s cubic-bezier(.32,.72,0,1),width .42s cubic-bezier(.32,.72,0,1),height .42s cubic-bezier(.32,.72,0,1);will-change:transform,width,height;}
.artifact-window-wrap[data-dragging="true"],.artifact-window-wrap[data-resizing="true"]{transition:none;}
@keyframes artifact-enter{from{opacity:0;}to{opacity:1;}}
@keyframes artifact-exit{to{opacity:0;transform:translate3d(0,12px,0) scale(.94);}}
.artifact-window{width:100%;height:100%;display:flex;flex-direction:column;transition:transform .18s cubic-bezier(.32,.72,0,1),box-shadow .18s cubic-bezier(.32,.72,0,1);}
.artifact-window-wrap.is-dragging .artifact-window{box-shadow:none;}
.artifact-window--new{box-shadow:0 18px 48px rgba(32,34,38,.22);}

/* Winbar acts as drag handle (title-bar style) */
.winbar{cursor:grab;user-select:none;}
.winbar:active{cursor:grabbing;}
.winbar i,.winbar button{cursor:pointer;}
body.is-dragging,body.is-dragging *{cursor:grabbing !important;}
body.is-resizing,body.is-resizing *{cursor:inherit;}

/* macOS-style resize handles — 4 corners + 4 edges, invisible chrome (cursor-only) */
.resize-edge{position:absolute;z-index:3;}
.resize-n { top:-3px;    left:14px;  right:14px;  height:6px;  cursor:ns-resize;}
.resize-s { bottom:-3px; left:14px;  right:14px;  height:6px;  cursor:ns-resize;}
.resize-w { left:-3px;   top:14px;   bottom:14px; width:6px;   cursor:ew-resize;}
.resize-e { right:-3px;  top:14px;   bottom:14px; width:6px;   cursor:ew-resize;}
.resize-nw{ top:-3px;    left:-3px;  width:14px;  height:14px; cursor:nwse-resize;}
.resize-ne{ top:-3px;    right:-3px; width:14px;  height:14px; cursor:nesw-resize;}
.resize-sw{ bottom:-3px; left:-3px;  width:14px;  height:14px; cursor:nesw-resize;}
.resize-se{ bottom:-3px; right:-3px; width:14px;  height:14px; cursor:nwse-resize;}
/* Transparent overlay to prevent iframe from stealing events during resize */
.resize-blocker{position:absolute;inset:0;z-index:3;cursor:nwse-resize;}
.drag-blocker{position:absolute;inset:0;z-index:3;background:transparent;cursor:grabbing;}
.iframe-focus-shield{position:absolute;inset:0;z-index:2;background:transparent;cursor:default;}
.win-content{flex:1;overflow:hidden;position:relative;overscroll-behavior:contain;}
.win-content iframe{width:100%;height:100%;border:0;display:block;}
.win-md{height:100%;overflow-y:auto;overscroll-behavior:contain;padding:16px 20px;font-size:13px;line-height:1.65;color:#2c3038;}
.win-md p{margin:.35em 0;}.win-md ul,.win-md ol{padding-left:1.4em;margin:.35em 0;}
.win-md strong{font-weight:700;color:#111318;}.win-md code{background:rgba(17,19,24,.07);border-radius:4px;padding:1px 5px;font-size:.88em;}
.win-md h1{font-size:1.6em;font-weight:700;letter-spacing:-.03em;margin:.6em 0 .3em;color:#111318;}
.win-md h2{font-size:1.25em;font-weight:700;letter-spacing:-.02em;margin:.7em 0 .3em;color:#111318;}
.win-md h3{font-size:1.08em;font-weight:700;margin:.6em 0 .25em;color:#111318;}
.win-md h4,.win-md h5,.win-md h6{font-size:1em;font-weight:700;margin:.5em 0 .2em;color:#111318;}
.win-md hr{border:none;border-top:1px solid rgba(17,19,24,.10);margin:1em 0;}
.win-md blockquote{margin:.5em 0;padding:.35em .9em;border-left:3px solid rgba(17,19,24,.18);color:#555d68;font-style:italic;}
.win-md table{width:100%;border-collapse:collapse;margin:.7em 0;font-size:12.5px;}
.win-md thead tr{background:rgba(17,19,24,.05);border-bottom:2px solid rgba(17,19,24,.12);}
.win-md th{padding:7px 12px;text-align:left;font-weight:700;color:#111318;white-space:nowrap;}
.win-md td{padding:6px 12px;border-bottom:1px solid rgba(17,19,24,.07);color:#3a4150;vertical-align:top;}
.win-md tbody tr:last-child td{border-bottom:none;}
.win-md tbody tr:hover{background:rgba(17,19,24,.03);}
/* same table styles for chat messages */
.msg table{width:100%;border-collapse:collapse;margin:.5em 0;font-size:12px;}
.msg thead tr{background:rgba(17,19,24,.05);border-bottom:2px solid rgba(17,19,24,.12);}
.msg th{padding:6px 10px;text-align:left;font-weight:700;color:#111318;}
.msg td{padding:5px 10px;border-bottom:1px solid rgba(17,19,24,.07);vertical-align:top;}
.msg tbody tr:last-child td{border-bottom:none;}.msg tbody tr:hover{background:rgba(17,19,24,.03);}
/* Long URLs and unbreakable strings must wrap inside chat bubbles */
.msg{min-width:0;overflow-wrap:anywhere;word-break:break-word;}
.msg a{overflow-wrap:anywhere;word-break:break-word;text-decoration-skip-ink:auto;}
.msg.agent a{color:var(--muted);text-decoration-color:rgba(104,112,123,.4);}
.msg.agent a:hover{color:#111318;text-decoration-color:rgba(17,19,24,.55);}
.msg p,.msg li,.msg span{overflow-wrap:anywhere;word-break:break-word;}
.msg pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto;max-width:100%;}
.msg code{white-space:pre-wrap;word-break:break-word;}
.msg img{max-width:100%;height:auto;}
/* Tighten markdown rendering inside chat bubbles. The bubble itself uses
   white-space:pre-wrap so plain-text replies keep their line breaks, but
   structural markdown nodes must NOT preserve source whitespace — otherwise
   blank lines between list items render as huge vertical gaps and bullets
   drift away from their text. */
.msg :where(p,ul,ol,li,h1,h2,h3,h4,h5,h6,table,blockquote){white-space:normal;}
.msg p{margin:.35em 0;}
.msg p:first-child{margin-top:0;}
.msg p:last-child{margin-bottom:0;}
.msg ul,.msg ol{margin:.35em 0;padding-left:1.35em;}
.msg li{margin:.15em 0;}
.msg li>p{margin:0;}
.msg li>p+p{margin-top:.25em;}
.msg li>ul,.msg li>ol{margin:.15em 0;}
.msg h1,.msg h2,.msg h3,.msg h4{margin:.6em 0 .3em;line-height:1.25;}
.msg h1{font-size:1.18em;}.msg h2{font-size:1.10em;}.msg h3{font-size:1.04em;}.msg h4{font-size:1em;}
.msg h1:first-child,.msg h2:first-child,.msg h3:first-child,.msg h4:first-child{margin-top:0;}
.msg blockquote{margin:.4em 0;padding-left:.7em;border-left:2px solid rgba(17,19,24,.12);color:#5a6068;}

/* Agent Configuration modal */
.config-btn{margin-left:auto;width:30px;height:30px;border:0;border-radius:9px;background:transparent;color:#68707b;cursor:pointer;display:grid;place-items:center;transition:background .15s,color .15s;flex:0 0 30px;}
.config-btn:hover{background:rgba(17,19,24,.07);color:#111318;}
.config-overlay{position:fixed;inset:0;z-index:200;background:rgba(17,19,24,.28);backdrop-filter:blur(14px) saturate(120%);display:grid;place-items:center;animation:overlay-in .18s ease both;}
@keyframes overlay-in{from{opacity:0}to{opacity:1}}
.config-panel{width:min(860px,calc(100vw - 32px));height:min(720px,calc(100vh - 48px));background:rgba(247,247,248,.96);border:1px solid rgba(255,255,255,.86);border-radius:18px;box-shadow:0 34px 90px rgba(17,19,24,.26),inset 0 1px 0 rgba(255,255,255,.74);display:grid;grid-template-rows:auto 1fr;overflow:hidden;animation:panel-in .22s cubic-bezier(.32,.72,0,1) both;color:#111318;}
@keyframes panel-in{from{opacity:0;transform:translateY(14px) scale(.976)}to{opacity:1;transform:none}}

/* Trust-mode confirmation modal (replaces window.confirm). Layers above the
   config panel so the user can flip trust mode while keeping context. */
.trust-modal-backdrop{position:fixed;inset:0;z-index:240;background:rgba(17,19,24,.42);backdrop-filter:blur(18px) saturate(120%);display:grid;place-items:center;padding:24px;animation:overlay-in .18s ease both;}
.trust-modal-card{width:min(440px,100%);background:rgba(247,247,248,.98);border:1px solid rgba(255,255,255,.86);border-radius:18px;box-shadow:0 34px 90px rgba(17,19,24,.32),inset 0 1px 0 rgba(255,255,255,.78);padding:24px 24px 18px;color:#111318;animation:panel-in .22s cubic-bezier(.32,.72,0,1) both;}
.trust-modal-icon{width:44px;height:44px;border-radius:12px;background:linear-gradient(180deg,#fef3c7,#fde68a);color:#92400e;display:grid;place-items:center;margin-bottom:14px;box-shadow:0 1px 0 rgba(255,255,255,.7) inset,0 2px 6px rgba(146,64,14,.18);}
.trust-modal-title{margin:0 0 8px;font-size:18px;font-weight:650;letter-spacing:-.015em;color:#111318;}
.trust-modal-body{margin:0 0 14px;font-size:13.5px;line-height:1.55;color:#3a4150;}
.trust-modal-still-blocked{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:10px 12px;border-radius:10px;background:rgba(192,57,43,.08);border:1px solid rgba(192,57,43,.18);margin-bottom:14px;}
.trust-modal-still-blocked-label{font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:#a93226;margin-right:4px;}
.trust-modal-still-blocked code{font-size:11.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#7b1d12;background:rgba(192,57,43,.12);padding:2px 7px;border-radius:6px;}
.trust-modal-foot{margin:0 0 16px;font-size:12px;color:#68707b;}
.trust-modal-actions{display:flex;justify-content:flex-end;gap:8px;}
.trust-modal-btn{font-size:13px;font-weight:600;padding:9px 16px;border-radius:10px;border:0;cursor:pointer;transition:background .15s,transform .1s,box-shadow .15s;}
.trust-modal-btn:disabled{opacity:.55;cursor:not-allowed;}
.trust-modal-btn:active:not(:disabled){transform:scale(.97);}
.trust-modal-btn--ghost{background:rgba(17,19,24,.07);color:#3a4150;}
.trust-modal-btn--ghost:hover:not(:disabled){background:rgba(17,19,24,.12);}
.trust-modal-btn--primary{background:#111318;color:#fef3c7;box-shadow:0 1px 0 rgba(255,255,255,.08) inset,0 4px 14px rgba(17,19,24,.22);}
.trust-modal-btn--primary:hover:not(:disabled){background:#1f232b;}
.trust-modal-btn--primary:focus-visible{outline:2px solid #d4b77f;outline-offset:2px;}
.config-header{display:flex;align-items:flex-start;padding:18px 18px 14px;border-bottom:1px solid rgba(17,19,24,.08);background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(247,247,248,.92));}
.config-header>div{flex:1;min-width:0;}
.config-title{display:block;font-size:15px;font-weight:760;color:#111318;letter-spacing:-.01em;}
.config-subtitle{display:block;margin-top:3px;font-size:12px;color:#737985;line-height:1.35;}
.config-close{width:26px;height:26px;border:0;border-radius:8px;background:rgba(17,19,24,.06);color:#68707b;cursor:pointer;display:grid;place-items:center;transition:background .15s,color .15s;}
.config-close:hover{background:rgba(17,19,24,.12);color:#111318;}
.config-shell{display:grid;grid-template-columns:190px 1fr;min-height:0;}
.config-tabs{display:flex;flex-direction:column;gap:4px;padding:14px 10px;background:rgba(238,239,241,.72);border-right:1px solid rgba(17,19,24,.08);}
.config-tab{height:54px;border:0;border-radius:10px;background:transparent;color:#626975;cursor:pointer;text-align:left;padding:0 12px;display:flex;flex-direction:column;justify-content:center;gap:2px;transition:background .16s,color .16s,box-shadow .16s;}
.config-tab span{font-size:13px;font-weight:720;letter-spacing:-.01em;}
.config-tab small{font-size:11px;color:#818792;}
.config-tab.on{background:rgba(255,255,255,.90);color:#111318;box-shadow:0 1px 2px rgba(17,19,24,.08),inset 0 0 0 1px rgba(17,19,24,.04);}
.config-tab.on small{color:#656b75;}
.config-tab:not(.on):hover{background:rgba(255,255,255,.58);color:#313740;}
/* Tools tab inner sub-navigation. Pills sit under the page head, single
   pane below — keeps the section focused and stops the Tools view from
   feeling like a 5-section dump. */
.tools-subnav{display:flex;gap:6px;padding:4px;background:rgba(241,242,244,.78);border:1px solid rgba(17,19,24,.06);border-radius:12px;flex-wrap:wrap;}
.tools-subnav-pill{flex:1 1 auto;min-width:0;border:0;background:transparent;color:#626975;cursor:pointer;text-align:left;padding:8px 12px;border-radius:9px;display:flex;flex-direction:column;gap:1px;transition:background .15s,color .15s,box-shadow .15s;}
.tools-subnav-pill b{font-size:12.5px;font-weight:680;letter-spacing:-.005em;color:inherit;}
.tools-subnav-pill small{font-size:10.5px;color:#8a909a;line-height:1.3;}
.tools-subnav-pill:not(.on):hover{background:rgba(255,255,255,.55);color:#313740;}
.tools-subnav-pill.on{background:#ffffff;color:#111318;box-shadow:0 1px 2px rgba(17,19,24,.06),inset 0 0 0 1px rgba(17,19,24,.05);}
.tools-subnav-pill.on small{color:#656b75;}
.tools-pane{display:flex;flex-direction:column;gap:14px;}
.config-content{min-width:0;min-height:0;overflow:hidden;}
.config-body{height:100%;overflow-y:auto;padding:22px 24px 26px;display:flex;flex-direction:column;gap:16px;min-height:0;}
/* Config modal now uses the canonical AdminModal shell (same as the
   "New agent" modal). Lock the card to a fixed height so the dialog does
   not resize when switching between Instructions / Design / Tools tabs —
   only the inner panel scrolls. */
.agents-modal--wide:has(.config-shell--in-admin-modal) .agents-modal-card{height:min(820px,92vh);max-height:min(820px,92vh);}
.agents-modal--wide .config-shell--in-admin-modal{flex:1;min-height:0;height:100%;}
.agents-modal--wide .config-shell--in-admin-modal .config-content{overflow:auto;min-height:0;}
.agents-modal--wide .config-shell--in-admin-modal .config-body{height:100%;}

/* Instructions builder — structured form replacing the monolithic textarea.
   Card-grid pickers for archetype / personality, dynamic Reports table,
   chiplist editors for DO / NEVER / Safety / References, mode toggle to
   fall back to raw markdown. */
.instr-builder{display:flex;flex-direction:column;gap:14px;}
.instr-mode-toggle{display:inline-flex;align-self:flex-start;gap:4px;padding:3px;background:rgba(241,242,244,.78);border:1px solid rgba(17,19,24,.06);border-radius:10px;}
.instr-mode-pill{border:0;background:transparent;color:#626975;cursor:pointer;padding:6px 12px;border-radius:7px;font-size:12px;font-weight:620;transition:background .15s,color .15s,box-shadow .15s;}
.instr-mode-pill:not(.on):hover{background:rgba(255,255,255,.55);color:#313740;}
.instr-mode-pill.on{background:#ffffff;color:#111318;box-shadow:0 1px 2px rgba(17,19,24,.06),inset 0 0 0 1px rgba(17,19,24,.05);}
.instr-form{display:flex;flex-direction:column;gap:18px;}
.instr-section{display:flex;flex-direction:column;gap:9px;}
.instr-section-head h4{margin:0;font-size:13.5px;font-weight:700;letter-spacing:-.01em;color:#111318;}
.instr-section-head p{margin:2px 0 0;font-size:12px;color:#68707b;line-height:1.4;text-wrap:pretty;}
.instr-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(168px,1fr));gap:8px;}
.instr-card{display:flex;align-items:flex-start;gap:9px;padding:11px 12px;border-radius:11px;background:#ffffff;border:1px solid rgba(17,19,24,.08);text-align:left;cursor:pointer;color:#3a414b;transition:background .15s,border-color .15s,box-shadow .15s,color .15s;}
.instr-card:hover{border-color:rgba(17,19,24,.18);background:#fafbfc;}
.instr-card.on{border-color:rgba(17,19,24,.55);background:#111318;color:#fafbfc;box-shadow:0 4px 14px rgba(17,19,24,.18);}
.instr-card-mark{display:grid;place-items:center;width:30px;height:30px;border-radius:8px;background:rgba(17,19,24,.06);color:#4a5059;flex:0 0 30px;}
.instr-card.on .instr-card-mark{background:rgba(255,255,255,.10);color:#fafbfc;}
.instr-card-body{display:flex;flex-direction:column;gap:1px;min-width:0;}
.instr-card-body b{font-size:13px;font-weight:680;letter-spacing:-.01em;}
.instr-card-body small{font-size:11px;line-height:1.35;opacity:.78;}
.instr-textarea{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:10px;padding:10px 12px;background:#fff;font-family:inherit;font-size:13px;line-height:1.5;resize:vertical;min-height:80px;color:#111318;transition:border-color .15s;}
.instr-textarea:focus{outline:0;border-color:rgba(17,19,24,.32);}
.instr-reports{display:flex;flex-direction:column;gap:6px;}
.instr-report-row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(180px,2fr) 28px;gap:8px;align-items:center;padding:7px 8px;background:#fff;border:1px solid rgba(17,19,24,.07);border-radius:9px;}
.instr-report-meta{display:flex;flex-direction:column;gap:2px;min-width:0;}
.instr-report-role{border:0;background:transparent;font-size:12.5px;font-weight:660;color:#111318;padding:1px 0;}
.instr-report-role:focus{outline:0;}
.instr-report-id{font-size:10px;color:#8a909a;background:rgba(17,19,24,.04);padding:1px 5px;border-radius:4px;align-self:flex-start;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;}
.instr-report-resp{border:0;background:transparent;font-size:12px;color:#3a414b;padding:1px 0;min-width:0;}
.instr-report-resp:focus{outline:0;}
.instr-report-remove{width:24px;height:24px;border:0;background:transparent;color:#8a909a;font-size:18px;line-height:1;border-radius:6px;cursor:pointer;}
.instr-report-remove:hover{background:rgba(17,19,24,.06);color:#111318;}
.instr-report-add select{width:100%;border:1px dashed rgba(17,19,24,.16);border-radius:9px;padding:8px 10px;background:#fafbfc;font-size:12.5px;color:#626975;cursor:pointer;}
.instr-report-add select:hover{border-color:rgba(17,19,24,.28);color:#313740;}
.instr-empty{font-size:12px;color:#8a909a;padding:8px 10px;border:1px dashed rgba(17,19,24,.10);border-radius:9px;background:#fafbfc;}
.instr-two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px;}
@media(max-width:760px){.instr-two-col{grid-template-columns:1fr;}.instr-report-row{grid-template-columns:1fr;}}
.instr-chiplist{display:flex;flex-direction:column;gap:6px;}
.instr-chiplist-label{font-size:12px;font-weight:660;color:#3a414b;}
.instr-chiplist-items{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px;}
.instr-chiplist-items li{display:flex;align-items:center;justify-content:space-between;gap:6px;padding:6px 9px;background:#fff;border:1px solid rgba(17,19,24,.07);border-radius:8px;font-size:12.5px;color:#3a414b;}
.instr-chiplist-items button{border:0;background:transparent;color:#8a909a;font-size:16px;line-height:1;width:20px;height:20px;border-radius:5px;cursor:pointer;flex:0 0 20px;}
.instr-chiplist-items button:hover{background:rgba(17,19,24,.06);color:#111318;}
.instr-chiplist-add{display:flex;gap:6px;}
.instr-chiplist-add input{flex:1;border:1px solid rgba(17,19,24,.10);border-radius:8px;padding:7px 10px;font-size:12px;background:#fff;}
.instr-chiplist-add input:focus{outline:0;border-color:rgba(17,19,24,.28);}
.instr-chiplist-add button{border:0;background:#111318;color:#fff;border-radius:8px;padding:7px 11px;font-size:12px;font-weight:620;cursor:pointer;}
.instr-chiplist-add button:disabled{opacity:.4;cursor:not-allowed;}
.instr-preset-banner{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 12px;border-radius:9px;background:#fffbed;border:1px solid rgba(212,183,127,.55);font-size:12px;color:#5e4a18;}
.instr-preset-banner.applied{background:#eef9f0;border-color:rgba(106,210,138,.5);color:#1f5a31;}
.instr-preset-banner b{font-weight:680;}
.instr-preset-banner .config-save-btn{padding:6px 11px;font-size:11.5px;flex:0 0 auto;}
.instr-preview-toggle{align-self:flex-start;border:1px dashed rgba(17,19,24,.16);background:transparent;border-radius:8px;padding:6px 11px;font-size:12px;font-weight:620;color:#3a414b;cursor:pointer;}
.instr-preview-toggle:hover{background:rgba(17,19,24,.04);border-color:rgba(17,19,24,.28);color:#111318;}
.instr-preview{margin:0;padding:12px 14px;background:#0e1014;color:#dfe2e6;border-radius:10px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;line-height:1.55;white-space:pre-wrap;word-break:break-word;max-height:280px;overflow:auto;border:1px solid rgba(17,19,24,.4);}
.instr-raw{display:flex;flex-direction:column;gap:10px;flex:1;min-height:0;}
.instr-raw .config-textarea{flex:1;min-height:0;height:100%;}
/* When raw mode is active, let the builder + page head stack collapse so
   the textarea owns the remaining card height. */
.instr-builder:has(.instr-raw){flex:1;min-height:0;display:flex;flex-direction:column;}

.config-page-head{display:flex;flex-direction:column;gap:5px;margin-bottom:2px;}
.config-page-head span{font-size:20px;font-weight:780;letter-spacing:-.025em;color:#111318;}
.config-page-head p{margin:0;max-width:620px;font-size:12.5px;color:#68707b;line-height:1.5;text-wrap:pretty;}
.config-hint{margin:0;font-size:12px;color:#68707b;line-height:1.55;}
.config-textarea{width:100%;min-height:0;flex:1;border:1px solid rgba(17,19,24,.10);border-radius:14px;padding:16px 17px;font-family:ui-monospace,'IBM Plex Mono',monospace;font-size:12px;line-height:1.75;color:#111318;background:rgba(255,255,255,.92);resize:none;transition:border-color .15s,box-shadow .15s;box-shadow:inset 0 1px 2px rgba(17,19,24,.035);}
.config-textarea:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 4px rgba(17,19,24,.06),inset 0 1px 2px rgba(17,19,24,.035);}
.config-footer{display:flex;align-items:center;gap:10px;}
.config-char-count{font-size:11px;color:#8a9099;flex:1;}
.config-save-btn{padding:8px 14px;border:0;border-radius:10px;background:#111318;color:#fff;font-size:12.5px;font-weight:700;cursor:pointer;transition:opacity .15s,transform .1s,background .15s;white-space:nowrap;}
.config-save-btn:hover{background:#2a2d33;}
.config-save-btn:active{transform:scale(.97);}
.config-save-btn:disabled{opacity:.4;cursor:not-allowed;}
/* Design style picker */
.design-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.design-style-card{border:1px solid rgba(17,19,24,.09);border-radius:14px;padding:15px 16px;background:rgba(255,255,255,.88);display:flex;flex-direction:column;gap:7px;cursor:pointer;text-align:left;transition:border-color .15s,box-shadow .15s,transform .15s,background .15s;min-height:126px;}
.design-style-card:hover{border-color:rgba(17,19,24,.20);box-shadow:0 8px 24px rgba(45,48,54,.08);transform:translateY(-1px);background:#fff;}
.design-style-card.on{border-color:rgba(17,19,24,.42);box-shadow:0 0 0 4px rgba(17,19,24,.06);background:#fff;}
.design-style-card-top{display:flex;align-items:center;justify-content:space-between;}
.design-style-name{font-size:13px;font-weight:700;color:#111318;letter-spacing:-.01em;}
.design-style-check{width:20px;height:20px;border-radius:50%;background:#111318;display:grid;place-items:center;flex:0 0 20px;color:#fff;}
.design-style-desc{margin:0;font-size:12px;line-height:1.55;color:#68707b;text-wrap:pretty;}

.config-secrets-panel,.config-tools-panel{border:1px solid rgba(17,19,24,.08);border-radius:18px;background:rgba(255,255,255,.92);padding:18px;display:flex;flex-direction:column;gap:16px;box-shadow:0 1px 2px rgba(17,19,24,.04);}
.secrets-empty{font-size:12.5px;color:#68707b;padding:10px 2px;}
.secrets-add-form{border:1px solid rgba(17,19,24,.08);border-radius:13px;padding:14px;background:#fafbfc;display:flex;flex-direction:column;gap:12px;}
.secrets-add-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.secrets-add-footer{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.secrets-scope-field{display:flex;align-items:center;gap:7px;font-size:12px;color:#68707b;flex:1;}
.secrets-scope-field select{height:32px;border:1px solid rgba(17,19,24,.11);border-radius:8px;padding:0 8px;font-size:12px;background:#fff;color:#111318;cursor:pointer;}
.secrets-error{font-size:11.5px;color:#9a3325;flex:1;}
.secrets-row-inner{display:grid;grid-template-columns:1fr auto;align-items:center;gap:14px;}
.secrets-row-meta{min-width:0;}
.secrets-row-actions{display:flex;align-items:center;gap:7px;flex-shrink:0;}
.secrets-action-btn{height:28px;padding:0 10px;border:1px solid rgba(17,19,24,.11);border-radius:8px;background:#fff;color:#313740;font-size:11.5px;font-weight:680;cursor:pointer;transition:background .14s,border-color .14s;}
.secrets-action-btn:hover{background:#f4f5f7;border-color:rgba(17,19,24,.18);}
.secrets-action-btn:disabled{opacity:.45;cursor:not-allowed;}
.secrets-action-btn.danger{color:#9a3325;border-color:rgba(154,51,37,.22);}
.secrets-action-btn.danger:hover{background:#fff0ed;border-color:rgba(154,51,37,.36);}
.secrets-rotate-inline{display:flex;align-items:center;gap:7px;flex-wrap:nowrap;}
.secrets-rotate-inline input{height:32px;width:140px;border:1px solid rgba(17,19,24,.11);border-radius:8px;padding:0 10px;font:12px ui-monospace,'IBM Plex Mono',monospace;background:#fff;color:#111318;}
.secrets-rotate-inline input:focus{outline:0;border-color:rgba(17,19,24,.34);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.config-secrets-head{display:flex;align-items:flex-start;gap:18px;padding-bottom:4px;border-bottom:1px solid rgba(17,19,24,.06);}
.config-secrets-head>div{flex:1;min-width:0;}
.config-section-title{display:block;font-size:14px;font-weight:780;color:#111318;letter-spacing:-.012em;}
.config-secrets-head p{margin:4px 0 0;font-size:12.5px;line-height:1.45;color:#68707b;}
.config-env-saved{font-size:12px;font-weight:720;color:#2d7044;background:#e8f6ee;border-radius:10px;padding:9px 11px;}
.config-env-grid{display:flex;flex-direction:column;gap:12px;}
.config-env-group{border:1px solid rgba(17,19,24,.07);border-radius:15px;padding:14px;background:linear-gradient(180deg,#fafbfc,#f5f6f8);display:grid;grid-template-columns:1fr 1fr;gap:13px 14px;}
.config-env-group-title{grid-column:1/-1;font-size:11px;font-weight:850;letter-spacing:.11em;text-transform:uppercase;color:#68707b;padding-bottom:2px;}
.config-env-field{display:flex;flex-direction:column;gap:7px;min-width:0;}
.config-env-field-top{display:flex;align-items:center;gap:10px;min-width:0;}
.config-env-field b{font-size:12.5px;color:#111318;letter-spacing:-.01em;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.config-env-field small{min-height:31px;font-size:11.5px;line-height:1.35;color:#727985;text-wrap:pretty;}
.config-env-field em{font-style:normal;font-size:10px;font-weight:820;color:#9a3325;background:#fff0ed;border-radius:999px;padding:3px 7px;white-space:nowrap;}
.config-env-field em.ready{color:#2d7044;background:#e8f6ee;}
.config-env-field input{height:38px;border:1px solid rgba(17,19,24,.11);border-radius:10px;padding:0 11px;background:#fff;color:#111318;font:12px ui-monospace,'IBM Plex Mono',monospace;min-width:0;transition:border-color .15s,box-shadow .15s;}
.config-env-field input:focus{outline:0;border-color:rgba(17,19,24,.34);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.config-env-field code{font:10.5px ui-monospace,'IBM Plex Mono',monospace;color:#8a9099;background:transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}

.config-tool-group{display:flex;flex-direction:column;gap:7px;}
.config-tool-group+.config-tool-group{padding-top:4px;border-top:1px solid rgba(17,19,24,.06);}
.config-tool-group-head{font-size:10px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.config-tools-list{display:flex;flex-direction:column;border:1px solid rgba(17,19,24,.06);border-radius:12px;overflow:hidden;background:#fff;}
.config-tool-row{padding:12px 13px;background:#fff;}
.config-tool-row+.config-tool-row{border-top:1px solid rgba(17,19,24,.06);}
.config-tool-row.on{background:linear-gradient(180deg,#fff,#fbfbfc);}
.config-tool-main{display:grid;grid-template-columns:1fr auto;align-items:center;gap:14px;}
.config-tool-titleline{display:flex;align-items:center;gap:7px;margin-bottom:3px;}
.config-tool-name{font-size:12.5px;font-weight:740;color:#111318;letter-spacing:-.01em;text-transform:capitalize;}
.config-tool-risk{font-size:9px;font-weight:850;letter-spacing:.07em;text-transform:uppercase;border-radius:5px;padding:2px 6px;background:#eef2f6;color:#57606b;}
.config-tool-risk.medium{background:#fff4d8;color:#80611b;}
.config-tool-risk.high{background:#ffe3df;color:#9a3325;}
.config-tool-risk.local{background:#e8f6ee;color:#2d7044;}
.config-tool-risk.irreversible{background:#3d1a10;color:#ffc4a8;cursor:default;}
.config-tool-irreversible-notice{background:#3d1a10!important;color:#ffc4a8!important;}
.config-tool-toggle{margin-left:auto;width:38px;height:22px;border:0;border-radius:999px;background:#d8dde4;padding:2px;cursor:pointer;transition:background .15s;flex:0 0 38px;}
.config-tool-toggle span{display:block;width:18px;height:18px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(17,19,24,.22);transition:transform .15s;}
.config-tool-toggle.on{background:#111318;}
.config-tool-toggle.on span{transform:translateX(16px);}
.config-tool-desc{margin:0;max-width:560px;font-size:11.8px;line-height:1.45;color:#5f6671;text-wrap:pretty;}
.config-tool-status{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px;}
.config-tool-status span{font-size:10.5px;font-weight:700;border-radius:999px;padding:3px 7px;background:rgba(17,19,24,.06);color:#68707b;}
.config-tool-status .ready{background:#e8f6ee;color:#2d7044;}
.config-tool-status .missing{background:#fff0ed;color:#9a3325;}
.trust-mode-card{display:flex;align-items:flex-start;gap:18px;padding:16px 18px;border:1px solid rgba(17,19,24,.08);border-radius:18px;background:rgba(255,255,255,.92);box-shadow:0 1px 2px rgba(17,19,24,.04);margin-bottom:6px;}
.trust-mode-card.on{border-color:rgba(154,51,37,.55);background:linear-gradient(180deg,#fff7f4,#fff);}
.trust-mode-info{flex:1;display:flex;flex-direction:column;gap:6px;}
.trust-mode-titleline{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.trust-mode-name{font-size:13.5px;font-weight:600;color:#111318;letter-spacing:-.005em;}
.trust-mode-pill{font-size:10.5px;font-weight:700;letter-spacing:.02em;text-transform:uppercase;border-radius:999px;padding:3px 9px;}
.trust-mode-pill.off{background:#eef0f3;color:#5f6671;}
.trust-mode-pill.on{background:#fde2dc;color:#9a3325;}
.trust-mode-desc{margin:0;max-width:560px;font-size:11.8px;line-height:1.45;color:#5f6671;text-wrap:pretty;}

/* Destination allowlists subsection — matches .config-secrets-panel rhythm */
.allowlists-empty-state{border:1px dashed rgba(17,19,24,.12);border-radius:12px;padding:16px 18px;background:#fafbfc;}
.allowlists-empty-state p{margin:0;font-size:12.5px;line-height:1.6;color:#68707b;text-wrap:pretty;}
.allowlists-tool-list{display:flex;flex-direction:column;gap:14px;}
.allowlists-tool-block{border:1px solid rgba(17,19,24,.08);border-radius:14px;background:#fafbfc;overflow:hidden;}
.allowlists-tool-head{display:flex;align-items:center;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(17,19,24,.06);}
.allowlists-tool-meta{flex:1;display:flex;align-items:center;gap:8px;min-width:0;}
.allowlists-scope-key{font-size:9px;font-weight:850;letter-spacing:.07em;text-transform:uppercase;border-radius:5px;padding:2px 6px;background:#eef2f6;color:#57606b;flex-shrink:0;}
.allowlists-entries-empty{padding:11px 14px;font-size:12px;color:#9a3325;background:#fff7f4;border-top:1px solid rgba(154,51,37,.10);}
.allowlists-tool-block .secrets-add-form{border:0;border-radius:0;border-top:1px solid rgba(17,19,24,.07);background:#f5f6f8;}
.allowlists-tool-block .config-tools-list{border:0;border-radius:0;border-top:1px solid rgba(17,19,24,.06);}
@media(max-width:760px){.config-panel{width:calc(100vw - 24px);height:calc(100vh - 28px);border-radius:16px;}.config-shell{grid-template-columns:1fr;grid-template-rows:auto 1fr}.config-tabs{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid rgba(17,19,24,.08);padding:10px}.config-tab{min-width:140px}.config-body{padding:18px}.config-env-group,.design-style-grid{grid-template-columns:1fr}.config-secrets-head{flex-direction:column}.config-tool-main{grid-template-columns:1fr;}.config-tool-toggle{margin-left:0;}.trust-mode-card{flex-direction:column;align-items:stretch;}}

/* Smart search / keyboard command palette */
.smart-search-overlay{position:fixed;inset:0;z-index:12000;display:grid;place-items:start center;padding-top:9vh;background:rgba(17,19,24,.28);backdrop-filter:blur(18px) saturate(130%);animation:overlay-in .16s ease both;}
.smart-search-panel{width:min(720px,calc(100vw - 28px));max-height:min(720px,calc(100vh - 72px));display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border-radius:24px;border:1px solid rgba(255,255,255,.76);background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(242,239,234,.94));box-shadow:0 38px 110px rgba(17,19,24,.34),inset 0 1px 0 rgba(255,255,255,.84);color:#111318;animation:panel-in .22s cubic-bezier(.32,.72,0,1) both;}
.smart-search-head{display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:center;padding:16px 18px;border-bottom:1px solid rgba(17,19,24,.08);background:linear-gradient(135deg,rgba(255,255,255,.82),rgba(246,243,237,.72));}
.smart-search-orb{width:13px;height:13px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#fff 0 10%,#d4b77f 26%,#9a3325 72%,#111318 100%);box-shadow:0 0 0 5px rgba(154,51,37,.08),0 0 24px rgba(154,51,37,.22);}
.smart-search-head input{width:100%;border:0;background:transparent;color:#111318;font:700 18px/1.3 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.025em;outline:0;}
.smart-search-head input::placeholder{color:#8c919a;font-weight:650;}
.smart-search-panel kbd{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:22px;padding:0 7px;border-radius:7px;border:1px solid rgba(17,19,24,.12);background:rgba(255,255,255,.76);box-shadow:inset 0 -1px 0 rgba(17,19,24,.08);font:800 10px/1 ui-monospace,'IBM Plex Mono',monospace;color:#5f6671;text-transform:none;white-space:nowrap;}
.smart-search-results{padding:8px;overflow:auto;display:flex;flex-direction:column;gap:4px;}
.smart-search-row{width:100%;border:0;border-radius:16px;background:transparent;color:inherit;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px;padding:12px 13px;text-align:left;cursor:pointer;transition:background .12s,box-shadow .12s,transform .12s;}
.smart-search-row.is-active,.smart-search-row:hover{background:#fff;box-shadow:0 10px 28px rgba(17,19,24,.10),inset 0 0 0 1px rgba(17,19,24,.045);transform:translateY(-1px);}
.smart-search-row-main{min-width:0;display:grid;gap:3px;}
.smart-search-row-main small{font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#9a3325;}
.smart-search-row-main b{font-size:14px;font-weight:780;letter-spacing:-.018em;color:#111318;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.smart-search-row-main em{font-style:normal;font-size:12px;line-height:1.35;color:#68707b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.smart-search-empty{padding:34px 18px 40px;text-align:center;color:#727985;font-size:13px;}
.smart-search-foot{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;justify-content:space-between;padding:10px 14px;border-top:1px solid rgba(17,19,24,.08);background:rgba(238,239,241,.56);font-size:11px;font-weight:720;color:#68707b;}
.smart-search-foot span{display:inline-flex;align-items:center;gap:5px;}
@media(max-width:760px){.smart-search-overlay{padding-top:18px;align-items:start}.smart-search-panel{width:calc(100vw - 18px);max-height:calc(100vh - 36px);border-radius:18px}.smart-search-head{padding:13px 14px}.smart-search-head input{font-size:16px}.smart-search-row{grid-template-columns:1fr;padding:11px}.smart-search-row>kbd{justify-self:start}.smart-search-row-main em{white-space:normal}.smart-search-foot{justify-content:flex-start}}

@media(max-width:760px){.config-panel{width:calc(100vw - 24px);height:calc(100vh - 28px);border-radius:16px;}.config-shell{grid-template-columns:1fr;grid-template-rows:auto 1fr}.config-tabs{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid rgba(17,19,24,.08);padding:10px}.config-tab{min-width:140px}.config-body{padding:18px}.config-env-group,.design-style-grid{grid-template-columns:1fr}.config-secrets-head{flex-direction:column}.config-tool-main{grid-template-columns:1fr;}.config-tool-toggle{margin-left:0;}}

/* Brand templates — interior styles only; outer shell uses AdminShell (.admin-frame/.admin-shell/.admin-header/.admin-kicker) */
.mkt-page[data-page="brand"] .brand-toast{position:sticky;top:0;z-index:20;margin:-10px 0 18px auto;max-width:560px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;border-radius:14px;padding:11px 12px;border:1px solid rgba(17,19,24,.10);background:rgba(255,255,255,.94);box-shadow:0 18px 48px rgba(17,19,24,.16);animation:brand-toast-in .22s cubic-bezier(.32,.72,0,1) both;}
.mkt-page[data-page="brand"] .brand-toast.success{border-color:rgba(45,112,68,.22);background:#f0fbf4;}
.mkt-page[data-page="brand"] .brand-toast.error{border-color:rgba(154,51,37,.24);background:#fff3f0;}
.mkt-page[data-page="brand"] .brand-toast>span{border-radius:999px;padding:4px 8px;background:#111318;color:#fff;font-size:10px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;}
.mkt-page[data-page="brand"] .brand-toast.success>span{background:#2d7044;}
.mkt-page[data-page="brand"] .brand-toast.error>span{background:#9a3325;}
.mkt-page[data-page="brand"] .brand-toast p{margin:0;min-width:0;color:#313740;font-size:12.5px;line-height:1.35;}
.mkt-page[data-page="brand"] .brand-toast button{width:24px;height:24px;border:0;border-radius:8px;background:rgba(17,19,24,.06);color:#59606b;cursor:pointer;font-size:16px;line-height:1;}
.mkt-page[data-page="brand"] .brand-toast button:hover{background:rgba(17,19,24,.12);color:#111318;}
@keyframes brand-toast-in{from{opacity:0;transform:translateY(-8px) scale(.98)}to{opacity:1;transform:none}}
.mkt-page .mkt-toast{position:sticky;top:8px;z-index:30;margin:0 0 14px auto;max-width:560px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:11px;border-radius:14px;padding:11px 12px;border:1px solid rgba(17,19,24,.10);background:rgba(255,255,255,.96);box-shadow:0 18px 48px rgba(17,19,24,.16);animation:brand-toast-in .22s cubic-bezier(.32,.72,0,1) both;}
.mkt-page .mkt-toast.success{border-color:rgba(45,112,68,.22);background:#f0fbf4;}
.mkt-page .mkt-toast.info{border-color:rgba(31,108,159,.22);background:#eef6fb;}
.mkt-page .mkt-toast.error{border-color:rgba(154,51,37,.24);background:#fff3f0;}
.mkt-page .mkt-toast>span{border-radius:999px;padding:4px 8px;background:#111318;color:#fff;font-size:10px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;white-space:nowrap;}
.mkt-page .mkt-toast.success>span{background:#2d7044;}
.mkt-page .mkt-toast.info>span{background:#1f6c9f;}
.mkt-page .mkt-toast.error>span{background:#9a3325;}
.mkt-page .mkt-toast p{margin:0;min-width:0;color:#313740;font-size:12.5px;line-height:1.35;}
.mkt-page .mkt-toast button{width:24px;height:24px;border:0;border-radius:8px;background:rgba(17,19,24,.06);color:#59606b;cursor:pointer;font-size:16px;line-height:1;}
.mkt-page .mkt-toast button:hover{background:rgba(17,19,24,.12);color:#111318;}
.brand-toggle{display:flex;align-items:center;gap:9px;padding:10px 12px;border-radius:999px;background:#fff;border:1px solid rgba(17,19,24,.09);font-size:12px;font-weight:800;white-space:nowrap;color:#313740;}
.brand-toggle input{accent-color:#111318;}
.mkt-page[data-page="brand"] .brand-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,.8fr);gap:14px;align-items:start;}
.mkt-page[data-page="brand"] .brand-panel{border:1px solid rgba(17,19,24,.08);background:rgba(255,255,255,.78);border-radius:16px;padding:16px;box-shadow:0 12px 34px rgba(17,19,24,.08);}
.mkt-page[data-page="brand"] .brand-panel-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px;}
.mkt-page[data-page="brand"] .brand-panel-head span{font-size:14px;font-weight:850;letter-spacing:-.02em;}
.mkt-page[data-page="brand"] .brand-panel-head small{font-size:11px;color:#68707b;text-align:right;line-height:1.35;}
.mkt-page[data-page="brand"] .brand-preview-panel{grid-row:span 2;background:linear-gradient(145deg,#111318,#313740);color:#fff;overflow:hidden;padding:0;}
.mkt-page[data-page="brand"] .brand-preview-card{min-height:330px;padding:28px;display:flex;flex-direction:column;justify-content:flex-end;background:radial-gradient(circle at 82% 18%,var(--brand-accent),transparent 25%);}
.mkt-page[data-page="brand"] .brand-preview-card img{width:74px;max-height:48px;object-fit:contain;margin-bottom:auto;filter:drop-shadow(0 12px 30px rgba(0,0,0,.20));}
.mkt-page[data-page="brand"] .brand-preview-card span{font:700 11px ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:rgba(255,255,255,.62);}
.mkt-page[data-page="brand"] .brand-preview-card h2{margin:12px 0;font-size:36px;line-height:1;letter-spacing:-.05em;max-width:420px;}
.mkt-page[data-page="brand"] .brand-preview-card p{margin:0;color:rgba(255,255,255,.72);line-height:1.55;font-size:13.5px;max-width:460px;}
.mkt-page[data-page="brand"] .brand-swatches{display:flex;gap:7px;margin-top:22px;}
.mkt-page[data-page="brand"] .brand-swatches i{width:28px;height:28px;border-radius:999px;border:1px solid rgba(255,255,255,.26);box-shadow:0 6px 18px rgba(0,0,0,.20);}
.mkt-page[data-page="brand"] .brand-upload-row{display:block;padding:10px 0;border-top:1px solid rgba(17,19,24,.06);}
.mkt-page[data-page="brand"] .brand-upload-row:first-of-type{border-top:0;padding-top:0;}
.mkt-page[data-page="brand"] .brand-file-picker{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:14px;width:100%;border:1px solid rgba(17,19,24,.09);border-radius:14px;background:linear-gradient(180deg,#fff,#f7f8fa);padding:12px 12px 12px 14px;cursor:pointer;transition:border-color .15s,box-shadow .15s,transform .12s;}
.mkt-page[data-page="brand"] .brand-file-picker:hover{border-color:rgba(17,19,24,.20);box-shadow:0 8px 24px rgba(17,19,24,.08);transform:translateY(-1px);}
.mkt-page[data-page="brand"] .brand-file-picker:active{transform:translateY(0);}
.mkt-page[data-page="brand"] .brand-file-picker input{position:absolute;inline-size:1px;block-size:1px;opacity:0;pointer-events:none;}
.mkt-page[data-page="brand"] .brand-file-picker span{display:flex;flex-direction:column;gap:3px;min-width:0;}
.mkt-page[data-page="brand"] .brand-file-picker b{font-size:12.5px;font-weight:850;letter-spacing:-.01em;color:#111318;}
.mkt-page[data-page="brand"] .brand-file-picker small{font-size:11.5px;line-height:1.35;color:#68707b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mkt-page[data-page="brand"] .brand-file-picker em{font-style:normal;border-radius:999px;background:#111318;color:#fff;font-size:11px;font-weight:850;padding:8px 11px;white-space:nowrap;}
.mkt-page[data-page="brand"] .brand-field span{font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}
.mkt-page[data-page="brand"] .brand-paths{display:flex;flex-direction:column;gap:5px;margin-top:12px;font:11px ui-monospace,monospace;color:#68707b;}
.mkt-page[data-page="brand"] .brand-field{display:flex;flex-direction:column;gap:7px;margin-top:12px;}
.mkt-page[data-page="brand"] .brand-field input,.mkt-page[data-page="brand"] .brand-field textarea{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;resize:vertical;}
.mkt-page[data-page="brand"] .brand-field input:focus,.mkt-page[data-page="brand"] .brand-field textarea:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.mkt-page[data-page="brand"] .brand-actions{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid rgba(17,19,24,.08);border-radius:16px;background:rgba(255,255,255,.82);padding:14px 16px;}
.mkt-page[data-page="brand"] .brand-save-status{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;min-width:0;flex:1;}
.mkt-page[data-page="brand"] .brand-save-status b{font-size:10px;font-weight:900;letter-spacing:.10em;text-transform:uppercase;color:#68707b;background:rgba(17,19,24,.06);border-radius:999px;padding:4px 8px;}
.mkt-page[data-page="brand"] .brand-save-status span{font-size:12px;color:#68707b;line-height:1.35;min-width:0;}
.mkt-page[data-page="brand"] .brand-save-status.success b{background:#e8f6ee;color:#2d7044;}
.mkt-page[data-page="brand"] .brand-save-status.success span{color:#2d7044;font-weight:650;}
.mkt-page[data-page="brand"] .brand-save-status.error b{background:#fff0ed;color:#9a3325;}
.mkt-page[data-page="brand"] .brand-save-status.error span{color:#9a3325;font-weight:650;}
.mkt-page[data-page="brand"] .brand-loading{min-height:240px;display:grid;place-items:center;color:#68707b;font-weight:800;}
.mkt-page[data-page="brand"] .brand-share-state{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px;}
.mkt-page[data-page="brand"] .brand-share-state small{font-size:11px;color:#68707b;}
.mkt-page[data-page="brand"] .brand-share-chip{font-size:10px;font-weight:900;letter-spacing:.08em;text-transform:uppercase;color:#68707b;background:rgba(17,19,24,.06);border-radius:999px;padding:5px 10px;}
.mkt-page[data-page="brand"] .brand-share-chip.on{background:#e8f6ee;color:#2d7044;}
.mkt-page[data-page="brand"] .brand-share-chip.org{background:#eef1fb;color:#3a4ba0;}
.mkt-page[data-page="brand"] .brand-share-hint{font-size:12px;color:#68707b;line-height:1.45;margin:6px 0 0;}
.mkt-page[data-page="brand"] .brand-share-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px;border:1px solid rgba(17,19,24,.08);border-radius:12px;background:rgba(255,255,255,.5);margin:4px 0 12px;}
.mkt-page[data-page="brand"] .brand-share-row b{display:block;font-size:13px;font-weight:800;letter-spacing:-.01em;}
.mkt-page[data-page="brand"] .brand-share-row small{font-size:11px;color:#68707b;}
.mkt-page[data-page="brand"] .brand-share-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px;}
@media(max-width:980px){.mkt-page[data-page="brand"] .brand-grid{grid-template-columns:1fr}.mkt-page[data-page="brand"] .brand-preview-panel{grid-row:auto}.mkt-page[data-page="brand"] .brand-actions{flex-direction:column;align-items:stretch}.mkt-page[data-page="brand"] .brand-save-status{grid-template-columns:1fr}.mkt-page[data-page="brand"] .brand-toast{max-width:none;}}

/* v1.0 admin console pages */
.admin-frame,.admin-frame:has(.rail:hover),.admin-frame:has(.rail:focus-within){grid-template-columns:64px 1fr;min-height:100vh;background:radial-gradient(circle at 78% 18%,rgba(232,206,164,.58),transparent 30%),radial-gradient(circle at 25% 80%,rgba(180,191,208,.64),transparent 38%),linear-gradient(135deg,#f5f0e6 0%,#dcd8cf 45%,#c9cdd2 100%);}
.admin-frame .rail{display:contents;}
/* Optimistic pending state on a nav link — visible to the user the instant
   they click, before pathname has resolved. Same accent as resolved-active. */
.admin-frame a[data-nav-pending="true"]{color:#C2452A;background:rgba(194,69,42,.12);box-shadow:inset 0 0 0 1px rgba(194,69,42,.28);}
.admin-frame a[data-nav-pending="true"] .nav-link-pulse{opacity:1;}
/* Per-link pulse dot — driven by Next.js `useLinkStatus()` via the
   <LinkPulse> child component. Fades in only when the Link itself is
   pending, so it tracks the real navigation state, not just the click. */
.nav-link-pulse{position:absolute;top:6px;right:6px;width:6px;height:6px;border-radius:50%;background:#C2452A;opacity:0;pointer-events:none;transition:opacity .12s ease-out;}
.nav-link-pulse[data-nav-pending="true"]{opacity:1;animation:nav-link-pulse 1.05s ease-in-out infinite;}
@keyframes nav-link-pulse{0%,100%{opacity:.55;transform:scale(.85);}50%{opacity:1;transform:scale(1.15);}}
/* Loading-boundary skeleton — renders during route transitions while the
   server component hydrates. Keeps the rail in view, gives the content area
   shape, and pulses subtly so the user knows work is in flight. */
.nav-skeleton{padding:8px 0 4px;}
.nav-skeleton .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.nav-skeleton__header{height:44px;width:46%;max-width:360px;border-radius:14px;background:linear-gradient(90deg,rgba(17,19,24,.06),rgba(17,19,24,.10),rgba(17,19,24,.06));background-size:200% 100%;animation:nav-skeleton-shimmer 1.4s ease-in-out infinite;margin-bottom:22px;}
.nav-skeleton__strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:18px;}
.nav-skeleton__pill{height:68px;border-radius:16px;background:linear-gradient(90deg,rgba(17,19,24,.05),rgba(17,19,24,.09),rgba(17,19,24,.05));background-size:200% 100%;animation:nav-skeleton-shimmer 1.4s ease-in-out infinite;}
.nav-skeleton__pill:nth-child(2){animation-delay:.1s;}
.nav-skeleton__pill:nth-child(3){animation-delay:.2s;}
.nav-skeleton__pill:nth-child(4){animation-delay:.3s;}
.nav-skeleton__rows{display:flex;flex-direction:column;gap:12px;}
.nav-skeleton__row{height:72px;border-radius:16px;background:linear-gradient(90deg,rgba(17,19,24,.04),rgba(17,19,24,.08),rgba(17,19,24,.04));background-size:200% 100%;animation:nav-skeleton-shimmer 1.6s ease-in-out infinite;}
.nav-skeleton__row:nth-child(2){animation-delay:.12s;}
.nav-skeleton__row:nth-child(3){animation-delay:.24s;}
.nav-skeleton__row:nth-child(4){animation-delay:.36s;}
@keyframes nav-skeleton-shimmer{0%{background-position:200% 0;}100%{background-position:-200% 0;}}
@media(prefers-reduced-motion:reduce){.nav-link-pulse[data-nav-pending="true"],.nav-skeleton__header,.nav-skeleton__pill,.nav-skeleton__row{animation:none;}}
.admin-shell{min-width:0;border:1px solid rgba(255,255,255,.75);background:rgba(255,255,255,.70);backdrop-filter:blur(22px) saturate(150%);box-shadow:0 18px 54px rgba(37,36,34,.16);border-radius:22px;overflow:auto;padding:26px;color:#111318;}
.admin-header{display:flex;justify-content:space-between;gap:24px;align-items:flex-start;margin-bottom:20px;}
.admin-header h1{margin:0;font-size:clamp(42px,6vw,84px);line-height:.9;letter-spacing:-.075em;}
.admin-header p{margin:14px 0 0;color:#555d68;font-size:15px;line-height:1.65;max-width:820px;}
.admin-kicker{display:block;font:800 11px ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:var(--accent-600);margin-bottom:12px;}
.admin-header-actions{display:flex;gap:9px;align-items:center;white-space:nowrap;}
.admin-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:0 0 14px;}
.admin-stat{border:1px solid rgba(17,19,24,.08);background:rgba(255,255,255,.78);border-radius:16px;padding:16px;box-shadow:0 10px 30px rgba(17,19,24,.07);}
.admin-stat b{display:block;font-size:34px;line-height:1;letter-spacing:-.06em;}
.admin-stat span{display:block;margin-top:7px;text-transform:uppercase;letter-spacing:.12em;color:#68707b;font-size:10px;font-weight:850;}
.admin-stat.mars{background:#fff0ed;border-color:rgba(194,69,42,.22);}
.admin-grid{display:grid;gap:14px;margin-bottom:14px;align-items:start;}.admin-grid.two{grid-template-columns:minmax(0,1fr) minmax(280px,.65fr);}.approvals-layout{grid-template-columns:minmax(0,1.15fr) minmax(300px,.65fr);}.reports-layout{grid-template-columns:1fr 1fr;}
.admin-panel{border:1px solid rgba(17,19,24,.08);background:rgba(255,255,255,.78);border-radius:16px;padding:16px;box-shadow:0 12px 34px rgba(17,19,24,.08);margin-bottom:14px;}
.admin-panel-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px;}
.admin-panel-head span{font-size:14px;font-weight:850;letter-spacing:-.02em;text-transform:capitalize;}.admin-panel-head small{font-size:11px;color:#68707b;text-align:right;line-height:1.35;max-width:360px;}
.admin-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;}.admin-form label{display:flex;flex-direction:column;gap:7px;font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}.admin-form label.wide,.admin-form button{grid-column:1/-1}.admin-form label.check{flex-direction:row;align-items:center;text-transform:none;font-size:12px;letter-spacing:0;color:#313740;}
.admin-form input,.admin-form textarea,.admin-form select{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;resize:vertical;}.admin-form input:focus,.admin-form textarea:focus,.admin-form select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
/* admin-form-grid + admin-field — used by the /admin Org Settings + Invite member
   forms and the AuditTable filters. These class names are referenced from JSX
   without the wrapping .admin-form, so they need their own root rules. */
.admin-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;align-items:start;}
.admin-field{display:flex;flex-direction:column;gap:6px;min-width:0;}
.admin-field.admin-field-wide{grid-column:1/-1;}
.admin-field>span{font-size:10.5px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.admin-field>small{font-size:11px;color:#7a818c;line-height:1.45;}
.admin-field input,.admin-field textarea,.admin-field select,.admin-input{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 12px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.admin-field input:focus,.admin-field textarea:focus,.admin-field select:focus,.admin-input:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.admin-field textarea{resize:vertical;min-height:88px;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:12px;}
/* Buttons referenced from JSX. admin-btn-sm renders compact secondary; danger variant uses mars hue. */
.admin-btn-sm{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:1px solid rgba(17,19,24,.12);border-radius:10px;background:#fff;color:#111318;font:600 12px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:-.005em;cursor:pointer;transition:border-color .14s ease,background .14s ease,box-shadow .14s ease,transform .1s;}
.admin-btn-sm:hover{border-color:rgba(17,19,24,.24);background:#fafbfc;box-shadow:0 4px 10px rgba(17,19,24,.06);}
.admin-btn-sm:active{transform:translateY(1px);}
.admin-btn-sm:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;}
.admin-btn-danger-sm{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:32px;padding:0 12px;border:1px solid rgba(194,69,42,.30);border-radius:10px;background:#fff;color:var(--accent-700,#9a3325);font:600 12px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:-.005em;cursor:pointer;transition:border-color .14s ease,background .14s ease,box-shadow .14s ease,transform .1s;}
.admin-btn-danger-sm:hover{border-color:var(--accent-500,#c2452a);background:#fff5f1;box-shadow:0 4px 10px rgba(194,69,42,.14);}
.admin-btn-danger-sm:active{transform:translateY(1px);}
/* Muted helper used for cells without data + secondary text. */
.admin-muted{color:#9aa0aa;font-style:normal;}
/* Account / org definition grid (Settings > Account). */
.account-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px 22px;margin:12px 0 0;padding:0;}
.account-meta>div{display:flex;flex-direction:column;gap:2px;min-width:0;}
.account-meta dt{font:600 10.5px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:.05em;text-transform:uppercase;color:#9aa0aa;margin:0;}
.account-meta dd{margin:0;font:500 13px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;word-break:break-word;}
.account-meta dd.mono,.mono{font-family:var(--font-mono-brand,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;letter-spacing:-.01em;color:#3b4048;}
/* Invite form row + form actions + share-links action bar. */
.admin-form-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px;}
.admin-form-row>input,.admin-form-row>select{flex:1;min-width:160px;border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:8px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.admin-form-row>input:focus,.admin-form-row>select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.admin-form-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px;}
.admin-invite-form .admin-record-top{margin-bottom:10px;}
/* admin-select — standalone select that does not live inside .admin-form. */
.admin-select{border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:8px 28px 8px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;cursor:pointer;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%2368707b' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat:no-repeat;background-position:right 8px center;background-size:14px 14px;}
.admin-select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
/* Primary CTA button, used for "Invite", "Save", etc. */
.admin-btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 14px;border:1px solid transparent;border-radius:10px;background:var(--accent-500,#c2452a);color:#fff;font:600 12.5px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:-.005em;cursor:pointer;transition:background .14s ease,box-shadow .14s ease,transform .1s;}
.admin-btn-primary:hover{background:var(--accent-600,#9a3325);box-shadow:0 4px 12px rgba(194,69,42,.24);}
.admin-btn-primary:active{transform:translateY(1px);}
.admin-btn-primary:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;}
/* In-table role select on the Members row should not look like a CTA. */
.admin-table select{border:1px solid rgba(17,19,24,.10);border-radius:8px;background:#fff;padding:5px 22px 5px 8px;font:12px/1 ui-sans-serif,system-ui,sans-serif;color:#111318;cursor:pointer;
  appearance:none;-webkit-appearance:none;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%2368707b' d='M4 6l4 4 4-4z'/></svg>");
  background-repeat:no-repeat;background-position:right 6px center;background-size:12px 12px;}
/* Audit table filter row + export links. AuditTable renders inline styles for layout but
   relies on these classes for typography. Scope to /admin so we don't bleed into other surfaces. */
.mkt-page[data-page="admin"] .audit-filter-row{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-bottom:14px;}
.mkt-page[data-page="admin"] .audit-filter-row label{display:flex;flex-direction:column;gap:5px;}
.mkt-page[data-page="admin"] .audit-filter-row label>span{font-size:10.5px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.mkt-page[data-page="admin"] .admin-panel-head a{font-size:12px;font-weight:700;color:var(--accent-700,#9a3325);text-decoration:none;padding:4px 8px;border-radius:8px;transition:background .14s ease;}
.mkt-page[data-page="admin"] .admin-panel-head a:hover{background:rgba(194,69,42,.08);text-decoration:none;}
.admin-button{border:0;border-radius:999px;background:#111318;color:#fff;font-size:12px;font-weight:850;padding:9px 13px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;}.admin-button:hover{background:#2a2d33}.admin-button.secondary{background:#fff;color:#111318;border:1px solid rgba(17,19,24,.12);}.admin-button.mars{background:var(--accent-500);}.admin-button:disabled{opacity:.5;cursor:not-allowed;}.admin-button.danger{background:#fff;color:#b91c1c;border:1px solid rgba(185,28,28,.2);}.admin-button.danger:hover{background:#fef2f2;border-color:#b91c1c;}
.admin-button[aria-busy="true"]{background:#2a2d33;opacity:.9;cursor:progress;}
.agent-run-spinner{width:10px;height:10px;border-radius:999px;border:1.5px solid rgba(255,255,255,.32);border-top-color:#fff;animation:agent-run-spin .7s linear infinite;display:inline-block;}
@keyframes agent-run-spin{to{transform:rotate(360deg)}}
.admin-copy{font-size:13px;line-height:1.65;color:#555d68;}.admin-copy h2{font-size:15px;letter-spacing:-.02em;color:#111318;margin:16px 0 4px;}.admin-copy h2:first-child{margin-top:0}.admin-copy p{margin:0 0 12px;}.admin-copy b{color:#111318;}
.admin-table-wrap{overflow:auto;border:1px solid rgba(17,19,24,.06);border-radius:12px;background:#fff;}.admin-table{width:100%;border-collapse:collapse;font-size:12.5px;}.admin-table th{padding:10px 12px;text-align:left;font-size:10px;letter-spacing:.10em;text-transform:uppercase;color:#68707b;background:#f5f6f8;border-bottom:1px solid rgba(17,19,24,.08);white-space:nowrap;}.admin-table td{padding:12px;border-bottom:1px solid rgba(17,19,24,.06);vertical-align:top;color:#313740;}.admin-table tr:last-child td{border-bottom:0}.admin-table td b{display:block;color:#111318;font-size:12.5px;}.admin-table td small{display:block;margin-top:4px;color:#7a818c;font-size:11px;}
.admin-pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:4px 8px;background:#eef2f6;color:#59616d;font-size:10px;font-weight:850;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;}.admin-pill.ready{background:#e8f6ee;color:#2d7044;}.admin-pill.warn{background:#fff4d8;color:#80611b;}.admin-pill.danger{background:#ffe3df;color:#9a3325;}.admin-pill.neutral{background:#eef2f6;color:#59616d;}
.admin-card-list{display:flex;flex-direction:column;gap:10px;}.admin-card-list.compact{max-height:720px;overflow:auto;}.admin-record{border:1px solid rgba(17,19,24,.07);border-radius:14px;background:#fff;padding:13px;}.admin-record.on{background:linear-gradient(180deg,#fff,#fbfbfc);}.admin-record.needs-action{border-color:rgba(154,51,37,.28);background:linear-gradient(180deg,#fff,#fff8f6);box-shadow:0 10px 28px rgba(154,51,37,.08);}.admin-record.compact{padding:11px;}.admin-record-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}.admin-record-top b{font-size:13px;color:#111318;letter-spacing:-.01em;}.admin-record-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end;}.admin-record p{margin:7px 0 0;color:#59616d;font-size:12px;line-height:1.5;}.admin-alert-text{color:#9a3325!important;font-weight:750;}.admin-operator-alert{border-color:rgba(154,51,37,.22);background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(255,248,246,.88));}.admin-operator-alert p{margin:0;color:#9a3325;font-size:13px;font-weight:750;line-height:1.55;}.admin-record pre{margin:10px 0 0;max-height:220px;overflow:auto;white-space:pre-wrap;border-radius:10px;background:#101216;color:#f7f2e8;padding:11px;font:11px/1.55 ui-monospace,monospace;}.admin-record small{display:block;margin-top:7px;color:#7a818c;font-size:11px;}.admin-inline-actions{display:flex;gap:8px;margin-top:10px;}.admin-pills{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end;}
.admin-tool-meta{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0;}.admin-tool-meta span{font-size:10.5px;font-weight:700;border-radius:999px;padding:4px 8px;background:rgba(17,19,24,.06);color:#68707b;}.admin-tool-meta b{color:#313740;}.admin-connector-grid,.admin-guide-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}.admin-mini-card{border:1px solid rgba(17,19,24,.07);border-radius:14px;background:#fff;padding:13px;text-decoration:none;color:#111318;}.admin-mini-card div{display:flex;align-items:center;justify-content:space-between;gap:10px;}.admin-mini-card b{font-size:13px;text-transform:capitalize;}.admin-mini-card p{margin:7px 0 0;color:#59616d;font-size:12px;line-height:1.45;}.admin-mini-card.link:hover{border-color:rgba(194,69,42,.32);box-shadow:0 12px 28px rgba(17,19,24,.08);}
a.admin-record-link{display:block;text-decoration:none;color:inherit;transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease;}a.admin-record-link:hover{border-color:rgba(194,69,42,.32);box-shadow:0 12px 28px rgba(17,19,24,.08);transform:translateY(-1px);}a.admin-record-link:focus-visible{outline:2px solid #111318;outline-offset:2px;}
.admin-empty{border:1px dashed rgba(17,19,24,.16);border-radius:14px;background:rgba(255,255,255,.62);padding:26px;text-align:center;color:#68707b;}.admin-empty b{display:block;color:#111318;margin-bottom:6px;}.admin-empty p{margin:0;font-size:13px;}.admin-link{display:inline-flex;margin-top:8px;color:#9a3325;font-size:12px;font-weight:850;text-decoration:none;}.admin-link:hover{text-decoration:underline;}
/* Marketplace · Connection setup modal */
.connection-setup{display:flex;flex-direction:column;gap:16px;}
.connection-setup-step{display:flex;flex-direction:column;gap:14px;}
.connection-setup-step-form{gap:16px;}
.connection-setup-intro,.connection-setup-benefit{margin:0;font-size:13.5px;line-height:1.6;color:#555d68;}
.connection-setup-benefit b{color:#111318;}
.connection-setup-unlocks{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:6px;font-size:12.5px;color:#555d68;}
.connection-setup-unlocks li{padding:8px 11px;background:#f5f6f8;border-radius:10px;line-height:1.5;}
.connection-setup-unlocks li b{color:#111318;}
.connection-setup-risk{margin:0;padding:10px 12px;background:#fff4d8;color:#80611b;border-radius:10px;font-size:12.5px;line-height:1.55;}
.connection-setup-risk b{color:#5c4711;}
.connection-setup-field{display:flex;flex-direction:column;gap:6px;}
.connection-setup-field-label{font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}
.connection-setup-field-label small{margin-left:6px;font-size:10.5px;font-weight:700;letter-spacing:.06em;color:#9aa1ac;text-transform:none;}
.connection-setup-field input{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.connection-setup-field input::placeholder{color:#aab0ba;}
.connection-setup-field input:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.connection-setup-field input:disabled{opacity:.55;cursor:not-allowed;background:#fafbfc;}
.connection-setup-field-help{display:block;font-size:11.5px;line-height:1.5;color:#7a818c;}
.connection-setup-field-help a{color:#9a3325;font-weight:700;text-decoration:none;}
.connection-setup-field-help a:hover{text-decoration:underline;}
.connection-setup-error{margin:0;padding:10px 12px;background:#ffe3df;color:#9a3325;border-radius:10px;font-size:12.5px;line-height:1.55;}
.connection-setup-error small{display:block;margin-top:4px;font-size:11.5px;color:#7a3a30;}
.connection-setup-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px;}
.connection-setup-step-verify{align-items:center;padding:18px 0;color:#68707b;font-size:13px;}
.connection-setup-done-head{display:flex;align-items:center;gap:10px;}
.connection-setup-done-head h3{margin:0;font-size:16px;letter-spacing:-.02em;color:#111318;}
.connection-setup-summary{margin:0;font-size:12.5px;color:#555d68;line-height:1.55;}
.connection-setup-summary span+span{margin-left:4px;}
.connection-setup-unlocked{margin:0;font-size:12.5px;color:#2d7044;}
.connection-setup-deeplink{margin:0;}
.connection-status{display:inline-flex;align-items:center;padding:4px 9px;border-radius:999px;font-size:10.5px;font-weight:850;letter-spacing:.06em;text-transform:uppercase;background:#eef2f6;color:#59616d;}
.connection-status.connected{background:#e8f6ee;color:#2d7044;}
.connection-status.error{background:#ffe3df;color:#9a3325;}
.connection-status.pending{background:#fff4d8;color:#80611b;}
.connection-setup-warning{margin:0;padding:10px 12px;background:#fff4d8;color:#80611b;border-radius:10px;font-size:12.5px;line-height:1.55;}
.connection-setup-warning b{color:#5c4711;}
/* Scope picker */
.scope-picker{display:flex;flex-direction:column;gap:9px;border:1px solid rgba(17,19,24,.08);border-radius:12px;padding:12px 13px;margin:0;background:rgba(245,246,248,.5);}
.scope-picker[disabled]{opacity:.55;}
.scope-picker-legend{padding:0 6px;margin-left:-6px;font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}
.scope-picker-label{font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}
.scope-picker--locked{flex-direction:row;align-items:center;gap:10px;}
.scope-picker-locked-value{font-size:12.5px;color:#111318;text-transform:capitalize;}
.scope-picker-radio{display:flex;align-items:flex-start;gap:9px;padding:8px 10px;border-radius:10px;cursor:pointer;transition:background .12s ease;}
.scope-picker-radio:hover{background:rgba(255,255,255,.55);}
.scope-picker-radio input[type=radio]{margin-top:3px;accent-color:#111318;}
.scope-picker-radio input[type=radio]:disabled{cursor:not-allowed;}
.scope-picker-radio-body{display:flex;flex-direction:column;gap:3px;flex:1;}
.scope-picker-radio-body b{font-size:12.5px;color:#111318;letter-spacing:-.01em;}
.scope-picker-radio-body small{font-size:11.5px;color:#7a818c;line-height:1.45;}
.scope-picker-select{margin-top:6px;width:100%;border:1px solid rgba(17,19,24,.10);border-radius:9px;background:#fff;padding:7px 9px;font:12.5px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.scope-picker-select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.scope-picker-error{display:block;margin-top:4px;font-size:11.5px;color:#9a3325;}
/* Connection card install chip-list */
.connection-card-installs{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:6px;}
.connection-card-installs li{display:inline-flex;}
.connection-card-add{border:1px dashed rgba(17,19,24,.20);background:transparent;color:#59616d;font-size:11px;font-weight:700;border-radius:999px;padding:5px 11px;cursor:pointer;letter-spacing:.01em;}
.connection-card-add:hover{border-color:rgba(17,19,24,.40);color:#111318;background:rgba(255,255,255,.5);}
.connection-scope-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 9px 4px 6px;border-radius:999px;background:#eef2f6;color:#313740;font-size:11px;font-weight:700;line-height:1.3;}
.connection-scope-badge.scope-global{background:#eef2f6;color:#3a4250;}
.connection-scope-badge.scope-project{background:#e6efff;color:#1f3a7a;}
.connection-scope-badge.scope-agent{background:#f5e8ff;color:#5a2c83;}
.connection-scope-badge-scope{display:inline-flex;align-items:center;padding:2px 6px;background:rgba(255,255,255,.7);border-radius:6px;font-size:9.5px;font-weight:850;text-transform:uppercase;letter-spacing:.06em;}
.connection-scope-badge-label{font-weight:850;letter-spacing:-.005em;}
.connection-scope-badge-sub{font-weight:600;color:rgba(0,0,0,.45);font-size:10.5px;margin-left:2px;}
/* Agent detail · Connections list */
.agent-detail-connections{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px;}
.agent-detail-connection-row{display:flex;align-items:center;gap:10px;padding:9px 11px;border:1px solid rgba(17,19,24,.07);border-radius:10px;background:#fff;text-decoration:none;color:#111318;transition:border-color .12s ease, transform .12s ease;}
.agent-detail-connection-row:hover{border-color:rgba(17,19,24,.18);}
.agent-detail-connection-title{font-size:12.5px;font-weight:850;}
.agent-detail-connection-meta{font-size:11.5px;color:#7a818c;}
@media(max-width:1100px){.admin-stats,.admin-connector-grid,.admin-guide-grid{grid-template-columns:repeat(2,minmax(0,1fr));}.admin-grid.two,.approvals-layout,.reports-layout{grid-template-columns:1fr;}.admin-header{flex-direction:column}.admin-header-actions{white-space:normal}.admin-form{grid-template-columns:1fr;}}
@media(max-width:760px){.admin-frame,.admin-frame:has(.rail:hover),.admin-frame:has(.rail:focus-within){height:auto;min-height:100vh;grid-template-columns:56px 1fr}.admin-shell{padding:18px;border-radius:18px}.admin-stats,.admin-connector-grid,.admin-guide-grid{grid-template-columns:1fr}.admin-header h1{font-size:42px;}.admin-panel-head{flex-direction:column}.admin-panel-head small{text-align:left}.admin-record-top{flex-direction:column}.admin-pills{justify-content:flex-start;}}
/* Agents page */
.agents-new-cta{padding-left:11px;}
.agents-new-cta-glyph{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:999px;background:rgba(255,255,255,.18);font-size:13px;font-weight:700;line-height:1;}
.agent-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:14px;align-items:stretch;margin:0 0 18px;}
.agent-card{display:flex;flex-direction:column;border:1px solid rgba(17,19,24,.07);border-radius:18px;background:rgba(255,255,255,.78);box-shadow:0 12px 34px rgba(17,19,24,.07);overflow:hidden;transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease,background .22s ease;position:relative;}
.agent-card::before{content:"";position:absolute;inset:0 0 auto 0;height:1px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.85),transparent);opacity:.6;pointer-events:none;}
.agent-card:hover{transform:translateY(-1px);box-shadow:0 18px 44px rgba(17,19,24,.10);border-color:rgba(17,19,24,.10);background:rgba(255,255,255,.88);}
.agent-card-link{display:flex;flex:1;min-width:0;text-decoration:none;color:inherit;}
.agent-card-main{flex:1;display:flex;flex-direction:column;gap:14px;padding:18px 18px 14px;min-width:0;}
.agent-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;}
.agent-card-identity{display:flex;align-items:center;gap:12px;min-width:0;flex:1;}
.agent-monogram{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:13px;background:linear-gradient(135deg,#f5ecdc,#cdb78a);color:#1f1a12;font:850 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.02em;box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 4px 14px rgba(17,19,24,.10);text-shadow:0 1px 0 rgba(255,255,255,.35);}
.agent-card-identity-text{display:flex;flex-direction:column;gap:2px;min-width:0;}
.agent-card-name{font-size:15.5px;font-weight:850;letter-spacing:-.025em;color:#111318;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.agent-card-title{font-size:11.5px;color:#7a818c;letter-spacing:.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.agent-card-mission{font-size:13px;color:#555d68;line-height:1.5;margin:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.agent-card-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:auto;}
.agent-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;background:rgba(17,19,24,.045);border:1px solid rgba(17,19,24,.04);font-size:11px;color:#3f454f;line-height:1;}
.agent-chip-label{font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#9aa0aa;font-size:9.5px;}
.agent-chip-value{font-variant-numeric:tabular-nums;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#1f242c;}
.agent-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px 12px 18px;border-top:1px solid rgba(17,19,24,.05);background:linear-gradient(180deg,rgba(252,251,248,.6),rgba(245,243,238,.85));}
.agent-card-last{display:inline-flex;align-items:center;gap:8px;font-size:11.5px;color:#7a818c;font-variant-numeric:tabular-nums;}
.agent-dot{display:inline-block;width:7px;height:7px;border-radius:999px;background:#c7cdd5;box-shadow:0 0 0 3px rgba(199,205,213,.18);}
.agent-dot.on{background:#3aa66f;box-shadow:0 0 0 3px rgba(58,166,111,.18);}
.agent-card-actions{display:inline-flex;gap:6px;align-items:center;flex-shrink:0;}
.agent-card-actions form{display:inline-flex;}
.agent-card-actions .admin-button{padding:6px 11px;font-size:11.5px;height:28px;}
.admin-button.icon{padding:0;width:28px;height:28px;}
.admin-button.icon svg{display:block;}
/* New agent modal */
.agents-modal{padding:0;border:0;border-radius:22px;background:transparent;color:inherit;max-width:min(560px,92vw);width:100%;}
.agents-modal--wide{max-width:min(1040px,94vw);}
.agents-modal::backdrop{background:rgba(28,26,22,.42);backdrop-filter:blur(6px);}
.agents-modal[open]{animation:agents-modal-in .22s cubic-bezier(.2,.7,.2,1.05) both;}
.agents-modal[open]::backdrop{animation:agents-modal-fade .22s ease both;}
@keyframes agents-modal-in{from{transform:translateY(8px) scale(.985);opacity:0;}to{transform:none;opacity:1;}}
@keyframes agents-modal-fade{from{opacity:0;}to{opacity:1;}}
.agents-modal-card{position:relative;border:1px solid rgba(255,255,255,.85);background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(252,250,246,.96));border-radius:22px;box-shadow:0 32px 80px rgba(17,19,24,.30),0 2px 0 rgba(255,255,255,.6) inset;padding:22px 22px 18px;max-height:88vh;overflow:auto;}
.agents-modal-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px;}
.agents-modal-head h2{margin:0;font-size:24px;letter-spacing:-.035em;line-height:1.1;color:#111318;}
.agents-modal-close{appearance:none;border:1px solid rgba(17,19,24,.10);background:#fff;color:#59616d;width:32px;height:32px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease,color .15s ease;}
.agents-modal-close:hover{background:#f5f3ee;color:#111318;}
.agents-modal-form{display:flex;flex-direction:column;gap:18px;}
.agents-modal-section{display:flex;flex-direction:column;gap:10px;}
.agents-modal-section-head{display:flex;flex-direction:column;gap:2px;}
.agents-modal-section-head span{font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.agents-modal-section-head small{font-size:11.5px;color:#9aa0aa;}
.agents-modal-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.agents-modal-field{display:flex;flex-direction:column;gap:6px;min-width:0;}
.agents-modal-field.wide{grid-column:1/-1;}
.agents-modal-field>span{font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.agents-modal-field input,.agents-modal-field textarea,.agents-modal-field select{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 12px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;transition:border-color .15s ease,box-shadow .15s ease;}
.agents-modal-field textarea{resize:vertical;min-height:74px;}
.agents-modal-field input:focus,.agents-modal-field textarea:focus,.agents-modal-field select:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.agents-modal-engine{gap:8px;}
.agents-modal-engine select,.agents-modal-engine input{height:34px;padding:0 11px;font:13px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;}
.agents-modal-advanced{margin:0;border-top:1px dashed rgba(17,19,24,.10);padding-top:14px;}
.agents-modal-advanced>summary{cursor:pointer;list-style:none;font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;user-select:none;display:inline-flex;align-items:center;gap:6px;}
.agents-modal-advanced>summary::-webkit-details-marker{display:none;}
.agents-modal-advanced>summary::before{content:"+";display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border-radius:999px;background:rgba(17,19,24,.07);color:#68707b;font-size:11px;}
.agents-modal-advanced[open]>summary::before{content:"−";}
.agents-modal-advanced[open]>summary{color:#111318;}
.agents-modal-advanced .agents-modal-grid{margin-top:12px;}
.agents-modal-foot{display:flex;justify-content:flex-end;gap:8px;padding-top:14px;border-top:1px solid rgba(17,19,24,.06);margin-top:4px;}
/* Split modal — left rail of items, right canvas of form. macOS System Settings pattern. */
.agents-modal--wide .agents-modal-card{padding:0;overflow:hidden;max-height:min(820px,92vh);display:flex;flex-direction:column;}
.agents-modal--wide .agents-modal-head{margin:0;padding:22px 24px 18px;border-bottom:1px solid rgba(17,19,24,.06);}
.agents-modal-form--split{display:flex;flex-direction:column;flex:1;min-height:0;gap:0;}
.agents-modal-body{display:grid;grid-template-columns:minmax(0,360px) minmax(0,1fr);flex:1;min-height:0;}
.agents-modal-aside{position:relative;display:flex;flex-direction:column;gap:14px;min-height:0;padding:20px 22px 22px;background:#f7f5f0;border-right:1px solid rgba(17,19,24,.07);overflow:hidden;}
.agents-modal-aside::after{content:'';position:absolute;left:22px;right:22px;bottom:22px;height:32px;pointer-events:none;background:linear-gradient(to bottom,rgba(247,245,240,0),#f7f5f0 85%);border-radius:0 0 14px 14px;}
.agents-modal-main{position:relative;}
.agents-modal-main::after{content:'';position:sticky;display:block;bottom:0;left:0;right:0;height:24px;margin-top:-24px;pointer-events:none;background:linear-gradient(to bottom,rgba(255,255,255,0),#fff 90%);}
.agents-modal-aside-head{display:flex;flex-direction:column;gap:3px;}
.agents-modal-aside-head h3{margin:0;font-size:15px;font-weight:650;letter-spacing:-.01em;color:#111318;}
.agents-modal-aside-head p{margin:0;font-size:12.5px;line-height:1.45;color:#68707b;}
.agents-modal-aside .tool-picker{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;}
.agents-modal-aside .tool-picker-list{flex:1;min-height:0;max-height:none;}
.agents-modal-main{display:flex;flex-direction:column;gap:18px;padding:22px 26px 24px;overflow-y:auto;min-height:0;}
.agents-modal--wide .agents-modal-foot{margin:0;padding:14px 24px 20px;border-top:1px solid rgba(17,19,24,.06);background:rgba(252,250,246,.6);}
@media(max-width:880px){.agents-modal-body{grid-template-columns:1fr;grid-template-rows:minmax(0,42vh) minmax(0,1fr);}.agents-modal-aside{border-right:0;border-bottom:1px solid rgba(17,19,24,.07);}}
/* Shared modal primitives — used by every AdminModal across the app */
.agents-modal-card--danger{background:linear-gradient(180deg,rgba(255,250,249,.98),rgba(252,247,246,.98));}
.agents-modal-card--danger .agents-modal-head h2{color:#7c2b19;}
.agents-modal-help{margin:0;font-size:13px;line-height:1.55;color:#59616d;}
.agents-modal-error{margin:0;font-size:12.5px;line-height:1.5;color:#b91c1c;padding:8px 10px;border-radius:10px;background:rgba(185,28,28,.06);border:1px solid rgba(185,28,28,.12);}
.agents-modal-check{flex-direction:row !important;align-items:center;gap:10px;}
.agents-modal-check input[type="checkbox"]{width:16px;height:16px;accent-color:var(--accent-600);}
.agents-modal-check>span{font-size:13px !important;font-weight:500 !important;letter-spacing:0 !important;text-transform:none !important;color:#3f454f !important;}
.agents-modal-radio-group{display:flex;flex-direction:column;gap:8px;}
.agents-modal-radio{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border:1px solid rgba(17,19,24,.10);border-radius:14px;background:#fff;cursor:pointer;transition:border-color .15s ease,background .15s ease;min-width:0;max-width:100%;overflow:hidden;box-sizing:border-box;}
.agents-modal-radio:hover{border-color:rgba(17,19,24,.22);}
.agents-modal-radio.on,.agents-modal-radio:has(input[type="radio"]:checked){border-color:rgba(17,19,24,.36);background:#fafaf7;}
.agents-modal-radio input[type="radio"]{margin-top:3px;accent-color:var(--accent-600);}
.agents-modal-radio-body{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1 1 0%;max-width:100%;overflow:hidden;}
.agents-modal-radio-body b{font-size:13px;font-weight:600;color:#111318;letter-spacing:-.01em;}
.agents-modal-radio-body code{display:block;width:100%;max-width:100%;font:11px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;color:#68707b;background:rgba(17,19,24,.04);padding:4px 8px;border-radius:6px;word-break:break-all;overflow-wrap:anywhere;white-space:pre-wrap;box-sizing:border-box;overflow:hidden;}
.agents-modal-radio-body small{font-size:12px;color:#68707b;line-height:1.5;}
/* Schedule picker — frequency dropdown + contextual sub-fields. */
.schedule-picker{display:flex;flex-direction:column;gap:10px;}
.schedule-picker-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px 12px;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fafaf7;}
.schedule-picker-stack{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fafaf7;}
.schedule-picker-stack .schedule-picker-row{border:0;background:transparent;padding:0;}
.schedule-picker-prefix,.schedule-picker-suffix{font-size:12.5px;color:#68707b;font-weight:500;}
.schedule-picker-select,.schedule-picker-time,.schedule-picker-datetime{border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:7px 10px;font:13px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;transition:border-color .15s ease,box-shadow .15s ease;}
.schedule-picker-select:focus,.schedule-picker-time:focus,.schedule-picker-datetime:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.schedule-picker-day-row{display:flex;gap:6px;flex-wrap:wrap;}
.schedule-picker-day-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:999px;border:1px solid rgba(17,19,24,.10);background:#fff;cursor:pointer;font-size:12px;font-weight:600;color:#3f454f;transition:border-color .15s ease,background .15s ease,color .15s ease;}
.schedule-picker-day-chip:hover{border-color:rgba(17,19,24,.22);}
.schedule-picker-day-chip.on,.schedule-picker-day-chip:has(input:checked){background:#111318;color:#fff;border-color:#111318;}
.schedule-picker-day-chip input{position:absolute;inset:0;opacity:0;cursor:pointer;}
.schedule-picker-day-chip span{pointer-events:none;}
.agents-modal-paste-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.agents-modal-paste-row input{flex:1 1 220px;min-width:0;max-width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 12px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.agents-modal-paste-row .admin-button{flex:0 0 auto;}
.agents-modal-folder-tools{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.agents-modal-folder-tools .admin-button{font-size:12px;padding:6px 10px;}
.agents-modal-create-folder{display:grid;grid-template-columns:1fr;gap:8px;margin-top:10px;padding:12px;border:1px dashed rgba(17,19,24,.14);border-radius:12px;background:rgba(252,250,246,.6);}
.agents-modal-create-folder input{width:100%;min-width:0;box-sizing:border-box;border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:8px 10px;font:13px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.agents-modal-create-folder .agents-modal-create-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;}
.agents-modal-create-folder .agents-modal-create-row > input{flex:1 1 200px;}
.agents-modal-create-folder small{font-size:11px;color:#68707b;line-height:1.4;}
.agents-modal-paste-row input:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.agents-modal-feedback{margin:0;font-size:12px;color:#59616d;}
.agents-modal-feedback.success{color:#1f6c4c;}
.agents-modal-feedback.error{color:#b91c1c;}
.agents-modal-swatches{display:flex;gap:10px;flex-wrap:wrap;border:0;padding:0;margin:0;}
.agents-modal-swatch{position:relative;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;}
.agents-modal-swatch input{position:absolute;inset:0;opacity:0;cursor:pointer;}
.agents-modal-swatch-ring{display:block;width:24px;height:24px;border-radius:999px;background:var(--swatch);box-shadow:0 0 0 1px rgba(17,19,24,.08);transition:transform .15s ease,box-shadow .15s ease;}
.agents-modal-swatch:hover .agents-modal-swatch-ring{transform:scale(1.08);}
.agents-modal-swatch input:checked + .agents-modal-swatch-ring{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--swatch);}
.agents-modal-swatch input:focus-visible + .agents-modal-swatch-ring{box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(17,19,24,.4);}
.agents-modal-chip-row{display:flex;gap:6px;flex-wrap:wrap;}
.agents-modal-chip-row code{font:11px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;background:rgba(17,19,24,.05);color:#3f454f;padding:5px 9px;border-radius:8px;}
.agents-modal-inline-code{font:12px/1 ui-monospace,SFMono-Regular,Menlo,monospace;background:rgba(17,19,24,.05);padding:2px 6px;border-radius:6px;color:#111318;font-weight:600;letter-spacing:0;text-transform:none;}
/* Tool picker — multi-select with brand icons, search, risk badges */
.tool-picker{display:flex;flex-direction:column;gap:10px;}
.tool-picker-chip-row{display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-height:28px;padding:6px;border:1px dashed rgba(17,19,24,.10);border-radius:12px;background:rgba(252,250,246,.55);}
.tool-picker-chip-empty{font-size:12px;color:#9aa0aa;padding:2px 6px;letter-spacing:0;text-transform:none;font-weight:400;}
.tool-picker-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 6px 5px 9px;border-radius:999px;background:#111318;color:#fff;font-size:11.5px;font-weight:600;letter-spacing:0;text-transform:none;line-height:1;animation:tool-chip-in .14s ease-out both;}
@keyframes tool-chip-in{from{opacity:0;transform:scale(.92);}to{opacity:1;transform:none;}}
.tool-picker-chip svg{color:#fff;opacity:.9;}
.tool-picker-chip-title{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tool-picker-chip-x{appearance:none;border:0;background:rgba(255,255,255,.16);color:#fff;width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:background .12s ease;}
.tool-picker-chip-x:hover{background:rgba(255,255,255,.28);}
.tool-picker-clear{margin-left:auto;appearance:none;border:0;background:transparent;color:#68707b;font-size:11px;font-weight:600;cursor:pointer;padding:4px 6px;border-radius:6px;letter-spacing:0;text-transform:none;}
.tool-picker-clear:hover{color:#111318;background:rgba(17,19,24,.04);}
.tool-picker-search{position:relative;display:flex;align-items:center;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:0 10px;transition:border-color .15s ease,box-shadow .15s ease;}
.tool-picker-search:focus-within{border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.tool-picker-search svg{color:#9aa0aa;flex-shrink:0;}
.tool-picker-search input{flex:1;border:0;background:transparent;padding:9px 8px;font:13px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;outline:0;}
.tool-picker-search input::placeholder{color:#9aa0aa;}
.tool-picker-search-clear{appearance:none;border:0;background:rgba(17,19,24,.06);color:#59616d;width:20px;height:20px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;}
.tool-picker-search-clear:hover{background:rgba(17,19,24,.10);color:#111318;}
.tool-picker-list{max-height:340px;overflow-y:auto;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:#fff;padding:6px;display:flex;flex-direction:column;gap:8px;scrollbar-width:thin;scrollbar-color:rgba(17,19,24,.18) transparent;}
.tool-picker-list::-webkit-scrollbar{width:8px;}
.tool-picker-list::-webkit-scrollbar-thumb{background:rgba(17,19,24,.14);border-radius:999px;}
.tool-picker-list::-webkit-scrollbar-thumb:hover{background:rgba(17,19,24,.22);}
.tool-picker-empty{padding:24px 12px;text-align:center;font-size:12.5px;color:#9aa0aa;}
.tool-picker-group{display:flex;flex-direction:column;gap:2px;}
.tool-picker-group-head{position:sticky;top:0;display:flex;align-items:center;gap:6px;padding:8px 10px 4px;background:linear-gradient(180deg,#fff 70%,rgba(255,255,255,0));font-size:10.5px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;z-index:1;}
.tool-picker-group-head svg{opacity:.9;}
.tool-picker-group-head small{margin-left:auto;font-size:10.5px;font-weight:700;color:#9aa0aa;letter-spacing:.04em;}
.tool-picker-options{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px;}
.tool-picker-option{appearance:none;width:100%;display:flex;align-items:center;gap:10px;padding:8px 10px;border:0;background:transparent;border-radius:10px;cursor:pointer;text-align:left;transition:background .12s ease;}
.tool-picker-option:hover{background:rgba(17,19,24,.035);}
.tool-picker-option.on{background:rgba(194,69,42,.06);}
.tool-picker-option.on:hover{background:rgba(194,69,42,.09);}
.tool-picker-option-icon{flex-shrink:0;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:rgba(17,19,24,.04);}
.tool-picker-option.on .tool-picker-option-icon{background:rgba(194,69,42,.10);}
.tool-picker-option-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;}
.tool-picker-option-title{display:flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:#111318;letter-spacing:-.005em;text-transform:none;line-height:1.3;}
.tool-picker-option-name{font:11px/1.3 ui-monospace,SFMono-Regular,Menlo,monospace;color:#9aa0aa;letter-spacing:0;text-transform:none;font-weight:400;}
.tool-picker-pill{font-size:10.5px;font-weight:550;letter-spacing:0;text-transform:none;padding:2px 8px;border-radius:999px;line-height:1.5;flex-shrink:0;white-space:nowrap;}
.tool-picker-pill.soft{background:rgba(17,19,24,.05);color:#68707b;}
.tool-picker-pill.warn{background:rgba(217,119,87,.10);color:#a8451c;}
.tool-picker-pill.danger{background:rgba(185,28,28,.08);color:#b91c1c;}
.tool-picker-check{flex-shrink:0;width:18px;height:18px;border-radius:999px;border:1.5px solid rgba(17,19,24,.18);display:inline-flex;align-items:center;justify-content:center;color:transparent;background:#fff;transition:background .12s ease,border-color .12s ease,color .12s ease;}
.tool-picker-check.on{background:var(--accent-600,#c2452a);border-color:var(--accent-600,#c2452a);color:#fff;}
.tool-picker-foot{display:flex;justify-content:flex-end;font-size:11px;color:#9aa0aa;padding:0 2px;}
.tool-picker-foot b{color:#111318;font-weight:700;}
/* Empty state */
.agents-empty{margin:8px 0 18px;display:flex;justify-content:center;}
.agents-empty-card{max-width:520px;width:100%;text-align:center;padding:36px 28px;border:1px solid rgba(17,19,24,.08);border-radius:20px;background:radial-gradient(circle at 50% 0%,rgba(232,206,164,.35),rgba(255,255,255,.92) 60%);box-shadow:0 18px 50px rgba(17,19,24,.07);}
.agents-empty-card h2{margin:8px 0 8px;font-size:26px;letter-spacing:-.03em;color:#111318;}
.agents-empty-card p{margin:0 0 18px;font-size:13.5px;line-height:1.6;color:#555d68;}
.agents-empty-cta{display:inline-flex;justify-content:center;}
/* System tray */
.agents-system-tray{display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:12px;margin-top:6px;}
.agents-system-tile{border:1px solid rgba(17,19,24,.07);border-radius:14px;background:rgba(255,255,255,.66);padding:12px 14px;font-size:12.5px;color:#555d68;line-height:1.5;}
.agents-system-tile-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px;}
.agents-system-tile-head span{font-size:12px;font-weight:850;letter-spacing:-.01em;color:#111318;}
.agents-system-tile p{margin:0;}
.agents-system-tile code{font:11px/1.5 ui-monospace,monospace;background:rgba(17,19,24,.05);padding:2px 6px;border-radius:6px;color:#3f454f;}
.agents-system-tile details>summary{cursor:pointer;font-size:12px;color:#3f454f;}
.agents-system-tile details>summary::-webkit-details-marker{display:none;}
.agents-system-tile details>summary::before{content:"›";display:inline-block;margin-right:6px;transition:transform .15s ease;color:#9aa0aa;}
.agents-system-tile details[open]>summary::before{transform:rotate(90deg);}
.agents-system-tile details p{margin:8px 0 4px;}
.agents-system-code{display:block;font-size:11px;background:rgba(17,19,24,.045);padding:8px 10px;border-radius:8px;margin:6px 0;word-break:break-all;}
.agent-engine-form{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.agent-engine-label{font-size:9.5px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#9aa0aa;white-space:nowrap;}
.agent-engine-form select,.agent-engine-form input[name=model]{border:1px solid rgba(17,19,24,.10);border-radius:8px;background:#fff;padding:5px 8px;font:12px/1.4 ui-monospace,monospace;color:#111318;height:28px;}
.agent-knowledge-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(260px,.85fr);gap:12px;}
.agent-knowledge-panel{border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.72);padding:12px;min-width:0;}
.agent-knowledge-head{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px;}
.agent-knowledge-head span{font-size:11px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#313740;}
.agent-knowledge-head small{font-size:11px;color:#7a828d;font-variant-numeric:tabular-nums;}
.agent-skills-form{display:flex;flex-direction:column;gap:10px;}
.agent-skills-form textarea{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace;color:#111318;resize:vertical;}
.agent-detail-contract{margin-top:18px;}
.agent-contract-form{display:flex;flex-direction:column;gap:16px;}
.agent-contract-field{display:flex;flex-direction:column;gap:5px;}
.agent-contract-field>span{font-size:12px;font-weight:650;color:#111318;letter-spacing:-.01em;}
.agent-contract-field>small{font-size:11px;color:#8a8f99;line-height:1.45;}
.agent-contract-field textarea{width:100%;margin-top:3px;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:#111318;resize:vertical;}
.agent-memory-list{display:flex;flex-direction:column;gap:8px;max-height:220px;overflow:auto;padding-right:2px;}
.agent-memory-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:start;border:1px solid rgba(17,19,24,.07);border-radius:12px;background:rgba(255,255,255,.76);padding:8px;}
.agent-memory-row span,.agent-memory-empty{font-size:12px;line-height:1.45;color:#555d68;overflow-wrap:anywhere;margin:0;}
.agent-memory-row .admin-button{padding:6px 8px;font-size:11px;}
.agent-engine-form select{min-width:120px;}
/* Engine inline-edit popover (used inside agent cards & detail) */
.agent-row-engine{position:relative;}
.agent-row-engine>summary{cursor:pointer;list-style:none;}
.agent-row-engine>summary::-webkit-details-marker{display:none;}
.agent-row-engine[open]>summary{background:#111318;color:#fff;}
.agent-row-engine[open] .agent-engine-form{position:absolute;right:0;top:calc(100% + 6px);z-index:20;display:flex;gap:6px;align-items:center;padding:10px;border-radius:12px;background:#fff;border:1px solid rgba(17,19,24,.10);box-shadow:0 12px 32px rgba(17,19,24,.12);white-space:nowrap;}
.agent-row-engine[open] .agent-engine-form select,.agent-row-engine[open] .agent-engine-form input{height:28px;}
.agent-advanced{margin:0;}
.agent-advanced>summary{cursor:pointer;list-style:none;font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#9aa0aa;padding:6px 0;user-select:none;}
.agent-advanced>summary::-webkit-details-marker{display:none;}
.agent-advanced>summary::before{content:"+ ";color:#9aa0aa;}
.agent-advanced[open]>summary::before{content:"− ";}
.agent-advanced-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px;}
.agent-advanced-grid label{display:flex;flex-direction:column;gap:6px;font-size:11px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#68707b;}
.agent-advanced-grid label:last-child{grid-column:1/-1;}
.agent-engine-form input[name=model]{width:140px;}
.agent-engine-form select:focus,.agent-engine-form input[name=model]:focus{outline:0;border-color:rgba(17,19,24,.28);box-shadow:0 0 0 2px rgba(17,19,24,.06);}
.agent-sidebar{display:flex;flex-direction:column;gap:14px;}
.agent-sidebar .admin-panel{margin-bottom:0;}
.agent-detail-hero{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(244,239,231,.82));}
.agent-detail-hero h2{margin:6px 0 8px;font-size:30px;letter-spacing:-.045em;color:#111318;line-height:1;}
.agent-detail-hero p{margin:0 0 12px;max-width:760px;color:#555d68;font-size:13px;line-height:1.55;}
.agent-detail-layout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(300px,.65fr);gap:14px;align-items:start;}.agent-detail-layout.lower{grid-template-columns:1fr 1fr;}
.agent-detail-side{display:flex;flex-direction:column;gap:14px;}.agent-detail-side .admin-panel{margin-bottom:0;}
.agent-detail-skills{position:sticky;top:14px;align-self:start;}
.agent-detail-skills textarea{height:calc(100vh - 180px);min-height:360px;max-height:86vh;}.agent-detail-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px;}.agent-detail-actions.split{justify-content:space-between;border-top:1px solid rgba(17,19,24,.07);padding-top:12px;}
/* Distilled detail-page additions */
.agent-detail-hero-main{flex:1;min-width:0;}
.agent-detail-hero-meta{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px;font-size:12px;color:#7a818c;font-variant-numeric:tabular-nums;}
.agent-detail-hero-meta>span:not(.admin-pill){white-space:nowrap;}
.agent-detail-hero-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#9aa0aa;}
.agent-detail-engine-edit{position:relative;flex-shrink:0;}
.agent-detail-engine-edit>summary{cursor:pointer;list-style:none;user-select:none;}
.agent-detail-engine-edit>summary::-webkit-details-marker{display:none;}
.agent-detail-engine-edit[open]>summary{background:#111318;color:#fff;}
.agent-detail-engine-edit[open] .agent-engine-form{position:absolute;right:0;top:calc(100% + 6px);z-index:20;display:flex;gap:6px;align-items:center;padding:10px;border-radius:12px;background:#fff;border:1px solid rgba(17,19,24,.10);box-shadow:0 12px 32px rgba(17,19,24,.12);white-space:nowrap;}
.agent-detail-kv-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.agent-detail-perm-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.agent-detail-perm-list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:10px;background:rgba(17,19,24,.03);}
.agent-detail-perm-name{font-size:12.5px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:#313740;overflow-wrap:anywhere;}
.agent-detail-audit-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.agent-detail-audit-list li{padding:10px 0;border-bottom:1px solid rgba(17,19,24,.06);}
.agent-detail-audit-list li:last-child{border-bottom:0;}
.agent-detail-audit-list li>div{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.agent-detail-audit-list li>div b{font-size:12px;color:#111318;font-family:ui-monospace,monospace;}
.agent-detail-audit-list li p{margin:4px 0 0;font-size:12.5px;line-height:1.45;color:#555d68;}
.agent-detail-audit-list li small{display:block;margin-top:4px;font-size:10.5px;color:#9aa0aa;font-variant-numeric:tabular-nums;}
.agent-detail-artifact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px;}
.agent-detail-kv{border:1px solid rgba(17,19,24,.07);border-radius:13px;background:#fff;padding:12px;display:flex;flex-direction:column;gap:5px;font-size:12px;color:#555d68;}.agent-detail-kv.danger{border-color:rgba(154,51,37,.24);background:#fff8f6;color:#9a3325;}.agent-detail-kv b{color:#111318;font-size:13px;}
.agent-memory-search{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:12px;}.agent-memory-search label{display:flex;flex-direction:column;gap:6px;min-width:min(360px,100%);font-size:10px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}.agent-memory-search input{border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 11px;font:13px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.agent-memory-bulk-form{display:flex;flex-direction:column;gap:12px;}.agent-memory-bulk-list{display:grid;gap:8px;max-height:360px;overflow:auto;padding-right:2px;}.agent-memory-select-row{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:start;border:1px solid rgba(17,19,24,.07);border-radius:13px;background:#fff;padding:10px;font-size:12.5px;line-height:1.5;color:#555d68;}.agent-memory-select-row b{display:inline-flex;margin-right:8px;color:#9a3325;font-family:ui-monospace,monospace;}.agent-memory-select-row input{margin-top:4px;}
.agent-memory-export{margin-top:14px;border:1px solid rgba(17,19,24,.08);border-radius:13px;background:rgba(255,255,255,.70);padding:10px 12px;}.agent-memory-export summary{font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#313740;cursor:pointer;}.agent-memory-export pre{white-space:pre-wrap;overflow:auto;max-height:260px;font:11.5px/1.55 ui-monospace,monospace;color:#313740;background:#fff;border-radius:10px;padding:12px;}
.task-filter-bar{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;padding:10px 12px;margin-bottom:14px;border:1px solid rgba(17,19,24,.07);border-radius:14px;background:rgba(255,255,255,.62);}
.task-filter-bar label{display:flex;flex-direction:column;gap:5px;font-size:10px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.task-filter-bar select{border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:6px 9px;font:12.5px/1.3 ui-sans-serif,system-ui,sans-serif;color:#111318;min-width:130px;}
.task-filter-bar select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.task-filter-check{flex-direction:row!important;align-items:center;gap:7px!important;text-transform:none!important;letter-spacing:0!important;font-size:12px!important;font-weight:600!important;color:#313740!important;padding-bottom:7px;}
.task-filter-check input{margin:0;}
.task-filter-bar .admin-button{padding:7px 13px;font-size:11.5px;height:30px;}
.task-filter-clear{background:transparent!important;border-color:transparent!important;color:#9a3325!important;}
.tasks-layout{display:grid;grid-template-columns:1fr 296px;gap:14px;align-items:start;}
.tasks-sidebar{display:flex;flex-direction:column;gap:14px;position:sticky;top:14px;}
.tasks-sidebar .admin-panel{margin-bottom:0;}
.task-list{display:flex;flex-direction:column;gap:10px;list-style:none;padding:0;margin:0;}
.task-row{border-radius:14px;background:rgba(255,255,255,.62);border:1px solid rgba(17,19,24,.06);transition:background .15s ease,border-color .15s ease;}
.task-row:hover{background:rgba(255,255,255,.86);border-color:rgba(17,19,24,.10);}
.task-row.needs-action{border-color:rgba(154,51,37,.24);background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,248,246,.78));}
.task-row.needs-action:hover{border-color:rgba(154,51,37,.40);}
.task-row-main{display:block;text-decoration:none;color:inherit;padding:14px 16px;}
.task-row-head{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap;}
.task-row-title{flex:1;min-width:0;font-size:15px;font-weight:700;letter-spacing:-.02em;color:#111318;line-height:1.3;}
.task-row-desc{margin:6px 0 0;font-size:13px;color:#555d68;line-height:1.45;overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;}
.task-row-alert{margin:6px 0 0;font-size:12px;font-weight:700;color:#9a3325;line-height:1.45;overflow:hidden;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;}
.task-row-meta{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;font-size:11.5px;color:#9aa0aa;font-variant-numeric:tabular-nums;}
.task-row-meta span{white-space:nowrap;}
/* New task modal — wide two-column layout, scrollable body, pinned footer */
.task-modal-form{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;gap:0;}
.task-modal-grid{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.9fr);gap:20px;align-items:start;padding:20px 24px 24px;overflow-y:auto;flex:1 1 auto;min-height:0;}
.task-modal-main{display:flex;flex-direction:column;gap:14px;min-width:0;}
.task-modal-side{display:flex;flex-direction:column;gap:14px;padding:16px;border:1px solid rgba(17,19,24,.07);border-radius:14px;background:rgba(17,19,24,.025);min-width:0;}
.task-modal-side .agents-modal-field>span{color:#3a3f47;}
.task-modal-main textarea{min-height:120px;}
.task-modal-hint{font-size:11px;color:#8a8f99;line-height:1.4;}
.task-modal-field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.task-modal-half{display:flex;flex-direction:column;gap:6px;min-width:0;}
.task-modal-half>span{font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.task-modal-half input{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 12px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.task-modal-half input:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}

/* Chip input + tag/checklist chips inside modal */
.task-chip-input-row{display:flex;gap:8px;align-items:stretch;}
.task-chip-input-row input{flex:1;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:10px 12px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.task-chip-input-row input:focus{outline:0;border-color:rgba(17,19,24,.32);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.task-chip-input-row .admin-button{height:auto;}
.task-chip-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.task-chip{display:inline-flex;align-items:center;gap:4px;padding:4px 4px 4px 10px;border-radius:999px;background:#111318;color:#fff;font:600 11.5px/1 ui-sans-serif,system-ui;letter-spacing:-.005em;}
.task-chip button{appearance:none;border:0;background:rgba(255,255,255,.18);color:#fff;width:18px;height:18px;border-radius:999px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;font-size:12px;line-height:1;}
.task-chip button:hover{background:rgba(255,255,255,.30);}
.task-chip-checklist{list-style:none;padding:0;margin:8px 0 0;display:flex;flex-direction:column;gap:6px;counter-reset:ckl;}
.task-chip-checklist li{display:flex;align-items:center;gap:10px;padding:8px 10px;border:1px solid rgba(17,19,24,.08);border-radius:10px;background:#fff;font-size:12.5px;color:#3a3f47;counter-increment:ckl;}
.task-chip-checklist li::before{content:counter(ckl);font:650 11px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9aa0aa;background:rgba(17,19,24,.05);border-radius:999px;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;}
.task-chip-checklist li>span{flex:1;min-width:0;}
.task-chip-checklist li>button{appearance:none;border:0;background:transparent;color:#9aa0aa;font-size:16px;cursor:pointer;line-height:1;}
.task-chip-checklist li>button:hover{color:#9a3325;}

/* Watcher grid (multi-select chips) — bounded scroll so long lists don't dominate */
.task-watcher-grid{display:flex;flex-wrap:wrap;gap:5px;max-height:128px;overflow-y:auto;padding:2px;}
.task-watcher-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border:1px solid rgba(17,19,24,.10);border-radius:999px;background:#fff;font:600 11px/1 ui-sans-serif,system-ui;color:#3a3f47;cursor:pointer;transition:background .12s,border-color .12s,color .12s;}
.task-watcher-chip:hover{border-color:rgba(17,19,24,.22);}
.task-watcher-chip input{position:absolute;opacity:0;pointer-events:none;}
.task-watcher-chip.on{background:#111318;border-color:#111318;color:#fff;}

@media(max-width:760px){
  .task-modal-grid{grid-template-columns:1fr;}
  .task-modal-field-row{grid-template-columns:1fr;}
}

/* List/board meta extras */
.task-meta-due{display:inline-flex;align-items:center;padding:2px 8px;border-radius:999px;font-weight:700;font-size:11px;background:rgba(17,19,24,.06);color:#3a3f47;}
.task-meta-due.tone-overdue{background:rgba(154,51,37,.14);color:#9a3325;}
.task-meta-due.tone-soon{background:rgba(194,69,42,.10);color:#7c2b19;}
.task-meta-due.tone-future{background:rgba(17,19,24,.05);color:#3a3f47;}
.task-meta-est{font-variant-numeric:tabular-nums;}
.task-meta-tags{display:inline-flex;gap:4px;flex-wrap:wrap;}
.task-meta-tag{display:inline-flex;align-items:center;padding:1px 7px;border-radius:999px;background:rgba(17,19,24,.06);color:#3a3f47;font:600 10.5px/1.5 ui-sans-serif,system-ui;letter-spacing:-.005em;}
.task-meta-watchers{font-size:11px;color:#68707b;}
.task-meta-recur{font-size:13px;color:#3a3f47;}

/* Task detail extras */
.task-hero-tags{display:flex;flex-wrap:wrap;gap:6px;margin:-6px 0 16px;}
.task-acceptance{white-space:pre-wrap;font:500 13px/1.55 ui-sans-serif,system-ui;color:#3a3f47;background:rgba(17,19,24,.04);border-radius:12px;padding:12px 14px;margin:0;}
.task-checklist{display:flex;flex-direction:column;gap:10px;}
.task-checklist-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;}
.task-checklist-list li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border:1px solid rgba(17,19,24,.07);border-radius:10px;background:#fff;}
.task-checklist-list li.done{background:rgba(17,19,24,.025);}
.task-checklist-list li label{display:flex;align-items:center;gap:10px;flex:1;min-width:0;cursor:pointer;font-size:13px;color:#111318;}
.task-checklist-list li.done label{color:#9aa0aa;text-decoration:line-through;}
.task-checklist-list input[type="checkbox"]{width:16px;height:16px;accent-color:var(--accent-600);}
.task-checklist-remove{appearance:none;border:0;background:transparent;color:#9aa0aa;font-size:18px;cursor:pointer;line-height:1;padding:2px 6px;border-radius:6px;}
.task-checklist-remove:hover{color:#9a3325;background:rgba(154,51,37,.06);}
.task-checklist-add{display:flex;gap:8px;}
.task-checklist-add input{flex:1;border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:8px 10px;font:13px/1.5 ui-sans-serif,system-ui;color:#111318;}
.task-checklist-add input:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}

.task-attachments{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:6px;}
.task-attachments li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border:1px solid rgba(17,19,24,.07);border-radius:10px;background:#fff;}
.task-attachments li small{font-size:11px;color:#9aa0aa;font-variant-numeric:tabular-nums;}

.task-meta-project{display:inline-flex;align-items:center;gap:6px;font-weight:650;color:#3a3f47;}
.task-meta-project i{width:8px;height:8px;border-radius:999px;display:inline-block;border:1px solid rgba(17,19,24,.10);}

/* Tasks toolbar — filters + view toggle */
.task-toolbar{margin:26px 0 22px;display:flex;flex-wrap:wrap;gap:14px;align-items:flex-end;justify-content:space-between;}
.task-toolbar-left{display:flex;align-items:flex-end;gap:14px;flex-wrap:wrap;}
.task-toolbar-right{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;}
.task-toolbar-field{display:flex;flex-direction:column;gap:5px;font-size:10px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.task-toolbar-field select{appearance:none;-webkit-appearance:none;background-color:#fff;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%2368707b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:12px;border:1px solid rgba(17,19,24,.10);border-radius:10px;padding:7px 32px 7px 12px;font:500 12.5px/1.2 ui-sans-serif,system-ui,sans-serif;color:#111318;min-width:140px;height:34px;cursor:pointer;}
.task-toolbar-field select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.task-toolbar-clear{align-self:flex-end;height:34px;padding:0 12px;border:1px solid transparent;border-radius:10px;background:transparent;color:#9a3325;font:650 11.5px/1 ui-sans-serif,system-ui;cursor:pointer;letter-spacing:-.005em;}
.task-toolbar-clear:hover{background:rgba(154,51,37,.06);border-color:rgba(154,51,37,.18);}
.task-view-toggle{align-self:flex-end;height:34px;}

.task-view-toggle{display:inline-flex;border:1px solid rgba(17,19,24,.10);border-radius:10px;background:#fff;padding:3px;gap:2px;height:34px;box-sizing:border-box;}
.task-view-toggle button{display:inline-flex;align-items:center;gap:7px;padding:0 12px;border:0;background:transparent;color:#68707b;font:600 12.5px/1 ui-sans-serif,system-ui;letter-spacing:-.005em;border-radius:7px;cursor:pointer;transition:background .15s,color .15s;}
.task-view-toggle button:hover{color:#111318;}
.task-view-toggle button.on{background:#111318;color:#fff;}
.task-view-glyph{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;}

/* Scope banner when a project is active */
.task-scope-banner{margin:-6px 0 18px;display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:linear-gradient(180deg,#fff,#fafbfc);}
.task-scope-tile{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:10px;color:#fff;font:850 13px/1 ui-sans-serif,system-ui;letter-spacing:-.01em;flex-shrink:0;}
.task-scope-text{display:flex;flex-direction:column;gap:2px;min-width:0;}
.task-scope-text b{font:700 13px/1.2 ui-sans-serif,system-ui;color:#111318;letter-spacing:-.01em;}
.task-scope-text small{font:500 11.5px/1.3 ui-sans-serif,system-ui;color:#68707b;}

/* List view (reuses .task-list / .task-row) */
.mkt-page[data-page="tasks"] .task-list{margin-top:0;}

/* Kanban board */
.task-board{margin:0;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,1fr);gap:14px;overflow-x:auto;padding-bottom:14px;scrollbar-width:thin;}
.task-board-col{display:flex;flex-direction:column;gap:10px;min-width:0;background:rgba(17,19,24,.025);border:1px solid rgba(17,19,24,.06);border-radius:14px;padding:12px;min-height:260px;}
.task-board-col-head{display:flex;align-items:center;gap:8px;padding:2px 4px 8px;border-bottom:1px solid rgba(17,19,24,.06);}
.task-board-col-head h3{margin:0;flex:1;min-width:0;font:700 12.5px/1.2 ui-sans-serif,system-ui;color:#111318;letter-spacing:-.01em;text-transform:capitalize;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.task-board-col-count{font:650 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#68707b;background:rgba(17,19,24,.06);border-radius:999px;padding:4px 8px;letter-spacing:.04em;}
.task-board-col-dot{width:10px;height:10px;border-radius:999px;flex-shrink:0;}
.task-board-col-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;}
.task-board-empty{padding:14px;text-align:center;font:500 11.5px/1.3 ui-sans-serif,system-ui;color:#9aa0aa;border:1px dashed rgba(17,19,24,.10);border-radius:10px;}
.task-board-card{background:#fff;border:1px solid rgba(17,19,24,.07);border-radius:12px;transition:border-color .15s,box-shadow .15s,transform .15s;}
.task-board-card:hover{border-color:rgba(17,19,24,.16);box-shadow:0 6px 18px rgba(17,19,24,.06);transform:translateY(-1px);}
.task-board-card.needs-action{border-color:rgba(154,51,37,.24);background:linear-gradient(180deg,#fff,#fff8f6);}
.task-board-card.needs-action:hover{border-color:rgba(154,51,37,.40);}
.task-board-card-link{display:block;padding:12px;text-decoration:none;color:inherit;}
.task-board-card-head{display:flex;align-items:center;gap:6px;justify-content:space-between;}
.task-board-card-title{margin:8px 0 6px;font:650 13px/1.35 ui-sans-serif,system-ui;color:#111318;letter-spacing:-.01em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;}
.task-board-card-alert{margin:0 0 6px;font:700 11.5px/1.35 ui-sans-serif,system-ui;color:#9a3325;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.task-board-meta{display:flex;flex-wrap:wrap;gap:8px;font:500 11px/1.2 ui-sans-serif,system-ui;color:#9aa0aa;font-variant-numeric:tabular-nums;margin-top:6px;}
.task-board-meta span{white-space:nowrap;}

.task-board-prio{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;font:700 10px/1 ui-sans-serif,system-ui;letter-spacing:.06em;text-transform:uppercase;background:rgba(17,19,24,.06);color:#3a3f47;}
.task-board-prio.prio-urgent{background:rgba(154,51,37,.12);color:#9a3325;}
.task-board-prio.prio-high{background:rgba(194,69,42,.10);color:#7c2b19;}
.task-board-prio.prio-medium{background:rgba(17,19,24,.06);color:#3a3f47;}
.task-board-prio.prio-low{background:rgba(17,19,24,.04);color:#68707b;}

@media(max-width:760px){
  .task-toolbar{flex-direction:column;align-items:stretch;}
  .task-toolbar-right{justify-content:flex-start;}
  .task-toolbar-field select{width:100%;}
  .task-board{grid-auto-columns:85vw;}
}
.task-hero-meta{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:-6px 0 16px;font-size:12.5px;color:#7a818c;font-variant-numeric:tabular-nums;}
.task-hero-meta>span:not(.admin-pill){white-space:nowrap;}
.task-hero-id{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#9aa0aa;}
.task-detail-layout{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr);gap:14px;align-items:start;}
.task-detail-main{display:flex;flex-direction:column;gap:14px;min-width:0;}
.task-detail-main .admin-panel{margin-bottom:0;}
.task-detail-side{display:flex;flex-direction:column;gap:14px;}
.task-detail-side .admin-panel{margin-bottom:0;}
.task-thread{list-style:none;padding:0;margin:0 0 14px;display:flex;flex-direction:column;gap:10px;}
.task-thread-item{border:1px solid rgba(17,19,24,.07);border-radius:13px;background:#fff;padding:11px 13px;}
.task-thread-meta{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:5px;}
.task-thread-meta b{font-size:12.5px;color:#111318;letter-spacing:-.01em;}
.task-thread-meta small{font-size:11px;color:#9aa0aa;font-variant-numeric:tabular-nums;}
.task-thread-item p{margin:0;font-size:13px;color:#313740;line-height:1.55;white-space:pre-wrap;}
.task-comment-form{display:flex;flex-direction:column;gap:10px;}
.task-comment-form textarea{border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;padding:11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;resize:vertical;}
.task-comment-form textarea:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.task-comment-form button{align-self:flex-end;}
.task-active-run-head{display:flex;align-items:center;gap:10px;margin-bottom:12px;font-size:12px;color:#7a818c;font-variant-numeric:tabular-nums;}
.task-run-events{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto;}
.task-run-event{border:1px solid rgba(17,19,24,.07);border-radius:11px;background:#fff;padding:9px 11px;}
.task-run-event-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;}
.task-run-event-head b{font-size:12px;color:#111318;letter-spacing:-.01em;}
.task-run-event-head small{font-size:10.5px;color:#9aa0aa;font-family:ui-monospace,monospace;}
.task-run-event p{margin:5px 0 0;font-size:12px;color:#555d68;line-height:1.5;}
.task-timeline{padding:0;overflow:hidden;}
.task-timeline>summary{list-style:none;cursor:pointer;padding:16px;margin:0;}
.task-timeline>summary::-webkit-details-marker{display:none;}
.task-timeline>summary::after{content:"+ show";font-size:11px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#9aa0aa;}
.task-timeline[open]>summary::after{content:"− hide";}
.task-timeline[open]>summary{padding-bottom:0;}
.task-timeline-list{list-style:none;padding:0 16px 16px;margin:0;display:flex;flex-direction:column;gap:8px;max-height:480px;overflow:auto;}
.task-timeline-list li{border:1px solid rgba(17,19,24,.07);border-radius:11px;background:#fff;padding:9px 11px;}
.task-timeline-list li>div{display:flex;justify-content:space-between;align-items:baseline;gap:10px;}
.task-timeline-list li b{font-size:12px;color:#111318;}
.task-timeline-list li small{font-size:10.5px;color:#9aa0aa;font-variant-numeric:tabular-nums;}
.task-timeline-list pre{margin:6px 0 0;font:11px/1.5 ui-monospace,monospace;color:#313740;background:rgba(17,19,24,.04);border-radius:8px;padding:8px;overflow:auto;max-height:160px;}
.task-edit-form{display:flex;flex-direction:column;gap:10px;}
.task-edit-form label{display:flex;flex-direction:column;gap:6px;font-size:10.5px;font-weight:850;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.task-edit-form input,.task-edit-form textarea,.task-edit-form select{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:11px;background:#fff;padding:9px 11px;font:13px/1.5 ui-sans-serif,system-ui,sans-serif;color:#111318;resize:vertical;}
.task-edit-form input:focus,.task-edit-form textarea:focus,.task-edit-form select:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.task-edit-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.task-edit-form button{margin-top:4px;align-self:flex-start;}
.task-child-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;}
.task-child-list li{display:flex;justify-content:space-between;align-items:center;gap:10px;border:1px solid rgba(17,19,24,.07);border-radius:11px;background:#fff;padding:9px 11px;}
.task-child-list li .admin-link{font-size:13px;color:#111318;font-weight:600;letter-spacing:-.01em;}
.task-child-list li .admin-link:hover{color:#9a3325;}
.task-run-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px;}
.task-run-list li{border:1px solid rgba(17,19,24,.07);border-radius:11px;background:#fff;padding:9px 11px;}
.task-run-list-head{display:flex;justify-content:space-between;align-items:center;gap:10px;}
.task-run-list-head b{font-size:12.5px;color:#111318;letter-spacing:-.01em;text-transform:capitalize;}
.task-run-list li small{display:block;margin-top:4px;font-size:11px;color:#9aa0aa;font-family:ui-monospace,monospace;}
.task-mute{margin:0;font-size:12.5px;color:#9aa0aa;}
@media(max-width:1100px){.agents-layout{grid-template-columns:1fr;}.agent-detail-layout,.agent-detail-layout.lower{grid-template-columns:1fr;}.agent-detail-hero{flex-direction:column;}.tasks-layout{grid-template-columns:1fr;}.tasks-sidebar{position:static;}.task-detail-layout{grid-template-columns:1fr;}}
@media(max-width:760px){.agent-card-grid{grid-template-columns:1fr;}.agent-card-foot{flex-direction:column;align-items:stretch;gap:10px;padding:12px 14px;}.agent-card-actions{justify-content:flex-end;width:100%;flex-wrap:wrap;}.agents-modal-grid{grid-template-columns:1fr;}.agent-card-meta{gap:12px;}.agent-card-top{flex-direction:column}.agent-engine-form{gap:6px;}.agent-engine-form input[name=model]{width:110px;}.agent-knowledge-grid{grid-template-columns:1fr;}.agent-memory-row{grid-template-columns:1fr;}.agent-detail-hero h2{font-size:24px}.agent-detail-actions.split{justify-content:flex-start}.agent-memory-search{align-items:stretch}.agent-memory-search .admin-button{width:100%;}.task-filter-bar{flex-direction:column;align-items:stretch;}.task-filter-bar select{width:100%;}.task-edit-row{grid-template-columns:1fr;}}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms!important;
    animation-iteration-count:1!important;
    transition-duration:.001ms!important;
    scroll-behavior:auto!important;
  }
}

/* AI onboarding wizard — interior styles only; outer shell uses AdminShell (.admin-frame/.admin-shell/.admin-header/.admin-kicker) */
.onboarding-progress{min-width:180px;border:1px solid rgba(17,19,24,.08);border-radius:22px;background:rgba(255,255,255,.68);padding:16px;box-shadow:inset 0 1px 0 rgba(255,255,255,.8);position:relative;overflow:hidden;}
.onboarding-progress b{font-size:34px;letter-spacing:-.06em;display:block;}
.onboarding-progress span{font-size:10px;font-weight:850;letter-spacing:.12em;text-transform:uppercase;color:#68707b;}
.onboarding-progress i{display:block;height:3px;background:var(--accent-500);border-radius:99px;margin-top:12px;transition:width .28s cubic-bezier(.32,.72,0,1);}
.onboarding-error{border:1px solid rgba(194,69,42,.22);background:rgba(194,69,42,.08);color:#7c2416;border-radius:16px;padding:12px 14px;font-weight:750;}
.onboarding-grid{display:grid;grid-template-columns:220px minmax(360px,.85fr) minmax(420px,1.15fr);gap:14px;align-items:start;}
.onboarding-panel{border:1px solid rgba(255,255,255,.78);background:rgba(255,255,255,.70);backdrop-filter:blur(22px) saturate(140%);border-radius:26px;box-shadow:0 22px 64px rgba(37,36,34,.14),inset 0 1px 0 rgba(255,255,255,.62);padding:18px;}
.panel-label{display:block;font-size:10px;font-weight:900;letter-spacing:.16em;text-transform:uppercase;color:var(--accent-600);margin-bottom:12px;}
.onboarding-step{display:flex;align-items:center;gap:10px;padding:10px;border-radius:16px;color:#69707a;border:1px solid transparent;}
.onboarding-step b{font-family:var(--font-mono-brand,'IBM Plex Mono',monospace);font-size:11px;color:var(--accent-500);}
.onboarding-step.done{background:#fff;border-color:rgba(17,19,24,.07);color:#111318;box-shadow:0 8px 18px rgba(17,19,24,.06);}
.voice-card{margin-top:18px;padding:14px;border-radius:18px;background:linear-gradient(145deg,#111318,#272c34);color:#fff;}
.voice-card span{display:block;font-weight:850;font-size:13px;}
.voice-card p{color:rgba(255,255,255,.72);font-size:12px;line-height:1.55;margin:8px 0 0;}
.onboarding-conversation{display:flex;flex-direction:column;gap:13px;}
.agent-bubble{border-radius:22px;padding:16px 17px;background:linear-gradient(145deg,#fff,#f6f1e8);border:1px solid rgba(212,183,127,.35);}
.agent-bubble b{display:block;font-size:18px;letter-spacing:-.03em;}
.agent-bubble p{margin:6px 0 0;color:#5c626d;line-height:1.55;font-size:13px;}
.onboarding-conversation label{display:flex;flex-direction:column;gap:7px;font-size:11px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;color:#68707b;}
.onboarding-conversation input,.onboarding-conversation textarea{width:100%;border:1px solid rgba(17,19,24,.10);border-radius:16px;background:rgba(255,255,255,.82);padding:12px 13px;color:#111318;font-size:14px;font-weight:650;letter-spacing:0;text-transform:none;outline:none;box-shadow:inset 0 1px 0 rgba(255,255,255,.75);}
.onboarding-conversation textarea{resize:vertical;line-height:1.55;font-weight:550;}
.onboarding-conversation input:focus,.onboarding-conversation textarea:focus{border-color:rgba(194,69,42,.45);box-shadow:0 0 0 3px rgba(194,69,42,.12);}
.onboarding-field-block>span{display:block;font-size:11px;font-weight:900;letter-spacing:.09em;text-transform:uppercase;color:#68707b;margin-bottom:8px;}
.onboarding-chips,.autonomy-grid{display:flex;flex-wrap:wrap;gap:8px;}
.onboarding-chips button,.autonomy-grid button{border:1px solid rgba(17,19,24,.10);background:rgba(255,255,255,.65);color:#313740;border-radius:999px;padding:8px 10px;font-size:12px;font-weight:800;cursor:pointer;}
.onboarding-chips button.selected,.autonomy-grid button.selected{background:#111318;color:#fff;border-color:#111318;box-shadow:0 8px 18px rgba(17,19,24,.15);}
.autonomy-grid button{border-radius:16px;display:flex;flex-direction:column;align-items:flex-start;min-width:98px;}
.autonomy-grid small{opacity:.68;font-size:10px;margin-top:2px;}
.onboarding-actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center;}
.blueprint-panel h2{font-size:34px;letter-spacing:-.055em;margin:0 0 8px;}
.blueprint-panel>p{color:#5d6470;line-height:1.65;margin:0 0 14px;}
.blueprint-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:14px 0;}
.blueprint-stats div{border:1px solid rgba(17,19,24,.07);border-radius:18px;background:#fff;padding:13px;}
.blueprint-stats b{display:block;font-size:28px;letter-spacing:-.06em;}
.blueprint-stats span{font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#68707b;}
.agent-blueprint-list{display:grid;gap:9px;max-height:520px;overflow:auto;padding-right:4px;}
.agent-blueprint-list article{border:1px solid rgba(17,19,24,.08);border-radius:18px;background:rgba(255,255,255,.78);padding:13px;}
.agent-blueprint-list article div{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;}
.agent-blueprint-list b{font-size:14px;letter-spacing:-.01em;}
.agent-blueprint-list span{font-size:10px;font-weight:800;color:var(--accent-600);white-space:nowrap;}
.agent-blueprint-list p{font-size:12px;line-height:1.55;color:#5d6470;margin:7px 0 0;}
.voice-opportunities{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0;}
.voice-opportunities div{border-radius:16px;background:#111318;color:#fff;padding:10px;}
.voice-opportunities b{display:block;font-size:11px;color:#d4b77f;}
.voice-opportunities span{display:block;font-size:11px;line-height:1.35;margin-top:4px;}
.blueprint-empty{min-height:360px;display:grid;place-content:center;text-align:center;border:1px dashed rgba(17,19,24,.16);border-radius:22px;color:#68707b;padding:28px;}
.blueprint-empty b{color:#111318;font-size:22px;letter-spacing:-.04em;}
.launch-result{margin-top:14px;border:1px solid rgba(194,69,42,.20);background:linear-gradient(145deg,rgba(194,69,42,.10),rgba(255,255,255,.78));border-radius:22px;padding:16px;}
.launch-result b{font-size:20px;letter-spacing:-.035em;}
.launch-result p{color:#555d68;margin:6px 0 12px;}
.launch-result div{display:flex;gap:8px;flex-wrap:wrap;}
@media(max-width:1180px){.onboarding-grid{grid-template-columns:1fr}.onboarding-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.voice-card{grid-column:1/-1}.voice-opportunities{grid-template-columns:1fr}}

/* ── Live agent tool steps — chat feed ── */
.tool-steps{display:flex;flex-direction:column;gap:4px;padding:2px 0;}
.tool-step{display:inline-flex;align-items:center;gap:7px;padding:5px 10px;border-radius:10px;border:1px solid rgba(17,19,24,.07);background:rgba(255,255,255,.68);width:fit-content;max-width:100%;min-width:0;}
.tool-step-icon{display:flex;align-items:center;flex-shrink:0;color:#68707b;}
.tool-step--running{border-color:rgba(17,19,24,.09);background:rgba(255,255,255,.78);}
.tool-step--done .tool-step-icon{color:#2e7d52;}
.tool-step--error .tool-step-icon{color:#c2452a;}
.tool-step-name{font-family:ui-monospace,'IBM Plex Mono',monospace;font-size:11px;color:#4a5059;white-space:nowrap;flex-shrink:0;}
.tool-step--done .tool-step-name{color:#2e7d52;opacity:.75;}
.tool-step--error .tool-step-name{color:#c2452a;}
.tool-step-sub{font-size:11px;color:#68707b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.tool-step--done .tool-step-sub{opacity:.6;}
/* CLI subprocess steps render as a compact icon-only pill — the model name is irrelevant to the user */
.tool-step--cli{padding:6px 9px;border-radius:999px;}
.tool-step--cli .tool-step-icon{color:#3a4150;}

/* ── Runtime popover — compact stats ── */
.runtime-compact-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;}
.runtime-compact-stat{border:1px solid rgba(17,19,24,.07);border-radius:10px;background:#f7f8fa;padding:8px 6px;display:flex;flex-direction:column;align-items:center;gap:1px;text-align:center;}
.runtime-compact-stat b{font-size:18px;font-weight:850;color:#b0b6bf;line-height:1;}
.runtime-compact-stat span{font-size:10px;color:#9ca3af;letter-spacing:.02em;}
.runtime-compact-stat.has-value b{color:#111318;}
.runtime-compact-stat.has-value span{color:#68707b;}
/* ── Runtime popover — dev tools footer ── */
.runtime-dev-tools{border-top:1px solid rgba(17,19,24,.07);padding-top:10px;display:flex;flex-direction:column;gap:7px;}
.runtime-dev-row{display:flex;gap:6px;}
.runtime-dev-btn{flex:1;border:1px solid rgba(17,19,24,.10);border-radius:8px;background:rgba(17,19,24,.04);color:#4a5059;font-size:11px;font-weight:600;padding:6px 8px;cursor:pointer;transition:background .14s,color .14s;}
.runtime-dev-btn:hover{background:rgba(17,19,24,.08);color:#111318;}
.runtime-dev-btn:disabled{opacity:.45;cursor:not-allowed;}
/* ── Runtime button — busy state ── */
.runtime-menu-btn{position:relative;}
.runtime-busy-dot{width:7px;height:7px;border-radius:50%;background:var(--accent-500);display:block;flex-shrink:0;animation:livepulse 1.1s ease-in-out infinite;}
.runtime-menu-btn--busy{border-color:rgba(194,69,42,.22);color:#111318;}
.runtime-menu-btn--busy:not(.on){background:rgba(255,255,255,.72);}

/* ── Runtime popover — live agent section ── */
.runtime-live-section{border-bottom:1px solid rgba(17,19,24,.08);padding-bottom:12px;display:flex;flex-direction:column;gap:8px;}
.runtime-live-header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
.runtime-live-title-row{display:flex;align-items:center;gap:7px;}
.runtime-live-phase{font-size:10px;font-weight:700;color:#68707b;letter-spacing:.06em;text-transform:uppercase;}
.runtime-live-meta{display:flex;align-items:center;gap:6px;flex-shrink:0;}
.runtime-live-elapsed{font-size:11px;font-family:ui-monospace,monospace;font-weight:700;color:#4a5059;background:rgba(17,19,24,.06);border-radius:6px;padding:2px 6px;}
.runtime-live-badge{display:inline-flex;align-items:center;gap:5px;background:rgba(17,19,24,.05);border:1px solid rgba(17,19,24,.09);border-radius:999px;padding:2px 8px 2px 5px;font-size:10px;font-weight:750;color:#111318;letter-spacing:.04em;}
/* ── Chat feed — elapsed time in tool steps ── */
.tool-step-elapsed{font-size:10.5px;font-family:ui-monospace,monospace;color:#9ca3af;padding:1px 4px;font-weight:600;letter-spacing:.02em;}
.runtime-live-badge-dot{width:6px;height:6px;border-radius:50%;background:var(--accent-500);animation:livepulse 1.1s ease-in-out infinite;flex-shrink:0;}
.runtime-live-steps{display:flex;flex-direction:column;gap:3px;}
.runtime-live-step{display:flex;align-items:center;gap:7px;padding:5px 8px;border-radius:9px;font-size:11.5px;min-width:0;border:1px solid transparent;}
.runtime-live-step--running{background:rgba(17,19,24,.03);border-color:rgba(17,19,24,.07);}
.runtime-live-step-icon{display:flex;align-items:center;color:#68707b;flex-shrink:0;}
.runtime-live-step--done .runtime-live-step-icon{color:#2e7d52;}
.runtime-live-step--error .runtime-live-step-icon{color:#c2452a;}
.runtime-live-step-name{font-family:ui-monospace,'IBM Plex Mono',monospace;font-size:11px;color:#4a5059;white-space:nowrap;flex-shrink:0;}
.runtime-live-step--done .runtime-live-step-name{color:#2e7d52;opacity:.75;}
.runtime-live-step--error .runtime-live-step-name{color:#c2452a;}
.runtime-live-step-sub{font-size:11px;color:#68707b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;}
.runtime-live-thinking{display:flex;align-items:center;gap:8px;padding:6px 9px;font-size:11.5px;color:#68707b;background:rgba(17,19,24,.03);border:1px solid rgba(17,19,24,.07);border-radius:9px;}
.runtime-live-thinking-icon{display:flex;align-items:center;color:#68707b;}

/* ============ Org chart ============ */
.org-chart-scroll{margin:6px -4px 0;padding:14px 4px 22px;overflow-x:auto;overflow-y:hidden;}
.org-chart-scroll::-webkit-scrollbar{height:8px;}
.org-chart-scroll::-webkit-scrollbar-thumb{background:rgba(17,19,24,.14);border-radius:999px;}
.org-chart{list-style:none;margin:0;padding:0;display:flex;justify-content:center;gap:36px;min-width:max-content;}
.org-branch{list-style:none;position:relative;display:flex;flex-direction:column;align-items:center;padding-top:0;}
.org-branch + .org-branch{margin-left:0;}
.org-children{list-style:none;margin:30px 0 0;padding:24px 0 0;display:flex;justify-content:center;gap:28px;position:relative;}
.org-children::before{content:"";position:absolute;left:50%;top:0;width:1px;height:24px;background:rgba(17,19,24,.22);}
.org-children > .org-branch{position:relative;padding-top:24px;}
.org-children > .org-branch::before{content:"";position:absolute;top:0;left:50%;width:1px;height:24px;background:rgba(17,19,24,.22);}
.org-children > .org-branch::after{content:"";position:absolute;top:0;left:50%;right:-14px;height:1px;background:rgba(17,19,24,.22);}
.org-children > .org-branch:first-child::after{left:50%;right:auto;width:calc(50% + 14px);}
.org-children > .org-branch:last-child::after{right:50%;left:auto;width:calc(50% + 14px);}
.org-children > .org-branch:only-child::after{display:none;}

.org-card{width:248px;border:1px solid rgba(17,19,24,.09);border-radius:16px;background:#fff;padding:14px 14px 12px;box-shadow:0 14px 32px rgba(17,19,24,.07);position:relative;transition:transform .18s ease, box-shadow .18s ease;}
.org-card:hover{transform:translateY(-2px);box-shadow:0 18px 42px rgba(17,19,24,.12);}
.org-card-head{display:flex;align-items:center;gap:11px;}
.org-card-avatar{width:38px;height:38px;border-radius:11px;background:#111318;color:#fbf6ec;font-size:13px;font-weight:850;letter-spacing:.04em;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-feature-settings:"ss01";}
.org-card-avatar.small{width:30px;height:30px;border-radius:9px;font-size:11px;}
.org-card-identity{min-width:0;flex:1;}
.org-card-name{font-size:13.5px;font-weight:850;color:#111318;letter-spacing:-.012em;line-height:1.2;}
.org-card-title{font-size:11.5px;color:#68707b;line-height:1.35;margin-top:3px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;}
.org-card-meta{display:flex;flex-wrap:wrap;gap:5px;margin-top:11px;}
.org-card-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:11px 0 0;padding-top:11px;border-top:1px solid rgba(17,19,24,.06);}
.org-card-stats > div{display:flex;flex-direction:column;align-items:flex-start;}
.org-card-stats dt{font-size:9.5px;text-transform:uppercase;letter-spacing:.1em;color:#8a909b;font-weight:850;}
.org-card-stats dd{margin:1px 0 0;font-size:15px;font-weight:850;color:#111318;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1;}
.org-card-stats dd.is-warn{color:#9a3325;}

.org-card--executive{border-color:rgba(194,69,42,.32);background:linear-gradient(180deg,#fff,#fff6f3);box-shadow:0 18px 44px rgba(194,69,42,.14);}
.org-card--executive .org-card-avatar{background:var(--accent-500);}
.org-card--manager{border-color:rgba(17,19,24,.16);background:linear-gradient(180deg,#fff,#fbfbfc);}
.org-card--team_lead{border-color:rgba(17,19,24,.11);}
.org-card--individual_contributor{background:rgba(255,255,255,.92);}

.org-card[data-reports="has"]{padding-bottom:13px;}
.org-card[data-reports="has"]::after{content:"";position:absolute;bottom:-8px;left:50%;transform:translateX(-50%);width:6px;height:6px;border-radius:50%;background:rgba(17,19,24,.32);}

.org-reporting-row{display:grid;grid-template-columns:minmax(180px,1fr) auto;gap:14px;align-items:center;padding:11px 12px;border:1px solid rgba(17,19,24,.07);border-radius:13px;background:#fff;}
.org-reporting-identity{display:flex;align-items:center;gap:10px;min-width:0;}
.org-reporting-name{font-size:13px;font-weight:850;color:#111318;letter-spacing:-.01em;}
.org-reporting-sub{font-size:11px;color:#7a818c;margin-top:1px;}
.org-reporting-fields{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;}
.org-reporting-field{display:flex;flex-direction:column;gap:4px;min-width:120px;}
.org-reporting-field > span{font-size:9.5px;text-transform:uppercase;letter-spacing:.1em;color:#8a909b;font-weight:850;}
.org-reporting-field input, .org-reporting-field select{border:1px solid rgba(17,19,24,.12);border-radius:9px;background:#fff;padding:7px 9px;font-size:12px;color:#111318;font-family:inherit;min-width:0;width:100%;}
.org-reporting-field input:focus, .org-reporting-field select:focus{outline:none;border-color:var(--accent-500);box-shadow:0 0 0 3px rgba(194,69,42,.12);}
.org-reporting-fields .admin-button{align-self:flex-end;height:32px;padding:0 14px;}

@media (max-width:1100px){
  .org-reporting-row{grid-template-columns:1fr;}
  .org-reporting-fields{width:100%;}
  .org-reporting-field{flex:1;}
}
@media (max-width:760px){
  .org-card{width:220px;}
  .org-children{gap:18px;}
  .org-chart{gap:22px;}
}

/* ─────────────────────────────────────────────────────────────
   Tools registry — editorial, Apple/Linear-style minimalism.
   Scoped under .tools-page so it never bleeds into other admin pages.
   ───────────────────────────────────────────────────────────── */
.tools-page{max-width:1180px;}

/* Inline stat strip — thin hairlines, no boxes */
.tools-page .tp-stats{margin:8px 0 0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid rgba(17,19,24,.09);border-bottom:1px solid rgba(17,19,24,.09);padding:20px 0;background:transparent;}
.tools-page .tp-stat{padding:0 26px;border-right:1px solid rgba(17,19,24,.06);position:relative;}
.tools-page .tp-stat:first-child{padding-left:0;}
.tools-page .tp-stat:last-child{border-right:0;}
.tools-page .tp-stat b{display:block;font:300 40px/.95 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.05em;color:#111318;font-feature-settings:"tnum","lnum";}
.tools-page .tp-stat span{display:block;margin-top:10px;font:650 10.5px/1.2 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#8a8f99;}

/* Connectors strip */
.tools-page .tp-connectors-section{margin:30px 0 0;}
.tools-page .tp-connectors-head{display:flex;align-items:baseline;justify-content:space-between;gap:14px;}
.tools-page .tp-connectors-label{font:650 11px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.18em;text-transform:uppercase;color:var(--accent-600);}
.tools-page .tp-connectors-head small{font-size:11.5px;color:#7a818c;line-height:1.4;}
.tools-page .tp-connectors{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px;}
.tools-page .tp-connector{display:inline-flex;align-items:center;gap:9px;padding:6px 14px 6px 6px;border:1px solid rgba(17,19,24,.08);border-radius:999px;background:#fff;color:#3a3f47;transition:border-color .15s ease,box-shadow .15s ease;}
.tools-page .tp-connector:hover{border-color:rgba(17,19,24,.18);box-shadow:0 1px 0 rgba(17,19,24,.03);}
.tools-page .tp-connector-name{font:550 12.5px/1 ui-sans-serif,system-ui;letter-spacing:-.01em;color:#111318;}
.tools-page .tp-connector small{font:650 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9aa0aa;letter-spacing:.12em;text-transform:uppercase;}
.tools-page .tp-connector[data-status="warn"]{background:#fff;}
.tools-page .tp-connector[data-status="warn"] small{color:#956400;}

/* Shared brand chip — soft pastel square with brand SVG inside */
.tools-page .tp-brand-chip{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:#faf7f0;border:1px solid rgba(17,19,24,.05);flex:0 0 auto;}
.tools-page .tp-connector .tp-brand-chip{width:28px;height:28px;border-radius:999px;}
.tools-page .tp-brand-chip.github{background:#f3f1ec;}
.tools-page .tp-brand-chip.supabase{background:#edf3ec;}
.tools-page .tp-brand-chip.vercel{background:#f7f6f3;}
.tools-page .tp-brand-chip.email{background:#fdebec;}
.tools-page .tp-brand-chip.web{background:#e7f1f9;}
.tools-page .tp-brand-chip.local_machine{background:#fbf3db;}
.tools-page .tp-brand-chip.travel{background:#e1f0fe;}

/* Universal status dot */
.tools-page .tp-status-dot{width:7px;height:7px;border-radius:50%;background:#9aa0aa;display:inline-block;flex:0 0 auto;}
.tools-page .tp-status-dot.ready{background:#3da76a;box-shadow:0 0 0 3px rgba(61,167,106,.14);}
.tools-page .tp-status-dot.warn{background:#d4a13a;box-shadow:0 0 0 3px rgba(212,161,58,.14);}
.tools-page .tp-status-dot.danger{background:#c04634;box-shadow:0 0 0 3px rgba(192,70,52,.14);}

/* Section heading */
.tools-page .tp-section{margin:46px 0 0;}
.tools-page .tp-section-head{display:flex;align-items:baseline;gap:14px;padding:0 0 14px;border-bottom:1px solid rgba(17,19,24,.07);}
.tools-page .tp-section-name{margin:0;font:500 22px/1 ui-sans-serif,system-ui;letter-spacing:-.025em;color:#111318;}
.tools-page .tp-section-count{font:550 12px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9aa0aa;letter-spacing:.04em;}
.tools-page .tp-section-status{margin-left:auto;display:inline-flex;align-items:center;gap:8px;font:650 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.14em;text-transform:uppercase;color:#68707b;}

/* Tool list rows */
.tools-page .tp-list{margin:0;padding:0;list-style:none;}
.tools-page .tp-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;column-gap:18px;align-items:center;padding:18px 4px;border-bottom:1px solid rgba(17,19,24,.06);transition:background .18s ease;}
.tools-page .tp-row:last-child{border-bottom:0;}
.tools-page .tp-row:hover{background:rgba(255,255,255,.55);}
.tools-page .tp-row.on{background:linear-gradient(180deg,rgba(255,255,255,.7),rgba(255,255,255,.35));}

.tools-page .tp-info{min-width:0;}
.tools-page .tp-headline{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.tools-page .tp-name{font:500 14px/1.15 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#111318;letter-spacing:-.01em;}
.tools-page .tp-risk{display:inline-flex;align-items:center;gap:6px;font:650 9.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.14em;text-transform:uppercase;color:#68707b;}
.tools-page .tp-risk-dot{width:6px;height:6px;border-radius:50%;background:#9aa0aa;display:inline-block;flex:0 0 auto;}
.tools-page .tp-risk-dot.low{background:#3da76a;}
.tools-page .tp-risk-dot.medium{background:#d4a13a;}
.tools-page .tp-risk-dot.high{background:#c04634;}
.tools-page .tp-risk-dot.irreversible{background:#111318;box-shadow:0 0 0 3px rgba(192,70,52,.22);}

.tools-page .tp-desc{margin:6px 0 8px;color:#69707b;font-size:13px;line-height:1.55;max-width:640px;text-wrap:pretty;}
.tools-page .tp-meta{display:flex;flex-wrap:wrap;gap:6px 20px;font:500 11.5px/1.2 ui-sans-serif,system-ui;color:#8a8f99;letter-spacing:-.005em;}
.tools-page .tp-meta b{color:#3a3f47;font-weight:600;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:11px;letter-spacing:0;}

.tools-page .tp-actions{display:flex;align-items:center;gap:18px;justify-self:end;}
.tools-page .tp-availability{font:650 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#9aa0aa;white-space:nowrap;}
.tools-page .tp-availability.warn{color:#956400;}

/* Toggle switch — physical, weighty, charcoal-on */
.tools-page .tp-switch-form{margin:0;}
.tools-page .tp-switch{position:relative;width:40px;height:23px;border:0;border-radius:999px;background:#d8dde2;padding:0;cursor:pointer;transition:background .2s ease;flex:0 0 auto;}
.tools-page .tp-switch::before{content:'';position:absolute;top:2px;left:2px;width:19px;height:19px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(17,19,24,.18),0 0 0 .5px rgba(17,19,24,.05);transition:transform .2s cubic-bezier(.32,.72,0,1);}
.tools-page .tp-switch.on{background:#111318;}
.tools-page .tp-switch.on::before{transform:translateX(17px);}
.tools-page .tp-switch:focus-visible{outline:2px solid rgba(17,19,24,.4);outline-offset:3px;}
.tools-page .tp-switch:active::before{width:22px;}
.tools-page .tp-switch.on:active::before{transform:translateX(14px);width:22px;}

/* Responsive — stacked layout below 880px */
@media (max-width:880px){
  .tools-page .tp-stats{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:18px;}
  .tools-page .tp-stat{padding:0 18px;}
  .tools-page .tp-stat:nth-child(2){border-right:0;}
  .tools-page .tp-stat:nth-child(3){padding-left:0;}
  .tools-page .tp-stat b{font-size:30px;}
  .tools-page .tp-row{grid-template-columns:36px minmax(0,1fr);grid-template-rows:auto auto;column-gap:14px;}
  .tools-page .tp-actions{grid-column:1/-1;justify-self:start;margin-left:50px;margin-top:4px;}
  .tools-page .tp-section-head{flex-wrap:wrap;}
  .tools-page .tp-section-status{margin-left:0;}
}

/* ─────────────────────────────────────────────────────────────
   Marketplace — Phase 1 foundation.
   Scoped under .mkt-page. Reuses minimalist-skill protocol — no new
   font / spacing scale is introduced. See ai-docs/marketplace-brand.md.
   ───────────────────────────────────────────────────────────── */
.mkt-page{width:100%;max-width:none;padding-bottom:80px;}

/* Stat strip — matches tools-page rhythm */
.mkt-page .mkt-stats{margin:8px 0 0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border-top:1px solid var(--mkt-divider-strong);border-bottom:1px solid var(--mkt-divider-strong);padding:20px 0;background:transparent;}
.mkt-page .mkt-stat{padding:0 22px;border-right:1px solid var(--mkt-divider);position:relative;min-width:0;}
.mkt-page .mkt-stat:first-child{padding-left:0;}
.mkt-page .mkt-stat:last-child{border-right:0;}
.mkt-page .mkt-stat b{display:block;font:300 40px/.95 ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;letter-spacing:-.05em;color:var(--mkt-installed);font-feature-settings:"tnum","lnum";}
.mkt-page .mkt-stat span{display:block;margin-top:10px;font:650 10.5px/1.2 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#8a8f99;}

/* Top toolbar — search + import action */
.mkt-page .mkt-toolbar{margin:26px 0 0;display:flex;align-items:center;gap:14px;flex-wrap:wrap;}
.mkt-page .mkt-search{flex:1;min-width:260px;position:relative;display:flex;align-items:center;}
.mkt-page .mkt-search-input{flex:1;width:100%;height:42px;padding:0 88px 0 44px;border:1px solid rgba(17,19,24,.10);border-radius:14px;background:#fff;font:500 13.5px/1 ui-sans-serif,system-ui;color:var(--mkt-installed);letter-spacing:-.005em;transition:border-color .18s ease,box-shadow .18s ease;}
.mkt-page .mkt-search-input::placeholder{color:#9aa0aa;font-weight:400;}
.mkt-page .mkt-search-input:focus{outline:0;border-color:var(--accent-500);box-shadow:0 0 0 3px rgba(194,69,42,.12);}
.mkt-page .mkt-search-icon{position:absolute;left:16px;top:50%;transform:translateY(-50%);color:#9aa0aa;pointer-events:none;}
.mkt-page .mkt-search-kbd{position:absolute;right:14px;top:50%;transform:translateY(-50%);display:inline-flex;align-items:center;gap:4px;font:650 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9aa0aa;letter-spacing:.06em;}
.mkt-page .mkt-search-kbd kbd{display:inline-block;padding:2px 5px;border:1px solid rgba(17,19,24,.10);border-radius:5px;background:#fafbfc;color:#68707b;font-size:10px;line-height:1;}

.mkt-page .mkt-cta{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 16px;border:1px solid transparent;border-radius:14px;background:var(--accent-500);color:#fff;font:600 12.5px/1 ui-sans-serif,system-ui;letter-spacing:-.005em;cursor:pointer;transition:border-color .18s ease,box-shadow .18s ease,transform .1s,background .18s ease;}
.mkt-page .mkt-cta:hover{background:var(--accent-600);border-color:transparent;box-shadow:0 4px 12px rgba(194,69,42,.22);}
.mkt-page .mkt-cta:active{transform:scale(.985);}
.mkt-page .mkt-cta .mkt-cta-mark{width:14px;height:14px;color:rgba(255,255,255,.7);}

/* Tabs (kind switcher) — flat, editorial */
.mkt-page .mkt-tabs{margin:28px 0 0;display:flex;align-items:flex-end;gap:24px;border-bottom:1px solid var(--mkt-divider-strong);position:relative;}
.mkt-page .mkt-tab{position:relative;display:inline-flex;align-items:baseline;gap:8px;padding:0 0 14px;border:0;background:transparent;cursor:pointer;color:#68707b;font:500 14px/1 ui-sans-serif,system-ui;letter-spacing:-.01em;}
.mkt-page .mkt-tab:hover{color:var(--mkt-installed);}
.mkt-page .mkt-tab.on{color:var(--mkt-installed);}
.mkt-page .mkt-tab.on::after{content:'';position:absolute;left:0;right:0;bottom:-1px;height:2px;background:var(--accent-500);border-radius:2px;}
.mkt-page .mkt-tab-count{font:650 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9aa0aa;letter-spacing:.04em;}
.mkt-page .mkt-tab.on .mkt-tab-count{color:#68707b;}

/* Category chips — sub-filter row */
.mkt-page .mkt-filters{margin:18px 0 0;display:flex;flex-wrap:wrap;gap:8px;}
.mkt-page .mkt-chip{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border:1px solid rgba(17,19,24,.10);border-radius:999px;background:#fff;color:#3a3f47;font:550 11.5px/1 ui-sans-serif,system-ui;letter-spacing:-.005em;cursor:pointer;transition:border-color .12s ease,transform .12s ease;}
.mkt-page .mkt-chip:hover{border-color:rgba(17,19,24,.22);background:#fafbfc;}
.mkt-page .mkt-chip:active{transform:scale(.97);}
.mkt-page .mkt-chip.on{background:var(--accent-500);border-color:var(--accent-500);color:#fff;box-shadow:0 2px 6px rgba(194,69,42,.18);}
.mkt-page .mkt-chip-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 6px;border-radius:999px;background:rgba(17,19,24,.06);color:#68707b;font:650 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.04em;}
.mkt-page .mkt-chip.on .mkt-chip-count{background:rgba(255,255,255,.22);color:#fff;}

/* Section frame — wraps tab content, with subtle motion on switch */
.mkt-page .mkt-section{margin:30px 0 0;animation:mkt-fade .22s cubic-bezier(.16,1,.3,1);}
@keyframes mkt-fade{
  from{opacity:0;transform:translateY(4px);}
  to{opacity:1;transform:translateY(0);}
}

/* Card grid — responsive auto-fill cards replace the legacy .mkt-row list */
.mkt-page .mkt-grid{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:18px;}
.mkt-page .mkt-card{position:relative;display:flex;flex-direction:column;gap:14px;padding:20px 20px 18px;border:1px solid rgba(17,19,24,.07);border-radius:18px;background:#fff;transition:transform .18s cubic-bezier(.16,1,.3,1),box-shadow .18s ease,border-color .18s ease;list-style:none;min-height:230px;}
.mkt-page .mkt-card::before{content:'';position:absolute;left:0;right:0;top:0;height:3px;border-radius:18px 18px 0 0;background:transparent;transition:background .18s ease;}
.mkt-page .mkt-card.kind-tool::before{background:var(--mkt-tool-ink);}
.mkt-page .mkt-card.kind-skill::before{background:var(--mkt-skill-ink);}
.mkt-page .mkt-card.kind-bundle::before{background:var(--mkt-bundle-ink);}
.mkt-page .mkt-card.kind-agent::before{background:var(--mkt-agent-ink);}
.mkt-page .mkt-card.kind-workflow::before{background:var(--mkt-workflow-ink);}
.mkt-page .mkt-card:hover{transform:translateY(-2px);box-shadow:0 12px 32px rgba(17,19,24,.10),0 2px 4px rgba(17,19,24,.04);border-color:rgba(17,19,24,.12);}
.mkt-page .mkt-card.on{background:linear-gradient(180deg,#fff 0%,#fbfaf7 100%);border-color:rgba(194,69,42,.22);box-shadow:0 6px 18px rgba(194,69,42,.08);}
.mkt-page .mkt-card-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.mkt-page .mkt-card-body{display:flex;flex-direction:column;gap:8px;flex:1;min-width:0;}
.mkt-page .mkt-card-title{margin:0;font:500 15px/1.2 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:var(--mkt-installed);letter-spacing:-.01em;word-break:break-word;}
.mkt-page .mkt-card-desc{margin:0;color:#69707b;font-size:13px;line-height:1.55;text-wrap:pretty;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
.mkt-page .mkt-card-meta{display:flex;flex-wrap:wrap;gap:4px 16px;font:500 11.5px/1.3 ui-sans-serif,system-ui;color:#8a8f99;letter-spacing:-.005em;padding-top:10px;border-top:1px solid var(--mkt-divider);}
.mkt-page .mkt-card-meta b{color:#3a3f47;font-weight:600;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:11px;letter-spacing:0;}
.mkt-page .mkt-card-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-top:12px;border-top:1px solid var(--mkt-divider);}

/* Kind chip — square brand tile */
.mkt-page .mkt-chip-tile{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:var(--mkt-tool-tint);border:1px solid rgba(17,19,24,.05);color:var(--mkt-tool-ink);flex:0 0 auto;}
.mkt-page .mkt-chip-tile.kind-tool{background:var(--mkt-tool-tint);color:var(--mkt-tool-ink);}
.mkt-page .mkt-chip-tile.kind-skill{background:var(--mkt-skill-tint);color:var(--mkt-skill-ink);}
.mkt-page .mkt-chip-tile.kind-bundle{background:var(--mkt-bundle-tint);color:var(--mkt-bundle-ink);}
.mkt-page .mkt-chip-tile.kind-agent{background:var(--mkt-agent-tint);color:var(--mkt-agent-ink);}
.mkt-page .mkt-chip-tile.kind-workflow{background:var(--mkt-workflow-tint);color:var(--mkt-workflow-ink);}

/* Inline kind badge */
.mkt-page .mkt-kind-badge{display:inline-flex;align-items:center;padding:2px 7px;border-radius:999px;font:650 9.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.14em;text-transform:uppercase;}
.mkt-page .mkt-kind-badge.kind-tool{background:var(--mkt-tool-tint);color:var(--mkt-tool-ink);}
.mkt-page .mkt-kind-badge.kind-skill{background:var(--mkt-skill-tint);color:var(--mkt-skill-ink);}
.mkt-page .mkt-kind-badge.kind-bundle{background:var(--mkt-bundle-tint);color:var(--mkt-bundle-ink);}
.mkt-page .mkt-kind-badge.kind-agent{background:var(--mkt-agent-tint);color:var(--mkt-agent-ink);}
.mkt-page .mkt-kind-badge.kind-workflow{background:var(--mkt-workflow-tint);color:var(--mkt-workflow-ink);}

/* Risk dot — shared with tools page, redeclared scoped */
.mkt-page .mkt-risk-dot{width:6px;height:6px;border-radius:50%;background:#9aa0aa;display:inline-block;flex:0 0 auto;}
.mkt-page .mkt-risk-dot.low{background:#3da76a;}
.mkt-page .mkt-risk-dot.medium{background:#d4a13a;}
.mkt-page .mkt-risk-dot.high{background:#c04634;}
.mkt-page .mkt-risk-dot.irreversible{background:var(--mkt-installed);box-shadow:0 0 0 3px rgba(192,70,52,.22);}

/* Availability label — used inside card footer */
.mkt-page .mkt-availability{font:650 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#9aa0aa;white-space:nowrap;}
.mkt-page .mkt-availability.warn{color:#956400;}
.mkt-page .mkt-availability.installed{color:var(--mkt-installed);}

/* Toggle switch — generalised from .tp-switch (install toggle) */
.mkt-page .mkt-toggle-form{margin:0;}
.mkt-page .mkt-toggle{position:relative;width:40px;height:23px;border:0;border-radius:999px;background:#d8dde2;padding:0;cursor:pointer;transition:background .2s ease;flex:0 0 auto;}
.mkt-page .mkt-toggle::before{content:'';position:absolute;top:2px;left:2px;width:19px;height:19px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(17,19,24,.18),0 0 0 .5px rgba(17,19,24,.05);transition:transform .2s cubic-bezier(.32,.72,0,1);}
.mkt-page .mkt-toggle.on{background:var(--mkt-installed);}
.mkt-page .mkt-toggle.on::before{transform:translateX(17px);}
.mkt-page .mkt-toggle:focus-visible{outline:2px solid rgba(17,19,24,.4);outline-offset:3px;}
.mkt-page .mkt-toggle:active::before{width:22px;}
.mkt-page .mkt-toggle.on:active::before{transform:translateX(14px);width:22px;}
.mkt-page .mkt-toggle[disabled]{opacity:.55;cursor:not-allowed;}

/* Empty state for "no results" search */
.mkt-page .mkt-empty{margin:48px 0;padding:36px 28px;border:1px dashed rgba(17,19,24,.14);border-radius:18px;text-align:center;background:#fafbfc;color:#68707b;}
.mkt-page .mkt-empty b{display:block;font:500 16px/1.2 ui-sans-serif,system-ui;color:var(--mkt-installed);letter-spacing:-.01em;margin-bottom:4px;}
.mkt-page .mkt-empty p{margin:6px 0 0;font-size:12.5px;line-height:1.5;}
.mkt-page .mkt-empty small{display:block;margin-top:14px;font:650 10.5px/1.2 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#8a8f99;letter-spacing:.14em;text-transform:uppercase;}

/* "Coming Phase 2" modal — informational only */
.mkt-page .mkt-modal-backdrop{position:fixed;inset:0;background:rgba(17,19,24,.42);backdrop-filter:blur(6px);display:grid;place-items:center;padding:18px;z-index:120;animation:mkt-fade .18s ease;}
.mkt-page .mkt-modal{position:relative;width:min(520px,100%);background:#fff;border:1px solid rgba(17,19,24,.08);border-radius:20px;box-shadow:0 30px 80px rgba(17,19,24,.22);padding:28px;color:var(--mkt-installed);}
.mkt-page .mkt-modal-eyebrow{font:650 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.18em;text-transform:uppercase;color:var(--accent-600);}
.mkt-page .mkt-modal h2{margin:8px 0 6px;font:300 28px/1.05 ui-sans-serif,system-ui;letter-spacing:-.03em;}
.mkt-page .mkt-modal p{margin:0;color:#5a626c;font-size:13.5px;line-height:1.55;}
.mkt-page .mkt-modal-row{margin-top:18px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.mkt-page .mkt-modal-input{flex:1;min-width:200px;height:40px;padding:0 14px;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fafbfc;color:#68707b;font:500 12.5px/1 ui-sans-serif,system-ui;cursor:not-allowed;}
.mkt-page .mkt-modal-cta{display:inline-flex;align-items:center;gap:6px;padding:0 14px;height:40px;border:0;border-radius:12px;background:#9aa0aa;color:#fff;font:650 11.5px/1 ui-sans-serif,system-ui;letter-spacing:.04em;cursor:not-allowed;}
.mkt-page .mkt-modal-close{position:absolute;top:14px;right:14px;width:28px;height:28px;display:grid;place-items:center;border:0;background:transparent;color:#68707b;cursor:pointer;border-radius:8px;}
.mkt-page .mkt-modal-close:hover{background:rgba(17,19,24,.05);color:var(--mkt-installed);}
.mkt-page .mkt-modal small{display:block;margin-top:16px;font:650 10.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.14em;text-transform:uppercase;color:#8a8f99;}

/* Responsive — stacked layout below 880px */
@media (max-width:880px){
  .mkt-page .mkt-stats{grid-template-columns:repeat(2,minmax(0,1fr));row-gap:18px;}
  .mkt-page .mkt-stat{padding:0 18px;}
  .mkt-page .mkt-stat:nth-child(2n){border-right:0;}
  .mkt-page .mkt-stat:nth-child(2n+1){padding-left:0;}
  .mkt-page .mkt-stat b{font-size:30px;}
  .mkt-page .mkt-grid{grid-template-columns:1fr;gap:14px;}
  .mkt-page .mkt-card{min-height:0;padding:18px;}
  .mkt-page .mkt-tabs{flex-wrap:wrap;gap:16px;}
  .mkt-page .mkt-toolbar{flex-direction:column;align-items:stretch;}
  .mkt-page .mkt-cta{justify-content:center;}
}

@media (max-width:760px){
  .mkt-page .mkt-search-kbd{display:none;}
}
@media (prefers-reduced-motion:reduce){
  .mkt-page .mkt-section,
  .mkt-page .mkt-modal-backdrop{animation:none;}
}



/* ------------------------------------------------------------------ */
/* Projects, Missions, Disk, Audit — admin surfaces                   */
/* All values derive from design tokens declared in @theme / :root.   */
/* ------------------------------------------------------------------ */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.project-switcher { display: flex; gap: 9px; align-items: center; }
.project-switcher select {
  /* Match .admin-button.secondary geometry so this pairs with the New project pill */
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(17,19,24,.12);
  border-radius: 999px;
  background-color: #fff;
  color: #111318;
  font: 850 12px/1 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -.005em;
  padding: 9px 30px 9px 13px;
  cursor: pointer;
  /* Custom chevron — neutral ink, matches the rest of the admin surface */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23111318' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px 12px;
  transition: background-color .15s ease, border-color .15s ease;
}
.project-switcher select:hover {
  background-color: #fafbfc;
  border-color: rgba(17,19,24,.22);
}
.project-switcher select:focus-visible {
  outline: 2px solid var(--accent-500, #c2452a);
  outline-offset: 2px;
}
.project-switcher select::-ms-expand { display: none; }

/* Project create — form card */
.project-form-card {
  max-width: 640px;
  margin: 8px auto 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--color-border, rgba(17,19,24,.08));
  background: var(--color-card, #fff);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 12px 34px rgba(17,19,24,.06);
}
.project-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-form-field .panel-label {
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.project-form-required {
  color: var(--accent-500, #c2452a);
  font-weight: 800;
}
.project-form-help {
  margin: -4px 0 6px;
  color: var(--color-muted-foreground, #68707b);
  font-size: 12px;
  line-height: 1.5;
}
.project-form-card input[type='text'],
.project-form-card input:not([type]),
.project-form-card textarea,
.new-project-modal input[type='text'],
.new-project-modal input:not([type]),
.new-project-modal textarea {
  width: 100%;
  border: 1px solid var(--color-border, rgba(20,22,26,.14));
  border-radius: var(--radius-md, 10px);
  background: var(--color-card, #fff);
  padding: 10px 12px;
  font: 500 13.5px/1.4 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--color-foreground, #111318);
  transition: border-color .18s ease, box-shadow .18s ease;
  box-sizing: border-box;
}
.project-form-card textarea,
.new-project-modal textarea {
  font-weight: 400;
  line-height: 1.55;
  resize: vertical;
  min-height: 96px;
}
.project-form-card input::placeholder,
.project-form-card textarea::placeholder,
.new-project-modal input::placeholder,
.new-project-modal textarea::placeholder {
  color: #9aa0aa;
}
.project-form-card input:hover,
.project-form-card textarea:hover,
.new-project-modal input:hover,
.new-project-modal textarea:hover {
  border-color: rgba(17,19,24,.22);
}
.project-form-card input:focus,
.project-form-card textarea:focus,
.new-project-modal input:focus,
.new-project-modal textarea:focus {
  outline: none;
  border-color: var(--accent-500, #c2452a);
  box-shadow: 0 0 0 3px rgba(194,69,42,.18);
}

/* New Project modal — layout extensions on top of the mkt-modal chrome */
.mkt-page .mkt-modal.new-project-modal {
  width: min(560px, 100%);
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100dvh - 36px);
  overflow-x: hidden;
  overflow-y: auto;
}
.mkt-page .new-project-modal h2 {
  margin: 4px 0 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -.03em;
  color: var(--color-foreground, #111318);
}
.new-project-modal-lede {
  margin: 0 0 4px;
  color: var(--color-muted-foreground, #68707b);
  font-size: 13px;
  line-height: 1.55;
}
/* The modal hosts a transparent .mkt-page wrapper purely to inherit the modal
   selector scope — don't let it inject extra padding or width constraints. */
.mkt-page.new-project-modal-root {
  max-width: none;
  padding: 0;
}

/* Color swatch picker */
.project-color-grid {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.project-color-swatch {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md, 10px);
  background: var(--swatch);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(17,19,24,.08);
  transition: transform .12s ease;
}
.project-color-swatch:hover {
  transform: translateY(-1px);
}
.project-color-swatch input[type='radio'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.project-color-swatch-ring {
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  pointer-events: none;
  box-shadow: 0 0 0 0 transparent;
  transition: box-shadow .15s ease;
}
.project-color-swatch input[type='radio']:checked ~ .project-color-swatch-ring {
  box-shadow:
    0 0 0 2px var(--color-card, #fff),
    0 0 0 4px var(--color-foreground, #111318);
}
.project-color-swatch input[type='radio']:focus-visible ~ .project-color-swatch-ring {
  box-shadow:
    0 0 0 2px var(--color-card, #fff),
    0 0 0 4px var(--accent-500, #c2452a);
}

/* Folder picker — radios for workspace vs custom path */
.project-folder-options {
  /* Reset fieldset's user-agent min-width:min-content — long workspace
     paths inside option labels would otherwise widen the whole modal. */
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.project-folder-option {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border, rgba(17,19,24,.10));
  border-radius: var(--radius-md, 10px);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
  background: var(--color-card, #fff);
}
.project-folder-option:hover { border-color: rgba(17,19,24,.22); }
.project-folder-option.on {
  border-color: var(--accent-500, #c2452a);
  background: rgba(194,69,42,.045);
  box-shadow: 0 0 0 3px rgba(194,69,42,.10);
}
.project-folder-option input[type='radio'] {
  margin: 3px 0 0;
  accent-color: var(--accent-500, #c2452a);
  flex-shrink: 0;
}
.project-folder-option-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.project-folder-option-body b {
  font-size: 13px;
  letter-spacing: -.005em;
  color: var(--color-foreground, #111318);
}
.project-folder-preview {
  display: block;
  max-width: 100%;
  min-width: 0;
  font: 500 11.5px/1.4 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: var(--color-muted-foreground, #68707b);
  letter-spacing: -.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-folder-help-inline {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--color-muted-foreground, #68707b);
}

/* Custom path paste-from-clipboard helper */
.project-folder-paste-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}
.project-folder-paste-row > input {
  flex: 1;
  min-width: 0;
}
.project-folder-paste-button {
  white-space: nowrap;
  flex-shrink: 0;
}
.project-folder-paste-hint {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--color-muted-foreground, #68707b);
}
.project-folder-paste-hint kbd {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  font: 600 11px/1.4 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: var(--color-foreground, #111318);
  background: rgba(17,19,24,.06);
  border: 1px solid rgba(17,19,24,.10);
  border-radius: 4px;
}
.project-folder-paste-feedback {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.5;
}
.project-folder-paste-feedback.success {
  color: #1f7a3a;
}
.project-folder-paste-feedback.error {
  color: var(--accent-600, #a83a22);
}

/* Delete project — confirm modal */
.mkt-page .mkt-modal.delete-project-modal {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mkt-page .delete-project-modal h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--color-foreground, #111318);
}
.project-confirm-slug {
  font: 500 12.5px/1.4 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  background: rgba(17,19,24,.06);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: -.005em;
}

/* Form actions */
.project-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border, rgba(17,19,24,.06));
}
.project-form-actions .admin-button {
  min-height: 36px;
  padding: 10px 18px;
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .project-form-card {
    padding: 20px;
    gap: 18px;
  }
  .project-form-actions {
    flex-direction: column-reverse;
  }
  .project-form-actions .admin-button {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .project-form-card input,
  .project-form-card textarea,
  .project-color-swatch,
  .project-color-swatch-ring {
    transition: none;
  }
}

/* Projects — marketplace card grid */
.mkt-page .project-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.mkt-page .project-card {
  min-height: 0;
  gap: 12px;
  padding: 18px 18px 16px;
}
.mkt-page .project-tile {
  position: relative;
  overflow: hidden;
  background: var(--tile-color, #111318);
}
.mkt-page .project-tile::after {
  /* subtle inner highlight to keep dark-color tiles legible */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 60%);
  pointer-events: none;
}
.project-tile-glyph {
  position: relative;
  font: 600 14px/1 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: #fff;
  letter-spacing: -.02em;
  z-index: 1;
}
.mkt-page .project-card-slug {
  font: 500 12.5px/1.2 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: var(--mkt-installed, #111318);
  letter-spacing: -.005em;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(17,19,24,.04);
  transition: background .15s ease, color .15s ease;
}
.mkt-page .project-card-slug:hover {
  background: rgba(17,19,24,.08);
  color: var(--accent-600, #a83a22);
}
.mkt-page .project-card .mkt-card-title {
  font: 500 17px/1.2 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: -.015em;
  color: var(--mkt-installed, #111318);
}
.mkt-page .project-card .mkt-card-meta {
  font-size: 11.5px;
  gap: 6px 14px;
}
.project-folder-meta code {
  font: 500 11px/1.4 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: #5a626c;
  background: rgba(17,19,24,.05);
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: -.005em;
  max-width: 200px;
  display: inline-block;
  vertical-align: bottom;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mkt-page .project-card .project-open,
.mkt-page .project-card .project-delete {
  padding: 6px 12px;
  font-size: 11px;
  height: 28px;
}
@media (max-width: 760px) {
  .mkt-page .project-card .mkt-card-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .project-card-actions {
    justify-content: flex-end;
  }
}

/* Project detail — integrations row */
.project-integrations { display:flex; flex-direction:column; }
.project-integration-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.project-integration-item {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border:1px solid rgba(17,19,24,.07); border-radius:14px;
  padding:12px 13px; background:rgba(255,255,255,.72);
}
.project-integration-info { display:flex; flex-direction:column; gap:2px; min-width:0; }
.project-integration-info b { font-size:13px; letter-spacing:-.01em; color:#111318; }
.project-integration-info small { color:#68707b; font-size:11.5px; }
.project-integration-cta { margin-top:auto; align-self:flex-start; }
.project-integration-row {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.project-integration-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-integration-status .panel-label { margin: 0; }
.project-integration-row .admin-button { margin-left: auto; }
.project-slug-stat {
  font: 500 22px/.95 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace !important;
  letter-spacing: -.02em !important;
}

/* Missions — variable card grid */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 0 0 14px;
}
.mission-grid .mission-card:first-child { grid-column: span 2; }
@media (max-width: 900px) {
  .mission-grid .mission-card:first-child { grid-column: auto; }
}
.mission-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.mission-card .admin-record-top b {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  letter-spacing: -.02em;
}
.mission-card p {
  margin: 0;
  color: var(--color-muted-foreground, #68707b);
  font-size: 13px;
  line-height: 1.55;
}
.mission-slug {
  font: 500 11.5px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--color-muted-foreground, #68707b);
  letter-spacing: -.005em;
  white-space: nowrap;
}
.mission-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, rgba(17,19,24,.06));
}
.mission-card-foot small {
  color: var(--color-muted-foreground, #68707b);
  font-size: 11.5px;
}
.mission-run-id {
  display: block;
  margin-top: 2px;
  font: 500 11px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--color-muted-foreground, #68707b);
}

/* Disk — two-pane layout */
.disk-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 900px) {
  .disk-shell { grid-template-columns: 1fr; }
}
.disk-folders {
  border: 1px solid var(--color-border, rgba(17,19,24,.08));
  background: rgba(255,255,255,.66);
  border-radius: var(--radius-lg, 14px);
  padding: 14px;
  position: sticky;
  top: 14px;
}
.disk-folders .panel-label { margin-bottom: 10px; }
.disk-folder {
  padding: 9px 10px;
  border: 1px solid var(--color-border, rgba(17,19,24,.06));
  border-radius: var(--radius-md, 10px);
  margin-bottom: 6px;
  background: var(--color-card, #fff);
}
.disk-folder code {
  font: 500 11.5px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--color-foreground, #111318);
}
.disk-folder-empty {
  margin: 0;
  color: var(--color-muted-foreground, #68707b);
  font-size: 12.5px;
}
.disk-main { display: flex; flex-direction: column; gap: 14px; }
.disk-upload {
  border: 1px dashed var(--color-border, rgba(17,19,24,.18));
  border-radius: var(--radius-lg, 14px);
  padding: 18px;
  background: rgba(255,255,255,.55);
}
.disk-upload-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.disk-upload-row input[type='file'] {
  flex: 1 1 200px;
  min-width: 0;
  font: inherit;
}
.disk-upload small {
  display: block;
  margin-top: 8px;
  color: var(--color-muted-foreground, #68707b);
  font-size: 11.5px;
}
.disk-local-only {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-foreground, #111318);
}
.disk-file b {
  font-size: 13.5px;
  letter-spacing: -.01em;
}
.disk-file-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: var(--color-muted-foreground, #68707b);
}
.disk-file-meta code {
  font: 500 10.5px/1 'IBM Plex Mono', ui-monospace, monospace;
  background: rgba(17,19,24,.04);
  padding: 2px 6px;
  border-radius: var(--radius-sm, 6px);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Audit — filters + rows */
.audit-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  align-items: end;
}
.audit-filters .audit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.audit-filters .audit-field .panel-label { margin: 0; }
.audit-filters input[type='text'] {
  border: 1px solid var(--color-border, rgba(20,22,26,.14));
  border-radius: var(--radius-md, 10px);
  padding: 8px 10px;
  background: var(--color-card, #fff);
  font: inherit;
  color: var(--color-foreground, #111318);
}
.audit-filters input[type='text']:focus {
  outline: 2px solid var(--accent-500, #c2452a);
  outline-offset: 1px;
}
.audit-actions {
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}
.audit-row .audit-action {
  display: inline-block;
  margin-left: 10px;
  font: 500 12.5px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--color-foreground, #111318);
  vertical-align: middle;
}
.audit-row .audit-time {
  color: var(--color-muted-foreground, #68707b);
  font-size: 11.5px;
  white-space: nowrap;
}
.audit-row p {
  margin: 8px 0 0;
  color: var(--color-muted-foreground, #68707b);
  font-size: 12.5px;
}
.audit-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.audit-meta small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-muted-foreground, #68707b);
  font-size: 11px;
}
.audit-meta small > span:first-child {
  font: 800 9.5px/1 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-600, #a83a22);
}
.audit-meta code {
  font: 500 11px/1 'IBM Plex Mono', ui-monospace, monospace;
  background: rgba(17,19,24,.04);
  padding: 2px 6px;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-foreground, #111318);
}
/* Agent stat card — Phase 1: declared but visually unified with other stats.
   Agent personas surface as a count tease; the reserved green tint is held
   until the Agent Marketplace ships. See DESIGN.md "Marketplace tokens". */

/* Runtime diagnostics page — admin-shell scoped overrides */
.runtime-mono {
  font: 500 11.5px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: -.005em;
  background: transparent;
  color: var(--color-foreground, #111318);
}
.runtime-state-pre {
  margin: 0;
  white-space: pre-wrap;
  border: 1px solid rgba(17,19,24,.08);
  border-radius: var(--radius-md, 10px);
  background: #101216;
  color: #f7f2e8;
  padding: 14px;
  font: 11.5px/1.55 'IBM Plex Mono', ui-monospace, monospace;
  overflow: auto;
  max-height: 60vh;
}

/* WhatsApp gateway page — admin-shell scoped helpers */
.whatsapp-mono {
  font: 500 11.5px/1.4 'IBM Plex Mono', ui-monospace, monospace;
  letter-spacing: -.005em;
  background: transparent;
  color: var(--color-foreground, #111318);
}
.whatsapp-pair-row {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.whatsapp-qr-box {
  background: #fff;
  border: 1px solid rgba(17,19,24,.08);
  border-radius: var(--radius-md, 10px);
  padding: 12px;
  display: inline-flex;
}
.whatsapp-qr-box img { display: block; }
.whatsapp-qr-pending {
  width: 240px;
  min-height: 240px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(17,19,24,.16);
  border-radius: var(--radius-md, 10px);
  background: rgba(255,255,255,.62);
  color: var(--color-muted-foreground, #68707b);
  font-size: 13px;
  line-height: 1.45;
  padding: 18px;
  text-align: center;
}
.whatsapp-pair-copy {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-muted-foreground, #68707b);
  font-size: 13px;
  line-height: 1.55;
}
.whatsapp-pair-copy p { margin: 0; }
.whatsapp-warn-copy {
  margin: 0;
  color: var(--accent-600, #a83a22);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}
.whatsapp-allow-form,
.whatsapp-send-form { margin-bottom: 14px; }
.whatsapp-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}
.whatsapp-table-wrap { margin-top: 4px; }
.whatsapp-table-actions { text-align: right; white-space: nowrap; }

/* WhatsApp section — embedded in AdminModal config tab */
.wa-section { display: flex; flex-direction: column; gap: 14px; }
.wa-status-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wa-status-user { font-size: 12px; color: #68707b; font-weight: 550; }
.wa-disconnect-confirm { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.wa-error-banner { background: #fff8f6; border: 1px solid rgba(154,51,37,.22); border-radius: 10px; padding: 10px 14px; color: #9a3325; font-size: 12.5px; font-weight: 650; line-height: 1.5; }
.wa-stats-row { display: flex; gap: 12px; flex-wrap: wrap; }
.wa-stat { flex: 1 1 120px; background: #f5f6f8; border: 1px solid rgba(17,19,24,.06); border-radius: 10px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.wa-stat-label { font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: #68707b; }
.wa-stat-value { font-size: 15px; font-weight: 750; color: #111318; letter-spacing: -.02em; }

/* ============================================================ */
/* Agents — mkt-page idiom                                       */
/* Aligns /agents and /agents/[id] with Marketplace and Projects */
/* ============================================================ */

/* Card uses .mkt-card base; agents have no kind stripe (the agent
   marketplace tokens are reserved for that future product). The
   engine tile in the head identifies the agent visually. */
.mkt-page[data-page="agents"] .mkt-card.agent-card-mkt::before { background: transparent; }
.mkt-page[data-page="agents"] .mkt-grid.agent-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.mkt-page[data-page="agents"] .mkt-card.agent-card-mkt { padding: 18px 18px 0; gap: 12px; min-height: 240px; }
.mkt-page[data-page="agents"] .mkt-card.agent-card-mkt.on { background: linear-gradient(180deg, #fff 0%, #fbfaf7 100%); }

.mkt-page[data-page="agents"] .agent-card-link {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; min-width: 0;
  color: inherit; text-decoration: none;
}
.mkt-page[data-page="agents"] .agent-card-link:focus-visible { outline: 2px solid var(--accent-500, #c2452a); outline-offset: 4px; border-radius: 12px; }

.mkt-page[data-page="agents"] .agent-card-tile { color: #3a3f47; }
.mkt-page[data-page="agents"] .agent-card-tile-glyph {
  font: 600 14px/1 'IBM Plex Mono', ui-monospace, monospace;
  color: #3a3f47;
}

.mkt-page[data-page="agents"] .agent-card-status {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  font: 650 10px/1 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  letter-spacing: .14em; text-transform: uppercase;
  color: #68707b;
}
.mkt-page[data-page="agents"] .agent-card-status .agent-card-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #c9ced6;
}
.mkt-page[data-page="agents"] .agent-card-status.tone-active { color: #2d7044; }
.mkt-page[data-page="agents"] .agent-card-status.tone-active .agent-card-status-dot { background: #3da76a; }
.mkt-page[data-page="agents"] .agent-card-status.tone-error { color: #9a3325; }
.mkt-page[data-page="agents"] .agent-card-status.tone-error .agent-card-status-dot { background: var(--accent-500, #c2452a); }

.mkt-page[data-page="agents"] .agent-card-role-tag {
  display: inline-block;
  font: 500 11px/1.3 ui-sans-serif, system-ui;
  color: #68707b;
  letter-spacing: -.005em;
}

.mkt-page[data-page="agents"] .agent-card-foot {
  margin: 0 -18px;
  padding: 12px 18px 14px;
  background: rgba(250, 248, 244, .6);
  border-top: 1px solid var(--mkt-divider);
  border-radius: 0 0 18px 18px;
}

.mkt-page[data-page="agents"] .agent-card-tools {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px;
}
.mkt-page[data-page="agents"] .agent-card-tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(17, 19, 24, .08);
  color: #3a3f47;
}
.mkt-page[data-page="agents"] .agent-card-tools-empty {
  font: 500 11px/1 ui-sans-serif, system-ui;
  color: #9aa0aa;
  letter-spacing: -.005em;
}

.mkt-page[data-page="agents"] .agent-card-actions {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.mkt-page[data-page="agents"] .agent-card-actions .admin-button {
  padding: 6px 11px; font-size: 11.5px; height: 28px;
}
.mkt-page[data-page="agents"] .agent-card-actions .admin-button.icon {
  padding: 0; width: 28px;
}
.mkt-page[data-page="agents"] .agent-card-actions .admin-button.icon.on {
  background: #111318; color: #fff; border-color: #111318;
}
.mkt-page[data-page="agents"] .admin-button.danger.icon {
  background: #fff; color: #9a3325; border-color: rgba(154, 51, 37, .28);
}
.mkt-page[data-page="agents"] .admin-button.danger.icon:hover {
  background: #fff3f0; border-color: rgba(154, 51, 37, .5);
}

.mkt-page[data-page="agents"] .agent-card-engine-form {
  margin: 0 -18px;
  padding: 12px 18px 14px;
  background: rgba(245, 243, 238, .6);
  border-top: 1px solid var(--mkt-divider);
  border-radius: 0 0 18px 18px;
}
.mkt-page[data-page="agents"] .agent-card-engine-form .agent-engine-form { flex-wrap: wrap; gap: 8px; }

/* Hermes integration panel (mirrors project-integrations) */
.mkt-page[data-page="agents"] .agent-integrations { margin-top: 24px; }
.mkt-page[data-page="agents"] .agent-integration-path,
.mkt-page[data-page="agents"] .agent-integration-details {
  flex: 1; min-width: 240px;
  font-size: 12.5px; color: #555d68; line-height: 1.5;
}
.mkt-page[data-page="agents"] .agent-integration-path { margin: 0; }
.mkt-page[data-page="agents"] .agent-integration-path code,
.mkt-page[data-page="agents"] .agent-integration-details code {
  font: 11px/1.5 ui-monospace, monospace;
  background: rgba(17, 19, 24, .05);
  padding: 2px 6px; border-radius: 6px;
  color: #3f454f;
}
.mkt-page[data-page="agents"] .agent-integration-code {
  display: block; padding: 8px 10px; margin: 6px 0;
  background: rgba(17, 19, 24, .045); border-radius: 8px;
  word-break: break-all;
}
.mkt-page[data-page="agents"] .agent-integration-details > summary {
  cursor: pointer; font-size: 12px; color: #3f454f; list-style: none;
}
.mkt-page[data-page="agents"] .agent-integration-details > summary::-webkit-details-marker { display: none; }
.mkt-page[data-page="agents"] .agent-integration-details > summary::before {
  content: "›"; display: inline-block; margin-right: 6px;
  transition: transform .15s ease; color: #9aa0aa;
}
.mkt-page[data-page="agents"] .agent-integration-details[open] > summary::before { transform: rotate(90deg); }

/* Delete confirmation dialog (replaces tailwind shadcn-y styling) */
.agent-delete-dialog {
  padding: 0; border: 0; background: transparent;
  border-radius: 18px; max-width: min(420px, 92vw);
}
.agent-delete-dialog::backdrop {
  background: rgba(17, 19, 24, .42);
  backdrop-filter: blur(6px);
}
.agent-delete-modal {
  width: 100%; overflow: hidden;
  background: #fff; color: #111318;
  border: 1px solid rgba(17, 19, 24, .08);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(17, 19, 24, .22);
}
.agent-delete-modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--mkt-divider);
}
.agent-delete-modal-title { display: flex; align-items: flex-start; gap: 12px; }
.agent-delete-modal-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 999px;
  background: #fff3f0; color: var(--accent-500, #c2452a);
  flex-shrink: 0; margin-top: 2px;
}
.agent-delete-modal h3 {
  margin: 0; font: 600 15px/1.2 ui-sans-serif, system-ui;
  letter-spacing: -.01em; color: #111318;
}
.agent-delete-modal-title p {
  margin: 2px 0 0; font-size: 12.5px; color: #68707b;
}
.agent-delete-modal-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; border-radius: 999px;
  background: transparent; color: #68707b; cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.agent-delete-modal-close:hover { background: rgba(17, 19, 24, .06); color: #111318; }
.agent-delete-modal-body {
  padding: 16px 18px 18px;
}
.agent-delete-modal-body > p {
  margin: 0; font-size: 13px; line-height: 1.55; color: #313740;
}
.agent-delete-modal-body > p b { color: #111318; font-weight: 650; }
.agent-delete-confirm-label {
  display: block; margin-top: 14px;
}
.agent-delete-confirm-label > span {
  display: block; font-size: 12px; color: #313740; margin-bottom: 6px;
}
.agent-delete-confirm-label code {
  font: 600 12px/1 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--accent-600, #a83a22);
}
.agent-delete-confirm-label input {
  width: 100%;
  font: 500 13px/1.2 'IBM Plex Mono', ui-monospace, monospace;
  padding: 8px 12px;
  border: 1px solid rgba(17, 19, 24, .12);
  border-radius: 10px;
  background: #fff;
  color: #111318;
  letter-spacing: .05em;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.agent-delete-confirm-label input:focus {
  outline: 0;
  border-color: var(--accent-500, #c2452a);
  box-shadow: 0 0 0 3px rgba(194, 69, 42, .12);
}
.agent-delete-modal-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-top: 18px;
}
.agent-delete-modal-actions .admin-button[disabled] {
  opacity: .5; cursor: not-allowed;
}

/* Agent detail — mkt-page idiom */
.mkt-page[data-page="agent-detail"] .agent-detail-summary { margin-top: 24px; }
.mkt-page[data-page="agent-detail"] .agent-detail-id {
  font: 500 11.5px/1.3 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  color: #68707b;
  word-break: break-all;
}
.mkt-page[data-page="agent-detail"] .agent-detail-engine-edit { margin-top: 14px; }
.mkt-page[data-page="agent-detail"] .agent-detail-layout { margin-top: 18px; }

/* Agents list — quiet footer link to runtime diagnostics. */
.agents-runtime-footer {
  margin: 28px 0 4px;
  font: 500 12px/1.5 var(--font-sans, system-ui);
  color: #68707b;
  text-align: center;
}
.agents-runtime-footer a {
  color: #2a2d33;
  text-decoration: none;
  border-bottom: 1px dotted rgba(17, 19, 24, .25);
}
.agents-runtime-footer a:hover { color: #111318; border-bottom-color: #111318; }

/* Agent detail — Simple / Details mode toggle. */
/* ==============================================================
   Agent detail — Apple-minimal redesign (ad-* classes).
   Scoped to .mkt-page[data-page="agent-detail"] so it never leaks
   into other marketplace pages. Two views share one vocabulary:
   data-view="simple"  → status strip + facts + activity
   data-view="details" → overview cards + admin panels
   ============================================================== */
.mkt-page[data-page="agent-detail"] { margin-top: 6px; }

/* ---- Simple view -------------------------------------------- */
.mkt-page[data-page="agent-detail"] .ad-simple {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Status strip — the at-a-glance "is this agent OK?" answer. */
.mkt-page[data-page="agent-detail"] .ad-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--mkt-divider-strong, rgba(17, 19, 24, .12));
  border-bottom: 1px solid var(--mkt-divider-strong, rgba(17, 19, 24, .12));
}
.mkt-page[data-page="agent-detail"] .ad-statusbar-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: 600 14px/1.4 var(--font-sans, system-ui);
  letter-spacing: -.01em;
  color: #2a2d33;
}
.mkt-page[data-page="agent-detail"] .ad-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd0d6;
  flex-shrink: 0;
}
.mkt-page[data-page="agent-detail"] .ad-statusbar-state.tone-active { color: #2d7044; }
.mkt-page[data-page="agent-detail"] .ad-statusbar-state.tone-active .ad-dot { background: #3da76a; }
.mkt-page[data-page="agent-detail"] .ad-statusbar-state.tone-error { color: #9a3325; }
.mkt-page[data-page="agent-detail"] .ad-statusbar-state.tone-error .ad-dot { background: var(--accent-500, #c2452a); }
.mkt-page[data-page="agent-detail"] .ad-statusbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Controls block — facts grid + tools strip + the shared editor drawer. */
.mkt-page[data-page="agent-detail"] .ad-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Quick facts — calm cards: publish, model, schedule, last run, status. */
.mkt-page[data-page="agent-detail"] .ad-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}
.mkt-page[data-page="agent-detail"] .ad-fact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgba(17, 19, 24, .07);
  border-radius: 14px;
  background: rgba(17, 19, 24, .02);
}
.mkt-page[data-page="agent-detail"] .ad-fact-label {
  font: 700 10.5px/1 var(--font-sans, system-ui);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-fact-value {
  font: 600 14px/1.4 var(--font-sans, system-ui);
  letter-spacing: -.01em;
  color: #1d2026;
  overflow-wrap: anywhere;
}

/* Editable fact cards (publish, model, schedule) — a fact that's also a button. */
.mkt-page[data-page="agent-detail"] .ad-fact--edit {
  position: relative;
  text-align: left;
  cursor: pointer;
  background: #fff;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.mkt-page[data-page="agent-detail"] .ad-fact--edit:hover {
  border-color: rgba(17, 19, 24, .18);
}
.mkt-page[data-page="agent-detail"] .ad-fact--edit.is-active {
  border-color: rgba(17, 19, 24, .30);
  box-shadow: 0 0 0 3px rgba(17, 19, 24, .05);
}
.mkt-page[data-page="agent-detail"] .ad-fact--edit .ad-fact-value { padding-right: 20px; }
.mkt-page[data-page="agent-detail"] .ad-fact-edit {
  position: absolute;
  top: 13px;
  right: 13px;
  color: #b7bcc4;
  transition: color .15s ease;
}
.mkt-page[data-page="agent-detail"] .ad-fact--edit:hover .ad-fact-edit,
.mkt-page[data-page="agent-detail"] .ad-fact--edit.is-active .ad-fact-edit { color: #6b7280; }

.mkt-page[data-page="agent-detail"] .ad-fact-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.mkt-page[data-page="agent-detail"] .ad-fact-status.tone-active { color: #2d7044; }
.mkt-page[data-page="agent-detail"] .ad-fact-status.tone-active .ad-dot { background: #3da76a; }
.mkt-page[data-page="agent-detail"] .ad-fact-status.tone-error { color: #9a3325; }
.mkt-page[data-page="agent-detail"] .ad-fact-status.tone-error .ad-dot { background: var(--accent-500, #c2452a); }

/* Tools strip — declared toolset as brand icons + one editor entry point. */
.mkt-page[data-page="agent-detail"] .ad-tools-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid rgba(17, 19, 24, .07);
  border-radius: 14px;
  background: rgba(17, 19, 24, .02);
}
.mkt-page[data-page="agent-detail"] .ad-tools-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  flex-wrap: wrap;
}
.mkt-page[data-page="agent-detail"] .ad-tool-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(17, 19, 24, .08);
  background: #fff;
}
.mkt-page[data-page="agent-detail"] .ad-tools-empty {
  font: 500 13px/1 var(--font-sans, system-ui);
  color: #9aa0a8;
}
.mkt-page[data-page="agent-detail"] .ad-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Shared editor drawer — animates open via grid-template-rows. */
.mkt-page[data-page="agent-detail"] .ad-drawer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .26s cubic-bezier(.22, 1, .36, 1);
}
.mkt-page[data-page="agent-detail"] .ad-drawer[data-open="true"] { grid-template-rows: 1fr; }
.mkt-page[data-page="agent-detail"] .ad-drawer-inner { overflow: hidden; }

.mkt-page[data-page="agent-detail"] .ad-editor {
  border: 1px solid rgba(17, 19, 24, .10);
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  margin-top: 2px;
}
.mkt-page[data-page="agent-detail"] .ad-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mkt-page[data-page="agent-detail"] .ad-editor-head h3 {
  margin: 0;
  font: 600 15px/1.2 var(--font-sans, system-ui);
  letter-spacing: -.01em;
  color: #1d2026;
}
.mkt-page[data-page="agent-detail"] .ad-editor-close {
  display: inline-flex;
  border: 0;
  background: transparent;
  color: #9aa0a8;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: color .15s ease, background .15s ease;
}
.mkt-page[data-page="agent-detail"] .ad-editor-close:hover { color: #1d2026; background: rgba(17, 19, 24, .05); }

.mkt-page[data-page="agent-detail"] .ad-editor-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mkt-page[data-page="agent-detail"] .ad-editor-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.mkt-page[data-page="agent-detail"] .ad-editor-row select,
.mkt-page[data-page="agent-detail"] .ad-editor-row input {
  flex: 1;
  min-width: 160px;
  border: 1px solid rgba(17, 19, 24, .12);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
  font: 500 13px/1.4 var(--font-sans, system-ui);
  color: #1d2026;
}
.mkt-page[data-page="agent-detail"] .ad-editor-actions {
  display: flex;
  gap: 8px;
}

/* Schedule composer. */
.mkt-page[data-page="agent-detail"] .ad-sched-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.mkt-page[data-page="agent-detail"] .ad-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mkt-page[data-page="agent-detail"] .ad-field--wide { grid-column: 1 / -1; }
.mkt-page[data-page="agent-detail"] .ad-field > span {
  font: 700 10.5px/1 var(--font-sans, system-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-field .admin-input {
  border-radius: 10px;
}
.mkt-page[data-page="agent-detail"] .ad-inline-num {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mkt-page[data-page="agent-detail"] .ad-inline-num input { width: 80px; }
.mkt-page[data-page="agent-detail"] .ad-inline-num em {
  font: 500 13px/1 var(--font-sans, system-ui);
  font-style: normal;
  color: #6b7280;
}
.mkt-page[data-page="agent-detail"] .ad-sched-preview {
  margin: 0;
  font: 600 13.5px/1.4 var(--font-sans, system-ui);
  color: #2a2d33;
}

/* Tools picker. */
.mkt-page[data-page="agent-detail"] .ad-tools-search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid rgba(17, 19, 24, .12);
  border-radius: 10px;
  color: #9aa0a8;
}
.mkt-page[data-page="agent-detail"] .ad-tools-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 13px/1.4 var(--font-sans, system-ui);
  color: #1d2026;
}
.mkt-page[data-page="agent-detail"] .ad-tools-count {
  font: 600 11.5px/1 var(--font-sans, system-ui);
  color: #8a8f99;
  white-space: nowrap;
}
.mkt-page[data-page="agent-detail"] .ad-tools-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 340px;
  overflow-y: auto;
  padding-right: 2px;
}
.mkt-page[data-page="agent-detail"] .ad-tools-group-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  font: 700 10.5px/1 var(--font-sans, system-ui);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6b7280;
}
.mkt-page[data-page="agent-detail"] .ad-tools-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.mkt-page[data-page="agent-detail"] .ad-tool-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(17, 19, 24, .12);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  font: 500 12.5px/1 var(--font-sans, system-ui);
  color: #2a2d33;
  transition: border-color .14s ease, background .14s ease, color .14s ease;
}
.mkt-page[data-page="agent-detail"] .ad-tool-option:hover { border-color: rgba(17, 19, 24, .26); }
.mkt-page[data-page="agent-detail"] .ad-tool-option.is-on {
  border-color: #1d2026;
  background: #1d2026;
  color: #fff;
}
.mkt-page[data-page="agent-detail"] .ad-tool-tag {
  font: 700 9px/1 var(--font-sans, system-ui);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9aa0a8;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(17, 19, 24, .05);
}
.mkt-page[data-page="agent-detail"] .ad-tool-option.is-on .ad-tool-tag { color: #cfd3d9; background: rgba(255, 255, 255, .12); }
.mkt-page[data-page="agent-detail"] .ad-tool-tag.warn { color: #9a6324; background: rgba(194, 132, 42, .12); }
.mkt-page[data-page="agent-detail"] .ad-tools-noresult {
  font: 500 13px/1.5 var(--font-sans, system-ui);
  color: #8a8f99;
}

/* Recent activity feed — executions + approvals, searchable. */
.mkt-page[data-page="agent-detail"] .ad-activity-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.mkt-page[data-page="agent-detail"] .ad-activity-title {
  font: 700 11px/1 var(--font-sans, system-ui);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-activity-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(17, 19, 24, .12);
  border-radius: 999px;
  color: #9aa0a8;
  min-width: 220px;
}
.mkt-page[data-page="agent-detail"] .ad-activity-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font: 500 13px/1.2 var(--font-sans, system-ui);
  color: #1d2026;
}
.mkt-page[data-page="agent-detail"] .ad-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mkt-page[data-page="agent-detail"] .ad-feed-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  border-bottom: 1px solid rgba(17, 19, 24, .06);
}
.mkt-page[data-page="agent-detail"] .ad-feed-row:last-child { border-bottom: 0; }
.mkt-page[data-page="agent-detail"] .ad-feed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(17, 19, 24, .05);
  color: #5b626c;
}
.mkt-page[data-page="agent-detail"] .ad-feed-icon.kind-approval { color: #1f6c9f; background: rgba(31, 108, 159, .10); }
.mkt-page[data-page="agent-detail"] .ad-feed-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mkt-page[data-page="agent-detail"] .ad-feed-title {
  font: 600 13.5px/1.35 var(--font-sans, system-ui);
  color: #1d2026;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mkt-page[data-page="agent-detail"] .ad-feed-meta {
  font: 500 11.5px/1 var(--font-sans, system-ui);
  color: #9aa0a8;
}
.mkt-page[data-page="agent-detail"] .ad-feed-status {
  font: 600 12px/1 var(--font-sans, system-ui);
  white-space: nowrap;
}
.mkt-page[data-page="agent-detail"] .ad-feed-status.tone-ok { color: #2d7044; }
.mkt-page[data-page="agent-detail"] .ad-feed-status.tone-warn { color: #9a6324; }
.mkt-page[data-page="agent-detail"] .ad-feed-status.tone-bad { color: #9a3325; }
.mkt-page[data-page="agent-detail"] .ad-feed-status.tone-neutral { color: #6b7280; }
.mkt-page[data-page="agent-detail"] .ad-feed-when {
  font: 500 12px/1 var(--font-sans, system-ui);
  color: #9aa0a8;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mkt-page[data-page="agent-detail"] .ad-feed-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 26px 2px;
  font: 500 13px/1.5 var(--font-sans, system-ui);
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-feed-empty strong {
  font-weight: 600;
  color: #2a2d33;
}

@media (prefers-reduced-motion: reduce) {
  .mkt-page[data-page="agent-detail"] .ad-drawer { transition: none; }
}

/* ---- Details view ------------------------------------------- */
/* Compact overview — operative numbers, calm not debug-dumpy. */
.mkt-page[data-page="agent-detail"] .ad-overview {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.mkt-page[data-page="agent-detail"] .ad-overview-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(17, 19, 24, .07);
  border-radius: 14px;
  background: rgba(255, 255, 255, .72);
}
.mkt-page[data-page="agent-detail"] .ad-overview-label {
  font: 700 10px/1 var(--font-sans, system-ui);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-overview-value {
  font: 600 14px/1.35 var(--font-sans, system-ui);
  letter-spacing: -.01em;
  color: #1d2026;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* Panel rhythm + key/value grids inside details. */
.mkt-page[data-page="agent-detail"] .ad-panel { margin-bottom: 18px; }
.mkt-page[data-page="agent-detail"] .ad-kv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.mkt-page[data-page="agent-detail"] .ad-kv {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(17, 19, 24, .07);
  border-radius: 13px;
  background: #fff;
  font-size: 12px;
  color: #59606b;
}
.mkt-page[data-page="agent-detail"] .ad-kv span {
  font: 700 10px/1 var(--font-sans, system-ui);
  letter-spacing: .10em;
  text-transform: uppercase;
  color: #8a8f99;
}
.mkt-page[data-page="agent-detail"] .ad-kv b {
  font-size: 13px;
  font-weight: 650;
  color: #1d2026;
  overflow-wrap: anywhere;
}
.mkt-page[data-page="agent-detail"] .ad-status-reason {
  margin: 14px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(154, 51, 37, .18);
  border-radius: 12px;
  background: #fff8f6;
  font-size: 12.5px;
  line-height: 1.5;
  color: #9a3325;
}

/* ---- Responsive --------------------------------------------- */
@media (max-width: 900px) {
  .mkt-page[data-page="agent-detail"] .ad-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mkt-page[data-page="agent-detail"] .ad-kv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .mkt-page[data-page="agent-detail"] .ad-statusbar { flex-direction: column; align-items: stretch; }
  .mkt-page[data-page="agent-detail"] .ad-statusbar-actions { justify-content: flex-start; flex-wrap: wrap; }
  .mkt-page[data-page="agent-detail"] .ad-facts,
  .mkt-page[data-page="agent-detail"] .ad-overview { grid-template-columns: 1fr 1fr; }
  .mkt-page[data-page="agent-detail"] .ad-kv-grid { grid-template-columns: 1fr; }
}

/* ============================================================== */
/* Persistent app shell                                            */
/* Sidebar lives in app/layout.js so it survives navigations.      */
/* Both the dashboard's visual-frame and admin pages' admin-shell  */
/* render INSIDE .app-content — they no longer carry the rail.    */
/* ============================================================== */
/* Sidebar is icon-only and never expands. Item labels appear as hover
   tooltips per icon (handled inside the sidebar component itself).

   Suppress the tooltip on the active link. The sidebar is persistent
   across navigations, so when you click a link the mouse stays over it
   and the :hover state would otherwise keep the tooltip pinned open
   after navigation — visually identical to "the click didn't register". */
.app-rail a[aria-current="page"] > span {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  height: 100vh;
  width: 100vw;
  background: #f4f3f0;
  overflow: hidden;
}
.app-rail {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.app-content {
  min-width: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.app-content > main,
.app-content > .visual-frame {
  flex: 1;
  min-height: 0;
}
@media (max-width: 980px) {
  .app-shell,
  .app-shell:has(.app-rail:hover),
  .app-shell:has(.app-rail:focus-within) {
    grid-template-columns: 56px 1fr;
  }
}

/* Dashboard (/) — visual-frame is now chat + canvas only. No rail column. */
.visual-frame.fresh-frame {
  grid-template-columns: 440px 1fr;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: #f4f4f3;
}
.visual-frame.fresh-frame.frame-chat-hidden {
  grid-template-columns: 1fr;
  column-gap: 0;
}
@media (max-width: 980px) {
  .visual-frame.fresh-frame,
  .visual-frame.fresh-frame.frame-chat-hidden {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
  }
}

/* Admin pages — .admin-shell is now a direct child of .app-content. */
.admin-shell {
  height: 100%;
  max-height: 100%;
}

/* Project detail — Finder-style project folder */
.mkt-page[data-page="project-detail"] .project-detail-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.mkt-page[data-page="project-detail"] .project-detail-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;margin-top:22px;align-items:stretch;}
.mkt-page[data-page="project-detail"] .project-detail-grid > .admin-panel{display:flex;flex-direction:column;}
.mkt-page[data-page="project-detail"] .project-status-panel .project-status-facts{margin-top:auto;}
.mkt-page[data-page="project-detail"] .project-status-card{display:flex;align-items:flex-start;gap:12px;padding:14px;border:1px solid rgba(17,19,24,.08);border-radius:16px;background:linear-gradient(180deg,#fff,#f8f7f4);}
.mkt-page[data-page="project-detail"] .project-status-card p{margin:0;color:#414751;font-size:13px;line-height:1.55;}
.mkt-page[data-page="project-detail"] .project-status-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0 0;}
.mkt-page[data-page="project-detail"] .project-status-facts div{min-width:0;border:1px solid rgba(17,19,24,.07);border-radius:14px;padding:11px 12px;background:rgba(255,255,255,.72);}
.mkt-page[data-page="project-detail"] .project-status-facts dt{font:750 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;text-transform:uppercase;letter-spacing:.12em;color:#8a8f99;margin-bottom:7px;}
.mkt-page[data-page="project-detail"] .project-status-facts dd{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#111318;font-size:12.5px;font-weight:650;}
.mkt-page[data-page="project-detail"] .project-folder-browser,.mkt-page[data-page="project-detail"] .project-changelog-panel{margin-top:14px;}
.mkt-page[data-page="project-detail"] .project-folder-browser-flush{margin-top:14px;padding:0;border:0;background:transparent;box-shadow:none;}
.mkt-page[data-page="project-detail"] .project-info-disclosure{margin-top:14px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:#fff;overflow:hidden;}
.mkt-page[data-page="project-detail"] .project-info-disclosure > summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 16px;color:#111318;font:650 13px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.01em;}

/* Supabase landing/login — institutional dark entry surface, chromeless by AppChrome. */
.login-page-shell{height:100vh;min-height:100vh;width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;display:grid;grid-template-columns:minmax(0,1.1fr) 440px;gap:1px;background:#4A4A4D;color:#E8E8E5;font-family:var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);}
.login-hero-panel,.login-card,.login-local-card{background:#0F0F11;position:relative;overflow:hidden;}
.login-page-shell--local{grid-template-columns:1fr;background:#0F0F11;place-items:center;padding:24px;}
.login-page-shell--local .login-local-card{width:min(620px,100%);min-height:auto;border:1px solid rgba(232,232,229,.10);border-radius:28px;box-shadow:0 30px 100px rgba(0,0,0,.34);}
.login-hero-panel{padding:clamp(34px,6vw,84px);display:flex;flex-direction:column;justify-content:center;min-height:100vh;}
.login-hero-panel::before{content:'';position:absolute;inset:8%;border:1px solid rgba(232,232,229,.08);transform:skewX(-8deg);pointer-events:none;}
/* Orbital rings + self-drawing madarX mark (shared brand motif from madarx.io) */
.login-orbit{position:absolute;right:-170px;top:50%;width:680px;height:680px;transform:translateY(-50%);pointer-events:none;z-index:0;opacity:0;animation:loginOrbitIn 1.3s ease .15s forwards;}
.login-orbit svg{display:block;width:100%;height:100%;}
.login-orbit-spin{transform-origin:350px 350px;animation:loginOrbitSpin 90s linear infinite;}
.login-orbit-spin--rev{animation-duration:130s;animation-direction:reverse;}
.login-orbit-bead{transform-origin:350px 350px;animation:loginOrbitSpin 26s linear infinite;}
.login-orbit-bead--outer{animation-duration:60s;animation-direction:reverse;}
.login-brand-lockup{position:relative;z-index:1;display:flex;align-items:center;gap:14px;}
.login-mark{display:block;flex:0 0 auto;overflow:visible;}
.login-mark .lm-arc{stroke-dasharray:252;stroke-dashoffset:252;animation:loginDraw 1.4s cubic-bezier(.4,0,.2,1) .3s forwards;}
.login-mark .lm-x1{stroke-dasharray:80;stroke-dashoffset:80;animation:loginDraw .5s cubic-bezier(.4,0,.2,1) 1.5s forwards;}
.login-mark .lm-x2{stroke-dasharray:80;stroke-dashoffset:80;animation:loginDraw .5s cubic-bezier(.4,0,.2,1) 1.85s forwards;}
.login-mark .lm-bead{opacity:0;animation:loginBeadIn .3s ease 2.1s forwards;}
@keyframes loginOrbitIn{to{opacity:1;}}
@keyframes loginOrbitSpin{to{transform:rotate(360deg);}}
@keyframes loginDraw{to{stroke-dashoffset:0;}}
@keyframes loginBeadIn{0%{opacity:0;r:0;}80%{r:4;}100%{opacity:1;r:3;}}
@media (prefers-reduced-motion:reduce){.login-orbit{animation:none;opacity:1;}.login-orbit-spin,.login-orbit-spin--rev,.login-orbit-bead{animation:none;}.login-mark .lm-arc,.login-mark .lm-x1,.login-mark .lm-x2{animation:none;stroke-dashoffset:0;}.login-mark .lm-bead{animation:none;opacity:1;}}
.login-wordmark{font:500 22px/1 var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);letter-spacing:-.06em;color:#E8E8E5;position:relative;z-index:1;}.login-wordmark span{color:#C2452A;}
.login-kicker{margin:72px 0 16px;color:#DCDCD8;text-transform:uppercase;letter-spacing:.18em;font-size:11px;position:relative;z-index:1;}.login-hero-panel h1{font-size:clamp(48px,7.8vw,104px);line-height:.88;letter-spacing:-.09em;max-width:960px;margin:0;color:#E8E8E5;position:relative;z-index:1;}.login-lede{max-width:690px;margin:28px 0 0;color:#BEBEB9;line-height:1.75;font-family:ui-sans-serif,system-ui,sans-serif;font-size:16px;position:relative;z-index:1;}
.login-proof-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin-top:56px;border:1px solid rgba(232,232,229,.10);position:relative;z-index:1;}.login-proof-grid div{padding:18px;background:rgba(232,232,229,.035);}.login-proof-grid b{display:block;color:#E8E8E5;font-size:12px;margin-bottom:8px;text-transform:uppercase;letter-spacing:.08em;}.login-proof-grid span{display:block;color:#A9AAA5;font:13px/1.55 ui-sans-serif,system-ui,sans-serif;}
.login-card{padding:clamp(24px,5vw,56px);display:flex;flex-direction:column;justify-content:center;min-height:100vh;border-left:1px solid rgba(232,232,229,.10);}.login-card-head p{margin:0 0 10px;color:#C2452A;text-transform:uppercase;letter-spacing:.16em;font-size:11px;font-weight:800;}.login-card-head h2{margin:0 0 24px;color:#E8E8E5;font-size:28px;letter-spacing:-.05em;}.login-mode-toggle{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border:1px solid rgba(232,232,229,.12);border-radius:8px;background:rgba(232,232,229,.04);margin-bottom:18px;}.login-mode-toggle button{border:0;border-radius:5px;background:transparent;color:#A9AAA5;padding:10px 12px;cursor:pointer;font-family:var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;transition:background .14s ease,color .14s ease,box-shadow .14s ease;}.login-mode-toggle button.active{background:rgba(194,69,42,.14);color:#E8E8E5;box-shadow:inset 0 0 0 1px rgba(194,69,42,.5);}.login-message{border-left:2px solid #C2452A;background:rgba(194,69,42,.10);padding:12px 14px;margin-bottom:16px;color:#E8E8E5;font:13px/1.45 ui-sans-serif,system-ui,sans-serif;}.login-form{display:grid;gap:14px;}.login-form label{display:grid;gap:8px;color:#DCDCD8;font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;}.login-sso{display:grid;gap:10px;margin-top:18px;}.login-sso>span{display:flex;align-items:center;gap:12px;color:#8D8E8A;font-size:11px;text-transform:uppercase;letter-spacing:.12em;}.login-sso>span::before,.login-sso>span::after{content:'';height:1px;background:rgba(232,232,229,.12);flex:1;}.login-footnote{margin:22px 0 0;color:#8D8E8A;font:12px/1.65 ui-sans-serif,system-ui,sans-serif;}.login-local-card{min-height:100vh;display:grid;place-content:center;padding:36px;text-align:center;}.login-local-card h1{font-size:42px;letter-spacing:-.07em;margin:22px 0 12px;}.login-local-card p{max-width:560px;color:#BEBEB9;font:15px/1.7 ui-sans-serif,system-ui,sans-serif;}.login-link-button{display:inline-flex;align-items:center;gap:10px;justify-content:center;margin:24px auto 0;padding:13px 20px;border-radius:4px;background:#C2452A;color:#fff;text-decoration:none;font-family:var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.14em;transition:opacity .15s ease;}.login-link-button:hover{opacity:.86;}
.login-link-button--ghost{margin-top:12px;background:transparent;color:#C2452A;border:1px solid rgba(194,69,42,.4);}.login-link-button--ghost:hover{opacity:1;background:rgba(194,69,42,.1);border-color:#C2452A;}
.login-message--warn{border-left-color:#C2452A;background:rgba(194,69,42,.08);}
.login-message--warn code,.login-local-card code{font:600 12px/1.4 ui-monospace,SFMono-Regular,Menlo,monospace;color:#E8E8E5;background:rgba(232,232,229,.10);padding:1px 6px;border-radius:6px;}
.login-env-block{text-align:left;max-width:560px;margin:18px auto;padding:16px 18px;border-radius:14px;background:rgba(0,0,0,.34);border:1px solid rgba(232,232,229,.12);color:#DCDCD8;font:600 12.5px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace;white-space:pre;overflow-x:auto;}
.login-message a{color:#E8E8E5;text-decoration:underline;}
.login-text-button{background:none;border:0;padding:0;color:#C2452A;font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;}
.login-text-button:disabled{opacity:.6;cursor:default;}
/* Personal vs Team chooser (top of the login card) */
.login-seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;border:1px solid rgba(232,232,229,.12);border-radius:8px;background:rgba(232,232,229,.04);margin-bottom:22px;}
.login-seg button{border:0;border-radius:5px;background:transparent;color:#A9AAA5;padding:11px 12px;cursor:pointer;font-family:var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.1em;transition:background .14s ease,color .14s ease,box-shadow .14s ease;}
.login-seg button.active{background:rgba(194,69,42,.14);color:#E8E8E5;box-shadow:inset 0 0 0 1px rgba(194,69,42,.5);}
/* Join-with-a-link row (Team view) */
.login-join{margin-top:22px;padding-top:18px;border-top:1px solid rgba(232,232,229,.10);}
.login-join-label{display:block;color:#8D8E8A;font-size:11px;text-transform:uppercase;letter-spacing:.12em;font-weight:800;margin-bottom:10px;}
.login-join-row{display:flex;gap:8px;align-items:stretch;}
/* Inline Create-a-team form (Team view, fresh install) */
.login-create-team{margin-top:2px;}
.login-create-actions{display:flex;gap:8px;align-items:stretch;}
/* Marketing-matched buttons (madarx.io): solid Mars primary, Mars-outline secondary, uppercase mono, crisp corners */
.login-btn{width:100%;min-height:46px;display:inline-flex;align-items:center;justify-content:center;gap:10px;padding:0 18px;border:0;border-radius:4px;background:#C2452A;color:#fff;font-family:var(--font-mono-brand,'IBM Plex Mono',ui-monospace,monospace);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.14em;cursor:pointer;transition:opacity .15s ease,background .15s ease,border-color .15s ease;}
.login-btn:hover:not(:disabled){opacity:.86;}
.login-btn:disabled{opacity:.5;cursor:default;}
.login-btn--ghost{background:transparent;color:#C2452A;border:1px solid rgba(194,69,42,.4);}
.login-btn--ghost:hover:not(:disabled){opacity:1;background:rgba(194,69,42,.1);border-color:#C2452A;}
.login-btn--inline{width:auto;flex:0 0 auto;}
.auth-mode-toggle{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.auth-mode-toggle button{display:flex;flex-direction:column;gap:3px;text-align:left;padding:12px 14px;border-radius:12px;border:1px solid rgba(20,22,26,.14);background:#fff;color:#313740;font-weight:700;cursor:pointer;transition:border-color 140ms ease,background 140ms ease;}
.auth-mode-toggle button small{font-weight:450;color:#737a85;font-size:11.5px;}
.auth-mode-toggle button.active{border-color:var(--accent-600,#C2452A);background:rgba(194,69,42,.05);box-shadow:inset 0 0 0 1px var(--accent-600,#C2452A);}
.auth-mode-toggle button:disabled{opacity:.55;cursor:default;}
@media(max-width:560px){.auth-mode-toggle{grid-template-columns:1fr;}}

/* ── Space share modal ─────────────────────────────────────────────────────── */
.space-share-overlay{position:fixed;inset:0;z-index:1000;background:rgba(17,19,24,.42);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;padding:24px;overflow-y:auto;}
.space-share-modal{width:min(540px,100%);max-height:calc(100vh - 48px);overflow-y:auto;background:#fff;border-radius:18px;border:1px solid rgba(20,22,26,.10);box-shadow:0 30px 90px rgba(17,19,24,.28);padding:22px;margin:auto;}
.ssm-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px;}
.ssm-eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase;color:var(--accent-600,#C2452A);}
.ssm-title{font-size:20px;font-weight:650;letter-spacing:-.02em;margin-top:3px;color:#16181d;}
.ssm-close{border:0;background:rgba(17,19,24,.05);color:#444;border-radius:9px;width:30px;height:30px;display:grid;place-items:center;cursor:pointer;}
.ssm-close:hover{background:rgba(17,19,24,.1);}
.ssm-error{background:rgba(194,69,42,.08);border:1px solid rgba(194,69,42,.22);color:#a8331c;padding:8px 12px;border-radius:10px;font-size:13px;margin-bottom:12px;}
.ssm-section{border-top:1px solid rgba(20,22,26,.08);padding-top:16px;margin-top:6px;}
.ssm-section:first-of-type{border-top:0;padding-top:0;}
.ssm-section-title{font-size:14px;font-weight:700;color:#1d2026;margin-bottom:4px;}
.ssm-note{font-size:12.5px;color:#6b7280;line-height:1.5;margin-bottom:12px;}
.ssm-form{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;margin-bottom:14px;}
.ssm-field{display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#5b626c;}
.ssm-field input,.ssm-field select{font:inherit;font-size:13px;font-weight:500;text-transform:none;letter-spacing:0;padding:8px 10px;border:1px solid rgba(20,22,26,.16);border-radius:9px;background:#fff;color:#1d2026;min-width:120px;}
.ssm-check{display:flex;align-items:center;gap:7px;font-size:13px;color:#3a3f47;font-weight:500;}
.ssm-btn{font:inherit;font-size:13px;font-weight:650;border-radius:9px;padding:8px 14px;border:1px solid rgba(20,22,26,.16);background:#fff;color:#2a2f37;cursor:pointer;}
.ssm-btn:disabled{opacity:.55;cursor:default;}
.ssm-btn-primary{background:#16181d;color:#fff;border-color:#16181d;}
.ssm-btn-sm{padding:6px 10px;font-size:12px;}
.ssm-btn-danger{color:#a8331c;border-color:rgba(194,69,42,.3);}
.ssm-btn-danger:hover{background:rgba(194,69,42,.06);}
.ssm-links{display:flex;flex-direction:column;gap:10px;}
.ssm-muted{font-size:12.5px;color:#8a8f99;}
.ssm-link{border:1px solid rgba(20,22,26,.10);border-radius:11px;padding:10px 12px;background:#fbfaf8;}
.ssm-link-main{display:flex;gap:8px;align-items:center;}
.ssm-link-url{flex:1;min-width:0;font:inherit;font-size:12px;padding:6px 9px;border:1px solid rgba(20,22,26,.14);border-radius:8px;background:#fff;color:#3a3f47;}
.ssm-link-meta{margin-top:6px;font-size:11.5px;color:#7a818c;}
.ssm-cloud-status{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.ssm-badge{font-size:11px;font-weight:700;border-radius:999px;padding:3px 10px;}
.ssm-badge-on{background:rgba(34,139,84,.12);color:#1d7a47;}
@media(max-width:980px){.login-page-shell{min-height:100dvh;height:100dvh;grid-template-columns:1fr;grid-auto-rows:max-content;}.login-hero-panel,.login-card{min-height:auto;overflow:visible;}.login-hero-panel{overflow:clip;}.login-orbit{right:-220px;width:520px;height:520px;opacity:.6;}.login-card{border-left:0;border-top:1px solid rgba(232,232,229,.10);}.login-proof-grid{grid-template-columns:1fr;}.login-hero-panel h1{font-size:48px;}}
.mkt-page[data-page="project-detail"] .project-info-disclosure > summary::-webkit-details-marker{display:none;}
.mkt-page[data-page="project-detail"] .project-info-disclosure > summary::after{content:'\\203A';color:#8a8f99;font-size:18px;transition:transform 160ms ease;}
.mkt-page[data-page="project-detail"] .project-info-disclosure[open] > summary::after{transform:rotate(90deg);}
.mkt-page[data-page="project-detail"] .project-info-disclosure > summary small{color:#7a818c;font:450 11.5px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:.01em;margin-left:auto;margin-right:10px;}
.mkt-page[data-page="project-detail"] .project-info-disclosure > summary:hover{background:rgba(17,19,24,.025);}
.mkt-page[data-page="project-detail"] .project-info-body{padding:6px 16px 16px;border-top:1px solid rgba(17,19,24,.07);background:#fbfaf7;}
.mkt-page[data-page="project-detail"] .project-info-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:12px 0 14px;}
.mkt-page[data-page="project-detail"] .project-info-facts div{min-width:0;border:1px solid rgba(17,19,24,.07);border-radius:12px;padding:10px 12px;background:#fff;}
.mkt-page[data-page="project-detail"] .project-info-facts dt{font:750 9.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;text-transform:uppercase;letter-spacing:.12em;color:#8a8f99;margin-bottom:7px;}
.mkt-page[data-page="project-detail"] .project-info-facts dd{margin:0;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#111318;font-size:12.5px;font-weight:600;}
.mkt-page[data-page="project-detail"] .project-info-integrations{border-top:1px dashed rgba(17,19,24,.08);padding-top:12px;}
.mkt-page[data-page="project-detail"] .project-info-integration-row{display:flex;align-items:center;justify-content:space-between;gap:14px;}
.mkt-page[data-page="project-detail"] .project-info-integration-row b{display:block;font-size:13px;color:#111318;}
.mkt-page[data-page="project-detail"] .project-info-integration-row small{display:block;color:#68707b;font-size:11.5px;margin-top:2px;}
.mkt-page[data-page="project-detail"] .project-info-integration-actions{display:flex;align-items:center;gap:10px;}
.mkt-page[data-page="project-detail"] .project-library-item.synthetic .project-file-icon{background:#1f6f54;}
.mkt-page[data-page="project-detail"] .project-library-item.synthetic b{color:#111318;}
.mkt-page[data-page="project-detail"] .project-library-item.synthetic.selected{border-color:rgba(31,111,84,.42);}
@media(max-width:720px){.mkt-page[data-page="project-detail"] .project-info-facts{grid-template-columns:1fr}}
.mkt-page[data-page="project-detail"] .project-finder-shell{display:grid;grid-template-columns:220px minmax(0,1fr) minmax(360px,1.05fr);min-height:560px;height:min(72vh,720px);border:1px solid rgba(17,19,24,.08);border-radius:18px;overflow:hidden;background:#fff;}
.mkt-page[data-page="project-detail"] .project-finder-sidebar{background:#f3f1ec;border-right:1px solid rgba(17,19,24,.08);padding:14px;display:flex;flex-direction:column;gap:6px;overflow:auto;}
.mkt-page[data-page="project-detail"] .project-library-label{margin-top:14px;}
.mkt-page[data-page="project-detail"] .project-folder-row{display:flex;flex-direction:column;gap:4px;border:1px solid transparent;border-radius:12px;padding:10px;color:#313740;text-align:left;background:transparent;cursor:default;}
.mkt-page[data-page="project-detail"] .project-smart-row{cursor:pointer;font:inherit;-webkit-appearance:none;appearance:none;}
.mkt-page[data-page="project-detail"] .project-smart-row:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:1px;}
.mkt-page[data-page="project-detail"] .project-folder-row.on,.mkt-page[data-page="project-detail"] .project-folder-row:hover{background:#fff;border-color:rgba(17,19,24,.08);box-shadow:0 8px 24px rgba(17,19,24,.06);}
.mkt-page[data-page="project-detail"] .project-folder-row.on b{color:#c2452a;}
.mkt-page[data-page="project-detail"] .project-folder-row b{font-size:12.5px;letter-spacing:-.01em;}
.mkt-page[data-page="project-detail"] .project-folder-row code{font:500 10.5px/1.3 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#7a818c;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.mkt-page[data-page="project-detail"] .project-finder-list{padding:12px;background:linear-gradient(180deg,#fff,#fbfaf7);overflow:auto;}
.mkt-page[data-page="project-detail"] .project-library-item{display:grid;grid-template-columns:46px minmax(0,1fr);gap:11px;align-items:center;border:1px solid transparent;border-radius:14px;padding:10px;margin-bottom:8px;width:100%;background:transparent;text-align:left;cursor:pointer;-webkit-appearance:none;appearance:none;font:inherit;color:inherit;transition:background 120ms ease,border-color 120ms ease,box-shadow 120ms ease;}
.mkt-page[data-page="project-detail"] .project-library-item:hover{background:#fff;border-color:rgba(17,19,24,.10);}
.mkt-page[data-page="project-detail"] .project-library-item.selected{background:#fff;border-color:rgba(194,69,42,.32);box-shadow:0 10px 28px rgba(17,19,24,.08);}
.mkt-page[data-page="project-detail"] .project-library-item:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:1px;}
.mkt-page[data-page="project-detail"] .project-library-item-meta{min-width:0;display:flex;flex-direction:column;gap:3px;}
.mkt-page[data-page="project-detail"] .project-file-icon{width:46px;height:46px;border-radius:13px;display:grid;place-items:center;background:#111318;color:#fff;font:800 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.04em;}
.mkt-page[data-page="project-detail"] .project-file-icon[data-kind="artifact"]{background:#c2452a;}
.mkt-page[data-page="project-detail"] .project-library-item b{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;letter-spacing:-.01em;color:#111318;}
.mkt-page[data-page="project-detail"] .project-library-item small{display:block;color:#68707b;font-size:11.5px;}
.mkt-page[data-page="project-detail"] .project-preview-pane{border-left:1px solid rgba(17,19,24,.08);background:#f8f7f4;padding:14px;overflow:hidden;display:flex;flex-direction:column;min-height:0;}
.mkt-page[data-page="project-detail"] .project-preview-card{flex:1;display:flex;flex-direction:column;min-height:0;border:1px solid rgba(17,19,24,.08);border-radius:16px;background:#fff;box-shadow:0 14px 34px rgba(17,19,24,.08);overflow:hidden;}
.mkt-page[data-page="project-detail"] .project-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid rgba(17,19,24,.07);background:#fafaf7;}
.mkt-page[data-page="project-detail"] .project-preview-head-info{min-width:0;flex:1;}
.mkt-page[data-page="project-detail"] .project-preview-head-actions{display:flex;align-items:center;gap:8px;flex-shrink:0;}
.mkt-page[data-page="project-detail"] .project-preview-download{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(17,19,24,.12);background:#fff;color:#111318;font:650 11.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:.01em;padding:7px 11px;border-radius:10px;cursor:pointer;transition:background 120ms ease,border-color 120ms ease,transform 120ms ease;}
.mkt-page[data-page="project-detail"] .project-preview-download:hover{background:#111318;color:#fff;border-color:#111318;}
.mkt-page[data-page="project-detail"] .project-preview-download:active{transform:translateY(1px);}
.mkt-page[data-page="project-detail"] .project-preview-download:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.mkt-page[data-page="project-detail"] .project-preview-head b{display:block;font-size:14px;letter-spacing:-.02em;color:#111318;}
.mkt-page[data-page="project-detail"] .project-preview-head small{display:block;margin-top:4px;color:#68707b;font-size:11.5px;}
.mkt-page[data-page="project-detail"] .project-preview-body{flex:1;overflow:auto;padding:16px;min-height:0;}
.mkt-page[data-page="project-detail"] .project-preview-card-flush .project-preview-body{padding:0;}
.mkt-page[data-page="project-detail"] .project-preview-card-flush{background:#fff;}
.mkt-page[data-page="project-detail"] .project-preview-iframe{display:block;width:100%;height:100%;min-height:0;border:0;background:#fff;}
.mkt-page[data-page="project-detail"] .project-preview-markdown{font-size:13.5px;line-height:1.6;color:#222731;}
.mkt-page[data-page="project-detail"] .project-preview-markdown h1,
.mkt-page[data-page="project-detail"] .project-preview-markdown h2,
.mkt-page[data-page="project-detail"] .project-preview-markdown h3{letter-spacing:-.02em;color:#111318;margin:18px 0 8px;}
.mkt-page[data-page="project-detail"] .project-preview-markdown h1{font-size:22px;font-weight:700;}
.mkt-page[data-page="project-detail"] .project-preview-markdown h2{font-size:17px;font-weight:650;}
.mkt-page[data-page="project-detail"] .project-preview-markdown h3{font-size:14px;font-weight:650;}
.mkt-page[data-page="project-detail"] .project-preview-markdown p{margin:0 0 10px;}
.mkt-page[data-page="project-detail"] .project-preview-markdown ul,
.mkt-page[data-page="project-detail"] .project-preview-markdown ol{margin:0 0 10px;padding-left:22px;}
.mkt-page[data-page="project-detail"] .project-preview-markdown li{margin:3px 0;}
.mkt-page[data-page="project-detail"] .project-preview-markdown code{background:#f3f1ec;border:1px solid rgba(17,19,24,.07);border-radius:6px;padding:1px 5px;font:500 12px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;}
.mkt-page[data-page="project-detail"] .project-preview-markdown pre{background:#111318;color:#f7f1e8;border-radius:12px;padding:13px;font:500 12px/1.55 'IBM Plex Mono','SF Mono',ui-monospace,monospace;overflow:auto;}
.mkt-page[data-page="project-detail"] .project-preview-markdown pre code{background:transparent;border:0;padding:0;color:inherit;}
.mkt-page[data-page="project-detail"] .project-preview-markdown a{color:#c2452a;text-decoration:underline;text-underline-offset:2px;}
.mkt-page[data-page="project-detail"] .project-preview-markdown blockquote{margin:0 0 10px;padding:8px 12px;border-left:3px solid #c2452a;background:rgba(194,69,42,.06);color:#3a3f49;border-radius:0 8px 8px 0;}
.mkt-page[data-page="project-detail"] .project-preview-markdown table{border-collapse:collapse;width:100%;font-size:12.5px;margin:8px 0;}
.mkt-page[data-page="project-detail"] .project-preview-markdown th,
.mkt-page[data-page="project-detail"] .project-preview-markdown td{border:1px solid rgba(17,19,24,.10);padding:6px 9px;text-align:left;}
.mkt-page[data-page="project-detail"] .project-preview-pre{margin:0;white-space:pre-wrap;border-radius:12px;background:#111318;color:#f7f1e8;padding:13px;font:500 12px/1.55 'IBM Plex Mono','SF Mono',ui-monospace,monospace;overflow:auto;}
.mkt-page[data-page="project-detail"] .project-preview-locked{display:flex;flex-direction:column;gap:8px;}
.mkt-page[data-page="project-detail"] .project-preview-locked code{font:500 11px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#68707b;word-break:break-all;}
.mkt-page[data-page="project-detail"] .project-preview-truncated{display:block;margin-top:10px;color:#8a8f99;font-size:11px;letter-spacing:.02em;}
.mkt-page[data-page="project-detail"] .project-preview-empty{color:#68707b;font-size:13px;line-height:1.55;display:grid;place-items:center;padding:28px 18px;text-align:center;}
.mkt-page[data-page="project-detail"] .project-changelog-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;}
.mkt-page[data-page="project-detail"] .project-changelog-list li{display:grid;grid-template-columns:120px minmax(0,1fr);gap:14px;border:1px solid rgba(17,19,24,.07);border-radius:14px;padding:12px;background:rgba(255,255,255,.76);}
.mkt-page[data-page="project-detail"] .project-changelog-list time{font:650 10.5px/1.35 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#8a8f99;text-transform:uppercase;letter-spacing:.08em;}
.mkt-page[data-page="project-detail"] .project-changelog-list b{display:block;color:#111318;font-size:13px;}
.mkt-page[data-page="project-detail"] .project-changelog-list p{margin:4px 0 7px;color:#59606b;font-size:12.5px;line-height:1.4;}
.mkt-page[data-page="project-detail"] .project-changelog-list code{font:650 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#9a3325;background:#fff0ed;border-radius:999px;padding:4px 7px;}
@media(max-width:1100px){
  .mkt-page[data-page="project-detail"] .project-detail-grid{grid-template-columns:1fr}
  .mkt-page[data-page="project-detail"] .project-finder-shell{grid-template-columns:1fr;height:auto;}
  .mkt-page[data-page="project-detail"] .project-finder-sidebar,.mkt-page[data-page="project-detail"] .project-preview-pane{border:0;border-bottom:1px solid rgba(17,19,24,.08)}
  .mkt-page[data-page="project-detail"] .project-preview-pane{min-height:480px;}
  .mkt-page[data-page="project-detail"] .project-preview-iframe{min-height:440px;}
}
@media(max-width:720px){.mkt-page[data-page="project-detail"] .project-status-facts{grid-template-columns:1fr}.mkt-page[data-page="project-detail"] .project-changelog-list li{grid-template-columns:1fr}.mkt-page[data-page="project-detail"] .project-detail-actions{justify-content:flex-start}}

/* ===== Project header chip ===== */
.project-activity-link{display:inline-flex;align-items:center;gap:7px;height:36px;color:#3a3f49;background:#fff;border:1px solid rgba(17,19,24,.12);border-radius:999px;padding:0 14px;font:600 12.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.005em;text-decoration:none;white-space:nowrap;transition:background 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease,transform 140ms ease;}
.project-activity-link svg{flex-shrink:0;color:#7a818c;transition:color 140ms ease;}
.project-activity-link:hover{background:#111318;color:#fff;border-color:#111318;box-shadow:0 6px 16px rgba(17,19,24,.16);}
.project-activity-link:hover svg{color:#fff;}
.project-activity-link:active{transform:translateY(1px);}
.project-activity-link:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-activity-link.icon-only{width:36px;padding:0;justify-content:center;}
.project-activity-link.icon-only svg{color:#3a3f49;}
.project-activity-link.icon-only:hover svg{color:#fff;}

/* ===== Project album ===== */
.mkt-page[data-page="project-detail"]{padding-top:4px;}
.project-album{display:flex;flex-direction:column;gap:18px;}
.project-album-toolbar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;justify-content:space-between;}
.project-album-search{flex:1 1 320px;display:flex;align-items:center;gap:9px;background:#fff;border:1px solid rgba(17,19,24,.10);border-radius:14px;padding:9px 14px;transition:border-color 120ms ease,box-shadow 120ms ease;min-width:0;}
.project-album-search:focus-within{border-color:rgba(17,19,24,.32);box-shadow:0 0 0 4px rgba(17,19,24,.04);}
.project-album-search-icon{color:#8a8f99;flex-shrink:0;}
.project-album-search input{flex:1;min-width:0;border:0;outline:0;background:transparent;font:500 13.5px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#111318;letter-spacing:-.005em;}
.project-album-search input::placeholder{color:#9aa0aa;}
.project-album-search-clear{border:0;background:rgba(17,19,24,.06);color:#3a3f49;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;cursor:pointer;font:600 14px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-album-search-clear:hover{background:rgba(17,19,24,.12);}
.project-album-filters{display:flex;align-items:center;gap:4px;background:rgba(17,19,24,.05);border:1px solid rgba(17,19,24,.06);border-radius:12px;padding:3px;}
.project-album-filter{display:inline-flex;align-items:center;gap:6px;border:0;background:transparent;color:#3a3f49;font:600 12px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:7px 12px;border-radius:9px;cursor:pointer;letter-spacing:.01em;transition:background 120ms ease,color 120ms ease;}
.project-album-filter code{font:600 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#8a8f99;background:transparent;padding:0;}
.project-album-filter:hover{color:#111318;}
.project-album-filter.on{background:#fff;color:#111318;box-shadow:0 1px 2px rgba(17,19,24,.06),0 0 0 1px rgba(17,19,24,.08);}
.project-album-filter.on code{color:#c2452a;}
.project-album-filter:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-lock{position:relative;width:36px;height:36px;display:grid;place-items:center;color:#3a3f49;background:#fff;border:1px solid rgba(17,19,24,.10);border-radius:12px;cursor:pointer;flex-shrink:0;transition:background 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease,transform 140ms ease;}
.project-album-lock svg{color:#7a818c;transition:color 140ms ease;}
.project-album-lock:hover:not(:disabled){border-color:rgba(17,19,24,.22);color:#111318;}
.project-album-lock:hover:not(:disabled) svg{color:#3a3f49;}
.project-album-lock:active:not(:disabled){transform:translateY(1px);}
.project-album-lock:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-lock:disabled{cursor:default;opacity:.55;}
.project-album-lock.state-locked{background:#111318;color:#fff;border-color:#111318;box-shadow:0 6px 16px rgba(17,19,24,.20);}
.project-album-lock.state-locked svg{color:#fff;}
.project-album-lock.state-locked:hover{background:#1e222a;border-color:#1e222a;}
.project-album-lock.state-unlocked{background:#fff;border-color:rgba(194,69,42,.30);color:#c2452a;}
.project-album-lock.state-unlocked svg{color:#c2452a;}
.project-album-lock.state-unlocked:hover{background:#fff5f1;}
.project-album-lock-dot{position:absolute;top:6px;right:6px;width:7px;height:7px;border-radius:50%;background:#f0a32c;box-shadow:0 0 0 2px #111318;}
.project-album-lock.lockout{background:#7a818c;border-color:#7a818c;}
.project-album-lock.lockout svg{color:#fff;}
.project-album-lock.lockout .project-album-lock-dot{background:#c2452a;box-shadow:0 0 0 2px #7a818c;}
/* ---- New lock chip (replaces old privacy-hint block) ---- */
.project-album-lock-chip{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 13px;box-sizing:border-box;border-radius:999px;border:1px solid rgba(17,19,24,.12);background:#fff;color:#3a3f49;font:600 12.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;cursor:pointer;flex-shrink:0;transition:background 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease;}
.project-album-lock-chip:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-lock-chip.no-passphrase{color:#7a818c;border-color:rgba(17,19,24,.08);}
.project-album-lock-chip.no-passphrase:hover{border-color:rgba(17,19,24,.22);color:#3a3f49;}
.project-album-lock-chip.locked{background:#111318;color:#fff;border-color:#111318;box-shadow:0 4px 12px rgba(17,19,24,.18);}
.project-album-lock-chip.locked:hover{background:#1e222a;border-color:#1e222a;}
.project-album-lock-chip.unlocked{background:#fff;border-color:rgba(40,167,74,.35);color:#1a8040;}
.project-album-lock-chip.unlocked:hover{background:#f0fdf4;border-color:rgba(40,167,74,.55);}
.project-album-lock-chip-count{display:inline-block;padding:1px 6px;border-radius:99px;background:rgba(255,255,255,.18);font:600 10.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.01em;}
.project-album-lock-chip-action{font:500 11px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:rgba(26,128,64,.7);margin-left:2px;}
.project-album-folder-new{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 14px;box-sizing:border-box;border-radius:999px;border:1px solid rgba(17,19,24,.12);background:#fff;color:#3a3f49;font:600 12.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.005em;cursor:pointer;flex-shrink:0;transition:background 140ms ease,border-color 140ms ease,color 140ms ease,box-shadow 140ms ease,transform 140ms ease;}
.project-album-folder-new svg{flex-shrink:0;color:#7a818c;transition:color 140ms ease;}
.project-album-folder-new:hover:not(:disabled){background:#111318;color:#fff;border-color:#111318;box-shadow:0 6px 16px rgba(17,19,24,.16);}
.project-album-folder-new:hover:not(:disabled) svg{color:#fff;}
.project-album-folder-new:active:not(:disabled){transform:translateY(1px);}
.project-album-folder-new:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-folder-new:disabled{opacity:.55;cursor:wait;}
.project-album-folder-hint{display:block;margin-top:6px;color:#7a818c;font:500 11.5px/1.4 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}

/* ---- Breadcrumb -------------------------------------------------------- */
.project-album-breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 14px;color:#7a818c;font:500 12.5px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-album-crumb-row{display:inline-flex;align-items:center;gap:6px;}
.project-album-crumb-sep{color:#b9bfc8;}
.project-album-crumb{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;border-radius:8px;padding:4px 8px;color:#3a3f49;cursor:pointer;font:inherit;transition:background 120ms ease,border-color 120ms ease,color 120ms ease;}
.project-album-crumb svg{color:#7a818c;}
.project-album-crumb:hover{background:#f1f2f4;color:#111318;}
.project-album-crumb.current{color:#111318;font-weight:600;padding:4px 8px;cursor:default;}
.project-album-crumb.drop-target{background:#fff;border-color:rgba(194,69,42,.55);color:#c2452a;box-shadow:0 0 0 3px rgba(194,69,42,.12);}

/* ---- Folder cards (grid above items) ----------------------------------- */
.project-album-folders{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin:0 0 18px;}
.project-album-folder-card{display:flex;align-items:center;gap:12px;padding:14px 16px;background:#fff;border:1px solid rgba(17,19,24,.08);border-radius:14px;cursor:pointer;text-align:left;font:inherit;color:inherit;transition:border-color 140ms ease,box-shadow 140ms ease,transform 120ms ease,background 140ms ease;}
.project-album-folder-card:hover{border-color:rgba(17,19,24,.22);box-shadow:0 4px 14px rgba(17,19,24,.06);}
.project-album-folder-card:active{transform:translateY(1px);}
.project-album-folder-card:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-folder-card-icon{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;background:#f4ede2;color:#8a6a3a;flex-shrink:0;}
.project-album-folder-card-body{display:flex;flex-direction:column;gap:2px;min-width:0;}
.project-album-folder-card-body b{font:600 13.5px/1.25 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#111318;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.project-album-folder-card-body small{color:#7a818c;font:500 11.5px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-album-folder-card.drop-target{border-color:rgba(194,69,42,.55);background:#fff7f5;box-shadow:0 0 0 3px rgba(194,69,42,.12);}

/* ---- Drag-move state on item cards ------------------------------------- */
.project-album-card.moving{opacity:.55;pointer-events:none;}
.project-album-card[draggable=true]{cursor:grab;}
.project-album-card[draggable=true]:active{cursor:grabbing;}

/* ---- Winbar move select ------------------------------------------------ */
.winbar-move,.winbar-space{position:relative;display:grid;place-items:center;width:22px;height:22px;padding:0;border-radius:6px;border:0;background:transparent;color:#6c747f;cursor:pointer;transition:background .12s,color .12s;flex-shrink:0;}
.winbar-move svg,.winbar-space svg{pointer-events:none;}
.winbar-move:hover,.winbar-space:hover{background:rgba(17,19,24,.08);color:#111318;}
.winbar-move:focus-within,.winbar-space:focus-within{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.winbar-move select,.winbar-space select{position:absolute;inset:0;width:100%;height:100%;opacity:0;appearance:none;border:0;background:transparent;cursor:pointer;font:600 10.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:transparent;}
.winbar-move select:disabled,.winbar-space select:disabled{cursor:wait;}
.winbar-move select option,.winbar-space select option{color:#111318;background:#fff;}
/* ---- Migration banner ---- */
.project-album-migration-banner{display:flex;align-items:center;gap:12px;padding:12px 16px;border:1px solid rgba(240,163,44,.28);background:linear-gradient(180deg,#fffbf0,#fdf7e3);border-radius:14px;color:#6b4f0a;flex-wrap:wrap;}
.project-album-migration-banner svg{flex-shrink:0;color:#c2452a;}
.project-album-migration-banner p{flex:1;min-width:180px;margin:0;font:500 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-album-migration-actions{display:flex;gap:8px;flex-shrink:0;}
.project-album-migration-cta{border:0;background:#111318;color:#fff;font:650 12px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:8px 13px;border-radius:9px;cursor:pointer;transition:background 120ms ease;}
.project-album-migration-cta:hover{background:#1e222a;}
.project-album-migration-dismiss{border:1px solid rgba(17,19,24,.14);background:#fff;color:#3a3f49;font:600 12px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:8px 13px;border-radius:9px;cursor:pointer;transition:background 120ms ease,color 120ms ease;}
.project-album-migration-dismiss:hover{background:rgba(17,19,24,.05);}
/* ---- Privacy modals (using <dialog> element) ---- */
.privacy-modal-dialog{border:0;padding:0;background:transparent;max-width:none;}
.privacy-modal-dialog::backdrop{background:rgba(17,19,24,.52);animation:project-password-fade 160ms ease-out;}
.privacy-modal-content{width:min(480px,calc(100vw - 32px));background:#fff;border-radius:18px;box-shadow:0 30px 80px rgba(17,19,24,.34);display:flex;flex-direction:column;overflow:hidden;animation:project-password-pop 220ms cubic-bezier(.2,.7,.2,1);}
.privacy-modal-header{display:flex;align-items:flex-start;gap:14px;padding:20px 22px 12px;}
.privacy-modal-icon{flex-shrink:0;width:38px;height:38px;display:grid;place-items:center;background:rgba(17,19,24,.06);border-radius:12px;color:#111318;}
.privacy-modal-header > div{flex:1;min-width:0;}
.privacy-modal-header b{display:block;font:700 16px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#111318;letter-spacing:-.01em;}
.privacy-modal-header small{display:block;margin-top:4px;color:#7a818c;font:500 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.privacy-modal-close{display:grid;place-items:center;width:28px;height:28px;border:0;background:rgba(17,19,24,.06);border-radius:8px;color:#5e646d;cursor:pointer;flex-shrink:0;transition:background 120ms ease,color 120ms ease;}
.privacy-modal-close:hover{background:rgba(17,19,24,.12);color:#111318;}
.privacy-modal-close:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.privacy-modal-body{padding:8px 22px 16px;display:flex;flex-direction:column;gap:12px;}
.privacy-modal-footer{display:flex;justify-content:flex-end;gap:9px;padding:14px 22px 20px;background:#fbfaf7;border-top:1px solid rgba(17,19,24,.06);}
/* ---- Passphrase setup screens ---- */
.privacy-modal-info-block{padding:11px 14px;border-radius:11px;background:#f7f5f0;border:1px solid rgba(17,19,24,.07);}
.privacy-modal-info-block--warn{background:rgba(194,69,42,.05);border-color:rgba(194,69,42,.14);}
.privacy-modal-info-heading{margin:0 0 6px;font:700 11px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#5e646d;text-transform:uppercase;letter-spacing:.09em;}
.privacy-modal-info-list{margin:0;padding-left:16px;display:flex;flex-direction:column;gap:4px;}
.privacy-modal-info-list li{font:400 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#3a3f49;}
.privacy-modal-checkbox{display:flex;align-items:flex-start;gap:10px;cursor:pointer;}
.privacy-modal-checkbox input[type="checkbox"]{flex-shrink:0;width:15px;height:15px;margin-top:2px;accent-color:#111318;}
.privacy-modal-checkbox span{font:500 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#3a3f49;}
/* ---- Strength bar ---- */
.privacy-strength-bar{display:flex;align-items:center;gap:8px;}
.privacy-strength-track{flex:1;height:4px;border-radius:99px;background:rgba(17,19,24,.08);overflow:hidden;}
.privacy-strength-fill{height:100%;border-radius:99px;transition:width 200ms ease,background 200ms ease;}
.privacy-strength-label{font:700 10.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;text-transform:uppercase;letter-spacing:.08em;width:38px;text-align:right;}
/* ---- Unlock modal extras ---- */
.privacy-lockout-notice{display:flex;align-items:center;gap:9px;padding:10px 13px;border-radius:10px;background:rgba(240,163,44,.12);border:1px solid rgba(240,163,44,.28);color:#6b4f0a;font:500 12.5px/1.4 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.privacy-lockout-notice svg{flex-shrink:0;color:#c2452a;}
.privacy-lockout-countdown{font:700 13px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.01em;}
.privacy-forgot-link{border:0;padding:0;background:transparent;color:#7a818c;font:500 12px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:left;}
.privacy-forgot-link:hover{color:#3a3f49;}
.privacy-reset-warning{display:flex;align-items:flex-start;gap:10px;padding:11px 14px;border-radius:11px;background:rgba(194,69,42,.07);border:1px solid rgba(194,69,42,.18);}
.privacy-reset-warning svg{flex-shrink:0;color:#c2452a;margin-top:1px;}
.privacy-reset-warning p{margin:0;font:500 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#6b2318;}
.privacy-reset-submit{background:#c2452a;}
.privacy-reset-submit:hover:not(:disabled){background:#9a3325;}
/* ---- Shake animation for wrong passphrase ---- */
@keyframes privacy-shake{0%,100%{transform:translateX(0);}20%{transform:translateX(-6px);}40%{transform:translateX(6px);}60%{transform:translateX(-4px);}80%{transform:translateX(4px);}}
.privacy-input-shake{animation:privacy-shake 0.3s ease-in-out;}
/* ---- Keyboard hint tooltip for locked cards ---- */
.project-album-key-hint{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);padding:5px 10px;border-radius:8px;background:rgba(17,19,24,.82);color:#fff;font:600 11px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;white-space:nowrap;pointer-events:none;z-index:10;backdrop-filter:blur(4px);}
.project-album-thumb-badge{position:absolute;top:8px;right:8px;width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:rgba(17,19,24,.78);color:#fff;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:none;box-shadow:0 4px 10px rgba(17,19,24,.18);}
.project-album-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px;}
.project-album-card{position:relative;display:flex;flex-direction:column;text-align:left;background:#fff;border:1px solid rgba(17,19,24,.08);border-radius:18px;padding:0;cursor:pointer;overflow:hidden;font:inherit;color:inherit;-webkit-appearance:none;appearance:none;transition:transform 180ms cubic-bezier(.2,.7,.2,1),box-shadow 180ms ease,border-color 180ms ease,opacity 180ms ease;}
.project-album-card:hover{transform:translateY(-2px);box-shadow:0 18px 40px rgba(17,19,24,.12);border-color:rgba(17,19,24,.16);}
.project-album-card:active{transform:translateY(0);}
.project-album-card:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-album-card.blurred{cursor:default;opacity:.78;}
.project-album-card.blurred:hover{transform:none;box-shadow:none;border-color:rgba(17,19,24,.08);}
.project-album-card.blurred .project-album-thumb-iframe-wrap,
.project-album-card.blurred .project-album-thumb-md,
.project-album-card.blurred .project-album-thumb-tile{filter:blur(16px) saturate(.85);transform:scale(1.08);transition:filter 220ms ease;}
.project-album-card.blurred .project-album-card-body small,
.project-album-card.blurred .project-album-card-meta{filter:blur(6px) saturate(.6);}
.project-album-thumb-lock{position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,255,255,.92);background:linear-gradient(180deg,rgba(17,19,24,.0),rgba(17,19,24,.25));pointer-events:none;}
.project-album-thumb-lock svg{padding:9px;background:rgba(17,19,24,.55);border-radius:50%;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);}
.project-album-card.highlighted{border-color:#c2452a;box-shadow:0 0 0 3px rgba(194,69,42,.18),0 18px 40px rgba(194,69,42,.18);}
.project-album-card.highlighted .project-album-thumb-iframe-wrap,
.project-album-card.highlighted .project-album-thumb-md,
.project-album-card.highlighted .project-album-thumb-tile{filter:none;transform:none;}
.project-album-card.highlighted .project-album-card-body b{color:#c2452a;}
.project-album-thumb{aspect-ratio:16/10;position:relative;background:#f7f5f0;border-bottom:1px solid rgba(17,19,24,.06);overflow:hidden;}
.project-album-thumb-iframe-wrap{position:absolute;inset:0;overflow:hidden;}
.project-album-thumb-iframe{position:absolute;top:0;left:0;width:333%;height:333%;border:0;background:#fff;transform:scale(.3);transform-origin:top left;pointer-events:none;}
.project-album-thumb-shield{position:absolute;inset:0;background:transparent;}
.project-album-thumb-md{position:absolute;inset:0;overflow:hidden;padding:14px 16px;color:#414751;font-size:11px;line-height:1.45;background:linear-gradient(180deg,#fff,#fbfaf7);}
.project-album-thumb-md-inner h1,.project-album-thumb-md-inner h2,.project-album-thumb-md-inner h3{margin:0 0 4px;color:#111318;letter-spacing:-.01em;}
.project-album-thumb-md-inner h1{font-size:13.5px;font-weight:700;}
.project-album-thumb-md-inner h2{font-size:12px;font-weight:650;}
.project-album-thumb-md-inner h3{font-size:11.5px;font-weight:650;}
.project-album-thumb-md-inner p{margin:0 0 6px;}
.project-album-thumb-md-inner ul,.project-album-thumb-md-inner ol{margin:0 0 6px;padding-left:14px;}
.project-album-thumb-md-inner li{margin:1px 0;}
.project-album-thumb-md-inner code{background:#f3f1ec;padding:0 3px;border-radius:3px;font:500 10px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;}
.project-album-thumb-md-inner pre{display:none;}
.project-album-thumb-md::after{content:'';position:absolute;left:0;right:0;bottom:0;height:42px;background:linear-gradient(180deg,transparent,#fbfaf7);pointer-events:none;}
.project-album-thumb-tile{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:#111318;color:#fff;}
.project-album-thumb-tile[data-kind="local"]{background:linear-gradient(135deg,#3a3022,#5b4a2d);}
.project-album-thumb-tile[data-kind="md"],.project-album-thumb-tile[data-kind="markdown"]{background:linear-gradient(135deg,#1f6f54,#235a48);}
.project-album-thumb-tile[data-kind="html"],.project-album-thumb-tile[data-kind="document"]{background:linear-gradient(135deg,#c2452a,#8e3220);}
.project-album-thumb-tile[data-kind="pdf"]{background:linear-gradient(135deg,#7a3d3d,#5a2828);}
.project-album-thumb-tile[data-kind="image"]{background:linear-gradient(135deg,#2c6ea3,#1f4f76);}
.project-album-thumb-tile[data-kind="text"],.project-album-thumb-tile[data-kind="txt"]{background:linear-gradient(135deg,#3a3f49,#222630);}
.project-album-thumb-tile span{font:800 13px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;}
.project-album-thumb-tile small{font:500 10px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;opacity:.72;}
.project-album-card-body{padding:12px 14px 13px;display:flex;flex-direction:column;gap:4px;min-width:0;}
.project-album-card-body b{display:block;color:#111318;font:650 13.5px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.project-album-card-meta{display:block;color:#7a818c;font:500 11.5px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.project-album-kind{display:inline-block;color:#c2452a;font:700 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;text-transform:uppercase;letter-spacing:.08em;}
.project-album-empty{display:grid;place-items:center;padding:60px 20px;border:1px dashed rgba(17,19,24,.14);border-radius:18px;background:#fbfaf7;text-align:center;gap:6px;}
.project-album-empty b{display:block;font-size:14px;color:#111318;}
.project-album-empty small{display:block;color:#7a818c;font-size:12.5px;}

/* ===== Slide-over preview ===== */
.project-slideover-root{position:fixed;inset:0;z-index:1200;}
.project-slideover-backdrop{position:absolute;inset:0;background:rgba(17,19,24,.32);border:0;padding:0;cursor:pointer;animation:project-slideover-fade 160ms ease-out;}
.project-slideover{position:absolute;top:0;right:0;bottom:0;width:min(620px,94vw);background:#fff;box-shadow:-30px 0 80px rgba(17,19,24,.22);display:flex;flex-direction:column;animation:project-slideover-slide 240ms cubic-bezier(.2,.7,.2,1);overflow:hidden;}
@keyframes project-slideover-fade{from{opacity:0}to{opacity:1}}
@keyframes project-slideover-slide{from{transform:translateX(20px);opacity:.6}to{transform:translateX(0);opacity:1}}
.project-slideover-head{display:flex;align-items:flex-start;gap:12px;padding:18px 20px;border-bottom:1px solid rgba(17,19,24,.08);background:#fafaf7;flex-shrink:0;}
.project-slideover-close{width:28px;height:28px;border-radius:8px;border:1px solid rgba(17,19,24,.10);background:#fff;color:#3a3f49;display:grid;place-items:center;cursor:pointer;flex-shrink:0;transition:background 120ms ease,color 120ms ease,border-color 120ms ease;}
.project-slideover-close:hover{background:#111318;color:#fff;border-color:#111318;}
.project-slideover-close:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-slideover-head-info{flex:1;min-width:0;}
.project-slideover-head-info b{display:block;color:#111318;font:700 16px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.project-slideover-head-info small{display:block;margin-top:4px;color:#7a818c;font:500 12px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-slideover-download{display:inline-flex;align-items:center;gap:6px;border:1px solid rgba(17,19,24,.12);background:#fff;color:#111318;font:650 11.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:7px 11px;border-radius:10px;cursor:pointer;flex-shrink:0;transition:background 120ms ease,color 120ms ease,border-color 120ms ease,transform 120ms ease;}
.project-slideover-download:hover{background:#111318;color:#fff;border-color:#111318;}
.project-slideover-download:active{transform:translateY(1px);}
.project-slideover-download:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-slideover-expand{width:28px;height:28px;border-radius:8px;border:1px solid rgba(17,19,24,.10);background:#fff;color:#3a3f49;display:grid;place-items:center;cursor:pointer;flex-shrink:0;transition:background 120ms ease,color 120ms ease,border-color 120ms ease,transform 120ms ease;}
.project-slideover-expand:hover{background:#111318;color:#fff;border-color:#111318;}
.project-slideover-expand:active{transform:translateY(1px);}
.project-slideover-expand:focus-visible{outline:2px solid rgba(194,69,42,.45);outline-offset:2px;}
.project-slideover-root.expanded .project-slideover{width:100vw;animation:project-slideover-expand 220ms cubic-bezier(.2,.7,.2,1);}

/* Floating artifact window for the project album — mirrors the dashboard
   .artifact-window pattern (drag, resize, double-click to expand). Portaled
   to document.body so position:fixed escapes the .admin-shell backdrop-filter
   containing block. */
.project-float-root{position:fixed;inset:0;z-index:1200;pointer-events:none;}
.project-float-root .artifact-window-wrap{pointer-events:auto;position:fixed;top:0;left:0;animation:project-float-in .26s cubic-bezier(.32,.72,0,1) both;}
.project-float-root .artifact-window-wrap[data-dragging="true"],
.project-float-root .artifact-window-wrap[data-resizing="true"]{transition:none;}
.project-float-window{border-radius:16px;background:#fff;border:1px solid rgba(17,19,24,.10);box-shadow:0 24px 64px rgba(17,19,24,.22),0 4px 14px rgba(17,19,24,.10);overflow:hidden;}
/* Grab hand on the header so users discover the drag affordance. The base
   .winbar rule (line 430 area) already sets cursor:grab + cursor:grabbing on
   :active — pin them again here at higher specificity so the float-window
   variant doesn't lose them. Dots/buttons keep pointer cursor via .winbar i,button. */
.project-float-window .winbar{cursor:grab;}
.project-float-window .winbar:active{cursor:grabbing;}
.project-float-root .artifact-window-wrap[data-dragging="true"] .winbar{cursor:grabbing;}
.project-float-root.is-expanded .artifact-window-wrap{transition:transform .28s cubic-bezier(.22,.8,.24,1),width .28s cubic-bezier(.22,.8,.24,1),height .28s cubic-bezier(.22,.8,.24,1);}
.project-float-root.is-expanded .project-float-window{border-radius:0;border:0;box-shadow:none;}
/* In fullscreen the bar still gets the grab hand so the double-click target
   reads as interactive. Drag is a no-op when expanded (handled in JS), but the
   close + zoom buttons stay visible — double-click the bar or click the green
   dot to exit. */
.project-float-root.is-expanded .project-float-window .winbar{border-radius:0;}
.project-float-body{background:#fff;}
.project-float-body iframe{width:100%;height:100%;border:0;display:block;background:#fff;}
.project-float-body .project-preview-markdown,
.project-float-body .project-preview-pre,
.project-float-body .project-preview-locked{padding:20px;height:100%;overflow:auto;}
.project-float-body .project-preview-markdown{font-size:14px;line-height:1.65;color:#222731;}
@keyframes project-float-in{from{opacity:0;transform:translate3d(var(--fx,0),var(--fy,0),0) scale(.96);}to{opacity:1;}}
@media (prefers-reduced-motion: reduce){
  .project-float-root .artifact-window-wrap{animation:none;}
  .project-float-root.is-expanded .artifact-window-wrap{transition:none;}
}

/* Slide-over header reuses the dashboard .winbar look (macOS traffic-light dots, kind badge,
   download icon button). Double-click anywhere on the bar that isn't a control toggles
   expanded → fullscreen, matching the canvas-section behavior. */
.project-slideover .winbar{height:40px;padding:0 18px;display:flex;align-items:center;gap:9px;background:rgba(246,247,248,.96);border-bottom:1px solid rgba(17,19,24,.08);flex-shrink:0;cursor:default;user-select:none;}
.project-slideover .winbar > b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:600 12.5px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:-.01em;color:#111318;margin-left:6px;}
.project-slideover .winbar-meta{font:500 11px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#7a818c;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:42%;}
.project-slideover .winbar-meta time{font-variant-numeric:tabular-nums;}
.project-slideover-root.expanded .project-slideover .winbar{cursor:zoom-out;}
/* When expanded, hide the zoom dot — double-click header or Escape collapses back. */
.project-slideover-root.expanded .project-slideover .dot-zoom{display:none;}
.project-slideover-root.expanded .project-slideover-backdrop{background:rgba(17,19,24,.55);}
@keyframes project-slideover-expand{from{transform:scale(.985);opacity:.85}to{transform:scale(1);opacity:1}}
.project-slideover-body{flex:1;overflow:auto;padding:20px;min-height:0;background:#fff;}
.project-slideover-body .project-preview-markdown{font-size:14px;line-height:1.65;color:#222731;}
.project-slideover-body .project-preview-markdown h1,
.project-slideover-body .project-preview-markdown h2,
.project-slideover-body .project-preview-markdown h3{letter-spacing:-.02em;color:#111318;margin:22px 0 10px;}
.project-slideover-body .project-preview-markdown h1{font-size:24px;font-weight:700;}
.project-slideover-body .project-preview-markdown h2{font-size:18px;font-weight:650;}
.project-slideover-body .project-preview-markdown h3{font-size:15px;font-weight:650;}
.project-slideover-body .project-preview-markdown p{margin:0 0 12px;}
.project-slideover-body .project-preview-markdown ul,
.project-slideover-body .project-preview-markdown ol{margin:0 0 12px;padding-left:24px;}
.project-slideover-body .project-preview-markdown li{margin:4px 0;}
.project-slideover-body .project-preview-markdown code{background:#f3f1ec;border:1px solid rgba(17,19,24,.07);border-radius:6px;padding:1px 5px;font:500 12.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;}
.project-slideover-body .project-preview-markdown pre{background:#111318;color:#f7f1e8;border-radius:12px;padding:14px;font:500 12.5px/1.55 'IBM Plex Mono','SF Mono',ui-monospace,monospace;overflow:auto;}
.project-slideover-body .project-preview-markdown pre code{background:transparent;border:0;padding:0;color:inherit;}
.project-slideover-body .project-preview-markdown a{color:#c2452a;text-decoration:underline;text-underline-offset:2px;}
.project-slideover-body .project-preview-markdown blockquote{margin:0 0 12px;padding:10px 14px;border-left:3px solid #c2452a;background:rgba(194,69,42,.06);color:#3a3f49;border-radius:0 8px 8px 0;}
.project-slideover-body .project-preview-pre{margin:0;white-space:pre-wrap;border-radius:12px;background:#111318;color:#f7f1e8;padding:14px;font:500 12.5px/1.55 'IBM Plex Mono','SF Mono',ui-monospace,monospace;overflow:auto;}
.project-slideover-body .project-preview-locked{display:flex;flex-direction:column;gap:10px;}
.project-slideover-body .project-preview-locked code{font:500 11.5px/1.5 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#68707b;word-break:break-all;background:#f3f1ec;border-radius:8px;padding:8px 10px;}
.project-slideover-iframe{display:block;width:100%;height:100%;border:0;background:#fff;}
.project-slideover-body:has(> .project-slideover-iframe){padding:0;}

/* ===== Project log page ===== */
.mkt-page[data-page="project-log"]{padding-top:8px;}
.mkt-page[data-page="project-log"] .project-log-status{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border:1px solid rgba(17,19,24,.07);border-radius:14px;background:#fbfaf7;margin-bottom:18px;}
.mkt-page[data-page="project-log"] .project-log-status-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;}
.mkt-page[data-page="project-log"] .project-log-status-row code{font:600 11px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#3a3f49;background:#fff;border:1px solid rgba(17,19,24,.07);border-radius:7px;padding:5px 8px;}
.mkt-page[data-page="project-log"] .project-log-status-row small{color:#7a818c;font:500 11.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;overflow:hidden;text-overflow:ellipsis;}
.mkt-page[data-page="project-log"] .project-log-status p{margin:0;color:#414751;font-size:13px;line-height:1.55;}
.mkt-page[data-page="project-log"] .project-log-md{max-width:760px;font-size:14px;line-height:1.65;color:#222731;}
.mkt-page[data-page="project-log"] .project-log-md h1,
.mkt-page[data-page="project-log"] .project-log-md h2,
.mkt-page[data-page="project-log"] .project-log-md h3{letter-spacing:-.02em;color:#111318;}
.mkt-page[data-page="project-log"] .project-log-md h2{font-size:20px;font-weight:700;margin:28px 0 12px;}
.mkt-page[data-page="project-log"] .project-log-md h3{font-size:15px;font-weight:650;margin:20px 0 8px;}
.mkt-page[data-page="project-log"] .project-log-md p{margin:0 0 12px;}
.mkt-page[data-page="project-log"] .project-log-md hr{border:0;border-top:1px solid rgba(17,19,24,.08);margin:20px 0;}
.mkt-page[data-page="project-log"] .project-log-md ul,
.mkt-page[data-page="project-log"] .project-log-md ol{margin:0 0 12px;padding-left:22px;}
.mkt-page[data-page="project-log"] .project-log-md li{margin:5px 0;}
.mkt-page[data-page="project-log"] .project-log-md code{background:#f3f1ec;border:1px solid rgba(17,19,24,.07);border-radius:6px;padding:1px 5px;font:500 12.5px/1.4 'IBM Plex Mono','SF Mono',ui-monospace,monospace;color:#3a3f49;}
.mkt-page[data-page="project-log"] .project-log-md em{color:#7a818c;font-style:normal;font-size:12.5px;}
.mkt-page[data-page="project-log"] .project-log-md strong{color:#111318;font-weight:650;}
.mkt-page[data-page="project-log"] .project-log-settings{margin-top:36px;padding:16px;border-top:1px solid rgba(17,19,24,.08);max-width:760px;}
.mkt-page[data-page="project-log"] .project-log-settings h3{font:650 13px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#7a818c;text-transform:uppercase;letter-spacing:.1em;margin:0 0 12px;}
.mkt-page[data-page="project-log"] .project-log-integration-row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border:1px solid rgba(17,19,24,.07);border-radius:12px;background:#fff;}
.mkt-page[data-page="project-log"] .project-log-integration-row b{display:block;font-size:13px;color:#111318;}
.mkt-page[data-page="project-log"] .project-log-integration-row small{display:block;color:#7a818c;font-size:11.5px;margin-top:2px;}
.mkt-page[data-page="project-log"] .project-log-integration-actions{display:flex;align-items:center;gap:10px;}

/* ===== Privacy passphrase modal ===== */
.project-password-root{position:fixed;inset:0;z-index:1400;display:grid;place-items:center;padding:24px;}
.project-password-backdrop{position:absolute;inset:0;border:0;padding:0;background:rgba(17,19,24,.52);cursor:pointer;animation:project-password-fade 160ms ease-out;}
.project-password-modal{position:relative;width:min(420px,100%);background:#fff;border-radius:18px;box-shadow:0 30px 80px rgba(17,19,24,.34);display:flex;flex-direction:column;overflow:hidden;animation:project-password-pop 220ms cubic-bezier(.2,.7,.2,1);}
@keyframes project-password-fade{from{opacity:0}to{opacity:1}}
@keyframes project-password-pop{from{transform:scale(.96) translateY(8px);opacity:0}to{transform:scale(1) translateY(0);opacity:1}}
.project-password-head{display:flex;align-items:flex-start;gap:14px;padding:20px 22px 12px;}
.project-password-head svg{flex-shrink:0;color:#111318;background:rgba(17,19,24,.06);border-radius:12px;padding:8px;width:38px;height:38px;}
.project-password-head b{display:block;font:700 16px/1.3 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#111318;letter-spacing:-.01em;}
.project-password-head small{display:block;margin-top:4px;color:#7a818c;font:500 12.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-password-body{padding:8px 22px 16px;display:flex;flex-direction:column;gap:12px;}
.project-password-field{display:flex;flex-direction:column;gap:6px;}
.project-password-field span{font:600 11.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#3a3f49;text-transform:uppercase;letter-spacing:.08em;}
.project-password-field input{padding:11px 13px;border:1px solid rgba(17,19,24,.14);border-radius:11px;background:#fafaf7;font:500 14px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#111318;letter-spacing:.02em;transition:border-color 140ms ease,background 140ms ease,box-shadow 140ms ease;}
.project-password-field input:focus{outline:0;border-color:rgba(17,19,24,.40);background:#fff;box-shadow:0 0 0 4px rgba(17,19,24,.06);}
.project-password-field input:disabled{opacity:.6;cursor:not-allowed;}
.project-password-error{margin:0;padding:9px 12px;border-radius:10px;background:rgba(194,69,42,.10);border:1px solid rgba(194,69,42,.22);color:#9a3325;font:600 12.5px/1.4 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-password-note{margin:0;color:#7a818c;font:500 11.5px/1.5 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.project-password-foot{display:flex;justify-content:flex-end;gap:9px;padding:14px 22px 20px;background:#fbfaf7;border-top:1px solid rgba(17,19,24,.06);}
.project-password-cancel{border:1px solid rgba(17,19,24,.14);background:#fff;color:#3a3f49;font:600 12.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:10px 16px;border-radius:11px;cursor:pointer;transition:background 140ms ease,color 140ms ease,border-color 140ms ease;}
.project-password-cancel:hover:not(:disabled){background:rgba(17,19,24,.05);}
.project-password-cancel:disabled{opacity:.5;cursor:not-allowed;}
.project-password-submit{border:0;background:#111318;color:#fff;font:650 12.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;padding:10px 18px;border-radius:11px;cursor:pointer;letter-spacing:.01em;transition:background 140ms ease,transform 140ms ease,opacity 140ms ease;}
.project-password-submit:hover:not(:disabled){background:#1e222a;}
.project-password-submit:active:not(:disabled){transform:translateY(1px);}
.project-password-submit:disabled{opacity:.5;cursor:not-allowed;}

@media(max-width:720px){
  .project-album-toolbar{flex-direction:column;align-items:stretch;}
  .project-album-filters{overflow-x:auto;}
  .project-album-grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;}
  .project-slideover{width:100vw;}
  .project-password-modal{width:100%;}
}


/* ── Voice Console (Jarvis) ──────────────────────────────────────────────── */
/* Mars-red brand surface. Stripped chrome: no wordmark, no mode chips, no
   header pill. One orb, one status word, one button. Mode selection lives
   in Config → Voice — most users only ever use Live realtime. */
.voice-panel{position:fixed;right:24px;bottom:24px;z-index:130;animation:voicePanelIn .26s cubic-bezier(.16,1,.3,1) both;font-family:'Geist','Inter',ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,sans-serif;pointer-events:none;}
.voice-panel > *{pointer-events:auto;}
@keyframes voicePanelIn{from{opacity:0;transform:translateY(12px) scale(.97);}to{opacity:1;transform:translateY(0) scale(1);}}
.voice-panel__inner{position:relative;width:min(280px,calc(100vw - 48px));overflow:visible;color:#fff5f0;border:1px solid rgba(255,255,255,0.16);border-radius:22px;padding:16px 18px 18px;
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(255,205,180,0.22) 0%, transparent 60%),
    linear-gradient(180deg, var(--accent-400) 0%, var(--accent-500) 45%, var(--accent-600) 100%);
  box-shadow:
    0 24px 52px rgba(120,30,15,0.38),
    0 2px 10px rgba(40,12,8,0.32),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(40,12,8,0.18);
}
.voice-panel__head-actions{position:absolute;top:12px;right:12px;display:flex;align-items:center;gap:5px;z-index:2;}
.voice-panel__icon-btn{background:rgba(255,255,255,0.92);border:1px solid rgba(255,255,255,0.0);color:var(--accent-700);width:28px;height:28px;border-radius:9px;display:grid;place-items:center;cursor:pointer;transition:background .16s ease,transform .12s ease,box-shadow .16s ease,color .16s ease;padding:0;box-shadow:0 2px 6px rgba(40,12,8,0.18);}
.voice-panel__icon-btn:hover{background:#fff;color:var(--accent-500);transform:translateY(-1px);box-shadow:0 4px 10px rgba(40,12,8,0.24);}
.voice-panel__icon-btn:active{transform:translateY(0) scale(.96);}
.voice-panel__icon-btn:focus-visible{outline:none;box-shadow:0 0 0 2px rgba(255,255,255,1),0 0 0 4px rgba(40,12,8,0.32);}
/* legacy alias — old markup used .voice-panel__close; keep it pointing at the
   same style so any cached HTML or partial reload doesn't regress. */
.voice-panel__close{background:rgba(255,255,255,0.92);border:1px solid rgba(255,255,255,0.0);color:var(--accent-700);width:28px;height:28px;border-radius:9px;display:grid;place-items:center;cursor:pointer;transition:background .16s ease,transform .12s ease,color .16s ease;padding:0;box-shadow:0 2px 6px rgba(40,12,8,0.18);}
.voice-panel__close:hover{background:#fff;color:var(--accent-500);transform:translateY(-1px);}
/* Orb wrapped as a button — Siri/ChatGPT pattern. Tap = start/stop. */
.voice-panel__orb-btn{background:transparent;border:0;padding:0;margin:14px auto 4px;display:block;cursor:pointer;border-radius:999px;-webkit-tap-highlight-color:transparent;transition:transform .18s cubic-bezier(.16,1,.3,1),filter .18s ease;}
.voice-panel__orb-btn:hover{transform:scale(1.04);filter:brightness(1.06);}
.voice-panel__orb-btn:active{transform:scale(.97);}
.voice-panel__orb-btn:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 5px rgba(40,12,8,0.35);}
.voice-panel__orb-btn:disabled,.voice-panel__orb-btn.is-busy{cursor:wait;opacity:.85;}
.voice-panel__orb-btn.is-live{animation:voiceOrbLivePulse 2.2s ease-in-out infinite;}
@keyframes voiceOrbLivePulse{0%,100%{transform:scale(1);}50%{transform:scale(1.025);}}
.voice-orb{filter:drop-shadow(0 12px 26px rgba(60,12,5,0.42));pointer-events:none;}
.voice-orb--connecting svg circle:first-of-type{animation:voiceOrbBreath 1.4s ease-in-out infinite;}
@keyframes voiceOrbBreath{0%,100%{opacity:.5;}50%{opacity:.85;}}
.voice-panel__status{text-align:center;color:rgba(255,245,240,0.92);font-size:12.5px;font-weight:500;letter-spacing:-.005em;margin:6px 0 0;line-height:1.3;}
/* Subtle mute pill — appears only during live calls, never competes with orb. */
.voice-panel__mute-btn{margin:10px auto 0;display:inline-flex;align-items:center;gap:6px;background:rgba(0,0,0,0.18);border:1px solid rgba(255,255,255,0.22);color:#fff5f0;font:600 11px/1 'Geist','Inter',ui-sans-serif,sans-serif;padding:6px 12px;border-radius:999px;cursor:pointer;transition:background .16s ease,border-color .16s ease,transform .12s ease;left:50%;position:relative;transform:translateX(-50%);}
.voice-panel__mute-btn:hover{background:rgba(0,0,0,0.28);border-color:rgba(255,255,255,0.40);}
.voice-panel__mute-btn:active{transform:translateX(-50%) scale(.96);}
.voice-panel__mute-btn.is-on{background:#fff;color:var(--accent-700);border-color:rgba(40,12,8,0.10);box-shadow:0 2px 8px rgba(40,12,8,0.22);}
/* Single discreet settings link, bottom-center. */
.voice-panel__settings-link{display:block;margin:14px auto 0;background:transparent;border:0;color:rgba(255,245,240,0.72);font:500 11px/1 'Geist','Inter',ui-sans-serif,sans-serif;cursor:pointer;padding:4px 8px;border-radius:6px;text-decoration:none;letter-spacing:.01em;transition:color .16s ease,background .16s ease;}
.voice-panel__settings-link:hover{color:#fff;background:rgba(0,0,0,0.10);}
.voice-cta{background:#fff;color:var(--accent-700);border:1px solid rgba(40,12,8,0.10);padding:11px 22px;border-radius:12px;font-size:13px;font-weight:650;letter-spacing:-.005em;cursor:pointer;transition:background .16s ease,transform .12s ease,box-shadow .16s ease,color .16s ease;box-shadow:0 6px 16px rgba(40,12,8,0.22),inset 0 1px 0 rgba(255,255,255,0.6);font-family:inherit;min-width:160px;}
.voice-cta:hover{background:#fffaf7;transform:translateY(-1px);box-shadow:0 8px 20px rgba(40,12,8,0.28),inset 0 1px 0 rgba(255,255,255,0.7);color:var(--accent-700);}
.voice-cta:active{transform:translateY(0);}
.voice-cta:disabled{opacity:0.55;cursor:not-allowed;background:rgba(255,245,240,0.18);box-shadow:none;border-color:rgba(255,255,255,0.20);color:rgba(255,245,240,0.75);transform:none;}
.voice-cta--stop{background:transparent;border-color:rgba(255,255,255,0.55);color:#fff;box-shadow:none;min-width:0;padding:11px 18px;}
.voice-cta--stop:hover{background:rgba(0,0,0,0.18);border-color:#fff;color:#fff;transform:translateY(-1px);box-shadow:none;}
.voice-cta--toggle{display:inline-flex;align-items:center;gap:6px;min-width:0;padding:11px 16px;background:rgba(0,0,0,0.16);color:#fff;border-color:rgba(255,255,255,0.32);box-shadow:none;}
.voice-cta--toggle:hover{background:rgba(0,0,0,0.26);color:#fff;border-color:rgba(255,255,255,0.50);box-shadow:none;}
.voice-cta--muted{background:#fff;color:var(--accent-700);border-color:rgba(40,12,8,0.10);box-shadow:0 4px 12px rgba(40,12,8,0.22),inset 0 1px 0 rgba(255,255,255,0.6);}
.voice-cta--muted:hover{background:#fffaf7;color:var(--accent-700);}
.voice-panel__approval{display:flex;align-items:center;gap:8px;justify-content:center;background:rgba(0,0,0,0.20);border:1px solid rgba(255,255,255,0.22);color:#fff;padding:7px 11px;border-radius:10px;font-size:11.5px;margin:10px 0 0;font-weight:500;}
.voice-panel__approval-dot{width:7px;height:7px;border-radius:50%;background:#fff;animation:voiceApprovalPulse 1.2s ease-in-out infinite;box-shadow:0 0 6px rgba(255,255,255,0.85);}
@keyframes voiceApprovalPulse{0%,100%{opacity:.55;}50%{opacity:1;}}
.voice-panel__error{background:rgba(0,0,0,0.22);border:1px solid rgba(255,255,255,0.30);color:#fff;padding:8px 11px;border-radius:10px;font-size:11.5px;margin:10px 0 0;text-align:center;font-weight:500;}
.voice-panel__transcript{list-style:none;padding:9px 11px;margin:10px 0 0;background:rgba(0,0,0,0.18);border:1px solid rgba(255,255,255,0.10);border-radius:11px;max-height:120px;overflow:auto;display:flex;flex-direction:column;gap:5px;}
.voice-line{display:flex;gap:7px;font-size:11.5px;line-height:1.45;}
.voice-line__role{flex:0 0 34px;color:rgba(255,245,240,0.60);font-size:9.5px;letter-spacing:.10em;text-transform:uppercase;padding-top:2px;font-weight:650;}
.voice-line--user .voice-line__role{color:#fff;}
.voice-line__text{color:#fff5f0;flex:1;}
.voice-panel__hint{text-align:center;color:rgba(255,245,240,0.78);font-size:11.5px;line-height:1.5;padding:8px 4px 0;font-weight:500;}
/* Activity strip: ALWAYS rendered with a reserved fixed height so the panel
   never resizes when tool calls land or finish. Single horizontal line with
   overflow-x scroll + edge-fade mask; the scrollbar is hidden because the
   pills self-document via tooltip + pulse. Empty state is an invisible
   track (opacity 0); transition is opacity, not layout. */
.voice-panel__activity{height:30px;margin:10px 0 0;padding:0;overflow:hidden;opacity:0;transition:opacity .18s ease;position:relative;
  -webkit-mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 14px),transparent 100%);
          mask-image:linear-gradient(to right,transparent 0,#000 14px,#000 calc(100% - 14px),transparent 100%);}
.voice-panel__activity.is-active{opacity:1;}
.voice-panel__activity-track{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:5px;height:100%;padding:0 12px;overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scrollbar-width:none;-ms-overflow-style:none;}
.voice-panel__activity-track::-webkit-scrollbar{display:none;width:0;height:0;}
.voice-panel__activity-pill{display:inline-flex;align-items:center;gap:5px;font-size:10.5px;line-height:1;padding:5px 8px;border-radius:999px;font-weight:600;letter-spacing:-.01em;background:rgba(0,0,0,0.22);border:1px solid rgba(255,255,255,0.18);color:rgba(255,245,240,0.92);font-family:'IBM Plex Mono','SF Mono',ui-monospace,Menlo,Consolas,monospace;text-transform:lowercase;flex:0 0 auto;white-space:nowrap;}
.voice-panel__activity-pill--running{background:rgba(255,255,255,0.18);border-color:rgba(255,255,255,0.42);color:#fff;}
.voice-panel__activity-pill--ok{background:rgba(0,0,0,0.18);border-color:rgba(255,255,255,0.14);color:rgba(255,245,240,0.70);}
.voice-panel__activity-pill--error{background:rgba(0,0,0,0.30);border-color:rgba(194,69,42,0.55);color:#ffd5cb;}
.voice-panel__activity-pill--approval{background:rgba(194,69,42,0.32);border-color:rgba(255,255,255,0.42);color:#fff;}
.voice-panel__activity-dot{width:6px;height:6px;border-radius:50%;background:#fff;animation:voiceApprovalPulse 1.0s ease-in-out infinite;box-shadow:0 0 5px rgba(255,255,255,0.85);}

/* Voice bubble — pixel-aligned with chat-restore-bubble (54px, right:24, bottom:24)
   so the two stack cleanly when both visible. When chat bubble is present the
   voice bubble slides to the LEFT of it (chat is the primary; voice is the
   secondary). Same dimensions, same baseline, same accent. */
.voice-bubble{position:fixed;right:24px;bottom:24px;width:54px;height:54px;border-radius:999px;border:1px solid rgba(168,58,34,0.55);background:var(--accent-500);color:#fff;display:grid;place-items:center;cursor:pointer;padding:0;z-index:120;box-shadow:0 16px 36px rgba(194,69,42,0.36),0 2px 8px rgba(17,19,24,0.12),inset 0 1px 0 rgba(255,255,255,0.18);transition:transform .18s cubic-bezier(.16,1,.3,1),background .16s ease,box-shadow .18s ease,border-color .16s ease,right .22s cubic-bezier(.16,1,.3,1);animation:voiceBubbleIn .32s cubic-bezier(.16,1,.3,1) both;}
.voice-bubble:hover{background:var(--accent-600);border-color:rgba(168,58,34,0.75);transform:translateY(-1px);box-shadow:0 18px 38px rgba(194,69,42,0.42),0 2px 8px rgba(17,19,24,0.14),inset 0 1px 0 rgba(255,255,255,0.22);}
.voice-bubble:active{transform:translateY(0) scale(.97);}
.voice-bubble:focus-visible{outline:none;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 5px rgba(194,69,42,.55),0 14px 28px rgba(194,69,42,0.36);}
.voice-bubble--error{background:#9a1f1f;border-color:rgba(154,31,31,0.65);}
.voice-bubble__pulse{position:absolute;inset:-3px;border-radius:999px;border:1.5px solid rgba(194,69,42,.65);pointer-events:none;animation:voiceBubblePulse 1.6s ease-out infinite;}
@keyframes voiceBubbleIn{from{opacity:0;transform:scale(.7);}to{opacity:1;transform:scale(1);}}
@keyframes voiceBubblePulse{0%{transform:scale(1);opacity:.7;}80%{transform:scale(1.55);opacity:0;}100%{transform:scale(1.55);opacity:0;}}
@media (prefers-reduced-motion:reduce){.voice-bubble,.voice-bubble__pulse,.voice-panel{animation:none;}}

/* Voice config section (Config -> Voice tab). Matches the dashboard's
   existing .config-secrets-panel aesthetic — light card, hairline borders,
   sentence-case labels, monospace values. */
.voice-config{gap:18px;}
.voice-config-sub{display:block;margin-top:4px;color:#727985;font-size:12px;line-height:1.4;font-weight:500;}
.voice-config-loading{padding:14px;color:#727985;font-size:12.5px;background:rgba(17,19,24,.03);border-radius:12px;}
.voice-config-section{display:flex;flex-direction:column;gap:8px;padding:14px;background:#fff;border:1px solid rgba(17,19,24,.07);border-radius:14px;box-shadow:0 1px 2px rgba(17,19,24,.03);}
.voice-config-section-label{font:700 10.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#5e646d;text-transform:uppercase;letter-spacing:.10em;}
.voice-config-help{margin:0;color:#727985;font-size:11.5px;line-height:1.45;font-weight:500;}
.voice-config-warn{margin:6px 0 0;padding:9px 12px;background:#fff0ed;border:1px solid rgba(194,69,42,.18);border-radius:10px;color:#9a3325;font-size:11.5px;line-height:1.45;font-weight:500;}
.voice-config-warn code{font:600 10.5px/1 ui-monospace,'IBM Plex Mono',monospace;color:#7c2b19;background:#fff;border-radius:6px;padding:2px 6px;border:1px solid rgba(194,69,42,.18);}
.voice-config-warn b{color:#111318;font-weight:700;}
.voice-config-readiness{display:flex;flex-wrap:wrap;gap:6px;}
.voice-cap-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border-radius:999px;background:rgba(17,19,24,.04);border:1px solid rgba(17,19,24,.10);color:#727985;font:600 11px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;letter-spacing:.01em;}
.voice-cap-badge.is-on{background:#e8f6ee;border-color:rgba(45,112,68,.28);color:#1a8040;}
.voice-cap-dot{width:7px;height:7px;border-radius:50%;background:#c3c7cd;flex-shrink:0;}
.voice-cap-badge.is-on .voice-cap-dot{background:#28a74a;}
.voice-cap-badge.is-pending{opacity:.55;}
.voice-cap-badge.is-pending .voice-cap-dot{background:#c3c7cd;animation:voice-cap-pulse 1.1s ease-in-out infinite;}
@keyframes voice-cap-pulse{0%,100%{opacity:.4;}50%{opacity:1;}}
.voice-config-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;}
.voice-config-grid--one{grid-template-columns:1fr;}
.voice-config-field{display:flex;flex-direction:column;gap:5px;min-width:0;}
.voice-config-field > span{font:700 10.5px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;color:#5e646d;text-transform:uppercase;letter-spacing:.08em;}
.voice-config-select,.voice-config-input{height:36px;border:1px solid rgba(17,19,24,.11);border-radius:10px;padding:0 11px;background:#fff;color:#111318;font:500 12.5px/1.2 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;min-width:0;transition:border-color .15s,box-shadow .15s;width:100%;}
.voice-config-input{font:500 12px/1.2 ui-monospace,'IBM Plex Mono',monospace;}
.voice-config-select:focus,.voice-config-input:focus{outline:0;border-color:rgba(17,19,24,.34);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.voice-config-select:disabled,.voice-config-input:disabled{opacity:.55;cursor:not-allowed;background:rgba(17,19,24,.03);}
@media(max-width:640px){.voice-config-grid{grid-template-columns:1fr;}}

/* Stacking with chat bubble.
   - Both bubbles share width 54px and bottom:24px so they sit on the same
     baseline and form one tidy row.
   - Chat keeps its existing right:24 anchor. Voice slides LEFT to right:90
     (24 base + 54 chat width + 12 gap) when chat bubble visible.
   - Voice panel (expanded) anchors to right:24 and lifts above the chat
     bubble (bottom:90) when chat is the only thing below it. */
body:has(.chat-restore-bubble) .voice-bubble{right:90px;}
body:has(.chat-restore-bubble) .voice-panel{bottom:90px;}
.voice-panel__top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px;}
.voice-panel__brand{display:flex;align-items:baseline;gap:14px;min-width:0;}
.voice-panel__wordmark{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:12.5px;letter-spacing:-.01em;color:#DCDCD8;display:inline-flex;align-items:center;gap:9px;line-height:1;}
.voice-panel__wordmark b{color:#DCDCD8;font-weight:500;}
.voice-panel__wordmark i{font-style:normal;font-size:9.5px;letter-spacing:.22em;text-transform:uppercase;color:#7c7d82;padding-left:9px;border-left:1px solid rgba(220,220,216,0.12);font-family:ui-sans-serif,system-ui,sans-serif;font-weight:700;}
.voice-panel__state{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:#888a90;}
.voice-panel__close{background:transparent;border:1px solid rgba(220,220,216,0.10);color:#888a90;width:28px;height:28px;border-radius:999px;display:grid;place-items:center;cursor:pointer;transition:color .14s, background .14s, border-color .14s;}
.voice-panel__close:hover{color:#DCDCD8;border-color:rgba(220,220,216,0.22);background:rgba(220,220,216,0.05);}
.voice-panel__stage{display:flex;align-items:center;justify-content:center;padding:8px 0 12px;position:relative;}
.voice-orb{filter:drop-shadow(0 12px 36px rgba(0,0,0,0.55));}
.voice-orb--connecting svg circle:first-of-type{animation:voiceOrbBreath 1.4s ease-in-out infinite;}
@keyframes voiceOrbBreath{0%,100%{opacity:.5;}50%{opacity:.85;}}
.voice-panel__modes{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:4px 0 14px;}
.voice-chip{background:rgba(220,220,216,0.04);border:1px solid rgba(220,220,216,0.10);color:#a8a9ad;padding:6px 12px;font-size:11.5px;letter-spacing:.04em;border-radius:999px;cursor:pointer;transition:color .14s, background .14s, border-color .14s, box-shadow .14s;}
.voice-chip:hover{color:#DCDCD8;border-color:rgba(220,220,216,0.20);}
.voice-chip--on{color:#0F0F11;background:#DCDCD8;border-color:#DCDCD8;box-shadow:0 4px 16px rgba(220,220,216,0.12);}
.voice-panel__controls{display:flex;justify-content:center;margin-bottom:10px;}
.voice-cta{background:#C2452A;color:#fff;border:1px solid rgba(255,255,255,0.10);padding:11px 22px;border-radius:14px;font-size:13px;font-weight:600;letter-spacing:-.005em;cursor:pointer;transition:background .14s, transform .12s, box-shadow .14s;box-shadow:0 10px 24px rgba(194,69,42,0.30),inset 0 1px 0 rgba(255,255,255,0.10);}
.voice-cta:hover{background:#a83a22;}
.voice-cta:disabled{opacity:0.55;cursor:not-allowed;background:#4A4A4D;box-shadow:none;}
.voice-cta--stop{background:#4A4A4D;box-shadow:none;}
.voice-cta--stop:hover{background:#5a5a5d;}
.voice-panel__tts{display:flex;gap:10px;margin:10px 0 8px;flex-wrap:wrap;justify-content:center;}
.voice-panel__tts label{display:flex;flex-direction:column;gap:4px;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#7c7d82;}
.voice-panel__tts select,.voice-panel__tts input{background:rgba(220,220,216,0.04);border:1px solid rgba(220,220,216,0.12);color:#DCDCD8;padding:7px 9px;border-radius:8px;font-size:12px;min-width:140px;}
.voice-panel__tts select:focus,.voice-panel__tts input:focus{outline:none;border-color:rgba(220,220,216,0.30);}
.voice-panel__approval{display:flex;align-items:center;gap:9px;justify-content:center;background:rgba(194,69,42,0.10);border:1px solid rgba(194,69,42,0.30);color:#f3c8be;padding:8px 12px;border-radius:11px;font-size:12px;margin:10px 0;}
.voice-panel__approval-dot{width:8px;height:8px;border-radius:50%;background:#C2452A;animation:voiceApprovalPulse 1.2s ease-in-out infinite;}
@keyframes voiceApprovalPulse{0%,100%{opacity:.55;}50%{opacity:1;}}
.voice-panel__error{background:rgba(185,28,28,0.12);border:1px solid rgba(185,28,28,0.32);color:#f5a3a3;padding:8px 12px;border-radius:11px;font-size:12px;margin:8px 0;text-align:center;}
.voice-panel__transcript{list-style:none;padding:10px 12px;margin:6px 0 0;background:rgba(220,220,216,0.03);border:1px solid rgba(220,220,216,0.08);border-radius:14px;max-height:200px;overflow:auto;display:flex;flex-direction:column;gap:6px;}
.voice-line{display:flex;gap:8px;font-size:12.5px;line-height:1.45;}
.voice-line__role{flex:0 0 44px;color:#7c7d82;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;padding-top:2px;}
.voice-line--user .voice-line__role{color:#C2452A;}
.voice-line__text{color:#DCDCD8;flex:1;}
.voice-panel__providers{display:flex;flex-wrap:wrap;gap:5px;justify-content:center;margin-top:14px;padding-top:12px;border-top:1px solid rgba(220,220,216,0.06);}
.voice-provider-chip{font-size:10px;letter-spacing:.10em;text-transform:uppercase;color:#7c7d82;background:rgba(220,220,216,0.04);border:1px solid rgba(220,220,216,0.08);padding:3px 8px;border-radius:999px;}
.voice-panel__hint{text-align:center;color:#7c7d82;font-size:11.5px;line-height:1.5;padding:8px 4px 0;}
.voice-launch{position:relative;}
.voice-launch:hover{color:#C2452A;}

/* =============================================================== */
/* Project detail — pure-white minimal theme                       */
/* Scoped via :has() so other admin pages keep the parchment look. */
/* =============================================================== */
body:has(.mkt-page[data-page="project-detail"]) .app-shell {
  background: #ffffff;
}
body:has(.mkt-page[data-page="project-detail"]) .admin-shell {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
  box-shadow: none;
  backdrop-filter: none;
}
body:has(.mkt-page[data-page="project-detail"]) .admin-header p {
  color: #59616d;
}
body:has(.mkt-page[data-page="project-detail"]) .admin-panel {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
  box-shadow: none;
}
body:has(.mkt-page[data-page="project-detail"]) .admin-stat {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
  box-shadow: none;
}
body:has(.mkt-page[data-page="project-detail"]) .admin-empty {
  background: #fbfbfb;
  border-color: rgba(17,19,24,.08);
}

/* Project album surfaces */
body:has(.mkt-page[data-page="project-detail"]) .project-album-search {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-status-card {
  background: #fbfbfb;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-status-facts div {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-info-disclosure {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-info-body {
  background: #fbfbfb;
  border-top-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-info-facts div {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
}

/* Finder browser — white panes, hairline dividers */
body:has(.mkt-page[data-page="project-detail"]) .project-finder-shell {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-finder-sidebar {
  background: #fafafa;
  border-right-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-folder-row.on,
body:has(.mkt-page[data-page="project-detail"]) .project-folder-row:hover {
  background: #ffffff;
  border-color: rgba(17,19,24,.06);
  box-shadow: none;
}
body:has(.mkt-page[data-page="project-detail"]) .project-finder-list {
  background: #ffffff;
}
body:has(.mkt-page[data-page="project-detail"]) .project-library-item:hover {
  background: #fafafa;
  border-color: rgba(17,19,24,.06);
}
body:has(.mkt-page[data-page="project-detail"]) .project-library-item.selected {
  background: #ffffff;
  border-color: rgba(194,69,42,.32);
  box-shadow: 0 1px 0 rgba(17,19,24,.04);
}
body:has(.mkt-page[data-page="project-detail"]) .project-preview-pane {
  background: #ffffff;
  border-left-color: rgba(17,19,24,.06);
}

/* Settings — Apple-style inner rail + outlet. The outer madarX sidebar
   still lives in app/layout.js; this rail is scoped to /settings only. */
.app-content > .settings-shell {
  flex: 1 1 auto;
  min-height: 0;
}
.settings-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
}
.settings-rail-wrap {
  position: relative;
  display: flex;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: 0 18px 54px rgba(37,36,34,.16);
  border-radius: 22px;
  padding: 14px 10px;
  overflow: auto;
}
.settings-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.settings-rail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px 10px;
  border-bottom: 1px solid rgba(17,19,24,.07);
  margin-bottom: 6px;
}
.settings-rail-title {
  font: 650 15px/1.2 -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  letter-spacing: -.01em;
  color: #111318;
}
.settings-rail-sub {
  font: 500 10.5px/1 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #8a8f99;
}
.settings-rail-list,
.settings-rail-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.settings-rail-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settings-rail-group-label {
  display: block;
  padding: 8px 10px 4px;
  font: 700 10px/1 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #8a8f99;
}
.settings-rail-divider {
  border: 0;
  height: 1px;
  background: rgba(17,19,24,.07);
  margin: 8px 6px 4px;
}
.settings-rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 0 2px;
  border-radius: 9px;
  color: #313740;
  text-decoration: none;
  font: 550 13px/1.2 -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  letter-spacing: -.005em;
  transition: background-color 120ms ease, color 120ms ease;
  cursor: pointer;
}
.settings-rail-item:hover {
  background: rgba(17,19,24,.05);
  color: #111318;
}
.settings-rail-item:active {
  background: rgba(17,19,24,.09);
}
.settings-rail-item[data-active="true"] {
  background: rgba(194,69,42,.10);
  color: #C2452A;
}
.settings-rail-item[data-active="true"] .settings-rail-icon {
  color: #C2452A;
}
.settings-rail-item[data-stub="true"] {
  color: #a1a6af;
  cursor: not-allowed;
}
.settings-rail-item[data-stub="true"]:hover {
  background: transparent;
  color: #a1a6af;
}
.settings-rail-icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: #68707b;
}
.settings-rail-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-rail-tag {
  flex: none;
  font: 700 9px/1 'IBM Plex Mono', 'SF Mono', ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a1a6af;
  background: rgba(17,19,24,.06);
  padding: 3px 6px;
  border-radius: 999px;
}
.settings-content {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.settings-content > .admin-shell {
  min-height: 0;
  flex: 1 1 auto;
}
html { scroll-behavior: smooth; }
.settings-content :target {
  scroll-margin-top: 18px;
}

@media (max-width: 1024px) {
  .settings-shell {
    grid-template-columns: 1fr;
  }
  .settings-rail-wrap {
    border-radius: 18px;
    padding: 10px 8px;
  }
}

/* =========================================================================
   Settings sub-pages — scoped overrides for the shared mkt-page template.
   Applies only when data-page starts with "settings-". Pairs with the
   shared rules at app/globals.css:1778+ and never leaks outside this scope.
   ========================================================================= */
.mkt-page[data-page^="settings-"]{padding-bottom:64px;}
.mkt-page[data-page^="settings-"] .mkt-stats{margin-top:0;}
.mkt-page[data-page^="settings-"] .mkt-section{margin-top:24px;}
.mkt-page[data-page^="settings-"] .mkt-section + .mkt-section{margin-top:28px;}

/* Full-width form card variant — Settings General / Appearance. */
.mkt-page[data-page^="settings-"] .mkt-card.mkt-card-form{grid-column:1/-1;display:block;min-height:0;padding:28px;}
.mkt-page[data-page^="settings-"] .mkt-card.mkt-card-form::before{content:none;}
.mkt-page[data-page^="settings-"] .mkt-card.mkt-card-form:hover{transform:none;box-shadow:none;border-color:rgba(17,19,24,.07);}
.mkt-page[data-page^="settings-"] .mkt-card.mkt-card-form .admin-form{margin:0;}

/* Tiny uppercase mono heading used to label Advanced page sub-sections. */
.mkt-page[data-page^="settings-"] .mkt-stat-hdr{margin:0 0 14px;font:650 10.5px/1.2 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.16em;text-transform:uppercase;color:#8a8f99;}

/* Link-card variant — used in Advanced page grids. Inherits mkt-card chrome
   but renders as <a> with no extra padding shift. */
.mkt-page[data-page^="settings-"] a.mkt-card{text-decoration:none;color:inherit;}
.mkt-page[data-page^="settings-"] a.mkt-card:hover{text-decoration:none;}
.mkt-page[data-page^="settings-"] .mkt-card-foot .mkt-card-arrow{color:#9aa0aa;font-size:18px;line-height:1;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;}
/* ---- Project share panel ------------------------------------------------ */
.share-panel-root{position:fixed;inset:0;z-index:1200;display:flex;justify-content:flex-end;}
.share-panel-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.18);}
.share-panel-shell{position:relative;z-index:1;width:380px;max-width:100vw;background:#fff;height:100%;display:flex;flex-direction:column;box-shadow:-4px 0 24px rgba(0,0,0,.12);overflow:hidden;}
.share-panel-header{display:flex;justify-content:space-between;align-items:flex-start;padding:1.25rem 1.25rem 1rem;border-bottom:1px solid #f0f0f0;}
.share-panel-header p{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;color:#888;margin:0 0 .25rem;}
.share-panel-header h2{font-size:.9375rem;font-weight:600;line-height:1.3;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;}
.share-panel-close{background:none;border:0;cursor:pointer;padding:.25rem;color:#555;flex-shrink:0;font:600 20px/1 -apple-system,BlinkMacSystemFont,'Inter',sans-serif;}
.share-panel-body{flex:1;overflow-y:auto;padding:1.25rem;}
.share-panel-muted{font-size:.8125rem;color:#888;margin:0;}
.share-panel-error{background:#fef2f2;border:1px solid #fecaca;border-radius:6px;padding:.625rem .75rem;margin-bottom:1rem;font-size:.8125rem;color:#dc2626;}
.share-panel-empty{font-size:.875rem;color:#666;line-height:1.5;margin:0;}
.share-panel-section{margin-bottom:1.5rem;}
.share-panel-section-title{font-size:.75rem;font-weight:600;letter-spacing:.04em;color:#555;margin:0 0 .625rem;text-transform:uppercase;}
.share-panel-scope-options{display:flex;flex-direction:column;gap:.375rem;}
.share-panel-scope-option{display:flex;align-items:center;gap:.625rem;padding:.625rem .75rem;border-radius:6px;border:1px solid #e5e7eb;background:#fff;cursor:pointer;}
.share-panel-scope-option.is-selected{border-color:#1a1a1a;background:#fafafa;}
.share-panel-scope-option input{margin:0;}
.share-panel-scope-option span span{font-size:.875rem;font-weight:500;display:block;}
.share-panel-scope-option small{font-size:.75rem;color:#888;}
.share-panel-save-button{margin-top:.75rem;padding:.5rem 1rem;background:#1a1a1a;color:#fff;border:0;border-radius:5px;cursor:pointer;font-size:.8125rem;font-family:inherit;width:100%;}
.share-panel-save-button:disabled{background:#f0f0f0;color:#aaa;cursor:default;}
.share-panel-create-row{display:flex;gap:.5rem;margin-bottom:.5rem;align-items:center;}
.share-panel-create-row select{padding:.375rem .5rem;border:1px solid #ddd;border-radius:5px;font-size:.8125rem;font-family:inherit;flex:1;}
.share-panel-primary-button{padding:.375rem .875rem;background:#1a1a1a;color:#fff;border:0;border-radius:5px;font-size:.8125rem;cursor:pointer;font-family:inherit;flex-shrink:0;}
.share-panel-secondary-button,.share-panel-copy-button{padding:.375rem .875rem;background:#f0f0f0;color:#1a1a1a;border:1px solid #ddd;border-radius:5px;font-size:.8125rem;cursor:pointer;font-family:inherit;}
.share-panel-copy-button{display:inline-flex;align-items:center;gap:.375rem;padding:.375rem .75rem;flex-shrink:0;}
.share-panel-link-stack{display:flex;flex-direction:column;gap:.75rem;}
.share-panel-link-card{border:1px solid #e5e7eb;border-radius:8px;padding:.875rem;background:#fafafa;}
.share-panel-link-row{display:flex;align-items:center;gap:.5rem;margin-bottom:.625rem;}
.share-panel-link-url{flex:1;font-size:.75rem;color:#555;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,monospace;}
.share-panel-link-meta{display:flex;gap:1rem;font-size:.75rem;color:#888;margin-bottom:.625rem;flex-wrap:wrap;}
.share-panel-link-meta span:last-child{color:#555;}
.share-panel-revoke-button{font-size:.75rem;color:#dc2626;background:none;border:0;cursor:pointer;padding:0;font-family:inherit;}
.share-panel-access-list{display:flex;flex-direction:column;gap:.25rem;}
.share-panel-access-row{display:flex;justify-content:space-between;align-items:center;padding:.5rem 0;border-bottom:1px solid #f0f0f0;font-size:.75rem;}
.share-panel-access-row div{color:#555;}
.share-panel-access-row span{display:block;font-weight:500;color:#1a1a1a;}
.share-panel-access-row small{color:#888;font-family:ui-monospace,monospace;font-size:.6875rem;}
.share-panel-access-row time{color:#888;flex-shrink:0;}

/* Project share controls — loading skeleton, cloud notice, member grants */
.share-panel-skeleton{height:2.5rem;border-radius:6px;margin-bottom:.625rem;background:linear-gradient(90deg,#f2f2f2 25%,#e9e9e9 37%,#f2f2f2 63%);background-size:400% 100%;animation:share-panel-shimmer 1.4s ease infinite;}
.share-panel-skeleton.short{width:60%;}
@keyframes share-panel-shimmer{0%{background-position:100% 0;}100%{background-position:0 0;}}
.share-panel-notice{display:flex;gap:.625rem;align-items:flex-start;padding:.875rem;border:1px solid #e5e7eb;border-radius:8px;background:#fafafa;color:#555;}
.share-panel-notice svg{flex-shrink:0;margin-top:.125rem;color:#888;}
.share-panel-notice strong{display:block;font-size:.8125rem;color:#1a1a1a;margin-bottom:.25rem;}
.share-panel-notice p{margin:0;font-size:.75rem;line-height:1.5;}
.share-panel-grant-add{display:flex;gap:.5rem;align-items:center;margin-bottom:.875rem;}
.share-panel-grant-add select{padding:.375rem .5rem;border:1px solid #ddd;border-radius:5px;font-size:.8125rem;font-family:inherit;background:#fff;min-width:0;}
.share-panel-grant-add select:first-child{flex:1;}
.share-panel-grant-add select:disabled{background:#f5f5f5;color:#aaa;}
.share-panel-grant-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;}
.share-panel-grant-row{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.625rem 0;border-bottom:1px solid #f0f0f0;}
.share-panel-grant-row:last-child{border-bottom:0;}
.share-panel-grant-who{min-width:0;}
.share-panel-grant-who span{display:block;font-size:.8125rem;font-weight:500;color:#1a1a1a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.share-panel-grant-who small{font-size:.6875rem;color:#888;font-family:ui-monospace,monospace;}
.share-panel-grant-actions{display:flex;align-items:center;gap:.625rem;flex-shrink:0;}
.share-panel-grant-actions select{padding:.25rem .375rem;border:1px solid #ddd;border-radius:5px;font-size:.75rem;font-family:inherit;background:#fff;}
.share-panel-primary-button:active:not(:disabled),.share-panel-save-button:active:not(:disabled){transform:translateY(1px);}
.share-panel-primary-button:disabled{background:#f0f0f0;color:#aaa;cursor:default;}

/* ── Workflows / Process engine pages ─────────────────────────────────────── */
.mkt-page[data-page="workflows"] .mkt-card-foot{margin-top:14px;display:flex;justify-content:flex-end;}
.mkt-page[data-page="workflows"] .mkt-card-body{margin:8px 0 0;color:#3c424b;font-size:13px;line-height:1.5;}
.mkt-page[data-page="workflows"] .mkt-card-title h3{margin:0;font-size:15px;font-weight:700;color:#111318;}
.mkt-page[data-page="workflows"] .mkt-card-title small{display:block;margin-top:2px;color:#69707a;font-size:11.5px;}
.mkt-page[data-page="workflows"] .mkt-section-head{margin-bottom:14px;}
.mkt-page[data-page="workflows"] .mkt-section-head h2{margin:0;font-size:15px;font-weight:700;letter-spacing:-.01em;color:#111318;}
.mkt-page[data-page="workflows"] .mkt-section-head p{margin:2px 0 0;color:#69707a;font-size:12.5px;}

.cases-table-wrap{border:1px solid rgba(17,19,24,.08);border-radius:14px;overflow:hidden;background:rgba(255,255,255,.78);}
.cases-table{width:100%;border-collapse:collapse;}
.cases-table thead{background:rgba(17,19,24,.04);}
.cases-table th{text-align:left;padding:10px 14px;font-size:11.5px;text-transform:uppercase;letter-spacing:.05em;color:#69707a;font-weight:700;border-bottom:1px solid rgba(17,19,24,.08);}
.cases-table td{padding:12px 14px;font-size:13px;color:#1a1d24;border-bottom:1px solid rgba(17,19,24,.04);}
.cases-table tr:last-child td{border-bottom:none;}
.cases-table .case-link{color:#111318;font-weight:600;text-decoration:none;}
.cases-table .case-link:hover{color:#c2452a;}
.cases-table .muted{color:#69707a;font-size:12px;}

/* New-case form */
.new-case-form{display:flex;flex-direction:column;gap:24px;max-width:760px;}
.new-case-form .form-section{padding:18px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.86);}
.new-case-form .form-section h2{margin:0 0 12px;font-size:14px;font-weight:700;color:#111318;}
.new-case-form .form-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:12px;}
.form-field{display:flex;flex-direction:column;gap:6px;margin-bottom:14px;}
.form-field-label{font-size:12.5px;font-weight:600;color:#3c424b;}
.form-field-label .req{color:#c2452a;}
.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="number"],
.form-field select,
.form-field textarea{padding:9px 12px;border:1px solid rgba(17,19,24,.12);border-radius:10px;background:#fff;font-size:13px;font-family:inherit;color:#111318;}
.form-field textarea{resize:vertical;min-height:96px;}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus{outline:none;border-color:#c2452a;box-shadow:0 0 0 3px rgba(194,69,42,.12);}
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea{border-color:#9a3325;}
.form-error{color:#9a3325;font-size:12px;}
.form-help{color:#69707a;font-size:11.5px;}
.shareholders-field{display:flex;flex-direction:column;gap:8px;}
.shareholder-row{display:grid;grid-template-columns:minmax(0,1fr) 96px auto auto;gap:8px;align-items:center;}
.shareholder-row input{padding:8px 10px;border:1px solid rgba(17,19,24,.12);border-radius:8px;font-size:13px;}
.shareholder-actions{display:flex;align-items:center;justify-content:space-between;}
.form-actions{display:flex;justify-content:flex-end;gap:10px;}

.btn-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 16px;border:1px solid transparent;border-radius:10px;background:#c2452a;color:#fff;font:600 13px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;text-decoration:none;transition:background .14s ease,box-shadow .14s ease,transform .1s;}
.btn-primary:hover{background:#9a3325;box-shadow:0 4px 12px rgba(194,69,42,.24);}
.btn-primary:disabled{opacity:.5;cursor:not-allowed;box-shadow:none;}
.btn-secondary{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:34px;padding:0 14px;border:1px solid rgba(17,19,24,.14);border-radius:10px;background:#fff;color:#111318;font:600 12.5px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;text-decoration:none;transition:border-color .14s,background .14s;}
.btn-secondary:hover{border-color:rgba(17,19,24,.32);background:#fafafa;}
.btn-tertiary{display:inline-flex;align-items:center;height:30px;padding:0 10px;border:0;border-radius:8px;background:rgba(17,19,24,.06);color:#3c424b;font:600 12px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;}
.btn-tertiary:hover{background:rgba(17,19,24,.12);color:#111318;}
.btn-danger{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:36px;padding:0 16px;border:1px solid rgba(154,51,37,.36);border-radius:10px;background:#fff5f3;color:#9a3325;font:600 13px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;}
.btn-danger:hover{background:#ffe9e3;}

/* Case detail page */
.case-detail{display:flex;flex-direction:column;gap:18px;}
.case-header{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:14px 18px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.86);}
.case-header-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;}
.case-header-meta .muted{color:#69707a;}
.case-header > button{margin-left:auto;}
.case-grid{display:grid;grid-template-columns:minmax(260px,300px) minmax(0,1fr);gap:18px;align-items:start;}
.case-timeline{padding:18px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.86);}
.case-timeline h3{margin:0 0 12px;font-size:13px;font-weight:700;color:#111318;text-transform:uppercase;letter-spacing:.06em;}
.case-timeline ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.stage-node button{width:100%;text-align:left;display:flex;flex-direction:column;gap:4px;padding:10px 12px;border:1px solid transparent;border-radius:10px;background:transparent;cursor:pointer;}
.stage-node button:hover{background:rgba(17,19,24,.04);}
.stage-node.active button{background:rgba(194,69,42,.06);border-color:rgba(194,69,42,.24);}
.stage-node.current button{box-shadow:inset 3px 0 0 0 #c2452a;}
.stage-node .stage-name{font-size:13px;font-weight:600;color:#111318;}
.stage-node .stage-kind{font-size:11.5px;color:#69707a;}

.case-stage-panel{padding:18px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.86);min-width:0;}
.case-stage-panel header{display:flex;align-items:center;gap:10px;margin-bottom:14px;}
.case-stage-panel header h3{margin:0;font-size:16px;font-weight:700;color:#111318;}
.case-stage-panel header .muted{color:#69707a;font-size:12px;}
.payload-card,.exec-card,.artifacts-card,.approval-card{margin-top:14px;padding:14px;border:1px solid rgba(17,19,24,.08);border-radius:12px;background:#fafbfc;}
.payload-card summary,.exec-card summary{cursor:pointer;font-weight:600;color:#111318;font-size:13px;}
.payload-card pre,.exec-card pre{margin:10px 0 0;padding:10px;background:#fff;border:1px solid rgba(17,19,24,.06);border-radius:8px;font-size:12px;overflow-x:auto;color:#1a1d24;font-family:ui-monospace,monospace;}
.exec-card header{display:flex;align-items:center;gap:10px;margin-bottom:8px;}
.exec-card header h4{margin:0;font-size:13px;font-weight:700;color:#111318;}
.artifacts-card h4{margin:0 0 8px;font-size:13px;font-weight:700;color:#111318;}
.artifacts-card ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;}
.artifacts-card li a{color:#c2452a;text-decoration:none;font-size:13px;font-weight:600;}
.artifacts-card li a:hover{text-decoration:underline;}
.approval-card{background:#fff8eb;border-color:rgba(218,143,29,.32);}
.approval-card p{margin:0 0 12px;color:#3c424b;font-size:13px;}
.approval-actions{display:flex;gap:10px;margin-bottom:8px;}
.intake-artifact-card{margin-top:14px;padding:14px;border:1px solid rgba(17,19,24,.10);border-radius:12px;background:#fff;display:flex;flex-direction:column;gap:8px;}
.intake-artifact-card header{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.intake-artifact-card header h4{margin:0;font-size:13px;font-weight:700;color:#111318;text-transform:uppercase;letter-spacing:.06em;}
.intake-artifact-card header a{color:#c2452a;text-decoration:none;font-size:12px;font-weight:600;}
.intake-artifact-card iframe{width:100%;height:340px;border:1px solid rgba(17,19,24,.08);border-radius:10px;background:#0e0d0c;}
.intake-artifact-card small{color:#69707a;font-size:11px;}
.case-artifacts-gallery{margin-top:22px;padding:18px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:rgba(255,255,255,.86);}
.case-artifacts-gallery h3{margin:0 0 6px;font-size:13px;font-weight:700;color:#111318;text-transform:uppercase;letter-spacing:.06em;}
.case-artifacts-gallery p.muted{margin:0 0 12px;font-size:12px;color:#69707a;}
.case-artifact-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px;}
.case-artifact-card{padding:12px;border:1px solid rgba(17,19,24,.08);border-radius:12px;background:#fff;display:flex;flex-direction:column;gap:8px;}
.case-artifact-card-meta a{color:#c2452a;text-decoration:none;font-size:13px;font-weight:600;}
.case-artifact-card iframe{width:100%;height:220px;border:1px solid rgba(17,19,24,.08);border-radius:10px;background:#0e0d0c;}

@media (max-width:840px){
  .case-grid{grid-template-columns:1fr;}
}

/* ─── /workflows page — aligned with Projects / Marketplace minimalism ─── */
.wf-page{--wf-accent:#c2452a;--wf-ink:#111318;--wf-muted:#68707b;--wf-line:rgba(17,19,24,.08);display:flex;flex-direction:column;gap:24px;color:var(--wf-ink);}
.wf-page .wf-stats{grid-template-columns:repeat(4,minmax(0,1fr));}

.wf-section{display:flex;flex-direction:column;gap:14px;}
.wf-section-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;}
.wf-section-head h2{margin:0 0 4px;font-size:16px;font-weight:560;letter-spacing:-.01em;color:#111318;}
.wf-section-head p{margin:0;color:var(--wf-muted);font-size:13px;line-height:1.45;}
.wf-section-link{color:#313740;text-decoration:none;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;font-weight:650;border-bottom:1px solid rgba(17,19,24,.18);padding-bottom:1px;}
.wf-section-link:hover{color:var(--wf-accent);border-bottom-color:rgba(194,69,42,.42);}

.wf-page .wf-defgrid{grid-template-columns:repeat(auto-fill,minmax(300px,1fr));}
.wf-defcard{min-height:0;overflow:visible;padding:18px;gap:12px;}
.wf-defcard::before{background:transparent !important;}
.wf-defcard-top{justify-content:space-between;}
.wf-defcard-cover{width:36px;height:36px;border-radius:10px;display:grid;place-items:center;background:#f3f1ec;border:1px solid rgba(17,19,24,.06);color:#3a3f47;flex:0 0 auto;}
.wf-defcard-initials{font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:12px;font-weight:600;letter-spacing:-.02em;color:#3a3f47;}
.wf-defcard-version{font:600 10.5px/1 'IBM Plex Mono','SF Mono',ui-monospace,monospace;letter-spacing:.02em;color:#8a8f99;background:#f7f7f5;border:1px solid rgba(17,19,24,.06);border-radius:999px;padding:5px 8px;}
.wf-defcard-body{gap:10px;}
.wf-defcard-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;}
.wf-defcard-kicker{display:block;margin-bottom:5px;font-size:10.5px;font-weight:700;letter-spacing:.10em;text-transform:uppercase;color:#9a9fa7;}
.wf-defcard-usage{font-size:11px;color:#8a8f99;background:#f7f7f5;border:1px solid rgba(17,19,24,.06);padding:4px 8px;border-radius:999px;white-space:nowrap;font-weight:600;}
.wf-page .wf-defcard-desc{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;}
.wf-defcard-error{margin:0;padding:9px 11px;background:#fff7f5;color:#7c2b19;border:1px solid rgba(194,69,42,.18);border-radius:10px;font-size:12.5px;}
.wf-defcard-share{margin:0;padding:9px 11px;background:#f7fbf6;border:1px solid rgba(45,112,68,.16);border-radius:10px;font-size:12px;display:flex;flex-direction:column;gap:4px;color:#235334;}
.wf-defcard-share a{color:#235334;text-decoration:none;word-break:break-all;font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace;font-size:11.5px;}
.wf-defcard-actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap;padding-top:12px;border-top:1px solid var(--mkt-divider);}
.wf-defcard-btn{appearance:none;border:1px solid rgba(17,19,24,.10);background:#fff;color:#313740;padding:8px 12px;border-radius:999px;font:650 12px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;transition:background .12s,color .12s,border-color .12s,transform .08s;}
.wf-defcard-btn:hover:not(:disabled){background:#f7f7f5;border-color:rgba(17,19,24,.16);color:#111318;}
.wf-defcard-btn:active{transform:scale(.98);}
.wf-defcard-btn:disabled{opacity:.55;cursor:not-allowed;}
.wf-defcard-btn--primary{background:#111318;color:#fff;border-color:#111318;}
.wf-defcard-btn--primary:hover:not(:disabled){background:#242832;border-color:#242832;color:#fff;}

.wf-caselist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.wf-casecard{background:#fff;border:1px solid var(--wf-line);border-radius:14px;transition:border-color .12s,box-shadow .12s,transform .08s;}
.wf-casecard:hover{border-color:rgba(17,19,24,.14);box-shadow:0 8px 24px rgba(17,19,24,.06);transform:translateY(-1px);}
.wf-casecard-link{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:16px;align-items:center;padding:13px 16px;text-decoration:none;color:inherit;}
.wf-casecard-body h3{margin:0 0 3px;font-size:14px;font-weight:560;letter-spacing:-.005em;color:#111318;}
.wf-casecard-body p{margin:0;display:flex;gap:6px;color:var(--wf-muted);font-size:12.5px;}
.wf-casecard-meta{text-align:right;display:flex;flex-direction:column;gap:2px;color:#8a8f99;font-size:11.5px;}
.wf-casecard-meta time{font-weight:600;color:#3a3f47;font-size:12px;}
.wf-casecard-meta small{font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:10.5px;}
.wf-casecard--awaiting_approval{border-left:2px solid #d6a92b;}
.wf-casecard--running{border-left:2px solid #1f6c9f;}
.wf-casecard--rejected,.wf-casecard--failed{border-left:2px solid var(--wf-accent);}
.wf-casecard--complete{border-left:2px solid #2d7044;}

@media (max-width:880px){
  .wf-page .wf-stats{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width:640px){
  .wf-casecard-link{grid-template-columns:auto 1fr;grid-template-rows:auto auto;}
  .wf-casecard-meta{grid-column:1/-1;flex-direction:row;justify-content:space-between;text-align:left;}
}

/* ─── JSON workflow editor (/workflows/new/definition) ─────────────── */
.wf-editor-page{display:flex;flex-direction:column;gap:18px;color:#111318;}
.wf-editor{display:grid;grid-template-columns:340px minmax(0,1fr);gap:18px;align-items:stretch;min-height:560px;}
@media (max-width:980px){.wf-editor{grid-template-columns:1fr;}}
.wf-editor-sidebar{display:flex;flex-direction:column;gap:14px;background:#fff;border:1px solid rgba(17,19,24,.08);border-radius:14px;padding:18px;}
.wf-editor-summary h3{margin:0 0 10px;font-size:11px;font-weight:700;letter-spacing:.10em;text-transform:uppercase;color:#9a9fa7;}
.wf-editor-summary dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:6px 14px;font-size:13px;}
.wf-editor-summary dt{color:#68707b;font-weight:600;}
.wf-editor-summary dd{margin:0;color:#111318;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:12.5px;word-break:break-all;}
.wf-editor-parse-err{margin:0;padding:9px 11px;background:#fff7f5;color:#7c2b19;border:1px solid rgba(194,69,42,.18);border-radius:10px;font-size:12.5px;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;}
.wf-editor-actions{display:flex;gap:8px;flex-wrap:wrap;}
.wf-editor-result{padding:11px 13px;border-radius:10px;font-size:13px;display:flex;flex-direction:column;gap:6px;}
.wf-editor-result--ok{background:#f4faf3;border:1px solid rgba(45,112,68,.20);color:#235334;}
.wf-editor-result--err{background:#fff7f5;border:1px solid rgba(194,69,42,.20);color:#7c2b19;}
.wf-editor-result strong{font-weight:650;}
.wf-editor-result ul{margin:0;padding-left:18px;font-size:12.5px;line-height:1.5;}
.wf-editor-result li{font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:12px;word-break:break-word;}
.wf-editor-result details{font-size:12px;}
.wf-editor-result details summary{cursor:pointer;color:#68707b;}
.wf-editor-hint{margin:0;padding:11px 12px;background:#fafaf8;border:1px solid rgba(17,19,24,.06);border-radius:10px;font-size:12.5px;line-height:1.55;color:#68707b;}
.wf-editor-hint code{background:#fff;border:1px solid rgba(17,19,24,.08);border-radius:4px;padding:1px 5px;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:11.5px;color:#3a3f47;}
.wf-editor-hint a{color:#3a3f47;border-bottom:1px solid rgba(17,19,24,.20);text-decoration:none;}
.wf-editor-codepane{position:relative;background:#0f0f11;border-radius:14px;overflow:hidden;border:1px solid #1a1a1c;}
.wf-editor-textarea{width:100%;height:100%;min-height:560px;display:block;border:0;outline:none;resize:none;background:#0f0f11;color:#e8e8e5;font-family:'IBM Plex Mono','SF Mono',ui-monospace,monospace;font-size:12.5px;line-height:1.55;letter-spacing:.01em;padding:18px 20px;tab-size:2;caret-color:#c2452a;}
.wf-editor-textarea::selection{background:rgba(194,69,42,.30);}

/* "New workflow" CTA on /workflows */
.wf-section-newbtn{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;background:#111318;color:#fff;border:1px solid #111318;font:650 12px/1 ui-sans-serif,system-ui,sans-serif;text-decoration:none;letter-spacing:.02em;transition:background .12s,border-color .12s;}
.wf-section-newbtn:hover{background:#242832;border-color:#242832;color:#fff;}

/* ─── Settings drawer ──────────────────────────────────────────────── */
.wf-drawer-scrim{position:fixed;inset:0;background:rgba(15,15,17,.42);backdrop-filter:blur(3px);display:flex;justify-content:flex-end;z-index:80;}
.wf-drawer{width:min(560px,100vw);height:100vh;background:#fff;display:flex;flex-direction:column;box-shadow:-30px 0 60px rgba(15,15,17,.22);animation:wfDrawerIn .22s cubic-bezier(.32,.72,0,1) both;}
@keyframes wfDrawerIn{from{transform:translateX(40px);opacity:0;}to{transform:none;opacity:1;}}
.wf-drawer-head{display:flex;align-items:flex-start;justify-content:space-between;padding:22px 24px 18px;border-bottom:1px solid rgba(15,15,17,.08);background:#0f0f11;color:#e8e8e5;}
.wf-drawer-kicker{display:block;font-size:10.5px;letter-spacing:.14em;text-transform:uppercase;color:#a8a8a4;margin-bottom:6px;}
.wf-drawer-head h3{margin:0 0 4px;font-size:20px;font-weight:600;letter-spacing:-.01em;color:#e8e8e5;}
.wf-drawer-head small{color:#a8a8a4;font-size:12px;}
.wf-drawer-close{background:transparent;border:0;font-size:26px;line-height:1;cursor:pointer;color:#a8a8a4;padding:0 4px;transition:color .12s;}
.wf-drawer-close:hover{color:var(--wf-accent,#c2452a);}
.wf-drawer-error{margin:16px 24px 0;padding:10px 12px;background:#fff2ef;border:1px solid #f0c0b6;color:#6e1410;border-radius:10px;font-size:12.5px;}
.wf-drawer-muted{color:#5f5a55;font-size:13px;margin:0;line-height:1.55;}
.wf-drawer-body{overflow-y:auto;padding:22px 24px 60px;display:flex;flex-direction:column;gap:18px;}
.wf-drawer-section{border:1px solid rgba(15,15,17,.08);border-radius:14px;padding:18px 18px 18px;background:#fff;display:flex;flex-direction:column;gap:12px;}
.wf-drawer-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:14px;}
.wf-drawer-section-head h4{margin:0;font-size:12.5px;text-transform:uppercase;letter-spacing:.12em;color:#0f0f11;font-weight:700;}
.wf-drawer-link{font-size:11.5px;text-transform:uppercase;letter-spacing:.08em;color:var(--wf-accent,#c2452a);text-decoration:none;font-weight:600;}
.wf-drawer-link:hover{text-decoration:underline;}
.wf-drawer-brand-row{background:#f7f4ee;border-color:rgba(15,15,17,.06);}
.wf-brand-chips{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px;}
.wf-brand-chip{display:flex;flex-direction:column;gap:2px;padding:8px 12px;background:#fff;border:1px solid rgba(15,15,17,.08);border-radius:10px;min-width:0;}
.wf-brand-chip>span{font-size:10px;letter-spacing:.10em;text-transform:uppercase;color:#5f5a55;}
.wf-brand-chip>strong{font-size:13px;color:#0f0f11;font-weight:600;}
.wf-brand-swatch{display:inline-block;width:12px;height:12px;border-radius:50%;border:1px solid rgba(15,15,17,.16);}
.wf-field{display:flex;flex-direction:column;gap:5px;margin:0;font-size:13px;color:#0f0f11;}
.wf-field>span{font-weight:600;font-size:12px;letter-spacing:.02em;display:flex;justify-content:space-between;align-items:baseline;}
.wf-optional{color:#7a7a78;font-weight:400;font-style:normal;font-size:11px;letter-spacing:.04em;text-transform:uppercase;}
.wf-field input,.wf-field select,.wf-drawer-section textarea{padding:9px 12px;border:1px solid rgba(15,15,17,.14);border-radius:10px;font:13px/1.4 inherit;background:#fff;color:#0f0f11;transition:border-color .12s, box-shadow .12s;}
.wf-field input:focus,.wf-field select:focus,.wf-drawer-section textarea:focus{outline:0;border-color:var(--wf-accent,#c2452a);box-shadow:0 0 0 3px rgba(194,69,42,.16);}
.wf-field input[type="color"]{padding:0;width:42px;height:34px;border-radius:8px;cursor:pointer;}
.wf-code{font-family:'IBM Plex Mono',ui-monospace,Menlo,Consolas,monospace !important;font-size:12px;line-height:1.45;width:100%;}
.wf-checkbox{display:flex;align-items:center;gap:8px;font-size:13px;margin:0;}
.wf-accent-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
.wf-accent-row input[type="text"]{width:auto;flex:1;min-width:130px;}
.wf-advanced{margin:4px 0 0;padding:10px 12px;border:1px dashed rgba(15,15,17,.18);border-radius:10px;font-size:12.5px;color:#5f5a55;background:#fafaf7;display:flex;flex-direction:column;gap:10px;}
.wf-advanced summary{cursor:pointer;font-weight:600;color:#0f0f11;font-size:12.5px;list-style:none;}
.wf-advanced summary::-webkit-details-marker{display:none;}
.wf-advanced summary::before{content:'▸ ';color:var(--wf-accent,#c2452a);}
.wf-advanced[open] summary::before{content:'▾ ';}
.wf-preview{display:flex;flex-direction:column;gap:6px;}
.wf-preview small{font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:#5f5a55;font-weight:600;}
.wf-preview iframe{width:100%;height:170px;border:1px solid rgba(15,15,17,.08);border-radius:12px;background:#f7f4ee;}
.wf-btn{appearance:none;align-self:flex-start;background:#0f0f11;color:#e8e8e5;border:1px solid #0f0f11;border-radius:999px;padding:9px 18px;font:600 12.5px/1 inherit;cursor:pointer;transition:background .12s, color .12s, border-color .12s, transform .08s;margin-top:4px;}
.wf-btn:hover:not(:disabled){background:var(--wf-accent,#c2452a);border-color:var(--wf-accent,#c2452a);color:#fff;}
.wf-btn:active{transform:scale(.97);}
.wf-btn:disabled{opacity:.55;cursor:not-allowed;}

/* Branded intake host page (when MADARX_BRANDED_INTAKE=1) */
.branded-intake-host{display:flex;flex-direction:column;gap:14px;}
.branded-intake-banner{padding:10px 14px;background:#eef7ee;border:1px solid #cfe7c8;border-radius:10px;font-size:13px;color:#1e4a17;display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;}
.branded-intake-banner a{color:#1e4a17;font-weight:600;}
.branded-intake-frame{width:100%;height:80vh;min-height:560px;border:1px solid rgba(17,19,24,.08);border-radius:14px;background:#f7f4ee;}

@media (max-width:560px){
  .workflows-card-actions{flex-direction:column;align-items:stretch;}
  .workflows-card-actions button{width:100%;}
  .wf-drawer{width:100vw;}
}

/* ── HAIL — operating-model layer ──────────────────────────────────────────
   Calm, confidential, principal-grade. Reuses the admin surface + brand tokens.
   Sensitive-data states are always visually explicit via .hail-badge tones;
   Mars (accent) is reserved for required / restricted / review-required. */
.hail-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;}
.hail-panel{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:18px 18px 20px;}
.hail-panel-title{margin:0 0 12px;font:650 14px/1.2 ui-sans-serif,system-ui,sans-serif;letter-spacing:-.01em;color:var(--ink);}
.hail-panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.hail-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.hail-list-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#fafbfc;}
.hail-list-link{display:flex;flex-direction:column;gap:2px;text-decoration:none;min-width:0;}
.hail-list-name{font:600 13px/1.3 ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.hail-list-meta{font-size:11.5px;color:var(--muted);}
.hail-form{display:flex;flex-direction:column;gap:12px;}
.hail-field{display:flex;flex-direction:column;gap:5px;font:600 12px/1.2 ui-sans-serif,system-ui,sans-serif;color:#3a4049;}
.hail-field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.hail-field input,.hail-field select,.hail-field textarea{border:1px solid rgba(20,22,26,.14);border-radius:10px;padding:9px 11px;font:400 13px/1.4 ui-sans-serif,system-ui,sans-serif;color:var(--ink);background:#fff;}
.hail-field textarea:disabled{background:#f4f5f6;color:var(--muted);}
.hail-field input:focus,.hail-field select:focus,.hail-field textarea:focus{outline:0;border-color:rgba(20,22,26,.32);}
.hail-req{color:var(--accent-600);font-weight:700;font-size:10px;letter-spacing:.04em;text-transform:uppercase;}
.hail-hint{font-size:11.5px;color:var(--muted);line-height:1.5;margin:6px 0 0;}
.hail-error{font-size:12px;color:var(--accent-700,#7c2b19);background:var(--accent-50);border:1px solid rgba(194,69,42,.3);border-radius:8px;padding:8px 10px;margin:0;}
.hail-check{display:flex;align-items:flex-start;gap:8px;font:500 12px/1.4 ui-sans-serif,system-ui,sans-serif;color:#3a4049;}
.hail-check input{margin-top:2px;}
.hail-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 13px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);font:600 12px/1 ui-sans-serif,system-ui,sans-serif;cursor:pointer;text-decoration:none;}
.hail-btn:hover{background:#f5f6f7;}
.hail-btn-primary{background:var(--accent-500);border-color:var(--accent-600);color:#fff;}
.hail-btn-primary:hover{background:var(--accent-600);}
.hail-btn-primary:disabled{opacity:.5;cursor:not-allowed;}
.hail-actions,.hail-inline-form{display:flex;gap:8px;align-items:center;}
.hail-meta{display:flex;flex-direction:column;gap:10px;margin:0;}
.hail-meta div{display:flex;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding-bottom:8px;}
.hail-meta dt{font:600 12px ui-sans-serif,system-ui,sans-serif;color:var(--muted);}
.hail-meta dd{margin:0;font:500 12px ui-sans-serif,system-ui,sans-serif;color:var(--ink);text-align:right;}
.hail-mono,.hail-inline-link{font-family:ui-monospace,monospace;font-size:11px;}
.hail-inline-link{color:var(--accent-600);}
/* lifecycle rail */
.hail-rail{display:flex;list-style:none;margin:0 0 18px;padding:0;gap:0;}
.hail-rail-step{display:flex;align-items:center;gap:8px;flex:1;color:var(--muted);font:600 12px ui-sans-serif,system-ui,sans-serif;position:relative;}
.hail-rail-step:not(:last-child)::after{content:'';flex:1;height:1px;background:var(--line);margin:0 10px;}
.hail-rail-dot{width:11px;height:11px;border-radius:50%;background:#fff;border:2px solid var(--line);flex:0 0 auto;}
.hail-rail-step.is-done .hail-rail-dot{background:var(--accent-500);border-color:var(--accent-500);}
.hail-rail-step.is-current .hail-rail-dot{border-color:var(--accent-500);box-shadow:0 0 0 3px var(--accent-50);}
.hail-rail-step.is-current{color:var(--ink);}
/* interview */
.hail-sections{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:16px;}
.hail-section-tab{border:1px solid var(--line);border-radius:999px;background:#fff;padding:7px 11px;font:500 11.5px ui-sans-serif,system-ui,sans-serif;color:#515760;cursor:pointer;}
.hail-section-tab.is-active{background:var(--ink);color:#fff;border-color:var(--ink);}
.hail-answers{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;}
.hail-answer{border:1px solid var(--line);border-radius:11px;padding:10px 12px;background:#fafbfc;}
.hail-answer.is-note{background:#fbfaf6;border-style:dashed;}
.hail-answer-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:5px;}
.hail-answer-key{font:600 12px ui-sans-serif,system-ui,sans-serif;color:var(--ink);}
.hail-answer-body{font-size:12.5px;color:#3a4049;line-height:1.5;white-space:pre-wrap;}
.hail-redacted{color:var(--muted);}
/* sensitive-state badges */
.hail-badge{display:inline-flex;align-items:center;font:700 10px/1 ui-sans-serif,system-ui,sans-serif;letter-spacing:.03em;text-transform:uppercase;padding:4px 7px;border-radius:999px;border:1px solid transparent;}
.hail-badge.tone-neutral{background:#f0f1f2;color:#5b626c;border-color:var(--line);}
.hail-badge.tone-info{background:#eef2fb;color:#3a527e;border-color:rgba(58,82,126,.18);}
.hail-badge.tone-warning{background:#fdf4e6;color:#8a6320;border-color:rgba(138,99,32,.2);}
.hail-badge.tone-danger{background:var(--accent-50);color:var(--accent-700,#7c2b19);border-color:rgba(194,69,42,.3);}
.hail-badge.tone-success{background:#eaf6ee;color:#2c6b40;border-color:rgba(44,107,64,.18);}
.hail-subhead{margin:14px 0 8px;font:600 12px ui-sans-serif,system-ui,sans-serif;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;}
.hail-diagnostic-summary .hail-meta{margin-bottom:6px;}
/* governance matrix editor */
.hail-gov-table{display:flex;flex-direction:column;gap:6px;overflow-x:auto;}
.hail-gov-row{display:grid;grid-template-columns:1.4fr .9fr .9fr .8fr .9fr .9fr 60px 60px 36px;gap:6px;align-items:center;min-width:760px;}
.hail-gov-head{font:700 10px ui-sans-serif,system-ui,sans-serif;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);}
.hail-gov-row input[type=text],.hail-gov-row input:not([type]),.hail-gov-row select{border:1px solid rgba(20,22,26,.14);border-radius:8px;padding:6px 7px;font:400 12px ui-sans-serif,system-ui,sans-serif;background:#fff;min-width:0;}
.hail-gov-row.is-warn input,.hail-gov-row.is-warn select{border-color:rgba(194,69,42,.5);}
.hail-gov-row.is-warn{background:var(--accent-50);border-radius:8px;}
/* setup review cards */
.hail-setup-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-top:12px;}
.hail-setup-card{border:1px solid var(--line);border-radius:11px;padding:12px;background:#fafbfc;}
.hail-setup-spec{margin:8px 0 0;padding:8px;background:#fff;border:1px solid var(--line);border-radius:8px;font:400 11px/1.4 ui-monospace,monospace;overflow:auto;max-height:180px;white-space:pre-wrap;word-break:break-word;}
ul.hail-error{list-style:disc;padding:8px 8px 8px 24px;margin:10px 0 0;display:flex;flex-direction:column;gap:3px;}
@media(max-width:900px){.hail-grid{grid-template-columns:1fr;}.hail-field-row{grid-template-columns:1fr;}.hail-rail{flex-wrap:wrap;gap:8px;}}

/* ── Help Center + smart-search result kinds ─────────────────────────────── */
/* Result-kind badge in the smart-search palette. Reuses palette tokens; each
   kind gets a quiet tint so users can tell navigate / set / doc apart. */
.smart-search-row-main small{display:inline-flex;align-items:center;gap:7px;}
.smart-search-kind{display:inline-flex;align-items:center;font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#9a3325;}
.smart-search-kind.kind-setting{color:#1f6c9f;}
.smart-search-kind.kind-doc{color:#2d7044;}
.smart-search-kind.kind-nav,.smart-search-kind.kind-shortcut{color:#68707b;}
.smart-search-kind.kind-action{color:#9a3325;}
.smart-search-pill{display:inline-flex;align-items:center;height:15px;padding:0 6px;border-radius:999px;background:#e8f6ee;color:#2d7044;font-size:9px;font-weight:900;letter-spacing:.06em;text-transform:uppercase;}

/* ── Inline "set a value" modal ──────────────────────────────────────────── */
.help-value-overlay{position:fixed;inset:0;z-index:12100;display:grid;place-items:start center;padding-top:13vh;background:rgba(17,19,24,.32);backdrop-filter:blur(16px) saturate(130%);animation:overlay-in .16s ease both;}
.help-value-modal{width:min(440px,calc(100vw - 28px));display:grid;gap:0;border-radius:22px;border:1px solid rgba(255,255,255,.76);background:linear-gradient(180deg,rgba(255,255,255,.97),rgba(244,241,236,.95));box-shadow:0 38px 110px rgba(17,19,24,.34),inset 0 1px 0 rgba(255,255,255,.84);color:#111318;overflow:hidden;animation:panel-in .22s cubic-bezier(.32,.72,0,1) both;}
.help-value-head{display:grid;grid-template-columns:1fr auto;align-items:start;gap:12px;padding:18px 18px 12px;}
.help-value-head small{font:900 10px/1 ui-monospace,monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--accent-600);}
.help-value-head h2{margin:9px 0 0;font-size:19px;line-height:1.15;letter-spacing:-.03em;}
.help-value-close{border:1px solid rgba(17,19,24,.12);background:rgba(255,255,255,.76);border-radius:8px;height:24px;padding:0 9px;font:800 10px/1 ui-monospace,monospace;color:#5f6671;cursor:pointer;}
.help-value-close:hover{background:#fff;color:#111318;}
.help-value-body{padding:4px 18px 6px;}
.help-value-field{display:grid;gap:7px;}
.help-value-label{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:11px;font-weight:850;letter-spacing:.06em;text-transform:uppercase;color:#68707b;}
.help-value-status{font-style:normal;text-transform:none;letter-spacing:0;font-weight:750;color:#2d7044;font-size:11px;}
.help-value-field input,.help-value-field select{width:100%;border:1px solid rgba(17,19,24,.12);border-radius:12px;background:#fff;padding:11px 12px;font:14px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.help-value-field input:focus,.help-value-field select:focus{outline:0;border-color:rgba(17,19,24,.34);box-shadow:0 0 0 3px rgba(17,19,24,.07);}
.help-value-help{margin:10px 0 0;font-size:12px;line-height:1.5;color:#68707b;}
.help-value-error{margin:10px 0 0;font-size:12.5px;line-height:1.45;color:#9a3325;font-weight:650;}
.help-value-ok{margin:10px 0 0;font-size:12.5px;color:#2d7044;font-weight:750;}
.help-value-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 16px;margin-top:8px;border-top:1px solid rgba(17,19,24,.08);background:rgba(238,239,241,.5);}
.help-value-links{display:flex;flex-direction:column;gap:3px;min-width:0;}
.help-value-links a{font-size:12px;font-weight:700;color:#1f6c9f;text-decoration:none;}
.help-value-links a:hover{text-decoration:underline;}
.help-value-actions{display:flex;gap:8px;flex-shrink:0;}
.help-value-btn{border-radius:999px;border:1px solid rgba(17,19,24,.12);padding:9px 16px;font-size:12.5px;font-weight:800;cursor:pointer;}
.help-value-btn.ghost{background:#fff;color:#313740;}
.help-value-btn.ghost:hover{background:rgba(17,19,24,.05);}
.help-value-btn.primary{background:#111318;color:#fff;border-color:#111318;}
.help-value-btn.primary:hover{background:#000;}
.help-value-btn:disabled{opacity:.55;cursor:default;}

/* ── Help Center (index) ─────────────────────────────────────────────────── */
.help-center{margin-bottom:18px;}
.help-center-search{margin-bottom:18px;}
.help-center-search input{width:100%;max-width:560px;border:1px solid rgba(17,19,24,.12);border-radius:14px;background:#fff;padding:13px 15px;font:15px/1.4 ui-sans-serif,system-ui,sans-serif;color:#111318;}
.help-center-search input:focus{outline:0;border-color:rgba(17,19,24,.30);box-shadow:0 0 0 3px rgba(17,19,24,.06);}
.help-center-group{margin-bottom:22px;}
.help-center-group-title{margin:0 0 12px;font-size:13px;font-weight:900;letter-spacing:.10em;text-transform:uppercase;color:#68707b;}
.help-center-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:11px;}
.help-center-card{display:block;border:1px solid rgba(17,19,24,.08);background:rgba(255,255,255,.82);border-radius:16px;padding:16px;text-decoration:none;color:inherit;box-shadow:0 10px 28px rgba(17,19,24,.06);transition:transform .12s,box-shadow .12s,border-color .12s;}
.help-center-card:hover{transform:translateY(-2px);border-color:rgba(17,19,24,.16);box-shadow:0 16px 40px rgba(17,19,24,.10);}
.help-center-card b{display:block;font-size:15px;font-weight:800;letter-spacing:-.02em;color:#111318;}
.help-center-card p{margin:7px 0 0;font-size:12.5px;line-height:1.5;color:#68707b;}
.help-center-empty{padding:28px;text-align:center;color:#727985;font-size:13px;}

/* ── Help article (doc viewer) ───────────────────────────────────────────── */
.help-article-layout{display:grid;grid-template-columns:minmax(190px,230px) minmax(0,1fr);gap:24px;align-items:start;}
.help-article-rail{position:sticky;top:0;display:grid;gap:16px;padding-right:6px;}
.help-article-back{font-size:12px;font-weight:800;color:#1f6c9f;text-decoration:none;}
.help-article-back:hover{text-decoration:underline;}
.help-article-rail-group{display:grid;gap:6px;}
.help-article-rail-label{font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#9aa0a8;}
.help-article-rail ul{list-style:none;margin:0;padding:0;display:grid;gap:2px;}
.help-article-rail li a{display:block;padding:5px 9px;border-radius:9px;font-size:12.5px;line-height:1.3;color:#555d68;text-decoration:none;}
.help-article-rail li a:hover{background:rgba(17,19,24,.05);color:#111318;}
.help-article-rail li a.is-active{background:#111318;color:#fff;font-weight:700;}
.help-article-actions{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:18px;}
.help-article-set{border-radius:999px;border:1px solid rgba(31,108,159,.3);background:#eef6fb;color:#1f6c9f;padding:9px 15px;font-size:12.5px;font-weight:800;cursor:pointer;transition:background .12s;}
.help-article-set:hover{background:#e0eef8;}
.help-article-prose{max-width:760px;color:#22262d;font-size:15px;line-height:1.7;}
.help-article-prose h1{font-size:30px;letter-spacing:-.035em;margin:0 0 16px;line-height:1.1;}
.help-article-prose h2{font-size:20px;letter-spacing:-.02em;margin:30px 0 10px;}
.help-article-prose h3{font-size:16px;margin:22px 0 8px;}
.help-article-prose p{margin:0 0 14px;}
.help-article-prose ul,.help-article-prose ol{margin:0 0 14px;padding-left:22px;}
.help-article-prose li{margin:4px 0;}
.help-article-prose a{color:#1f6c9f;text-decoration:none;}
.help-article-prose a:hover{text-decoration:underline;}
.help-article-prose code{font:13px ui-monospace,'IBM Plex Mono',monospace;background:rgba(17,19,24,.06);padding:2px 6px;border-radius:6px;}
.help-article-prose pre{background:#15171c;color:#eef0f3;border-radius:12px;padding:14px 16px;overflow:auto;margin:0 0 16px;}
.help-article-prose pre code{background:transparent;padding:0;color:inherit;font-size:12.5px;line-height:1.6;}
.help-article-prose blockquote{margin:0 0 16px;padding:10px 16px;border-left:3px solid var(--accent-500);background:rgba(194,69,42,.06);border-radius:0 10px 10px 0;color:#55402f;}
.help-article-prose table{width:100%;border-collapse:collapse;margin:0 0 16px;font-size:13.5px;}
.help-article-prose th,.help-article-prose td{border:1px solid rgba(17,19,24,.10);padding:8px 11px;text-align:left;vertical-align:top;}
.help-article-prose th{background:rgba(17,19,24,.04);font-weight:800;}
.help-article-related{margin-top:30px;padding-top:18px;border-top:1px solid rgba(17,19,24,.08);}
.help-article-related-label{font-size:10px;font-weight:900;letter-spacing:.12em;text-transform:uppercase;color:#9aa0a8;}
.help-article-related-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px;margin-top:10px;}
.help-article-related-card{display:block;border:1px solid rgba(17,19,24,.08);background:rgba(255,255,255,.82);border-radius:14px;padding:13px;text-decoration:none;color:inherit;transition:transform .12s,box-shadow .12s;}
.help-article-related-card:hover{transform:translateY(-1px);box-shadow:0 12px 30px rgba(17,19,24,.09);}
.help-article-related-card b{display:block;font-size:13.5px;font-weight:800;color:#111318;}
.help-article-related-card p{margin:5px 0 0;font-size:12px;line-height:1.45;color:#68707b;}
@media(max-width:820px){.help-article-layout{grid-template-columns:1fr;}.help-article-rail{position:static;}}


/* ── Chat file attachments ─────────────────────────────────────────────── */
.chat{position:relative;}
.chat--dragover{outline:2px dashed rgba(17,19,24,.28);outline-offset:-6px;}
.chat-dropzone{position:absolute;inset:0;z-index:20;display:grid;place-items:center;background:rgba(244,245,247,.86);backdrop-filter:blur(2px);border-radius:22px;pointer-events:none;}
.chat-dropzone-inner{display:flex;flex-direction:column;align-items:center;gap:10px;color:#111318;font-size:13px;font-weight:600;}
.chat-dropzone-inner svg{color:#111318;opacity:.8;}
.composer .attach-btn{align-self:stretch;width:42px;padding:0;display:grid;place-items:center;border-radius:14px;flex-shrink:0;background:#fff !important;color:#515760;border:1px solid rgba(20,22,26,.10);font-weight:400;cursor:pointer;transition:background .15s,color .15s;}
.composer .attach-btn:hover:not(:disabled){background:rgba(17,19,24,.06) !important;color:#111318;}
.composer .attach-btn:disabled{opacity:.45;cursor:not-allowed;}
.composer-field{flex:1;min-width:0;display:flex;flex-direction:column;gap:7px;}
.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;}
.attach-chip{display:inline-flex;align-items:center;gap:6px;max-width:200px;padding:4px 7px 4px 5px;border-radius:9px;background:#fff;border:1px solid rgba(20,22,26,.12);font-size:11.5px;color:#3a4049;}
.attach-chip-thumb{width:18px;height:18px;border-radius:4px;object-fit:cover;flex-shrink:0;}
.attach-chip-icon{color:#7b828c;flex-shrink:0;}
.attach-chip-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.attach-chip-x{display:grid;place-items:center;width:16px;height:16px;padding:0;border:0;border-radius:5px;background:transparent !important;color:#9098a2 !important;cursor:pointer;flex-shrink:0;font-weight:400;}
.attach-chip-x:hover{background:rgba(17,19,24,.08) !important;color:#111318 !important;}
.attach-uploading{font-size:11.5px;color:#7b828c;align-self:center;}
.attach-error{font-size:11.5px;color:var(--accent-600,#c2452a);align-self:center;}
/* Composer action cluster — attach + send sit together, small and round. */
.composer-actions{position:absolute;right:16px;bottom:14px;z-index:2;display:flex;flex-direction:column;align-items:center;gap:6px;}
.composer-actions .attach-btn,.composer-actions .send-btn{width:38px;height:38px;min-height:0;align-self:auto;padding:0;border-radius:999px;display:grid;place-items:center;flex-shrink:0;}
.config-btn.on{background:rgba(17,19,24,.08);color:#111318;}

/* Three separate dashboard surfaces: the chat (read) card and the input (write)
   card are distinct elements split by a draggable grip; the canvas (Spaces) is
   the third. Drag the grip — or ↑/↓ when focused — to resize the input;
   double-click to reset. The textarea fills the input card height. */
.chat-column{display:flex;flex-direction:column;gap:9px;min-width:0;min-height:0;height:100%;position:relative;}
.chat-column > .chat{flex:1;min-height:0;}
.composer-panel{flex:0 0 auto;display:flex;flex-direction:column;min-height:0;border:0;background:transparent;border-radius:22px;overflow:visible;}
.composer-resizer{flex-shrink:0;height:12px;margin:-3px 0;display:grid;place-items:center;cursor:ns-resize;background:transparent;border:0;touch-action:none;}
.composer-resizer:focus-visible{outline:none;}
.composer-resizer-grip{width:44px;height:5px;border-radius:999px;background:rgba(17,19,24,.15);transition:background .15s,width .15s;}
.composer-resizer:hover .composer-resizer-grip,.composer-resizer:focus-visible .composer-resizer-grip,.chat-column--resizing .composer-resizer-grip{background:rgba(17,19,24,.36);width:60px;}
.composer{position:relative;flex:1;min-height:0;padding:0;border-top:0;display:flex;flex-direction:column;align-items:stretch;background:transparent;}
.composer-field{align-self:stretch;width:100%;flex:1;}
.composer textarea{flex:1;width:100%;height:100%;min-height:0;max-height:none;resize:none;padding-right:62px;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:14px;line-height:1.55;letter-spacing:-.006em;color:#33383f;border-radius:16px;font-kerning:normal;}
.composer textarea::placeholder{color:#9aa1ab;letter-spacing:0;}
/* Soften chat message text (agent/light bubbles); user bubbles keep white. */
.feed .msg.agent{color:#33383f;}
.chat-column--resizing{user-select:none;}

/* Remove the flat backgrounds behind the input and the Spaces page so both sit
   directly on the app backdrop. The chat (read) card keeps its white surface. */
.visual-frame.fresh-frame{background:transparent;}
.visual-frame.fresh-frame .canvas{background:transparent;border:0;}
.fresh-canvas{background:transparent;}

/* Minimize hides the whole chat+input column; canvas (Spaces) fills the width. */
.visual-frame.fresh-frame.frame-chat-hidden .chat-column{display:none;}

/* Drag-and-drop highlight lives on the column so dropping over either card works. */
.chat-column--dragover{outline:2px dashed rgba(17,19,24,.28);outline-offset:-4px;border-radius:22px;}

/* Full-screen — both cards cover the viewport, centered, for focused writing. */
.chat-column--fullscreen{position:fixed;inset:0;z-index:200;padding:16px;gap:12px;background:rgba(20,22,26,.34);backdrop-filter:blur(3px);}
.chat-column--fullscreen > .chat,.chat-column--fullscreen > .composer-resizer,.chat-column--fullscreen > .composer-panel{width:100%;max-width:1000px;margin-left:auto;margin-right:auto;}

/* Flat + clean — no drop shadows on the dashboard surfaces. */
.toolbar{box-shadow:none;}
.window{box-shadow:none;}
.msg-attachments{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
.msg-attach-chip{display:inline-flex;align-items:center;gap:5px;max-width:200px;padding:3px 8px;border-radius:8px;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.msg.user .msg-attach-chip{background:rgba(255,255,255,.12);color:#fff;}
.msg.agent .msg-attach-chip{background:rgba(17,19,24,.06);color:#3a4049;}

/* Team settings (/settings/team) */
.admin-pill.mars{background:#ffe3df;color:#9a3325;}
.team-invite-code{display:block;word-break:break-all;padding:10px 12px;background:#f4f6f9;border:1px solid #e2e7ee;border-radius:8px;font-family:var(--font-mono-brand,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;line-height:1.5;color:#2b3038;}
.team-invite-list{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:8px;}
.team-invite-list>li{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:13px;color:#3b4048;}
