@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-cyrillic.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Geist Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Geologica Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geologica-latin.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --background: oklch(0.995 0.001 90);
  --foreground: oklch(0.18 0.01 60);
  --primary: oklch(0.25 0.01 60);
  --primary-foreground: oklch(0.98 0.002 90);
  --secondary: oklch(0.96 0.005 85);
  --muted: oklch(0.955 0.005 85);
  --muted-foreground: oklch(0.50 0.005 60);
  --accent: oklch(0.94 0.007 80);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.91 0.005 80);
  --ring: oklch(0.65 0.01 60);
  --sidebar: oklch(0.955 0.007 80);
  --sidebar-accent: oklch(0.93 0.01 78);
  --sidebar-border: oklch(0.90 0.007 80);
  --status-success: oklch(0.55 0.15 145);
  --status-warning: oklch(0.62 0.13 75);
  --status-info: oklch(0.5 0.1 250);
  --brand-amber: oklch(0.75 0.16 75);
  --radius: 10px;
  color: var(--foreground);
  background: var(--background);
  font-family: "Geist Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
  scrollbar-color: oklch(0.85 0.005 80) transparent;
  scrollbar-width: thin;
}

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select {
  color: inherit;
  font: inherit;
}

button,
select,
label[for],
[role="option"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid color-mix(in oklch, var(--ring) 65%, transparent);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-wordmark {
  font-family: "Geologica Variable", "Geist Variable", sans-serif;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.brand-product {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
}

.demo-badge,
.mini-status,
.status-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklch, var(--muted) 70%, transparent);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 550;
  line-height: 1;
}

.demo-badge {
  border-color: color-mix(in oklch, var(--brand-amber) 42%, var(--border));
  background: color-mix(in oklch, var(--brand-amber) 12%, var(--background));
  color: oklch(0.45 0.11 70);
  padding: 4px 7px;
  text-transform: lowercase;
}

.eyebrow,
.lane-kicker {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 7px;
}

.muted {
  color: var(--muted-foreground);
}

.primary-button,
.ghost-button,
.icon-button {
  min-height: 34px;
  border-radius: calc(var(--radius) - 2px);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 550;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.primary-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.primary-button:hover {
  background: color-mix(in oklch, var(--primary) 86%, black);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.ghost-button,
.icon-button {
  border: 1px solid var(--border);
  background: var(--background);
}

.ghost-button:hover,
.icon-button:hover {
  background: var(--accent);
}

/* Закрытый вход использует тот же плоский shell, что и основное приложение. */
.login-page {
  background:
    radial-gradient(circle at 50% -15%, color-mix(in oklch, var(--brand-amber) 13%, transparent), transparent 34%),
    var(--background);
}

.login-shell {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 30px;
  border: 1px solid color-mix(in oklch, var(--border) 72%, transparent);
  border-radius: var(--radius);
  background: var(--background);
}

.login-card .eyebrow {
  margin-top: 38px;
  color: oklch(0.48 0.11 70);
}

.login-card h1 {
  max-width: 370px;
  margin: 0;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.18;
  letter-spacing: -0.025em;
}

.login-lead {
  margin: 13px 0 24px;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.55;
}

.login-card form > label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 550;
}

.secret-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.secret-field input,
.search-wrap input,
.search-wrap select,
.speed-control select {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  outline: 0;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.secret-field input {
  min-width: 0;
  padding: 9px 10px;
}

.secret-field input:focus,
.search-wrap input:focus,
.search-wrap select:focus,
.speed-control select:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 12%, transparent);
}

.login-button {
  width: 100%;
  margin-top: 10px;
}

.form-error {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--destructive);
  font-size: 12px;
}

.privacy-note {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid color-mix(in oklch, var(--border) 65%, transparent);
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.5;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
  background: color-mix(in oklch, var(--background) 94%, transparent);
  backdrop-filter: blur(12px);
}

.topbar-actions,
.detail-actions,
.speed-control {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.speed-control {
  gap: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.speed-control select {
  padding: 6px 8px;
}

.workspace {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  min-height: calc(100dvh - 52px);
}

.call-browser {
  position: sticky;
  top: 52px;
  display: flex;
  height: calc(100dvh - 52px);
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  background: var(--sidebar);
}

.browser-head {
  padding: 20px 16px 12px;
}

.browser-head h1 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.browser-head p:last-child {
  margin: 0;
  font-size: 11px;
}

.search-wrap {
  display: grid;
  gap: 7px;
  padding: 0 10px 10px;
}

.search-wrap input,
.search-wrap select {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}

.call-list {
  min-height: 0;
  padding: 0 6px 18px;
  overflow-y: auto;
}

.call-row {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.call-row:hover {
  background: color-mix(in oklch, var(--sidebar-accent) 62%, transparent);
}

.call-row.selected {
  border-color: var(--sidebar-border);
  background: var(--sidebar-accent);
}

.call-row-top,
.cue-head,
.player-label,
.transcript-lane > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.call-row-top strong {
  font-size: 13px;
  font-weight: 600;
}

.call-row-meta,
.call-row-phone {
  color: var(--muted-foreground);
  font-size: 11px;
}

.mini-status {
  padding: 3px 6px;
  font-size: 10px;
}

.status-ready .mini-status,
.status-pill.status-ready {
  border-color: color-mix(in oklch, var(--status-success) 28%, var(--border));
  background: color-mix(in oklch, var(--status-success) 9%, var(--background));
  color: color-mix(in oklch, var(--status-success) 85%, black);
}

.status-running .mini-status,
.status-pill.status-running {
  border-color: color-mix(in oklch, var(--status-warning) 30%, var(--border));
  background: color-mix(in oklch, var(--status-warning) 11%, var(--background));
  color: color-mix(in oklch, var(--status-warning) 82%, black);
}

.status-failed .mini-status,
.status-pill.status-failed {
  border-color: color-mix(in oklch, var(--destructive) 24%, var(--border));
  background: color-mix(in oklch, var(--destructive) 8%, var(--background));
  color: var(--destructive);
}

.comparison {
  min-width: 0;
  padding: clamp(18px, 2.5vw, 32px);
}

.empty-state {
  display: grid;
  min-height: 65vh;
  max-width: 360px;
  margin: auto;
  place-content: center;
  justify-items: center;
  color: var(--muted-foreground);
  text-align: center;
}

.empty-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--border) 60%, transparent);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, oklch(0.62 0.16 300 / 0.15), oklch(0.62 0.13 250 / 0.08), oklch(0.68 0.16 350 / 0.15));
  color: var(--foreground);
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 650;
}

.empty-state h2 {
  margin: 14px 0 5px;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 650;
}

.empty-state p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.detail-view {
  max-width: 1440px;
  margin: 0 auto;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.detail-head .eyebrow {
  margin-bottom: 4px;
}

.detail-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.detail-meta {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.detail-actions {
  gap: 8px;
}

.status-pill {
  padding: 7px 9px;
}

.player-card,
.transcript-lane {
  border: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
  border-radius: var(--radius);
  background: var(--background);
}

.player-card {
  margin-bottom: 12px;
  padding: 12px 14px;
}

.player-label {
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 550;
}

.audio-player {
  width: 100%;
  height: 40px;
}

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in oklch, var(--status-info) 24%, var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--status-info) 7%, var(--background));
  color: color-mix(in oklch, var(--status-info) 78%, black);
  font-size: 12px;
}

.notice-warning {
  border-color: color-mix(in oklch, var(--status-warning) 28%, var(--border));
  background: color-mix(in oklch, var(--status-warning) 9%, var(--background));
  color: color-mix(in oklch, var(--status-warning) 80%, black);
}

.notice-error {
  border-color: color-mix(in oklch, var(--destructive) 24%, var(--border));
  background: color-mix(in oklch, var(--destructive) 7%, var(--background));
  color: var(--destructive);
}

/* Processing остаётся компактным, но показывает, что внутри идёт живая работа. */
.notice-processing {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 66px;
  overflow: hidden;
  border-color: color-mix(in oklch, var(--status-info) 24%, var(--border));
  background:
    radial-gradient(circle at 8% 50%, oklch(0.62 0.16 300 / 0.09), transparent 24%),
    linear-gradient(110deg, color-mix(in oklch, var(--status-info) 7%, var(--background)), color-mix(in oklch, var(--brand-amber) 5%, var(--background)));
  color: var(--foreground);
}

.notice-processing::after {
  position: absolute;
  z-index: -1;
  top: -80%;
  bottom: -80%;
  left: -18%;
  width: 18%;
  background: linear-gradient(90deg, transparent, oklch(1 0 0 / 0.48), transparent);
  content: "";
  filter: blur(5px);
  transform: rotate(12deg);
  animation: processing-scan 4.6s ease-in-out infinite;
}

.processing-visual {
  position: relative;
  display: grid;
  width: 50px;
  height: 40px;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in oklch, var(--status-info) 22%, var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 50%, oklch(0.7 0.15 295 / 0.16), transparent 58%),
    color-mix(in oklch, var(--background) 72%, transparent);
}

.processing-visual::before {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 1px solid oklch(0.67 0.14 285 / 0.22);
  border-radius: 999px;
  content: "";
  animation: processing-orbit 2.8s ease-in-out infinite;
}

.processing-wave {
  position: relative;
  z-index: 1;
  display: flex;
  height: 20px;
  align-items: center;
  gap: 2px;
}

.processing-bar {
  width: 2px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--brand-amber), oklch(0.57 0.14 285));
  transform: scaleY(0.28);
  transform-origin: center;
  animation: processing-wave 1.35s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.processing-bar:nth-child(2),
.processing-bar:nth-child(6) {
  animation-delay: -0.95s;
}

.processing-bar:nth-child(3),
.processing-bar:nth-child(5) {
  animation-delay: -0.68s;
}

.processing-bar:nth-child(4) {
  animation-delay: -0.42s;
}

.processing-copy {
  display: grid;
  gap: 3px;
}

.processing-copy strong {
  font-size: 13px;
  font-weight: 600;
}

.processing-copy > span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.4;
}

@keyframes processing-wave {
  0%, 100% { transform: scaleY(0.28); opacity: 0.58; }
  50% { transform: scaleY(1); opacity: 1; }
}

@keyframes processing-orbit {
  0%, 100% { transform: scale(0.82); opacity: 0.35; }
  50% { transform: scale(1.14); opacity: 0.75; }
}

@keyframes processing-scan {
  0%, 12% { left: -18%; opacity: 0; }
  28% { opacity: 0.7; }
  54%, 100% { left: 112%; opacity: 0; }
}

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

.transcript-lane {
  min-width: 0;
  overflow: hidden;
}

.transcript-lane > header {
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in oklch, var(--border) 70%, transparent);
}

.lane-kicker {
  margin: 0 0 2px;
}

.transcript-lane h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}

.lane-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.source-dot {
  background: var(--muted-foreground);
}

.aigentura-dot {
  background: var(--status-success);
}

.cue-list {
  max-height: 68vh;
  padding: 7px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.cue {
  display: grid;
  width: 100%;
  gap: 5px;
  margin-bottom: 5px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  text-align: left;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.cue.employee {
  background: color-mix(in oklch, var(--status-info) 6%, var(--background));
}

.cue.customer {
  background: color-mix(in oklch, var(--muted) 58%, var(--background));
}

.cue:hover {
  border-color: var(--border);
  background: var(--accent);
}

.cue.active {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--ring) 11%, transparent);
}

.cue-head {
  color: var(--muted-foreground);
  font-size: 11px;
}

.cue-head strong {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 550;
}

.cue-text {
  font-size: 14px;
  line-height: 1.5;
}

.source-lane mark,
.aigentura-lane mark {
  border-radius: 4px;
  padding: 1px 3px;
}

.source-lane mark {
  background: color-mix(in oklch, var(--destructive) 10%, var(--background));
  color: var(--destructive);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.aigentura-lane mark {
  background: color-mix(in oklch, var(--status-success) 12%, var(--background));
  color: color-mix(in oklch, var(--status-success) 82%, black);
  font-weight: 600;
}

.lane-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 30px;
  color: var(--muted-foreground);
  text-align: center;
}

.comparison-note {
  margin: 12px 2px 0;
  color: var(--muted-foreground);
  font-size: 11px;
}

/* В приложении один канонический мобильный брейкпоинт — 768px. */
@media (max-width: 767px) {
  .topbar {
    height: 48px;
    padding: 0 12px;
  }

  .demo-badge,
  .speed-control > :first-child {
    display: none;
  }

  .workspace {
    display: block;
    min-height: calc(100dvh - 48px);
  }

  .call-browser {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .browser-head {
    padding: 16px 12px 10px;
  }

  .search-wrap {
    grid-template-columns: 1fr 1fr;
    padding: 0 8px 8px;
  }

  .search-wrap input,
  .search-wrap select,
  .secret-field input {
    font-size: 16px;
  }

  .call-list {
    display: flex;
    gap: 4px;
    padding: 0 8px 10px;
    overflow-x: auto;
  }

  .call-row {
    min-width: 210px;
  }

  .comparison {
    padding: 16px 10px 28px;
  }

  .detail-head {
    display: grid;
    gap: 12px;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .compare-grid {
    grid-template-columns: 1fr;
  }

  .cue-list {
    max-height: 55vh;
  }

  .login-shell {
    padding: 12px;
  }

  .login-card {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-processing::after,
  .processing-visual::before,
  .processing-bar {
    animation: none;
  }

  .processing-bar:nth-child(2),
  .processing-bar:nth-child(6) {
    transform: scaleY(0.55);
  }

  .processing-bar:nth-child(3),
  .processing-bar:nth-child(5) {
    transform: scaleY(0.8);
  }
}
