:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #12221e;
  --muted: #697873;
  --line: #dce5e2;
  --line-strong: #cbd8d4;
  --accent: #126f5d;
  --accent-strong: #0c594a;
  --accent-soft: #e1f1ec;
  --accent-pale: #f0f8f5;
  --danger: #b33a42;
  --danger-soft: #fff0f1;
  --warning: #8a5d10;
  --warning-soft: #fff8e7;
  --shadow: 0 12px 36px rgba(26, 55, 47, 0.07);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --transition: 160ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(47, 160, 132, 0.12), transparent 30rem),
    var(--bg);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

button,
input {
  font: inherit;
}

button,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
label[for]:focus-visible,
audio:focus-visible {
  outline: 3px solid rgba(18, 111, 93, 0.23);
  outline-offset: 2px;
}

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

.is-hidden {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.topbar {
  height: 76px;
  border-bottom: 1px solid rgba(203, 216, 212, 0.78);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar__inner {
  width: min(1320px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(18, 111, 93, 0.22);
}

.brand__mark i {
  display: block;
  width: 2px;
  border-radius: 3px;
  background: currentColor;
}

.brand__mark i:nth-child(1),
.brand__mark i:nth-child(5) { height: 8px; opacity: 0.75; }
.brand__mark i:nth-child(2),
.brand__mark i:nth-child(4) { height: 16px; }
.brand__mark i:nth-child(3) { height: 24px; }

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.service-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d39d39;
  box-shadow: 0 0 0 4px rgba(211, 157, 57, 0.14);
}

.service-status.is-online .status-dot {
  background: #2d9b71;
  box-shadow: 0 0 0 4px rgba(45, 155, 113, 0.13);
}

.service-status.is-offline .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(179, 58, 66, 0.12);
}

.app-shell {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 26px;
}

.page-heading h1 {
  max-width: 760px;
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.035em;
}

.page-heading p:not(.eyebrow) {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
}

.eyebrow,
.section-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 9px;
}

.tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.7);
}

.tab {
  min-width: 112px;
  padding: 9px 15px;
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  font-weight: 650;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 3px 10px rgba(29, 58, 50, 0.08);
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px 17px;
  border: 1px solid #ead9a5;
  border-radius: var(--radius-md);
  color: var(--warning);
  background: var(--warning-soft);
}

.notice__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #c18b2b;
  font-size: 12px;
  font-weight: 800;
}

.notice strong {
  display: block;
}

.notice p {
  margin: 2px 0 0;
  color: #806828;
  font-size: 13px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card__header,
.section-heading,
.results-heading,
.detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.card__header h2,
.section-heading h3,
.results-heading h2 {
  margin: 2px 0 0;
  line-height: 1.25;
}

.count-pill {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 750;
}

.library-demo-cta {
  margin-bottom: 18px;
  padding: 17px 19px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  color: var(--ink);
  border: 1px solid #bcded4;
  border-radius: 16px;
  background:
    radial-gradient(circle at 85% 0, rgba(18, 111, 93, .12), transparent 20rem),
    var(--accent-pale);
}

.library-demo-cta__visual {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  border-radius: 14px;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(18, 111, 93, .18);
}

.library-demo-cta__visual i {
  width: 3px;
  height: 11px;
  display: block;
  border-radius: 4px;
  background: currentColor;
}

.library-demo-cta__visual i:nth-child(2),
.library-demo-cta__visual i:nth-child(4) { height: 21px; }
.library-demo-cta__visual i:nth-child(3) { height: 31px; }

.library-demo-cta__copy {
  min-width: 0;
}

.library-demo-cta__copy span,
.library-demo-cta__copy strong {
  display: block;
}

.library-demo-cta__copy span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
}

.library-demo-cta__copy strong {
  margin-top: 1px;
  font-size: 16px;
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.29fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.speaker-sidebar {
  min-height: 680px;
  padding: 22px;
}

.add-speaker {
  display: flex;
  gap: 8px;
  margin: 20px 0 14px;
}

.add-speaker input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.add-speaker input::placeholder {
  color: #94a09c;
}

.add-speaker input:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(18, 111, 93, 0.09);
}

.button,
.record-button,
.icon-button,
.text-button {
  border: 0;
  cursor: pointer;
  font-weight: 680;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
}

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

.button:disabled,
.record-button:disabled,
.icon-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 10px;
  white-space: nowrap;
}

.button--compact {
  min-height: 41px;
  padding: 8px 14px;
}

.button--primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 5px 14px rgba(18, 111, 93, 0.17);
}

.button--primary:hover:not(:disabled) {
  background: var(--accent-strong);
}

.button--secondary {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: #fff;
}

.button--secondary:hover:not(:disabled) {
  border-color: #aebfba;
  background: var(--surface-soft);
}

.button--ghost {
  color: var(--muted);
  background: transparent;
}

.button--ghost:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.75);
}

.button--danger-ghost {
  min-height: 38px;
  color: var(--danger);
  border: 1px solid #efc8cb;
  background: #fff;
}

.button--danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.speaker-list {
  display: grid;
  gap: 6px;
}

.speaker-item {
  width: 100%;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.speaker-item:hover {
  background: var(--surface-soft);
}

.speaker-item.is-active {
  border-color: #cae4dc;
  background: var(--accent-pale);
}

.speaker-item__avatar,
.identity__avatar {
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  font-weight: 800;
}

.speaker-item__avatar {
  width: 39px;
  height: 39px;
}

.speaker-item__copy {
  min-width: 0;
}

.speaker-item__copy strong,
.speaker-item__copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.speaker-item__copy strong {
  font-size: 14px;
}

.speaker-item__copy small {
  color: var(--muted);
  font-size: 11px;
}

.chevron {
  color: #9faca8;
  font-size: 23px;
  line-height: 1;
}

.sidebar-empty,
.list-empty,
.detail-empty {
  text-align: center;
  color: var(--muted);
}

.sidebar-empty {
  padding: 48px 10px 20px;
}

.empty-avatar {
  width: 50px;
  height: 50px;
  margin: 0 auto 13px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border: 1px dashed #a9cdc3;
  border-radius: 50%;
  background: var(--accent-pale);
  font-size: 22px;
}

.sidebar-empty strong,
.list-empty strong {
  display: block;
  color: var(--ink);
}

.sidebar-empty p,
.list-empty p {
  margin: 4px 0 0;
  font-size: 13px;
}

.speaker-detail {
  min-width: 0;
  min-height: 680px;
}

.detail-empty {
  min-height: 680px;
  padding: 48px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.detail-empty h2 {
  margin: 22px 0 7px;
  color: var(--ink);
  font-size: 21px;
}

.detail-empty p {
  max-width: 420px;
  margin-bottom: 0;
}

.empty-wave {
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 28px;
  color: var(--accent);
  background: var(--accent-soft);
}

.empty-wave i {
  width: 3px;
  border-radius: 4px;
  background: currentColor;
}

.empty-wave i:nth-child(1), .empty-wave i:nth-child(7) { height: 10px; opacity: .45; }
.empty-wave i:nth-child(2), .empty-wave i:nth-child(6) { height: 20px; opacity: .65; }
.empty-wave i:nth-child(3), .empty-wave i:nth-child(5) { height: 32px; opacity: .85; }
.empty-wave i:nth-child(4) { height: 46px; }

.detail-content {
  padding: 28px;
}

.identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.identity__avatar {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  font-size: 18px;
}

.identity h2 {
  margin: 0;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.identity p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.recorder-card {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid #cfe4de;
  border-radius: 17px;
  background:
    radial-gradient(circle at 100% 0, rgba(18, 111, 93, 0.08), transparent 20rem),
    var(--accent-pale);
}

.recorder-copy h3 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.recorder-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.step-badge {
  display: inline-block;
  padding: 4px 8px;
  color: var(--accent);
  border-radius: 999px;
  background: #dcefe9;
  font-size: 10px;
  font-weight: 780;
  letter-spacing: .08em;
}

.capture-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.record-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 17px;
  color: #fff;
  border-radius: 10px;
  background: var(--ink);
}

.record-button:hover:not(:disabled) {
  background: #1e3932;
}

.record-button__icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fb6b72;
  box-shadow: 0 0 0 4px rgba(251, 107, 114, 0.14);
}

.button--stop {
  color: var(--danger);
  border: 1px solid #edc4c7;
  background: var(--danger-soft);
}

.stop-icon {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: currentColor;
}

.recording-timer,
.big-timer {
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
}

.audio-draft {
  margin-top: 20px;
  padding: 13px;
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid #c9ddd7;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.78);
}

.audio-draft__info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-file-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 17px;
}

.audio-draft__info strong,
.audio-draft__info small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-draft__info small {
  color: var(--muted);
  font-size: 11px;
}

.audio-draft audio,
.recording-item audio {
  width: 100%;
  height: 38px;
}

.audio-draft__actions {
  display: flex;
  gap: 6px;
}

.recordings-section {
  margin-top: 30px;
}

.text-button {
  padding: 5px;
  color: var(--accent);
  background: transparent;
}

.text-button:hover:not(:disabled) {
  color: var(--accent-strong);
}

.recording-list {
  margin-top: 13px;
  display: grid;
  gap: 8px;
}

.recording-item {
  display: grid;
  grid-template-columns: 38px minmax(130px, .7fr) minmax(200px, 1.15fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.recording-item__index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 780;
}

.recording-item__meta {
  min-width: 0;
}

.recording-item__meta strong,
.recording-item__meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recording-item__meta strong {
  font-size: 13px;
}

.recording-item__meta small {
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
}

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

.icon-button--danger:hover:not(:disabled) {
  background: var(--danger-soft);
}

.list-empty {
  margin-top: 13px;
  padding: 34px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  background: var(--surface-soft);
}

.demo-hero {
  padding: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: center;
  gap: 34px;
  overflow: hidden;
  color: #fff;
  border-color: rgba(10, 79, 65, .55);
  background:
    radial-gradient(circle at 100% -15%, rgba(137, 220, 196, .25), transparent 22rem),
    linear-gradient(135deg, #123c33, #0b6654);
  box-shadow: 0 18px 45px rgba(16, 70, 57, .15);
}

.demo-hero__copy h2 {
  max-width: 700px;
  margin: 12px 0 8px;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.2;
  letter-spacing: -.025em;
}

.demo-hero__copy p {
  max-width: 770px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, .74);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .08);
  font-size: 11px;
  font-weight: 700;
}

.demo-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #65d5ad;
  box-shadow: 0 0 0 4px rgba(101, 213, 173, .14);
}

.library-stat {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .17);
  border-radius: 16px;
  background: rgba(255, 255, 255, .1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.library-stat > span {
  color: rgba(255, 255, 255, .68);
  font-size: 11px;
}

.library-stat > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.library-stat strong {
  font-size: 38px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.library-stat small {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
}

.text-button--arrow {
  margin-top: 9px;
  padding: 0;
  color: #b5ead8;
}

.text-button--arrow:hover:not(:disabled) {
  color: #fff;
}

.demo-steps {
  margin: 14px 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  list-style: none;
}

.demo-steps li {
  min-width: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
}

.demo-step__number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.demo-steps strong,
.demo-steps p {
  display: block;
}

.demo-steps strong {
  font-size: 13px;
}

.demo-steps p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.identify-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
}

.identify-capture,
.guide-card {
  padding: 28px;
}

.card__header--stack {
  display: block;
}

.card__header--stack h2 {
  margin: 4px 0 6px;
  font-size: 25px;
}

.card__header--stack p {
  margin-bottom: 0;
  color: var(--muted);
}

.sample-demo {
  margin-top: 20px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d9d6f0;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8f6ff, #f4faf8);
}

.sample-demo strong,
.sample-demo p {
  display: block;
}

.sample-demo strong {
  margin-top: 5px;
  font-size: 14px;
}

.sample-demo p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.sample-demo__badge {
  padding: 3px 7px;
  color: #61549b;
  border-radius: 999px;
  background: #e9e4fb;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.button--demo {
  flex: 0 0 auto;
  color: #fff;
  background: #56498c;
  box-shadow: 0 5px 14px rgba(86, 73, 140, .17);
}

.button--demo:hover:not(:disabled) {
  background: #473c78;
}

.big-recorder {
  min-height: 310px;
  margin-top: 24px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #b8d0c9;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 55%, rgba(18, 111, 93, .08), transparent 15rem),
    var(--surface-soft);
  transition: border-color var(--transition), background var(--transition);
}

.big-recorder.is-recording {
  border-color: #e4aaae;
  background:
    radial-gradient(circle at 50% 55%, rgba(179, 58, 66, .08), transparent 15rem),
    #fffafa;
}

.big-recorder__visual {
  height: 64px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
}

.big-recorder__visual span {
  width: 4px;
  height: var(--bar-height, 20px);
  border-radius: 5px;
  background: currentColor;
  opacity: .78;
}

.big-recorder__visual span:nth-child(1), .big-recorder__visual span:nth-child(9) { --bar-height: 14px; opacity: .35; }
.big-recorder__visual span:nth-child(2), .big-recorder__visual span:nth-child(8) { --bar-height: 26px; opacity: .48; }
.big-recorder__visual span:nth-child(3), .big-recorder__visual span:nth-child(7) { --bar-height: 39px; opacity: .63; }
.big-recorder__visual span:nth-child(4), .big-recorder__visual span:nth-child(6) { --bar-height: 52px; opacity: .78; }
.big-recorder__visual span:nth-child(5) { --bar-height: 64px; }

.big-recorder.is-recording .big-recorder__visual {
  color: var(--danger);
}

.big-recorder.is-recording .big-recorder__visual span {
  animation: pulse-wave .75s ease-in-out infinite alternate;
}

.big-recorder.is-recording .big-recorder__visual span:nth-child(2n) { animation-delay: -.35s; }
.big-recorder.is-recording .big-recorder__visual span:nth-child(3n) { animation-delay: -.2s; }

@keyframes pulse-wave {
  from { transform: scaleY(.42); }
  to { transform: scaleY(1); }
}

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

.big-recorder > strong {
  font-size: 18px;
}

.big-recorder > p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.big-timer {
  margin-top: 10px;
  font-size: 24px;
  letter-spacing: .04em;
}

.capture-actions--center {
  justify-content: center;
}

.audio-draft--identify {
  margin-top: 16px;
  border-color: var(--line);
  background: var(--surface-soft);
}

.button--identify {
  min-width: 112px;
}

.guide-card {
  background:
    linear-gradient(160deg, rgba(18, 111, 93, .035), transparent 55%),
    #fff;
}

.guide-card h2 {
  margin: 5px 0 0;
  font-size: 23px;
}

.guide-list {
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.guide-list li {
  display: grid;
  grid-template-columns: 31px 1fr;
  gap: 12px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.guide-list li > span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  color: var(--accent);
  border-radius: 9px;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
}

.guide-list strong {
  display: block;
  font-size: 14px;
}

.guide-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.results-card {
  margin-top: 20px;
  padding: 28px;
}

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

.result-summary {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.metric--accent {
  border-color: #cce3dc;
  background: var(--accent-pale);
}

.metric small,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  margin: 3px 0 0;
  display: inline-block;
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}

.known-speakers-block,
.timeline-block {
  margin-top: 28px;
}

.known-speakers-block h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.speaker-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.speaker-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px 7px 7px;
  color: var(--ink);
  border: 1px solid #cfe4de;
  border-radius: 999px;
  background: var(--accent-pale);
  font-size: 13px;
  font-weight: 680;
}

.speaker-chip__avatar {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: var(--accent);
  font-size: 10px;
}

.speaker-chip small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.muted {
  color: var(--muted);
}

.segment-list {
  margin-top: 13px;
  display: grid;
  gap: 7px;
}

.segment-item {
  display: grid;
  grid-template-columns: 112px 11px minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.segment-item.is-unknown {
  color: #6f6752;
  background: #fcfaf5;
}

.segment-time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.segment-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(18, 111, 93, .1);
}

.segment-item.is-unknown .segment-marker {
  background: #b3914e;
  box-shadow: 0 0 0 4px rgba(179, 145, 78, .1);
}

.segment-speaker {
  min-width: 0;
}

.segment-speaker strong,
.segment-speaker small {
  display: block;
}

.segment-speaker small {
  color: var(--muted);
  font-size: 10px;
}

.score-badge {
  padding: 4px 8px;
  color: var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 750;
}

.segment-item.is-unknown .score-badge {
  color: #7b693e;
  background: #f1ead8;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  width: min(360px, calc(100% - 40px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 13px 15px;
  color: #fff;
  border-radius: 11px;
  background: #17332c;
  box-shadow: 0 12px 32px rgba(10, 32, 26, .22);
  opacity: 0;
  transform: translateY(8px);
  animation: toast-in .22s forwards;
  pointer-events: auto;
  font-size: 13px;
}

.toast.is-error {
  background: #7f2930;
}

@keyframes toast-in {
  to { opacity: 1; transform: translateY(0); }
}

.loading-row {
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

@media (max-width: 1040px) {
  .identify-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
  }

  .audio-draft {
    grid-template-columns: minmax(150px, .8fr) minmax(190px, 1fr);
  }

  .audio-draft__actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .recording-item {
    grid-template-columns: 38px minmax(130px, .7fr) minmax(180px, 1fr) auto;
  }
}

@media (max-width: 820px) {
  .app-shell,
  .topbar__inner {
    width: min(100% - 28px, 680px);
  }

  .app-shell {
    padding-top: 28px;
  }

  .page-heading {
    display: block;
  }

  .tabs {
    width: 100%;
    margin-top: 22px;
  }

  .tab {
    flex: 1;
  }

  .manager-layout,
  .identify-grid {
    grid-template-columns: 1fr;
  }

  .demo-hero {
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 22px;
  }

  .demo-steps {
    gap: 7px;
  }

  .demo-steps li {
    padding: 12px;
  }

  .speaker-sidebar,
  .speaker-detail,
  .detail-empty {
    min-height: auto;
  }

  .speaker-sidebar {
    padding: 18px;
  }

  .speaker-list {
    max-height: 260px;
    overflow: auto;
  }

  .detail-empty {
    padding: 60px 20px;
  }

  .guide-card {
    order: -1;
  }

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

  .guide-list li {
    display: block;
    border-top: 0;
    padding-bottom: 0;
  }

  .guide-list li > span {
    margin-bottom: 8px;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: 68px;
  }

  .service-status span:last-child {
    display: none;
  }

  .service-status {
    padding: 10px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

  .library-demo-cta {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .library-demo-cta .button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .demo-hero {
    padding: 22px;
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .library-stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 12px;
  }

  .library-stat > span,
  .library-stat > div {
    grid-column: 1;
  }

  .library-stat .text-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    margin-top: 0;
  }

  .demo-steps {
    grid-template-columns: 1fr;
  }

  .sample-demo {
    align-items: stretch;
    flex-direction: column;
  }

  .sample-demo .button {
    width: 100%;
  }

  .detail-content,
  .identify-capture,
  .guide-card,
  .results-card {
    padding: 20px;
  }

  .detail-heading,
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .recorder-card {
    padding: 18px;
  }

  .audio-draft {
    grid-template-columns: 1fr;
  }

  .audio-draft__actions {
    grid-column: auto;
  }

  .audio-draft__actions .button {
    flex: 1;
  }

  .recording-item {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .recording-item audio {
    grid-column: 1 / -1;
  }

  .guide-list,
  .result-summary {
    grid-template-columns: 1fr;
  }

  .guide-list {
    gap: 0;
  }

  .guide-list li {
    display: grid;
    padding: 14px 0;
    border-top: 1px solid var(--line);
  }

  .guide-list li > span {
    margin-bottom: 0;
  }

  .segment-item {
    grid-template-columns: 94px 9px 1fr;
    gap: 8px;
  }

  .score-badge {
    grid-column: 3;
    justify-self: start;
  }

  .big-recorder {
    min-height: 290px;
    padding-inline: 16px;
  }
}

@media (max-width: 390px) {
  .app-shell,
  .topbar__inner {
    width: calc(100% - 20px);
  }

  .brand small {
    display: none;
  }

  .capture-actions .button,
  .capture-actions .record-button,
  .capture-actions .file-button {
    flex: 1 1 auto;
  }
}
