@font-face {
  font-family: "Onest";
  src: url("/assets/fonts/Onest-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/IBMPlexMono-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --mist: #e8eef1;
  --paper: #f9fbfb;
  --ink: #10212b;
  --navy: #143c4a;
  --teal: #0b7d83;
  --teal-soft: #d5eaeb;
  --green: #3f7f63;
  --amber: #9d6a19;
  --red: #b84d58;
  --line: #c9d5d9;
  --muted: #60737b;
  --container-max: 92rem;
  --panel-radius: 1.1rem;
  --panel-pad: 1.3rem;
  --shadow: 0 1.25rem 3.5rem rgba(16, 33, 43, 0.1);
  color-scheme: light;
  font-family: "Onest", "Segoe UI Variable", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 20rem;
  margin: 0;
  color: var(--ink);
  background: var(--mist);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 0.16rem solid var(--teal);
  outline-offset: 0.16rem;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.shell {
  width: min(96%, var(--container-max));
  margin: 0 auto;
  padding: 1.5rem 0 5rem;
}

.topbar,
.brand,
.panel-header,
.dialog-header,
.dialog-footer,
.pagination {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand {
  gap: 0.85rem;
}

.brand-mark {
  display: grid;
  width: 3rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.8rem;
  color: white;
  background: var(--navy);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.8rem;
}

.brand-copy strong,
.brand-copy span,
.person strong,
.person small,
.operator strong,
.operator small,
.metric span,
.metric strong,
.metric small {
  display: block;
}

.brand-copy strong {
  font-size: 1rem;
}

.brand-copy span,
.system-state,
.eyebrow,
.utility,
.id,
.utterance-time {
  font-family: "IBM Plex Mono", monospace;
}

.brand-copy span,
.system-state,
.utility {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-copy span,
.muted,
.panel-header p,
.metric span,
.metric small,
.person small,
.operator small {
  color: var(--muted);
}

.system-state {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  border: 1px solid var(--line);
  border-radius: 999rem;
  padding: 0.55rem 0.9rem;
  color: var(--ink);
  background: rgba(249, 251, 251, 0.78);
  text-align: left;
  cursor: pointer;
}

.system-state::before {
  width: 0.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0.3rem rgba(63, 127, 99, 0.13);
  content: "";
}

.system-state.failed::before {
  background: var(--red);
  box-shadow: 0 0 0 0.3rem rgba(184, 77, 88, 0.13);
}

.hero,
.filters,
.panel {
  border: 1px solid rgba(201, 213, 217, 0.92);
  background: rgba(249, 251, 251, 0.94);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.35rem;
  padding: clamp(1.4rem, 3vw, 2.6rem);
}

.hero::after {
  position: absolute;
  top: -6rem;
  right: -4rem;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(11, 125, 131, 0.18);
  border-radius: 50%;
  box-shadow:
    0 0 0 3.25rem rgba(11, 125, 131, 0.035),
    0 0 0 6.5rem rgba(11, 125, 131, 0.025);
  content: "";
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 2rem;
  align-items: end;
}

.eyebrow {
  margin-bottom: 0.8rem;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  max-width: 15ch;
  margin-bottom: 0.85rem;
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  font-weight: 650;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 55ch;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.demo-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.85fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  margin-top: 1rem;
  border: 1px solid var(--navy);
  border-radius: var(--panel-radius);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
}

.demo-intro .eyebrow {
  color: #9bdee0;
}

.demo-intro h2 {
  max-width: 20ch;
  margin-bottom: 0.7rem;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.demo-intro p:last-child {
  max-width: 54ch;
  margin-bottom: 0;
  color: #d0e0e4;
  line-height: 1.55;
}

.demo-upload {
  display: grid;
  gap: 0.75rem;
  border: 1px dashed #85b7c0;
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
}

.demo-upload label {
  color: white;
}

.demo-upload input {
  height: auto;
  padding: 0.75rem;
  color: var(--ink);
}

.demo-upload input::file-selector-button {
  margin-right: 0.75rem;
  border: 0;
  border-radius: 0.45rem;
  padding: 0.4rem 0.65rem;
  color: var(--navy);
  background: var(--teal-soft);
  cursor: pointer;
}

.demo-upload p {
  margin: 0;
  color: #d0e0e4;
  font-size: 0.78rem;
}

.demo-upload .button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.demo-upload .button.primary {
  color: var(--navy);
  background: #a7e0df;
}

.demo-upload .button.primary:hover {
  background: #c5f0ef;
}

#feedbackDialog {
  width: min(94%, 38rem);
}

.feedback-contact {
  display: grid;
  gap: 0.3rem;
  font-size: 1.15rem;
}

.feedback-contact a {
  color: var(--teal);
}

.feedback-note {
  color: var(--muted);
  font-size: 0.78rem;
}

.hero-counter {
  display: grid;
  gap: 0.2rem;
  border-left: 1px solid var(--line);
  padding-left: 1.5rem;
}

.hero-counter strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
  line-height: 1;
}

.hero-counter span {
  color: var(--muted);
  font-size: 0.9rem;
}

.quality-ribbon {
  --good-share: 1fr;
  --neutral-share: 1fr;
  --bad-share: 1fr;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--good-share) var(--neutral-share) var(--bad-share);
  min-height: 2.4rem;
  margin-top: 2rem;
  overflow: hidden;
  border-radius: 0.75rem;
  color: white;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
}

.quality-ribbon.compact {
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  min-height: 4.5rem;
  margin-top: 0;
  overflow: visible;
  border-radius: 0;
}

.quality-ribbon.compact > span {
  min-width: 0;
  border-radius: 0.75rem;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem;
}

.quality-ribbon.compact strong {
  font-size: 1.25rem;
  line-height: 1;
}

.quality-ribbon.compact small {
  font-family: "Onest", "Segoe UI Variable", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
}

.quality-ribbon.compact b,
.resolution-grid b {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 400;
}

.resolution-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  min-height: 4.5rem;
}

.resolution-grid > span {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem;
  text-align: center;
}

.resolution-grid strong {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.25rem;
  line-height: 1;
}

.resolution-grid small {
  font-size: 0.72rem;
  font-weight: 600;
}

.resolution-grid .yes {
  color: white;
  background: var(--green);
}

.resolution-grid .partial {
  color: white;
  background: var(--amber);
}

.resolution-grid .no {
  color: white;
  background: var(--red);
}

.resolution-grid .unknown {
  color: white;
  background: var(--navy);
}

.quality-ribbon > span {
  display: flex;
  min-width: 0.5rem;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.quality-ribbon .good {
  background: var(--green);
}

.quality-ribbon .neutral {
  color: white;
  background: var(--amber);
}

.quality-ribbon .bad {
  background: var(--red);
}

.quality-legend {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.2rem;
  margin-top: 0.65rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
}

.quality-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.swatch {
  width: 0.55rem;
  aspect-ratio: 1;
  border-radius: 50%;
}

.swatch.good {
  background: var(--green);
}

.swatch.neutral {
  background: var(--amber);
}

.swatch.bad {
  background: var(--red);
}

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(12rem, 1.2fr) auto;
  gap: 0.85rem;
  align-items: end;
  margin-top: 1rem;
  border-radius: var(--panel-radius);
  padding: 1.1rem;
}

label,
.filter-control {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.field-label {
  display: block;
}

input,
select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0 0.8rem;
  color: var(--ink);
  background: white;
}

.custom-select {
  position: relative;
  min-width: 0;
}

.custom-select.is-open {
  z-index: 40;
}

.custom-select-trigger {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  padding: 0 0.8rem;
  color: var(--ink);
  background: white;
  cursor: pointer;
  text-align: left;
}

.custom-select-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  width: 0.58rem;
  height: 0.58rem;
  flex: 0 0 auto;
  border-right: 0.12rem solid currentColor;
  border-bottom: 0.12rem solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform 140ms ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: translateY(0.12rem) rotate(225deg);
}

.custom-select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  left: 0;
  right: auto;
  display: grid;
  width: max-content;
  min-width: 100%;
  max-width: min(32rem, calc(100vw - 2rem));
  max-height: 18rem;
  gap: 0.2rem;
  border: 1px solid var(--line);
  border-radius: 0.72rem;
  padding: 0.35rem;
  background: white;
  box-shadow: 0 0.85rem 2rem rgba(16, 33, 43, 0.18);
  overflow-y: auto;
}

.custom-select-menu[hidden] {
  display: none;
}

.custom-select-menu button {
  position: relative;
  width: 100%;
  min-height: 2.4rem;
  border: 0;
  border-radius: 0.5rem;
  padding: 0 0.8rem 0 2rem;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.custom-select-menu button:hover,
.custom-select-menu button:focus-visible {
  background: var(--teal-soft);
}

.custom-select-menu button[aria-selected="true"] {
  color: var(--navy);
  background: color-mix(in srgb, var(--teal-soft) 72%, white);
  font-weight: 700;
}

.custom-select-menu button[aria-selected="true"]::before {
  position: absolute;
  top: 50%;
  left: 0.85rem;
  width: 0.42rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--teal);
  content: "";
  transform: translateY(-50%);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

.button,
.icon-button {
  border: 0;
  cursor: pointer;
}

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  padding: 0 1.05rem;
  text-decoration: none;
  font-weight: 650;
}

.button.primary {
  color: white;
  background: var(--navy);
}

.button.ghost {
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.metric {
  display: grid;
  min-width: 0;
  border-top: 0.22rem solid var(--teal);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--paper);
  box-shadow: 0 0.8rem 2.2rem rgba(16, 33, 43, 0.07);
}

.metric.warn {
  border-top-color: var(--amber);
}

.metric.danger {
  border-top-color: var(--red);
}

.metric span,
.metric small {
  font-size: 0.78rem;
}

.metric strong {
  margin-top: 0.45rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.7rem;
}

.metric small {
  margin-top: 0.25rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  align-items: stretch;
}

.quality-panel,
.resolution-panel {
  grid-column: span 2;
}

.quality-panel,
.resolution-panel {
  display: flex;
  flex-direction: column;
}

.operators-panel {
  grid-column: 1 / -1;
}

.journal-filters {
  grid-column: 1 / -1;
  margin-top: 0;
}

.panel {
  border-radius: var(--panel-radius);
  padding: var(--panel-pad);
}

.panel-header,
.dialog-header {
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.panel-header {
  margin-bottom: 0.9rem;
}

.panel-header h2,
.dialog-header h2 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.panel-header p {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.utility {
  color: var(--teal);
  white-space: nowrap;
}

.operator-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.operator-list > .empty {
  display: grid;
  min-height: 4.5rem;
  grid-column: 1 / -1;
  place-items: center;
  padding: 0.85rem;
}

.operator {
  display: grid;
  width: 100%;
  grid-template-columns: 2.25rem minmax(0, 1fr) auto;
  gap: 0.6rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.65rem;
  color: var(--ink);
  background: white;
  text-align: left;
  cursor: pointer;
}

.operator:hover,
tbody tr:hover {
  background: #f0f7f7;
}

.operator-rank {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 0.55rem;
  color: var(--teal);
  background: var(--teal-soft);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
}

.operator-score {
  min-width: 3.2rem;
  color: var(--green);
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 1rem;
  text-align: right;
}

.table-panel {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
}

table {
  width: 100%;
  min-width: 78rem;
  border-collapse: collapse;
  background: white;
}

th,
td {
  border-bottom: 1px solid #dbe3e6;
  padding: 0.85rem 0.9rem;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #f1f5f6;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

.person small {
  margin-top: 0.15rem;
}

.id {
  color: var(--muted);
  font-size: 0.78rem;
}

.pill {
  display: inline-flex;
  border-radius: 999rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.73rem;
  font-weight: 650;
  white-space: nowrap;
}

.pill.satisfied {
  color: #285f48;
  background: #dbede4;
}

.pill.neutral {
  color: #805c18;
  background: #f6e8c8;
}

.pill.dissatisfied {
  color: #8d3440;
  background: #f2dce0;
}

.pill.resolution.yes {
  color: #285f48;
  background: #dbede4;
}

.pill.resolution.partial {
  color: #805c18;
  background: #f6e8c8;
}

.pill.resolution.no {
  color: #8d3440;
  background: #f2dce0;
}

.pill.resolution.unknown {
  color: var(--muted);
  background: var(--mist);
}

.report-link {
  border: 0;
  padding: 0;
  color: var(--teal);
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.pagination {
  justify-content: flex-end;
  gap: 0.8rem;
  margin-top: 1rem;
  color: var(--muted);
}

.empty,
.error {
  border-radius: 0.75rem;
  padding: 1.25rem;
  text-align: center;
}

.empty {
  color: var(--muted);
  background: #f1f5f6;
}

.error {
  color: #8d3440;
  background: #f2dce0;
}

dialog {
  width: min(94%, 64rem);
  max-height: 90vh;
  border: 0;
  border-radius: 1.2rem;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 2rem 6rem rgba(16, 33, 43, 0.3);
}

dialog::backdrop {
  background: rgba(16, 33, 43, 0.52);
  backdrop-filter: blur(0.25rem);
}

.dialog-shell {
  display: grid;
  max-height: 90vh;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.dialog-header,
.dialog-footer {
  padding: 1.2rem 1.4rem;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-footer {
  justify-content: flex-end;
  gap: 0.7rem;
  border-top: 1px solid var(--line);
}

.dialog-content {
  overflow: auto;
  padding: 1.4rem;
}

.recording-player {
  display: grid;
  grid-template-columns: minmax(12rem, 0.45fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-left: 0.24rem solid var(--teal);
  border-radius: 0.8rem;
  padding: 1rem;
  background: var(--teal-soft);
}

.recording-player h3,
.recording-player p {
  margin-bottom: 0;
}

.recording-player h3 {
  font-size: 1rem;
}

.recording-player p {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.recording-player audio {
  display: none;
}

.audio-player {
  min-width: 0;
}

.audio-controls {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.7rem 0.8rem;
  background: white;
  box-shadow: 0 0.5rem 1.2rem rgba(16, 33, 43, 0.08);
}

.audio-toggle {
  display: grid;
  width: 2.5rem;
  flex: 0 0 2.5rem;
  aspect-ratio: 1;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  cursor: pointer;
}

.audio-toggle span {
  transform: translateX(0.06rem);
}

.audio-player.is-playing .audio-toggle {
  background: var(--teal);
}

.audio-player.is-playing .audio-toggle span {
  transform: none;
}

.audio-controls input[type="range"] {
  min-height: 1rem;
  border: 0;
  padding: 0;
  background: transparent;
  accent-color: var(--teal);
  cursor: pointer;
}

.audio-progress {
  min-width: 8rem;
  flex: 1 1 16rem;
}

.audio-time {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.3rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.74rem;
  white-space: nowrap;
}

.audio-volume {
  display: inline-flex;
  flex: 0 1 9rem;
  grid-template-columns: none;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.68rem;
}

.audio-volume input {
  min-width: 4rem;
}

.recording-player.unavailable {
  grid-template-columns: 1fr;
  border-left-color: var(--amber);
  background: white;
}

.icon-button {
  width: 2.5rem;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--ink);
  background: var(--mist);
  font-size: 1.5rem;
}

.report-meta,
.outcome-grid,
.emotion-grid {
  display: grid;
  gap: 0.75rem;
}

.report-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.outcome-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.outcome-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  background: white;
}

.outcome-card > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.report-meta > div,
.report-section {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 1rem;
  background: white;
}

.report-meta span,
.report-meta strong {
  display: block;
}

.report-meta span {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.report-section {
  margin-top: 1rem;
}

.emotion-section {
  border-left: 0.24rem solid var(--teal);
  background: #f3f8f8;
}

.report-section h3 {
  margin-bottom: 0.65rem;
  font-size: 1rem;
}

.emotion-overall {
  margin-bottom: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
}

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

.emotion-role {
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 0.85rem;
  background: white;
}

.emotion-role > strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.8rem;
}

.emotion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.emotion-tag {
  border-radius: 999rem;
  padding: 0.3rem 0.55rem;
  color: #285f60;
  background: var(--teal-soft);
  font-size: 0.72rem;
  font-weight: 650;
}

.transcript {
  display: grid;
  gap: 0.6rem;
}

.utterance {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.75rem;
  border-left: 0.2rem solid var(--teal);
  padding: 0.75rem;
  background: #f3f7f8;
}

.utterance p {
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

.utterance-time {
  color: var(--muted);
  font-size: 0.75rem;
}

.toast {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 20;
  max-width: min(22rem, calc(100% - 2.4rem));
  border-radius: 0.75rem;
  padding: 0.65rem 0.8rem;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 1366px) {
  .filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .operator-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-actions {
    align-self: stretch;
  }

  .filter-actions .button {
    flex: 1;
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .demo-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .hero-counter {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 1rem;
    padding-left: 0;
  }

  .metrics,
  .report-meta,
  .outcome-grid,
  .emotion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quality-panel,
  .resolution-panel,
  .operators-panel {
    grid-column: 1;
  }
}

@media (max-width: 767px) {
  .shell {
    width: min(94%, var(--container-max));
    padding-top: 1rem;
  }

  .topbar,
  .panel-header,
  .dialog-header,
  .dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

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

  .system-state {
    justify-content: center;
  }

  .hero,
  .filters,
  .panel {
    border-radius: 0.9rem;
  }

  .filters,
  .metrics,
  .recording-player,
  .report-meta,
  .outcome-grid,
  .emotion-grid {
    grid-template-columns: 1fr;
  }

  .quality-ribbon.compact,
  .operator-list {
    grid-template-columns: 1fr;
  }

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

  .filter-actions,
  .dialog-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .pagination {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero,
  .filters,
  .metrics,
  .dashboard-grid {
    animation: rise 0.45s ease both;
  }

  .filters {
    animation-delay: 0.04s;
  }

  .metrics {
    animation-delay: 0.08s;
  }

  .dashboard-grid {
    animation-delay: 0.12s;
  }

  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(0.5rem);
    }
  }
}
