:root {
  color-scheme: dark;
  --bg: #101214;
  --surface: #171a1f;
  --surface-2: #20252d;
  --field: #0f141a;
  --text: #f7f3ea;
  --muted: #a8b0ba;
  --line: #303741;
  --accent: #22b8a7;
  --accent-2: #4f7cff;
  --accent-3: #f5b84b;
  --danger: #f97373;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

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

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(100%, 880px);
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 14px calc(24px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
}

.hero {
  display: grid;
  gap: 16px;
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #d7fff7;
  color: #06211d;
  font-weight: 900;
}

.eyebrow,
.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.05;
}

h2 {
  font-size: 31px;
  line-height: 1.12;
}

.admin-link {
  min-width: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #d7dee8;
  text-align: center;
  font-weight: 800;
  background: #161b22;
}

.hero-grid {
  display: grid;
  gap: 14px;
  align-items: stretch;
  margin-top: 8px;
}

.hero-main {
  display: grid;
  gap: 12px;
}

.hero-copy {
  margin: 0;
  color: #d4d8de;
  font-size: 16px;
  line-height: 1.7;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-row span,
.scenario-list span {
  border: 1px solid #35404b;
  border-radius: 999px;
  color: #d7dee8;
  background: #171d24;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 750;
}

.live-preview {
  display: grid;
  gap: 10px;
  min-height: 230px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #141920;
  align-content: center;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-message {
  padding: 12px;
  border: 1px solid #33414d;
  border-radius: 8px;
  background: #101820;
}

.preview-message b {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-3);
  font-size: 13px;
}

.preview-message p {
  margin: 0;
  line-height: 1.5;
}

.translated-preview {
  background: #10201d;
  border-color: #28564e;
}

.panel {
  display: grid;
  gap: 14px;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel.compact {
  grid-template-columns: 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  padding: 13px 12px;
  outline: none;
}

textarea {
  resize: none;
  min-height: 64px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 184, 167, 0.16);
}

button {
  border: 0;
  border-radius: 8px;
  color: var(--text);
  padding: 12px 16px;
  font-weight: 850;
  cursor: pointer;
  min-height: 46px;
}

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

.primary {
  background: linear-gradient(90deg, #088f7f, #3c64e8);
}

.secondary {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: #d7dee8;
}

.info-band {
  display: grid;
  gap: 10px;
}

.info-band div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-left: 3px solid var(--accent);
  background: #151a20;
}

.info-band strong {
  font-size: 14px;
}

.info-band span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.scenario-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room {
  min-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 12px;
}

.hidden {
  display: none !important;
}

.room-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}

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

.invite-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px dashed #3b4653;
  border-radius: 8px;
  background: #121820;
  color: var(--muted);
  font-size: 12px;
}

.invite-card code {
  color: #e8f0ff;
  word-break: break-all;
  font-family: "SF Mono", Consolas, monospace;
}

.participants {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.room-limit {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.participant {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #182029;
  color: #d7dee8;
  font-size: 13px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 260px;
  padding: 8px 0;
}

.message {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.message.mine {
  border-color: rgba(34, 184, 167, 0.58);
  background: #11211e;
}

.message-meta {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.translated {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
}

details {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

summary {
  cursor: pointer;
}

.original {
  color: #d7dee8;
  margin-bottom: 0;
}

.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  padding: 12px;
  margin: 0 -8px;
  background: rgba(16, 18, 20, 0.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.composer-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mic {
  background: #17342f;
  border: 1px solid #1d766b;
}

.mic.listening {
  background: var(--danger);
  border-color: var(--danger);
}

.send {
  min-width: 92px;
}

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

.admin-shell {
  display: grid;
  align-content: start;
  gap: 16px;
}

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

.admin-dashboard {
  display: grid;
  gap: 14px;
}

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

.admin-summary article {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-summary span,
.metric-line span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-summary strong {
  font-size: 28px;
  line-height: 1;
}

.metrics-panel {
  gap: 0;
}

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.metric-line:last-of-type {
  border-bottom: 0;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-title h2 {
  font-size: 20px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

td {
  color: #e9edf2;
  font-size: 13px;
}

@media (min-width: 720px) {
  .shell {
    padding-top: 28px;
  }

  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }

  .info-band {
    grid-template-columns: repeat(3, 1fr);
  }

  .admin-login {
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .admin-summary {
    grid-template-columns: repeat(4, 1fr);
  }
}
