:root {
  color-scheme: light;
  --bg: #eef9f7;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-soft: rgba(241, 252, 250, 0.72);
  --ink: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.12);
  --primary: #14b8a6;
  --primary-dark: #0ea5a4;
  --primary-soft: rgba(20, 184, 166, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --radius-sm: 14px;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-soft: 0 18px 55px rgba(15, 23, 42, 0.1);
  --shadow-card: 0 12px 34px rgba(15, 23, 42, 0.08);
  --shadow-focus: 0 0 0 4px rgba(20, 184, 166, 0.14);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(20, 184, 166, 0.2), transparent 31%),
    radial-gradient(circle at 86% 12%, rgba(125, 211, 252, 0.2), transparent 34%),
    radial-gradient(circle at 70% 82%, rgba(167, 243, 208, 0.28), transparent 34%),
    linear-gradient(135deg, #f8fffd 0%, #eef9f7 48%, #f5f8ff 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 45% 28%, rgba(255, 255, 255, 0.56), transparent 34%);
  content: "";
  pointer-events: none;
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes softPulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

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

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    box-shadow 180ms var(--ease),
    background 180ms var(--ease),
    color 180ms var(--ease);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(20, 184, 166, 0.24);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

input,
select {
  padding: 0 14px;
}

textarea {
  min-height: 128px;
  padding: 13px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(20, 184, 166, 0.56);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-focus);
}

label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 740;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

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

.brand-mark {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(20, 184, 166, 0.25);
  border-radius: 16px;
  background:
    radial-gradient(circle at 74% 20%, rgba(255, 255, 255, 0.94), transparent 28%),
    linear-gradient(135deg, #0f172a, #0ea5a4 88%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 28px rgba(14, 165, 164, 0.22);
  background-position: center;
  background-size: cover;
}

.brand-mark::after {
  position: absolute;
  inset: 11px 9px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-right-color: rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  content: "";
  transform: rotate(-18deg);
}

.brand-mark-image::after {
  display: none;
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.06;
  letter-spacing: 0;
}

.brand p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.primary-button {
  border-color: rgba(15, 23, 42, 0.92);
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.primary-button:hover:not(:disabled) {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: 0 16px 34px rgba(14, 165, 164, 0.24);
}

.danger-button {
  border-color: rgba(239, 68, 68, 0.18);
  background: var(--danger-soft);
  color: #b91c1c;
}

.danger-button:hover:not(:disabled) {
  border-color: rgba(239, 68, 68, 0.3);
  background: #ef4444;
  color: #ffffff;
}

.tiny-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid rgba(20, 184, 166, 0.18);
  border-radius: 999px;
  background: rgba(240, 253, 250, 0.82);
  color: #0f766e;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 840;
  letter-spacing: 0;
}

.status-text {
  margin: 0;
  border-radius: var(--radius-sm);
  background: rgba(241, 245, 249, 0.74);
  color: var(--muted-strong);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(380px, 440px);
  align-items: center;
  gap: clamp(24px, 7vw, 92px);
  min-height: 100vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 56px);
}

.auth-copy,
.auth-card,
.admin-card,
.friends-panel,
.call-workspace,
.translator-card,
.profile-modal {
  animation: riseIn 520ms var(--ease) both;
}

.auth-copy {
  display: grid;
  gap: 30px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.34);
  padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  filter: contrast(1.36);
}

.auth-headline h2 {
  max-width: 640px;
  margin: 0;
  color: #08111f;
  font-size: clamp(42px, 7vw, 74px);
  font-weight: 920;
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-headline p {
  max-width: 560px;
  margin: 18px 0 0;
  color: #334155;
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 560;
  line-height: 1.75;
}

.value-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 620px;
}

.value-list span {
  border: 1px solid rgba(20, 184, 166, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.auth-card {
  display: grid;
  gap: 18px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(241, 252, 250, 0.82)),
    rgba(255, 255, 255, 0.84);
  padding: clamp(20px, 4vw, 30px);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(20px);
}

.auth-shell > .auth-card:only-child {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(460px, 100%);
}

.auth-card-wide {
  width: min(580px, 100%) !important;
}

.mobile-auth-brand {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  border-radius: 16px;
  background: rgba(226, 232, 240, 0.56);
  padding: 5px;
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-tabs button.active {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.auth-form {
  display: grid;
  gap: 11px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 38px;
}

.toggle-row input {
  position: relative;
  order: 2;
  width: 46px;
  min-height: 26px;
  padding: 0;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: #cbd5e1;
  appearance: none;
  cursor: pointer;
}

.toggle-row input::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 9px rgba(15, 23, 42, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.toggle-row input:checked {
  border-color: rgba(20, 184, 166, 0.42);
  background: var(--primary);
}

.toggle-row input:checked::after {
  transform: translateX(20px);
}

.toggle-row span {
  order: 1;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.admin-link,
.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.68);
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.product-shell {
  min-height: 100vh;
  padding: clamp(14px, 2vw, 24px);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 0.92fr) minmax(260px, 1.1fr) minmax(210px, 0.92fr);
  align-items: center;
  gap: 14px;
  max-width: 1500px;
  margin: 0 auto 18px;
}

.center-brand {
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 12px 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.profile-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  min-height: 64px;
  border-color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.64);
  padding: 9px 12px;
  text-align: left;
}

.profile-chip small,
.friend-main small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.avatar-dot,
.avatar-large {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.96), transparent 30%),
    linear-gradient(135deg, #ccfbf1, var(--primary));
  color: var(--ink);
  font-weight: 900;
  background-position: center;
  background-size: cover;
}

.avatar-dot {
  width: 42px;
  height: 42px;
}

.avatar-large {
  width: 76px;
  height: 76px;
  font-size: 24px;
}

.avatar-image {
  color: transparent;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.top-actions select {
  max-width: 168px;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(250px, 22fr) minmax(0, 78fr);
  gap: 18px;
  max-width: 1500px;
  margin: 0 auto;
}

.friends-panel,
.call-workspace,
.translator-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
}

.friends-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.panel-title,
.call-hero,
.translator-toolbar,
.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-title h2,
.call-hero h2,
.admin-card h2,
.caption-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.panel-title h2 {
  margin-top: 7px;
  font-size: 20px;
}

.compact-title h2 {
  font-size: 16px;
}

.account-summary {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 13px;
}

.account-summary p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.55;
}

.signal-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.14);
  margin-top: 7px;
  animation: softPulse 2.4s ease-in-out infinite;
}

.bind-form,
.quick-room {
  display: grid;
  gap: 10px;
}

.room-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.room-row button {
  min-width: 86px;
}

.quick-room {
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 92% 0%, rgba(20, 184, 166, 0.13), transparent 38%),
    rgba(255, 255, 255, 0.58);
  padding: 14px;
}

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

.friend-item {
  display: grid;
  gap: 8px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  padding: 10px;
  transition:
    transform 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.friend-item:hover,
.friend-item.selected {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.friend-main {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  box-shadow: none;
}

.friend-actions {
  display: flex;
  gap: 8px;
}

.friend-actions button {
  flex: 1;
  min-height: 34px;
  font-size: 12px;
}

.empty-state,
.permission-notice {
  border-radius: var(--radius);
  background: rgba(241, 245, 249, 0.72);
  color: var(--muted-strong);
  padding: 14px;
  font-size: 13px;
  line-height: 1.58;
}

.permission-notice {
  background: rgba(254, 249, 195, 0.7);
  color: #854d0e;
}

.call-workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.call-hero {
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 90% 0%, rgba(20, 184, 166, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(240, 253, 250, 0.78));
  padding: 20px;
}

.call-hero h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.14;
}

.call-hero p {
  margin: 8px 0 0;
  color: var(--muted-strong);
  line-height: 1.55;
}

.call-actions {
  display: flex;
  gap: 10px;
}

.video-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 360px;
  animation: riseIn 420ms var(--ease) both;
}

.video-tile {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 0%, rgba(20, 184, 166, 0.4), transparent 36%),
    linear-gradient(135deg, #0f172a, #1e293b);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.video-tile::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 82%);
}

video {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.video-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
}

.video-empty span {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
  color: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 860;
  backdrop-filter: blur(12px);
}

.video-label {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.media-controls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 5;
  display: flex;
  gap: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  padding: 8px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.media-controls button {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  padding: 0 14px;
}

.media-controls button.active {
  background: rgba(20, 184, 166, 0.88);
}

.media-controls button.muted {
  background: rgba(239, 68, 68, 0.82);
}

.translator-card {
  display: grid;
  grid-template-rows: auto auto auto minmax(250px, 1fr) auto;
  overflow: hidden;
}

.translator-toolbar {
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  padding: 15px 16px;
}

.language-switcher {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr);
  align-items: end;
  gap: 10px;
  flex: 1;
  min-width: 320px;
}

.language-switcher span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #0f766e;
  font-weight: 900;
  margin-bottom: 3px;
}

.tool-row {
  display: grid;
  grid-template-columns: auto 112px auto 140px;
  align-items: center;
  gap: 8px;
}

.caption-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 16px;
}

.caption-header h2 {
  font-size: 20px;
}

.caption-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.interim-caption {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  color: var(--muted-strong);
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 650;
}

.captions-list {
  --caption-size: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: auto;
  min-height: 250px;
  padding: 16px 16px 20px;
}

.captions-list:empty::before {
  display: grid;
  min-height: 210px;
  place-items: center;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 0%, rgba(20, 184, 166, 0.12), transparent 38%),
    rgba(255, 255, 255, 0.5);
  color: var(--muted);
  content: attr(data-empty-text);
  padding: 24px;
  text-align: center;
  line-height: 1.6;
}

.captions-muted {
  opacity: 0.36;
}

.caption-item {
  max-width: min(760px, 84%);
  border-radius: 20px 20px 20px 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 13px 15px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.caption-item.local {
  align-self: flex-end;
  border-radius: 20px 20px 8px 20px;
  background: linear-gradient(135deg, rgba(204, 251, 241, 0.92), rgba(240, 253, 250, 0.92));
}

.caption-meta {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.caption-original,
.caption-translation {
  overflow-wrap: anywhere;
  margin: 0;
  line-height: 1.48;
}

.caption-original {
  color: var(--ink);
  font-size: var(--caption-size);
}

.caption-translation {
  margin-top: 7px;
  color: #0f766e;
  font-size: calc(var(--caption-size) - 1px);
  font-weight: 760;
}

.captions-list[data-mode="translation"] .caption-original,
.captions-list[data-mode="translation"] .caption-meta {
  display: none;
}

.message-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  overflow: auto;
  background: rgba(15, 23, 42, 0.26);
  padding: 20px;
  backdrop-filter: blur(14px);
}

.profile-modal {
  display: grid;
  width: min(700px, 100%);
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  background: rgba(241, 245, 249, 0.66);
  padding: 14px;
}

.brand-preview strong {
  display: block;
  font-size: 20px;
}

.brand-preview p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-shell {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
  animation: riseIn 560ms var(--ease) both;
}

.admin-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 84% 0%, rgba(20, 184, 166, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.74);
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
}

.admin-hero h1 {
  margin: 8px 0 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: 0;
}

.admin-hero p,
.admin-card p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.users-card,
.admin-note {
  grid-column: 1 / -1;
}

.admin-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
  padding: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
}

.admin-card-header {
  margin-bottom: 4px;
}

.compact-header {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.admin-card-header .primary-button {
  min-width: 112px;
}

.admin-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brand-editor,
.setup-banner,
.test-result {
  display: grid;
  gap: 12px;
  border-radius: var(--radius);
  background: rgba(241, 252, 250, 0.62);
  padding: 14px;
}

.setup-banner strong {
  font-size: 17px;
}

.setup-banner p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

#siteAccentColor {
  width: 76px;
  padding: 5px;
}

.test-result {
  min-height: 136px;
}

.test-result p {
  color: var(--ink);
  font-size: 17px;
  font-weight: 760;
}

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

.user-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 140px minmax(280px, 1.2fr) 92px;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.68);
  padding: 12px;
}

.user-row strong {
  display: block;
  font-size: 16px;
}

.user-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

.mini-toggle {
  min-height: 34px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  padding: 6px 8px;
}

.mini-toggle input {
  width: 36px;
  min-height: 22px;
}

.mini-toggle input::after {
  top: 3px;
  width: 16px;
  height: 16px;
}

.mini-toggle input:checked::after {
  transform: translateX(14px);
}

.mini-toggle span {
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 1040px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    gap: 22px;
  }

  .topbar,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .center-brand {
    justify-content: flex-start;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions select,
  .top-actions button {
    flex: 1;
    max-width: none;
  }

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

  .friends-panel > .panel-title:first-child,
  .account-summary,
  .friends-list {
    grid-column: 1 / -1;
  }

  .translator-toolbar,
  .call-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .video-stage {
    grid-template-columns: 1fr;
  }

  .media-controls {
    position: sticky;
    bottom: 12px;
    justify-self: center;
    transform: none;
    left: auto;
    grid-column: 1;
  }

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

@media (max-width: 680px) {
  .auth-shell,
  .admin-shell {
    padding: 16px;
  }

  .auth-copy {
    display: none;
  }

  .mobile-auth-brand {
    display: flex;
  }

  .product-shell {
    padding: 12px;
  }

  .brand h1 {
    font-size: 19px;
  }

  .center-brand {
    order: -1;
  }

  .friends-panel {
    grid-template-columns: 1fr;
  }

  .friends-panel > * {
    grid-column: auto !important;
  }

  .call-actions,
  .friend-actions,
  .admin-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .room-row,
  .message-box,
  .tool-row,
  .language-switcher,
  .admin-two-col,
  .user-row,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .language-switcher span {
    width: 100%;
    height: 32px;
    margin: 0;
  }

  .caption-item {
    max-width: 96%;
  }

  .video-tile {
    min-height: 260px;
  }

  .media-controls {
    flex-wrap: wrap;
    justify-content: center;
    width: min(100%, 360px);
    border-radius: 22px;
  }

  .media-controls button {
    flex: 1 1 42%;
  }

  .admin-hero {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .admin-hero h1 {
    font-size: 27px;
  }
}

.admin-app {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 68% 8%, rgba(20, 184, 166, 0.16), transparent 30%),
    linear-gradient(135deg, #f8fffd 0%, #effaf8 48%, #f7f9ff 100%);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  overflow-y: auto;
  background:
    radial-gradient(circle at 70% 0%, rgba(20, 184, 166, 0.24), transparent 32%),
    #0f172a;
  color: #e2e8f0;
  padding: 22px;
}

.admin-side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 18px;
}

.admin-side-brand strong,
.admin-side-brand span {
  display: block;
}

.admin-side-brand strong {
  color: #ffffff;
  font-size: 17px;
}

.admin-side-brand span {
  margin-top: 4px;
  color: #94a3b8;
  font-size: 12px;
}

.admin-nav {
  display: grid;
  gap: 6px;
}

.admin-nav a,
.admin-side-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  border-radius: 14px;
  color: #cbd5e1;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none;
  transition:
    background 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.admin-nav a:hover,
.admin-nav a.active,
.admin-side-link:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  transform: translateX(2px);
}

.admin-nav a.active {
  background: rgba(20, 184, 166, 0.18);
  color: #ccfbf1;
}

.admin-side-link {
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  justify-content: center;
}

.admin-main {
  display: grid;
  align-content: start;
  gap: 18px;
  min-width: 0;
  padding: clamp(16px, 3vw, 32px);
}

.admin-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.admin-kicker {
  display: block;
  color: #0f766e;
  font-size: 12px;
  font-weight: 840;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 8px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

.admin-topbar p {
  max-width: 720px;
  margin: 9px 0 0;
  color: var(--muted-strong);
  line-height: 1.6;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.env-badge,
.admin-identity,
.category-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 820;
}

.env-badge {
  background: rgba(20, 184, 166, 0.12);
  color: #0f766e;
}

.admin-identity {
  background: rgba(15, 23, 42, 0.06);
  color: var(--ink);
}

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

.admin-metric-grid article {
  display: grid;
  gap: 7px;
  min-height: 116px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.admin-metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.admin-metric-grid strong {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.05;
}

.admin-metric-grid small {
  color: var(--muted);
}

.admin-content-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
}

.section-anchor {
  position: absolute;
  top: -18px;
}

.admin-panel {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
}

.admin-inline-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #0f766e;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.api-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.api-toolbar h2,
.fallback-panel h2,
.provider-section h2 {
  margin: 7px 0 0;
}

.api-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 170px 140px auto;
  gap: 10px;
  flex: 1;
}

.fallback-grid {
  display: grid;
  gap: 10px;
}

.fallback-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(160px, 0.85fr));
  align-items: end;
  gap: 12px;
  border-radius: 16px;
  background: rgba(241, 245, 249, 0.72);
  padding: 14px;
}

.fallback-row strong,
.fallback-row span {
  display: block;
}

.fallback-row span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.provider-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.provider-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 13px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  padding: 14px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.provider-logo {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background:
    radial-gradient(circle at 70% 18%, rgba(255, 255, 255, 0.92), transparent 30%),
    linear-gradient(135deg, #0f172a, var(--primary));
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
}

.provider-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.provider-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.2;
}

.category-badge {
  background: rgba(20, 184, 166, 0.11);
  color: #0f766e;
}

.status-badge.enabled {
  background: rgba(34, 197, 94, 0.12);
  color: #15803d;
}

.status-badge.disabled {
  background: rgba(148, 163, 184, 0.16);
  color: #475569;
}

.provider-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 13px 0;
}

.provider-meta div {
  min-width: 0;
}

.provider-meta dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.provider-meta dd {
  overflow: hidden;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.provider-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.provider-drawer {
  display: grid;
  width: min(860px, 100%);
  max-height: min(92vh, 980px);
  overflow: auto;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

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

.secret-field {
  display: grid;
  gap: 6px;
}

.secret-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
}

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

.secret-toggle {
  min-height: 46px;
}

.custom-provider-fields {
  display: grid;
  gap: 12px;
  border-radius: 18px;
  background: rgba(241, 252, 250, 0.72);
  padding: 14px;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: -20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding-top: 14px;
  backdrop-filter: blur(12px);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  border-radius: 16px;
  background: #0f172a;
  color: #ffffff;
  padding: 14px 16px;
  box-shadow: var(--shadow-soft);
  font-weight: 720;
}

.toast.success {
  background: #0f766e;
}

.toast.error {
  background: #b91c1c;
}

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

  .provider-list,
  .admin-content-grid {
    grid-template-columns: 1fr;
  }

  .fallback-row {
    grid-template-columns: 1fr;
  }

  .api-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .api-filter-row {
    grid-template-columns: 1fr 1fr;
  }
}

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

  .admin-sidebar {
    position: relative;
    height: auto;
  }

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

  .admin-topbar,
  .admin-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-metric-grid,
  .api-filter-row,
  .provider-meta,
  .admin-three-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .admin-main,
  .admin-sidebar {
    padding: 14px;
  }

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

  .provider-card {
    grid-template-columns: 1fr;
  }

  .drawer-actions,
  .provider-actions {
    flex-direction: column;
  }
}

/* Mobile polish layer: keeps the desktop product intact while making Lingkara feel native on phones. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

.mobile-panel-button,
.mobile-panel-close,
.mobile-panel-backdrop,
.admin-menu-button,
.admin-menu-close,
.admin-sidebar-backdrop {
  display: none;
}

.mobile-panel-open,
.admin-menu-open {
  overflow: hidden;
}

@media (max-width: 1040px) {
  .friends-panel {
    grid-template-columns: 1fr;
  }

  .friends-panel > * {
    grid-column: auto !important;
  }
}

@media (max-width: 820px) {
  body {
    font-size: 15px;
  }

  button,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  button,
  .admin-nav a,
  .admin-side-link {
    min-height: 44px;
  }

  .toggle-row {
    min-height: 44px;
  }

  input,
  select {
    min-height: 48px;
  }

  textarea {
    min-height: 124px;
  }

  .auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100svh;
    width: 100%;
    padding: 16px;
  }

  .auth-card,
  .auth-shell > .auth-card:only-child,
  .auth-card-wide {
    width: calc(100% - 32px) !important;
    max-width: 460px;
    max-height: none;
    padding: 20px;
  }

  .auth-tabs button,
  .auth-form button {
    min-height: 50px;
  }

  .auth-headline h2 {
    font-size: 40px;
  }

  .product-shell {
    min-height: 100svh;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  .center-brand {
    order: -1;
    justify-content: flex-start;
    padding: 11px;
  }

  .center-brand .brand-mark {
    width: 42px;
    height: 42px;
  }

  .profile-chip {
    min-height: 58px;
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(132px, 0.85fr) auto;
    gap: 8px;
  }

  .mobile-panel-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border-color: rgba(20, 184, 166, 0.16);
    background: rgba(240, 253, 250, 0.88);
    color: #0f766e;
  }

  .mobile-panel-close {
    display: inline-flex;
    justify-content: center;
    width: 100%;
    background: rgba(241, 245, 249, 0.85);
  }

  .product-grid {
    display: block;
    max-width: 100%;
  }

  .mobile-panel-backdrop:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 28;
    display: block;
    background: rgba(15, 23, 42, 0.34);
    backdrop-filter: blur(8px);
  }

  .friends-panel {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 32;
    display: grid;
    max-height: min(84svh, 720px);
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    animation: none;
    transform: translateY(106%);
    transition: transform 260ms var(--ease);
    overscroll-behavior: contain;
  }

  .mobile-panel-open .friends-panel {
    transform: translateY(0);
  }

  .call-workspace {
    gap: 12px;
    padding: 12px;
  }

  .call-hero {
    align-items: stretch;
    gap: 14px;
    padding: 16px;
  }

  .call-hero h2 {
    font-size: 25px;
  }

  .call-hero p {
    font-size: 15px;
  }

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

  .call-actions button {
    min-height: 52px;
  }

  .permission-notice {
    padding: 13px;
    font-size: 14px;
  }

  .translator-card {
    border-radius: 22px;
    grid-template-rows: auto auto auto minmax(320px, 1fr) auto;
  }

  .translator-toolbar {
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .language-switcher {
    grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr);
    gap: 8px;
    min-width: 0;
  }

  .language-switcher label,
  .tool-row label {
    font-size: 12px;
  }

  .language-switcher select,
  .tool-row select {
    min-height: 46px;
    padding: 0 10px;
    font-size: 14px;
  }

  .language-switcher span {
    width: 36px;
    height: 36px;
    margin-bottom: 5px;
  }

  .tool-row {
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
  }

  .caption-header {
    align-items: center;
    flex-direction: row;
    padding: 12px;
  }

  .caption-header h2 {
    font-size: 18px;
  }

  .caption-header p {
    font-size: 12px;
  }

  .interim-caption {
    min-height: 38px;
    padding: 9px 12px;
  }

  .captions-list {
    min-height: 42svh;
    max-height: 58svh;
    padding: 12px 12px 18px;
    scroll-padding-bottom: 92px;
  }

  .captions-list:empty::before {
    min-height: 260px;
    padding: 20px;
  }

  .caption-item {
    max-width: 94%;
    padding: 12px;
  }

  .caption-original,
  .caption-translation {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .message-box {
    position: sticky;
    bottom: 0;
    z-index: 8;
    grid-template-columns: minmax(0, 1fr) 58px;
    gap: 8px;
    border-top-color: rgba(15, 23, 42, 0.07);
    background: rgba(255, 255, 255, 0.92);
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    backdrop-filter: blur(14px);
  }

  .message-box input {
    min-height: 50px;
  }

  .message-box button {
    min-width: 0;
    min-height: 50px;
    padding: 0 10px;
  }

  .video-stage {
    min-height: min(70svh, 640px);
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: 24px;
    background: #0f172a;
    padding: 0 0 86px;
  }

  .video-tile {
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .video-tile:nth-child(2) {
    order: 1;
    min-height: min(58svh, 540px);
  }

  .video-tile:first-child {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: clamp(112px, 34vw, 160px);
    height: clamp(130px, 26svh, 190px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.35);
  }

  .video-tile:first-child .video-empty span {
    width: 56px;
    height: 56px;
    font-size: 13px;
  }

  .video-tile:first-child .video-label {
    left: 8px;
    bottom: 8px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .video-tile:nth-child(2) .video-label {
    bottom: 96px;
  }

  .media-controls {
    position: fixed;
    right: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 50%;
    width: min(calc(100vw - 24px), 480px);
    justify-content: space-between;
    gap: 6px;
    border-radius: 24px;
    padding: 8px;
    transform: translateX(-50%);
  }

  .media-controls button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    padding: 0 6px;
    font-size: 12px;
    white-space: nowrap;
  }

  .profile-modal,
  .provider-drawer {
    width: 100%;
    max-height: 92svh;
    border-radius: 24px 24px 0 0;
  }

  .modal-backdrop {
    align-items: end;
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .admin-app {
    display: block;
    min-height: 100svh;
  }

  .admin-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 44px;
    border-color: rgba(20, 184, 166, 0.18);
    background: rgba(240, 253, 250, 0.88);
    color: #0f766e;
    padding: 0 14px;
  }

  .admin-menu-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    margin-left: auto;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .admin-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 36;
    width: min(84vw, 320px);
    height: 100svh;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateX(-106%);
    transition: transform 260ms var(--ease);
  }

  .admin-menu-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-sidebar-backdrop:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 34;
    display: block;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(8px);
  }

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

  .admin-main {
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .admin-topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
    border-radius: 22px;
  }

  .admin-topbar h1 {
    font-size: 30px;
  }

  .admin-top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .admin-top-actions button {
    grid-column: 1 / -1;
  }

  .env-badge,
  .admin-identity {
    justify-content: center;
    min-height: 36px;
  }

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

  .admin-content-grid,
  .api-filter-row,
  .fallback-row,
  .provider-list,
  .provider-meta,
  .admin-two-col,
  .admin-three-col,
  .user-row,
  .permission-grid {
    grid-template-columns: 1fr;
  }

  .admin-card {
    padding: 16px;
    border-radius: 20px;
  }

  .admin-card-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-card-header .primary-button,
  .api-filter-row button,
  .drawer-actions button,
  .provider-actions button,
  .user-row button {
    width: 100%;
    min-height: 48px;
  }

  .api-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .provider-card {
    grid-template-columns: 44px minmax(0, 1fr);
    padding: 12px;
  }

  .provider-logo {
    width: 44px;
    height: 44px;
  }

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

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

  .provider-meta dd {
    white-space: normal;
    word-break: break-word;
  }

  .provider-drawer {
    padding: 16px;
  }

  .secret-field > div {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .drawer-actions {
    display: grid;
    grid-template-columns: 1fr;
    bottom: -16px;
    margin: 0 -16px -16px;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .toast {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
    max-width: none;
  }
}

@media (max-width: 430px) {
  .auth-card,
  .auth-shell > .auth-card:only-child,
  .auth-card-wide {
    width: 100% !important;
  }

  .product-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .top-actions {
    grid-template-columns: 1fr 1fr;
  }

  .top-actions select {
    min-width: 0;
  }

  .top-actions #logoutButton {
    padding: 0 10px;
  }

  .mobile-panel-button {
    grid-column: 1 / -1;
  }

  .brand p,
  .profile-chip small {
    font-size: 12px;
  }

  .call-actions,
  .room-row,
  .provider-actions {
    grid-template-columns: 1fr;
  }

  .tool-row {
    grid-template-columns: 1fr 1fr;
  }

  .tool-row label {
    align-self: end;
  }

  .caption-header {
    align-items: stretch;
    flex-direction: column;
  }

  .caption-header button {
    width: 100%;
  }

  .media-controls {
    width: calc(100vw - 16px);
    gap: 4px;
    padding: 6px;
  }

  .media-controls button {
    min-height: 50px;
    padding: 0 4px;
    font-size: 11px;
  }

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

  .provider-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .product-shell,
  .admin-main,
  .auth-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .language-switcher {
    grid-template-columns: 1fr;
  }

  .language-switcher span {
    width: 100%;
    height: 30px;
    margin: 0;
  }

  .message-box {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  .message-box button {
    font-size: 0;
  }

  .message-box button::before {
    content: "Send";
    font-size: 12px;
  }
}

@media (max-width: 820px) and (orientation: landscape) {
  .video-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: calc(100svh - 96px);
    padding-bottom: 76px;
  }

  .video-tile:first-child {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    height: auto;
    min-height: 240px;
    border-radius: 22px 0 0 22px;
  }

  .video-tile:nth-child(2) {
    min-height: 240px;
    border-radius: 0 22px 22px 0;
  }
}
