

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --background: 0 0% 100%;
  --foreground: 240 10% 9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 9%;

  --primary: 240 10% 9%;
  --primary-foreground: 0 0% 100%;

  --brand: 243 75% 59%;
  --brand-foreground: 0 0% 100%;
  --brand-2: 271 76% 53%;
  --brand-soft: 243 100% 97%;

  --secondary: 240 5% 96%;
  --secondary-foreground: 240 10% 9%;
  --muted: 240 5% 96%;
  --muted-foreground: 240 5% 45%;
  --accent: 240 5% 96%;
  --accent-foreground: 240 10% 9%;

  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 100%;

  --border: 240 6% 90%;
  --input: 240 6% 90%;
  --ring: 240 10% 9%;

  --chart-1: 240 10% 20%;
  --chart-2: 173 58% 39%;
  --chart-3: 27 87% 67%;
  --chart-4: 200 70% 50%;
  --chart-5: 340 60% 50%;

  --radius: 0.625rem;

  --sidebar-background: 240 6% 98%;
  --sidebar-foreground: 240 8% 28%;
  --sidebar-primary: 240 10% 9%;
  --sidebar-primary-foreground: 0 0% 100%;
  --sidebar-accent: 240 5% 94%;
  --sidebar-accent-foreground: 240 10% 9%;
  --sidebar-border: 240 6% 90%;
  --sidebar-ring: 240 10% 9%;

  --sidebar: var(--sidebar-background);
}

.dark {
  --background: 240 8% 6%;
  --foreground: 0 0% 96%;
  --card: 240 7% 9%;
  --card-foreground: 0 0% 96%;
  --popover: 240 7% 9%;
  --popover-foreground: 0 0% 96%;

  --primary: 0 0% 96%;
  --primary-foreground: 240 10% 9%;

  --brand: 245 80% 68%;
  --brand-foreground: 240 10% 9%;
  --brand-2: 271 80% 68%;
  --brand-soft: 243 40% 16%;

  --secondary: 240 6% 13%;
  --secondary-foreground: 0 0% 96%;
  --muted: 240 6% 13%;
  --muted-foreground: 240 5% 64%;
  --accent: 240 6% 15%;
  --accent-foreground: 0 0% 96%;

  --destructive: 0 63% 50%;
  --destructive-foreground: 0 0% 96%;

  --border: 240 6% 16%;
  --input: 240 6% 16%;
  --ring: 0 0% 96%;

  --chart-1: 0 0% 92%;
  --chart-2: 160 60% 50%;
  --chart-3: 30 80% 60%;
  --chart-4: 200 70% 60%;
  --chart-5: 340 60% 55%;

  --sidebar-background: 240 8% 7%;
  --sidebar-foreground: 240 5% 78%;
  --sidebar-primary: 0 0% 96%;
  --sidebar-primary-foreground: 240 10% 9%;
  --sidebar-accent: 240 6% 12%;
  --sidebar-accent-foreground: 0 0% 96%;
  --sidebar-border: 240 6% 16%;
  --sidebar-ring: 0 0% 96%;
  --sidebar: var(--sidebar-background);
}

html, body { height: 100%; }
html, body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  letter-spacing: -0.005em;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.35);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.bg-stripe-mesh {
  background-image:
    radial-gradient(at 12% -6%, hsl(var(--primary) / 0.06) 0px, transparent 50%),
    radial-gradient(at 88% 8%, hsl(var(--accent) / 0.6) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsl(var(--primary) / 0.03) 0px, transparent 50%);
}
.bg-stripe-lines {
  background-image: repeating-linear-gradient(135deg,
    hsl(var(--primary) / 0.03) 0px, hsl(var(--primary) / 0.03) 1px,
    transparent 1px, transparent 16px);
}
.hairline { box-shadow: inset 0 0 0 1px hsl(var(--border)); }
.elev-1 {
  box-shadow:
    0 1px 2px hsl(var(--foreground) / 0.04),
    0 0 0 1px hsl(var(--border) / 0.6);
}
.elev-2 {
  box-shadow:
    0 8px 24px -6px hsl(var(--foreground) / 0.08),
    0 2px 6px -2px hsl(var(--foreground) / 0.04);
}

.elev-3 {
  box-shadow:
    0 24px 50px -12px hsl(var(--foreground) / 0.30),
    0 8px 20px -8px hsl(var(--foreground) / 0.18),
    0 0 0 1px hsl(var(--border) / 0.7);
}

.z-55 { z-index: 55; }
.z-60 { z-index: 60; }
.glow-ring {
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.35), 0 8px 30px -6px hsl(var(--primary) / 0.25);
}
.text-gradient-brand {
  background: linear-gradient(135deg, hsl(var(--foreground)) 0%, hsl(var(--muted-foreground)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-gradient-color {
  background: linear-gradient(115deg, hsl(var(--brand)) 0%, hsl(var(--brand-2)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.bg-brand-mesh {
  background-image:
    radial-gradient(at 8% -10%, hsl(var(--brand) / 0.18) 0px, transparent 50%),
    radial-gradient(at 92% 0%, hsl(var(--brand-2) / 0.16) 0px, transparent 45%),
    radial-gradient(at 50% 110%, hsl(var(--brand) / 0.08) 0px, transparent 55%);
}
.bg-brand-gradient {
  background-image: linear-gradient(115deg, hsl(var(--brand)) 0%, hsl(var(--brand-2)) 100%);
}
.glow-brand { box-shadow: 0 10px 40px -8px hsl(var(--brand) / 0.45); }

@keyframes orbit-spin     { from { transform: rotate(0deg); }   to { transform: rotate(360deg); } }
@keyframes orbit-spin-rev { from { transform: rotate(0deg); }   to { transform: rotate(-360deg); } }
@keyframes orbit-glow     { 0%,100% { opacity: 0.45; } 50% { opacity: 0.7; } }
.orbit-ring-inner { animation: orbit-spin 44s linear infinite; }
.orbit-ring-outer { animation: orbit-spin-rev 64s linear infinite; }
.orbit-chip-inner { animation: orbit-spin-rev 44s linear infinite; }
.orbit-chip-outer { animation: orbit-spin 64s linear infinite; }
.orbit-glow { animation: orbit-glow 6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .orbit-ring-inner, .orbit-ring-outer, .orbit-chip-inner, .orbit-chip-outer, .orbit-glow { animation: none; }
}

.typing-caret::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 4px;
  margin-bottom: 1px;
  border-radius: 9999px;
  background: hsl(var(--primary));
  vertical-align: baseline;
  animation: caretPulse 1.05s ease-in-out infinite;
}
@keyframes caretPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.72); }
}
@media (prefers-reduced-motion: reduce) {
  .typing-caret::after { animation: none; }
}
@keyframes indeterminate-slide { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer {
  background: linear-gradient(90deg,
    hsl(var(--muted)) 0%, hsl(var(--accent)) 50%, hsl(var(--muted)) 100%);
  background-size: 800px 100%;
  animation: shimmer 1.6s linear infinite;
}
.msg-enter { animation: msg-in 0.25s ease both; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

.px-typing { display: inline-flex; align-items: center; gap: 3px; }

.px-typing.hidden { display: none; }
.px-typing i { width: 4px; height: 4px; border-radius: 9999px; background: currentColor;
               opacity: .35; animation: pxTyping 1.2s ease-in-out infinite; }
.px-typing i:nth-child(2) { animation-delay: .18s; }
.px-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes pxTyping { 0%, 70%, 100% { opacity: .3; transform: translateY(0); }
                      35% { opacity: 1; transform: translateY(-3px); } }

.ag-pop { animation: agPop .42s cubic-bezier(.2,.9,.3,1.15) both; animation-delay: calc(var(--i,0) * 70ms); }
@keyframes agPop { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.ag-pop .ag-stage-dot { animation: agBadge .42s cubic-bezier(.2,.9,.3,1.3) both; animation-delay: inherit; }
@keyframes agBadge { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ag-pop .ag-port { animation: agPing .6s ease-out both; animation-delay: calc(var(--i,0) * 70ms + 120ms); }
@keyframes agPing { 0% { box-shadow: 0 0 0 0 var(--ag-accent); } 100% { box-shadow: 0 0 0 9px transparent; } }

.ag-canvas {
  position: relative;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;

  background:
    radial-gradient(at 12% -6%, hsl(var(--primary) / 0.06) 0px, transparent 50%),
    radial-gradient(at 88% 8%, hsl(var(--accent) / 0.6) 0px, transparent 50%),
    radial-gradient(at 0% 100%, hsl(var(--primary) / 0.03) 0px, transparent 50%),
    hsl(var(--background));
}
.ag-canvas.ag-grabbing { cursor: grabbing; }

body.ag-panning, body.ag-panning * {
  -webkit-user-select: none !important;
          user-select: none !important;
  cursor: grabbing !important;
}
.ag-canvas::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;

  background-image:
    radial-gradient(hsl(var(--foreground) / 0.045) 1px, transparent 1.4px);

  background-size:
    calc(22px * var(--ag-bg-s, 1)) calc(22px * var(--ag-bg-s, 1));
  background-position: var(--ag-bg-x, 0px) var(--ag-bg-y, 0px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 6%, black 94%, transparent);
          mask-image: linear-gradient(to bottom, transparent, black 6%, black 94%, transparent);
}

.ag-controls {
  position: absolute; left: 14px; bottom: 14px; z-index: 6;
  display: flex; flex-direction: column;
  border: 1px solid hsl(var(--border)); border-radius: 12px;
  background: hsl(var(--card) / 0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.05);
  overflow: hidden;
}
.ag-ctl-btn {
  width: 34px; height: 32px; display: grid; place-items: center;
  color: hsl(var(--foreground) / 0.6); background: transparent;
  border: 0; border-bottom: 1px solid hsl(var(--border) / 0.6);
  cursor: pointer; transition: background .14s ease, color .14s ease;
}
.ag-ctl-btn:hover { background: hsl(var(--brand) / 0.10); color: hsl(var(--brand)); }
.ag-ctl-btn:active { background: hsl(var(--brand) / 0.18); }
@media (pointer: coarse) {
  .ag-ctl-btn { width: 44px; height: 44px; }
  .ag-ctl-zoom { min-width: 44px; }
}
.ag-ctl-zoom {
  padding: 5px 0 6px; text-align: center; min-width: 34px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  color: hsl(var(--foreground) / 0.55); font-variant-numeric: tabular-nums;
}
.dark .ag-canvas::before {
  background-image:
    radial-gradient(hsl(var(--foreground) / 0.07) 1px, transparent 1.4px);
}

.ag-blueprint-shell { position: relative; width: min(100%, 920px); margin-inline: 0; transform-origin: 0 0; }

.ag-blueprint-hero {
  position: relative; overflow: hidden;
  border-radius: 1rem;
  border: 1px solid hsl(var(--border));
  background:
    linear-gradient(135deg, hsl(var(--card) / 0.96), hsl(var(--muted) / 0.34)),
    radial-gradient(circle at 95% 0%, hsl(var(--brand) / 0.14), transparent 22rem);
  box-shadow: 0 1px 3px hsl(var(--foreground) / 0.05);
}
.ag-blueprint-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; z-index: 1;
  background: linear-gradient(115deg, hsl(var(--brand)), hsl(var(--brand-2)));
  opacity: .9;
}
.ag-blueprint-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, hsl(var(--background) / 0.46), transparent);
  transform: translateX(-100%);
  animation: agBlueprintSheen 5.5s ease-in-out infinite;
}
@keyframes agBlueprintSheen {
  0%, 54% { transform: translateX(-115%); opacity: 0; }
  68% { opacity: .7; }
  100% { transform: translateX(115%); opacity: 0; }
}

.ag-stage-list {
  position: relative;
  --ag-spine-top: 18px;
  --ag-drawn: 100%;
}

.ag-spine {
  position: absolute; left: 27px;
  top: var(--ag-spine-top, 18px);
  height: calc(var(--ag-drawn, 100%) - var(--ag-spine-top, 18px));
  width: 2px; z-index: 0; pointer-events: none;
}
.ag-spine::before {
  content: ""; position: absolute; inset: 0; border-radius: 9999px;
  background: repeating-linear-gradient(180deg,
    hsl(var(--foreground) / 0.18) 0 6px, transparent 6px 12px);
  opacity: .5;
}
.ag-spine::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 100%;
  border-radius: 9999px;
  background: linear-gradient(180deg,
    hsl(var(--brand)), hsl(var(--brand-2)) 52%, hsl(var(--chart-2)) 100%);
  opacity: .55;
}
.dark .ag-spine::before { opacity: .6; }
.dark .ag-spine::after { opacity: .72; }

.ag-flow-dot {
  position: absolute; left: 25.5px;
  top: var(--ag-spine-top, 18px);
  width: 5px; height: 5px; z-index: 1;
  border-radius: 9999px;
  background: var(--ag-accent, hsl(var(--brand)));
  box-shadow: 0 0 8px 2px hsl(var(--brand) / 0.8); opacity: 0; pointer-events: none;
}
.ag-building .ag-flow-dot { animation: agFlowDot 2.4s ease-in-out infinite; }
@keyframes agFlowDot {
  0%   { top: var(--ag-spine-top, 18px); opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: var(--ag-drawn, 100%); opacity: 0; }
}

.ag-stage {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  column-gap: .75rem;
  padding-bottom: 28px;
}
.ag-stage:last-child { padding-bottom: 4px; }
.ag-stage-rail { display: flex; flex-direction: column; align-items: center; }

.ag-stage-dot {
  position: relative; z-index: 2;
  width: 36px; height: 36px; border-radius: .9rem;
  display: grid; place-items: center;
  background: hsl(var(--card));
  border: 1.5px solid var(--ag-accent, hsl(var(--brand)));
  color: var(--ag-accent, hsl(var(--brand)));
  box-shadow: 0 0 0 5px hsl(var(--background));
}

.ag-stage:not(:last-child) .ag-stage-dot::after {
  content: ""; position: absolute; z-index: -1;
  top: 50%; left: 100%; width: 22px; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, var(--ag-accent), transparent);
  opacity: .5;
}

.ag-building .ag-stage:last-of-type .ag-stage-dot {
  box-shadow:
    0 0 0 5px hsl(var(--background)),
    0 0 0 7px var(--ag-accent);
  animation: agDotPulse 1.8s ease-in-out infinite;
}
@keyframes agDotPulse { 50% { box-shadow: 0 0 0 5px hsl(var(--background)), 0 0 0 9px transparent; } }

.ag-stage-dot.ag-cap {
  background: var(--ag-accent); color: var(--ag-cap-ink, #1a1205);
  border-color: var(--ag-accent);
}
.dark .ag-stage-dot.ag-cap { color: hsl(var(--background)); }

.ag-rail-spacer { flex: 1 1 auto; min-height: 6px; }
.ag-chev {
  display: grid; place-items: center;
  width: 36px; height: 22px; margin: 0;
  color: var(--ag-next, var(--ag-accent)); opacity: .5;
}
.ag-stage:last-child .ag-chev,
.ag-stage:last-child .ag-rail-spacer { display: none; }

.ag-stage-title {
  display: block; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  letter-spacing: .12em; text-transform: uppercase;
  font-size: 10.5px; font-weight: 750; line-height: 1;
  color: var(--ag-accent, hsl(var(--brand)));
}
.ag-term {
  flex: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px; font-weight: 700; letter-spacing: .14em;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border)); border-radius: 6px;
  padding: 1px 5px; margin-left: 6px;
}

.ag-node {
  position: relative; isolation: isolate;
  transition: border-color .15s ease, background .15s ease;
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.035);
}

.ag-node::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 9999px;
  background: linear-gradient(180deg, var(--ag-accent), transparent);
  transition: opacity .15s ease; opacity: .85;
}

.ag-node::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--ag-accent-soft), transparent 55%);
  opacity: .5;
}
.ag-node > * { position: relative; z-index: 1; }

.ag-fan-multi .ag-node::after { opacity: .28; }

.ag-port {
  position: absolute; left: -4px; top: 19px; width: 8px; height: 8px; z-index: 2;
  border-radius: 9999px; background: hsl(var(--card));
  border: 1.5px solid var(--ag-accent);
}

.ag-ico {
  height: 40px; width: 40px; border-radius: .75rem;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--ag-accent-12, hsl(var(--muted)));
  border: 1px solid var(--ag-accent-35, hsl(var(--border)));
  color: var(--ag-accent);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.18);
}
button.ag-node { cursor: pointer; }
button.ag-node:hover {
  border-color: hsl(var(--foreground) / 0.22);
}
button.ag-node:hover::before { opacity: 1; }
button.ag-node:hover .ag-chevron { transform: translateX(2px); color: var(--ag-accent); }
.ag-chevron { transition: transform .15s ease, color .15s ease; }

.ag-cap { transition: border-color .15s ease, background .15s ease; }
.ag-cap:hover {
  border-color: var(--ag-accent-35, hsl(var(--border)));
}

.ag-fan { position: relative; }
.ag-fan > * + * { margin-top: 12px; }

.ag-ghost { border-style: dashed !important; background: hsl(var(--card) / 0.4) !important; box-shadow: none !important; }
.ag-ghost .ag-ico { background: hsl(var(--muted) / 0.5); border-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); box-shadow: none; }
.ag-ghost::before, .ag-ghost::after { opacity: .25; }
.ag-stage-dot.ag-ghost-dot {
  background: hsl(var(--card)); border: 1.5px dashed hsl(var(--muted-foreground) / 0.5);
  color: hsl(var(--muted-foreground)); box-shadow: 0 0 0 5px hsl(var(--background));
  animation: none;
}
.ag-stage-dot.ag-ghost-dot::after { background: linear-gradient(90deg, hsl(var(--muted-foreground) / 0.4), transparent); }
.ag-ghost-shimmer { position: relative; overflow: hidden; }
.ag-ghost-shimmer::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(90deg, transparent, hsl(var(--foreground) / 0.05), transparent);
  transform: translateX(-100%); animation: agGhostSheen 1.8s ease-in-out infinite;
}
@keyframes agGhostSheen { 100% { transform: translateX(100%); } }
.ag-building-note { display: flex; align-items: center; gap: 8px; justify-content: center; color: hsl(var(--muted-foreground)); font-size: 12px; }

.ag-notes { margin-top: 1rem; padding-left: 68px; display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 767px) {
  .ag-node { padding: .75rem .875rem; }

  .ag-blueprint-shell .ag-stage-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ag-pop, .ag-pop .ag-stage-dot, .ag-pop .ag-port,
  .ag-blueprint-hero::after, .ag-ghost-shimmer::after,
  .ag-building .ag-flow-dot, .ag-building .ag-stage:last-of-type .ag-stage-dot,
  .ag-build-orb::before, .ag-build-orb::after {
    animation: none !important;
  }
}


.ag-stage-desc { font-size: 11.5px; line-height: 1.5; color: hsl(var(--muted-foreground)); max-width: 46ch; }


.ag-empty-shell { display: flex; flex-direction: column; align-items: center; }
.ag-build-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 14px 18px 22px; }
.ag-build-orb { position: relative; height: 58px; width: 58px; border-radius: 50%; display: grid; place-items: center;
  color: hsl(var(--brand)); margin-bottom: 10px; background: hsl(var(--brand) / 0.08); }
.ag-build-orb::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 0deg, hsl(var(--brand) / 0) 8%, hsl(var(--brand)) 90%, hsl(var(--brand) / 0));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; animation: agOrbSpin 0.9s linear infinite; }
.ag-build-orb::after { content: ""; position: absolute; inset: -9px; border-radius: 50%;
  background: radial-gradient(closest-side, hsl(var(--brand) / 0.22), transparent); animation: agOrbGlow 1.9s ease-in-out infinite; }
@keyframes agOrbSpin { to { transform: rotate(360deg); } }
@keyframes agOrbGlow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.ag-build-orb-idle { color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / 0.5); }
.ag-build-orb-idle::before { animation: none; background: hsl(var(--border)); opacity: .7; }
.ag-build-orb-idle::after { display: none; }
.ag-build-h { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.ag-build-p { font-size: 12.5px; line-height: 1.55; color: hsl(var(--muted-foreground)); max-width: 300px; }
.ag-ghost-list { opacity: .92; transition: opacity .3s ease; }
.ag-ghost-list.ag-ghost-dim { opacity: .5; }


.ag-b-title { font-size: 12.5px; font-weight: 650; letter-spacing: -0.005em; color: hsl(var(--foreground)); }
.ag-b-dot { display: inline-grid; place-items: center; height: 26px; width: 26px; border-radius: 8px; flex-shrink: 0;
  font-weight: 700; font-size: 12px; background: var(--ag-accent-12, hsl(var(--muted))); color: var(--ag-accent, hsl(var(--foreground))); }
.ag-grid-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.ag-grid-head .ag-b-title, .ag-grid-head .ag-stage-desc { min-width: 0; }


.ag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 2px; }
.ag-grid-cell { border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 14px; background: hsl(var(--card)); padding: 14px; }
@media (max-width: 640px) { .ag-grid { grid-template-columns: 1fr; } }


.ag-timeline { padding: 2px 2px 2px 6px; }
.ag-tl-row { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding-bottom: 20px; }
.ag-tl-row:last-child { padding-bottom: 0; }
.ag-tl-axis { position: relative; display: flex; justify-content: center; }
.ag-tl-axis::before { content: ""; position: absolute; top: 36px; bottom: -20px; width: 2px; left: 50%; transform: translateX(-50%); background: hsl(var(--border)); }
.ag-tl-row:last-child .ag-tl-axis::before { display: none; }
.ag-tl-node { z-index: 1; height: 36px; width: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: hsl(var(--card)); border: 2px solid var(--ag-accent, hsl(var(--border))); color: var(--ag-accent, hsl(var(--foreground))); box-shadow: 0 0 0 4px hsl(var(--background)); }
.ag-tl-body { border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; min-width: 0; }
.ag-tl-body .ag-stage-desc { margin-bottom: 8px; }


.ag-lanes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.ag-lane { border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--muted) / 0.22); overflow: hidden; }
.ag-lane-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: hsl(var(--muted-foreground));
  padding: 9px 12px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card)); }
.ag-lane-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.ag-lane-card { border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 10px; background: hsl(var(--card)); padding: 11px; }
.ag-lane-empty { color: hsl(var(--muted-foreground)); text-align: center; padding: 10px; font-size: 12px; }
@media (max-width: 720px) { .ag-lanes { grid-template-columns: 1fr; } }


.ag-loop { position: relative; padding-left: 22px; }
.ag-loop-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08); border: 1px solid hsl(var(--primary) / 0.22); border-radius: 999px; padding: 4px 11px; margin: 0 0 12px 56px; }
.ag-loop-list { position: relative; }
.ag-loop-return { position: absolute; top: 26px; bottom: 24px; left: -20px; width: 15px;
  border: 2px dashed hsl(var(--primary) / 0.4); border-right: 0; border-radius: 11px 0 0 11px; }


.ag-hub { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 4px; }
.ag-hub-core { width: min(340px, 92%); text-align: center; border: 1.5px solid var(--ag-accent, hsl(var(--border))); border-radius: 16px;
  background: hsl(var(--card)); padding: 16px; box-shadow: 0 8px 26px -14px var(--ag-accent, hsl(var(--foreground) / 0.4)); }
.ag-hub-core-dot { display: inline-grid; place-items: center; height: 44px; width: 44px; border-radius: 50%;
  background: var(--ag-accent-12, hsl(var(--muted))); color: var(--ag-accent, hsl(var(--foreground))); margin-bottom: 8px; }
.ag-hub-core .ag-stage-desc { margin: 2px auto 8px; }
.ag-hub-ring { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
.ag-hub-spoke { border: 1px solid hsl(var(--border)); border-top: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px; background: hsl(var(--card)); padding: 12px; }
@media (max-width: 640px) { .ag-hub-ring { grid-template-columns: 1fr; } }


.ag-tree { display: flex; flex-direction: column; align-items: center; }
.ag-tree-head { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.ag-tree-node { width: min(460px, 96%); border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; }
.ag-tree-connect { height: 20px; display: flex; justify-content: center; }
.ag-tree-stem { width: 2px; background: hsl(var(--border)); }
.ag-tree-branches { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%; position: relative; padding-top: 16px; }
.ag-tree-branches::before { content: ""; position: absolute; top: 0; left: 12%; right: 12%; height: 2px; background: hsl(var(--border)); }
.ag-tree-branch { position: relative; flex: 1 1 230px; max-width: 320px; min-width: 210px;
  border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); overflow: hidden; }
.ag-tree-branch::before { content: ""; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px; background: hsl(var(--border)); }
.ag-tree-chip { display: block; font-size: 11px; font-weight: 700; text-align: center; letter-spacing: .02em;
  color: var(--ag-accent, hsl(var(--primary))); background: var(--ag-accent-12, hsl(var(--muted))); padding: 6px; }
.ag-tree-branch-card { padding: 10px; }
.ag-tree-then { margin: 18px 0 2px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); text-align: center; }
.ag-tree-foot { margin-top: 16px; width: 100%; display: flex; justify-content: center; }
@media (max-width: 640px) { .ag-tree-branch { flex-basis: 100%; max-width: 100%; } .ag-tree-branches::before { display: none; } }

.input {
  width: 100%;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  outline: none;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.input { box-shadow: inset 0 1px 2px hsl(var(--foreground) / 0.045); }
.input::placeholder { color: hsl(var(--muted-foreground) / 0.7); }
.input:hover { border-color: hsl(var(--foreground) / 0.22); }
.input:focus { border-color: hsl(var(--brand)); box-shadow: 0 0 0 3px hsl(var(--brand) / 0.15), inset 0 1px 2px hsl(var(--foreground) / 0.04); }

.input-lead { padding-left: 2.5rem !important; }
.input-trail { padding-right: 2.75rem !important; }

.ts-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.375rem;
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-weight: 600; font-size: 0.875rem;
  border-radius: var(--radius); padding: 0.625rem 1.25rem;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-brand {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: hsl(var(--brand)); color: hsl(var(--brand-foreground));
  font-weight: 600; font-size: 0.875rem;
  border-radius: var(--radius); padding: 0.625rem 1.25rem;
  transition: filter 0.15s;
}
.btn-brand:hover { filter: brightness(1.08); }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  background: hsl(var(--background)); color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  font-weight: 600; font-size: 0.875rem;
  border-radius: var(--radius); padding: 0.625rem 1.25rem;
  transition: background 0.15s;
}
.btn-secondary:hover { background: hsl(var(--muted)); }

.btn-primary.hidden,
.btn-secondary.hidden,
.btn-brand.hidden,
.btn-cta.hidden { display: none; }

.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  color: #fff !important;
  background-image: linear-gradient(118deg, hsl(243 72% 56%) 0%, hsl(271 76% 53%) 100%);
  font-weight: 600; font-size: 0.9rem; line-height: 1; white-space: nowrap;
  border-radius: 9999px; padding: 0.8rem 1.45rem;
  box-shadow: 0 0 0 1px hsl(var(--brand) / 0.24);
  transition: border-color .15s ease, filter .15s ease, background .15s ease;
}
.btn-cta:hover { filter: brightness(1.04); box-shadow: 0 0 0 1px hsl(var(--brand) / 0.34); }
.btn-cta:active { filter: brightness(0.98); }
.btn-cta:disabled { opacity: 0.5; cursor: not-allowed; filter: none; transform: none;
  box-shadow: 0 0 0 1px hsl(var(--brand) / 0.16); }
.btn-cta svg { stroke: #fff; }
.btn-cta-sm { height: 2.25rem; padding: 0 1.1rem; font-size: 0.875rem; }
.btn-cta-lg { font-size: 1rem; padding: 0.95rem 1.8rem; }

.pw-eye .eye-off { display: none; }
.pw-eye.is-revealed .eye-on { display: none; }
.pw-eye.is-revealed .eye-off { display: inline; }

.opt-prose {
  font-size: 16px;
  line-height: 1.75;
  color: hsl(var(--foreground));
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum", "lnum", "ss01", "cv11";

  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.opt-prose a, .opt-prose code, .opt-prose pre { overflow-wrap: anywhere; word-break: break-word; }

.opt-prose img, .opt-prose video, .opt-prose iframe { max-width: 100%; height: auto; border-radius: 12px; margin: 1.25rem 0; }
.opt-prose figure { margin: 1.5rem 0; }
.opt-prose figure figcaption { font-size: .9rem; color: hsl(var(--muted-foreground)); text-align: center; margin-top: .5rem; }
.opt-prose iframe { aspect-ratio: 16 / 9; width: 100%; }
.opt-prose video { width: 100%; }

.kit-card {
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04),
              0 1px 3px hsl(var(--foreground) / 0.03);
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}

@keyframes pxWidgetDone {
  0%, 100% { box-shadow: 0 0 0 0 hsl(var(--foreground) / 0.04); }
  50% { box-shadow: 0 0 0 4px hsl(346 90% 60% / 0.18); }
}
.px-widget-done { animation: pxWidgetDone 1s ease-in-out 3; }

.kit-xlsx table { border-collapse: collapse; font-size: 12px; }
.kit-xlsx td, .kit-xlsx th {
  border: 1px solid hsl(var(--border)); padding: 4px 9px;
  white-space: nowrap; color: hsl(var(--foreground)); max-width: 360px;
  overflow: hidden; text-overflow: ellipsis;
}
.kit-xlsx tr:first-child td { background: hsl(var(--muted)); font-weight: 600; }
.kit-xlsx td[data-t="n"] { text-align: right; font-variant-numeric: tabular-nums; }

.kit-docx { color: #1a1a1a; background: #fff; border-radius: 8px; }
.kit-docx * { max-width: 100%; }

.kit-pptx { display: flex; flex-direction: column; gap: 14px; }
.kit-pptx-slide {
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  background: hsl(var(--card));
  overflow: hidden;
}
.kit-pptx-slide-h {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 8px 14px;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.4);
}
.kit-pptx-slide-b { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.kit-pptx-line {
  font-size: 13.5px; line-height: 1.5; color: hsl(var(--foreground));
  white-space: pre-wrap; word-break: break-word;
}
.kit-pptx-line:first-child { font-weight: 600; }
.kit-pptx-empty { font-size: 12.5px; font-style: italic; color: hsl(var(--muted-foreground)); }
.kit-pptx-more { font-size: 12.5px; text-align: center; color: hsl(var(--muted-foreground)); padding: 4px 0 2px; }

.kit-hscroll { scrollbar-width: thin; scrollbar-color: hsl(var(--border)) transparent; }
.kit-hscroll::-webkit-scrollbar { height: 7px; }
.kit-hscroll::-webkit-scrollbar-track { background: transparent; }
.kit-hscroll::-webkit-scrollbar-thumb { background: hsl(var(--border)); border-radius: 9999px; }
.kit-hscroll::-webkit-scrollbar-thumb:hover { background: hsl(var(--muted-foreground) / 0.4); }

.kit-card-i { cursor: pointer; }
.kit-card-i:hover {
  box-shadow: 0 12px 28px -10px hsl(var(--foreground) / 0.14),
              0 2px 6px -2px hsl(var(--foreground) / 0.05);
  transform: translateY(-1px);
  border-color: hsl(var(--border));
}

details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .kit-chevron { transform: rotate(180deg); }

.ag-md { font-size: 13.5px; line-height: 1.72; }
.ag-md > :first-child { margin-top: 0 !important; }
.ag-md > :last-child { margin-bottom: 0 !important; }


.ag-md > * + * { margin-top: 0.95rem; }
.ag-md p { margin: 0; }

.ag-md br { content: ""; display: block; margin-top: 0.28rem; }

.ag-md h1, .ag-md h2, .ag-md h3, .ag-md h4, .ag-md h5, .ag-md h6 {
  font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; margin: 0.2rem 0 0; }
.ag-md > * + :is(h1, h2, h3, h4, h5, h6) { margin-top: 1.3rem; }
.ag-md :is(h1, h2, h3, h4, h5, h6) + * { margin-top: 0.4rem; }
.ag-md h1 { font-size: 1.15rem; }
.ag-md h2 { font-size: 1.05rem; }
.ag-md h3 { font-size: 0.98rem; }
.ag-md h4, .ag-md h5, .ag-md h6 { font-size: 0.92rem; }

.ag-md ul, .ag-md ol { margin: 0; padding-left: 1.35rem; }
.ag-md ul { list-style: disc; }
.ag-md ol { list-style: decimal; }
.ag-md li { margin: 0.4rem 0; }
.ag-md li::marker { color: hsl(var(--muted-foreground)); }
.ag-md li > p { margin: 0; }
.ag-md li > ul, .ag-md li > ol { margin: 0.3rem 0 0.15rem; }

.ag-md code {
  font-family: var(--font-mono, ui-monospace, "SFMono-Regular", Menlo, monospace);
  font-size: 0.86em; background: hsl(var(--muted) / 0.7);
  border: 1px solid hsl(var(--border) / 0.5); padding: 0.12em 0.38em; border-radius: 5px; }

.ag-md pre {
  background: hsl(var(--muted) / 0.5); border: 1px solid hsl(var(--border));
  border-radius: 10px; padding: 0.75rem 0.85rem; overflow-x: auto; line-height: 1.5; }
.ag-md pre code { background: none; border: 0; padding: 0; font-size: 0.85em; }

.ag-md a {
  color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2.5px;
  text-decoration-thickness: 1px; text-decoration-color: hsl(var(--primary) / 0.4);
  transition: text-decoration-color .15s ease; }
.ag-md a:hover { text-decoration-color: hsl(var(--primary)); }
.ag-md strong { font-weight: 700; }
.ag-md em { font-style: italic; }
.ag-md s, .ag-md del { color: hsl(var(--muted-foreground)); }

.ag-md blockquote {
  border-left: 3px solid hsl(var(--primary) / 0.35); background: hsl(var(--muted) / 0.3);
  padding: 0.4rem 0.85rem; border-radius: 0 8px 8px 0; color: hsl(var(--muted-foreground)); }
.ag-md blockquote > * { margin: 0; }

.ag-md table {
  border-collapse: collapse; font-size: 0.92em; display: block; overflow-x: auto;
  border: 1px solid hsl(var(--border) / 0.6); border-radius: 8px; }
.ag-md thead { background: hsl(var(--muted) / 0.45); }
.ag-md th, .ag-md td { border: 1px solid hsl(var(--border) / 0.5); padding: 0.42rem 0.6rem; text-align: left; }
.ag-md th { font-weight: 650; }
.ag-md tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.18); }

.ag-md hr { border: 0; border-top: 1px solid hsl(var(--border) / 0.6); margin: 0.9rem 0; height: 0; }
.opt-prose > * + * { margin-top: 1rem; }

.opt-prose h1 {
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid hsl(var(--border));
}
.opt-prose h2 {
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.014em;
  margin: 1.75rem 0 0.625rem; padding-bottom: 0.375rem;
  border-bottom: 1px solid hsl(var(--border) / 0.6);
}
.opt-prose h3 { font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; margin: 1.5rem 0 0.375rem; }
.opt-prose h4 { font-size: 0.95rem; font-weight: 600; margin: 1rem 0 0.25rem; }
.opt-prose h3::before {
  content: ""; display: inline-block;
  width: 3px; height: 0.85em; margin-right: 0.5rem;
  border-radius: 9999px; background: hsl(var(--primary) / 0.5);
  vertical-align: -1px;
}
.opt-prose > h1:first-child, .opt-prose > h2:first-child,
.opt-prose > h3:first-child, .opt-prose > h4:first-child { margin-top: 0; }

.opt-prose p { margin: 0; }
.opt-prose strong { font-weight: 600; color: hsl(var(--foreground)); }
.opt-prose em { font-style: italic; }
.opt-prose a {
  color: hsl(var(--primary));
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: hsl(var(--primary) / 0.4);
  transition: text-decoration-color 0.15s;
}
.opt-prose a:hover { text-decoration-color: hsl(var(--primary)); }
.opt-prose > p:first-child { font-size: 16.5px; }

.opt-prose ul { list-style: disc; padding-left: 1.25rem; margin: 0.5rem 0; }
.opt-prose ul ::marker { color: hsl(var(--muted-foreground)); }
.opt-prose ul > li + li, .opt-prose ol > li + li { margin-top: 0.375rem; }
.opt-prose ol { padding-left: 0; margin: 0.5rem 0; list-style: none; counter-reset: opt-ol; }
.opt-prose ol > li { position: relative; padding-left: 2.3rem; counter-increment: opt-ol; }
.opt-prose ol > li::before {
  content: counter(opt-ol) ".";
  position: absolute; left: 0; top: 0;
  width: 1.9rem; text-align: right; padding-right: 0.4rem;
  white-space: nowrap;
  font-weight: 600; color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums lining-nums;
  line-height: inherit;
}
.opt-prose ol ol { counter-reset: opt-ol-2; }
.opt-prose ol ol > li { counter-increment: opt-ol-2; padding-left: 2rem; }
.opt-prose ol ol > li::before { content: counter(opt-ol-2, lower-alpha) "."; }
.opt-prose ol ol ol { counter-reset: opt-ol-3; }
.opt-prose ol ol ol > li { counter-increment: opt-ol-3; }
.opt-prose ol ol ol > li::before { content: counter(opt-ol-3, lower-roman) "."; }
.opt-prose li { line-height: 1.7; }
.opt-prose li > p { margin: 0; }
.opt-prose li > p + p { margin-top: 0.5rem; }
.opt-prose li > ul, .opt-prose li > ol { margin: 0.5rem 0 0; }

.opt-prose blockquote {
  padding: 0.75rem 1rem; margin: 1rem 0;
  border-radius: 0 0.75rem 0.75rem 0;
  font-size: 15.5px; font-style: normal;
  color: hsl(var(--foreground) / 0.9);
  border-left: 3px solid hsl(var(--primary) / 0.55);
  background: hsl(var(--muted) / 0.5);
}
.opt-prose blockquote p { margin: 0.375rem 0; }
.opt-prose blockquote > :first-child { margin-top: 0; }
.opt-prose blockquote > :last-child { margin-bottom: 0; }

.opt-prose hr {
  margin: 1.75rem 0; border: 0; height: 1px;
  background: linear-gradient(to right, transparent, hsl(var(--border)), transparent);
}

.opt-table-wrap {
  margin: 1rem 0; width: 100%; overflow-x: auto;
  border-radius: 0.75rem; border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
}
.opt-prose table {
  width: 100%; font-size: 14.5px; border-collapse: collapse; margin: 0;
  font-variant-numeric: tabular-nums lining-nums;
}
.opt-prose thead { background: hsl(var(--muted) / 0.7); }
.opt-prose th {
  text-align: left; font-weight: 600; padding: 0.75rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground)); white-space: nowrap;
  letter-spacing: -0.005em;
}
.opt-prose td { padding: 0.75rem 1rem; border-bottom: 1px solid hsl(var(--border) / 0.5); vertical-align: top; }
.opt-prose tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.35); }
.opt-prose tbody tr:hover { background: hsl(var(--accent) / 0.6); }
.opt-prose tr:last-child td { border-bottom: 0; }

.opt-prose .opt-table-wrap table { width: auto; min-width: 100%; }
.opt-prose .opt-table-wrap th,
.opt-prose .opt-table-wrap td {
  min-width: 8.5rem; white-space: normal; overflow-wrap: anywhere; word-break: normal; hyphens: none;
}
.opt-prose .opt-table-wrap th { white-space: nowrap; }
.opt-prose .opt-table-wrap th:first-child,
.opt-prose .opt-table-wrap td:first-child { min-width: 0; white-space: nowrap; }

.opt-prose code {
  font-family: var(--font-mono); font-size: 0.88em;
  border-radius: 0.375rem; padding: 0.125rem 0.375rem;
  color: hsl(var(--foreground));
  background: hsl(var(--muted) / 0.8);
  border: 1px solid hsl(var(--border) / 0.7);
  font-feature-settings: "calt" 0;
}
.opt-prose h1 code, .opt-prose h2 code, .opt-prose h3 code { font-size: 0.9em; }

.opt-prose pre {
  margin: 0.85rem 0; overflow-x: auto;
  background: #2b303b; border-radius: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 0.95rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  color: #c7cdd9;
}
.opt-prose pre code {
  background: transparent; border: 0; padding: 0;
  font-size: 13px; line-height: 1.65; color: #c7cdd9;
  font-feature-settings: "calt" 0;
}

.opt-prose input[type="checkbox"] { vertical-align: middle; margin-right: 0.375rem; }
.opt-prose ul.contains-task-list { list-style: none; padding-left: 0.25rem; }


.opt-prose .bp-toc { border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.35); border-radius: 14px; padding: 20px 24px; margin: 1.75rem 0; }
.opt-prose .bp-toc-title { font-weight: 600; font-size: 14px; margin: 0 0 10px; color: hsl(var(--foreground)); }
.opt-prose .bp-toc ol { margin: 0; color: hsl(var(--muted-foreground)); }
.opt-prose .bp-stat { border-left: 3px solid hsl(var(--foreground)); background: hsl(var(--muted) / 0.4); border-radius: 0 12px 12px 0; padding: 18px 22px; margin: 1.75rem 0; }
.opt-prose .bp-stat-num { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; color: hsl(var(--foreground)); }
.opt-prose .bp-stat-cap { font-size: 14px; margin: 6px 0 0; color: hsl(var(--muted-foreground)); }
.opt-prose .bp-def { border-left: 3px solid hsl(var(--brand)); background: hsl(var(--brand) / 0.05); border-radius: 0 12px 12px 0; padding: 16px 20px; margin: 1.25rem 0 1.5rem; font-size: 16.5px; }
.opt-prose .bp-def p { margin: 0; }
.opt-prose .bp-quote { border-left: 3px solid hsl(var(--brand)); padding: 4px 0 4px 20px; margin: 2rem 0; font-size: 19px; font-weight: 600; font-style: italic; letter-spacing: -0.01em; color: hsl(var(--foreground)); }
.opt-prose .bp-callout { border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.35); border-radius: 12px; padding: 14px 18px; margin: 1.5rem 0; font-size: 15px; }
.opt-prose .bp-callout p { margin: 0; }
.opt-prose .bp-check { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: 14px; padding: 20px 24px; margin: 1.75rem 0; box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04); }
.opt-prose .bp-check-title { font-weight: 600; margin: 0 0 10px; color: hsl(var(--foreground)); }
.opt-prose .bp-cta { border: 1px solid hsl(var(--brand) / 0.3); background: hsl(var(--brand) / 0.05); border-radius: 12px; padding: 14px 18px; margin: 1.75rem 0; font-size: 15px; }
.opt-prose .bp-cta p { margin: 0; }
.opt-prose .bp-tablewrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid hsl(var(--border)); border-radius: 12px; }
.opt-prose .bp-tablewrap table { margin: 0; min-width: 100%; }

.opt-prose .bp-tablewrap th, .opt-prose .bp-tablewrap td { min-width: 160px; overflow-wrap: normal; word-break: normal; hyphens: none; white-space: normal; }
.opt-prose .bp-tablewrap td:first-child, .opt-prose .bp-tablewrap th:first-child { white-space: nowrap; min-width: 0; }
.opt-prose .bp-figure { margin: 2.25rem 0; border: 1px solid hsl(var(--border)); border-radius: 14px; padding: 18px 18px 12px; background: hsl(var(--card)); }
.opt-prose .bp-figure img { margin: 0; border-radius: 8px; }
.opt-prose .bp-note { font-size: 13.5px; color: hsl(var(--muted-foreground)); border-top: 1px solid hsl(var(--border)); padding-top: 14px; margin-top: 2.5rem; }
@media (max-width: 640px) {
  .blog-cover { aspect-ratio: 1 / 1 !important; }
}

.mk-product-shell {
  border: 1px solid hsl(var(--border) / 0.68);
  background:
    linear-gradient(180deg, hsl(var(--card) / 0.96), hsl(var(--background) / 0.96)),
    radial-gradient(circle at 16% 8%, hsl(var(--brand) / 0.10), transparent 18rem);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.55), 0 1px 2px hsl(var(--foreground) / 0.035);
}
.mk-command-line {
  border: 1px solid hsl(var(--border) / 0.74);
  background: hsl(var(--background) / 0.78);
}
.mk-flow-rule {
  background: linear-gradient(90deg, transparent, hsl(var(--brand) / 0.34), transparent);
}
.mk-subtle-card {
  border: 1px solid hsl(var(--border) / 0.68);
  background: hsl(var(--card) / 0.86);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.38);
}
.mk-subtle-card:hover,
.mk-link-soft:hover {
  border-color: hsl(var(--brand) / 0.38);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.38);
}
.auth-card {
  border: 1px solid hsl(var(--border) / 0.7);
  background: hsl(var(--card) / 0.96);
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04), inset 0 1px 0 hsl(0 0% 100% / 0.55);
}
.auth-code-input {
  width: min(100%, 18rem);
  margin-inline: auto;
  font-variant-numeric: tabular-nums;
  letter-spacing: .28em;
  padding-left: 1.1rem !important;
  padding-right: .8rem !important;
}
.auth-footer-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.otp-wrap {
  display: flex;
  gap: .5rem;
  justify-content: center;
  flex-wrap: nowrap;
}
.otp-box {
  width: 3rem;
  height: 3.5rem;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border: 1px solid hsl(var(--input));
  border-radius: .7rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  caret-color: hsl(var(--brand));
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.otp-box::placeholder { color: transparent; }
.otp-box.is-filled {
  border-color: hsl(var(--brand) / .55);
  background: hsl(var(--brand) / .04);
}
.otp-box:focus {
  outline: none;
  border-color: hsl(var(--brand));
  box-shadow: 0 0 0 3px hsl(var(--brand) / .15);
}
@media (max-width: 420px) {
  .otp-wrap { gap: .375rem; }
  .otp-box { width: 2.5rem; height: 3.1rem; font-size: 1.25rem; border-radius: .6rem; }
}
@media (max-width: 340px) {
  .otp-box { width: 2.15rem; height: 2.9rem; }
}
.captcha-shell {
  border: 0;
  background: transparent;
  border-radius: 0.75rem;
}
.pwm-wrap {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: opacity .24s ease, max-height .28s ease, transform .24s ease;
}
.pwm-wrap.active {
  opacity: 1;
  max-height: 7rem;
  transform: translateY(0);
}
@media (max-width: 640px) {
  .auth-card { border: 0; box-shadow: none; background: transparent; }
  .auth-code-input { letter-spacing: .18em; font-size: 1.35rem; }
  .auth-footer-links { flex-direction: column; align-items: flex-start; }
  .captcha-shell { padding-inline: .25rem; overflow-x: auto; }
}

@media (max-width: 767px) {
  #sidebar.app-sidebar-mobile {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    max-width: 84vw;
    transform: translateX(-100%);
    transition: transform .22s ease;
    z-index: 60;
    display: flex !important;
    
    background: hsl(var(--card));
  }
  #sidebar.app-sidebar-mobile.is-open {
    transform: translateX(0);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  }
  #sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 55;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
  }
  #sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
  body.mobile-nav-open { overflow: hidden; }
}


#sidebar [data-nav-overflow] { display: none; }
#sidebar nav.nav-expanded [data-nav-overflow] { display: block; }
#sidebar [data-nav-expand-toggle] { display: flex; }


@media (max-width: 1023px) {
  #sidebar [data-nav-pin] { display: inline-flex; }
}

.ag-railnav { width: 58px; }
@media (min-width: 1024px) { .ag-railnav { width: 212px; } }

@media (max-width: 1023px) {
  #flow-root { min-height: 60vh; }
  #build-log { min-height: 40vh; }
}

.ag-disclose > summary { list-style: none; }
.ag-disclose > summary::-webkit-details-marker { display: none; }
.ag-disclose[open] > summary .ag-disclose-chev { transform: rotate(90deg); }

.ag-md > * + table { margin-top: 0.8rem; }
.ag-md table { width: 100%; border-collapse: collapse; font-size: 0.92em; display: block; overflow-x: auto; }
.ag-md thead th { text-align: left; font-weight: 600; background: hsl(var(--muted) / 0.5); }
.ag-md th, .ag-md td { border: 1px solid hsl(var(--border) / 0.7); padding: 0.4rem 0.6rem; vertical-align: top; }
.ag-md tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.25); }
.ag-md blockquote {
  margin: 0.7rem 0 0; padding: 0.15rem 0 0.15rem 0.85rem;
  border-left: 3px solid hsl(var(--primary) / 0.45); color: hsl(var(--muted-foreground)); }
.ag-md blockquote > * + * { margin-top: 0.4rem; }
.ag-md hr { margin: 1rem 0; border: 0; border-top: 1px solid hsl(var(--border)); }
.ag-md img { max-width: 100%; height: auto; border-radius: 8px; margin-top: 0.6rem; }
.ag-md h1, .ag-md h2 { padding-bottom: 0.25rem; border-bottom: 1px solid hsl(var(--border) / 0.6); }

#mail-rail-divider { width: 5px; margin: 0 -2px; cursor: col-resize; flex-shrink: 0; position: relative; z-index: 5; background: transparent; }
#mail-rail-divider::after { content: ""; position: absolute; inset: 0 2px; background: hsl(var(--border)); transition: background .15s ease; }
#mail-rail-divider:hover::after, #mail-rail-divider.dragging::after { background: hsl(var(--primary)); }
body.mail-resizing { cursor: col-resize; user-select: none; }
@media (max-width: 1023px) {
  #mail-rail-divider { display: none; }
  #mail-folders-rail {
    display: flex !important; position: fixed; top: 0; bottom: 0; left: 0; z-index: 48;
    width: 272px; max-width: 84vw; transform: translateX(-104%); transition: transform .22s ease;
    box-shadow: 0 12px 40px rgba(0,0,0,.22); border-right: 1px solid hsl(var(--border));
    padding-top: calc(0.75rem + env(safe-area-inset-top));
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    padding-left: calc(0.5rem + env(safe-area-inset-left));
  }
  #mail-folders-rail.open { transform: translateX(0); }
  #mail-rail-backdrop.open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.42); }
}

.mail-xlsx table { border-collapse: collapse; font-size: 12.5px; color: hsl(var(--foreground)); width: max-content; }
.mail-xlsx td, .mail-xlsx th { border: 1px solid hsl(var(--border)); padding: 4px 9px; white-space: nowrap; }
.mail-xlsx tr:first-child td { background: hsl(var(--muted)); font-weight: 600; }
.mail-xlsx tr:nth-child(even) td { background: hsl(var(--muted) / 0.5); }

/* ============================================================================
   PRAXIVARA MAIL — component layer (mail-*). Solid-indigo brand accent used
   scarcely: active nav, unread signal, primary Send/Compose only. Everything
   else monochrome tokens. Dark-mode safe throughout. See [[praxivara-less-purple]].
   ============================================================================ */

/* folders / labels rail */
.mail-compose-btn { height: 40px; border-radius: 11px; border: 0; cursor: pointer;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); font-weight: 600; font-size: 13.5px;
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .15s ease; }
.mail-compose-btn:hover { opacity: 0.9; }
/* Folder / address / label rows run edge-to-edge in the rail (negative margin cancels its px-2), so the
   hover + active fill spans the FULL sidebar width. Accent bar sits flush on the left edge. */
.mail-nav-item { position: relative; display: flex; align-items: center; gap: 11px; height: 36px;
  margin: 0 -8px; width: calc(100% + 16px); box-sizing: border-box; padding: 0 12px 0 18px;
  border-radius: 0 8px 8px 0; font-size: 13px; font-weight: 500;
  color: hsl(var(--foreground)); cursor: pointer; transition: background .12s ease; }
.mail-nav-item > svg { color: hsl(var(--muted-foreground)); flex: 0 0 auto; }
.mail-nav-item:hover { background: hsl(var(--muted) / 0.6); }
.mail-nav-item.is-active { background: hsl(var(--brand-soft)); color: hsl(var(--brand)); }
.mail-nav-item.is-active > svg { color: hsl(var(--brand)); }
.mail-nav-item.is-active::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 3px 3px 0; background: hsl(var(--brand)); }
.mail-nav-count { margin-left: auto; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground)); }
.mail-nav-item.is-active .mail-nav-count { color: hsl(var(--brand)); }
.mail-sec-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 6px; padding: 0 11px;
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
.mail-sec-head button { border: 0; background: none; color: hsl(var(--muted-foreground)); cursor: pointer;
  width: 18px; height: 18px; border-radius: 5px; display: grid; place-items: center; }
.mail-sec-head button:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
/* addr + label rows share the folder-row full-bleed geometry (edge-to-edge fill, flush accent bar) */
.mail-addr-item { position: relative; display: flex; align-items: center; gap: 9px; height: 30px;
  margin: 0 -8px; width: calc(100% + 16px); box-sizing: border-box; padding: 0 12px 0 18px; border-radius: 0 8px 8px 0;
  font-size: 11.5px; cursor: pointer; color: hsl(var(--muted-foreground)); transition: background .12s ease; }
.mail-addr-item:hover { background: hsl(var(--muted) / 0.6); }
.mail-addr-item.is-active { background: hsl(var(--muted)); color: hsl(var(--foreground)); font-weight: 500; }
.mail-label-item { position: relative; display: flex; align-items: center; gap: 10px; height: 30px;
  margin: 0 -8px; width: calc(100% + 16px); box-sizing: border-box; padding: 0 12px 0 18px; border-radius: 0 8px 8px 0;
  font-size: 12.5px; cursor: pointer; color: hsl(var(--foreground)); transition: background .12s ease; }
.mail-label-item:hover { background: hsl(var(--muted) / 0.6); }
.mail-label-item.is-active { background: hsl(var(--muted)); font-weight: 500; }
.mail-addr-item.is-active::before, .mail-label-item.is-active::before { content: ""; position: absolute; left: 0;
  top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: hsl(var(--muted-foreground)); }
/* touch: label edit/delete is the only editing path but is hover-gated — always reveal it on coarse pointers */
@media (hover: none) {
  .mail-label-item [data-editlabel] { display: grid !important; }
  .mail-label-item [class*="group-hover:hidden"] { display: none; }
}

/* label color classes — dark-mode safe (chip text lightens in dark) */
.mlc { --lh: 215; --ls: 12%; }
.mlc-slate { --lh: 215; --ls: 14%; } .mlc-red { --lh: 0; --ls: 72%; } .mlc-orange { --lh: 25; --ls: 90%; }
.mlc-amber { --lh: 38; --ls: 90%; } .mlc-green { --lh: 142; --ls: 62%; } .mlc-teal { --lh: 172; --ls: 60%; }
.mlc-sky { --lh: 199; --ls: 85%; } .mlc-blue { --lh: 217; --ls: 88%; } .mlc-indigo { --lh: 239; --ls: 80%; }
.mlc-violet { --lh: 258; --ls: 85%; } .mlc-fuchsia { --lh: 292; --ls: 80%; } .mlc-pink { --lh: 330; --ls: 78%; }
.mail-ldot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; background: hsl(var(--lh) var(--ls) 50%); }
.mail-lchip { display: inline-flex; align-items: center; gap: 5px; height: 19px; padding: 0 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 500; max-width: 160px; background: hsl(var(--lh) var(--ls) 50% / 0.15); color: hsl(var(--lh) var(--ls) 36%); }
.dark .mail-lchip { color: hsl(var(--lh) var(--ls) 74%); background: hsl(var(--lh) var(--ls) 50% / 0.2); }
.mail-lchip .mail-ldot { width: 6px; height: 6px; }
.mail-lchip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-lchip button { color: inherit; opacity: .6; } .mail-lchip button:hover { opacity: 1; }

/* hue-hashed avatar — dark-mode aware (JS sets --ah) */
.mail-av { border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-weight: 600;
  background: hsl(var(--ah, 240) 55% 90%); color: hsl(var(--ah, 240) 42% 34%); }
.dark .mail-av { background: hsl(var(--ah, 240) 30% 24%); color: hsl(var(--ah, 240) 68% 80%); }

/* list header, search, tabs */
.mail-search { flex: 1; position: relative; }
.mail-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: hsl(var(--muted-foreground)); }
.mail-search input { width: 100%; height: 34px; border: 0; border-radius: 9px; background: hsl(var(--muted) / 0.6);
  padding: 0 12px 0 32px; font-size: 12.5px; color: hsl(var(--foreground)); outline: none; }
.mail-search input:focus { background: hsl(var(--muted)); box-shadow: 0 0 0 1px hsl(var(--border)); }
.mail-iconbtn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: hsl(var(--muted-foreground));
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: background .12s ease; }
.mail-iconbtn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mail-tabs { display: flex; gap: 4px; padding: 7px 10px; border-bottom: 1px solid hsl(var(--border)); }
.mail-tab { height: 28px; padding: 0 12px; border-radius: 8px; border: 0; background: none; font-size: 12px; font-weight: 500;
  color: hsl(var(--muted-foreground)); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.mail-tab:hover { background: hsl(var(--muted) / 0.6); color: hsl(var(--foreground)); }
.mail-tab.is-active { background: hsl(var(--brand-soft)); color: hsl(var(--brand)); font-weight: 600; }
.mail-tab-pill { font-size: 10px; background: hsl(var(--brand) / 0.16); color: hsl(var(--brand)); border-radius: 20px; padding: 1px 6px; font-weight: 600; }

/* list rows */
.mail-row { position: relative; display: flex; gap: 11px; padding: 11px 14px;
  cursor: pointer; transition: background .1s ease; }
.mail-row:hover { background: hsl(var(--muted) / 0.4); }
.mail-row.is-open { background: hsl(var(--muted) / 0.6); }
.mail-row.is-selected { background: hsl(var(--brand-soft)); }
.mail-row-gutter { width: 8px; flex: 0 0 auto; display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; }
.mail-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--brand)); }
.mail-row-star { flex: 0 0 auto; color: hsl(var(--muted-foreground) / 0.4); background: none; border: 0; cursor: pointer; padding: 0; }
.mail-row:hover .mail-row-star { color: hsl(var(--muted-foreground)); }
/* Reader-header star isn't inside a .mail-row, so it never gets the hover-brighten — give it a legible idle. */
.mail-row-star.mail-reader-star { color: hsl(var(--muted-foreground)); }
.mail-row-star.is-on, .mail-row-star:hover { color: hsl(38 92% 50%); }
/* Coarse pointer: the list-row star is the main always-visible row action, so give it a 44px hit area
   (negative margins keep row height + right-edge alignment). Scoped to .mail-row so the reader star is untouched. */
@media (pointer: coarse) {
  .mail-row .mail-row-star { min-width: 44px; min-height: 44px; margin: -6px -8px -6px 0; display: grid; place-items: center; }
}
.mail-check { width: 18px; height: 18px; border-radius: 5px; border: 1.6px solid hsl(var(--border)); flex: 0 0 auto;
  cursor: pointer; display: grid; place-items: center; color: transparent; background: hsl(var(--card)); transition: all .1s ease; }
.mail-check:hover { border-color: hsl(var(--brand)); }
.mail-check.is-on { background: hsl(var(--brand)); border-color: hsl(var(--brand)); color: #fff; }
.mail-check-overlay { opacity: 0; transition: opacity .1s ease; }
.mail-row:hover .mail-check-overlay, .mail-row.is-selected .mail-check-overlay { opacity: 1; }
.mail-row:hover .mail-av, .mail-row.is-selected .mail-av { opacity: 0; }
/* Touch has no :hover — surface the select checkbox on every row so multi-select is discoverable
   (mirrors the hover swap: hide the row avatar, reveal the 18px check). Scoped to the row's own avatar. */
@media (hover: none) {
  .mail-row .mail-check-overlay { opacity: 1; }
  .mail-row [data-selrow] > .mail-av { opacity: 0; }
}
.mail-row-actions { position: absolute; right: 10px; top: 8px; display: none; align-items: center; gap: 2px;
  background: hsl(var(--card) / 0.96); backdrop-filter: blur(4px); border-radius: 9px; padding: 2px; box-shadow: 0 2px 10px -2px rgba(0,0,0,.18); }
.mail-row:hover .mail-row-actions { display: flex; }
.mail-row:hover .mail-row-time { visibility: hidden; }
.mail-row-actions button { width: 28px; height: 28px; border-radius: 7px; border: 0; background: none; color: hsl(var(--muted-foreground));
  display: grid; place-items: center; cursor: pointer; }
.mail-row-actions button:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mail-row-actions button.is-danger:hover { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }

/* bulk selection bar */
.mail-bulk { display: flex; align-items: center; gap: 4px; padding: 8px 12px; border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--card));
  flex-wrap: nowrap; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.mail-bulk::-webkit-scrollbar { display: none; }
.mail-bulk-n { font-size: 12.5px; font-weight: 600; margin-right: 4px; flex: 0 0 auto; }
.mail-bulk button { height: 30px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: hsl(var(--foreground));
  font-size: 12px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.mail-bulk button:hover { background: hsl(var(--muted)); }
.mail-bulk button.is-danger { color: hsl(var(--destructive)); }
.mail-bulk .mail-bulk-x { width: 30px; padding: 0; justify-content: center; }

/* reader toolbar (clustered) */
.mail-toolbar { display: flex; align-items: center; gap: 2px; padding: 9px 12px; border-bottom: 1px solid hsl(var(--border)); }
.mail-tb-sep { width: 1px; height: 20px; background: hsl(var(--border)); margin: 0 5px; flex: 0 0 auto; }
.mail-tb-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: hsl(var(--muted-foreground));
  display: grid; place-items: center; cursor: pointer; flex: 0 0 auto; transition: background .12s ease; }
.mail-tb-btn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.mail-tb-btn.is-danger:hover { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }

/* message count chip */
.mail-mcount { font-size: 11px; color: hsl(var(--muted-foreground)); background: hsl(var(--muted)); border-radius: 20px;
  padding: 2px 9px; font-weight: 500; flex: 0 0 auto; }

/* sender HTML body — stays on a white card even in dark so sender colors read */
.mail-html-body { border: 1px solid hsl(var(--border)); border-radius: 12px; background: #fff; overflow: hidden; }
.mail-html-body iframe { display: block; width: 100%; border: 0; background: #fff; }
.mail-img-bar { display: flex; align-items: center; gap: 7px; width: 100%; padding: 7px 12px; border: 0;
  border-bottom: 1px solid hsl(var(--border)); background: hsl(var(--muted) / 0.55); font-size: 11.5px;
  color: hsl(var(--muted-foreground)); cursor: pointer; text-align: left; }
.mail-img-bar:hover { background: hsl(var(--muted)); }
.mail-img-bar svg { flex: 0 0 auto; }
.mail-img-show { color: hsl(var(--brand)); font-weight: 600; }

/* attachment chips */
.mail-att { display: inline-flex; align-items: center; gap: 9px; border: 1px solid hsl(var(--border)); border-radius: 11px;
  background: hsl(var(--card)); padding: 6px 12px 6px 7px; cursor: pointer; max-width: 100%; text-align: left; transition: all .12s ease; }
.mail-att:hover { background: hsl(var(--muted) / 0.5); border-color: hsl(var(--foreground) / 0.2); }
.mail-att-thumb { width: 36px; height: 36px; border-radius: 8px; background: hsl(var(--muted)); display: grid; place-items: center;
  color: hsl(var(--muted-foreground)); flex: 0 0 auto; overflow: hidden; }
.mail-att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mail-att-prev { color: hsl(var(--brand)); font-weight: 600; }

/* reply dock */
.mail-reply-open { flex: 1; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border-radius: 14px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 13px; cursor: pointer; }
.mail-reply-open:hover { background: hsl(var(--muted) / 0.5); }
.mail-reply-mini { width: 46px; height: 46px; border-radius: 14px; border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  display: grid; place-items: center; color: hsl(var(--muted-foreground)); cursor: pointer; flex: 0 0 auto; }
.mail-reply-mini:hover { background: hsl(var(--muted) / 0.5); color: hsl(var(--foreground)); }

/* composer — recipient chips, format bar, solid send */
.mail-recip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 3px; border-radius: 20px;
  background: hsl(var(--muted)); font-size: 12px; max-width: 100%; }
.mail-recip .ra { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 9px; font-weight: 600; flex: 0 0 auto; }
.mail-recip .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-recip .rx { width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; color: hsl(var(--muted-foreground));
  cursor: pointer; border: 0; background: none; flex: 0 0 auto; }
.mail-recip .rx:hover { background: hsl(var(--foreground) / 0.1); color: hsl(var(--foreground)); }
.mail-recip.is-bad { background: hsl(var(--destructive) / 0.12); color: hsl(var(--destructive)); }
/* recipient autocomplete (from prior contacts) */
.mail-ac { position: fixed; z-index: 60; max-height: 264px; overflow-y: auto; padding: 4px;
  background: hsl(var(--popover, var(--card))); border: 1px solid hsl(var(--border)); border-radius: 12px;
  box-shadow: 0 12px 34px -10px rgba(0,0,0,.32); }
.mail-ac-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border-radius: 8px;
  border: 0; background: none; cursor: pointer; text-align: left; color: hsl(var(--foreground)); }
.mail-ac-item.is-on, .mail-ac-item:hover { background: hsl(var(--muted)); }
.mail-fmt-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: hsl(var(--foreground));
  display: grid; place-items: center; cursor: pointer; font-size: 13px; flex: 0 0 auto; }
.mail-fmt-btn:hover { background: hsl(var(--muted)); }
.mail-fmt-sep { width: 1px; height: 20px; background: hsl(var(--border)); margin: 0 6px; flex: 0 0 auto; }
.mail-send { height: 36px; padding: 0 18px; border-radius: 10px; border: 0; color: hsl(var(--primary-foreground)); font-weight: 600;
  font-size: 13px; background: hsl(var(--primary)); display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  transition: opacity .15s ease; }
.mail-send:hover { opacity: 0.9; } .mail-send:disabled { opacity: .6; cursor: default; }

/* tokenized danger — JS controls route here instead of raw text-red-600 so the red tracks dark mode */
.mail-danger { color: hsl(var(--destructive)); }
.mail-danger:hover { background: hsl(var(--destructive) / 0.1); }
.mail-chip-x:hover { color: hsl(var(--destructive)); }

/* keyboard focus ring across the whole compose/reply surface (WCAG 2.4.7). ID selectors also reach the
   runtime-injected inline-reply fields, which don't carry the composer ids until they render. */
#mail-compose-to:focus-visible, #mail-compose-cc:focus-visible, #mail-compose-bcc:focus-visible,
#mail-compose-subject:focus-visible, #mail-compose-body:focus-visible,
#mail-reply-to:focus-visible {
  box-shadow: 0 0 0 2px hsl(var(--brand) / 0.4); border-radius: 6px; }
/* the reply body is w-full flush inside an overflow-hidden card, so an OUTSET ring gets clipped
   left/right — inset it so the whole frame stays visible on keyboard focus */
#mail-reply-body:focus-visible { box-shadow: inset 0 0 0 2px hsl(var(--brand) / 0.4); border-radius: 6px; }
.mail-fmt-btn:focus-visible, .mail-send:focus-visible, .mail-iconbtn:focus-visible, .mail-tb-btn:focus-visible {
  outline: 2px solid hsl(var(--brand)); outline-offset: 2px; }

/* spam / trash banner */
.mail-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border)); font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.mail-banner.is-spam { background: hsl(38 92% 50% / 0.1); }
.mail-banner .mail-banner-act { margin-left: auto; color: hsl(var(--destructive)); font-weight: 600; background: none; border: 0; cursor: pointer; }
.mail-banner .mail-banner-act:hover { text-decoration: underline; }

/* attachment lightbox — retokenized (still on a dark scrim, but doc surfaces use tokens) */
.mail-lightbox-doc { background: hsl(var(--card)); color: hsl(var(--foreground)); }
.mail-lightbox-doc pre { color: hsl(var(--foreground)); }
.mail-lightbox-tabs { background: hsl(var(--muted)); border-bottom: 1px solid hsl(var(--border)); }
.mail-lightbox-tab { color: hsl(var(--muted-foreground)); }
.mail-lightbox-tab.is-on { background: hsl(var(--card)); color: hsl(var(--foreground)); box-shadow: 0 1px 2px rgba(0,0,0,.1); font-weight: 500; }

/* mobile swipe */
.mail-swipe-wrap { position: relative; overflow: hidden; border-bottom: 1px solid hsl(var(--border)); }
.mail-swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 22px; color: #fff; font-weight: 600; font-size: 13px; gap: 8px; }
.mail-swipe-bg.arch { background: hsl(var(--brand)); justify-content: flex-start; }
.mail-swipe-bg.tras { background: hsl(var(--destructive)); justify-content: flex-end; }
.mail-swipe-fg { position: relative; background: hsl(var(--card)); transition: transform .18s ease; will-change: transform; }
.mail-swipe-fg.no-anim { transition: none; }
@media (min-width: 1024px) { .mail-swipe-bg { display: none; } }

.app-shell-root { min-height: 100vh; height: 100vh; min-height: 100dvh; height: 100dvh; height: var(--app-h, 100dvh); }
body.route-chat main { overflow: hidden; }

.safe-t { padding-top: env(safe-area-inset-top); }
.safe-b { padding-bottom: env(safe-area-inset-bottom); }
.safe-l { padding-left: env(safe-area-inset-left); }
.safe-r { padding-right: env(safe-area-inset-right); }
.safe-x { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.safe-pb { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .safe-pb { padding-bottom: 1rem; } }

.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

.page-pad { padding: 1rem; padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
@media (min-width: 640px)  { .page-pad { padding: 1.25rem 1.5rem; } }
@media (min-width: 1024px) { .page-pad { padding: 1.5rem 2rem; } }

.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
.stat-grid { display: grid; gap: .75rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 640px)  { .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }

@media (max-width: 767px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select, .modal-input-16 { font-size: 16px; }
}


:where(.tap) { display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse) {
  .tap, .tap-coarse { min-height: 44px; min-width: 44px; }
}

@media (max-width: 767px) {
  .stack-table thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: .5rem .8rem; margin-bottom: .75rem; background: hsl(var(--card)); }
  .stack-table td { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .45rem 0; border: 0 !important; text-align: right; min-height: 40px; }
  .stack-table td::before { content: attr(data-label); font-weight: 600; color: hsl(var(--muted-foreground)); text-align: left; margin-right: auto; }
  .stack-table td:empty { display: none; }
}

.filter-select { width: 100%; height: 44px; border: 1px solid hsl(var(--input)); border-radius: var(--radius); background: hsl(var(--background)); color: hsl(var(--foreground)); padding: 0 2.25rem 0 .875rem; font-size: 16px; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'><path d='m6 9 6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right .75rem center; }

.seg-scroll { display: flex; gap: .5rem; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; -ms-overflow-style: none; scrollbar-width: none; }
.seg-scroll::-webkit-scrollbar { display: none; }
.seg-scroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.seg-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .375rem; min-height: 44px; padding: 0 .95rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.seg-chip:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.seg-chip.is-active { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: hsl(var(--foreground)); }

.cat-rail { display: flex; gap: .5rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cat-rail::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) { .cat-rail { flex-direction: column; gap: .125rem; overflow-x: visible; overflow-y: auto; padding-right: .25rem; flex: 1 1 0%; min-height: 0; } }

.fixed.inset-0, .sheet-modal { margin: 0 !important; }

@media (max-width: 767px) {
  .sheet-modal { position: fixed !important; left: 0 !important; right: 0 !important; bottom: 0 !important; top: auto !important; transform: none !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; border-radius: 1rem 1rem 0 0 !important; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(1rem + env(safe-area-inset-bottom)) !important; }
  .sheet-modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 999px; background: hsl(var(--border)); margin: 0 auto .75rem; }

  .sheet-full { position: fixed !important; inset: 0 !important; transform: none !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; height: 100dvh !important; max-height: 100dvh !important; border-radius: 0 !important; }
}

@media (max-width: 1023px) {
  .md-detail { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; z-index: 44; background: hsl(var(--background)); transform: translateX(100%); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); }
  .md-detail.is-open { display: flex !important; transform: translateX(0); }
  body.md-detail-open { overflow: hidden; }
}


#channels-modal .ch-backdrop { opacity: 0; transition: opacity .2s ease; }
#channels-modal.is-open .ch-backdrop { opacity: 1; }

#channels-modal .ch-panel { opacity: 0; transform: translateY(10px) scale(.985); transition: opacity .18s ease, transform .18s ease; }
#channels-modal.is-open .ch-panel { opacity: 1; transform: none; }

#channels-modal .ch-body { overscroll-behavior: contain; }
@media (min-width: 640px) { #channels-modal [data-ch-nav] { gap: .125rem; } }

@media (max-width: 639.98px) {
  
  #channels-modal { padding: 0; }
  #channels-modal .ch-panel {
    position: fixed; inset: 0;
    width: 100%; max-width: none; margin: 0;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0; border-width: 0;
    opacity: 1; transform: translateY(100%);
    transition: transform .30s cubic-bezier(.32, .72, 0, 1);
  }
  #channels-modal.is-open .ch-panel { transform: translateY(0); }
}

body.ch-open { overflow: hidden; }


#channels-modal .ch-body { min-height: 0; -webkit-overflow-scrolling: touch; }


.ch-mark { display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; border-radius: 10px; background: hsl(var(--muted-foreground)); box-shadow: inset 0 0 0 1px hsl(0 0% 100% / .18), 0 1px 2px hsl(240 10% 9% / .16); }

.ch-tab { display: flex; align-items: center; gap: .625rem; flex: 0 0 auto; min-height: 44px; padding: .5rem .875rem; border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--card)); color: hsl(var(--muted-foreground)); font-size: 13.5px; font-weight: 500; text-align: left; white-space: nowrap; transition: background .12s, color .12s, border-color .12s; }
.ch-tab:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.ch-tab.is-active { background: hsl(var(--accent)); color: hsl(var(--foreground)); font-weight: 600; }
@media (min-width: 640px) {
  .ch-tab { width: 100%; padding: .5rem .625rem; border-radius: var(--radius); border-color: transparent; background: transparent; }
  .ch-tab:hover { background: hsl(var(--muted)); }
  .ch-tab.is-active { background: hsl(var(--accent)); border-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
  #channels-modal .ch-backdrop, #channels-modal .ch-panel { transition: none; }
}


.ch-openbtn {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  min-height: 54px; padding: .75rem 1rem; border-radius: 14px;
  background: var(--ch, hsl(var(--primary))); color: #fff;
  font-size: 15px; font-weight: 650; letter-spacing: -0.01em; text-decoration: none;
  box-shadow: 0 1px 2px hsl(240 10% 9% / .12), 0 8px 20px -8px var(--ch, hsl(240 10% 9% / .35));
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
}
.ch-openbtn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.ch-openbtn:active { transform: translateY(0); filter: brightness(.97); }
.ch-openbtn:focus-visible { outline: 2px solid var(--ch, hsl(var(--primary))); outline-offset: 2px; }
.ch-openbtn-ic {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px;
  background: hsl(0 0% 100% / .22); color: #fff;
  box-shadow: inset 0 0 0 1px hsl(0 0% 100% / .18);
}
.ch-openbtn-txt { flex: 1 1 auto; min-width: 0; text-align: left; }
.ch-openbtn-arrow { flex: none; opacity: .9; }


.ch-fold { border-top: 1px solid hsl(var(--border)); padding-top: .875rem; }
.ch-fold-sum {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .375rem;
  font-size: 12.5px; font-weight: 500; color: hsl(var(--muted-foreground));
  padding: .125rem 0; user-select: none;
}
.ch-fold-sum::-webkit-details-marker { display: none; }
.ch-fold-sum::before {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .15s ease;
}
.ch-fold[open] .ch-fold-sum::before { transform: rotate(90deg); }
.ch-fold-sum:hover { color: hsl(var(--foreground)); }

.sticky-composer { position: sticky; bottom: 0; z-index: 20; background: hsl(var(--card)); border-top: 1px solid hsl(var(--border)); padding: .625rem .75rem calc(.625rem + env(safe-area-inset-bottom)); }
.chat-composer-bar { padding-bottom: max(.5rem, env(safe-area-inset-bottom)); }

.top-tabs { display: flex; gap: .25rem; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; }
.top-tabs::-webkit-scrollbar { display: none; }
.top-tabs > * { flex: 0 0 auto; min-height: 44px; scroll-snap-align: start; }

@media (max-width: 767px) {
  #sidebar.app-sidebar-mobile { padding-top: env(safe-area-inset-top); }
  #sidebar.app-sidebar-mobile #sidebar-chats, #sidebar.app-sidebar-mobile #sidebar-agents { overscroll-behavior: contain; }
  #user-menu { left: .5rem; right: .5rem; width: auto; bottom: calc(.75rem + env(safe-area-inset-bottom)); }
}

 bg-linear-to-* are normalized to
   v3.4 equivalents during component adaptation, so only these live here.)
   ===================================================================== */
.outline-hidden { outline: 2px solid transparent; outline-offset: 2px; }
.shadow-2xs { --tw-shadow: 0 1px rgb(0 0 0 / 0.05); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }
.shadow-xs  { --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }
.dark .dark\:shadow-none { --tw-shadow: 0 0 #0000; box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); }


.tool-group > summary { list-style: none; }
.tool-group > summary::-webkit-details-marker { display: none; }
.tool-group[open] .tool-group-chev { transform: rotate(180deg); }


.kit-mail[open] .kit-mail-chev { transform: rotate(180deg); }

.kit-mail-row[open] .kit-mail-chev { transform: rotate(180deg); }




.drv { padding: 1rem; height: 100%; overflow: hidden; display: flex; flex-direction: column; }
@media (min-width: 768px) { .drv { padding: 1.25rem 1.5rem 1rem; } }
@media (min-width: 900px) {
  .drv { display: grid; grid-template-columns: 15rem minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr); gap: 1.75rem; }
}
.drv-main { min-width: 0; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; }
.drv-head { flex: 0 0 auto; }
.drv-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; }
@media (min-width: 900px) { .drv-rail { margin: 0; } .drv-rail .drv-quota { margin-top: auto; } }


.drv-rail { display: flex; flex-direction: column; gap: 1rem; flex: 0 0 auto; }
@media (min-width: 900px) { .drv-rail { position: sticky; top: 1rem; } }
.drv-lenses { display: flex; flex-direction: column; gap: .2rem; }
@media (max-width: 899px) {
  .drv-lenses { flex-direction: row; overflow-x: auto; gap: .5rem; padding-bottom: .15rem;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .drv-lenses::-webkit-scrollbar { display: none; }
}

.drv-lens {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  padding: .5rem .6rem; border-radius: var(--radius); cursor: pointer;
  border: 0; background: transparent; color: hsl(var(--foreground) / .85);
  font-size: .875rem; transition: background .15s, color .15s;
}
.drv-lens:hover { background: hsl(var(--muted) / .6); color: hsl(var(--foreground)); }
.drv-lens.is-active { background: hsl(var(--accent)); color: hsl(var(--foreground)); }
@media (max-width: 899px) { .drv-lens { flex: 0 0 auto; width: auto; } }
.drv-lens-ic {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  color: hsl(var(--muted-foreground));
}
.drv-lens.is-active .drv-lens-ic { color: hsl(var(--foreground)); }
.drv-lens-ic svg { width: 1.1rem; height: 1.1rem; }
.drv-lens-body { flex: 1 1 auto; min-width: 0; }
.drv-lens-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drv-lens.is-active .drv-lens-name { font-weight: 600; }


.drv-drop.hidden,
.drv-selbar.hidden,
.drv-empty.hidden,
.drv-more.hidden { display: none; }


.drv-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.drv-toolbar .drv-tb-grow { flex: 1 1 12rem; min-width: 0; }
.drv-search {
  display: flex; align-items: center; gap: .5rem; width: 100%;
  height: 2.25rem; padding: 0 .7rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--muted-foreground)); transition: border-color .15s, box-shadow .15s;
}
.drv-search:hover { border-color: hsl(var(--foreground) / .22); }
.drv-search:focus-within {
  border-color: hsl(var(--brand));
  box-shadow: 0 0 0 3px hsl(var(--brand) / .15);
}
.drv-search input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none;
  font-size: .875rem; color: hsl(var(--foreground));
}
.drv-search input::placeholder { color: hsl(var(--muted-foreground)); }
.drv-search .drv-search-clear { display: none; }
.drv-search.is-filled .drv-search-clear { display: inline-flex; }


.drv-icobtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 2.25rem; width: 2.25rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--muted-foreground)); cursor: pointer; flex: 0 0 auto;
  transition: background .15s, color .15s, border-color .15s;
}
.drv-icobtn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.drv-btn {
  display: inline-flex; align-items: center; gap: .4rem; height: 2.25rem;
  padding: 0 .85rem; border-radius: var(--radius); font-size: .8125rem;
  font-weight: 600; cursor: pointer; flex: 0 0 auto; white-space: nowrap;
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--foreground)); transition: background .15s, border-color .15s, opacity .15s;
}
.drv-btn:hover { background: hsl(var(--muted)); }
.drv-btn--primary {
  border-color: transparent; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.drv-btn--primary:hover { background: hsl(var(--primary)); opacity: .9; }


.drv-seg {
  display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto;
  padding: 2px; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .5);
}
.drv-seg button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.85rem; width: 2rem; border-radius: calc(var(--radius) - 4px);
  color: hsl(var(--muted-foreground)); cursor: pointer; transition: background .15s, color .15s;
}
.drv-seg button:hover { color: hsl(var(--foreground)); }
.drv-seg button.is-active {
  background: hsl(var(--card)); color: hsl(var(--foreground));
  box-shadow: 0 1px 2px hsl(240 10% 9% / .08);
}
.drv-select {
  height: 2.25rem; padding: 0 2rem 0 .7rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
  color: hsl(var(--foreground)); font-size: .8125rem; font-weight: 500;
  cursor: pointer; flex: 0 0 auto;
  
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center;
  -webkit-appearance: none; appearance: none;
}


.drv-quota {
  padding: .85rem .9rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--card));
}
.drv-quota-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  font-size: .78rem; margin-bottom: .45rem;
}
.drv-quota-top b { color: hsl(var(--foreground)); font-weight: 600; }
.drv-quota-top span { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.drv-quota-track {
  height: 6px; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden;
}
.drv-quota-fill {
  height: 100%; border-radius: 999px; width: 0;
  background: linear-gradient(90deg, hsl(var(--brand)), hsl(var(--brand-2)));
  transition: width .4s ease;
}
.drv-quota-link {
  display: inline-block; margin-top: .6rem; font-size: .74rem; font-weight: 600;
  color: hsl(var(--primary));
}
.drv-quota-link:hover { text-decoration: underline; }
.drv-quota.is-over .drv-quota-fill { background: hsl(var(--destructive)); }
.drv-quota.is-over .drv-quota-top span { color: hsl(var(--destructive)); }


.drv-crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: .1rem;
  margin: .1rem 0 .6rem; font-size: .9rem; min-height: 1.75rem;
}
.drv-crumb {
  display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .45rem;
  border-radius: 7px; color: hsl(var(--muted-foreground)); cursor: pointer;
  background: transparent; border: 0; font-size: .9rem; max-width: 16rem;
  transition: background .15s, color .15s;
}
.drv-crumb:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.drv-crumb.is-current { color: hsl(var(--foreground)); font-weight: 600; cursor: default; }
.drv-crumb.is-current:hover { background: transparent; }
.drv-crumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-crumb-sep { color: hsl(var(--muted-foreground) / .6); flex: 0 0 auto; }


.drv-selbar {
  display: flex; align-items: center; gap: .5rem; margin: .35rem 0 .1rem;
  padding: .45rem .5rem .45rem .8rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--brand) / .35); background: hsl(var(--brand) / .07);
}
.drv-selbar-count { font-size: .82rem; font-weight: 600; color: hsl(var(--foreground)); flex: 0 0 auto; }
.drv-selbar-spacer { flex: 1 1 auto; }
.drv-selbar .drv-act {
  display: inline-flex; align-items: center; gap: .35rem; height: 2rem; padding: 0 .6rem;
  border-radius: 8px; font-size: .8rem; font-weight: 500; cursor: pointer;
  color: hsl(var(--foreground)); background: hsl(var(--card));
  border: 1px solid hsl(var(--border)); transition: background .15s;
}
.drv-selbar .drv-act:hover { background: hsl(var(--muted)); }
.drv-selbar .drv-act--danger { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / .3); }
.drv-selbar .drv-act--danger:hover { background: hsl(var(--destructive) / .1); }


.drv-items { margin-top: .5rem; position: relative; }
.drv-ic {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  --h: 240; --s: 6%; --l: 45%;
  background: hsl(var(--h) var(--s) var(--l) / .16); color: hsl(var(--h) var(--s) var(--l));
}
.drv-ic svg { width: 55%; height: 55%; }
.drv-ic--folder { --h: 205; --s: 90%; --l: 52%; }
.drv-ic--image  { --h: 217; --s: 88%; --l: 58%; }
.drv-ic--pdf    { --h: 4;   --s: 82%; --l: 58%; }
.drv-ic--doc    { --h: 221; --s: 78%; --l: 60%; }
.drv-ic--sheet  { --h: 146; --s: 62%; --l: 42%; }
.drv-ic--slides { --h: 25;  --s: 90%; --l: 55%; }
.drv-ic--audio  { --h: 280; --s: 66%; --l: 62%; }
.drv-ic--video  { --h: 330; --s: 72%; --l: 60%; }
.drv-ic--archive{ --h: 40;  --s: 86%; --l: 50%; }
.drv-ic--code   { --h: 190; --s: 80%; --l: 45%; }
.drv-ic--file   { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }


.drv-prov {
  display: inline-flex; align-items: center; gap: .3rem; max-width: 100%;
  padding: .1rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 600;
  color: hsl(var(--muted-foreground)); background: hsl(var(--muted));
  text-decoration: none; border: 1px solid transparent; overflow: hidden;
}
a.drv-prov:hover { color: hsl(var(--foreground)); border-color: hsl(var(--border)); }
.drv-prov svg { width: .72rem; height: .72rem; flex: 0 0 auto; }
.drv-prov span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .4rem;
  border-radius: 999px; font-size: .66rem; font-weight: 700; flex: 0 0 auto;
}
.drv-badge svg { width: .7rem; height: .7rem; }
.drv-badge--kept { color: hsl(var(--brand)); background: hsl(var(--brand) / .12); }
.drv-badge--star { color: hsl(38 92% 45%); background: hsl(38 92% 50% / .14); }
.drv-badge--gone { color: hsl(var(--muted-foreground)); background: hsl(var(--muted-foreground) / .12); }


.drv-listhead, .drv-row {
  display: grid; align-items: center; gap: .75rem;
  grid-template-columns: 2.25rem minmax(0, 1fr) 8rem 6rem 2.25rem;
}
.drv-listhead {
  padding: .35rem .75rem; font-size: .7rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  border-bottom: 1px solid hsl(var(--border));
  
  position: sticky; top: 0; z-index: 3; background: hsl(var(--background));
}
.drv-items--grid .drv-listhead { display: none; }


.drv-pick { position: relative; display: inline-flex; align-self: center; justify-self: center; width: 1.55rem; height: 1.55rem; align-items: center; justify-content: center; }
.drv-pick .drv-ic { height: 1.55rem; width: 1.55rem; }
.drv-check {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; padding: 0;
  border: 1.5px solid hsl(var(--muted-foreground) / .5); background: hsl(var(--card)); color: transparent;
}
.drv-check svg { width: 62%; height: 62%; }
.drv-row:hover .drv-check,
.drv-row.is-selected .drv-check { display: inline-flex; }
.drv-row.is-selected .drv-check,
.drv-tile.is-selected .drv-tilecheck {
  background: hsl(var(--primary)); border-color: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.drv-tilecheck {
  position: absolute; top: .4rem; left: .4rem; z-index: 3; display: none; padding: 0;
  height: 1.4rem; width: 1.4rem; border-radius: 6px; cursor: pointer;
  align-items: center; justify-content: center;
  border: 1.5px solid hsl(var(--muted-foreground) / .5); background: hsl(var(--card)); color: transparent;
}
.drv-tilecheck svg { width: 62%; height: 62%; }
.drv-tile:hover .drv-tilecheck, .drv-tile.is-selected .drv-tilecheck { display: inline-flex; }
.drv-col-r { text-align: right; }
.drv-col-c { text-align: center; }

.drv-row {
  padding: .45rem .75rem; border-radius: var(--radius); cursor: default;
  border: 1px solid transparent; scroll-margin: 6rem;
}
.drv-row + .drv-row { margin-top: 1px; }
.drv-row:hover { background: hsl(var(--muted) / .6); }
.drv-row.is-selected { background: hsl(var(--brand) / .1); border-color: hsl(var(--brand) / .4); }
.drv-row .drv-ic { height: 1.55rem; width: 1.55rem; border-radius: 7px; }
.drv-namecell { min-width: 0; }
.drv-name {
  font-size: .875rem; font-weight: 500; color: hsl(var(--foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drv-sub {
  display: flex; align-items: center; gap: .35rem; margin-top: .15rem;
  min-width: 0; overflow: hidden;
}
.drv-cell-meta { font-size: .78rem; color: hsl(var(--muted-foreground)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drv-rowbtn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.9rem; width: 1.9rem; border-radius: 8px; cursor: pointer;
  color: hsl(var(--muted-foreground)); background: transparent; border: 0;
  opacity: .55; transition: background .15s, color .15s, opacity .15s;
}
.drv-rowbtn svg { width: 1.15rem; height: 1.15rem; flex: 0 0 auto; }
.drv-row:hover .drv-rowbtn, .drv-tile:hover .drv-rowbtn { opacity: 1; }
.drv-rowbtn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
@media (hover: none) { .drv-rowbtn { opacity: 1; } }

@media (max-width: 820px) {
  .drv-listhead, .drv-row { grid-template-columns: 2.25rem minmax(0, 1fr) 6rem 2.25rem; }
  .drv-col-mod { display: none; }
}
@media (max-width: 560px) {
  .drv-listhead, .drv-row { grid-template-columns: 2rem minmax(0, 1fr) 2.25rem; }
  .drv-col-size { display: none; }
}


.drv-grid {
  display: grid; grid-template-columns: 1fr; gap: .8rem;
  align-items: start;   
}
@media (min-width: 480px) { .drv-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); } }
.drv-items--list .drv-grid { display: none; }
.drv-items--grid #drv-list, .drv-items--grid .drv-listhead { display: none; }

.drv-tile {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); overflow: hidden;
  background: hsl(var(--card)); cursor: default; transition: border-color .15s, background .15s;
}
.drv-tile:hover { border-color: hsl(var(--foreground) / .18); background: hsl(var(--muted) / .35); }
.drv-tile.is-selected { border-color: hsl(var(--brand) / .55); box-shadow: 0 0 0 2px hsl(var(--brand) / .35); }
.drv-thumb {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: hsl(var(--muted) / .5); overflow: hidden;
}
.drv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.drv-thumb .drv-ic { height: 3.1rem; width: 3.1rem; border-radius: 12px; }
.drv-tile--folder .drv-thumb { aspect-ratio: auto; padding: 1.15rem; }
.drv-tilebar {
  display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem .55rem .7rem;
  border-top: 1px solid hsl(var(--border));
}
.drv-tile--folder .drv-tilebar { border-top: 0; padding: .7rem .6rem .7rem .8rem; gap: .6rem; }
.drv-tile--folder .drv-tilebar .drv-ic { height: 2.05rem; width: 2.05rem; border-radius: 9px; }
.drv-tilebar .drv-ic { height: 1.6rem; width: 1.6rem; border-radius: 6px; }
.drv-tilebody { min-width: 0; flex: 1 1 auto; }
.drv-tile .drv-sub { margin-top: .1rem; }
.drv-tilemenu {
  position: absolute; top: .45rem; right: .45rem; z-index: 2;
  background: hsl(var(--card) / .85); backdrop-filter: blur(4px);
}
.drv-tile-star {
  position: absolute; top: .45rem; left: .45rem; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  height: 1.6rem; width: 1.6rem; border-radius: 999px;
  background: hsl(var(--card) / .85); backdrop-filter: blur(4px);
  color: hsl(38 92% 45%);
}


.drv-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3.5rem 1.5rem; gap: .35rem;
}
.drv-empty-ic {
  display: inline-flex; align-items: center; justify-content: center;
  height: 3.5rem; width: 3.5rem; border-radius: 18px; margin-bottom: .5rem;
  background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
}
.drv-empty h3 { font-size: 1rem; font-weight: 600; color: hsl(var(--foreground)); }
.drv-empty p { font-size: .85rem; color: hsl(var(--muted-foreground)); max-width: 22rem; }

.drv-sentinel { height: 1px; width: 100%; }
.drv-more {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  margin-top: .5rem; padding: .9rem; color: hsl(var(--muted-foreground));
  font-size: .8rem; font-weight: 500;
}
.drv-more-spin { animation: drv-spin .8s linear infinite; }
@keyframes drv-spin { to { transform: rotate(360deg); } }
.drv-group-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: hsl(var(--muted-foreground)); margin: .9rem .25rem .4rem;
}


.drv-drop {
  position: fixed; inset: 0; z-index: 85; display: grid; place-items: center;
  background: hsl(var(--background) / .75); backdrop-filter: blur(2px);
  padding: 2rem; pointer-events: none;
}
.drv-drop-inner {
  border: 2px dashed hsl(var(--brand)); border-radius: calc(var(--radius) + 6px); padding: 3rem 4rem;
  background: hsl(var(--card)); text-align: center; color: hsl(var(--foreground));
  font-weight: 600; box-shadow: 0 20px 60px hsl(240 10% 9% / .25);
}
.drv-drop-inner svg { width: 2.5rem; height: 2.5rem; color: hsl(var(--brand)); margin: 0 auto .6rem; }


.drv-drawer { position: fixed; inset: 0; z-index: 88; }
.drv-drawer-back { position: absolute; inset: 0; background: hsl(240 10% 4% / .4); }
.drv-drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 100%;
  display: flex; flex-direction: column;
  background: hsl(var(--card)); border-left: 1px solid hsl(var(--border));
  animation: drvSlideIn .22s ease;
}
@media (min-width: 560px) { .drv-drawer-panel { width: 26rem; } }
@keyframes drvSlideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drv-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 0 .75rem 0 1rem; height: 3.5rem; border-bottom: 1px solid hsl(var(--border)); flex: 0 0 auto;
}
.drv-drawer-head h2 { font-size: .95rem; font-weight: 600; color: hsl(var(--foreground)); }
.drv-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 1rem; }
.drv-dz {
  border: 2px dashed hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: 1.75rem 1rem;
  text-align: center; color: hsl(var(--muted-foreground)); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drv-dz:hover, .drv-dz.is-drag { border-color: hsl(var(--brand)); background: hsl(var(--brand) / .06); color: hsl(var(--foreground)); }
.drv-dz svg { width: 2rem; height: 2rem; margin: 0 auto .5rem; color: hsl(var(--brand)); }
.drv-quota-note {
  margin-top: .85rem; padding: .7rem .85rem; border-radius: var(--radius); font-size: .8rem;
  display: flex; gap: .5rem; align-items: flex-start;
}
.drv-quota-note--over { background: hsl(var(--destructive) / .1); color: hsl(var(--destructive)); }
.drv-quota-note--ok { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.drv-quota-note svg { width: 1rem; height: 1rem; flex: 0 0 auto; margin-top: .05rem; }

.drv-up { display: flex; gap: .6rem; align-items: center; padding: .6rem 0; }
.drv-up + .drv-up { border-top: 1px solid hsl(var(--border)); }
.drv-up .drv-ic { height: 2rem; width: 2rem; border-radius: 8px; }
.drv-up-body { flex: 1 1 auto; min-width: 0; }
.drv-up-name {
  font-size: .8rem; font-weight: 500; color: hsl(var(--foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drv-up-meta { font-size: .72rem; color: hsl(var(--muted-foreground)); margin-top: .15rem; }
.drv-prog { height: 5px; border-radius: 999px; background: hsl(var(--muted)); overflow: hidden; margin-top: .35rem; }
.drv-prog-fill { height: 100%; width: 0; border-radius: 999px; background: hsl(var(--brand)); transition: width .18s ease; }
.drv-up.is-done .drv-prog-fill { background: hsl(146 62% 42%); }
.drv-up.is-error .drv-prog-fill { background: hsl(var(--destructive)); }
.drv-up.is-error .drv-up-meta { color: hsl(var(--destructive)); }
.drv-up-stat { flex: 0 0 auto; display: inline-flex; align-items: center; }
.drv-up-stat svg { width: 1.1rem; height: 1.1rem; }
.drv-up-stat--done { color: hsl(146 62% 42%); }
.drv-up-stat--error { color: hsl(var(--destructive)); }


.drv-menu {
  position: fixed; z-index: 120; min-width: 11rem; padding: .3rem;
  border-radius: calc(var(--radius) + 2px); border: 1px solid hsl(var(--border));
  background: hsl(var(--popover)); box-shadow: 0 16px 40px hsl(240 10% 9% / .18);
  animation: drvPop .12s ease;
}
@keyframes drvPop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.drv-menu button {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  padding: .45rem .55rem; border-radius: 8px; font-size: .82rem; font-weight: 500;
  color: hsl(var(--foreground)); background: transparent; border: 0; cursor: pointer;
}
.drv-menu button:hover { background: hsl(var(--muted)); }
.drv-menu button svg { width: 1rem; height: 1rem; flex: 0 0 auto; color: hsl(var(--muted-foreground)); }
.drv-menu button.drv-menu--danger { color: hsl(var(--destructive)); }
.drv-menu button.drv-menu--danger:hover { background: hsl(var(--destructive) / .1); }
.drv-menu button.drv-menu--danger svg { color: hsl(var(--destructive)); }
.drv-menu-sep { height: 1px; margin: .3rem .25rem; background: hsl(var(--border)); }


.drv-tilemeta {
  margin-top: .15rem; font-size: .72rem; color: hsl(var(--muted-foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


.drv-details-wrap { position: fixed; inset: 0; z-index: 122; }
.drv-details-back {
  position: absolute; inset: 0; background: hsl(240 10% 4% / .45);
  opacity: 0; transition: opacity .2s ease;
}
.drv-details-wrap.is-open .drv-details-back { opacity: 1; }
.drv-details {
  position: absolute; top: 0; right: 0; bottom: 0; width: 22rem; max-width: 92vw;
  display: flex; flex-direction: column;
  background: hsl(var(--card)); border-left: 1px solid hsl(var(--border));
  box-shadow: -18px 0 50px hsl(240 10% 9% / .22);
  transform: translateX(100%); transition: transform .22s cubic-bezier(.4, 0, .2, 1);
}
.drv-details-wrap.is-open .drv-details { transform: translateX(0); }
.drv-details-head {
  display: flex; align-items: center; gap: .7rem; padding: 1rem 1.1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.drv-details-head .drv-ic { height: 2.4rem; width: 2.4rem; border-radius: 10px; flex: 0 0 auto; }
.drv-details-htext { min-width: 0; flex: 1 1 auto; }
.drv-details-name {
  font-size: .92rem; font-weight: 600; color: hsl(var(--foreground));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.drv-details-kind { font-size: .74rem; color: hsl(var(--muted-foreground)); margin-top: .1rem; }
.drv-details-x {
  flex: 0 0 auto; height: 2rem; width: 2rem; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8px; border: 0; background: transparent;
  color: hsl(var(--muted-foreground)); cursor: pointer;
}
.drv-details-x:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.drv-details-x svg { width: 1.1rem; height: 1.1rem; }
.drv-details-preview {
  margin: 1rem 1.1rem 0; border-radius: 12px; overflow: hidden;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted) / .5);
  display: grid; place-items: center; max-height: 12rem;
}
.drv-details-preview img { width: 100%; height: 100%; max-height: 12rem; object-fit: contain; display: block; }
.drv-details-body { padding: .9rem 1.1rem; overflow-y: auto; flex: 1 1 auto; }
.drv-detrow {
  display: flex; gap: .75rem; padding: .5rem 0; align-items: baseline;
  border-bottom: 1px solid hsl(var(--border) / .55);
}
.drv-detrow:last-child { border-bottom: 0; }
.drv-detlabel { flex: 0 0 6rem; font-size: .76rem; color: hsl(var(--muted-foreground)); }
.drv-detval {
  flex: 1 1 auto; font-size: .82rem; color: hsl(var(--foreground)); text-align: right;
  overflow-wrap: anywhere;
}
.drv-details-acts {
  display: flex; gap: .5rem; padding: .9rem 1.1rem; border-top: 1px solid hsl(var(--border));
}
.drv-details-btn {
  flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center;
  height: 2.2rem; border-radius: 9px; font-size: .82rem; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  text-decoration: none;
}
.drv-details-btn:hover { filter: brightness(.96); }
.drv-details-btn--ghost {
  background: transparent; color: hsl(var(--foreground)); border-color: hsl(var(--border));
}
.drv-details-btn--ghost:hover { background: hsl(var(--muted)); filter: none; }
@media (max-width: 640px) {
  .drv-details { width: 100%; max-width: 100%; }
}


.drv-modal { position: fixed; inset: 0; z-index: 96; display: grid; place-items: center; padding: 1rem; }
.drv-modal-back { position: absolute; inset: 0; background: hsl(240 10% 4% / .45); }
.drv-modal-card {
  position: relative; width: 100%; max-width: 27rem; max-height: 85vh; display: flex; flex-direction: column;
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 60px hsl(240 10% 9% / .3); overflow: hidden; animation: drvPop .14s ease;
}
.drv-modal-head { padding: 1.1rem 1.25rem .25rem; }
.drv-modal-head h2 { font-size: 1rem; font-weight: 600; color: hsl(var(--foreground)); }
.drv-modal-head p { font-size: .82rem; color: hsl(var(--muted-foreground)); margin-top: .2rem; }
.drv-modal-body { padding: .75rem 1.25rem; overflow-y: auto; }
.drv-input {
  width: 100%; height: 2.5rem; padding: 0 .75rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); background: hsl(var(--background));
  color: hsl(var(--foreground)); font-size: .9rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.drv-input:focus { border-color: hsl(var(--brand)); box-shadow: 0 0 0 3px hsl(var(--brand) / .15); }
.drv-modal-foot {
  display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.25rem 1.1rem;
}


.drv-tree { border: 1px solid hsl(var(--border)); border-radius: calc(var(--radius) + 2px); padding: .35rem; max-height: 15rem; overflow-y: auto; }
.drv-tree-node button {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
  padding: .4rem .5rem; border-radius: 8px; font-size: .85rem; color: hsl(var(--foreground));
  background: transparent; border: 0; cursor: pointer;
}
.drv-tree-node button:hover { background: hsl(var(--muted)); }
.drv-tree-node button.is-active { background: hsl(var(--brand) / .12); color: hsl(var(--brand)); font-weight: 600; }
.drv-tree-node button svg { width: 1rem; height: 1rem; flex: 0 0 auto; color: hsl(205 90% 52%); }
.drv-tree-children { margin-left: 1rem; border-left: 1px solid hsl(var(--border)); padding-left: .15rem; }

.drv-skel { padding: .5rem 0; }
.drv-tombstone .drv-name { color: hsl(var(--muted-foreground)); text-decoration: line-through; }


/* ============================================================================
   Deliveries layouts (.dlv-*) — the 12 primitives behind the 40-template catalog
   in static/data/deliveries_templates.json. Same visual language as the blueprint
   .ag-* layouts above: same tokens, radii, type scale and accent-variable trick,
   so a deliveries page reads as the same system as the build canvas.
   ========================================================================== */
.dlv-wrap { display: flex; flex-direction: column; gap: 10px; }
.dlv-flush > .dlv-wrap { gap: 14px; }

/* Accent tones — mirror --ag-accent so every primitive leans on one variable. */
.dlv-t-emerald { --dlv-accent: 160 84% 32%; }
.dlv-t-sky     { --dlv-accent: 199 89% 44%; }
.dlv-t-violet  { --dlv-accent: 262 83% 58%; }
.dlv-t-amber   { --dlv-accent: 38 92% 46%; }
.dlv-t-red     { --dlv-accent: 0 72% 51%; }
.dlv-t-indigo  { --dlv-accent: 243 75% 59%; }
.dlv-t-slate   { --dlv-accent: 215 16% 47%; }
.dlv-sev-high  { --dlv-accent: 0 72% 51%; }
.dlv-sev-med   { --dlv-accent: 38 92% 46%; }
.dlv-sev-low   { --dlv-accent: 215 16% 47%; }

/* Shared bits */
.dlv-ghead { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); margin: 14px 2px 2px; }
.dlv-wrap > .dlv-ghead:first-child { margin-top: 2px; }
.dlv-meta { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.dlv-badge { display: inline-flex; align-items: center; margin-left: 7px; font-size: 10.5px; font-weight: 650;
  padding: 2px 7px; border-radius: 999px; background: hsl(var(--dlv-accent, var(--muted)) / 0.12);
  color: hsl(var(--dlv-accent, var(--foreground))); white-space: nowrap; }
.dlv-dot { height: 8px; width: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 6px;
  background: hsl(var(--dlv-accent, var(--border))); }
.dlv-check { color: hsl(160 84% 32%); font-weight: 700; flex-shrink: 0; }
.dlv-open { font-size: 11.5px; font-weight: 600; color: hsl(var(--primary)); background: none; border: 0;
  padding: 4px 2px; cursor: pointer; white-space: nowrap; }
.dlv-open:hover { text-decoration: underline; }
.dlv-src { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
.dlv-src:hover { text-decoration: underline; }
.dlv-file { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650;
  color: hsl(var(--primary)); background: hsl(var(--primary) / 0.09); border: 1px solid hsl(var(--primary) / 0.24);
  border-radius: 8px; padding: 4px 9px; white-space: nowrap; line-height: 1; transition: background .12s ease; }
.dlv-file:hover { background: hsl(var(--primary) / 0.15); text-decoration: none; }
.dlv-file svg { flex-shrink: 0; opacity: .85; }
.dlv-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.dlv-price { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dlv-delta { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dlv-up { color: hsl(160 84% 32%); }
.dlv-down { color: hsl(0 72% 51%); }

/* row */
.dlv-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px;
  border: 1px solid hsl(var(--border)); border-left: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 12px; background: hsl(var(--card)); }
.dlv-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dlv-row-title { font-size: 12.5px; font-weight: 650; letter-spacing: -0.005em; color: hsl(var(--foreground));
  overflow-wrap: anywhere; }
.dlv-row-sub { font-size: 12px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.dlv-row-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.dlv-row-img { height: 40px; width: 40px; border-radius: 9px; object-fit: cover; flex-shrink: 0;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
.dlv-avatar { height: 34px; width: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); }
@media (max-width: 560px) { .dlv-row { flex-wrap: wrap; } .dlv-row-right { width: 100%; justify-content: flex-end; } }

/* tile */
.dlv-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dlv-tile { border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); overflow: hidden;
  display: flex; flex-direction: column; }
.dlv-tile-img { aspect-ratio: 16 / 10; background: hsl(var(--muted)); }
.dlv-tile-img img { height: 100%; width: 100%; object-fit: cover; display: block; }
.dlv-tile-noimg { background: linear-gradient(135deg, hsl(var(--muted)), hsl(var(--dlv-accent, var(--muted)) / 0.12)); }
.dlv-tile-body { padding: 12px 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dlv-tile-title { font-size: 12.5px; font-weight: 650; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.dlv-tile-sub { font-size: 12px; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.dlv-tile-foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
@media (max-width: 900px) { .dlv-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dlv-tiles { grid-template-columns: 1fr; } }

/* panel */
.dlv-panel { display: flex; gap: 14px; border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--dlv-accent, var(--border))); border-radius: 14px;
  background: hsl(var(--card)); padding: 15px 16px; }
.dlv-panel-img { height: 82px; width: 116px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
  border: 1px solid hsl(var(--border)); }
.dlv-panel-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.dlv-panel-title { font-size: 14px; font-weight: 660; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.dlv-panel-sub { font-size: 12.5px; line-height: 1.6; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.dlv-panel-foot { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dlv-panel-acts { display: flex; align-items: center; gap: 12px; }
@media (max-width: 560px) { .dlv-panel { flex-direction: column; } .dlv-panel-img { width: 100%; height: 130px; } }

/* table */
.dlv-tablewrap { border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); overflow-x: auto; }
.dlv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dlv-table th { text-align: left; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); padding: 10px 14px; border-bottom: 1px solid hsl(var(--border));
  white-space: nowrap; background: hsl(var(--muted) / 0.3); }
.dlv-table td { padding: 11px 14px; border-bottom: 1px solid hsl(var(--border)); vertical-align: top;
  font-variant-numeric: tabular-nums; }
.dlv-table tbody tr:last-child td { border-bottom: 0; }
.dlv-table tbody tr:hover { background: hsl(var(--muted) / 0.25); }
.dlv-td-title { font-weight: 650; color: hsl(var(--foreground)); min-width: 160px; }
.dlv-td-act { text-align: right; white-space: nowrap; font-weight: 700; }
.dlv-table tfoot td { padding: 11px 14px; border-top: 1px solid hsl(var(--border)); font-weight: 700;
  background: hsl(var(--muted) / 0.3); }

/* kpi */
.dlv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dlv-kpi { border: 1px solid hsl(var(--border)); border-top: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 14px; background: hsl(var(--card)); padding: 14px; display: flex; flex-direction: column; gap: 3px; }
.dlv-kpi-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.dlv-kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dlv-kpi-sub { font-size: 11.5px; color: hsl(var(--muted-foreground)); }
@media (max-width: 900px) { .dlv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .dlv-kpis { grid-template-columns: 1fr; } }

/* timeline */
.dlv-timeline { padding-left: 4px; }
.dlv-tl-item { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 14px; }
.dlv-tl-item:last-child { padding-bottom: 0; }
.dlv-tl-dot { position: relative; height: 11px; width: 11px; border-radius: 50%; margin-top: 15px; justify-self: center;
  background: hsl(var(--card)); border: 2px solid hsl(var(--dlv-accent, var(--border))); z-index: 1; }
.dlv-tl-item::before { content: ""; position: absolute; left: 10px; top: 26px; bottom: -4px; width: 2px;
  background: hsl(var(--border)); }
.dlv-tl-item:last-child::before { display: none; }
.dlv-tl-body { border: 1px solid hsl(var(--border)); border-left: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; min-width: 0; }
.dlv-tl-title { font-size: 12.5px; font-weight: 650; letter-spacing: -0.005em; overflow-wrap: anywhere; }
.dlv-tl-sub { font-size: 12px; color: hsl(var(--muted-foreground)); margin-top: 2px; overflow-wrap: anywhere; }
.dlv-tl-foot { margin-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* gallery */
.dlv-gallery { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dlv-gfig { margin: 0; border: 1px solid hsl(var(--border)); border-radius: 12px; overflow: hidden;
  background: hsl(var(--card)); }
.dlv-gfig img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: hsl(var(--muted)); }
.dlv-gfig-noimg { width: 100%; aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, hsl(var(--muted)), hsl(var(--dlv-accent, var(--muted)) / 0.14)); }
.dlv-gfig figcaption { padding: 9px 11px; font-size: 11.5px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .dlv-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dlv-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* split */
.dlv-split { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.dlv-split-list { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding-right: 2px; }
.dlv-split-row { border: 1px solid hsl(var(--border)); border-radius: 11px; background: hsl(var(--card)); padding: 11px 12px;
  display: flex; flex-direction: column; gap: 2px; }
.dlv-split-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); }
.dlv-split-read { border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--card)); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 7px; }
@media (max-width: 820px) { .dlv-split { grid-template-columns: 1fr; } .dlv-split-list { max-height: none; } }

/* board */
.dlv-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px;
  overflow-x: auto; padding-bottom: 4px; align-items: start; }
.dlv-col { border: 1px solid hsl(var(--border)); border-radius: 14px; background: hsl(var(--muted) / 0.22); overflow: hidden; }
.dlv-col-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: hsl(var(--muted-foreground)); padding: 9px 12px; border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card)); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dlv-count { font-variant-numeric: tabular-nums; opacity: .75; }
.dlv-col > .dlv-card { margin: 10px; }
.dlv-card { border: 1px solid hsl(var(--border)); border-left: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 10px; background: hsl(var(--card)); padding: 11px; display: flex; flex-direction: column; gap: 3px; }
.dlv-card .dlv-open { align-self: flex-start; }

/* calendar */
.dlv-cal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.dlv-cal-day { border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); padding: 11px;
  display: flex; flex-direction: column; gap: 7px; }
.dlv-cal-date { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); }
.dlv-cal-item { font-size: 12px; border-left: 3px solid hsl(var(--dlv-accent, var(--border)));
  background: hsl(var(--muted) / 0.35); border-radius: 7px; padding: 7px 9px; display: flex;
  align-items: center; justify-content: space-between; gap: 8px; overflow-wrap: anywhere; }
@media (max-width: 900px) { .dlv-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .dlv-cal { grid-template-columns: 1fr; } }

/* hero */
.dlv-hero { border: 1px solid hsl(var(--border)); border-top: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 16px; background: hsl(var(--card)); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 8px 26px -18px hsl(var(--foreground) / 0.35); }
.dlv-hero-title { font-size: 18px; font-weight: 680; letter-spacing: -0.02em; line-height: 1.3; overflow-wrap: anywhere; }
.dlv-hero-sub { font-size: 13px; line-height: 1.65; color: hsl(var(--muted-foreground)); overflow-wrap: anywhere; }
.dlv-hero-hist { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

/* diff */
.dlv-diff { border: 1px solid hsl(var(--border)); border-left: 3px solid hsl(var(--dlv-accent, var(--border)));
  border-radius: 14px; background: hsl(var(--card)); padding: 14px 16px; }
.dlv-diff-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  font-size: 12.5px; font-weight: 650; margin-bottom: 10px; overflow-wrap: anywhere; }
.dlv-diff-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlv-diff-col { border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 10px 12px; font-size: 12.5px;
  display: flex; flex-direction: column; gap: 3px; overflow-wrap: anywhere; }
.dlv-diff-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: hsl(var(--muted-foreground)); }
.dlv-before { background: hsl(0 72% 51% / 0.05); border-color: hsl(0 72% 51% / 0.22); }
.dlv-after { background: hsl(160 84% 32% / 0.06); border-color: hsl(160 84% 32% / 0.25); }
@media (max-width: 560px) { .dlv-diff-cols { grid-template-columns: 1fr; } }


/* ---- Blueprint layouts, second wave -------------------------------------------------------
   funnel / decision / escalation / split_merge / gate / triage / relay / checklist.
   Same vocabulary as the seven above: --ag-accent left/top borders, hsl(var(--card)) surfaces,
   12-14px radii, pure CSS so they stay robust under the canvas pan/zoom.
   ----------------------------------------------------------------------------------------- */

/* funnel — each stage narrower than the last (many in, few out) */
.ag-funnel { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 2px; }
.ag-funnel-row { display: flex; justify-content: center; min-width: 240px; }
.ag-funnel-cell { flex: 1; border: 1px solid hsl(var(--border));
  border-left: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px;
  background: hsl(var(--card)); padding: 12px 14px; }
@media (max-width: 640px) { .ag-funnel-row { width: 100% !important; } }

/* decision — one condition, two outcomes */
.ag-dec { display: flex; flex-direction: column; align-items: center; }
.ag-dec-head { width: min(460px, 96%); border: 1px solid hsl(var(--border));
  border-left: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px;
  background: hsl(var(--card)); padding: 12px 14px; }
.ag-dec-arms { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; width: 100%;
  position: relative; padding-top: 16px; }
.ag-dec-arms::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px;
  background: hsl(var(--border)); }
.ag-dec-arm { position: relative; flex: 1 1 260px; max-width: 380px; display: flex;
  flex-direction: column; gap: 10px; }
.ag-dec-arm::before { content: ""; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px;
  background: hsl(var(--border)); }
.ag-dec-chip { align-self: center; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: hsl(var(--primary)); background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.22); border-radius: 999px; padding: 4px 12px; }
.ag-dec-cell { border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; }
@media (max-width: 640px) { .ag-dec-arms::before { display: none; } .ag-dec-arm { flex-basis: 100%; } }

/* escalation — tiers, each tried only if the last did not resolve it */
.ag-esc { display: flex; flex-direction: column; gap: 0; }
.ag-esc-tier { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: start; }
.ag-esc-lvl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border)); border-radius: 999px; padding: 5px 8px; text-align: center;
  margin-top: 12px; }
.ag-esc-cell { border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; min-width: 0; }
.ag-esc-sep { margin: 10px 0 10px 86px; font-size: 11px; font-weight: 600;
  color: hsl(var(--muted-foreground)); position: relative; padding-left: 18px; }
.ag-esc-sep::before { content: ""; position: absolute; left: 0; top: 50%; width: 12px; height: 2px;
  background: hsl(var(--border)); }
@media (max-width: 640px) { .ag-esc-tier { grid-template-columns: 1fr; }
  .ag-esc-lvl { justify-self: start; margin-top: 0; } .ag-esc-sep { margin-left: 4px; } }

/* split_merge — fan out to parallel work, then converge */
.ag-sm { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ag-sm-single { width: min(460px, 96%); border: 1px solid hsl(var(--border));
  border-left: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px;
  background: hsl(var(--card)); padding: 12px 14px; }
.ag-sm-fan { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; width: 100%;
  position: relative; padding-top: 16px; }
.ag-sm-fan::before { content: ""; position: absolute; top: 0; left: 14%; right: 14%; height: 2px;
  background: hsl(var(--border)); }
.ag-sm-branch { position: relative; flex: 1 1 220px; max-width: 300px;
  border: 1px solid hsl(var(--border)); border-top: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px; }
.ag-sm-branch::before { content: ""; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px;
  background: hsl(var(--border)); }
.ag-sm-merge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); }
@media (max-width: 640px) { .ag-sm-fan::before { display: none; } .ag-sm-branch { flex-basis: 100%; max-width: 100%; } }

/* gate — an approval checkpoint between every step */
.ag-gate { display: flex; flex-direction: column; gap: 0; }
.ag-gate-cell { border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; }
.ag-gate-check { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  margin: 10px 0 10px 18px; font-size: 11px; font-weight: 600; color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.07); border: 1px dashed hsl(var(--primary) / 0.32);
  border-radius: 999px; padding: 5px 12px; }

/* triage — one intake, sorted into buckets */
.ag-triage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ag-triage-in { width: min(460px, 96%); border: 1px solid hsl(var(--border));
  border-left: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px;
  background: hsl(var(--card)); padding: 12px 14px; }
.ag-triage-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: hsl(var(--muted-foreground)); }
.ag-triage-outs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; width: 100%; }
.ag-triage-out { border: 1px solid hsl(var(--border)); border-top: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px; }
@media (max-width: 860px) { .ag-triage-outs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ag-triage-outs { grid-template-columns: 1fr; } }

/* relay — a handoff chain */
.ag-relay { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px; align-items: start; }
.ag-relay-cell { border: 1px solid hsl(var(--border));
  border-top: 3px solid var(--ag-accent, hsl(var(--border))); border-radius: 12px;
  background: hsl(var(--card)); padding: 12px; }
.ag-relay-arrow { display: none; }

/* checklist — a fixed procedure it works through */
.ag-check { display: flex; flex-direction: column; gap: 10px; }
.ag-check-row { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start;
  border: 1px solid hsl(var(--border)); border-left: 3px solid var(--ag-accent, hsl(var(--border)));
  border-radius: 12px; background: hsl(var(--card)); padding: 12px 14px; }
.ag-check-box { display: grid; place-items: center; height: 24px; width: 24px; border-radius: 7px;
  font-size: 11px; font-weight: 700; background: var(--ag-accent-12, hsl(var(--muted)));
  color: var(--ag-accent, hsl(var(--foreground))); }
.ag-check-body { min-width: 0; }

/* Toasts: safe-area aware + clean responsive width (mobile = near full-width bar,
   sm+ = compact content-sized). ID specificity so it wins over the utility classes. */
#toast-host {
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(1.25rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 27rem;
  padding: 0 .75rem;
  box-sizing: border-box;
}
#toast-host .toast-item { width: 100%; max-width: none; }
@media (min-width: 640px) {
  #toast-host { width: auto; max-width: 34rem; padding: 0; }
  #toast-host .toast-item { width: auto; }
}

.opt-prose .bp-tablewrap.bp-vs-table table { font-size: 14.5px; }
.opt-prose .bp-tablewrap.bp-vs-table th { padding: 0.85rem 1.1rem; }
.opt-prose .bp-tablewrap.bp-vs-table td { padding: 0.85rem 1.1rem; line-height: 1.6; }
.opt-prose .bp-tablewrap.bp-vs-table th.bp-vs-us {
  background: hsl(var(--brand) / 0.09);
  color: hsl(var(--foreground));
  box-shadow: inset 0 2px 0 hsl(var(--brand) / 0.65);
}
.opt-prose .bp-tablewrap.bp-vs-table th.bp-vs-them {
  background: hsl(215 25% 40% / 0.07);
  color: hsl(var(--foreground));
  box-shadow: inset 0 2px 0 hsl(215 16% 65% / 0.8);
}
.opt-prose .bp-tablewrap.bp-vs-table td.bp-vs-us { background: hsl(var(--brand) / 0.04); }
.opt-prose .bp-tablewrap.bp-vs-table td.bp-vs-them { background: hsl(215 25% 40% / 0.025); }
.opt-prose .bp-tablewrap.bp-vs-table tbody td:first-child { font-weight: 600; color: hsl(var(--foreground)); }
.opt-prose .bp-tablewrap.bp-vs-table tbody tr:nth-child(even) { background: hsl(var(--muted) / 0.4); }
.opt-prose .bp-tablewrap.bp-vs-table tbody tr:hover { background: hsl(var(--brand) / 0.045); }
@media (max-width: 640px) {
  .opt-prose .bp-tablewrap.bp-vs-table table { font-size: 14px; }
  .opt-prose .bp-tablewrap.bp-vs-table th,
  .opt-prose .bp-tablewrap.bp-vs-table td { padding: 0.7rem 0.85rem; }
}

.opt-prose .bp-adv {
  display: inline-flex; align-items: center; gap: 0.38em;
  border-radius: 9999px; padding: 2px 12px 3px;
  font-size: 15px; font-weight: 650; line-height: 1.5;
  font-variant-caps: all-small-caps; letter-spacing: 0.05em;
  white-space: nowrap; vertical-align: baseline;
}
.opt-prose .bp-adv::before { font-variant-caps: normal; letter-spacing: 0; font-size: 0.82em; line-height: 1; }
.opt-prose .bp-adv--us {
  color: hsl(243 60% 46%);
  background: hsl(var(--brand) / 0.1);
  border: 1px solid hsl(var(--brand) / 0.22);
}
.opt-prose .bp-adv--us::before { content: "\2713"; color: hsl(var(--brand)); }
.opt-prose .bp-adv--them {
  color: hsl(215 25% 30%);
  background: hsl(215 25% 40% / 0.08);
  border: 1px solid hsl(215 25% 40% / 0.2);
}
.opt-prose .bp-adv--them::before { content: "\2713"; color: hsl(215 20% 45%); }
.opt-prose .bp-adv--tie {
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.7);
  border: 1px solid hsl(var(--border));
}
.opt-prose .bp-adv--tie::before { content: "="; font-weight: 700; color: hsl(var(--muted-foreground)); }

.opt-prose .bp-verdict {
  border-left: 3px solid hsl(var(--brand));
  background: hsl(var(--brand) / 0.05);
  border-radius: 0 14px 14px 0;
  padding: 18px 22px; margin: 1.75rem 0;
  font-size: 15.5px;
}
.opt-prose .bp-verdict > :first-child { margin-top: 0; }
.opt-prose .bp-verdict > :last-child { margin-bottom: 0; }
.opt-prose .bp-verdict > * + * { margin-top: 0.6rem; }
.opt-prose .bp-verdict > p:first-of-type { font-weight: 650; font-size: 16.5px; color: hsl(var(--foreground)); letter-spacing: -0.005em; }
.opt-prose .bp-verdict-label {
  display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 700; line-height: 1.4;
  font-variant-caps: all-small-caps; letter-spacing: 0.06em;
  color: hsl(243 60% 46%);
  background: hsl(var(--brand) / 0.1);
  border: 1px solid hsl(var(--brand) / 0.2);
  border-radius: 9999px; padding: 1px 12px 2px;
  margin-bottom: 4px;
}

.opt-prose .bp-procon {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: 16px; overflow: hidden;
  margin: 1.75rem 0;
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.04);
}
.opt-prose .bp-procon-col { background: hsl(var(--card)); padding: 20px 24px; min-width: 0; }
.opt-prose .bp-procon-col h4 {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 12px; font-size: 14px; font-weight: 650; letter-spacing: 0.01em;
  color: hsl(var(--foreground));
}
.opt-prose .bp-procon-col h4::before {
  content: ""; flex: none; width: 8px; height: 8px; border-radius: 9999px;
  background: hsl(var(--brand));
}
.opt-prose .bp-procon-col:last-child h4::before { background: hsl(215 16% 65%); }
.opt-prose .bp-procon-col ul { margin: 0; padding-left: 1.15rem; font-size: 15px; }
.opt-prose .bp-procon-col ul > li + li { margin-top: 0.45rem; }
.opt-prose .bp-procon-col li { line-height: 1.6; }
.opt-prose .bp-procon-col > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .opt-prose .bp-procon { grid-template-columns: 1fr; }
}

.dh-root { --dh-ok:#059669; --dh-run:#0284c7; --dh-warn:#c2740b; --dh-bad:#dc2626; --dh-live:#e11d48; }
.dark .dh-root { --dh-ok:#34d399; --dh-run:#38bdf8; --dh-warn:#fbbf24; --dh-bad:#f87171; --dh-live:#fb7185; }

.dh-hello { display:flex; align-items:flex-end; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.dh-hello h2 { margin:0; font-size:clamp(25px,3.2vw,32px); font-weight:650; letter-spacing:-.02em; line-height:1.1; text-wrap:balance; }
.dh-grad { background:linear-gradient(120deg, hsl(var(--foreground)), hsl(var(--muted-foreground))); -webkit-background-clip:text; background-clip:text; color:transparent; }
.dh-date { font-size:13px; color:hsl(var(--muted-foreground)); padding-bottom:5px; white-space:nowrap; }
.dh-brief { margin:.5rem 0 0; font-size:14.5px; color:hsl(var(--muted-foreground)); max-width:72ch; }
.dh-brief b { color:hsl(var(--foreground)); font-weight:600; }
.dh-brief .warn { color:var(--dh-warn); font-weight:600; }
.dh-stamp { font-size:11.5px; color:hsl(var(--muted-foreground)); opacity:.85; margin-top:.2rem; }

.dh-composer { margin-top:1.15rem; position:relative; display:flex; align-items:center; gap:.55rem; background:hsl(var(--card)); border:1px solid hsl(var(--border)); border-radius:16px; padding:.35rem .5rem .35rem .95rem; box-shadow:0 2px 10px -4px hsl(var(--foreground)/.06), 0 1px 2px hsl(var(--foreground)/.04); transition:border-color .15s, box-shadow .15s; }
.dh-composer:focus-within { border-color:hsl(var(--foreground)/.25); box-shadow:0 0 0 4px hsl(var(--foreground)/.05); }
.dh-spark { color:hsl(var(--brand)); flex:0 0 auto; }
.dh-composer input { flex:1; min-width:0; border:0; outline:0; background:none; color:inherit; font-size:16px; padding:.7rem 0; }
.dh-composer input::placeholder { color:hsl(var(--muted-foreground)/.75); }
.dh-kbd { font-size:11px; color:hsl(var(--muted-foreground)); border:1px solid hsl(var(--border)); border-radius:6px; padding:.15rem .4rem; background:hsl(var(--muted)/.5); white-space:nowrap; }
.dh-send { flex:0 0 auto; height:38px; width:38px; display:grid; place-items:center; border-radius:999px; background:hsl(var(--foreground)); color:hsl(var(--background)); border:0; cursor:pointer; transition:opacity .15s; }
.dh-send:hover { opacity:.9; }
.dh-chips { display:flex; gap:.5rem; margin-top:.7rem; overflow-x:auto; padding-bottom:.15rem; scrollbar-width:none; }
.dh-chips::-webkit-scrollbar { display:none; }
.dh-chip { flex:0 0 auto; display:inline-flex; align-items:center; height:32px; padding:0 .8rem; border-radius:999px; border:1px solid hsl(var(--border)); background:hsl(var(--card)); font-size:12.5px; font-weight:500; color:hsl(var(--foreground)/.75); white-space:nowrap; cursor:pointer; transition:.15s; }
.dh-chip:hover { color:hsl(var(--foreground)); background:hsl(var(--accent)); }

.dh-needs { margin-top:1.15rem; position:relative; border:1px solid color-mix(in srgb, var(--dh-warn) 42%, hsl(var(--border))); border-radius:14px; overflow:hidden; background:hsl(var(--card)); box-shadow:0 1px 2px hsl(var(--foreground)/.04); }
.dh-needs::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:linear-gradient(var(--dh-warn), var(--dh-bad)); }
.dh-needs-h { display:flex; align-items:center; gap:.55rem; padding:.7rem 1rem .25rem 1.05rem; }
.dh-needs-h svg { color:var(--dh-warn); }
.dh-needs-h b { font-size:13.5px; }
.dh-needs-h .count { font-size:12px; color:hsl(var(--muted-foreground)); margin-left:auto; }
.dh-needs ul { list-style:none; margin:0; padding:.1rem .45rem .5rem; }
.dh-needs li { display:flex; align-items:center; gap:.65rem; padding:.5rem .65rem; border-radius:10px; }
.dh-needs li:hover { background:hsl(var(--muted)/.5); }
.dh-needs .txt { flex:1; min-width:0; display:flex; flex-direction:column; }
.dh-needs .txt .t { font-size:13.5px; font-weight:550; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-needs .txt .s { font-size:12px; color:hsl(var(--muted-foreground)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.dh-pill { display:inline-flex; align-items:center; gap:.35rem; height:22px; padding:0 .5rem; border-radius:999px; font-size:11px; font-weight:650; }
.dh-pill .dot { height:6px; width:6px; border-radius:999px; }
.dh-pill.ok { color:var(--dh-ok); background:color-mix(in srgb, var(--dh-ok) 12%, transparent); }
.dh-pill.ok .dot { background:var(--dh-ok); }
.dh-pill.run { color:var(--dh-run); background:color-mix(in srgb, var(--dh-run) 12%, transparent); }
.dh-pill.run .dot { background:var(--dh-run); }
.dh-pill.warn { color:var(--dh-warn); background:color-mix(in srgb, var(--dh-warn) 15%, transparent); }
.dh-pill.warn .dot { background:var(--dh-warn); }
.dh-pill.bad { color:var(--dh-bad); background:color-mix(in srgb, var(--dh-bad) 12%, transparent); }
.dh-pill.bad .dot { background:var(--dh-bad); }
.dh-pill.live { color:var(--dh-live); background:color-mix(in srgb, var(--dh-live) 12%, transparent); }
.dh-pill.live .dot { background:var(--dh-live); }
.dh-pill.idle { color:hsl(var(--muted-foreground)); background:hsl(var(--muted)); }
.dh-pill.idle .dot { background:hsl(var(--muted-foreground)); }
.dh-pill.w { width:74px; justify-content:center; }
.dh-pulse { animation:dh-pulse 1.6s ease-in-out infinite; }
@keyframes dh-pulse { 0%,100% { opacity:1; } 50% { opacity:.35; } }
@media (prefers-reduced-motion:reduce) { .dh-pulse { animation:none; } }

.dh-btn { display:inline-flex; align-items:center; gap:.35rem; height:30px; padding:0 .75rem; border-radius:999px; font-size:12.5px; font-weight:600; border:1px solid hsl(var(--border)); background:hsl(var(--card)); color:hsl(var(--foreground)); cursor:pointer; transition:.15s; white-space:nowrap; }
.dh-btn:hover { background:hsl(var(--muted)); }
.dh-btn.solid { background:hsl(var(--foreground)); color:hsl(var(--background)); border-color:transparent; }
.dh-btn.solid:hover { opacity:.9; }
.dh-dismiss { flex:0 0 auto; height:26px; width:26px; display:inline-flex; align-items:center; justify-content:center; border-radius:8px; border:none; background:transparent; color:hsl(var(--muted-foreground)); font-size:18px; line-height:1; cursor:pointer; transition:.15s; }
.dh-dismiss:hover { background:hsl(var(--muted)); color:hsl(var(--foreground)); }

.dh-kpis { margin-top:1.15rem; display:grid; grid-template-columns:repeat(2,1fr); gap:.75rem; }
.dh-kpi { border:1px solid hsl(var(--border)); border-radius:14px; background:hsl(var(--card)); padding:1rem; box-shadow:0 1px 2px hsl(var(--foreground)/.04); transition:border-color .15s; }
.dh-kpi:hover { border-color:hsl(var(--foreground)/.2); }
.dh-kpi .top { display:flex; align-items:center; justify-content:space-between; }
.dh-kicon { height:30px; width:30px; border-radius:9px; display:grid; place-items:center; flex:0 0 auto; color:var(--c); background:color-mix(in srgb, var(--c) 13%, transparent); }
.dh-kpi .lbl { font-size:11px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }
.dh-kpi .num { font-size:27px; font-weight:650; letter-spacing:-.02em; margin-top:.5rem; line-height:1; }
.dh-kpi .sub { font-size:12px; color:hsl(var(--muted-foreground)); margin-top:.4rem; }
.dh-kpi .sub .hot { color:var(--dh-warn); font-weight:600; }
.dh-bar { height:6px; border-radius:999px; background:hsl(var(--muted)); overflow:hidden; margin-top:.55rem; }
.dh-bar > i { display:block; height:100%; border-radius:999px; }

.dh-grid { margin-top:1.5rem; display:grid; grid-template-columns:1fr; gap:1.1rem; align-items:start; }
.dh-col { display:flex; flex-direction:column; gap:1.1rem; min-width:0; }
.dh-card { border:1px solid hsl(var(--border)); border-radius:16px; background:hsl(var(--card)); box-shadow:0 1px 2px hsl(var(--foreground)/.04); overflow:hidden; }
.dh-card-h { display:flex; align-items:center; gap:.6rem; padding:.9rem 1.1rem .5rem; }
.dh-card-h h3 { margin:0; font-size:11.5px; font-weight:700; letter-spacing:.11em; text-transform:uppercase; color:hsl(var(--muted-foreground)); }
.dh-card-h .link { margin-left:auto; font-size:12px; font-weight:500; color:hsl(var(--muted-foreground)); transition:.15s; }
.dh-card-h .link:hover { color:hsl(var(--foreground)); }
.dh-rows { padding:.1rem .5rem .55rem; }
.dh-r { display:flex; align-items:center; gap:.7rem; padding:.55rem .6rem; border-radius:11px; }
.dh-r + .dh-r { border-top:1px solid hsl(var(--border)/.7); }
.dh-r:hover { background:hsl(var(--muted)/.45); }
.dh-r .main { flex:1; min-width:0; display:flex; flex-direction:column; }
.dh-r .title { font-size:13.5px; font-weight:550; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-r .meta { font-size:11.5px; color:hsl(var(--muted-foreground)); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dh-r .when { font-size:11.5px; color:hsl(var(--muted-foreground)); white-space:nowrap; flex:0 0 auto; }
.dh-r .when.strong { font-weight:600; color:hsl(var(--foreground)); }
.dh-r .over { color:var(--dh-bad); font-weight:600; }
.dh-ic { height:28px; width:28px; border-radius:9px; display:grid; place-items:center; flex:0 0 auto; background:hsl(var(--brand)/.12); color:hsl(var(--brand)); }
.dh-ic.amber { background:color-mix(in srgb, var(--dh-warn) 14%, transparent); color:var(--dh-warn); }
.dh-pri { height:7px; width:7px; border-radius:999px; flex:0 0 auto; }
.dh-check { height:19px; width:19px; border-radius:999px; border:2px solid hsl(var(--border)); display:grid; place-items:center; flex:0 0 auto; color:var(--dh-ok); background:none; cursor:pointer; transition:.15s; }
.dh-check svg { opacity:0; transition:.15s; }
.dh-taskrow:hover .dh-check { border-color:var(--dh-ok); }
.dh-taskrow:hover .dh-check svg, .dh-check:focus-visible svg { opacity:1; }
.dh-check:focus-visible { border-color:var(--dh-ok); outline:2px solid hsl(var(--brand)); outline-offset:2px; }
@media (hover:none) { .dh-check svg { opacity:.5; } }

.dh-agent { display:flex; align-items:center; gap:.75rem; padding:.6rem .6rem; }
.dh-agent + .dh-agent { border-top:1px solid hsl(var(--border)/.7); }
.dh-av { height:34px; width:34px; border-radius:10px; display:grid; place-items:center; flex:0 0 auto; background:linear-gradient(135deg, hsl(var(--brand)/.95), hsl(var(--brand-2)/.95)); color:#fff; font-weight:700; font-size:12.5px; }

.dh-logos { display:flex; flex-wrap:wrap; gap:.5rem; padding:.35rem .9rem .35rem; }
.dh-logo { height:36px; width:36px; border-radius:10px; display:grid; place-items:center; background:hsl(var(--card)); border:1px solid hsl(var(--border)); position:relative; }
.dh-logo img { height:20px; width:20px; border-radius:5px; object-fit:contain; }
.dh-logo .hb { position:absolute; right:-2px; bottom:-2px; height:11px; width:11px; border-radius:999px; background:var(--dh-ok); border:2px solid hsl(var(--card)); }
.dh-logo.more { color:hsl(var(--muted-foreground)); font-size:11px; font-weight:700; }
.dh-logo.add { border-style:dashed; color:hsl(var(--muted-foreground)); cursor:pointer; }
.dh-logo.add:hover { background:hsl(var(--muted)); }
.dh-divider { height:1px; background:hsl(var(--border)/.7); margin:.35rem .9rem; }
.dh-chan { display:flex; flex-wrap:wrap; gap:.45rem; padding:.15rem .9rem .9rem; }
.dh-cchip { display:inline-flex; align-items:center; gap:.4rem; height:30px; padding:0 .55rem; border-radius:999px; border:1px solid hsl(var(--border)); background:hsl(var(--card)); font-size:12px; font-weight:550; color:hsl(var(--foreground)); cursor:pointer; }
.dh-cchip.off { color:hsl(var(--muted-foreground)); border-style:dashed; }
.dh-cchip.off:hover { background:hsl(var(--muted)); }
.dh-cchip .st { font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.dh-cchip.on .st { color:var(--dh-ok); }
.dh-cchip.off .st { color:hsl(var(--muted-foreground)); }

.dh-setup { margin-top:1.15rem; border:1px solid hsl(var(--border)); border-radius:18px; overflow:hidden; box-shadow:0 8px 24px -12px hsl(var(--foreground)/.12), 0 1px 2px hsl(var(--foreground)/.04); background:radial-gradient(120% 100% at 0% 0%, hsl(var(--brand)/.06), transparent 55%), hsl(var(--card)); }
.dh-setup-h { padding:1.1rem 1.25rem .4rem; }
.dh-setup-h .row1 { display:flex; align-items:center; gap:.7rem; }
.dh-setup-h h2 { margin:0; font-size:17px; font-weight:650; letter-spacing:-.01em; }
.dh-setup-h .cnt { margin-left:auto; font-size:12.5px; font-weight:650; color:hsl(var(--muted-foreground)); }
.dh-setup-h p { margin:.3rem 0 0; font-size:13.5px; color:hsl(var(--muted-foreground)); }
.dh-prog { height:7px; border-radius:999px; background:hsl(var(--muted)); overflow:hidden; margin-top:.8rem; }
.dh-prog > i { display:block; height:100%; border-radius:999px; background:linear-gradient(90deg, hsl(var(--brand)), hsl(var(--brand-2))); transition:width .5s ease; }
.dh-tiles { display:grid; grid-template-columns:1fr; gap:.7rem; padding:1rem 1.1rem 1.15rem; }
.dh-tile { display:flex; align-items:center; gap:.85rem; padding:.85rem; border:1px solid hsl(var(--border)); border-radius:13px; background:hsl(var(--card)); text-align:left; cursor:pointer; transition:.15s; }
.dh-tile:hover { border-color:hsl(var(--foreground)/.22); transform:translateY(-1px); }
.dh-tile.done { opacity:.62; }
.dh-tic { height:40px; width:40px; border-radius:11px; display:grid; place-items:center; flex:0 0 auto; background:hsl(var(--brand)/.1); color:hsl(var(--brand)); }
.dh-tm { flex:1; min-width:0; }
.dh-tm .t { font-size:14px; font-weight:600; }
.dh-tm .t.strike { text-decoration:line-through; text-decoration-color:hsl(var(--muted-foreground)/.5); }
.dh-tm .s { font-size:12px; color:hsl(var(--muted-foreground)); margin-top:.1rem; }
.dh-go { color:hsl(var(--muted-foreground)); flex:0 0 auto; transition:.15s; }
.dh-tile:hover .dh-go { color:hsl(var(--foreground)); transform:translateX(2px); }
.dh-donechk { height:24px; width:24px; border-radius:999px; background:var(--dh-ok); color:#fff; display:grid; place-items:center; flex:0 0 auto; }
.dh-mini { display:flex; gap:.3rem; margin-top:.4rem; flex-wrap:wrap; }
.dh-mini .m { height:22px; width:22px; border-radius:6px; display:grid; place-items:center; background:hsl(var(--card)); border:1px solid hsl(var(--border)); }
.dh-mini .m img { height:14px; width:14px; object-fit:contain; }
.dh-mini .m.txt { width:auto; padding:0 .35rem; font-size:9.5px; font-weight:700; color:hsl(var(--muted-foreground)); }

.dh-empty { padding:.55rem 1.1rem 1.15rem; color:hsl(var(--muted-foreground)); font-size:13.5px; line-height:1.5; }
.dh-empty .cta { margin-top:.7rem; display:flex; flex-wrap:wrap; gap:.5rem; }

@media (min-width:1024px) { .dh-kpis { grid-template-columns:repeat(4,1fr); } }
@media (min-width:1140px) { .dh-grid { grid-template-columns:minmax(0,1fr) 372px; } }
@media (min-width:640px) { .dh-tiles { grid-template-columns:1fr 1fr; } }
.dh-logo .mono { font-size:11px; font-weight:700; color:hsl(var(--muted-foreground)); }

.lg-shell { display:grid; grid-template-columns:270px minmax(0,1fr); gap:16px; height:calc(100vh - 232px); min-height:540px; }
.lg-rail { display:flex; flex-direction:column; border:1px solid hsl(var(--border)); border-radius:16px; background:hsl(var(--card)); overflow:hidden; }
.lg-rail-top { padding:12px; border-bottom:1px solid hsl(var(--border)); display:flex; flex-direction:column; gap:8px; }
.lg-rail-count { font-size:11px; color:hsl(var(--muted-foreground)); font-weight:500; }
.lg-search { width:100%; height:34px; border:1px solid hsl(var(--border)); border-radius:9px; background:hsl(var(--background)); padding:0 11px; font-size:12.5px; color:hsl(var(--foreground)); outline:none; }
.lg-search:focus { border-color:hsl(var(--brand)); box-shadow:0 0 0 3px hsl(var(--brand) / 0.14); }
.lg-list { overflow-y:auto; padding:8px; display:flex; flex-direction:column; gap:2px; flex:1; }
.lg-group { font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:hsl(var(--muted-foreground)); padding:12px 8px 4px; }
.lg-group:first-child { padding-top:4px; }
.lg-item { display:block; width:100%; text-align:left; border:0; background:none; border-radius:10px; padding:8px 11px; cursor:pointer; border-left:2px solid transparent; transition:background .1s ease; }
.lg-item:hover { background:hsl(var(--muted) / 0.55); }
.lg-item.active { background:hsl(var(--brand) / 0.1); border-left-color:hsl(var(--brand)); }
.lg-item-name { font-size:13px; font-weight:600; color:hsl(var(--foreground)); display:block; line-height:1.3; }
.lg-item.active .lg-item-name { color:hsl(var(--brand)); }
.lg-item-sub { font-size:11px; color:hsl(var(--muted-foreground)); display:block; margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lg-empty { padding:24px 12px; text-align:center; font-size:12px; color:hsl(var(--muted-foreground)); }
.lg-pane { display:flex; flex-direction:column; border:1px solid hsl(var(--border)); border-radius:16px; background:hsl(var(--card)); overflow:hidden; min-width:0; }
.lg-head { padding:15px 18px; border-bottom:1px solid hsl(var(--border)); display:flex; align-items:flex-start; gap:14px; flex-wrap:wrap; }
.lg-head-main { min-width:0; flex:1; }
.lg-title { font-size:16px; font-weight:700; letter-spacing:-.01em; display:flex; align-items:center; gap:8px; flex-wrap:wrap; color:hsl(var(--foreground)); }
.lg-badge { font-size:10px; font-weight:600; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; padding:2px 7px; border-radius:6px; background:hsl(var(--muted)); color:hsl(var(--muted-foreground)); }
.lg-badge.brand { background:hsl(var(--brand) / 0.12); color:hsl(var(--brand)); }
.lg-desc { font-size:12.5px; color:hsl(var(--muted-foreground)); margin-top:5px; line-height:1.5; }
.lg-when { font-size:12px; color:hsl(var(--muted-foreground)); margin-top:6px; }
.lg-when b { color:hsl(var(--foreground)); font-weight:600; }
.lg-zoombar { display:flex; align-items:center; gap:5px; flex-shrink:0; }
.lg-zbtn { height:31px; min-width:31px; padding:0 7px; display:inline-flex; align-items:center; justify-content:center; gap:5px; border:1px solid hsl(var(--border)); border-radius:8px; background:hsl(var(--card)); color:hsl(var(--foreground)); cursor:pointer; font-size:11.5px; font-weight:600; }
.lg-zbtn:hover { background:hsl(var(--muted) / 0.6); }
.lg-zlabel { font-size:11.5px; font-variant-numeric:tabular-nums; color:hsl(var(--muted-foreground)); min-width:44px; text-align:center; }
.lg-stage { flex:1; min-height:440px; position:relative; overflow:hidden; background:hsl(var(--muted) / 0.22); }
.lg-canvas { position:absolute; inset:0; }
.lg-viewport { position:absolute; inset:0; overflow:auto; padding:22px; }
.lg-zoom { transform-origin:top left; transform:scale(var(--lg-z,1)); width:100%; will-change:transform; }
.lg-hint { position:absolute; right:14px; left:auto; bottom:12px; font-size:11px; color:hsl(var(--muted-foreground)); background:hsl(var(--card) / 0.85); backdrop-filter:blur(4px); border:1px solid hsl(var(--border)); border-radius:8px; padding:4px 9px; pointer-events:none; }
@media (max-width:1023px) {
  .lg-shell { grid-template-columns:1fr; height:auto; min-height:0; }
  .lg-rail { max-height:340px; }
  .lg-stage { min-height:460px; }
}


.ag-conveyor{padding-bottom:2px}
.ag-conv-belt,.ag-conv-link{display:none}
.ag-conv-track{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:14px}
.ag-conv-cell{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-kanban{display:flex;flex-wrap:wrap;gap:14px;align-items:flex-start}
.ag-kan-col{flex:1 1 280px;max-width:520px;border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--muted)/.22);overflow:hidden}
.ag-kan-head{display:flex;align-items:center;gap:9px;padding:11px 13px;border-bottom:1px solid hsl(var(--border));background:hsl(var(--card))}
.ag-kan-body{padding:12px;display:flex;flex-direction:column;gap:10px}

.ag-orbit{display:flex;flex-direction:column;gap:14px}
.ag-orbit-ring{display:none}
.ag-orbit-core-wrap{display:flex;justify-content:center}
.ag-orbit-core{width:100%;max-width:520px;border:1px solid hsl(var(--border));border-top:3px solid var(--ag-accent,hsl(var(--border)));border-radius:16px;background:hsl(var(--card));padding:14px}
.ag-orbit-sats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ag-orbit-sat{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-journey{position:relative;padding-left:34px}
.ag-jrny-path{position:absolute;left:13px;top:6px;bottom:6px;width:2px;background:hsl(var(--border));border-radius:2px}
.ag-jrny-stop{position:relative;margin-bottom:14px}
.ag-jrny-stop:last-child{margin-bottom:0}
.ag-jrny-pin{position:absolute;left:-34px;top:2px;display:inline-grid;place-items:center;height:26px;width:26px;border-radius:8px;font-weight:700;font-size:12px;background:var(--ag-accent-12,hsl(var(--muted)));color:var(--ag-accent,hsl(var(--foreground)));box-shadow:0 0 0 4px hsl(var(--background))}
.ag-jrny-card{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}
.ag-jrny-card .ag-stage-desc{margin-top:2px}
.ag-jrny-card .ag-fan{margin-top:9px}

.ag-cascade{display:flex;flex-direction:column;gap:12px}
.ag-casc-item{margin-left:calc(var(--casc-i,0)*20px)}
.ag-casc-cell{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-spot{display:flex;flex-direction:column;gap:14px}
.ag-spot-hero{border:1px solid hsl(var(--border));border-top:3px solid var(--ag-accent,hsl(var(--border)));border-radius:16px;background:hsl(var(--card));padding:16px}
.ag-spot-sats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ag-spot-sat{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-ledger{border:1px solid hsl(var(--border));border-radius:14px;overflow:hidden;background:hsl(var(--card))}
.ag-ldg-row{display:grid;grid-template-columns:minmax(120px,200px) 1fr;gap:14px;align-items:start;padding:12px 14px;border-bottom:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)))}
.ag-ldg-row:last-child{border-bottom:0}
.ag-ldg-key{display:flex;align-items:center;gap:9px;min-width:0;padding-top:2px}
.ag-ldg-label{font-size:12.5px;font-weight:650;color:hsl(var(--foreground));min-width:0}

.ag-radar{display:flex;flex-direction:column;gap:12px}
.ag-radar-band{border:1px solid hsl(var(--border));border-radius:14px;background:hsl(var(--muted)/.22);padding:12px}
.ag-radar-lbl{display:inline-block;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:hsl(var(--muted-foreground));margin-bottom:9px}
.ag-radar-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ag-radar-cell{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:12px;background:hsl(var(--card));padding:14px}

.ag-matrix{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr));gap:14px;align-items:start}
.ag-mx-arrow{display:none}
.ag-mx-col{border:1px solid hsl(var(--border));border-top:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-pillars{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:14px;align-items:start}
.ag-pil{display:flex;flex-direction:column;border:1px solid hsl(var(--border));border-top:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}
.ag-pil-cap{margin-bottom:9px}
.ag-pil-body .ag-stage-desc{margin-top:2px}
.ag-pil-body .ag-fan{margin-top:9px}

.ag-circuit{display:flex;flex-direction:column}
.ag-cir-node{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}
.ag-cir-trace{display:block;width:2px;height:16px;margin-left:27px;background:hsl(var(--border))}

.ag-story{display:flex;flex-direction:column;gap:14px}
.ag-story-ch{display:grid;grid-template-columns:auto 1fr;gap:14px;align-items:start;border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}
.ag-story-num{font-size:20px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ag-accent,hsl(var(--muted-foreground)));line-height:1;min-width:2ch}
.ag-story-body .ag-stage-desc{margin-top:2px}
.ag-story-body .ag-fan{margin-top:9px}

.ag-hexgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ag-hexcell{display:grid;grid-template-columns:auto 1fr;gap:9px;align-items:start;border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}
.ag-hexbadge{display:inline-grid;place-items:center;height:26px;width:26px;border-radius:8px;font-weight:700;font-size:12px;background:var(--ag-accent-12,hsl(var(--muted)));color:var(--ag-accent,hsl(var(--foreground)))}
.ag-hexcell-body .ag-fan{margin-top:8px}

.ag-dash{display:flex;flex-direction:column;gap:14px}
.ag-dash-tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.ag-dash-tile{border:1px solid hsl(var(--border));border-radius:12px;background:hsl(var(--card));padding:11px 13px}
.ag-dash-tk{font-size:10px;text-transform:uppercase;letter-spacing:.1em;color:hsl(var(--muted-foreground))}
.ag-dash-tv{font-size:14px;font-weight:650;margin-top:2px;color:hsl(var(--foreground));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ag-dash-flow{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:14px;align-items:start}
.ag-dash-link{display:none}
.ag-dash-cell{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

.ag-network{position:relative}
.ag-net-web{display:none}
.ag-net-nodes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.ag-net-node{border:1px solid hsl(var(--border));border-left:3px solid var(--ag-accent,hsl(var(--border)));border-radius:14px;background:hsl(var(--card));padding:14px}

@media (max-width:640px){
  .ag-orbit-sats,.ag-spot-sats,.ag-radar-row,.ag-hexgrid,.ag-net-nodes,.ag-dash-tiles{grid-template-columns:1fr}
  .ag-ldg-row{grid-template-columns:1fr;gap:8px}
  .ag-casc-item{margin-left:calc(var(--casc-i,0)*10px)}
}

.px-disc { margin: 0 0 14px; }
.px-think { margin: 2px 0 13px; }
.px-disc-head { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; text-align: left; color: hsl(var(--muted-foreground)); -webkit-appearance: none; appearance: none; }
.px-activity { border: 1px solid hsl(var(--border)); border-radius: 12px; background: hsl(var(--card)); overflow: hidden; }
.px-activity .px-disc-head { display: flex; width: 100%; gap: 10px; padding: 10px 13px; color: hsl(var(--foreground)); }
.px-disc-ico { display: inline-flex; flex: none; color: hsl(var(--brand)); }
.px-activity .px-disc-ico.is-done, .px-disc-ico.is-done { color: hsl(var(--brand)); }
.px-disc-lbl { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .15s ease; }
.px-think .px-disc-lbl { font-size: 13px; font-weight: 500; }
.px-activity .px-disc-lbl { flex: 1; max-width: none; font-size: 13.5px; font-weight: 500; color: hsl(var(--foreground)); }
.px-disc-head:hover .px-disc-lbl { color: hsl(var(--foreground)); }
.px-disc-chev { flex: none; color: hsl(var(--muted-foreground)); transition: transform .22s ease; }
.px-disc.is-open .px-disc-chev { transform: rotate(90deg); }
.px-disc-body { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .3s ease, opacity .18s ease; }
.px-disc.is-open .px-disc-body { max-height: 65vh; opacity: 1; overflow-y: auto; }
.px-think .px-think-inner { white-space: pre-wrap; word-break: break-word; font-size: 13px; line-height: 1.65; color: hsl(var(--muted-foreground)); border-left: 2px solid hsl(var(--border)); padding: 3px 4px 6px 14px; margin: 9px 0 2px 6px; max-width: 660px; }
.px-activity.is-open .px-act-body { border-top: 1px solid hsl(var(--border)); }
.px-act-body > .msg-enter { margin: 0; }
.px-act-body > .msg-enter + .msg-enter { border-top: 1px solid hsl(var(--border)); }
.px-act-body > .msg-enter > * { border-top: 0 !important; border-left: 0 !important; border-right: 0 !important; border-bottom: 0 !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; }
.px-disc-spin { display: inline-block; width: 15px; height: 15px; box-sizing: border-box; border-radius: 50%; vertical-align: middle; border: 2px solid hsl(var(--brand) / 0.2); border-top-color: hsl(var(--brand)); animation: px-disc-spin .7s linear infinite; }
@keyframes px-disc-spin { to { transform: rotate(360deg); } }
.px-activity:not(.has-content) { border: 0; background: transparent; border-radius: 0; overflow: visible; }
.px-activity:not(.has-content) .px-disc-head { width: auto; padding: 0; color: hsl(var(--muted-foreground)); }
.px-activity:not(.has-content) .px-disc-lbl { color: hsl(var(--muted-foreground)); }
.px-activity:not(.has-content) .px-disc-chev { display: none; }
.px-activity:not(.has-content) .px-disc-body { display: none; }
.px-activity.has-content { margin: 2px 0 14px; }
.px-disc.is-live .px-disc-lbl { animation: px-disc-sheen 1.5s ease-in-out infinite; }
@keyframes px-disc-sheen { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .px-disc-spin { animation: none; } .px-disc.is-live .px-disc-lbl { animation: none; } }

.px-act-body > .px-act-row { padding: 10px 13px; }
.px-act-body > .px-act-row + .px-act-row { border-top: 1px solid hsl(var(--border)); }
.px-ag-thought + .px-ag-thought { margin-top: 9px; }

/* Message copy / action affordances (Executive Assistant + Agent Builder). TOUCH devices — phones
   AND tablets — have NO hover, so the old width-based md:group-hover left the copy button PERMANENTLY
   INVISIBLE on tablets (>= md width, no pointer hover). Base it on hover CAPABILITY instead: always
   shown + tappable on touch, revealed on hover for mouse users, and always shown on keyboard focus. */
.px-hover-actions { opacity: 1; transition: opacity .16s ease; }
.px-hover-actions:focus-within { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .px-hover-actions { opacity: 0; }
  .group:hover .px-hover-actions,
  .px-hover-actions:hover,
  .px-hover-actions:focus-within { opacity: 1; }
}
.px-copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; width: 26px; border-radius: 7px;
  color: hsl(var(--muted-foreground)); line-height: 1;
  cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: background-color .14s ease, color .14s ease;
}
.px-copy-btn:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.px-copy-btn:active { background: hsl(var(--muted)); }
.px-copy-btn:focus-visible { outline: 2px solid hsl(var(--brand)); outline-offset: 1px; }
.px-copy-btn.is-copied { color: #10b981; }
.px-copy-btn svg { height: 13px; width: 13px; }
@media (pointer: coarse) { .px-copy-btn { height: 34px; width: 34px; min-height: 34px; min-width: 34px; } }

.agc { color: hsl(var(--foreground)); }
.agc-head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; }
.agc-av { flex: none; height: 38px; width: 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: hsl(var(--brand)); background: hsl(var(--brand) / 0.12); }
.agc-titlerow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agc-title { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.agc-sub { font-size: 11.5px; color: hsl(var(--muted-fg)); margin-top: 1px; }
.agc-pill { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; }
.agc-dot { height: 6px; width: 6px; border-radius: 999px; background: currentColor; }
.agc-pill.agc-on { color: #059669; background: rgb(16 185 129 / .12); }
.agc-pill.agc-off { color: hsl(var(--muted-fg)); background: hsl(var(--muted) / .7); }
.agc-pill.agc-paused { color: #d97706; background: rgb(217 119 6 / .12); }
.agc-tag { flex: none; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; text-transform: capitalize;
  color: hsl(var(--muted-fg)); background: hsl(var(--muted) / .7); }
.agc-tag.agc-emerald { color: #059669; background: rgb(16 185 129 / .12); }
.agc-tag.agc-red { color: #dc2626; background: rgb(220 38 38 / .1); }
.agc-tag.agc-amber { color: #d97706; background: rgb(217 119 6 / .12); }
.agc-tag.agc-indigo { color: hsl(var(--brand)); background: hsl(var(--brand) / .12); }
.agc-body { padding: 0 14px 13px; }
.agc-desc { font-size: 12.5px; color: hsl(var(--muted-fg)); line-height: 1.55; margin-bottom: 10px; }
.agc-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.agc-stat { flex: 1; border: 1px solid hsl(var(--border)); border-radius: 12px; padding: 8px 4px; text-align: center; }
.agc-statn { display: block; font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.agc-statl { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: hsl(var(--muted-fg)); margin-top: 1px; }
.agc-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.agc-meta span { font-size: 11px; color: hsl(var(--muted-fg)); background: hsl(var(--muted) / .6); border-radius: 6px; padding: 2px 7px; }
.agc-note { margin-top: 10px; font-size: 11.5px; color: #d97706; background: rgb(217 119 6 / .1); border-radius: 8px; padding: 6px 9px; }
.agc-empty, .agc-more { padding: 12px 14px; font-size: 12px; color: hsl(var(--muted-fg)); }
.agc-more { padding: 8px 14px; font-size: 11px; }
.agc-lsum { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; user-select: none; list-style: none; }
.agc-lsum::-webkit-details-marker { display: none; }
.agc-lav { flex: none; height: 30px; width: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  color: hsl(var(--brand)); background: hsl(var(--brand) / .12); }
.agc-list { border-top: 1px solid hsl(var(--border) / .6); max-height: 340px; overflow-y: auto; }
.agc-row { display: flex; align-items: center; gap: 9px; padding: 9px 14px; }
.agc-row + .agc-row, .agc-step + .agc-step { border-top: 1px solid hsl(var(--border) / .55); }
.agc-rdot { flex: none; height: 7px; width: 7px; border-radius: 999px; background: hsl(var(--muted-fg)); }
.agc-rdot.agc-on, .agc-rdot.agc-emerald { background: #10b981; }
.agc-rdot.agc-off, .agc-rdot.agc-muted { background: hsl(var(--muted-fg) / .55); }
.agc-rdot.agc-paused, .agc-rdot.agc-amber { background: #d97706; }
.agc-rdot.agc-red { background: #dc2626; }
.agc-rdot.agc-indigo { background: hsl(var(--brand)); }
.agc-rt { font-size: 13px; font-weight: 500; }
.agc-rs { font-size: 11px; color: hsl(var(--muted-fg)); margin-top: 1px; }
.agc-out { margin-top: 8px; font-size: 12px; line-height: 1.55; color: hsl(var(--foreground)); background: hsl(var(--muted) / .5);
  border-radius: 10px; padding: 9px 11px; max-height: 220px; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.agc-out.agc-out-err { color: #dc2626; background: rgb(220 38 38 / .08); }
.agc-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; }
.agc-stepn { flex: none; height: 20px; width: 20px; border-radius: 999px; display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: hsl(var(--brand)); background: hsl(var(--brand) / .12); margin-top: 1px; }
.agc-read { max-height: 300px; overflow-y: auto; padding: 12px 14px; font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
  border-top: 1px solid hsl(var(--border) / .6); }
.agc-md { white-space: normal; }
.agc-md > :first-child { margin-top: 0; }
.agc-md > :last-child { margin-bottom: 0; }
.agc-md p { margin: 0 0 7px; }
.agc-md strong { font-weight: 650; }
.agc-md em { font-style: italic; }
.agc-md ul, .agc-md ol { margin: 4px 0 8px; padding-left: 18px; }
.agc-md li { margin: 2px 0; }
.agc-md li > ul, .agc-md li > ol { margin: 2px 0; }
.agc-md h1, .agc-md h2, .agc-md h3, .agc-md h4, .agc-md h5 { font-weight: 650; margin: 11px 0 5px; line-height: 1.3; }
.agc-md h1 { font-size: 15px; }
.agc-md h2 { font-size: 14px; }
.agc-md h3 { font-size: 13px; }
.agc-md h4, .agc-md h5 { font-size: 12.5px; }
.agc-md a { color: hsl(var(--brand)); text-decoration: underline; }
.agc-md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: hsl(var(--muted)); padding: 1px 5px; border-radius: 5px; }
.agc-md pre { background: hsl(var(--muted)); padding: 9px 11px; border-radius: 9px; overflow-x: auto; margin: 0 0 8px; }
.agc-md pre code { background: none; padding: 0; font-size: 11.5px; }
.agc-md blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid hsl(var(--border)); color: hsl(var(--muted-fg)); }
.agc-md hr { border: none; border-top: 1px solid hsl(var(--border)); margin: 10px 0; }
.agc-md table { border-collapse: collapse; font-size: 11.5px; margin: 0 0 8px; display: block; overflow-x: auto; }
.agc-md th, .agc-md td { border: 1px solid hsl(var(--border)); padding: 3px 7px; text-align: left; }
.agc-md th { background: hsl(var(--muted) / .6); font-weight: 600; }
.agc-md img { max-width: 100%; height: auto; border-radius: 8px; }
.px-web-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.agc-live { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); border-radius: 16px; padding: 12px 13px;
  box-shadow: 0 1px 2px hsl(var(--foreground) / .04); }
.agc-live-head { display: flex; align-items: center; gap: 11px; }
.agc-live-icon { flex: none; height: 36px; width: 36px; border-radius: 11px; display: grid; place-items: center;
  color: hsl(var(--brand)); background: hsl(var(--brand) / .1); border: 1px solid hsl(var(--brand) / .18); }
.agc-live-icon svg { height: 19px; width: 19px; }
.agc-live-title { display: block; font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; color: hsl(var(--foreground)); }
.agc-live-phase { display: block; font-size: 11.5px; color: hsl(var(--brand)); margin-top: 1px; }
.agc-lsteps { margin-top: 10px; padding-top: 10px; border-top: 1px solid hsl(var(--border) / .55); display: flex; flex-direction: column; gap: 5px; }
.agc-lstep { display: flex; align-items: flex-start; gap: 8px; }
.agc-lstep-tick { flex: none; color: #10b981; margin-top: 1px; }
.agc-lstep-tick svg { height: 12px; width: 12px; }
.agc-lstep-txt { font-size: 12px; line-height: 1.45; color: hsl(var(--muted-fg)); }
.agc-lq { margin-top: 10px; border: 1px solid rgb(217 119 6 / .3); background: rgb(217 119 6 / .08); border-radius: 11px; padding: 9px 11px; }
.agc-lq-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: #d97706; }
.agc-lq-txt { font-size: 13px; font-weight: 500; line-height: 1.45; color: hsl(var(--foreground)); margin-top: 3px; }
.agc-line { display: flex; align-items: center; gap: 9px; padding: 12px 14px; }
.agc-linetxt { font-size: 13px; color: hsl(var(--foreground)); }
.agc-open { display: flex; align-items: center; justify-content: center; gap: 5px; border-top: 1px solid hsl(var(--border) / .6);
  padding: 9px 12px; font-size: 12px; font-weight: 500; color: hsl(var(--brand)); text-decoration: none; transition: background-color .12s ease; }
.agc-open:hover { background: hsl(var(--brand) / .06); }
.agc-rowlink { text-decoration: none; color: inherit; cursor: pointer; }
.agc-rowarr { flex: none; height: 14px; width: 14px; color: hsl(var(--muted-fg) / .5); transition: color .12s ease; }
.agc-rowlink:hover .agc-rowarr { color: hsl(var(--brand)); }
.agc-open svg { height: 14px; width: 14px; }
.agc-pending { margin-top: 10px; border: 1px solid rgb(217 119 6 / .3); background: rgb(217 119 6 / .08); border-radius: 10px; padding: 9px 11px; }
.agc-plabel { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #d97706; }
.agc-ptext { font-size: 13px; font-weight: 500; color: hsl(var(--foreground)); margin-top: 2px; }
.agc-pdetail { font-size: 11.5px; color: hsl(var(--muted-fg)); margin-top: 2px; }
.agc-pchips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.agc-pchips span { font-size: 11px; color: hsl(var(--foreground)); background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 6px; padding: 2px 8px; }
.agc-qopts { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.agc-qopt { display: block; width: 100%; text-align: left; font-size: 12.5px; font-weight: 500; line-height: 1.4; color: hsl(var(--foreground));
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: 10px; padding: 8px 11px; cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease; }
.agc-qopt:hover { background: hsl(var(--brand) / .07); border-color: hsl(var(--brand) / .45); }
.agc-qhint { margin-top: 7px; font-size: 11px; color: hsl(var(--muted-fg)); }
