/* ==========================================================================
   AI Dispečer — demo pro dopravní firmy
   Design tokeny převzaté z 88 Leads CRM (Monolith Obsidian), aby to sedělo
   na produkt, který už máme hotový.
   ========================================================================== */

:root {
  --bg-0: #0a0a0f;
  --bg-1: #0e0b1a;
  --surf: #16131f;
  --surf-high: #201b30;
  --surf-highest: #2a2440;

  --text-1: #f5f5fa;
  --text-2: rgba(245, 245, 250, 0.64);
  --text-3: rgba(245, 245, 250, 0.44);

  --brand: #7c6cff;
  --brand-hover: #9b8dff;
  --brand-subtle: rgba(124, 108, 255, 0.12);

  --teal: #22d3ee;
  --teal-subtle: rgba(34, 211, 238, 0.12);
  --ok: #34d399;
  --ok-subtle: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-subtle: rgba(251, 191, 36, 0.14);
  --bad: #fb7185;
  --bad-subtle: rgba(251, 113, 133, 0.14);

  --line: rgba(255, 255, 255, 0.10);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.18);

  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.55);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;

  --sidebar: 232px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(38% 38% at 18% 12%, rgba(124, 108, 255, 0.16) 0%, transparent 70%),
    radial-gradient(32% 32% at 84% 8%, rgba(34, 211, 238, 0.10) 0%, transparent 70%),
    radial-gradient(30% 34% at 72% 88%, rgba(244, 114, 182, 0.07) 0%, transparent 70%);
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; }
a { color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surf-highest); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ layout ============================ */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  height: 100vh;
}

/* ---- sidebar ---- */
.sidebar {
  border-right: 1px solid var(--line-soft);
  background: rgba(14, 11, 26, 0.62);
  backdrop-filter: blur(28px) saturate(160%);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  gap: 22px;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--teal));
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(124, 108, 255, 0.35);
  flex: none;
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-name { font-weight: 650; letter-spacing: -0.03em; font-size: 15px; line-height: 1.1; }
.brand-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); padding: 0 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; text-align: left; width: 100%;
  transition: background .15s, color .15s;
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-1); }
.nav-item.is-active { background: var(--brand-subtle); color: var(--text-1); }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.nav-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 600;
  background: var(--bad-subtle); color: var(--bad);
  padding: 1px 7px; border-radius: 99px;
}
.nav-badge.is-quiet { background: rgba(255,255,255,.07); color: var(--text-3); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.workspace {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
}
.avatar {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: linear-gradient(135deg, #4f46e5, #7c6cff); color: #fff;
}
.workspace-name { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.workspace-sub { font-size: 10.5px; color: var(--text-3); }

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

.topbar {
  height: 58px; flex: none;
  display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(20px);
}
.page-title { font-size: 15.5px; font-weight: 650; }
.page-sub { font-size: 12px; color: var(--text-3); }

.demo-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--warn);
  background: var(--warn-subtle); border: 1px solid rgba(251, 191, 36, 0.28);
  padding: 5px 11px; border-radius: 99px; font-weight: 600;
}
.clock { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); letter-spacing: -0.02em; }

.scroll { overflow-y: auto; flex: 1; padding: 20px 22px 40px; }

.page { display: none; animation: fade .3s ease both; }
.page.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================ atoms ============================ */

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-bottom: 1px solid var(--line-soft);
}
.card-title { font-size: 13.5px; font-weight: 650; }
.card-note { font-size: 11.5px; color: var(--text-3); margin-left: auto; }
.card-body { padding: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: 13px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line);
  transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), #6b5bff);
  border-color: transparent; color: #fff;
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.28);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-hover), #7c6cff); }
.btn-ok { background: var(--ok-subtle); border-color: rgba(52,211,153,.3); color: var(--ok); }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 99px;
  background: rgba(255,255,255,.06); color: var(--text-2); white-space: nowrap;
}
.tag-ok { background: var(--ok-subtle); color: var(--ok); }
.tag-warn { background: var(--warn-subtle); color: var(--warn); }
.tag-bad { background: var(--bad-subtle); color: var(--bad); }
.tag-brand { background: var(--brand-subtle); color: var(--brand-hover); }
.tag-teal { background: var(--teal-subtle); color: var(--teal); }
.dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; flex: none; }

.muted { color: var(--text-3); }
.mono { font-family: var(--mono); }

/* ============================ stat row ============================ */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.stat {
  position: relative; overflow: hidden;
  padding: 14px 16px; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
  border: 1px solid var(--line);
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -40px;
  width: 110px; height: 110px; border-radius: 99px;
  background: radial-gradient(circle, var(--glow, rgba(124,108,255,.20)), transparent 70%);
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.035em; margin-top: 5px; line-height: 1; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.stat-foot { font-size: 11.5px; color: var(--text-2); margin-top: 7px; display: flex; align-items: center; gap: 5px; }

/* ============================ mapa ============================ */

.dispatch-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 14px; align-items: start; }

.map-card { position: relative; overflow: hidden; padding: 0; }
.map-wrap { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(180deg, #0b0a14, #0a0a10); }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-land path {
  fill: rgba(124, 108, 255, 0.085);
  stroke: rgba(255, 255, 255, 0.17);
  stroke-width: 0.9;
  vector-effect: non-scaling-stroke;
}
.map-grid line { stroke: rgba(255,255,255,.035); stroke-width: 1; vector-effect: non-scaling-stroke; }
.route { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linecap: round; opacity: .55; }
.route-done { stroke-dasharray: none; }
.route-rest { stroke-dasharray: 5 7; opacity: .45; }

.city { pointer-events: none; }
.city circle { fill: rgba(255,255,255,.55); }
.city text { fill: rgba(245,245,250,.55); font-size: 6.4px; font-family: var(--font); font-weight: 500; }

.truck { cursor: pointer; }
.truck .halo { opacity: .30; }
.truck .core { stroke: rgba(10,10,15,.9); stroke-width: 2; vector-effect: non-scaling-stroke; }
.truck .plate {
  font-size: 6.6px; font-weight: 700; font-family: var(--mono);
  fill: var(--text-1); paint-order: stroke; stroke: rgba(8,8,14,.85); stroke-width: 2.2px;
}
.truck.is-late .halo { animation: pulse 1.05s ease-in-out infinite; }
.truck.is-stopped .halo { animation: pulse 1.7s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .12; transform: scale(.85); } 50% { opacity: .5; transform: scale(1.35); } }
.truck .halo { transform-box: fill-box; transform-origin: center; }

.map-legend {
  position: absolute; left: 14px; bottom: 14px;
  display: flex; gap: 14px; align-items: center;
  padding: 9px 13px; border-radius: 12px;
  background: rgba(10, 10, 15, 0.72); backdrop-filter: blur(14px);
  border: 1px solid var(--line-soft); font-size: 11.5px; color: var(--text-2);
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 99px; }

.map-hint {
  position: absolute; right: 14px; top: 14px;
  padding: 7px 12px; border-radius: 10px; font-size: 11.5px; color: var(--text-2);
  background: rgba(10, 10, 15, 0.72); backdrop-filter: blur(14px); border: 1px solid var(--line-soft);
}

/* ============================ Jarvis panel (Telegram) ============================ */

.jarvis { display: flex; flex-direction: column; max-height: calc(100vh - 210px); }
.jarvis-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.jarvis-ava {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #22d3ee, #7c6cff);
  display: grid; place-items: center; box-shadow: 0 4px 16px rgba(34,211,238,.25);
}
.jarvis-ava svg { width: 17px; height: 17px; }
.jarvis-name { font-size: 13px; font-weight: 650; }
.jarvis-state { font-size: 11px; color: var(--ok); display: flex; align-items: center; gap: 5px; }
.jarvis-feed { padding: 14px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; min-height: 320px; }

.msg { max-width: 92%; animation: pop .32s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.msg-bubble {
  background: var(--surf-high); border: 1px solid var(--line-soft);
  border-radius: 14px 14px 14px 4px; padding: 10px 13px;
  font-size: 12.8px; line-height: 1.5; color: var(--text-1);
}
.msg.me { margin-left: auto; }
.msg.me .msg-bubble {
  background: linear-gradient(135deg, rgba(124,108,255,.85), rgba(107,91,255,.85));
  border-radius: 14px 14px 4px 14px; border-color: transparent; color: #fff;
}
.msg-time { font-size: 10px; color: var(--text-3); margin-top: 4px; padding: 0 4px; }
.msg-title { font-weight: 650; display: block; margin-bottom: 3px; }
.msg b { font-weight: 650; }
.msg-actions { display: flex; gap: 8px; margin-top: 10px; }

.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing span {
  width: 6px; height: 6px; border-radius: 99px; background: var(--text-3);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.jarvis-foot { padding: 10px 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; }
.fake-input {
  flex: 1; background: var(--bg-0); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--text-3);
}

/* ============================ hovor (modal) ============================ */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 5, 12, 0.72); backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.overlay.is-open { opacity: 1; pointer-events: auto; }
.call {
  width: min(680px, 100%); max-height: 88vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #191527, #121020);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.98); transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
  overflow: hidden;
}
.overlay.is-open .call { transform: none; }

.call-head { display: flex; align-items: center; gap: 13px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.call-ava {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
  background: linear-gradient(135deg, #f59e0b, #fb7185); color: #fff;
}
.call-name { font-size: 15px; font-weight: 650; }
.call-num { font-size: 12px; color: var(--text-3); font-family: var(--mono); }
.call-timer { margin-left: auto; text-align: right; }
.call-timer .t { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.call-timer .s { font-size: 11px; color: var(--ok); }

.ring { display: flex; align-items: center; gap: 10px; }
.ring i {
  width: 4px; border-radius: 99px; background: var(--teal); display: block;
  animation: eq .9s ease-in-out infinite;
}
@keyframes eq { 0%,100% { height: 8px; opacity: .4; } 50% { height: 22px; opacity: 1; } }

.lang-switch { display: flex; gap: 6px; padding: 12px 18px 0; }
.lang-btn {
  font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 99px;
  background: rgba(255,255,255,.05); border: 1px solid var(--line-soft); color: var(--text-2);
}
.lang-btn.is-active { background: var(--brand-subtle); border-color: rgba(124,108,255,.4); color: var(--brand-hover); }

.transcript { padding: 14px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.line { display: flex; gap: 11px; animation: pop .3s ease both; }
.line-who {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  width: 58px; flex: none; padding-top: 3px; color: var(--text-3);
}
.line.ai .line-who { color: var(--brand-hover); }
.line.drv .line-who { color: var(--warn); }
.line-body { flex: 1; }
.line-native { font-size: 13.5px; line-height: 1.45; }
.line-cz { font-size: 12px; color: var(--text-3); margin-top: 3px; font-style: italic; }

.call-foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; align-items: center; }
.btn-hangup { background: var(--bad-subtle); border-color: rgba(251,113,133,.35); color: var(--bad); }

/* ============================ automatické akce ============================ */

.actions-card { margin-top: 14px; }
.action-row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 0; border-bottom: 1px dashed var(--line-soft);
  animation: pop .35s ease both;
}
.action-row:last-child { border-bottom: none; }
.action-check {
  width: 20px; height: 20px; border-radius: 99px; flex: none; margin-top: 1px;
  display: grid; place-items: center;
  background: var(--ok-subtle); color: var(--ok);
}
.action-check svg { width: 12px; height: 12px; }
.action-main { flex: 1; min-width: 0; }
.action-title { font-size: 13px; font-weight: 600; }
.action-detail { font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.action-time { font-size: 11px; color: var(--text-3); font-family: var(--mono); }

.sms-preview {
  margin-top: 8px; padding: 10px 12px; border-radius: 10px;
  background: rgba(52, 211, 153, 0.07); border: 1px solid rgba(52, 211, 153, 0.22);
  font-size: 12.2px; line-height: 1.5; color: var(--text-1);
}
.sms-preview .to { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* ============================ drawer (karta řidiče) ============================ */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: linear-gradient(180deg, #17142380, #101020);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 64px rgba(0,0,0,.5);
  transform: translateX(100%); transition: transform .32s cubic-bezier(.3,.8,.3,1);
  z-index: 70; display: flex; flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer-head { padding: 18px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 13px; align-items: center; }
.drawer-body { padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.kv { display: grid; grid-template-columns: 116px 1fr; gap: 7px 10px; font-size: 12.8px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; font-weight: 500; }
.sect-title { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); margin-bottom: 9px; }

.doc-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line-soft);
  font-size: 12.5px;
}
.doc-row + .doc-row { margin-top: 6px; }
.doc-row .name { flex: 1; }

.close-x {
  margin-left: auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: var(--text-3);
  background: rgba(255,255,255,.05);
}
.close-x:hover { color: var(--text-1); background: rgba(255,255,255,.1); }

/* ============================ tabulky ============================ */

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-3); font-weight: 600; padding: 0 14px 10px; white-space: nowrap;
}
.table td { padding: 12px 14px; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(255,255,255,.03); }
.table .clickable { cursor: pointer; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
.person .n { font-weight: 600; }
.person .m { font-size: 11.5px; color: var(--text-3); }

/* ============================ nábor (kanban) ============================ */

.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.col-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
  font-size: 11.5px; font-weight: 650; color: var(--text-2);
}
.col-count {
  font-size: 10.5px; background: rgba(255,255,255,.07); color: var(--text-3);
  padding: 1px 7px; border-radius: 99px;
}
.col-body {
  background: rgba(255,255,255,.02); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 8px; min-height: 190px;
  display: flex; flex-direction: column; gap: 7px;
}
.chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  background: var(--surf); border: 1px solid var(--line-soft); border-radius: 10px;
  font-size: 12px; animation: pop .3s ease both; transition: transform .2s, opacity .3s;
}
.chip .avatar { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
.chip.is-out { opacity: .4; }
.chip.is-out .n { text-decoration: line-through; }

/* ============================ asistent ============================ */

.assistant { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.chat { display: flex; flex-direction: column; min-height: 520px; }
.chat-feed { padding: 18px; display: flex; flex-direction: column; gap: 13px; flex: 1; overflow-y: auto; max-height: 62vh; }
.chat-input { padding: 12px; border-top: 1px solid var(--line-soft); display: flex; gap: 9px; }
.chat-input input {
  flex: 1; background: var(--bg-0); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 14px; font-size: 13px; outline: none;
}
.chat-input input:focus { border-color: rgba(124,108,255,.5); box-shadow: 0 0 0 3px rgba(124,108,255,.12); }
.presets { display: flex; flex-direction: column; gap: 8px; }
.preset {
  text-align: left; padding: 11px 13px; border-radius: 12px; font-size: 12.5px; line-height: 1.45;
  background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); color: var(--text-2);
  transition: background .15s, border-color .15s, color .15s;
}
.preset:hover { background: var(--brand-subtle); border-color: rgba(124,108,255,.35); color: var(--text-1); }

.artifact {
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: rgba(255,255,255,.025); animation: pop .35s ease both;
}
.artifact-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: rgba(255,255,255,.04); font-size: 11.5px; font-weight: 650; color: var(--text-2);
  border-bottom: 1px solid var(--line-soft);
}
.artifact-head svg { width: 14px; height: 14px; }
.artifact-body { padding: 12px; font-size: 12.5px; line-height: 1.55; }
.artifact-body .row { display: flex; gap: 8px; }
.artifact-body .row + .row { margin-top: 4px; }
.artifact-body .k { color: var(--text-3); min-width: 72px; }

/* ============================ ekonomika ============================ */

.econ { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; align-items: start; }
.slider-row { margin-bottom: 20px; }
.slider-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.slider-label { font-size: 12.5px; color: var(--text-2); }
.slider-val { margin-left: auto; font-size: 19px; font-weight: 700; letter-spacing: -.03em; }
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 5px; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand) var(--pct, 40%), rgba(255,255,255,.1) var(--pct, 40%));
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 19px; height: 19px; border-radius: 99px;
  background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.4); cursor: grab;
  border: 3px solid var(--brand);
}
.result {
  background: linear-gradient(160deg, rgba(124,108,255,.14), rgba(34,211,238,.06));
  border: 1px solid rgba(124,108,255,.28); border-radius: var(--r);
  padding: 20px; text-align: center;
}
.result-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.result-value { font-size: 40px; font-weight: 800; letter-spacing: -.045em; margin: 8px 0 2px; line-height: 1; }
.result-sub { font-size: 12.5px; color: var(--text-2); }

.pitch-list { display: flex; flex-direction: column; gap: 11px; }
.pitch-item { display: flex; gap: 11px; font-size: 13px; line-height: 1.55; }
.pitch-num {
  width: 22px; height: 22px; border-radius: 8px; flex: none; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; background: var(--brand-subtle); color: var(--brand-hover);
}

/* ============================ pomocné ============================ */

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-14 { margin-top: 14px; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.section-head h2 { font-size: 16px; font-weight: 680; }
.section-head p { margin: 0; font-size: 12.5px; color: var(--text-3); }

.hint-bar {
  display: flex; align-items: center; gap: 10px; font-size: 12.3px; color: var(--text-2);
  background: rgba(34, 211, 238, 0.07); border: 1px solid rgba(34, 211, 238, 0.2);
  padding: 10px 14px; border-radius: 12px; margin-bottom: 14px;
}
.hint-bar svg { width: 16px; height: 16px; color: var(--teal); flex: none; }
.hint-bar kbd {
  font-family: var(--mono); font-size: 11px; background: rgba(255,255,255,.1);
  padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line);
}

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px);
  background: var(--surf-high); border: 1px solid var(--line-strong);
  padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 550;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; z-index: 90;
  transition: opacity .25s, transform .25s; display: flex; align-items: center; gap: 9px;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: var(--ok); }

@media (max-width: 1240px) {
  .dispatch-grid, .assistant, .econ { grid-template-columns: minmax(0, 1fr); }
  .jarvis { max-height: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .kanban { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
