/* ==========================================================================
   Work Desk — layout + components.
   Depth model: layered translucent surfaces + a .5px hairline ring.
   No hard 1px borders anywhere in chrome. Glass only on floating chrome.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; border: 0 solid var(--border); }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-sans); font-size: 14px; line-height: 1.4286;
  color: var(--foreground); background: var(--background);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; background: none; }
button { cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.icon { width: 16px; height: 16px; flex-shrink: 0; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-fg-3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }

/* ambient field: gives the whole app a sense of depth behind the glass */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(680px 420px at 12% -6%, oklch(68.5% .169 237.323/.10), transparent 62%),
    radial-gradient(560px 380px at 92% 4%, oklch(60.6% .25 292.717/.07), transparent 60%),
    radial-gradient(720px 520px at 60% 108%, oklch(69.6% .17 162.48/.05), transparent 60%);
}
.dark body::before { opacity: .5; }

/* ---------- app frame ---------- */
.app { position: relative; z-index: 1; display: flex; height: 100%; }

/* ---------- sidebar: seamless, subtly distinct ---------- */
.rail {
  width: var(--rail-w); flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--sidebar-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset -1px 0 0 oklch(14.5% 0 0/.05);
  transition: width var(--dur-slow) var(--ease-in-out);
  overflow: hidden;
}
.dark .rail { box-shadow: inset -1px 0 0 oklch(98.5% 0 0/.05); }
.rail.collapsed { width: var(--rail-w-collapsed); }
/* collapse fades and folds rather than popping */
.rail .lbl, .rail .rail-foot-meta, .rail .wordmark { transition: opacity 150ms var(--ease-out); }
.rail .rail-group { max-height: 760px; opacity: 1; overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-in-out), opacity 200ms var(--ease-out) 60ms, margin var(--dur-slow) var(--ease-in-out); }
.rail.collapsed .lbl, .rail.collapsed .rail-foot-meta, .rail.collapsed .wordmark { opacity: 0; pointer-events: none; }
.rail.collapsed .rail-group { max-height: 0; opacity: 0; margin-top: 0; }
.rail.collapsed .rail-item { justify-content: center; padding: 0; }
.rail.collapsed .rail-head { padding: 0 8px; justify-content: center; }
.rail.collapsed .rail-sep { margin: 8px 6px; }

.rail-head { display: flex; align-items: center; gap: 8px; height: var(--header-h); padding: 0 10px 0 14px; flex-shrink: 0; }
.wordmark { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .16em; flex: 1; }
.wordmark b { font-weight: 700; }

.rail-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 8px; }
.rail-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 34px;
  padding: 0 10px; border-radius: var(--r-md); color: var(--surface-fg-1);
  font-size: 13.5px; font-weight: 450; text-align: left;
  transition: background var(--dur-fast) var(--ease-out);
}
.rail-item .icon { width: 17px; height: 17px; flex-shrink: 0; color: var(--surface-fg-2); }
.rail-item:hover { background: var(--muted); }
.rail-item[aria-current="page"] { background: var(--secondary); color: var(--foreground); font-weight: 550; }
.rail-item[aria-current="page"] .icon { color: var(--brand-content); }
.rail-item .cnt { margin-left: auto; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--surface-fg-3); }

.rail-sep { height: 1px; margin: 8px 10px; background: var(--border); opacity: .7; }
.rail-group { margin-top: 10px; }
.rail-group > h4 {
  margin: 0 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 500;
  letter-spacing: 0; color: var(--surface-fg-3);
}
.chat-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px 0 10px; border-radius: var(--r-md); text-align: left; color: var(--surface-fg-1); font-size: 13px; }
.chat-row:hover { background: var(--muted); }
.chat-row[aria-current="page"] { background: var(--secondary); }
.chat-row .icon.lead { width: 15px; height: 15px; color: var(--surface-fg-3); }
.chat-row[aria-current="page"] .icon.lead { color: var(--brand-content); }
.chat-row .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-row .more { opacity: 0; width: 22px; height: 22px; display: grid; place-items: center; border-radius: var(--r-sm); flex-shrink: 0; color: var(--surface-fg-2); }
.chat-row:hover .more, .chat-row .more:focus-visible { opacity: 1; }
.chat-row .more:hover { background: var(--accent); }
.chat-row .proj { font-size: 10.5px; color: var(--surface-fg-3); flex-shrink: 0; }
.showmore { display: block; width: 100%; padding: 5px 10px; text-align: left; font-size: 12.5px; color: var(--surface-fg-2); border-radius: var(--r-md); }
.showmore:hover { background: var(--muted); color: var(--foreground); }

.rail-foot { flex-shrink: 0; padding: 8px; }
.pfp-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border-radius: var(--r-lg); text-align: left; }
.pfp-btn:hover { background: var(--muted); }
.rail-foot-meta { min-width: 0; display: block; }
.rail-foot-meta .n { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot-meta .e { display: block; font-size: 11px; color: var(--surface-fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.av {
  width: 26px; height: 26px; border-radius: var(--r-full); flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(150deg, var(--sky-400), var(--violet-500));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.18);
}
.av.lg { width: 34px; height: 34px; font-size: 13px; }

/* ---------- notifications: right-hand pane, slides in ---------- */
.npane {
  width: 0; flex-shrink: 0; overflow: hidden; position: relative;
  background: var(--sidebar-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 1px 0 0 oklch(14.5% 0 0/.06);
  transition: width var(--dur-slow) var(--ease-in-out);
}
.dark .npane { box-shadow: inset 1px 0 0 oklch(98.5% 0 0/.06); }
.npane.open { width: 340px; }
.npane-inner {
  width: 340px; height: 100%; display: flex; flex-direction: column;
  opacity: 0; transform: translateX(16px);
  transition: opacity 170ms var(--ease-out), transform var(--dur-slow) var(--ease-out);
}
.npane.open .npane-inner { opacity: 1; transform: none; transition-delay: 70ms, 40ms; }
.npane-head { display: flex; align-items: center; gap: 6px; padding: 0 8px 0 16px; height: var(--header-h); flex-shrink: 0; box-shadow: inset 0 -1px 0 oklch(14.5% 0 0/.05); }
.dark .npane-head { box-shadow: inset 0 -1px 0 oklch(98.5% 0 0/.05); }
.npane-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.npane-scroll { flex: 1; overflow-y: auto; padding: 8px; }
.notif {
  display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--r-lg);
  text-align: left; width: 100%; align-items: flex-start;
}
.notif:hover { background: var(--muted); }
.notif .dot { width: 6px; height: 6px; border-radius: 99px; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.notif .dot.read { background: var(--surface-fg-3); }
.notif .nb { min-width: 0; }
.notif .nt { font-size: 13px; font-weight: 500; }
.notif .nd { font-size: 12px; color: var(--surface-fg-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif .na { font-size: 11px; color: var(--surface-fg-3); margin-top: 2px; }

/* ---------- main column ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.masthead {
  display: flex; align-items: center; gap: 10px; height: var(--header-h); padding: 0 12px 0 16px; flex-shrink: 0;
  background: var(--masthead-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: inset 0 -1px 0 oklch(14.5% 0 0/.05);
  position: relative; z-index: 30;
}
.dark .masthead { box-shadow: inset 0 -1px 0 oklch(98.5% 0 0/.05); }
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--surface-fg-2); min-width: 0; }
.crumb a:hover { color: var(--foreground); }
.crumb .sep { color: var(--surface-fg-3); }
.crumb .cur { color: var(--foreground); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mast-spacer { flex: 1; }
.mast-actions { display: flex; align-items: center; gap: 2px; }

.iconbtn {
  width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-md);
  color: var(--surface-fg-2); position: relative; flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.iconbtn:hover { background: var(--muted); color: var(--foreground); }
.iconbtn[aria-expanded="true"] { background: var(--secondary); color: var(--foreground); }
.iconbtn .icon { width: 17px; height: 17px; }
.iconbtn .badge {
  position: absolute; top: 3px; right: 3px; min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 99px; background: var(--destructive); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 15px; text-align: center;
  box-shadow: 0 0 0 2px var(--background);
}

.view { flex: 1; overflow-y: auto; position: relative; }
.pad { max-width: 1180px; margin: 0 auto; padding: 26px 28px 64px; }
.pad.narrow { max-width: 880px; }

/* ---------- typography ---------- */
h1.pt { margin: 0 0 3px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
p.psub { margin: 0 0 20px; font-size: 13.5px; color: var(--surface-fg-2); }
h2.sec { margin: 26px 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px; padding: 0 13px; border-radius: var(--r-md); font-size: 13px; font-weight: 500;
  color: var(--surface-fg-1); background: var(--surface-primary);
  box-shadow: var(--ring-surface), var(--shadow-xs);
  transition: background var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast);
}
.btn:hover { background: var(--muted); }
.btn:active { transform: translateY(.5px); }
.btn .icon { width: 15px; height: 15px; }
.btn.primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn.primary:hover { opacity: .9; background: var(--primary); }
.btn.ghost { background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--muted); }
.btn.danger { color: var(--destructive); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- surfaces ---------- */
.card {
  background: var(--surface-secondary); border-radius: var(--card-radius);
  box-shadow: var(--ring-surface), var(--shadow-sm); padding: 16px;
  transition: box-shadow var(--dur), transform var(--dur);
}
a.card:hover, button.card:hover { box-shadow: var(--ring-surface), var(--shadow-lg); transform: translateY(-1px); }
.card h3 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.card p { margin: 0; font-size: 12.5px; color: var(--surface-fg-2); }
.grid { display: grid; gap: 12px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 1040px) { .grid.c4 { grid-template-columns: repeat(2,minmax(0,1fr)); } .grid.c3 { grid-template-columns: repeat(2,minmax(0,1fr)); } }

.panel { background: var(--surface-secondary); border-radius: var(--r-lg); box-shadow: var(--ring-surface); overflow: hidden; }
.panel .prow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; box-shadow: inset 0 -1px 0 var(--border); }
.panel .prow:last-child { box-shadow: none; }
.panel .prow:hover { background: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-lg); background: var(--muted); margin-bottom: 18px; }
.tab { height: 28px; padding: 0 13px; border-radius: var(--r-md); font-size: 13px; font-weight: 500; color: var(--surface-fg-2); }
.tab:hover { color: var(--foreground); }
.tab[aria-selected="true"] { background: var(--surface-primary); color: var(--foreground); box-shadow: var(--ring-surface), var(--shadow-xs); }

/* ---------- table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 8px 12px; font-size: 10.5px; font-weight: 600;
  letter-spacing: .01em; color: var(--surface-fg-3);
  box-shadow: inset 0 -1px 0 var(--border);
}
table.tbl td { padding: 11px 12px; box-shadow: inset 0 -1px 0 var(--border); vertical-align: middle; }
table.tbl tr:hover td { background: var(--muted); }
table.tbl td .nm { font-weight: 500; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 19px; padding: 0 7px;
  border-radius: 99px; font-size: 10.5px; font-weight: 600; letter-spacing: 0;
  background: var(--secondary); color: var(--surface-fg-2);
}
.badge.brand { background: oklch(68.5% .169 237.323/.14); color: var(--brand-content); }
.badge.ok { background: oklch(69.6% .17 162.48/.15); color: var(--success); }
.badge.warn { background: oklch(76.9% .188 70.08/.18); color: var(--warn); }
.badge.danger { background: oklch(57.7% .245 27.325/.12); color: var(--destructive); }
.badge.violet { background: oklch(60.6% .25 292.717/.13); color: var(--violet-500); }
.dark .badge.violet { color: var(--violet-400); }

/* ---------- the orb (the one neomorphic element) ---------- */
.orb { width: 76px; height: 76px; border-radius: 50%; position: relative; margin: 0 auto 20px; isolation: isolate; }
.orb::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 26%, #fff 0%, rgba(255,255,255,.85) 9%, rgba(214,226,255,.75) 26%, rgba(150,170,240,.72) 52%, rgba(108,118,214,.8) 78%, rgba(76,80,170,.9) 100%);
  box-shadow:
    inset -6px -8px 18px rgba(56,58,130,.55),
    inset 5px 6px 14px rgba(255,255,255,.75),
    0 12px 26px -8px rgba(86,92,190,.5),
    0 2px 6px rgba(40,44,110,.18);
  animation: orbFloat 7s var(--ease-in-out) infinite;
}
.orb::after {
  content: ""; position: absolute; inset: -22%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(126,140,232,.28), transparent 62%);
  animation: orbPulse 7s var(--ease-in-out) infinite;
}
.orb.sm { width: 34px; height: 34px; margin: 0; }
@keyframes orbFloat { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.02); } }
@keyframes orbPulse { 0%,100% { opacity: .65; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .orb::before, .orb::after { animation: none; } }

/* ---------- home ---------- */
.home-wrap { display: flex; flex-direction: column; min-height: 100%; }
.hero { padding: 52px 28px 0; max-width: 820px; margin: 0 auto; width: 100%; }
.hero h1 { margin: 0 0 26px; font-size: 27px; font-weight: 500; text-align: center; letter-spacing: -.015em; }
.hero h1 span { color: var(--brand-content); }

.composer {
  background: var(--composer-bg); border-radius: var(--composer-radius);
  box-shadow: var(--ring-surface), var(--composer-shadow), 0 18px 36px -22px rgba(0,0,0,.22);
  padding: 12px 12px 9px; transition: box-shadow var(--dur);
}
.composer:focus-within { box-shadow: 0 0 0 .5px var(--border-surface-strong), var(--composer-shadow), 0 22px 44px -22px rgba(0,0,0,.3); }
.composer textarea {
  width: 100%; border: 0; outline: 0; resize: none; background: none;
  font-size: 14.5px; line-height: 1.5; min-height: 46px; max-height: 180px;
}
.composer textarea::placeholder { color: var(--surface-fg-3); }
.composer-bar { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 99px; font-size: 12.5px; color: var(--surface-fg-2);
  box-shadow: var(--ring-surface);
}
.chip:hover { background: var(--muted); color: var(--foreground); }
.chip .icon { width: 14px; height: 14px; }
.send { width: 30px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--primary); color: var(--primary-foreground); }
.send:hover { opacity: .9; }

.starters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
@media (max-width: 820px) { .starters { grid-template-columns: 1fr; } }
.starter { text-align: left; padding: 13px 14px; border-radius: var(--r-lg); background: var(--surface-tertiary); box-shadow: var(--ring-surface); }
.starter:hover { background: var(--surface-secondary); }
.starter .st { display: block; font-size: 12.5px; line-height: 1.45; }
.starter .icon { width: 15px; height: 15px; color: var(--surface-fg-3); margin-top: 10px; }

.resume { max-width: 820px; margin: 40px auto 0; width: 100%; padding: 0 28px 60px; }
.resume h2 { margin: 0 0 11px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.resume-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
@media (max-width: 820px) { .resume-grid { grid-template-columns: 1fr; } }
.rcard { text-align: left; padding: 13px 14px; border-radius: var(--r-lg); background: var(--surface-secondary); box-shadow: var(--ring-surface), var(--shadow-xs); }
.rcard:hover { box-shadow: var(--ring-surface), var(--shadow-md); transform: translateY(-1px); }
.rcard .rk { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.rcard .rt { display: block; font-size: 13.5px; font-weight: 500; margin: 4px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcard .rm { display: block; font-size: 11.5px; color: var(--surface-fg-3); }

/* needs you */
.needsyou {
  max-width: 820px; margin: 0 auto 18px; width: 100%;
  background: linear-gradient(180deg, oklch(76.9% .188 70.08/.10), oklch(76.9% .188 70.08/.04));
  border-radius: var(--r-lg); box-shadow: 0 0 0 .5px oklch(76.9% .188 70.08/.35); padding: 12px 14px;
}
.needsyou h3 { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--warn); display: flex; align-items: center; gap: 6px; }
.needsyou h3 .icon { width: 14px; height: 14px; }
.ny-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.ny-row + .ny-row { box-shadow: inset 0 1px 0 oklch(76.9% .188 70.08/.2); }
.ny-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ny-row .exp { font-size: 11.5px; color: var(--warn); font-variant-numeric: tabular-nums; }

/* ---------- chat ---------- */
.chat-wrap { display: flex; flex-direction: column; height: 100%; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 22px 0 8px; }
.thread { max-width: 760px; margin: 0 auto; padding: 0 28px; }
.msg { margin-bottom: 22px; }
.msg.user .bubble {
  margin-left: auto; max-width: 74%; background: var(--secondary);
  padding: 10px 14px; border-radius: var(--r-lg); font-size: 14px;
}
.msg.ai .bubble { font-size: 14.5px; line-height: 1.6; }
.msg.ai .bubble p { margin: 0 0 10px; }
.msg.ai .bubble ul { margin: 0 0 10px; padding-left: 18px; }
.msg.ai .bubble li { margin-bottom: 4px; }
.worked { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--surface-fg-2); padding: 5px 10px; border-radius: 99px; box-shadow: var(--ring-surface); margin-bottom: 10px; }
.worked .icon { width: 13px; height: 13px; }
.msg-actions { display: flex; align-items: center; gap: 2px; margin-top: 6px; opacity: 0; transition: opacity var(--dur); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-actions .ts { font-size: 11px; color: var(--surface-fg-3); margin-left: auto; }
.chat-composer { padding: 0 28px 22px; max-width: 760px; margin: 0 auto; width: 100%; }

/* ---------- project detail w/ right pane ---------- */
.split { display: flex; height: 100%; min-height: 0; }
.split-main { flex: 1; min-width: 0; overflow-y: auto; }
.ppane {
  width: 320px; flex-shrink: 0; overflow-y: auto; padding: 18px 16px 40px;
  background: var(--surface-tertiary);
  box-shadow: inset 1px 0 0 var(--border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.ppane.hidden { display: none; }
.ppane h4 { margin: 0 0 7px; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.ppane section { margin-bottom: 20px; }
.ppane .instr { font-size: 12.5px; line-height: 1.55; color: var(--surface-fg-1); background: var(--surface-secondary); border-radius: var(--r-md); padding: 10px 11px; box-shadow: var(--ring-surface); }
.ppane .fitem { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12.5px; }
.ppane .fitem .icon { width: 14px; height: 14px; color: var(--surface-fg-3); flex-shrink: 0; }
.ppane .empty { font-size: 12px; color: var(--surface-fg-3); padding: 6px 0; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.kv .k { font-size: 10.5px; letter-spacing: .01em; color: var(--surface-fg-3); }
.kv .v { font-size: 12.5px; font-family: var(--font-mono); }

/* ---------- designer ---------- */
.designer { display: flex; height: 100%; min-height: 0; }
.dz-palette { width: 190px; flex-shrink: 0; padding: 14px 12px; overflow-y: auto; box-shadow: inset -1px 0 0 var(--border); }
.dz-palette h5 { margin: 14px 0 5px; font-size: 10px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.dz-palette h5:first-child { margin-top: 0; }
.dz-step { display: block; width: 100%; text-align: left; padding: 7px 10px; margin-bottom: 4px; border-radius: var(--r-md); font-size: 12.5px; background: var(--surface-secondary); box-shadow: var(--ring-surface); }
.dz-step:hover { background: var(--muted); }
.dz-canvas { flex: 1; min-width: 0; position: relative; overflow: auto; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; }
.dz-node { position: absolute; width: 190px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-primary); box-shadow: var(--ring-surface), var(--shadow-md); }
.dz-node.sel { box-shadow: 0 0 0 1.5px var(--brand), var(--shadow-lg); }
.dz-node .k { font-size: 10px; letter-spacing: .01em; color: var(--brand-content); font-weight: 600; }
.dz-node .n { font-size: 13px; font-weight: 500; margin-top: 2px; }
.dz-node .id { font-size: 11px; color: var(--surface-fg-3); font-family: var(--font-mono); }
.dz-cfg { width: 290px; flex-shrink: 0; padding: 14px; overflow-y: auto; box-shadow: inset 1px 0 0 var(--border); }
.dz-cfg .fld { margin-bottom: 12px; }

/* ---------- forms ---------- */
.fld label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 5px; color: var(--surface-fg-1); }
.inp, select.inp, textarea.inp {
  width: 100%; height: 34px; padding: 0 11px; border-radius: var(--r-md);
  background: var(--surface-primary); box-shadow: var(--ring-surface);
  font-size: 13.5px; outline: none; transition: box-shadow var(--dur-fast);
}
textarea.inp { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; line-height: 1.5; }
select.inp { appearance: none; background-image: none; cursor: pointer; }
.inp:focus { box-shadow: 0 0 0 1px var(--brand), 0 0 0 3.5px oklch(68.5% .169 237.323/.15); }
.inp::placeholder { color: var(--surface-fg-3); }
.selwrap { position: relative; }
.selwrap .icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--surface-fg-3); pointer-events: none; }
.switch { width: 36px; height: 20px; border-radius: 99px; background: var(--secondary); position: relative; flex-shrink: 0; transition: background var(--dur); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-out); }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* ---------- popovers / menus ---------- */
.pop {
  position: absolute; z-index: 60; min-width: 200px; padding: 5px;
  border-radius: var(--r-xl); background: var(--popover);
  box-shadow: var(--overlay-ring), var(--shadow-xl);
  -webkit-backdrop-filter: blur(var(--overlay-blur)) saturate(1.6); backdrop-filter: blur(var(--overlay-blur)) saturate(1.6);
  animation: popIn var(--dur) var(--ease-out);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }
.pop .mi { display: flex; align-items: center; gap: 9px; width: 100%; height: 31px; padding: 0 9px; border-radius: var(--r-md); font-size: 13px; text-align: left; color: var(--surface-fg-1); }
.pop .mi:hover { background: var(--muted); }
.pop .mi .icon { width: 15px; height: 15px; color: var(--surface-fg-2); }
.pop .mi.danger { color: var(--destructive); } .pop .mi.danger .icon { color: var(--destructive); }
.pop .msep { height: 1px; margin: 4px 6px; background: var(--border); }
.pop .mhead { padding: 7px 9px 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: var(--surface-fg-3); }
.seg { display: flex; gap: 2px; padding: 3px; margin: 2px 6px 4px; border-radius: var(--r-md); background: var(--muted); }
.seg button { flex: 1; height: 25px; border-radius: var(--r-sm); font-size: 12px; color: var(--surface-fg-2); }
.seg button[aria-pressed="true"] { background: var(--surface-primary); color: var(--foreground); box-shadow: var(--ring-surface); }

.scrim { position: fixed; inset: 0; z-index: 55; }

/* ---------- feedback popover ---------- */
.fb-pop { width: 430px; padding: 0; max-height: calc(100vh - 70px); display: flex; flex-direction: column; }
.fb-head { display: flex; align-items: center; gap: 8px; padding: 13px 15px 10px; }
.fb-head h3 { margin: 0; font-size: 14px; font-weight: 600; flex: 1; }
.fb-head .icon { width: 16px; height: 16px; color: var(--brand-content); }
.fb-body { padding: 0 15px 4px; overflow-y: auto; }
.fb-body .fld { margin-bottom: 12px; }
.fb-row { display: grid; grid-template-columns: 1fr 160px; gap: 10px; }
.dropzone {
  border-radius: var(--r-lg); padding: 16px 12px; text-align: center; cursor: pointer;
  background: var(--surface-tertiary);
  box-shadow: 0 0 0 1.5px var(--border) inset;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 7px, oklch(14.5% 0 0/.02) 7px, oklch(14.5% 0 0/.02) 14px);
  transition: box-shadow var(--dur), background var(--dur);
}
.dropzone:hover { background: var(--muted); }
.dropzone.over { box-shadow: 0 0 0 1.5px var(--brand) inset; background: oklch(68.5% .169 237.323/.07); }
.dropzone .icon { width: 19px; height: 19px; margin: 0 auto 6px; color: var(--surface-fg-3); }
.dropzone .dz1 { font-size: 12.5px; font-weight: 500; }
.dropzone .dz2 { font-size: 11.5px; color: var(--surface-fg-3); margin-top: 2px; }
.fb-files { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.fb-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--r-md); background: var(--surface-secondary); box-shadow: var(--ring-surface); font-size: 12px; }
.fb-file img { width: 26px; height: 26px; object-fit: cover; border-radius: var(--r-sm); flex-shrink: 0; }
.fb-file .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-file .fs { color: var(--surface-fg-3); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fb-file .x { width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--surface-fg-2); flex-shrink: 0; }
.fb-file .x:hover { background: var(--accent); }
.fb-foot { display: flex; align-items: center; gap: 8px; padding: 11px 15px 13px; box-shadow: inset 0 1px 0 var(--border); }
.fb-foot .sp { flex: 1; }
.fb-note { font-size: 11.5px; color: var(--surface-fg-3); }
.fb-msg { font-size: 12.5px; padding: 8px 11px; border-radius: var(--r-md); margin: 0 15px 10px; }
.fb-msg.ok { background: oklch(69.6% .17 162.48/.12); color: var(--success); }
.fb-msg.err { background: oklch(57.7% .245 27.325/.1); color: var(--destructive); }
.req { color: var(--destructive); }

/* ---------- coach marks / onboarding ---------- */
.coach-scrim { position: fixed; inset: 0; z-index: 80; background: oklch(0 0 0/.45); -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px); }
.coach-hole { position: fixed; z-index: 81; border-radius: var(--r-lg); box-shadow: 0 0 0 9999px oklch(0 0 0/.45), 0 0 0 2px var(--brand); pointer-events: none; transition: all var(--dur-slow) var(--ease-in-out); }
.coach-card { position: fixed; z-index: 82; width: 310px; padding: 15px 16px; border-radius: var(--r-xl); background: var(--popover); box-shadow: var(--overlay-ring), var(--shadow-xl); transition: all var(--dur-slow) var(--ease-in-out); }
.coach-card h3 { margin: 0 0 5px; font-size: 14.5px; font-weight: 600; }
.coach-card p { margin: 0 0 13px; font-size: 12.5px; line-height: 1.5; color: var(--surface-fg-2); }
.coach-foot { display: flex; align-items: center; gap: 8px; }
.coach-foot .dots { display: flex; gap: 4px; flex: 1; }
.coach-foot .dots i { width: 5px; height: 5px; border-radius: 99px; background: var(--surface-fg-3); }
.coach-foot .dots i.on { background: var(--brand); width: 14px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 7px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 99px;
  background: var(--popover); box-shadow: var(--overlay-ring), var(--shadow-lg);
  -webkit-backdrop-filter: blur(var(--overlay-blur)); backdrop-filter: blur(var(--overlay-blur));
  font-size: 13px; animation: toastIn var(--dur-slow) var(--ease-out);
}
.toast .icon { width: 15px; height: 15px; }
.toast.ok .icon { color: var(--success); } .toast.err .icon { color: var(--destructive); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- misc ---------- */
.empty-state { text-align: center; padding: 56px 20px; }
.empty-state .icon { width: 26px; height: 26px; margin: 0 auto 10px; color: var(--surface-fg-3); }
.empty-state h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 550; }
.empty-state p { margin: 0 0 14px; font-size: 13px; color: var(--surface-fg-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.searchbox { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 11px; border-radius: var(--r-md); background: var(--surface-primary); box-shadow: var(--ring-surface); font-size: 13px; color: var(--surface-fg-3); min-width: 220px; }
.searchbox .icon { width: 15px; height: 15px; }
.searchbox input { flex: 1; border: 0; outline: 0; background: none; font-size: 13px; color: var(--foreground); }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 5px; bottom: 5px; width: 1.5px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before { content: ""; position: absolute; left: -18.5px; top: 5px; width: 9px; height: 9px; border-radius: 99px; background: var(--surface-primary); box-shadow: 0 0 0 1.5px var(--border); }
.tl-item.ok::before { background: var(--success); box-shadow: 0 0 0 1.5px var(--success); }
.tl-item.fail::before { background: var(--destructive); box-shadow: 0 0 0 1.5px var(--destructive); }
