/* ============================================================
   ТМК AI — Solid / Expensive
   Product-first, Linear/Anthropic ethos.
   One accent: warm brass. Geist variable everywhere.
   ============================================================ */

:root {
  /* Warm near-black with just enough depth to feel expensive */
  --bg: #0a0a0c;
  --bg-2: #0f0f12;
  --bg-3: #141418;
  --bg-4: #1b1b20;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text: #f4f4f5;
  --text-2: #e4e4e7;
  --muted: #a1a1a9;
  --muted-2: #71717a;

  /* Single accent — antique brass / warm metal */
  --brass: #d4a574;
  --brass-2: #e8bc8a;
  --brass-dim: rgba(212, 165, 116, 0.14);
  --brass-glow: rgba(212, 165, 116, 0.38);

  --display: 'Geist', -apple-system, sans-serif;
  --sans: 'Geist', -apple-system, sans-serif;
  --mono: 'Geist Mono', 'JetBrains Mono', monospace;

  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; max-width: 100%; }
html { scroll-behavior: smooth; overflow-x: hidden; overscroll-behavior-x: none; }

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  overscroll-behavior-x: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'ss02', 'ss03', 'cv11';
  line-height: 1.55;
  letter-spacing: -0.005em;
}

/* Very soft warm glow from top — expensive lighting */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% -20%, rgba(212, 165, 116, 0.10), transparent 60%),
    radial-gradient(ellipse 40% 40% at 100% 110%, rgba(212, 165, 116, 0.04), transparent 70%);
}

/* Whisper-quiet grain — only noticeable in hover */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: var(--brass);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--brass-2); }

::selection { background: var(--brass-dim); color: var(--text); }

/* ============================================================
   DESKTOP: one-screen app shell (no page scroll)
   ============================================================ */
@media (min-width: 641px) {
  html, body { height: 100dvh; overflow: hidden; }
  body { display: flex; flex-direction: column; }
  .top { flex: 0 0 auto; }
  .shell {
    flex: 1 1 auto;
    min-height: 0;
    padding-top: 20px;
    padding-bottom: 16px;
    overflow: hidden;
  }
  .chat-col { min-height: 0; height: 100%; gap: 0; }
  .chat-card { min-height: 0; height: 100%; }
  .viz-col { min-height: 0; height: 100%; gap: 16px; overflow: hidden; }
  .pipe-card { min-height: 0; flex: 1 1 60%; }
  #pipeCanvas { min-height: 0; }
  .branches-card { flex: 0 0 auto; max-height: 40%; display: flex; flex-direction: column; }
  .branches-list { max-height: none; flex: 1 1 auto; min-height: 0; }
  .footer {
    flex: 0 0 auto;
    padding: 8px 32px;
    font-size: 10.5px;
    border-top: 1px solid var(--border);
  }
  .input-wrap { padding: 10px 20px 12px; }
  .kbd-hint { margin-top: 6px; }
  .chat { padding: 20px 28px 14px; }
}

/* ============================================================
   TOP BAR — minimal, product-shell
   ============================================================ */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(10, 10, 12, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 15px;
  color: var(--brass);
  letter-spacing: -0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 24px rgba(212, 165, 116, 0.08);
}
.brand-text { display: flex; flex-direction: column; }
.title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.2;
}
.title span { color: var(--brass); }
.subtitle {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0;
  margin-top: 3px;
  font-weight: 400;
}

.top-right { display: flex; align-items: center; gap: 16px; }
.tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.015);
}
.tag .dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass-glow);
  margin-right: 6px;
  vertical-align: middle;
}
.top-right a.by {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.top-right a.by strong { color: var(--text); font-weight: 500; }

/* Mobile-only top buttons to open sheets — hidden on desktop */
.sheet-btn { display: none; }
.sheet-backdrop { display: none; }

/* ============================================================
   LAYOUT — app shell, asymmetric columns
   ============================================================ */
.shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 28px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 32px 48px;
  min-height: calc(100vh - 72px);
}

@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; padding: 24px 20px 40px; max-width: 760px; }
  .viz-col { order: -1; }
}

@media (max-width: 640px) {
  /* ---- App shell: простой iOS-safe lock без position:fixed ---- */
  html {
    height: 100dvh;
    overflow: hidden;
  }
  body {
    height: 100dvh;
    width: 100%;
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    display: flex;
    flex-direction: column;
    background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(212, 165, 116, 0.08), transparent 60%), var(--bg) !important;
  }
  body::before, body::after { display: none; }

  /* ---- Ultra-compact top bar ---- */
  .top {
    flex: 0 0 auto;
    position: static;
    padding: calc(9px + env(safe-area-inset-top, 0px)) 14px 9px 14px;
    gap: 10px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid var(--border);
  }
  .brand { gap: 10px; min-width: 0; flex: 1; }
  .logo { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }
  .title { font-size: 14px; }
  .subtitle { display: none !important; }
  .top-right { gap: 6px; }
  .top-right .tag,
  .top-right .by { display: none; }

  /* Sheet toggle buttons in header */
  .sheet-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-2);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .sheet-btn:active { background: var(--brass-dim); border-color: var(--brass); color: var(--text); }
  body.sheet-open-pipe .sheet-btn[data-sheet='pipe'],
  body.sheet-open-branches .sheet-btn[data-sheet='branches'] {
    background: var(--brass-dim);
    border-color: var(--brass);
    color: var(--brass-2);
  }

  /* ---- Shell: two-column grid collapses to chat-only ---- */
  .shell {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
    gap: 0;
    display: block;
    overflow: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
  }

  .chat-col {
    height: 100%;
    min-height: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
  }
  .chat-card {
    flex: 1 1 auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .chat-card::before { display: none; }

  .chat-card > .card-label { display: none !important; }

  /* ---- Welcome hero (mobile only) — compact empty state ---- */
  .welcome {
    flex: 0 0 auto;
    padding: 18px 18px 14px;
    text-align: left;
    animation: fadeUp 0.5s ease both;
  }
  .welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--brass-2);
    background: var(--brass-dim);
    border: 1px solid rgba(212, 165, 116, 0.28);
    padding: 5px 10px 5px 9px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 500;
  }
  .welcome-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--brass);
    box-shadow: 0 0 10px var(--brass-glow);
    animation: blink 2.4s infinite;
  }
  .welcome-title {
    font-family: var(--display);
    font-size: 26px;
    line-height: 1.12;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--text);
    margin: 12px 0 8px;
  }
  .welcome-title br { display: block; }
  .welcome-sub {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--muted);
    margin: 0;
    letter-spacing: 0;
    line-height: 1.5;
  }
  /* Hide old bot bubble welcome on mobile — welcome hero replaces it */
  #welcomeMsg { display: none; }
  /* Once chat has real messages, hide the welcome hero */
  .chat.has-messages .welcome { display: none; }

  /* Chat scrolls internally — content pinned to bottom (iMessage feel) */
  .chat {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 14px 10px;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .chat.has-messages { justify-content: flex-end; padding-top: 14px; }
  .chat > .msg:last-child { margin-bottom: 4px; }
  .msg { margin-bottom: 14px; }
  .msg .bubble {
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .msg.bot .bubble table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    font-size: 12px;
  }
  .msg.bot .bubble th, .msg.bot .bubble td { padding: 7px 8px 7px 0; }
  .msg.bot .bubble h2 { font-size: 16px; }
  .msg.bot .bubble h3 { font-size: 14px; }
  .msg.bot .bubble pre, .msg.bot .bubble code { white-space: pre-wrap; word-break: break-word; }

  /* Input pinned at bottom of chat-card */
  .input-wrap {
    flex: 0 0 auto;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg);
  }
  .input-wrap .examples {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 10px;
    padding: 0;
    max-width: 100%;
  }
  .chat.has-messages + .input-wrap .examples { display: none; }
  .input-wrap .examples .ex {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    padding: 11px 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    color: var(--text);
    min-height: 52px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
    -webkit-tap-highlight-color: transparent;
  }
  .input-wrap .examples .ex:active {
    background: var(--brass-dim);
    border-color: var(--brass);
    transform: scale(0.98);
  }
  .input-wrap .examples .ex .ex-ico {
    font-size: 18px;
    flex: 0 0 auto;
    line-height: 1;
    filter: saturate(0.9);
  }
  .input-wrap .examples .ex .ex-t {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
  }
  .input-wrap .examples .ex .ex-t b {
    font-family: var(--display);
    font-size: 12.5px;
    font-weight: 550;
    color: var(--text);
    letter-spacing: -0.005em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .input-wrap .examples .ex .ex-t i {
    font-family: var(--mono);
    font-size: 10px;
    font-style: normal;
    color: var(--muted);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .input-row input { font-size: 15px; padding: 11px 10px; }
  .input-row button { width: 36px; height: 36px; }
  .input-row button[type='submit'] { width: 40px; }
  .kbd-hint { display: none; }

  /* ---- Viz column becomes a bottom sheet ---- */
  .viz-col {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    max-height: 82vh;
    padding: 10px 12px 16px;
    gap: 10px;
    background: var(--bg-2);
    border-top: 1px solid var(--border-strong);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.6);
    transform: translateY(110%);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
  }
  .viz-col::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: 0 auto 10px;
    flex: 0 0 auto;
  }
  .viz-col .pipe-card,
  .viz-col .branches-card { display: none; }
  body.sheet-open-pipe .viz-col,
  body.sheet-open-branches .viz-col { transform: translateY(0); }
  body.sheet-open-pipe .viz-col .pipe-card { display: flex; }
  body.sheet-open-branches .viz-col .branches-card { display: block; }

  .pipe-card { min-height: 360px; }
  .pipe-specs-row { padding: 14px 16px 6px; }
  .pipe-specs { font-size: 22px; }
  #pipeCanvas { min-height: 240px; }
  .pipe-meta { padding: 10px 14px 4px; font-size: 11px; margin: 8px 12px 0; }

  .branches-list { padding: 4px 16px 14px; max-height: 60vh; }
  .branch-row { padding: 10px 0; font-size: 13.5px; }
  .branch-row .city { font-size: 14px; }
  .branch-row .t { font-size: 12.5px; }

  /* Backdrop */
  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  body.sheet-open-pipe .sheet-backdrop,
  body.sheet-open-branches .sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .footer { display: none !important; }
}

/* ============================================================
   CARDS — shared surface style
   ============================================================ */
.card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  letter-spacing: 0.01em;
  padding: 15px 20px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.card-label .k { display: flex; align-items: center; gap: 10px; color: var(--text); }
.card-label .k::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 10px var(--brass-glow);
}
.card-label .m { color: var(--muted); font-size: 11px; font-weight: 400; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-col { display: flex; flex-direction: column; gap: 20px; min-height: 70vh; }

.chat-card { flex: 1; display: flex; flex-direction: column; min-height: 480px; }

.chat {
  flex: 1;
  overflow-y: auto;
  padding: 28px 28px 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.chat::-webkit-scrollbar { width: 4px; }
.chat::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }

.msg {
  margin-bottom: 22px;
  animation: fadeUp 0.4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-role {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.msg.bot .msg-role::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass-glow);
}
.msg.user .msg-role::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.msg .bubble {
  font-size: 15px;
  line-height: 1.68;
  color: var(--text);
  max-width: 680px;
}
.msg.user .bubble {
  color: var(--text);
  font-weight: 500;
  padding-left: 14px;
  border-left: 2px solid var(--brass);
}
.msg.bot .bubble {
  padding-left: 14px;
  border-left: 1px solid var(--border-strong);
}

.msg.bot .bubble strong { color: var(--text); font-weight: 600; }
.msg.bot .bubble em { color: var(--brass); font-style: normal; font-weight: 500; }
.msg.bot .bubble p:first-child { margin-top: 0; }
.msg.bot .bubble p:last-child { margin-bottom: 0; }

.msg.bot .bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 14px 0;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.msg.bot .bubble th, .msg.bot .bubble td {
  padding: 9px 12px 9px 0;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.msg.bot .bubble th {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 8px;
  padding-top: 4px;
}
.msg.bot .bubble tr:hover td { color: var(--text); }

.msg.bot .bubble code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-4);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--brass-2);
  border: 1px solid var(--border);
}
.msg.bot .bubble blockquote {
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  border-left: 1px solid var(--border-strong);
  color: var(--muted);
  font-style: normal;
}
.msg.bot .bubble ul, .msg.bot .bubble ol { padding-left: 20px; margin: 10px 0; }
.msg.bot .bubble li { margin: 4px 0; }
.msg.bot .bubble hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.msg.bot .bubble h2, .msg.bot .bubble h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 18px 0 8px;
}
.msg.bot .bubble h2 { font-size: 18px; }
.msg.bot .bubble h3 { font-size: 15px; }

/* Typing — single quiet pulse */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-left: 12px;
}
.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: tp 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.18s; }
.typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes tp {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; background: var(--brass); }
}

/* ============================================================
   INPUT — quiet, large, product-feel
   ============================================================ */
.input-wrap {
  padding: 14px 20px 20px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.015));
}
.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.examples .ex {
  font-family: var(--sans);
  font-size: 12.5px;
  padding: 7px 13px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  font-weight: 450;
}
.examples .ex:hover {
  color: var(--text);
  border-color: var(--brass);
  background: var(--brass-dim);
}

.input-row {
  display: flex;
  gap: 0;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input-row:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px var(--brass-dim);
}
.input-row input {
  flex: 1;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  outline: none;
  line-height: 1.4;
  letter-spacing: -0.005em;
  font-weight: 450;
}
.input-row input::placeholder { color: var(--muted); }
.input-row button {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: all 0.18s;
  display: grid;
  place-items: center;
}
.input-row button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.input-row button[type='submit'] {
  background: var(--brass);
  color: var(--bg);
  font-weight: 600;
  font-size: 17px;
  width: 44px;
}
.input-row button[type='submit']:hover {
  background: var(--brass-2);
}
.input-row button:disabled { opacity: 0.3; cursor: not-allowed; }
.mic.recording { background: var(--brass) !important; color: var(--bg) !important; }

.kbd-hint {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 10px;
  text-align: right;
}
.kbd-hint kbd {
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  margin: 0 1px;
}

/* ============================================================
   VIZ COLUMN — right sidebar
   ============================================================ */
.viz-col { display: flex; flex-direction: column; gap: 20px; }

.pipe-card {
  padding-bottom: 20px;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}
.pipe-specs-row {
  padding: 16px 20px 6px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.pipe-specs {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'ss01';
}
.pipe-specs .em { color: var(--brass); font-weight: 500; }
.pipe-specs-unit { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 4px; }
.pipe-status {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
}
.pipe-status .live {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 8px var(--brass-glow);
  margin-right: 5px;
  vertical-align: middle;
  animation: blink 2.4s infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

#pipeCanvas {
  flex: 1;
  width: 100% !important;
  min-height: 360px;
  display: block;
}


/* Branches — clean table */
.branches-card {
  padding-bottom: 8px;
}
.branches-list {
  padding: 4px 20px 14px;
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.branches-list::-webkit-scrollbar { width: 3px; }
.branches-list::-webkit-scrollbar-thumb { background: var(--border-strong); }

.branch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--sans);
  font-size: 13.5px;
  position: relative;
}
.branch-row:last-child { border-bottom: 0; }
.branch-row .city { color: var(--text); font-weight: 500; letter-spacing: -0.005em; font-size: 14px; }
.branch-row .t {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brass-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.branch-row .t em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  margin-left: 4px;
}
.branch-row::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1px;
  background: var(--brass);
  width: var(--fill, 0%);
  opacity: 0.45;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 32px 40px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--border);
  letter-spacing: 0;
}
.footer strong { color: var(--text-2); font-weight: 500; }

@media (max-width: 700px) {
  .footer { flex-direction: column; padding: 20px; }
}

/* A11y */
:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
