/* =============================================================================
 * MCPWing Desktop — app shell CSS (on top of tokens.css)
 * =========================================================================== */

html, body, #root { height: 100%; }
body { overflow: hidden; }

/* The "window" — emulates an Electron BrowserWindow inside the viewport. */
.os-window {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

/* When framed (desktop bezel), the window is a centered, sensibly-sized app
   window — not an edge-to-edge ultra-wide panel. */
.os-window.framed {
  inset: auto;
  width: min(1340px, calc(100vw - 72px));
  height: min(852px, calc(100vh - 60px));
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.55);
  border: 1px solid var(--line);
  animation: win-rise 520ms cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes win-rise {
  from { transform: translate(-50%, -49.2%) scale(0.99); }
  to   { transform: translate(-50%, -50%) scale(1); }
}
.os-backdrop {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(56,189,248,0.10), transparent 60%),
    #05070B;
}

/* ---- App title bar (the macOS / windows chrome) ---- */
.titlebar {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 100;
  -webkit-app-region: drag;
  user-select: none;
}
.titlebar .nodrag { -webkit-app-region: no-drag; }

/* traffic lights (mac) */
.traffic { display: flex; gap: 8px; align-items: center; }
.traffic .light { width: 12px; height: 12px; border-radius: 50%; position: relative; cursor: default; transition: filter .15s; }
.traffic .light.close { background: #FF5F57; }
.traffic .light.min { background: #FEBC2E; }
.traffic .light.max { background: #28C840; }
.traffic:hover .light { filter: brightness(1.08); }

/* windows controls */
.wincontrols { display: flex; height: 100%; margin-left: auto; }
.wincontrols button {
  width: 46px; height: 100%; border: 0; background: transparent; color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center; cursor: default;
  transition: background .12s, color .12s;
}
.wincontrols button:hover { background: var(--surface-2); color: var(--ink); }
.wincontrols button.close:hover { background: #E81123; color: #fff; }

/* ---- Body layout ---- */
.app-body { flex: 1 1 auto; display: flex; min-height: 0; position: relative; }
.sidebar {
  width: 220px; flex: 0 0 220px; background: var(--bg-elevated);
  border-right: 1px solid var(--line); padding: 14px 12px;
  display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto;
}
.content-area { flex: 1 1 auto; min-width: 0; overflow-y: auto; position: relative; }
.content-pad { padding: 32px clamp(24px, 4vw, 56px) 80px; }

/* ---- nav links ---- */
.navlink {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  color: var(--ink-muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: background .14s, color .14s; border: 1px solid transparent;
}
.navlink:hover { background: var(--surface); color: var(--ink); }
.navlink.active { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.nav-section-label {
  font-family: var(--font-mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-quiet); padding: 6px 12px 8px;
}

/* ---- inputs ---- */
.inp {
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 12px; border-radius: 10px; width: 100%; font-family: var(--font-sans);
  font-size: 14px; outline: none; transition: border-color .14s, box-shadow .14s, background .14s;
}
.inp:focus { border-color: var(--brand-tint-40); box-shadow: 0 0 0 3px var(--brand-tint-12); }
.inp::placeholder { color: var(--ink-quiet); }
textarea.inp { resize: vertical; line-height: 1.5; }
.inp:disabled { opacity: .6; cursor: not-allowed; }

/* ---- scroll niceties ---- */
.content-area::-webkit-scrollbar { width: 10px; }

/* ---- reveal / page transition ----
   NOTE: these animate transform ONLY (never opacity) so that if the animation
   timeline is frozen/throttled (e.g. an unfocused webview), content is still
   fully visible at rest instead of being stuck at opacity:0. */
@keyframes page-in { from { transform: translateY(10px); } to { transform: translateY(0); } }
.page-in { animation: page-in 360ms cubic-bezier(0.22,1,0.36,1) both; }

@keyframes fade-in { from { transform: translateY(4px); } to { transform: translateY(0); } }
.fade-in { animation: fade-in 240ms ease both; }

@keyframes scale-in { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }

@keyframes blink { 50% { opacity: 0; } }
.caret { display: inline-block; width: 8px; height: 15px; background: var(--brand-400); vertical-align: text-bottom; margin-left: 2px; animation: blink 1s steps(2,end) infinite; border-radius: 1px; }

/* mode switch sweep overlay */
@keyframes mode-sweep {
  0% { transform: translateX(-100%); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}
.mode-sweep {
  position: absolute; inset: 0; z-index: 500; pointer-events: none;
  background: linear-gradient(105deg, transparent, var(--brand-tint-20) 35%, rgba(56,189,248,0.35) 50%, var(--brand-tint-20) 65%, transparent);
  animation: mode-sweep 620ms cubic-bezier(0.65,0,0.35,1) both;
}

/* generic helpers */
.row { display: flex; align-items: center; }
.muted { color: var(--ink-muted); }
.quiet { color: var(--ink-quiet); }
.mono { font-family: var(--font-mono); }
.serif-i { font-family: var(--font-serif); font-style: italic; color: var(--brand-400); font-weight: 400; }
.link-brand { color: var(--brand-400); text-decoration: none; cursor: pointer; }
.link-brand:hover { text-decoration: underline; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand-400); animation: spin .8s linear infinite; }
.spin-soft { animation: spin .9s linear infinite; }

/* drag-card tilt */
.dragging { opacity: .35; }
.drag-over { background: var(--brand-tint-08) !important; border-color: var(--brand-tint-40) !important; }

/* kbd */
kbd { font-family: var(--font-mono); font-size: 11px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink-muted); }

/* chat typing dots */
.td { width: 6px; height: 6px; border-radius: 999px; background: var(--ink-quiet); display: inline-block; animation: td-bounce 1.2s infinite; }
.td:nth-child(2) { animation-delay: .15s; }
.td:nth-child(3) { animation-delay: .3s; }
@keyframes td-bounce { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* ---- assistant message markdown ---- */
.msg-md { font-size: 14.5px; line-height: 1.72; color: var(--ink); }
.msg-md > *:first-child { margin-top: 0; }
.msg-md > *:last-child { margin-bottom: 0; }
.msg-md p { margin: 0 0 12px; }
.msg-md .md-lead { color: var(--ink-muted); font-weight: 500; margin: 16px 0 8px; font-size: 13px; letter-spacing: 0.01em; }
.msg-md ul { margin: 4px 0 12px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.msg-md li { position: relative; padding-left: 20px; }
.msg-md li::before { content: ""; position: absolute; left: 5px; top: 9px; width: 5px; height: 5px; border-radius: 999px; background: var(--brand-400); }
.msg-md code { font-family: var(--font-mono); font-size: 0.86em; background: var(--brand-tint-08); color: var(--brand-300); border: 1px solid var(--brand-tint-12); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }
.msg-md strong { font-weight: 600; color: var(--ink); }

/* chat dev dock slide-in */
@keyframes dock-in { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* agentic welcome hero */
.hero-rise { animation: hero-rise .5s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes hero-rise { from { transform: translateY(14px); } to { transform: translateY(0); } }
.hero-orb { position: relative; width: 86px; height: 86px; display: grid; place-items: center; }
.hero-orb::before { content: ""; position: absolute; width: 62px; height: 62px; border-radius: 999px; background: radial-gradient(circle, rgba(56,189,248,0.28), transparent 70%); }
.hero-orb .hpulse { position: absolute; width: 56px; height: 56px; border-radius: 999px; border: 1px solid var(--brand-tint-40); animation: hero-pulse 2.6s ease-out infinite; }
.hero-orb .hpulse:nth-child(2) { animation-delay: 1.3s; }
@keyframes hero-pulse { 0% { transform: scale(.6); opacity: .8; } 80% { opacity: .06; } 100% { transform: scale(1.85); opacity: 0; } }
.cap-card { transition: transform .16s, border-color .16s, background .16s; }
.cap-card:hover:not(:disabled) { transform: translateY(-3px); border-color: var(--brand-tint-40) !important; background: var(--brand-tint-04) !important; }

/* composer */
.composer { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: border-color .18s, box-shadow .18s; }
.composer:focus-within { border-color: var(--brand-tint-40); box-shadow: 0 0 0 4px var(--brand-tint-08); }
.composer textarea { width: 100%; resize: none; background: transparent; border: none; outline: none; color: var(--ink); font-family: var(--font-sans); font-size: 14.5px; line-height: 1.55; padding: 14px 16px 4px; min-height: 30px; max-height: 168px; }
.composer textarea::placeholder { color: var(--ink-quiet); }
.composer-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px 9px; }
.cbtn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12.5px; font-family: var(--font-sans); white-space: nowrap; transition: background .14s, color .14s, border-color .14s; }
.cbtn:hover { background: var(--surface-2); color: var(--ink); }
.cbtn.icon { padding: 0; width: 30px; justify-content: center; }
.cbtn.on { background: var(--brand-tint-12); color: var(--brand-400); }

/* login form-panel ambient (subtle, behind the form) */
.auth-grid { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 75%); }
.auth-aurora { position: absolute; border-radius: 50%; pointer-events: none; filter: blur(70px); opacity: .22; will-change: transform; }
.auth-aurora.a1 { width: 360px; height: 360px; top: -80px; right: -60px; background: radial-gradient(circle, var(--brand-500), transparent 68%); animation: aurora-1 16s ease-in-out infinite; }
.auth-aurora.a2 { width: 320px; height: 320px; bottom: -90px; left: -40px; background: radial-gradient(circle, var(--role-lead), transparent 68%); animation: aurora-2 20s ease-in-out infinite; }
@keyframes aurora-1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-40px,46px) scale(1.12); } }
@keyframes aurora-2 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(38px,-40px) scale(1.1); } }

/* stat card grid */
.stat-grid { display: grid; gap: 12px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.stat-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-quiet); }
.stat-value { font-size: 28px; font-weight: 600; color: var(--ink); margin-top: 4px; line-height: 1; }

/* def list */
.deflist { display: grid; grid-template-columns: 180px 1fr; gap: 0; }
.deflist dt { color: var(--ink-quiet); font-size: 13px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.deflist dd { color: var(--ink); font-size: 13.5px; padding: 9px 0; margin: 0; border-bottom: 1px solid var(--line-soft); }

/* tiny label */
.tiny-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-quiet); display: block; margin-bottom: 6px; }

/* ---- segmented OTP input ---- */
.otp-row { display: flex; gap: 10px; justify-content: center; }
.otp-cell {
  width: 50px; height: 60px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--ink);
  transition: border-color .16s, box-shadow .16s, background .16s, transform .16s;
}
.otp-cell.filled { border-color: var(--brand-tint-40); background: var(--surface-2); }
.otp-cell.active { border-color: var(--brand-400); box-shadow: 0 0 0 3px var(--brand-tint-12); background: var(--surface-2); transform: translateY(-1px); }
.otp-caret { width: 2px; height: 28px; background: var(--brand-400); border-radius: 1px; animation: blink 1s steps(2,end) infinite; }

/* ---- auth phase transition (transform-only so content never hides) ---- */
@keyframes auth-in { from { transform: translateX(26px); } to { transform: translateX(0); } }
.auth-in { animation: auth-in 420ms cubic-bezier(0.22,1,0.36,1) both; }

/* ---- boot / launch splash (lightweight) ---- */
.boot { position: fixed; inset: 0; z-index: 11000; background: #05070B; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; }
.boot.out { animation: boot-out 550ms cubic-bezier(0.65,0,0.35,1) forwards; }
@keyframes boot-out { to { opacity: 0; visibility: hidden; } }
.boot-pop { animation: boot-pop 700ms cubic-bezier(0.22,1,0.36,1) both; }
@keyframes boot-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }

/* faint horizon line for depth */
.boot-horizon { position: absolute; left: 0; right: 0; bottom: 38%; height: 1px; background: linear-gradient(90deg, transparent, var(--brand-tint-20) 30%, var(--brand-tint-40) 50%, var(--brand-tint-20) 70%, transparent); opacity: 0; animation: boot-horizon 1.2s ease .4s forwards; }
@keyframes boot-horizon { to { opacity: .7; } }

/* bird unfurls its wings, holds, then resolves (centered) into the lockup */
.boot-morph { position: relative; display: grid; place-items: center; width: 300px; height: 120px; }
.bird { position: absolute; display: flex; align-items: center; justify-content: center; gap: 14px; animation: bird-seq 3.0s cubic-bezier(0.4,0,0.2,1) both; will-change: transform, opacity; }
@keyframes bird-seq {
  0%   { transform: translateY(-22px) scale(.22); opacity: 0; }
  14%  { opacity: 1; }
  46%  { transform: translateY(0) scale(1); opacity: 1; }   /* arrived, wings open — hold */
  70%  { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(0) scale(.5); opacity: 0; }  /* calm shrink at center → cross-fade */
}
.wing { display: inline-flex; }
.wing .wi { display: inline-flex; }
.wing-l .wi { transform: scaleX(-1); }
.wing-l { transform-origin: 100% 78%; animation: unfurl-l 1.5s cubic-bezier(0.22,1,0.36,1) both; }
.wing-r { transform-origin: 0% 78%; animation: unfurl-r 1.5s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes unfurl-l {
  0% { transform: rotate(-52deg); opacity: .35; }
  55% { opacity: 1; }
  68% { transform: rotate(8deg); }
  100% { transform: rotate(0); }
}
@keyframes unfurl-r {
  0% { transform: rotate(52deg); opacity: .35; }
  55% { opacity: 1; }
  68% { transform: rotate(-8deg); }
  100% { transform: rotate(0); }
}
.lockup { position: absolute; opacity: 0; animation: lockup-in 1.0s cubic-bezier(0.22,1,0.36,1) 2.1s both; }
@keyframes lockup-in {
  0% { opacity: 0; transform: scale(.92); }
  55% { opacity: 1; }
  100% { opacity: 1; transform: scale(1); }
}

/* ---- sidebar contextual tree ---- */
.subnav { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 8px 14px; padding-left: 10px; border-left: 1px solid var(--line); overflow: hidden; }
.subnav-item { padding: 6px 10px; border-radius: 7px; font-size: 12.5px; color: var(--ink-muted); cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background .12s, color .12s; }
.subnav-item:hover { background: var(--surface); color: var(--ink); }
.subnav-item.active { background: var(--surface-2); color: var(--ink); }
.subnav-item .dotmark { width: 5px; height: 5px; border-radius: 999px; background: currentColor; flex: 0 0 auto; opacity: .5; }
@keyframes subnav-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.subnav { animation: subnav-open .2s ease both; }
.no-sb::-webkit-scrollbar { height: 0; width: 0; display: none; }
.no-sb { scrollbar-width: none; }

/* ---- demo/embed mode: full-bleed the app window inside the marketing iframe ---- */
html[data-demo] .os-backdrop { background: var(--bg); }
html[data-demo] .os-window.framed {
  inset: 0; width: 100%; height: 100%; left: 0; top: 0; transform: none;
  border-radius: 0; border: none; box-shadow: none; animation: none;
}

/* ---- project-picker modal (mandatory on new agentic chat) ---- */
.picker-backdrop {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8, 12, 20, 0.62);
  backdrop-filter: blur(6px);
  animation: picker-fade 180ms ease both;
}
@keyframes picker-fade { from { opacity: 0; } to { opacity: 1; } }
.picker-shell {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  display: flex; flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}
.picker-head { padding: 22px 24px 14px; border-bottom: 1px solid var(--line-soft); }
.picker-title { font-size: 18px; font-weight: 600; color: var(--ink); margin: 0 0 4px; letter-spacing: -0.01em; }
.picker-sub { font-size: 13px; color: var(--ink-muted); margin: 0; line-height: 1.5; }
.picker-section { padding: 14px 16px 6px; }
.picker-section-label {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-quiet); margin: 0 4px 8px;
}
.picker-section-dot { width: 6px; height: 6px; border-radius: 999px; }
.picker-section-dot-app { background: var(--brand-400); }
.picker-section-dot-mcp { background: #A78BFA; }
.picker-list { display: flex; flex-direction: column; gap: 4px; }
.picker-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  text-align: left; cursor: pointer; color: var(--ink);
  transition: background .14s, border-color .14s;
}
.picker-row:hover { background: var(--surface-2); border-color: var(--brand-tint-20); }
.picker-row-glyph { width: 28px; height: 28px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: 14px; flex: 0 0 auto; }
.picker-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.picker-row-name { font-size: 13.5px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-row-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-quiet); letter-spacing: 0.03em; }
.picker-row-pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; flex: 0 0 auto;
}
.picker-row-pill-app { background: var(--brand-tint-08); color: var(--brand-400); border: 1px solid var(--brand-tint-20); }
.picker-row-pill-mcp { background: rgba(167,139,250,0.10); color: #A78BFA; border: 1px solid rgba(167,139,250,0.28); }
.picker-foot { padding: 12px 18px 16px; display: flex; justify-content: flex-end; }
.picker-cancel {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 12.5px;
}
.picker-cancel:hover { color: var(--ink); }

/* ---- tool-call card (mirrors desktop ToolCallCard) ---- */
.tool-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden;
  font-family: var(--font-mono); font-size: 12px;
}
.tool-card-head {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 7px 10px;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-muted); font-family: inherit; font-size: inherit;
  text-align: left;
}
.tool-card-head:hover { background: var(--surface); }
.tool-card-name { display: inline-flex; align-items: baseline; gap: 0; color: var(--ink); white-space: nowrap; }
.tool-card-summary { color: var(--ink-quiet); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.tool-card-status { width: 14px; height: 14px; display: inline-grid; place-items: center; flex: 0 0 14px; }
.tool-card-status-ok { color: var(--ok); }
.tool-card-status-pending { color: var(--brand-400); }
.tool-card-body { padding: 8px 12px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.tool-card-args { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-card-arg { display: inline-flex; align-items: baseline; gap: 5px; padding: 2px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.tool-card-arg-k { color: var(--ink-quiet); }
.tool-card-arg-v { color: var(--brand-300); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-card-pending { color: var(--ink-quiet); font-style: italic; }
.tool-card-pre { margin: 0; white-space: pre-wrap; color: var(--ink-muted); }

/* ---- mcp_ui frame (always-visible rendered preview) ---- */
.mcp-ui-frame {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--surface-2); margin-top: 8px;
}
.mcp-ui-head {
  display: flex; align-items: center;
  padding: 6px 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.mcp-ui-fs-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 5px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-muted); font-family: inherit; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}
.mcp-ui-fs-btn:hover { color: var(--ink); border-color: var(--brand-tint-40); }
.mcp-ui-overlay {
  position: absolute; inset: 0; z-index: 70;
  display: flex; padding: 20px;
  background: rgba(8, 12, 20, 0.78); backdrop-filter: blur(6px);
}
.mcp-ui-overlay-shell {
  flex: 1; display: flex; flex-direction: column;
  background: white; border-radius: 10px; overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.45);
}
.mcp-ui-overlay-head {
  display: flex; align-items: center;
  padding: 10px 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
}
.mcp-ui-fs-close {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink); font-family: inherit; font-size: 11px;
  letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
}

/* ---- + Link pill button (design rows, ticket cards) ---- */
.link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--brand-tint-20);
  background: var(--brand-tint-08);
  color: var(--brand-400);
  font-family: var(--font-sans);
  font-size: 11.5px; font-weight: 500;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.link-btn:hover { background: var(--brand-tint-12); border-color: var(--brand-tint-40); }
.link-btn:disabled { background: transparent; color: var(--ink-muted); border-color: var(--line); cursor: default; }

/* ---- Projects tab (rich UI matching the real desktop app) ---- */
.proj-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.proj-card-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink); text-align: left;
  transition: background 140ms ease;
}
.proj-card-head:hover { background: var(--surface-2); }
.proj-card-glyph {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 8px; background: var(--brand-tint-08);
  border: 1px solid var(--brand-tint-20);
  display: grid; place-items: center;
}
.proj-card-type {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; padding: 3px 9px;
  border-radius: 999px; flex: 0 0 auto;
}
.proj-card-type-app {
  background: var(--brand-tint-08); color: var(--brand-400);
  border: 1px solid var(--brand-tint-20);
}
.proj-card-type-mcp {
  background: rgba(167,139,250,0.10); color: #A78BFA;
  border: 1px solid rgba(167,139,250,0.28);
}
.proj-card-body {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}
.badge-linked {
  display: inline-block;
  padding: 2px 8px; border-radius: 5px;
  font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: 0.12em;
  background: var(--brand-tint-12);
  color: var(--brand-400);
  border: 1px solid var(--brand-tint-20);
}

/* Subproject rows live inside an expanded project card. The head row has the
   three inline action buttons (Designs / Board / + Link) and toggles a panel
   beneath when Designs or Board is clicked. */
.subproject-card {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden;
}
.subproject-head-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
}
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-muted); font-size: 11.5px; font-weight: 500;
  cursor: pointer; flex: 0 0 auto;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.chip-btn:hover { background: var(--surface-2); color: var(--ink); }
.chip-btn-on {
  background: var(--brand-tint-08); color: var(--brand-400);
  border-color: var(--brand-tint-40);
}
.subproject-body {
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.design-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
}
.design-row:first-child { border-top: none; }
