* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Poppins", "Inter", system-ui, -apple-system, sans-serif;
  background: #0c0f1a;
  color: #e1e5f0;
  font-size: 14px;
  line-height: 1.5;
}
body[data-mode="user"] #progress-card {
  display: none !important;
}
main {
  max-width: 960px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 28px;
}
main > * {
  width: 100%;
}
@media (min-width: 1200px) {
  main { max-width: 1080px; }
}

.brand-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  border: 1px solid #1a2b4a;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(64, 123, 255, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(11, 22, 39, 0.96), rgba(9, 17, 31, 0.96));
}
.brand-banner-copy {
  min-width: 0;
  text-align: left;
}
.brand-banner-logo {
  width: min(100%, 280px);
  justify-self: end;
  height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.96) drop-shadow(0 18px 42px rgba(4, 10, 22, 0.42));
}
.banner-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #25416f;
  background: rgba(16, 31, 56, 0.85);
  color: #85b5ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-banner h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.journey-toggle-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid #1a2b4a;
  border-radius: 18px;
  background: rgba(10, 20, 37, 0.9);
}
.journey-toggle-card > div {
  min-width: 0;
}

.journey-route-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 180px;
}

.route-subtype {
  color: #8ea6c8;
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.call-center-ops {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.session-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.session-history-item {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #1a2b4a;
  background: #0c1528;
  text-align: left;
}

.session-history-item.active {
  border-color: #3b5bdb;
  background: linear-gradient(180deg, rgba(22, 40, 78, 0.96), rgba(13, 24, 44, 0.96));
}

.session-history-item-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-weight: 600;
  color: #edf3ff;
}

.session-history-item-meta,
.session-history-empty {
  color: #8ea6c8;
  font-size: 12px;
  line-height: 1.55;
}

.assist-controls {
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(260px, 1fr) minmax(0, 1.1fr);
  gap: 12px;
  align-items: end;
}

.auto-push-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid #1a2b4a;
  border-radius: 14px;
  background: rgba(8, 17, 33, 0.7);
  color: #d7e4f7;
  cursor: pointer;
}

.auto-push-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auto-push-toggle strong,
.auto-push-toggle small {
  display: block;
}

.auto-push-toggle strong {
  font-size: 12px;
  line-height: 1.2;
}

.auto-push-toggle small {
  margin-top: 3px;
  color: #8ea6c8;
  font-size: 11px;
  line-height: 1.25;
}

.auto-push-track {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #284067;
  background: #0b1426;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.auto-push-track span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #8ea6c8;
  transition: transform 0.18s ease, background 0.18s ease;
}

.auto-push-toggle input:checked + .auto-push-track {
  border-color: #3b82f6;
  background: #174ea6;
}

.auto-push-toggle input:checked + .auto-push-track span {
  transform: translateX(18px);
  background: #fff;
}

.assist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.assist-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.call-note-box {
  min-height: 112px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #1a1f35;
  background: #0c1426;
  color: #a5b7d2;
  white-space: pre-wrap;
}

.call-facts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fact-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #1f345d;
  background: rgba(15, 28, 50, 0.94);
  color: #d7e4f7;
  font-size: 12px;
  line-height: 1.2;
}

/* ── Header ────────────────────────────────────────── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1f35;
}
.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #151b30;
  border: 1px solid #242d4a;
  object-fit: cover;
}
.typing {
  font-size: 12px;
  color: #8892b0;
  padding: 5px 12px;
  border: 1px solid #1e2845;
  border-radius: 20px;
  background: #111728;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.hidden { display: none; }
h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.sub {
  margin: 3px 0 0 0;
  color: #8892b0;
  font-size: 13px;
  line-height: 1.55;
  text-wrap: pretty;
}

/* ── Chat ──────────────────────────────────────────── */
#chat {
  flex: 1;
  background: #0e1225;
  border: 1px solid #1a1f35;
  border-radius: 14px;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
}
.msg {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 80%;
  line-height: 1.55;
  font-size: 14px;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.msg.user {
  align-self: flex-end;
  background: #1e3a6e;
  color: #d4e0f7;
  border-bottom-right-radius: 4px;
}
.msg.assistant {
  align-self: flex-start;
  background: #161c33;
  color: #c8cee0;
  border-bottom-left-radius: 4px;
}
.msg.system {
  align-self: center;
  background: transparent;
  color: #6b7394;
  font-size: 12px;
  padding: 6px 12px;
  border: 1px dashed #242d4a;
  max-width: 90%;
}

/* ── Report block in chat ──────────────────────────── */
.msg-report {
  background: #111a2e;
  border: 1px solid #1e2845;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
}
.msg-report h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #a3b1d6;
  font-weight: 600;
}
.msg-report p {
  margin: 4px 0;
  color: #8e9bc0;
}
.msg-report .report-score {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 13px;
}
.msg-report .report-score.qualified {
  background: rgba(39, 174, 96, 0.15);
  color: #5dd89a;
  border: 1px solid rgba(39, 174, 96, 0.3);
}
.msg-report .report-score.not-qualified {
  background: rgba(217, 154, 43, 0.15);
  color: #e8b84a;
  border: 1px solid rgba(217, 154, 43, 0.3);
}
.msg-report-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.msg-report-actions button {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: 8px;
}

/* ── Cards ─────────────────────────────────────────── */
.card {
  background: #111728;
  border: 1px solid #1a1f35;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

/* ── Progress / Stats Card ─────────────────────────── */
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.pill {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #1a1f35;
  color: #8e9bc0;
  border: 1px solid #242d4a;
}
.pill-good {
  background: rgba(39, 174, 96, 0.12);
  border-color: rgba(39, 174, 96, 0.35);
  color: #5dd89a;
}
.pill-warn {
  background: rgba(217, 154, 43, 0.12);
  border-color: rgba(217, 154, 43, 0.35);
  color: #e8b84a;
}
.progress-bar {
  width: 100%;
  height: 6px;
  background: #0b1020;
  border: none;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar #progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #6366f1);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  font-size: 12px;
  color: #8e9bc0;
}

.records-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #8e9bc0;
  min-width: 0;
}
.records-field span {
  line-height: 1.35;
}
.records-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Responsive breakpoints ────────────────────────── */
@media (min-width: 640px) {
  .progress-meta {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .brand-banner {
    grid-template-columns: 1fr;
  }
  .brand-banner-logo {
    justify-self: start;
    width: min(100%, 240px);
  }
  .journey-toggle-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .journey-route-summary {
    align-items: flex-start;
  }
  .route-subtype {
    text-align: left;
  }
  .call-center-ops,
  .assist-controls,
  .assist-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Form / Input ──────────────────────────────────── */
form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: stretch;
}
input, select {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid #1a1f35;
  background: #0e1225;
  color: #e1e5f0;
  font-size: 14px;
  transition: border-color 0.2s;
}
select {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
input:focus, select:focus {
  outline: none;
  border-color: #3b5bdb;
}

/* ── Buttons ───────────────────────────────────────── */
button {
  padding: 10px 18px;
  border: 1px solid #242d4a;
  border-radius: 10px;
  background: #1a2040;
  color: #c8cee0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}
button:hover {
  background: #212a4a;
  border-color: #3b5bdb;
  color: #e1e5f0;
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
/* Primary action buttons */
button[type="submit"], button.btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
}
button[type="submit"]:hover, button.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}
/* Secondary / subtle buttons */
button.btn-subtle {
  background: transparent;
  border: 1px solid #242d4a;
  color: #8e9bc0;
  font-size: 12px;
  padding: 7px 14px;
}
button.btn-subtle:hover {
  background: #1a1f35;
  color: #c8cee0;
}
/* Icon buttons */
button#mic-btn, button#play-btn, button#upload-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #141a30;
  border: 1px solid #1a1f35;
  color: #8e9bc0;
  border-radius: 10px;
}

button#mic-btn svg,
button#play-btn svg,
button#upload-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 760px) {
  form {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  }
}
button#mic-btn:hover, button#play-btn:hover, button#upload-btn:hover {
  background: #1a2040;
  color: #c8cee0;
}
button#mic-btn.active,
button#play-btn.active {
  background: rgba(39, 174, 96, 0.15);
  border-color: rgba(39, 174, 96, 0.4);
  color: #5dd89a;
}

/* ── Batch Card ────────────────────────────────────── */
#batch-card {
  background: #111728;
  border: 1px solid #1a1f35;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#batch-card.hidden {
  display: none !important;
}
#batch-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
#batch-card .sub {
  margin: 0;
}

/* ── Footer ────────────────────────────────────────── */
footer {
  text-align: center;
  font-size: 11px;
  color: #4a5278;
  padding: 8px 0;
  border-top: 1px solid #141a30;
}
footer span {
  display: inline-block;
  margin: 0 4px;
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #242d4a;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b4570;
}
