:root {
  --ink: #242424;
  --muted: #62676d;
  --line: #dde4eb;
  --bg: #f8f9fb;
  --accent: #007f98;
  --brand: #00a8c1;
  --quality-handled: #76c8c9;
  --quality-partial: #e9c367;
  --quality-poor: #e99898;
  --quality-unknown: #bdc5d0;
  --soft: #eafaff;
  --danger: #9a5010;
  --danger-bg: #fff2da;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
button,
input,
select {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  background: white;
  color: var(--ink);
}
button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  font-weight: 600;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
input,
select {
  padding: 9px 11px;
  max-width: 100%;
}
button:hover:not(:disabled) {
  background: var(--soft);
}
:focus-visible {
  outline: 3px solid #007f98;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin-bottom: 6px;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.3px;
}
h3 {
  font-size: 15px;
}
p {
  line-height: 1.6;
}
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  vertical-align: middle;
}
.app {
  display: grid;
  grid-template-columns: 226px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  background: white;
  padding: 28px 16px 18px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.7px;
  padding: 0 10px;
}
.brand span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
nav {
  display: grid;
  gap: 6px;
  margin-top: 38px;
}
nav button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 14px;
  font-size: 14px;
}
nav button[aria-current='page'] {
  color: var(--accent);
  background: var(--soft);
}
.nav-count {
  margin-left: auto;
  font-size: 11px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--danger-bg);
  color: var(--danger);
}
.sidebar-bottom {
  margin-top: auto;
  padding: 16px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.sidebar-bottom .icon {
  margin-right: 5px;
  width: 15px;
}
.text-button {
  border: 0;
  min-height: 30px;
  padding: 4px 0;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
}
.sidebar-bottom button {
  display: block;
  margin-top: 8px;
}
main {
  min-width: 0;
  padding: 28px 26px 14px;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 25px;
}
.page-header p {
  color: var(--muted);
  margin: 0;
}
.header-actions {
  display: flex;
  gap: 12px;
}
#mobileLogout {
  display: none;
}
.outline {
  background: white;
  color: var(--accent);
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover:not(:disabled) {
  background: #8d2303;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.channel-tabs {
  display: flex;
  gap: 0;
}
.channel-tabs button {
  border-radius: 0;
  border-right-width: 0;
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 13px;
}
.channel-tabs button:first-child {
  border-radius: 8px 0 0 8px;
}
.channel-tabs button:last-child {
  border-radius: 0 8px 8px 0;
  border-right-width: 1px;
}
.channel-tabs button[aria-pressed='true'] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.filter-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-controls label {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.filter-controls input,
.filter-controls select {
  font-size: 12px;
}
.search-label {
  position: relative;
}
.search-label .icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
}
.search-label input {
  padding-left: 35px;
  width: 200px;
}
.filter-controls input[type='date'] {
  width: 128px;
  padding: 9px 6px;
}
.result-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  margin: 12px 0 9px;
  min-height: 26px;
}
.page-error {
  background: #fff3ef;
  border: 1px solid #f0c4b6;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  color: #934020;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(300px, 1.55fr) minmax(
      220px,
      0.8fr
    );
  gap: 8px;
  min-height: 550px;
  height: calc(100vh - 260px);
}
.analysis-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.metrics.insight-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.insight-distribution,
.insight-trend {
  padding: 24px;
}
.insight-distribution .card-subtitle,
.insight-trend .card-subtitle,
.insight-metrics .metric-note {
  font-size: 13px;
}
.insight-scope {
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0;
}
.insight-bar {
  margin-top: 20px;
  display: block;
  width: 100%;
  padding: 8px;
  text-align: left;
  background: transparent;
  border-color: transparent;
}
.insight-bar:hover {
  background: var(--soft);
  border-color: var(--line);
}
.insight-bar:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.insight-bar > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}
.insight-bar .track {
  height: 12px;
}
.insight-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 14px;
  margin: 20px 0;
}
.insight-legend span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.insight-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.insight-chart {
  width: 100%;
  height: 230px;
}
.insight-chart-scroll {
  overflow-x: auto;
}
.insight-total-value,
.insight-segment-value {
  font-size: 12px;
  font-weight: 600;
  fill: #000;
}
.insight-dates {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.insight-table {
  overflow-x: auto;
  margin-top: 14px;
}
.insight-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.insight-table th,
.insight-table td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 760px) {
  .metrics.insight-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .insight-grid {
    grid-template-columns: 1fr;
  }
  .insight-distribution,
  .insight-trend {
    padding: 18px;
  }
}
.conversation-panel,
.dialogue,
.context,
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.conversation-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.list-heading {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 15px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.list-heading span {
  font-size: 10px;
  color: var(--muted);
}
.conversation-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.conversation-row {
  width: 100%;
  display: block;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 17px 18px;
  background: white;
  position: relative;
  font-weight: 400;
}
.conversation-row[aria-pressed='true'] {
  background: var(--soft);
}
.conversation-row[aria-pressed='true']::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent);
}
.row-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 7px;
}
.row-title strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.row-title time {
  color: var(--muted);
  white-space: nowrap;
  font-size: 10px;
  padding-top: 3px;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eef2f6;
  border-radius: 10px;
  font-size: 10px;
  padding: 3px 7px;
  color: #3b4b61;
}
.badge .icon {
  width: 12px;
  height: 12px;
}
.badge.warning {
  background: var(--danger-bg);
  color: var(--danger);
}
.badge.positive {
  background: #fff1ea;
  color: #a92a03;
}
.preview {
  display: block;
  color: #46556a;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 7px;
}
.exchange-count {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.pager {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.pager button {
  font-size: 10px;
  min-height: 30px;
  padding: 6px 8px;
}
.pager span {
  font-size: 10px;
  color: var(--muted);
}
.dialogue {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dialogue-header {
  padding: 20px;
  border-bottom: 1px solid var(--line);
}
.dialogue-header h2 {
  font-size: 18px;
  margin-bottom: 10px;
  overflow-wrap: anywhere;
}
.dialogue-header .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  flex-wrap: wrap;
}
.dialogue-header .badge {
  margin: 0;
}
.messages {
  padding: 22px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.message {
  max-width: 91%;
  margin-bottom: 18px;
}
.message.customer {
  margin-left: auto;
}
.speaker {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
  font-size: 12px;
}
.customer .speaker,
.customer .message-time {
  text-align: right;
}
.bubble {
  padding: 13px 16px;
  background: #eef2f6;
  border-radius: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.customer .bubble {
  background: var(--soft);
}
.message-time {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.feedback {
  margin-top: 7px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.attachment {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 12px;
}
.attachment img {
  display: block;
  width: 100%;
  max-width: 280px;
  max-height: 180px;
  object-fit: contain;
  margin-top: 6px;
  border-radius: 8px;
}
.transcript-footer {
  border-top: 1px dashed var(--line);
  margin-top: 20px;
  padding: 18px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}
mark {
  color: inherit;
  background: #fff0b3;
  border-radius: 2px;
}
.context {
  padding: 22px 18px;
  overflow: auto;
  font-size: 15px;
  line-height: 1.6;
}
.context h2 {
  font-size: 21px;
  margin-bottom: 24px;
}
dl {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 17px 10px;
  font-size: 12px;
  margin: 0;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.context-section {
  margin-top: 25px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.action {
  color: #46556a;
  font-size: 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}
.action .icon {
  width: 14px;
  margin-right: 6px;
  color: var(--accent);
}
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.daily-counts {
  margin-top: 14px;
}
.daily-counts summary {
  font-weight: 400;
  font-size: 11px;
}
.context p {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 10px;
}
.context dl,
.context .action {
  font-size: 14px;
}
.context h3 {
  font-size: 18px;
}
.context h4 {
  font-size: 15px;
  margin: 20px 0 10px;
}
.context .badge {
  font-size: 13px;
  padding: 5px 10px;
}
#classificationResult > p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}
#classificationResult .text-button {
  display: block;
  width: 100%;
  text-align: left;
  font-size: 15px;
  line-height: 1.6;
  margin: 10px 0;
  white-space: normal;
}
.overall-assessment {
  padding: 18px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f3f6f9;
}
.overall-assessment.handled_well {
  background: #fff1ea;
  border-color: #edb29f;
}
.overall-assessment.partially_handled {
  background: #fff7e8;
  border-color: #ead3a5;
}
.overall-assessment.poorly_handled {
  background: #fff0ed;
  border-color: #edc6bd;
}
.overall-assessment strong {
  display: block;
  font-size: 22px;
  line-height: 1.3;
  margin: 6px 0 12px;
}
.context .overall-assessment p {
  color: var(--ink);
  font-size: 15px;
}
.assessment-label,
.assessment-confidence {
  font-size: 14px;
  color: #46556a;
}
.quality-signal {
  border-left: 3px solid #c18b37;
  padding-left: 12px;
  margin-bottom: 16px;
}

.recording-button {
  width: 100%;
  margin: 7px 0;
  font-size: 11px;
}
audio {
  width: 100%;
  margin-top: 10px;
  height: 38px;
}
.empty {
  padding: 35px 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  font-size: 13px;
}
.empty h2 {
  color: var(--ink);
  font-size: 17px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.metric {
  display: block;
  text-align: left;
  padding: 22px;
}
.metric-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  margin-bottom: 12px;
}
.metric-value {
  display: block;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}
.metric-note {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
}
.overview-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 16px;
}
.card {
  padding: 24px;
}
.card-subtitle {
  color: var(--muted);
  font-size: 11px;
  margin-top: -6px;
}
#analysisActions .card-subtitle {
  margin: 12px 0 0;
  line-height: 1.6;
}
#analysisProgress:empty {
  display: none;
}
.chart {
  width: 100%;
  height: 200px;
  display: block;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  margin-top: 8px;
}
.channel-breakdown {
  margin-top: 25px;
}
.channel-stat {
  margin-bottom: 22px;
}
.channel-stat-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12px;
}
.channel-stat-top span:first-child {
  display: flex;
  gap: 7px;
  align-items: center;
}
.track {
  height: 7px;
  border-radius: 6px;
  background: #edf1f5;
  overflow: hidden;
}
.track span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}
.overview-review {
  margin-top: 16px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 15px 0;
  text-align: left;
  font-weight: 400;
}
.review-row strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.review-row small {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
}
.report-note {
  margin-top: 15px;
  font-size: 10px;
  color: var(--muted);
}
.back-button {
  display: none;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 40px;
  width: min(460px, 100%);
}
.login-card .brand {
  padding: 0;
  margin-bottom: 34px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card p {
  color: var(--muted);
  font-size: 13px;
}
.login-card label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 24px 0 8px;
}
.login-card input,
.login-card button {
  width: 100%;
  margin-bottom: 12px;
}
.error {
  color: #a33a2d !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
@media (max-width: 1200px) {
  .app {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  main {
    padding: 24px 18px;
  }
  .workspace {
    grid-template-columns: 240px minmax(0, 1fr);
    height: auto;
  }
  .context {
    grid-column: 2;
    max-height: 360px;
  }
  .dialogue,
  .conversation-panel {
    height: 650px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 18px;
  }
}
@media (max-width: 760px) {
  .header-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .header-actions button {
    white-space: nowrap;
  }
  .app {
    display: block;
  }
  .sidebar {
    height: auto;
    position: static;
    padding: 18px 16px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 20px;
    padding: 0;
  }
  nav {
    display: flex;
    margin-top: 17px;
    gap: 4px;
  }
  nav button {
    font-size: 11px;
    padding: 10px 8px;
    gap: 5px;
  }
  .sidebar-bottom {
    display: none;
  }
  #mobileLogout {
    display: inline-flex;
  }
  main {
    padding: 20px 14px;
  }
  h1 {
    font-size: 26px;
  }
  .page-header {
    gap: 9px;
  }
  .page-header p {
    font-size: 12px;
  }
  .page-header button {
    font-size: 11px;
    padding: 8px;
  }
  .filters {
    display: block;
  }
  .channel-tabs {
    width: 100%;
  }
  .channel-tabs button {
    flex: 1;
    font-size: 11px;
    padding: 10px 6px;
    gap: 4px;
  }
  .channel-tabs .icon {
    width: 14px;
  }
  .filter-controls {
    margin-top: 12px;
    gap: 8px;
  }
  .search-label {
    flex: 1;
  }
  .search-label input {
    width: 100%;
  }
  .filter-controls input[type='date'] {
    width: 122px;
  }
  .workspace {
    display: block;
    min-height: 0;
    height: auto;
  }
  .conversation-panel {
    height: 540px;
  }
  .dialogue,
  .context {
    display: none;
  }
  .workspace.detail-open .conversation-panel {
    display: none;
  }
  .workspace.detail-open .dialogue {
    display: flex;
    height: auto;
    min-height: 480px;
  }
  .workspace.detail-open .messages {
    overflow: visible;
  }
  .workspace.detail-open .context {
    display: block;
    margin-top: 10px;
    max-height: none;
  }
  .back-button {
    display: inline-flex;
    margin-bottom: 15px;
    font-size: 11px;
    padding: 5px 8px;
    min-height: 30px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric {
    padding: 17px;
  }
  .metric-value {
    font-size: 25px;
  }
  .metric-label {
    font-size: 11px;
  }
  .overview-grid {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 19px;
  }
  .bubble {
    font-size: 13px;
  }
  .report-note {
    font-size: 9px;
  }
  .login-card {
    padding: 28px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  button {
    transition: background-color 0.12s ease;
  }
}

.brand {
  display: block;
  color: #242424;
  line-height: 1.1;
}
.brand > span {
  display: inline;
  color: #00a8c1;
  font-size: inherit;
}
.brand small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 10px;
}
.recorded-articles {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}
.recorded-articles li {
  border-left: 3px solid #00a8c1;
  padding: 9px 12px;
  margin-bottom: 8px;
  background: #fff8f4;
  overflow-wrap: anywhere;
}
.recorded-articles time,
.recorded-articles small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
a {
  color: var(--accent);
}
.analysis-disclosure {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.sidebar-bottom a {
  display: block;
  margin-top: 12px;
}

.brand img{display:block;max-width:100%;height:auto}.brand{background:linear-gradient(120deg,#062e43,#087d94);border-radius:12px;padding:14px;color:white}.brand small{color:white}.login-card .brand{margin-bottom:24px}
.recorded-routing{margin-top:10px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--soft);font-size:12px}.recorded-routing summary{cursor:pointer;font-weight:600}.recorded-routing p{margin:8px 0 4px}.recorded-routing small{color:var(--muted)}
