:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #18212f;
  --muted: #647084;
  --line: #d9dee7;
  --accent: #246b5a;
  --accent-soft: #e5f2ee;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --danger: #a23a3a;
  --danger-soft: #fde9e9;
  --info: #245c8f;
  --info-soft: #e6f0f8;
  --priority-sameday: #d97706;
  --priority-normal: #2563eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

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

.login-panel {
  width: min(100%, 420px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(24, 33, 47, 0.08);
}

.login-panel h1 {
  margin: 0;
  font-size: 1.45rem;
}

.login-panel > p {
  margin: 6px 0 20px;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-fields {
  display: grid;
  gap: 10px;
}

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

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

button.secondary,
.button-link.secondary {
  background: #ffffff;
  color: var(--accent);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.is-loading {
  gap: 8px;
}

button.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 760ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 8px 10px;
}

textarea {
  min-height: 180px;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 28px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.title-block h1,
.panel-header h2,
.placeholder-panel h2,
.section-heading h3 {
  margin-bottom: 4px;
}

.title-block p,
.panel-header p,
.placeholder-panel p,
.metric-note {
  color: var(--muted);
}

.auth-form {
  display: grid;
  gap: 6px;
  width: min(680px, 100%);
}

.auth-fields {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.auth-mode-fields {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr);
  gap: 8px;
}

.auth-mode-fields label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.auth-session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.auth-session span {
  color: var(--muted);
  font-weight: 700;
}

.auth-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.auth-message.error {
  color: var(--danger);
}

.auth-message.success {
  color: var(--accent);
}

.audit-table td {
  vertical-align: top;
}

.audit-metadata-preview {
  max-width: 260px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 28px 28px;
}

.module-nav {
  display: grid;
  gap: 8px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.nav-button {
  justify-content: flex-start;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--accent);
}

.content {
  min-width: 0;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 12px;
}

.message {
  min-height: 22px;
  margin: 0 0 12px;
  color: var(--muted);
  opacity: 1;
  transition: opacity 260ms ease;
}

.message.error,
.module-error {
  color: var(--danger);
}

.message.success {
  color: var(--accent);
}

.message.fading {
  opacity: 0;
}

.realtime-status-icon {
  display: inline-flex;
  position: relative;
  width: 18px;
  height: 18px;
  margin: -6px 0 10px;
  color: var(--danger);
  vertical-align: middle;
}

.realtime-status-icon.hidden {
  display: none;
}

.realtime-status-icon::before,
.realtime-status-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-left-color: transparent;
  border-radius: 50%;
  transform: translateX(-50%) rotate(45deg);
}

.realtime-status-icon::before {
  bottom: 3px;
  width: 14px;
  height: 14px;
}

.realtime-status-icon::after {
  bottom: 6px;
  width: 7px;
  height: 7px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.statistics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric-card,
.section-panel,
.placeholder-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
}

.metric-card strong {
  font-size: 34px;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-note {
  margin-bottom: 0;
}

.statistics-toolbar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 12px;
}

.statistics-range-filter {
  margin-bottom: 0;
}

.call-view-segmented button,
.statistics-range-filter button {
  min-height: 44px;
}

.statistics-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.statistics-section {
  display: grid;
  gap: 14px;
}

.statistics-subsection {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.statistics-subsection h4 {
  margin: 0;
  font-size: 13px;
}

.statistics-list {
  display: grid;
  gap: 8px;
}

.statistics-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f4;
}

.statistics-list-item:last-child {
  border-bottom: 0;
}

.statistics-list-item span {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.statistics-list-item strong {
  flex: 0 0 auto;
  color: var(--muted);
}

.overview-status {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 400;
}

.overview-status-sameday {
  color: var(--priority-sameday);
  font-weight: 600;
}

.overview-status-count {
  font-weight: 700;
}

.workflow-layout {
  display: flex;
  gap: 24px;
  height: calc(100vh - 220px);
  min-height: 460px;
  min-width: 0;
}

.handoff-inbox {
  flex: 0 0 360px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.handoff-inbox-list {
  display: grid;
  gap: 10px;
}

.handoff-inbox-card {
  width: 100%;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 76px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 15px 12px;
  text-align: left;
  white-space: normal;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 180ms ease, transform 180ms ease;
}

.handoff-inbox-card:hover {
  border-color: #d9e1e7;
  background: #f8f9fa;
  color: var(--ink);
}

.handoff-inbox-card.active {
  border-color: #d4dde6;
  background: #f8f9fa;
  box-shadow: 0 10px 22px rgba(24, 33, 47, 0.07);
  color: var(--ink);
}

.handoff-inbox-card.removing {
  animation: handoff-card-remove 180ms ease forwards;
  pointer-events: none;
}

.handoff-card-priority {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--priority-normal);
}

.priority-dot.same-day {
  background: var(--priority-sameday);
}

.handoff-card-body,
.handoff-card-title-row {
  min-width: 0;
}

.handoff-card-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.handoff-card-title-row strong,
.handoff-card-subline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handoff-card-title-row strong {
  min-width: 0;
  font-size: 14px;
}

.handoff-card-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.handoff-card-subline {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.handoff-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.handoff-card-badges .badge {
  padding: 2px 7px;
  font-size: 11px;
}

.handoff-card-actions {
  display: flex;
  margin-top: 10px;
}

.handoff-card-action-button {
  min-height: 30px;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
}

.handoff-card-action-button.secondary {
  border-color: #d4dde6;
  background: #ffffff;
  color: var(--muted);
}

.handoff-workspace {
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.same-day-warning {
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid #f0cf9a;
  border-left: 4px solid var(--priority-sameday);
  border-radius: 8px;
  background: #fff8ed;
  color: #7c3f00;
  font-weight: 700;
}

.handoff-identity h3 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.handoff-identity p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.overview-intelligence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.handoff-story-box {
  margin-top: 24px;
  padding: 28px 24px;
  border-radius: 8px;
  background: #f8f9fa;
  line-height: 1.6;
}

.handoff-operational-summary {
  margin-top: 16px;
}

.overview-recording-row {
  margin-top: 16px;
}

.handoff-detail-loading {
  margin: 12px 0 0;
  color: var(--muted);
}

.transcript-accordion {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.transcript-accordion summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
}

.transcript-box {
  margin-top: 12px;
  max-height: 320px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  white-space: pre-wrap;
}

.handoff-action-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid #e5e7eb;
  background: var(--panel);
}

.handoff-action-footer button {
  min-height: 44px;
  border-radius: 7px;
  padding: 11px 18px;
}

.overview-resolve-confirmation {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.overview-resolve-confirmation h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.overview-resolve-confirmation p {
  margin: 0;
  color: var(--muted);
}

.overview-resolve-confirmation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.overview-resolve-confirmation-actions button {
  min-height: 36px;
}

.overview-audit-trail {
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  padding-top: 14px;
}

.overview-audit-trail h4 {
  color: #111827;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.overview-note-composer {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.overview-note-input {
  min-height: 72px;
  resize: vertical;
}

.overview-quick-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.overview-quick-note {
  min-height: 30px;
  border-color: #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.82rem;
  padding: 5px 9px;
}

.overview-note-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-note-footer button {
  min-height: 34px;
}

.overview-note-message {
  color: #6b7280;
  font-size: 0.85rem;
}

.overview-note-message.success {
  color: #047857;
}

.overview-note-message.error {
  color: #b91c1c;
}

.overview-primary-callback {
  border-top: 1px solid #d7e5df;
  margin-top: 18px;
  padding-top: 16px;
}

.overview-primary-callback-button {
  width: 100%;
  min-height: 52px;
  border-color: #047857;
  background: #047857;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
}

.overview-primary-callback-button.secondary {
  border-color: #d1d5db;
  background: #ffffff;
  color: #4b5563;
}

.overview-callback-outcomes {
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  padding-top: 14px;
}

.overview-callback-outcomes h4 {
  color: #111827;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.overview-callback-outcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-callback-outcome-button {
  min-height: 34px;
  border-color: #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.86rem;
  padding: 7px 10px;
}

.overview-callback-outcome-message {
  color: #6b7280;
  font-size: 0.85rem;
  margin: 8px 0 0;
}

.overview-callback-outcome-message.success {
  color: #047857;
}

.overview-callback-outcome-message.error {
  color: #b91c1c;
}

.overview-callback-follow-up {
  border-top: 1px solid #e5e7eb;
  margin-top: 16px;
  padding-top: 14px;
}

.overview-callback-follow-up h4 {
  color: #111827;
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.overview-follow-up-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-follow-up-quick-button {
  min-height: 34px;
  border-color: #d1d5db;
  background: #ffffff;
  color: #374151;
  font-size: 0.86rem;
  padding: 7px 10px;
}

.overview-follow-up-custom {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.overview-follow-up-custom span {
  color: #4b5563;
  font-size: 0.85rem;
  font-weight: 700;
}

.overview-follow-up-custom input {
  max-width: 260px;
}

.overview-follow-up-selected {
  color: #374151;
  font-size: 0.88rem;
  margin: 8px 0 0;
}

.overview-follow-up-footer {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.overview-follow-up-footer button {
  min-height: 34px;
}

.overview-follow-up-message {
  color: #6b7280;
  font-size: 0.85rem;
}

.overview-follow-up-message.success {
  color: #047857;
}

.overview-follow-up-message.error {
  color: #b91c1c;
}

.overview-audit-state {
  color: #6b7280;
  font-size: 0.9rem;
  margin: 0;
}

.overview-audit-state.error {
  color: #b91c1c;
}

.overview-audit-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.overview-audit-item {
  border-left: 2px solid #d1d5db;
  display: grid;
  gap: 2px;
  padding: 2px 0 2px 10px;
}

.overview-audit-label {
  color: #111827;
  font-size: 0.92rem;
  font-weight: 700;
}

.overview-audit-meta,
.overview-audit-summary {
  color: #6b7280;
  font-size: 0.84rem;
}

.overview-audit-note {
  color: #374151;
  font-size: 0.9rem;
  margin: 4px 0 0;
  white-space: pre-wrap;
}

.overview-audit-follow-up {
  color: #374151;
  font-size: 0.9rem;
  margin: 4px 0 0;
}

.handoff-action-footer button:first-child:not(.secondary) {
  min-width: 176px;
  border-color: #0e5c4e;
  background: #0e5c4e;
}

.handoff-action-footer button.secondary {
  min-width: 164px;
}

.handoff-action-footer button.is-loading {
  position: relative;
  cursor: progress;
}

.handoff-action-footer button.is-loading::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 0.8s linear infinite;
}

.workflow-empty-state {
  display: grid;
  align-content: center;
  min-height: 100%;
  color: var(--muted);
}

.workflow-empty-state h3 {
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 22px;
}

.workflow-empty-state p {
  margin-bottom: 0;
}

@keyframes handoff-card-remove {
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.filters {
  display: grid;
  grid-template-columns: minmax(150px, 0.6fr) minmax(240px, 1fr) minmax(110px, 0.3fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.calls-layout {
  display: grid;
  grid-template-columns: minmax(420px, 42%) minmax(520px, 1fr);
  gap: 16px;
  align-items: start;
}

.call-view-segmented {
  display: inline-flex;
  gap: 3px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fa;
}

.call-view-segmented button {
  min-height: 32px;
  padding: 6px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.call-view-segmented button:hover {
  color: var(--ink);
  background: #eef2f4;
}

.call-view-segmented button.active {
  color: #0e5c4e;
  background: #e6f2ef;
  box-shadow: inset 0 0 0 1px rgba(14, 92, 78, 0.18);
}

.handoff-view-segmented {
  grid-column: 1 / -1;
  justify-self: start;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(360px, 40%) minmax(560px, 1fr);
  gap: 16px;
  align-items: start;
  height: calc(100vh - 240px);
  min-height: 560px;
  min-width: 0;
}

.facts-dynamic-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.55fr) minmax(360px, 1.15fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.policies-layout {
  display: grid;
  grid-template-columns: minmax(360px, 40%) minmax(560px, 1fr);
  gap: 16px;
  align-items: start;
  height: calc(100vh - 240px);
  min-height: 560px;
  min-width: 0;
}

.handoffs-filters {
  grid-template-columns: minmax(140px, 0.8fr) minmax(170px, 0.9fr) minmax(220px, 1.5fr) minmax(90px, 0.35fr);
  margin-bottom: 10px;
  padding: 12px;
}

.knowledge-filters {
  grid-template-columns: minmax(105px, 0.9fr) minmax(78px, 0.52fr) minmax(84px, 0.58fr) minmax(130px, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
}

.knowledge-filters input,
.knowledge-filters select {
  min-height: 32px;
  padding: 6px 8px;
}

.handoffs-workflow-layout {
  display: grid;
  grid-template-columns: minmax(380px, 42%) minmax(520px, 1fr);
  gap: 18px;
  height: calc(100vh - 300px);
  min-height: 520px;
  min-width: 0;
}

.handoffs-inbox-panel,
.handoffs-workspace {
  min-width: 0;
  min-height: 0;
}

.handoffs-inbox-panel {
  overflow-y: auto;
}

.handoffs-inbox-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
}

.handoffs-inbox-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  min-height: 94px;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  white-space: normal;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.handoffs-inbox-card > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.handoffs-inbox-card.same-day {
  border-left-color: transparent;
}

.handoffs-inbox-card:hover {
  border-color: #d9e1e7;
  background: #fbfcfd;
  color: var(--ink);
}

.handoffs-inbox-card.active {
  border-color: #d9e1e7;
  background: #f8f9fa;
  box-shadow: 0 10px 22px rgba(24, 33, 47, 0.07);
  color: var(--ink);
}

.handoffs-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  min-width: 0;
}

.handoffs-card-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.handoffs-inbox-card.same-day .handoffs-card-time::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--priority-sameday);
  vertical-align: 1px;
}

.handoffs-card-title,
.handoffs-card-preview {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handoffs-card-title {
  font-size: 15px;
}

.handoffs-card-preview {
  color: var(--muted);
  font-size: 13px;
}

.handoffs-list-empty {
  display: grid;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
}

.handoffs-list-empty strong {
  color: var(--ink);
}

.handoffs-list-empty p {
  margin-bottom: 0;
}

.handoffs-workspace {
  overflow-y: auto;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.handoff-focus-header h3 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.handoff-focus-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.handoff-badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.handoffs-workspace .handoff-story-box {
  padding: 30px 28px;
}

.handoffs-workspace .handoff-action-footer {
  gap: 12px;
}

.handoffs-workspace .handoff-action-footer button {
  min-height: 44px;
  border-radius: 7px;
}

.facts-theme-panel,
.facts-main-panel,
.facts-editor-panel,
.facts-advanced-panel,
.policies-main-panel {
  padding: 16px;
}

.facts-editor-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.policy-filters {
  grid-template-columns: minmax(105px, 0.9fr) minmax(90px, 0.55fr) minmax(90px, 0.55fr) minmax(130px, 1fr);
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px;
}

.policy-filters input,
.policy-filters select {
  min-height: 32px;
  padding: 6px 8px;
}

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

.input-with-suffix {
  position: relative;
  display: block;
}

.input-with-suffix input {
  padding-right: 78px;
}

.input-suffix {
  position: absolute;
  right: 10px;
  top: 50%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-50%);
}

.checkbox-list-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
}

.checkbox-list-tile input {
  width: auto;
  margin-top: 3px;
}

.checkbox-list-tile-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.checkbox-list-tile-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.checkbox-list-tile-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.severity-critical {
  background: var(--danger-soft);
}

.severity-critical td:first-child {
  border-left: 4px solid var(--danger);
}

.facts-columns {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(0, 1.2fr);
  gap: 16px;
}

.compact-heading {
  align-items: center;
  margin-bottom: 8px;
}

.compact-heading h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.facts-list {
  display: grid;
  gap: 8px;
}

.facts-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  white-space: normal;
}

.facts-list-item.active,
.facts-list-item:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.facts-list-item strong,
.facts-list-item span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.facts-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.facts-structured-panel {
  padding: 18px;
}

.facts-structured-form {
  display: grid;
  gap: 18px;
}

.facts-form-section {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.facts-form-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.facts-form-section h3 {
  margin: 0;
  font-size: 18px;
}

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

.facts-form-grid textarea {
  min-height: 104px;
}

.facts-checkbox-tile {
  align-self: stretch;
  min-height: 42px;
}

.fact-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.section-panel {
  min-width: 0;
  padding: 16px;
}

.calls-table-panel,
.call-detail-panel {
  padding: 0;
}

.call-detail-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.call-detail-panel .section-heading {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.knowledge-inbox-panel,
.knowledge-workspace {
  min-width: 0;
  min-height: 0;
}

.knowledge-inbox-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 12px;
}

.knowledge-inbox-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.knowledge-inbox-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
}

.knowledge-tree-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.knowledge-tree-controls button {
  min-height: 34px;
  padding: 7px 10px;
}

.knowledge-search-label {
  min-width: 0;
}

.knowledge-search-label input {
  min-height: 34px;
  padding: 7px 10px;
}

.knowledge-tree,
.knowledge-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}

.knowledge-tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 38px;
  gap: 10px;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.knowledge-tree-row.depth-1 {
  padding-left: 24px;
}

.knowledge-tree-row.depth-2 {
  padding-left: 40px;
}

.knowledge-tree-row:hover {
  border-color: #d9e1e7;
  background: #fbfcfd;
  color: var(--ink);
}

.knowledge-tree-row:focus-visible,
.knowledge-tree-row.active {
  border-color: #d9e1e7;
  background: #f8f9fa;
  box-shadow: inset 0 0 0 1px #d9e1e7;
  color: var(--ink);
  outline: 0;
}

.knowledge-tree-row.inactive {
  opacity: 0.6;
}

.knowledge-tree-row.inactive.active,
.knowledge-tree-row.inactive:focus-visible,
.knowledge-tree-row.inactive:hover {
  opacity: 0.78;
}

.knowledge-tree-label,
.knowledge-tree-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-tree-label {
  font-weight: 700;
}

.knowledge-tree-row.depth-2 .knowledge-tree-label {
  font-weight: 600;
}

.knowledge-tree-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.knowledge-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-height: 92px;
  gap: 7px;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  white-space: normal;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.knowledge-card > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.knowledge-card:hover {
  border-color: #d9e1e7;
  background: #fbfcfd;
  color: var(--ink);
}

.knowledge-card:focus-visible,
.knowledge-card.active {
  border-color: #d9e1e7;
  background: #f8f9fa;
  box-shadow: 0 10px 22px rgba(24, 33, 47, 0.07);
  color: var(--ink);
  outline: 0;
}

.knowledge-card.inactive {
  opacity: 0.6;
}

.knowledge-card.inactive.active,
.knowledge-card.inactive:focus-visible,
.knowledge-card.inactive:hover {
  opacity: 0.78;
}

.knowledge-card-meta,
.knowledge-card-badges,
.knowledge-read-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.knowledge-card-title,
.knowledge-card-preview {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.knowledge-card-title {
  font-size: 15px;
}

.knowledge-card-preview {
  color: var(--muted);
  font-size: 13px;
}

.knowledge-list-empty,
.knowledge-empty-workspace {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.knowledge-list-empty {
  padding: 18px;
}

.knowledge-list-empty strong,
.knowledge-empty-workspace h3 {
  color: var(--ink);
}

.knowledge-list-empty p,
.knowledge-empty-workspace p {
  margin-bottom: 0;
}

.knowledge-workspace {
  overflow-y: auto;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.knowledge-read-view,
.knowledge-read-content {
  min-height: 100%;
}

.knowledge-read-content {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
}

.knowledge-read-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.knowledge-read-header h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.knowledge-read-body {
  min-height: 260px;
  padding: 28px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.knowledge-read-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
}

.knowledge-read-actions button {
  min-height: 44px;
  border-radius: 7px;
  padding-inline: 16px;
}

.knowledge-form {
  padding: 0;
  gap: 16px;
}

.knowledge-form .section-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.knowledge-subtheme-overview {
  display: grid;
  gap: 14px;
}

.knowledge-subtheme-overview h4 {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.knowledge-overview-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
}

.knowledge-overview-card.inactive {
  opacity: 0.68;
}

.knowledge-overview-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.knowledge-overview-card-header h4 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  text-transform: none;
}

.knowledge-overview-card p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.knowledge-overview-card button {
  justify-self: start;
  min-height: 34px;
}

.knowledge-add-fact-button {
  max-width: 100%;
  white-space: normal;
}

.knowledge-fact-row {
  gap: 9px;
  padding: 14px;
}

.knowledge-inline-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
}

.knowledge-icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 6px;
  font-weight: 700;
  line-height: 1;
}

.knowledge-icon-button.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.knowledge-inline-content {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
  user-select: text;
}

.knowledge-inline-content:hover {
  color: var(--ink);
}

.knowledge-inline-editor {
  width: 100%;
  min-height: 104px;
  resize: vertical;
}

.knowledge-inline-edit-form {
  display: grid;
  gap: 10px;
}

.knowledge-inline-edit-controls {
  display: grid;
  grid-template-columns: minmax(120px, 180px) auto minmax(170px, 1fr);
  gap: 10px;
  align-items: end;
}

.knowledge-inline-active {
  min-height: 36px;
}

.knowledge-inline-edit-actions {
  justify-content: flex-start;
}

.knowledge-inline-status {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.knowledge-inline-status.error {
  color: var(--danger);
}

.policies-main-panel,
.policies-workspace {
  min-width: 0;
  min-height: 0;
}

.policies-main-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  padding: 12px;
}

.policy-inbox-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.policy-inbox-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
}

.policy-rule-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
}

.policy-rule-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 100%;
  max-width: none;
  min-height: 94px;
  gap: 7px;
  box-sizing: border-box;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  white-space: normal;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.policy-rule-card > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.policy-rule-card:hover {
  border-color: #d9e1e7;
  background: #fbfcfd;
  color: var(--ink);
}

.policy-rule-card:focus-visible,
.policy-rule-card.active {
  border-color: #d9e1e7;
  background: #f8f9fa;
  box-shadow: 0 10px 22px rgba(24, 33, 47, 0.07);
  color: var(--ink);
  outline: 0;
}

.policy-rule-card.inactive {
  opacity: 0.62;
}

.policy-rule-card.inactive.active,
.policy-rule-card.inactive:focus-visible,
.policy-rule-card.inactive:hover {
  opacity: 0.8;
}

.policy-rule-card.structured {
  border-left: 4px solid var(--info);
}

.policy-rule-card-meta,
.policy-read-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.policy-rule-card-title,
.policy-rule-card-preview {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.policy-rule-card-title {
  font-size: 15px;
}

.policy-rule-card-preview {
  color: var(--muted);
  font-size: 13px;
}

.policy-list-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: var(--muted);
}

.policy-list-empty strong {
  color: var(--ink);
}

.policy-list-empty p {
  margin-bottom: 0;
}

.policies-workspace {
  overflow-y: auto;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-workspace-read,
.policy-read-content {
  min-height: 100%;
}

.policy-read-content {
  display: grid;
  gap: 22px;
}

.policy-rule-form .section-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.policy-empty-workspace {
  min-height: 100%;
}

.settings-workspace {
  display: grid;
  gap: 16px;
  max-width: 860px;
}

.settings-card {
  display: grid;
  gap: 22px;
  padding: 28px;
}

.settings-card .section-heading {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-card .section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
}

.policy-settings-grid {
  grid-template-columns: 1fr;
}

.policy-secondary-settings {
  padding: 16px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
}

.policy-secondary-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}

.policy-secondary-settings .settings-grid {
  margin-top: 14px;
}

.policy-settings-actions {
  margin-top: 0;
}

.settings-actions {
  justify-content: flex-start;
}

.policy-read-content {
  grid-template-rows: auto 1fr auto;
}

.policy-read-header {
  display: grid;
  gap: 14px;
}

.policy-read-header h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.policy-read-body {
  min-height: 260px;
  padding: 28px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.policy-read-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.policy-read-actions button,
.policy-settings-actions button {
  min-height: 44px;
  border-radius: 7px;
  padding-inline: 16px;
}

.policy-entry-content {
  grid-template-rows: auto 1fr;
}

.policy-card-list {
  display: grid;
  gap: 14px;
  align-content: start;
}

.policy-entry-card {
  align-content: start;
}

.policy-entry-card-header h4 {
  overflow-wrap: anywhere;
}

.policy-entry-card .policy-read-badges {
  width: 100%;
}

.policy-forbidden-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  line-height: 1.5;
}

.policy-forbidden-list li {
  overflow-wrap: anywhere;
}

.policy-inline-edit-form textarea {
  min-height: 98px;
  resize: vertical;
}

.policy-inline-edit-controls {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 150px) minmax(190px, 1fr);
  gap: 10px;
  align-items: end;
}

.policy-inline-edit-actions {
  justify-content: flex-start;
}

.policy-structured-content {
  grid-template-rows: auto 1fr;
}

.policy-structured-body {
  display: grid;
  gap: 14px;
  white-space: normal;
}

.policy-structured-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid #e5e9ef;
}

.policy-structured-row:last-child {
  border-bottom: 0;
}

.policy-structured-row span {
  color: var(--muted);
  font-weight: 700;
}

.policy-structured-row strong {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.policy-structured-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e5e9ef;
  border-radius: 8px;
  background: #ffffff;
}

.policy-structured-block.warning {
  border-color: var(--warn);
  background: var(--warn-soft);
}

.policy-structured-block h4 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.policy-structured-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.policy-structured-list li {
  overflow-wrap: anywhere;
}

.policy-rule-form {
  padding: 0;
  gap: 16px;
}

.call-detail-shell-heading {
  display: none;
}

.call-detail-panel > .empty-state {
  padding: 32px;
}

.call-detail-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.call-detail-workspace {
  display: grid;
  gap: 20px;
  padding: 32px;
}

.call-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.call-detail-identity h3 {
  margin-bottom: 6px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
}

.call-detail-identity p {
  margin-bottom: 0;
  color: var(--muted);
}

.call-summary-box {
  padding: 24px 26px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.65;
}

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

.operational-summary-grid > div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.operational-summary-grid > div.wide {
  grid-column: 1 / -1;
}

.operational-summary-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.operational-summary-grid strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.call-intelligence-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.call-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.call-action-button {
  min-height: 40px;
  border-color: #d4dde6;
  color: var(--accent);
}

.call-action-button.recording::before {
  content: "";
  width: 0;
  height: 0;
  margin-right: 8px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.call-action-unavailable {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--muted);
}

.call-recording-row {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #eef1f5;
  border-radius: 8px;
}

.call-recording-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.call-recording-row audio {
  display: none;
}

.call-recording-row.audio-error audio {
  display: block;
  grid-column: 2 / -1;
  width: 100%;
}

.recording-waveform-button {
  display: block;
  min-height: 54px;
  padding: 0;
  border: 1px solid #d4dde6;
  background: #ffffff;
  overflow: hidden;
}

.recording-waveform {
  display: block;
  width: 100%;
  height: 54px;
}

.recording-time {
  white-space: nowrap;
}

.recording-error-message {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.recording-direct-link {
  min-height: 32px;
  border-color: #d4dde6;
  font-size: 12px;
}

.recording-quick-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recording-play-button,
.recording-skip-button,
.recording-speed-select {
  min-height: 32px;
  border: 1px solid #d4dde6;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.recording-skip-button {
  padding: 0 9px;
}

.recording-play-button {
  padding: 0 10px;
}

.recording-speed-select {
  padding: 0 8px;
}

.call-transcript-chat {
  display: grid;
  gap: 12px;
}

.call-transcript-chat h4 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.chat-message {
  display: flex;
}

.chat-message.agent {
  justify-content: flex-end;
}

.chat-message.guest,
.chat-message.neutral {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(74%, 560px);
  padding: 11px 14px;
  border-radius: 14px;
  background: #f1f4f7;
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.5;
}

.language-chip {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  padding: 1px 5px;
  border: 1px solid #ccd4df;
  border-radius: 5px;
  background: #ffffff;
  color: #526174;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  vertical-align: 1px;
}

.transcript-segment {
  margin: 0 0 10px;
  white-space: pre-wrap;
}

.transcript-segment:last-child {
  margin-bottom: 0;
}

.chat-message.agent .chat-bubble {
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 5px;
}

.chat-message.guest .chat-bubble,
.chat-message.neutral .chat-bubble {
  border-bottom-left-radius: 5px;
}

.call-transcript-empty {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
}

.technical-details {
  margin-top: 6px;
}

.technical-details > .compact-list {
  margin: 0;
  padding: 0 12px 12px;
}

.detail-section {
  display: grid;
  gap: 8px;
}

.detail-section h4 {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.calls-table {
  min-width: 720px;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: fixed;
}

.calls-table th,
.calls-table td {
  padding: 8px 10px;
}

.calls-table tbody td {
  border-bottom: 0;
  vertical-align: middle;
}

.calls-table th:nth-child(1),
.calls-table td:nth-child(1) {
  width: 124px;
}

.calls-table th:nth-child(2),
.calls-table td:nth-child(2) {
  width: auto;
}

.calls-table th:nth-child(3),
.calls-table td:nth-child(3) {
  width: 86px;
}

.calls-table th:nth-child(4),
.calls-table td:nth-child(4) {
  width: 240px;
  padding-left: 10px;
}

.calls-table-row {
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.calls-table-row td {
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.calls-table-row:hover td {
  background: #fbfcfd;
}

.calls-table-row.active td {
  background: #f8f9fa;
  box-shadow: inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
}

.calls-table-row.active td:first-child {
  box-shadow: inset 1px 0 0 #d9e1e7, inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
  border-radius: 8px 0 0 8px;
}

.calls-table-row.active td:last-child {
  box-shadow: inset -1px 0 0 #d9e1e7, inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
  border-radius: 0 8px 8px 0;
}

.calls-table-row:focus-visible td {
  background: #f8f9fa;
  outline: 0;
  box-shadow: inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
}

.calls-table-row:focus-visible td:first-child {
  box-shadow: inset 1px 0 0 #d9e1e7, inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
  border-radius: 8px 0 0 8px;
}

.calls-table-row:focus-visible td:last-child {
  box-shadow: inset -1px 0 0 #d9e1e7, inset 0 1px 0 #d9e1e7, inset 0 -1px 0 #d9e1e7;
  border-radius: 0 8px 8px 0;
}

.calls-status-badges .badge {
  justify-content: center;
  min-width: 72px;
  white-space: nowrap;
}

.calls-status-cell {
  vertical-align: middle;
}

.calls-status-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  margin: 0;
  border-bottom: 0;
}

.muted-placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.calls-identity-cell {
  display: grid;
  gap: 3px;
  border-bottom: 0;
}

.calls-identity-cell strong,
.calls-identity-cell span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
}

.calls-identity-cell strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  white-space: normal;
}

.calls-identity-cell span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  background: #fbfcfd;
}

td {
  overflow-wrap: anywhere;
}

.summary-list,
.calls-list,
.compact-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li,
.calls-list li,
.compact-list li {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list li:last-child,
.calls-list li:last-child,
.compact-list li:last-child {
  border-bottom: 0;
}

.summary-list span,
.calls-list span,
.compact-list span {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  color: var(--muted);
  padding: 8px 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid #c9ddd6;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.badge.warn {
  border-color: #e3b65f;
  background: var(--warn-soft);
  color: #7a4300;
}

.badge.danger {
  border-color: #efc4c4;
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.info {
  border-color: #c1d7e8;
  background: var(--info-soft);
  color: var(--info);
}

.badge.muted {
  border-color: #d6dde6;
  background: #eef1f5;
  color: var(--muted);
}

.badge.live {
  border-color: #c9ddd6;
  background: var(--accent-soft);
  color: var(--accent);
}

.module-error {
  min-height: 20px;
  margin: 10px 0 0;
}

.note {
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--info-soft);
  border: 1px solid #c9dceb;
  border-radius: 8px;
  color: var(--info);
}

.editor-form {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.checkbox-row input {
  width: auto;
}

.content-preview {
  max-width: 360px;
  color: var(--muted);
}

pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  background: #111827;
  color: #f9fafb;
  border-radius: 6px;
  font-size: 12px;
  white-space: pre-wrap;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
}

details pre {
  border-radius: 0 0 8px 8px;
}

.placeholder-panel {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 760px;
  padding: 20px;
}

.placeholder-panel p {
  max-width: 620px;
  margin-bottom: 4px;
}

@media (max-width: 1080px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-kpi-grid,
  .statistics-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calls-layout,
  .handoffs-workflow-layout,
  .knowledge-layout,
  .policies-layout,
  .facts-dynamic-layout,
  .facts-columns,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .workflow-layout {
    display: grid;
    height: auto;
    min-height: 0;
  }

  .handoff-inbox {
    width: 100%;
    max-height: 320px;
  }

  .handoff-workspace {
    min-height: 520px;
  }

  .handoffs-workflow-layout {
    height: auto;
    min-height: 0;
  }

  .knowledge-layout {
    height: auto;
    min-height: 0;
  }

  .policies-layout {
    height: auto;
    min-height: 0;
  }

  .handoffs-inbox-panel {
    max-height: 360px;
  }

  .knowledge-inbox-panel {
    max-height: 420px;
  }

  .policies-main-panel {
    max-height: 420px;
  }

  .handoffs-workspace {
    min-height: 520px;
  }

  .knowledge-workspace {
    min-height: 520px;
  }

  .policies-workspace {
    min-height: 520px;
  }

  .knowledge-tree-controls,
  .knowledge-filters,
  .policy-filters,
  .facts-form-grid,
  .policy-structured-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .call-detail-panel,
  .knowledge-workspace,
  .facts-editor-panel,
  .policies-workspace {
    position: static;
    max-height: none;
  }
}

@media (max-width: 820px) {
  .app-header,
  .app-shell {
    grid-template-columns: 1fr;
    display: grid;
  }

  .app-header {
    align-items: stretch;
  }

  .module-nav {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .key-row,
  .metrics-grid,
  .statistics-kpi-grid,
  .statistics-sections,
  .filters,
  .facts-form-grid,
  .knowledge-inline-edit-controls,
  .policy-structured-row,
  .operational-summary-grid,
  .summary-list li,
  .calls-list li,
  .compact-list li {
    grid-template-columns: 1fr;
  }

  .call-recording-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .recording-quick-controls {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .app-header,
  .app-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .module-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-header {
    display: grid;
  }
}

/* Aurora hospitality design system */
:root {
  --aurora-primary: #187279;
  --aurora-primary-hover: #125a60;
  --aurora-mint: #5bb8a8;
  --aurora-mist: #e8f4f2;
  --aurora-deep: #0f3e43;
  --aurora-gold: #d9a96b;
  --surface-page: #f7f7f3;
  --surface-card: #fffefa;
  --surface-subtle: #f0f3ef;
  --text-strong: #16383b;
  --text-body: #354d4f;
  --text-muted: #6b7e7e;
  --border-subtle: #dce5e1;
  --border-strong: #c7d7d2;
  --success: #317c68;
  --success-soft: #e9f5f0;
  --warning: #936326;
  --warning-soft: #fbf3e5;
  --error: #a13d43;
  --error-soft: #fbecef;
  --info: #376d83;
  --info-soft: #eaf2f5;
  --shadow-card: 0 1px 2px rgba(15, 62, 67, 0.03), 0 10px 30px rgba(15, 62, 67, 0.045);
  --shadow-raised: 0 14px 35px rgba(15, 62, 67, 0.09);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --focus-ring: 0 0 0 3px rgba(91, 184, 168, 0.28);
  --bg: var(--surface-page);
  --panel: var(--surface-card);
  --ink: var(--text-strong);
  --muted: var(--text-muted);
  --line: var(--border-subtle);
  --accent: var(--aurora-primary);
  --accent-soft: var(--aurora-mist);
  --warn: var(--warning);
  --warn-soft: var(--warning-soft);
  --danger: var(--error);
  --danger-soft: var(--error-soft);
  --priority-sameday: var(--warning);
  --priority-normal: var(--aurora-primary);
}

html {
  min-width: 320px;
  background: var(--surface-page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% -10%, rgba(91, 184, 168, 0.08), transparent 32rem),
    var(--surface-page);
  color: var(--text-body);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  color: var(--aurora-deep);
  font-family: Charter, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-wrap: balance;
}

a {
  color: var(--aurora-primary);
  text-underline-offset: 3px;
}

a:visited {
  color: #4e696d;
}

button,
.button-link {
  min-height: 44px;
  border: 1px solid var(--aurora-primary);
  border-radius: var(--radius-sm);
  background: var(--aurora-primary);
  padding: 10px 16px;
  color: #ffffff;
  font-weight: 650;
  box-shadow: 0 1px 1px rgba(15, 62, 67, 0.08);
  transition: background-color 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out, box-shadow 160ms ease-out, transform 120ms ease-out;
}

button:hover:not(:disabled),
.button-link:hover {
  border-color: var(--aurora-primary-hover);
  background: var(--aurora-primary-hover);
  color: #ffffff;
}

button:active:not(:disabled),
.button-link:active {
  transform: translateY(1px);
}

button.secondary,
.button-link.secondary {
  border-color: var(--border-strong);
  background: var(--surface-card);
  color: var(--aurora-primary);
  box-shadow: none;
}

button.secondary:hover:not(:disabled),
.button-link.secondary:hover {
  border-color: var(--aurora-primary);
  background: var(--aurora-mist);
  color: var(--aurora-deep);
}

button:focus-visible,
.button-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--aurora-primary);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

input,
select,
textarea {
  min-height: 44px;
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 10px 12px;
  color: var(--text-strong);
  transition: border-color 160ms ease-out, box-shadow 160ms ease-out, background-color 160ms ease-out;
}

textarea {
  min-height: 150px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #a8c2bb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--aurora-primary);
  outline: none;
  box-shadow: var(--focus-ring);
}

label {
  gap: 7px;
  color: var(--text-body);
  font-size: 0.82rem;
  font-weight: 650;
}

.app-header {
  position: relative;
  z-index: 10;
  align-items: center;
  min-height: 88px;
  border-bottom-color: var(--border-subtle);
  background: rgba(255, 254, 250, 0.92);
  padding: 18px clamp(20px, 3vw, 44px);
  backdrop-filter: blur(14px);
}

.brand-lockup,
.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50% 50% 48% 52%;
  background: var(--aurora-deep);
  box-shadow: inset 0 -7px 12px rgba(91, 184, 168, 0.18);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  left: 8px;
  width: 22px;
  height: 12px;
  border: 2px solid var(--aurora-mint);
  border-color: var(--aurora-mint) transparent transparent;
  border-radius: 50%;
}

.brand-mark::before { top: 9px; }
.brand-mark span { top: 14px; opacity: 0.72; }
.brand-mark::after { top: 19px; opacity: 0.42; }

.brand-name {
  display: block;
  color: var(--aurora-deep);
  font-family: "Avenir Next", Avenir, sans-serif;
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.17em;
}

.title-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-form {
  width: auto;
  max-width: min(100%, 720px);
}

.auth-session span {
  max-width: min(48vw, 640px);
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-message {
  min-height: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(24px, 3vw, 48px);
  max-width: 1660px;
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 44px) 48px;
}

.module-nav {
  top: 26px;
  gap: 5px;
  padding: 6px;
}

.nav-section-label {
  padding: 8px 11px 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-button {
  position: relative;
  min-height: 46px;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  padding: 11px 13px 11px 34px;
  color: #496163;
  font-weight: 600;
  box-shadow: none;
}

.nav-button::before {
  content: "";
  position: absolute;
  left: 15px;
  width: 7px;
  height: 7px;
  border: 1.5px solid #91aaa6;
  border-radius: 50%;
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.nav-button:hover,
.nav-button.active {
  border-color: transparent;
  background: var(--aurora-mist);
  color: var(--aurora-primary);
}

.nav-button:hover::before,
.nav-button.active::before {
  border-color: var(--aurora-primary);
  background: var(--aurora-mint);
  transform: scale(1.08);
}

.nav-button.active {
  font-weight: 700;
}

.nav-assurance {
  display: block;
  margin: 26px 8px 0;
  border-top: 1px solid var(--border-subtle);
  padding: 18px 4px 0;
  color: var(--aurora-deep);
  font-size: 0.78rem;
  font-weight: 650;
}

.nav-assurance::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--aurora-mint);
  box-shadow: 0 0 0 4px rgba(91, 184, 168, 0.14);
}

.nav-assurance small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-weight: 450;
  line-height: 1.4;
}

.content {
  width: 100%;
  max-width: 1380px;
}

.panel-header {
  align-items: end;
  margin-bottom: 26px;
}

.panel-header h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.08;
}

.panel-header > div > p:not(.page-eyebrow):not(.page-intro) {
  max-width: 680px;
  margin: 8px 0 0;
}

.page-eyebrow {
  margin: 0 0 7px;
  color: var(--aurora-primary);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-intro {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.overview-status {
  margin: -4px 0 20px;
  color: var(--text-body);
  font-size: 1rem;
}

.metric-card,
.section-panel,
.placeholder-panel,
.handoff-workspace,
.filters,
.settings-workspace {
  border-color: var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-card);
  box-shadow: var(--shadow-card);
}

.metric-card {
  min-height: 142px;
  gap: 10px;
  padding: 20px;
}

.metric-card strong {
  color: var(--aurora-deep);
  font-family: Charter, "Iowan Old Style", Georgia, serif;
  font-size: 2.45rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.metric-label {
  color: var(--text-body);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: none;
}

.metric-note {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.statistics-kpi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.statistics-sections {
  gap: 18px;
}

.section-panel,
.settings-card,
.filters {
  padding: 18px;
}

.filters {
  margin-bottom: 18px;
}

.workflow-layout {
  gap: 18px;
  height: calc(100vh - 292px);
}

.handoff-inbox {
  flex-basis: 350px;
  padding: 2px 4px 2px 0;
}

.handoff-inbox-card {
  border-color: transparent;
  border-radius: 12px;
  padding: 14px;
}

.handoff-inbox-card:hover {
  border-color: var(--border-subtle);
  background: rgba(232, 244, 242, 0.55);
}

.handoff-inbox-card.active {
  border-color: #bed8d2;
  background: var(--aurora-mist);
  box-shadow: none;
}

.handoff-workspace {
  padding: clamp(22px, 3vw, 34px);
}

.handoff-story-box,
.operational-summary-grid,
.overview-resolve-confirmation {
  border-color: var(--border-subtle);
  border-radius: 12px;
  background: var(--surface-subtle);
}

.handoff-story-box {
  padding: 22px;
}

.same-day-warning {
  border: 1px solid #e7d2b3;
  border-radius: 12px;
  background: var(--warning-soft);
  color: #704a1d;
}

.calls-layout,
.knowledge-layout,
.policies-layout,
.handoffs-workflow-layout {
  gap: 18px;
}

.calls-table-panel,
.call-detail-panel,
.knowledge-inbox-panel,
.knowledge-workspace,
.policies-main-panel,
.policies-workspace {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.call-detail-panel,
.knowledge-workspace,
.policies-workspace {
  top: 26px;
}

.table-wrap {
  scrollbar-color: #b8cbc6 transparent;
}

table {
  font-variant-numeric: tabular-nums;
}

th {
  border-bottom-color: var(--border-subtle);
  background: #f4f6f3;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  border-bottom-color: #e8eeeb;
  color: var(--text-body);
  font-size: 0.88rem;
}

.calls-table-row:hover td {
  background: #f5faf8;
}

.calls-table-row.active td {
  background: var(--aurora-mist);
}

.calls-table-row.active td:first-child {
  box-shadow: inset 3px 0 var(--aurora-primary);
}

.badge {
  min-height: 24px;
  border: 1px solid rgba(49, 124, 104, 0.1);
  border-radius: 999px;
  background: var(--success-soft);
  padding: 3px 9px;
  color: var(--success);
  font-size: 0.71rem;
  font-weight: 700;
}

.badge.warn {
  border-color: rgba(147, 99, 38, 0.12);
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger {
  border-color: rgba(161, 61, 67, 0.1);
  background: var(--error-soft);
  color: var(--error);
}

.badge.info {
  border-color: rgba(55, 109, 131, 0.1);
  background: var(--info-soft);
  color: var(--info);
}

.badge.muted {
  border-color: var(--border-subtle);
  background: #f0f3f1;
  color: #647575;
}

.call-detail-hero {
  border-bottom-color: var(--border-subtle);
  background: linear-gradient(145deg, rgba(232, 244, 242, 0.7), rgba(255, 254, 250, 0.2));
}

.call-detail-identity h3 {
  font-size: 1.75rem;
}

.call-transcript-chat {
  display: grid;
  gap: 12px;
}

.call-transcript-chat h4 {
  margin-bottom: 4px;
}

.chat-message {
  display: flex;
}

.chat-message.agent,
.chat-message.assistant,
.chat-message.aurora {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(78%, 680px);
  border: 1px solid var(--border-subtle);
  border-radius: 4px 14px 14px 14px;
  background: #f3f5f2;
  padding: 11px 14px;
  color: var(--text-body);
  line-height: 1.55;
}

.chat-message.agent .chat-bubble,
.chat-message.assistant .chat-bubble,
.chat-message.aurora .chat-bubble {
  border-color: #cfe4df;
  border-radius: 14px 4px 14px 14px;
  background: var(--aurora-mist);
  color: var(--aurora-deep);
}

.recording-waveform-button,
.recording-play-button,
.recording-skip-button {
  min-height: 44px;
}

.knowledge-tree-row,
.knowledge-card,
.policy-rule-card {
  border-radius: 11px;
}

.knowledge-tree-row:hover,
.knowledge-card:hover,
.policy-rule-card:hover {
  border-color: #bfd5d0;
  background: #f4faf8;
}

.knowledge-tree-row.active,
.knowledge-card.active,
.policy-rule-card.active {
  border-color: #b6d3cd;
  background: var(--aurora-mist);
  box-shadow: none;
}

.settings-grid {
  gap: 20px;
}

.settings-card {
  border-radius: var(--radius-md);
}

.message,
.module-error,
.auth-message {
  border-radius: var(--radius-sm);
}

.message:not(:empty) {
  min-height: auto;
  padding: 10px 12px;
  background: var(--info-soft);
}

.message.error:not(:empty),
.module-error:not(:empty) {
  background: var(--error-soft);
  color: var(--error);
}

.message.success:not(:empty) {
  background: var(--success-soft);
  color: var(--success);
}

.empty-state,
.workflow-empty-state,
.knowledge-empty-workspace,
.policy-empty-workspace {
  color: var(--text-muted);
}

.workflow-empty-state,
.knowledge-empty-workspace,
.policy-empty-workspace {
  min-height: 230px;
  align-content: center;
  justify-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: rgba(240, 243, 239, 0.45);
  padding: 34px;
  text-align: center;
}

.workflow-empty-state::before,
.knowledge-empty-workspace::before,
.policy-empty-workspace::before {
  content: "";
  width: 36px;
  height: 20px;
  margin-bottom: 10px;
  border: 2px solid var(--aurora-mint);
  border-color: var(--aurora-mint) transparent transparent;
  border-radius: 50%;
}

details {
  border-color: var(--border-subtle);
  border-radius: var(--radius-sm);
}

details summary {
  min-height: 44px;
  color: var(--aurora-primary);
}

pre {
  border-radius: var(--radius-sm);
  background: #15373a;
  color: #f0f7f5;
}

.login-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background:
    linear-gradient(115deg, rgba(15, 62, 67, 0.97), rgba(24, 114, 121, 0.91)),
    var(--aurora-deep);
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: linear-gradient(120deg, transparent 48%, rgba(232, 244, 242, 0.12) 49%, transparent 50%);
  background-size: 70px 70px;
}

.login-panel {
  position: relative;
  width: min(100%, 470px);
  border-color: rgba(255, 255, 255, 0.42);
  border-radius: var(--radius-lg);
  background: rgba(255, 254, 250, 0.97);
  padding: clamp(30px, 5vw, 46px);
  box-shadow: 0 30px 90px rgba(4, 31, 34, 0.3);
}

.login-brand {
  margin-bottom: 36px;
}

.login-panel h1 {
  margin: 0;
  color: var(--aurora-deep);
  font-size: clamp(2rem, 6vw, 2.7rem);
  line-height: 1.08;
}

.login-panel > p:not(.page-eyebrow) {
  margin: 12px 0 28px;
  color: var(--text-muted);
}

.login-form {
  gap: 18px;
}

.login-fields {
  gap: 12px;
}

.login-form .auth-message {
  text-align: left;
}

@media (max-width: 1180px) {
  .statistics-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-sections {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app-header {
    position: sticky;
    top: 0;
  }

  .app-shell {
    display: block;
    padding-top: 18px;
  }

  .module-nav {
    position: relative;
    top: auto;
    z-index: 8;
    display: flex;
    width: 100%;
    margin-bottom: 28px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 0 12px;
    scrollbar-width: none;
  }

  .module-nav::-webkit-scrollbar { display: none; }
  .nav-section-label,
  .nav-assurance { display: none; }

  .nav-button {
    flex: 0 0 auto;
    padding: 10px 14px;
  }

  .nav-button::before { display: none; }

  .workflow-layout {
    height: auto;
  }
}

@media (max-width: 680px) {
  body { font-size: 16px; }

  .app-header {
    min-height: 74px;
    padding: 13px 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-mark::before,
  .brand-mark::after,
  .brand-mark span {
    left: 7px;
    width: 20px;
  }

  .title-block p { display: none; }

  .auth-session span { display: none; }

  .auth-session button {
    min-height: 42px;
    padding: 8px 12px;
  }

  .app-shell {
    padding: 14px 16px 32px;
  }

  .module-nav {
    margin: 0 -16px 24px;
    width: calc(100% + 32px);
    padding: 0 16px 12px;
  }

  .panel-header h2 {
    font-size: 2rem;
  }

  .page-intro {
    font-size: 0.95rem;
  }

  .statistics-kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .metric-card {
    min-height: 126px;
    padding: 16px;
  }

  .metric-card strong {
    font-size: 2rem;
  }

  .metric-note {
    display: none;
  }

  .filters {
    border-radius: 12px;
    padding: 14px;
  }

  .handoff-workspace,
  .section-panel,
  .settings-card {
    border-radius: 12px;
  }

  .handoff-workspace {
    min-height: 420px;
    padding: 18px;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .calls-table {
    min-width: 0;
  }

  .calls-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .calls-table,
  .calls-table tbody,
  .calls-table tr,
  .calls-table td {
    display: block;
    width: 100%;
  }

  .calls-table tr {
    margin: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
  }

  .calls-table td {
    border: 0;
    padding: 4px 0;
  }

  .calls-table-row.active td,
  .calls-table-row:hover td {
    background: transparent;
  }

  .calls-table-row.active {
    background: var(--aurora-mist);
    box-shadow: inset 3px 0 var(--aurora-primary);
  }

  .login-shell {
    align-items: center;
    padding: 18px;
  }
}

@media (max-width: 420px) {
  .statistics-kpi-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body .call-view-segmented button,
body .statistics-range-filter button {
  min-height: 44px;
  padding-top: 9px;
  padding-bottom: 9px;
}
