:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --soft: #f2f2f7;
  --accent: #007aff;
  --accent-dark: #0067d8;
  --danger: #ff3b30;
  --ok: #34c759;
  --record: #ff3b30;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
a {
  font: inherit;
}

.shell {
  width: min(780px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  align-items: center;
  padding: 24px 0;
}

.guest-shell {
  width: min(460px, calc(100vw - 32px));
}

.simple-shell {
  align-items: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  padding: 24px;
}

.compact {
  max-width: 420px;
  margin: 0 auto;
}

.simple-panel {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 18px;
  padding: 32px 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.8rem);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
}

.subtitle {
  max-width: 470px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 13px;
  border: 0;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.status.ok {
  color: #0b6b2f;
  background: rgba(52, 199, 89, 0.14);
}

.status.bad {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.12);
}

.status.recording {
  color: var(--record);
  background: rgba(255, 59, 48, 0.12);
}

.field,
.link-box {
  display: grid;
  gap: 8px;
}

.field span,
.link-box span,
.meter-label {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

input {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--soft);
}

button,
.download {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: var(--ink);
  background: var(--soft);
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.primary {
  color: white;
  border-color: var(--accent);
  background: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  color: var(--danger);
  background: rgba(255, 59, 48, 0.1);
}

.muted {
  color: #8a5a00;
  background: rgba(255, 204, 0, 0.18);
}

.record {
  color: #fff;
  border-color: var(--record);
  background: var(--record);
}

.wide {
  width: 100%;
}

.link-box {
  margin-top: 0;
}

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

.main-action {
  margin-top: 16px;
}

.guest-action {
  min-height: 56px;
  font-size: 1.08rem;
}

.meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 22px 0 14px;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 90ms linear;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.guest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.guest-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: #0b6b2f;
  background: rgba(52, 199, 89, 0.14);
  font-weight: 700;
}

.recording-timer {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 14px;
  margin-top: 14px;
  color: var(--record);
  background: rgba(255, 59, 48, 0.12);
  font-weight: 760;
}

.recording-timer strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.guest-timer {
  margin: 0;
}

.download {
  color: #fff;
  border-color: var(--ok);
  background: var(--ok);
}

.hidden {
  display: none;
}

.remote-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.guest-note {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

@media (max-width: 680px) {
  .panel {
    padding: 20px;
  }

  .topbar,
  .copy-row,
  .meters {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .status {
    justify-self: start;
  }

  .simple-panel .status {
    justify-self: center;
  }
}
