:root {
  --canvas: #faf9f5;
  --surface: #faf9f5;
  --surface-bright: #fffdf9;
  --surface-card: #efe9de;
  --surface-soft: #f5f0e8;
  --surface-strong: #e8e0d2;
  --surface-container: #efeeea;
  --surface-container-lowest: #ffffff;
  --surface-dark: #181715;
  --hairline: #e6dfd8;
  --outline: #87736d;
  --outline-variant: #dac1ba;
  --ink: #141413;
  --body-strong: #252523;
  --body: #3d3d3a;
  --muted: #6c6a64;
  --primary: #8f482f;
  --primary-container: #ad5f45;
  --primary-fixed: #ffdbd0;
  --surface-tint: #924a31;
  --secondary: #605e5b;
  --tertiary: #00685a;
  --tertiary-fixed: #98f3e0;
  --accent-amber: #e8a55a;
  --error: #ba1a1a;
  --error-container: #ffdad6;
  --on-primary: #ffffff;
  --shadow: 0 24px 72px rgba(20, 20, 19, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  background: var(--canvas);
  color: var(--body);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  font: inherit;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 72, 47, 0.14);
}

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

[hidden] {
  display: none !important;
}

select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(143, 72, 47, 0.14);
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.material-symbols-outlined.filled {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.side-nav {
  width: 256px;
  height: 100vh;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 0 0 256px;
  padding: 32px 16px;
  background: var(--surface-container-lowest);
  border-right: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 1px 22px rgba(20, 20, 19, 0.04);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-container);
  color: #fffbff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.brand-name,
.mobile-brand {
  color: var(--primary);
  font-family: "Source Serif 4", serif;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
}

.brand-plan {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  text-align: left;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.nav-link:hover {
  background: rgba(143, 72, 47, 0.06);
  color: var(--body-strong);
}

.nav-link.active {
  color: var(--secondary);
  background: rgba(230, 226, 222, 0.5);
  border-right: 4px solid var(--secondary);
}

.side-controls {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.user-panel {
  margin-top: auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-soft);
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--tertiary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.user-panel strong,
.user-panel span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-panel strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.user-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

label {
  min-width: 0;
  display: grid;
  gap: 6px;
}

label span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
  text-transform: uppercase;
}

.sidebar-action {
  width: 100%;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  transition:
    background 160ms ease,
    transform 160ms ease;
}

.sidebar-action:hover {
  background: var(--surface-tint);
  transform: translateY(-1px);
}

.mobile-topbar,
.mobile-bottom-nav,
.mobile-drawer {
  display: none;
}

body:not(.is-authenticated) .side-nav,
body:not(.is-authenticated) .mobile-topbar,
body:not(.is-authenticated) .mobile-bottom-nav,
body:not(.is-authenticated) .mobile-drawer,
body:not(.is-authenticated) .recording-dock,
body:not(.is-authenticated) .workspace-shell,
body.is-authenticated .login-screen {
  display: none;
}

.login-screen {
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 253, 249, 0.92), rgba(239, 238, 234, 0.94)),
    radial-gradient(circle at top left, rgba(152, 243, 224, 0.38), transparent 32%),
    var(--canvas);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  box-shadow: var(--shadow);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-heading {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.login-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: "Source Serif 4", serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0;
}

.login-message {
  min-height: 22px;
  color: var(--error);
  font-size: 13px;
  line-height: 1.5;
}

.login-message.good {
  color: var(--tertiary);
}

.workspace-shell {
  min-width: 0;
  height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  overflow: hidden;
}

.app-view {
  display: none;
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.app-view.active {
  display: block;
}

#liveView.app-view.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.page-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 32px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 700;
}

.workspace-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  flex: 0 0 auto;
  z-index: 5;
}

.title-group {
  min-width: 0;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--body-strong);
  font-family: "Source Serif 4", serif;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 400;
}

.title-group p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.live-pill,
.status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.live-pill {
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--muted);
}

.live-pill.ok {
  background: rgba(0, 104, 90, 0.11);
  color: var(--tertiary);
}

.live-pill.warn {
  background: rgba(232, 165, 90, 0.18);
  color: #9d5d0e;
}

.live-pill.error {
  background: var(--error-container);
  color: var(--error);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.9s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.38;
  }
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.language-card {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-soft);
}

.select-display {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(20, 20, 19, 0.04);
  white-space: nowrap;
}

.status-stack {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  padding: 0 10px;
  border: 1px solid var(--hairline);
  background: var(--surface-container-lowest);
  color: var(--muted);
}

.status-pill .status-icon {
  font-size: 18px;
}

.status-pill.ok {
  border-color: rgba(0, 104, 90, 0.22);
  background: rgba(152, 243, 224, 0.26);
  color: var(--tertiary);
}

.status-pill.warn {
  border-color: rgba(232, 165, 90, 0.36);
  background: rgba(232, 165, 90, 0.16);
  color: #9d5d0e;
}

.status-pill.error {
  border-color: rgba(186, 26, 26, 0.24);
  background: var(--error-container);
  color: var(--error);
}

.header-export,
.icon-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--primary);
  padding: 0 12px;
  font-weight: 600;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.header-export:hover,
.icon-button:hover {
  background: var(--surface-soft);
  border-color: var(--hairline);
}

.mobile-selectors {
  display: none;
}

.control-panel {
  padding: 14px 32px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(250, 249, 245, 0.94);
  display: grid;
  gap: 12px;
  flex: 0 0 auto;
}

.control-grid,
.mode-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(180px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.mode-fields {
  display: none;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.mode-fields.active {
  display: grid;
}

.mode-fields .wide {
  grid-column: span 1;
}

.control-field {
  position: relative;
}

.mode-tabs {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-soft);
}

.mode-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-tabs button.active {
  background: var(--surface-container-lowest);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(20, 20, 19, 0.05);
}

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

.select-trigger {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  color: var(--ink);
  padding: 0 10px;
}

.select-value {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.select-value span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag-chip,
.provider-dot {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid rgba(135, 115, 109, 0.18);
  font-size: 15px;
  line-height: 1;
}

.provider-dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  display: none;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.98);
  box-shadow: 0 18px 50px rgba(20, 20, 19, 0.14);
}

.custom-select.open .select-menu {
  display: grid;
  gap: 4px;
}

.select-option {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--body);
  padding: 6px 8px;
  text-align: left;
}

.select-option:hover,
.select-option.selected {
  background: var(--surface-soft);
  color: var(--ink);
}

.option-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  flex: 1;
}

.option-copy strong,
.option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.option-copy small {
  color: var(--muted);
  font-size: 12px;
}

.checkmark {
  opacity: 0;
  color: var(--primary);
  font-size: 18px;
}

.select-option.selected .checkmark {
  opacity: 1;
}

.split-workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  overflow: hidden;
}

.pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.source-pane {
  border-right: 1px solid var(--hairline);
  background: var(--surface-bright);
}

.translation-pane {
  background: rgba(239, 233, 222, 0.3);
}

.pane-toolbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  flex: 0 0 auto;
}

.pane-toolbar p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
}

.pane-toolbar h2 {
  margin-top: 4px;
  color: var(--secondary);
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
}

.translation-pane .pane-toolbar h2 {
  color: var(--primary);
}

.count-badge {
  min-width: 34px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary);
  font: 500 13px/1 JetBrains Mono, monospace;
}

.live-line {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.55;
}

.live-line.active {
  color: var(--body-strong);
}

.live-line.accent.active {
  color: var(--primary);
}

.cursor-dot {
  width: 6px;
  height: 18px;
  border-radius: 99px;
  background: rgba(143, 72, 47, 0.48);
  animation: pulse 1.4s ease-in-out infinite;
}

.stream-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px 132px;
  display: flex;
  flex-direction: column-reverse;
  gap: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-dim) transparent;
}

.stream-list::-webkit-scrollbar {
  width: 6px;
}

.stream-list::-webkit-scrollbar-track {
  background: transparent;
}

.stream-list::-webkit-scrollbar-thumb {
  background: var(--surface-strong);
  border-radius: 999px;
}

.stream-list:empty::before {
  content: "会话开始后，内容会按时间出现在这里。";
  display: block;
  max-width: 520px;
  margin: 24px auto 0;
  color: var(--muted);
  line-height: 1.6;
}

.translation-list:empty::before {
  content: "收到最终转录后，翻译会排队生成。";
}

.stream-item {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--body-strong);
}

.stream-item time {
  color: var(--muted);
  font: 700 12px/1.4 Inter, sans-serif;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.mini-lang {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.mini-lang .flag-chip {
  width: 18px;
  height: 18px;
  font-size: 12px;
}

.arrow-mini {
  color: var(--primary);
  letter-spacing: 0;
}

.stream-item div:last-child {
  border-radius: 12px;
  padding: 16px;
  border: 1px solid transparent;
  background: transparent;
  line-height: 1.7;
}

.transcript-list .stream-item div:last-child {
  font-size: 16px;
  font-weight: 500;
}

.translation-list .stream-item div:last-child {
  background: rgba(239, 233, 222, 0.72);
  border-color: rgba(218, 193, 186, 0.48);
  color: var(--ink);
  font-family: "Source Serif 4", serif;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 400;
}

.stream-item.pending div:last-child {
  background: rgba(245, 240, 232, 0.95);
  color: var(--muted);
}

.stream-item.error div:last-child {
  border-color: rgba(186, 26, 26, 0.22);
  background: var(--error-container);
  color: var(--error);
  font-family: Inter, sans-serif;
  font-size: 15px;
}

.message-line {
  min-height: 24px;
  position: fixed;
  right: 24px;
  bottom: 22px;
  z-index: 60;
  max-width: min(520px, calc(100vw - 48px));
  color: var(--error);
  font-size: 13px;
  text-align: right;
  pointer-events: none;
}

.recording-dock {
  position: fixed;
  left: calc(256px + (100vw - 256px) / 2);
  bottom: 24px;
  z-index: 45;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(250, 249, 245, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.dashboard-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 24px 32px;
}

.metric-card,
.settings-card,
.panel-section,
.provider-form,
.provider-card,
.session-card {
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.78);
  box-shadow: 0 10px 34px rgba(20, 20, 19, 0.05);
}

.metric-card,
.settings-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.metric-card span,
.settings-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.metric-card strong,
.settings-card strong {
  color: var(--primary);
  font-family: "Source Serif 4", serif;
  font-size: 42px;
  line-height: 1;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.settings-card strong {
  font-size: 28px;
}

.panel-section {
  margin: 0 32px 32px;
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  color: var(--body-strong);
  font-size: 20px;
}

.text-action {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
}

.session-list {
  display: grid;
  gap: 12px;
}

.session-list.large {
  padding: 24px 32px 48px;
}

.session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.session-card time,
.session-card p,
.provider-card small,
.provider-card p {
  color: var(--muted);
  font-size: 13px;
}

.session-card h3,
.provider-title strong {
  margin: 4px 0;
  color: var(--body-strong);
  font-size: 17px;
}

.session-actions,
.provider-actions,
.form-actions,
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.session-actions button,
.provider-actions button,
.soft-button {
  min-height: 36px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  background: var(--surface-container-lowest);
  color: var(--body);
  padding: 0 12px;
  font-weight: 700;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--outline-variant);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 24px 32px 48px;
}

.provider-form {
  display: grid;
  gap: 12px;
  padding: 18px;
  align-self: start;
}

.provider-form label {
  text-transform: none;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.admin-message {
  min-height: 20px;
  color: var(--error);
  font-size: 13px;
}

.admin-message.good {
  color: var(--tertiary);
}

.provider-list {
  display: grid;
  gap: 12px;
  align-self: start;
}

.provider-card {
  padding: 16px;
}

.provider-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.provider-title span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(152, 243, 224, 0.26);
  color: var(--tertiary);
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-title .muted-badge {
  background: var(--surface-strong);
  color: var(--muted);
}

.meter-ring {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: end start;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--hairline);
}

.meter-ring span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--tertiary-fixed), var(--primary-fixed));
  transition: width 80ms linear;
}

.dock-button {
  border: 1px solid var(--hairline);
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--body-strong);
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    border-color 160ms ease;
}

.dock-button:hover:not(:disabled) {
  transform: scale(1.045);
}

.dock-button.secondary {
  width: 48px;
  height: 48px;
  background: var(--surface);
}

.dock-button.primary {
  width: 64px;
  height: 64px;
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 14px 38px rgba(143, 72, 47, 0.3);
  position: relative;
}

.dock-button.primary.recording::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid var(--primary);
  border-radius: inherit;
  opacity: 0.2;
  animation: dockPulse 1.8s ease-out infinite;
}

@keyframes dockPulse {
  to {
    transform: scale(1.24);
    opacity: 0;
  }
}

.dock-button.danger:hover:not(:disabled) {
  color: var(--error);
  border-color: var(--error-container);
  background: var(--error-container);
}

@media (max-width: 1100px) {
  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-tools {
    width: 100%;
    justify-content: space-between;
  }

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

  .mode-tabs {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .mode-tabs button {
    flex: 1;
  }

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

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  body {
    display: block;
    min-height: 100vh;
    overflow: auto;
  }

  .side-nav {
    display: none;
  }

  .mobile-drawer {
    position: fixed;
    top: 64px;
    left: 12px;
    right: 12px;
    z-index: 70;
    display: none;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: rgba(255, 253, 249, 0.98);
    box-shadow: 0 18px 50px rgba(20, 20, 19, 0.14);
  }

  .mobile-drawer.open {
    display: grid;
  }

  .mobile-topbar {
    height: 64px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(250, 249, 245, 0.94);
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    font-size: 28px;
  }

  .workspace-shell {
    min-height: 100vh;
    height: auto;
    padding-top: 64px;
    padding-bottom: 176px;
    overflow: visible;
  }

  .page-header {
    min-height: auto;
    padding: 88px 16px 18px;
  }

  .workspace-header {
    min-height: 0;
    padding: 24px 16px 12px;
    background: var(--canvas);
  }

  .title-row {
    justify-content: center;
  }

  .title-group {
    width: 100%;
    text-align: center;
  }

  h1 {
    font-size: 30px;
  }

  .header-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .language-card,
  .status-stack,
  .header-export {
    display: none;
  }

  .control-panel {
    padding: 0 16px 18px;
    background: var(--canvas);
  }

  .control-grid,
  .mode-fields,
  .mode-fields.active {
    grid-template-columns: 1fr 1fr;
  }

  .mode-fields .wide {
    grid-column: auto;
  }

  .mode-tabs {
    grid-column: 1 / -1;
  }

  .mode-fields,
  .mode-fields.active {
    grid-template-columns: 1fr;
  }

  .mobile-selectors .wide {
    grid-column: 1 / -1;
  }

  .split-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px;
    overflow: visible;
  }

  .pane {
    border: 1px solid var(--hairline);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 34px rgba(20, 20, 19, 0.05);
  }

  .source-pane {
    border-right: 1px solid var(--hairline);
    background: var(--surface-card);
  }

  .translation-pane {
    background: var(--surface-strong);
  }

  .pane-toolbar {
    min-height: auto;
    padding: 16px;
  }

  .live-line {
    min-height: 48px;
    padding: 10px 16px;
    font-size: 14px;
  }

  .stream-list {
    max-height: 24vh;
    min-height: 0;
    padding: 8px 16px;
  }

  .stream-list:empty::before {
    display: none;
  }

  .translation-list .stream-item div:last-child {
    font-size: 18px;
  }

  .recording-dock {
    left: 50%;
    bottom: 78px;
    gap: 14px;
    padding: 8px 12px;
  }

  .message-line {
    left: 16px;
    right: 16px;
    bottom: 158px;
    text-align: center;
  }

  .mobile-bottom-nav {
    height: 72px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 44;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    border-top: 1px solid var(--hairline);
    background: rgba(250, 249, 245, 0.96);
  }

  .mobile-bottom-nav button {
    width: 33.333%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--secondary);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    position: relative;
  }

  .mobile-bottom-nav button.active {
    color: var(--primary);
  }

  .mobile-bottom-nav button.active::before {
    content: "";
    position: absolute;
    top: 0;
    width: 48px;
    height: 4px;
    border-radius: 0 0 999px 999px;
    background: var(--primary);
  }

  .dashboard-grid,
  .settings-grid,
  .session-list.large,
  .admin-grid {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .panel-section {
    margin: 0 16px 24px;
  }

  .session-card,
  .provider-card {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .mobile-selectors {
    grid-template-columns: 1fr;
  }

  .mobile-selectors .wide {
    grid-column: auto;
  }

  .dock-button.secondary {
    width: 44px;
    height: 44px;
  }

  .dock-button.primary {
    width: 60px;
    height: 60px;
  }

  .meter-ring {
    width: 36px;
    height: 36px;
  }
}
