@font-face {
  font-family: Montserrat;
  src: url('./montserrat-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url('./montserrat-semibold.woff2') format('woff2');
  font-weight: 500 600;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url('./montserrat-bold.woff2') format('woff2');
  font-weight: 650 900;
  font-display: swap;
}

:root {
  --joycall-blue: #001c70;
  --joycall-hover: #0d3697;
  --joycall-wash: #edf2ff;
  --joycall-border: #d5dff4;
  --nav: var(--joycall-blue);
  --teal: var(--joycall-blue);
  --ink: #162244;
  --muted: #52627d;
  --line: #dce2ee;
  --bg: #f6f8fc;
  --radius: 20px;
  font-family: Montserrat, Arial, sans-serif;
}

.sidebar { color: white; }
.sidebar .joycall-brand { padding: 4px 12px 28px; }
.joycall-brand img.joycall-mark { display: block; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; }
.sidebar .joycall-mark { outline: 1px solid #627cc3; }
.joycall-lockup { line-height: 1.1; letter-spacing: -.04em; }
.joycall-brand .joycall-lockup small { color: #dbe5ff; font-size: 10px; margin-top: 5px; letter-spacing: .01em; }
.login-card .joycall-lockup small { color: var(--muted); }
.nav a { color: #e3ebff; border-radius: 12px; font-size: 14px; }
.nav a:hover { background: #173584; }
.nav a.active { background: white; color: var(--joycall-blue); font-weight: 600; }
.nav .count { background: #1a3c8c; color: white; }
.nav a.active .count { background: var(--joycall-wash); color: var(--joycall-blue); }
.sidebar-bottom { border-color: #375295; }
.sidebar-bottom small, .sidebar-bottom .smalltext { color: #e3ebff; }
.sidebar-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 42px;
  padding: 8px 5px;
  border: 1px solid #728dd2;
  border-radius: 10px;
  background: #183887;
  color: white;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.sidebar-logout:hover { background: #264a9d; border-color: #abc0ff; }
.sidebar-logout svg { flex: 0 0 16px; width: 16px; height: 16px; }
.avatar { background: #234388; }
.agent-avatar { flex: 0 0 36px; object-fit: cover; }
.sidebar :focus-visible { outline: 2px solid #d1e0ff; outline-offset: 2px; }

.topbar .crumb b, .page-heading h1, .login-card h1 { color: var(--joycall-blue); }
.page-heading h1 { font-weight: 700; letter-spacing: -.045em; }
.stat-num { color: var(--joycall-blue); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-head svg { color: #405da5; }
.bar-track { background: var(--joycall-wash); }
.funnel-row:nth-child(n) .bar { background: #264aaa; }
.funnel-row:last-child .bar { background: var(--joycall-blue); }
.taskicon { background: var(--joycall-wash); color: var(--joycall-blue); }
.funnel-row.funnel-link:hover span { color: var(--joycall-blue); }
.niche-tab:hover { background: #f4f6fd; color: var(--joycall-blue); }
.niche-tab.active { background: var(--joycall-wash); color: var(--joycall-blue); }
tbody tr.clickable:hover, .selectionbar { background: #f4f6fd; }

.btn { border-radius: 26px; border-color: var(--joycall-border); }
.btn:hover { background: #f2f5fc; border-color: #a9bce3; }
.btn.primary, .btn.dark { background: var(--joycall-blue); border-color: var(--joycall-blue); color: white; }
.btn.primary:hover, .btn.dark:hover { background: var(--joycall-hover); border-color: var(--joycall-hover); }
.btn.danger { border-color: #e7cac7; }
.btn.danger:hover { background: #fff2f1; border-color: #dba6a2; }

.field, .filters input, .filters select { border-color: var(--joycall-border); border-radius: 12px; }
.field:focus-visible, .filters input:focus-visible, .filters select:focus-visible,
.btn:focus-visible, .niche-tab:focus-visible { outline: 2px solid #365dbc; outline-offset: 2px; }
.script-speech, .script-map-column h2, .turn { background: var(--joycall-wash); }
.turn.user { background: #f5f7fa; }
dialog { border-radius: 22px; box-shadow: 0 24px 80px #001c7040; }
dialog::backdrop { background: #091c4f66; }

.login-shell { background: radial-gradient(ellipse at 50% 15%, #26489b, var(--joycall-blue) 67%); }
.login-card { border-radius: 26px; padding: clamp(24px, 7vw, 40px); box-shadow: 0 22px 60px #06133866; }
.login-card .joycall-brand { margin-bottom: 29px; }
.login-card h1 { font-size: clamp(24px, 5vw, 31px); font-weight: 700; }

.web-test-shell {
  min-height: 100dvh;
  padding: 24px 16px;
}
.web-test-card { width: min(100%, 560px); }
.web-test-card .joycall-brand { padding: 0; }
.web-test-heading { display: flex; align-items: center; gap: 16px; }
.web-test-heading .avatar { flex: 0 0 64px; width: 64px; height: 64px; object-fit: cover; }
.web-test-heading h1 { min-width: 0; line-height: 1.15; letter-spacing: -.035em; }
.web-test-card .web-test-instructions { margin: 20px 0 8px; color: var(--ink); line-height: 1.6; }
.web-test-card .web-test-note { margin: 0 0 24px; line-height: 1.5; }
.web-test-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.web-test-actions .btn { min-height: 46px; }
.web-test-actions [hidden] { display: none; }
.web-test-feedback p { margin: 0; font-size: 13px; line-height: 1.5; }
.web-test-feedback p:not([hidden]):not(:empty) { margin-top: 10px; }
.web-test-feedback #status { color: var(--ink); font-weight: 600; }
.web-test-feedback #quality { color: #78531b; }

@media (max-width: 460px) {
  .web-test-heading { gap: 12px; }
  .web-test-heading .avatar { flex-basis: 48px; width: 48px; height: 48px; }
  .web-test-actions .btn { width: 100%; white-space: normal; }
}

@media (max-width: 850px) {
  .sidebar .joycall-brand { justify-content: center; padding: 0 0 20px; }
  .sidebar .joycall-lockup { display: none; }
}

@media (max-width: 590px) {
  .sidebar .joycall-brand { display: flex; justify-content: flex-start; padding: 15px 16px 8px; }
  .sidebar .joycall-lockup { display: block; font-size: 21px; }
  .sidebar img.joycall-mark { width: 32px; height: 32px; }
  .nav a { flex: 0 0 48px; min-width: 48px; }
  .topbar { height: auto; min-height: 62px; padding-block: 10px; }
  .topbar .crumb { display: block; min-width: 0; }
  .crumb-root { display: none; }
  .topbar .top-actions { flex-wrap: wrap; justify-content: flex-end; }
  .topbar .mode { line-height: 1.2; }
}
