*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-sunken: #f1f1ef;
  --fg: #0c0c0d;
  --muted: rgba(12, 12, 13, .58);
  --faint: rgba(12, 12, 13, .38);
  --border: rgba(12, 12, 13, .08);
  /* Black accent. --on-accent is the text/glyph colour that sits on it; both
     flip on dark surfaces (see .pl-dark) so primaries stay visible. */
  --accent: #0c0c0d;
  --on-accent: #ffffff;
  --accent-tint: rgba(12, 12, 13, .04);   /* row highlight, live banners */
  --accent-soft: rgba(12, 12, 13, .07);   /* active chip / segment fill */
  --ring: rgba(12, 12, 13, .13);           /* focus ring */
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #f59e0b;
  --chip-bg: rgba(12, 12, 13, .05);
}

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 currentColor; }
  70% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

@keyframes dot-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .55; }
  40% { transform: translateY(-4px); opacity: 1; }
}

.pl-app {
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
}

.pl-shell {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.pl-sidebar {
  width: 224px;
  flex-shrink: 0;
  border-right: .5px solid var(--border);
  background: var(--surface-sunken);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.pl-main {
  flex: 1;
  min-width: 0;
}

.pl-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.pl-logo {
  width: 15px;
  height: 15px;
  border-radius: 5px;
  background: var(--accent);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
}

.pl-logo::after {
  content: "";
  position: absolute;
  inset: 22%;
  background: var(--on-accent);
  border-radius: 2px;
  clip-path: polygon(0 0, 60% 0, 60% 100%, 0 100%, 0 60%, 40% 60%, 40% 40%, 0 40%);
}

.pl-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 22px;
}

.pl-nav a, .pl-nav button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

.pl-nav a.active, .pl-nav button.active {
  color: var(--fg);
  background: rgba(12, 12, 13, .05);
}

.pl-account {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 4px;
}

.pl-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: repeating-linear-gradient(135deg, #d8dde4 0 5px, #e3e8ef 5px 10px);
  border: .5px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
}

.pl-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pl-account-email {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pl-plan {
  border: .5px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 650;
  text-transform: capitalize;
}

.pl-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 40px 20px;
  border-bottom: .5px solid var(--border);
  flex-wrap: wrap;
}

.pl-eyebrow {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.pl-title {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.pl-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.pl-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pl-content {
  padding: 24px 40px 80px;
}

.pl-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.pl-card.compact { padding: 18px; }

.pl-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.pl-card h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.pl-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 4px;
}

.pl-btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-decoration: none;
  white-space: nowrap;
}

.pl-btn.secondary {
  background: var(--surface);
  color: var(--fg);
  border: .5px solid var(--border);
}

.pl-btn.ghost {
  background: transparent;
  color: var(--fg);
}

.pl-btn.danger {
  background: rgba(220, 38, 38, .1);
  color: #b91c1c;
  border: .5px solid rgba(220, 38, 38, .25);
}

.pl-btn.dark {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border: .5px solid rgba(255, 255, 255, .12);
}

.pl-btn.small {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
}

/* Async-action loading state: hide the label, show a spinner. */
.pl-btn.loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}
.pl-btn.loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--on-accent) 45%, transparent);
  border-top-color: var(--on-accent);
  border-radius: 50%;
  animation: pl-spin .6s linear infinite;
}
.pl-btn.secondary.loading::after,
.pl-btn.danger.loading::after,
.pl-btn.ghost.loading::after {
  border-color: rgba(0, 0, 0, .2);
  border-top-color: var(--fg);
}
@keyframes pl-spin { to { transform: rotate(360deg); } }

/* "Jump to live" — sticks to the bottom of a transcript scroller. */
.pl-jump {
  position: sticky;
  bottom: 16px;
  width: fit-content;
  margin: 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
  z-index: 5;
}

.pl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pl-label {
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
}

.pl-input, .pl-select, .pl-file {
  width: 100%;
  background: var(--surface);
  color: var(--fg);
  border: .5px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  outline: none;
}

.pl-input:focus, .pl-select:focus {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: 0 0 0 3px var(--ring);
}

.pl-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.pl-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
}

.pl-ok {
  color: var(--ok);
  font-size: 13px;
}

.pl-grid {
  display: grid;
  gap: 16px;
}

.pl-two {
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: start;
}

.pl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pl-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--chip-bg);
  color: var(--fg);
  border: .5px solid var(--border);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
}

.pl-chip button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 0 0 2px;
}

.pl-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 9px 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  background: rgba(12, 12, 13, .06);
  color: var(--muted);
}

.pl-status.live {
  background: var(--accent);
  color: var(--on-accent);
}

.pl-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pl-status.live .pl-dot { animation: live-pulse 1.4s ease-out infinite; }

.pl-table-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.pl-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 12px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pl-meeting-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 110px minmax(0, 1.2fr) minmax(0, 1fr) 210px;
  gap: 24px;
  align-items: center;
  padding: 18px 24px;
  border-top: .5px solid var(--border);
}

.pl-meeting-row.live { background: var(--accent-tint); }
.pl-meeting-name {
  font-size: 14.5px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.pl-meta {
  color: var(--muted);
  font-size: 12.5px;
}

.pl-empty {
  padding: 80px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.pl-empty-glyph {
  width: 96px;
  height: 96px;
  border-radius: 16px;
  background: var(--surface-sunken);
  border: .5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 38px;
}

.pl-lang-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px;
  min-height: 44px;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 8px;
}

.pl-lang-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 7px;
  border: .5px solid var(--border);
  background: var(--chip-bg);
  color: var(--fg);
  font-size: 12.5px;
  cursor: pointer;
}

.pl-lang-option input { margin: 0; }

.pl-linkbox {
  display: flex;
  align-items: center;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  gap: 8px;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 8px;
  padding: 3px 3px 3px 12px;
}

.pl-linkbox code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.pl-linkbox .pl-btn {
  flex-shrink: 0;
}

.pl-qr {
  display: inline-block;
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .06);
}

.pl-qr.dark { box-shadow: 0 4px 16px rgba(0, 0, 0, .4); }

.pl-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
}

.pl-auth-hero {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pl-auth-hero h1 {
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
  max-width: 720px;
}

.pl-auth-visual {
  margin-top: 52px;
  max-width: 640px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(12, 12, 13, .16), 0 0 0 .5px rgba(12, 12, 13, .06);
  padding: 26px;
}

.pl-auth-panel {
  background: var(--surface);
  border-left: .5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px;
}

.pl-auth-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pl-tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  background: var(--surface-sunken);
  border-radius: 9px;
}

.pl-tabs button {
  flex: 1;
  border: 0;
  border-radius: 7px;
  padding: 8px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pl-tabs button.active {
  background: #fff;
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

.pl-dark {
  --bg: #0a0a0b;
  --surface: #15151a;
  --surface-sunken: #0f0f12;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, .58);
  --faint: rgba(255, 255, 255, .38);
  --border: rgba(255, 255, 255, .08);
  --chip-bg: rgba(255, 255, 255, .06);
  /* On near-black surfaces a black accent would vanish — invert it to white,
     and flip on-accent to dark so primaries read as white-on-black. */
  --accent: #ffffff;
  --on-accent: #0c0c0d;
  --accent-tint: rgba(255, 255, 255, .05);
  --accent-soft: rgba(255, 255, 255, .1);
  --ring: rgba(255, 255, 255, .18);
  background: #0a0a0b;
  color: #fff;
}

/* Logo flips with the surface: white tile + dark glyph on dark surfaces. */
.pl-dark .pl-logo { background: #fff; }
.pl-dark .pl-logo::after { background: #0c0c0d; }

.pl-studio {
  min-height: 100vh;
  background: #0a0a0b;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.pl-studio-top {
  padding: 14px 22px;
  border-bottom: .5px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #0a0a0b;
  flex-shrink: 0;
}

.pl-studio-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 320px;
  gap: 1px;
  background: rgba(255, 255, 255, .06);
  min-height: 0;
}

.pl-studio-pane {
  background: #0a0a0b;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
}

.pl-studio-main {
  background: #0a0a0b;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.pl-studio-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 32px 40px max(80px, 48vh);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pl-studio-card {
  background: #15151a;
  border: .5px solid rgba(255, 255, 255, .06);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pl-studio-card h2 {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .62);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pl-dark-input {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: .5px solid rgba(255, 255, 255, .12);
  color: #fff;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12.5px;
}

.pl-meter {
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  border: .5px solid var(--border);
  background: var(--surface-sunken);
}

.pl-meter div {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width .1s ease;
}

.pl-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 24px;
}

.pl-bars span {
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
}

.pl-stream-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
}

.pl-stream-row strong {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pl-transcript-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: .5px solid rgba(255, 255, 255, .06);
  flex-wrap: wrap;
}

.pl-segment {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: rgba(255, 255, 255, .04);
  border-radius: 8px;
  overflow-x: auto;
}

.pl-segment button {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .58);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.pl-segment button.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
}

.pl-transcript {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pl-turn {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
}

.pl-turn-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.pl-turn-name {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.pl-turn-ts {
  color: var(--muted);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.pl-turn-text {
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg);
  min-width: 0;
}

.pl-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: caret-blink 1.1s steps(2) infinite;
}

.pl-listener {
  min-height: 100vh;
  height: 100vh;
  height: 100dvh;
  background: #0a0a0b;
  color: #fff;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.pl-listener-inner {
  /* Width / type are reader-tunable via the Settings panel (CSS vars below). */
  width: min(100%, var(--lst-width, 760px));
  min-height: 100vh;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Readability vars drive the live transcript; defaults read well, the
   Settings panel overrides them inline on .pl-listener (persisted). */
.pl-listener .pl-turn-text {
  font-size: var(--lst-fs, 19px);
  font-weight: var(--lst-fw, 400);
  line-height: 1.6;
}
.pl-listener .pl-turn-orig .txt { font-size: calc(var(--lst-fs, 19px) * 0.8); }
.pl-listener .pl-now-playing { max-width: min(92%, var(--lst-width, 760px)); }
/* Speaker photo size is reader-tunable (Settings → Speaker photo). The left rail
   column grows with it so larger photos never crowd the text. */
.pl-listener .pl-avatar { width: var(--lst-avatar, 44px); height: var(--lst-avatar, 44px); }
.pl-listener .pl-turn { grid-template-columns: max(120px, calc(var(--lst-avatar, 44px) + 20px)) 1fr; }
/* Centre the avatar + name + time in the rail so a large photo stays balanced
   rather than left-skewed under it. */
.pl-listener .pl-turn-meta { align-items: center; text-align: center; }

/* Subtitle layout (Show speaker → off): drop the speaker rail entirely and run
   the text full-width like projected captions — no names to second-guess. */
.pl-listener.subtitles .pl-turn { display: block; }
.pl-listener.subtitles .pl-turn-meta { display: block; text-align: left; margin-bottom: 5px; }
.pl-listener.subtitles .pl-turn-ts { font-size: 12px; color: var(--faint); }
.pl-listener.subtitles .pl-transcript { gap: 26px; }

/* ── Listener live header (stripped) + settings (gear) panel ── */
.pl-lst-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pl-gear {
  appearance: none;
  border: .5px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pl-gear.on { background: var(--accent-soft); border-color: rgba(255, 255, 255, .25); }
.pl-lst-settings {
  /* Anchored to the viewport's right edge so it opens beside the centred stream
     (in the right margin on wide screens) rather than covering the transcript. */
  position: fixed;
  top: 64px;
  right: 16px;
  left: auto;
  width: min(380px, calc(100vw - 32px));
  z-index: 30;
  background: rgba(21, 21, 26, .98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: .5px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 6px 22px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}
/* Join QR, anchored to the LEFT edge — mirror of .pl-lst-settings on the right,
   so on a projection screen the audience can scan to join while the stream stays
   centred. */
.pl-lst-qr {
  position: fixed;
  top: 64px;
  left: 16px;
  right: auto;
  width: min(var(--lst-qr, 320px), calc(100vw - 32px));
  z-index: 30;
  background: rgba(21, 21, 26, .98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: .5px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5);
  text-align: center;
}
.pl-lst-qr .pl-qr-title { font-size: 13.5px; font-weight: 650; color: #fff; margin-bottom: 14px; }
.pl-lst-qr img { width: 100%; height: auto; display: block; background: #fff; border-radius: 12px; padding: 14px; box-sizing: border-box; }
.pl-lst-qr .pl-qr-url { font-size: 11.5px; color: rgba(255, 255, 255, .55); margin-top: 12px; word-break: break-all; }
/* The join QR is a projection aid — never show it on phones, even if toggled on. */
@media (max-width: 767px) { .pl-lst-qr { display: none !important; } }

.pl-set-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
  margin: 16px 0 4px;
}
.pl-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: .5px solid rgba(255, 255, 255, .07);
}
.pl-set-row:first-of-type { border-top: 0; }
.pl-set-label { font-size: 13.5px; font-weight: 500; color: #fff; }
.pl-set-help { font-size: 11.5px; color: rgba(255, 255, 255, .5); margin-top: 1px; }
.pl-set-stack { padding: 11px 0; border-top: .5px solid rgba(255, 255, 255, .07); }
.pl-set-stack .pl-set-label { margin-bottom: 8px; }
.pl-set-toggle { appearance: none; border: 0; background: transparent; padding: 0; flex-shrink: 0; }
.pl-switch.on { background: var(--accent); }
.pl-switch.on::after { left: 14px; }
.pl-range { width: 100%; accent-color: var(--accent); }
.pl-range-row { display: flex; align-items: center; gap: 10px; }
.pl-range-row .cap { font-size: 11px; color: rgba(255, 255, 255, .5); flex-shrink: 0; }
.pl-range-val {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, .7);
  min-width: 42px;
  text-align: right;
}
.pl-lst-settings .pl-seg { display: flex; width: 100%; }
.pl-lst-settings .pl-seg button { flex: 1; }
.pl-lst-settings .pl-dark-input { width: auto; min-width: 130px; max-width: 170px; }

.pl-listener-pick {
  flex: 1;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pl-listener-choice {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  margin-top: 8px;
  border: .5px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  text-align: left;
}

.pl-listener-live-head {
  padding: 14px 18px 12px;
  border-bottom: .5px solid rgba(255, 255, 255, .06);
  background: rgba(10, 10, 11, .94);
  position: sticky;
  top: 0;
  z-index: 2;
}

.pl-live-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  /* Generous bottom padding lets the newest block scroll up to the anchor line
     (lower-quarter or centre) with empty space beneath it. */
  padding: 28px 24px max(80px, 44vh);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pl-now-playing {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 16px;
  max-width: 496px;
  margin: 0 auto;
  background: rgba(21, 21, 26, .94);
  backdrop-filter: blur(20px);
  border: .5px solid rgba(255, 255, 255, .1);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}

.pl-recorder {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.pl-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #0c0c0d;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 999;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .2);
}

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

/* ─────────────────────────────────────────────────────────────────────────
   Management surfaces (Overview / Meetings / Wizard / Detail / Transcript).
   Re-chrome of the host area; all token-driven so they invert on .pl-dark.
   ───────────────────────────────────────────────────────────────────────── */

/* Sidebar nav icons + new-meeting + upsell */
.pl-nav a svg, .pl-nav button svg { flex-shrink: 0; opacity: .85; }
.pl-nav a.active svg, .pl-nav button.active svg { opacity: 1; }

.pl-sidebar-spacer { margin-top: auto; }

.pl-upsell {
  margin-top: 20px;
  padding: 14px;
  border: .5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.pl-upsell-title { font-size: 12.5px; font-weight: 650; }
.pl-upsell-sub { font-size: 12px; color: var(--muted); margin: 4px 0 10px; line-height: 1.45; }

/* Back link (detail / transcript) */
.pl-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  text-decoration: none;
}
.pl-back:hover { color: var(--fg); }

/* Themed segmented control (filters, language switch, layout toggle) */
.pl-seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-sunken);
  border: .5px solid var(--border);
}
.pl-seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.pl-seg button.active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

/* Search box */
.pl-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 8px;
  min-width: 220px;
}
.pl-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  padding: 9px 0;
  color: var(--fg);
}
.pl-search svg { color: var(--faint); flex-shrink: 0; }

/* Overflow + export menus */
.pl-menu { position: relative; display: inline-flex; }
.pl-menu-btn {
  appearance: none;
  border: .5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pl-menu-btn:hover { color: var(--fg); }
.pl-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: 184px;
  padding: 6px;
  border-radius: 10px;
  background: var(--surface);
  border: .5px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .14);
}
.pl-menu-pop button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
}
.pl-menu-pop button:hover { background: var(--surface-sunken); }
.pl-menu-pop button.danger { color: var(--danger); }
.pl-menu-pop .pl-menu-fmt {
  justify-content: space-between;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
}
.pl-menu-pop .pl-menu-fmt span:last-child {
  font-family: Inter, sans-serif;
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
}

/* Overview */
.pl-ov-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pl-ov-label > span:first-child {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .07em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pl-ov-label .pl-livedot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent);
  animation: live-pulse 1.4s ease-out infinite;
}
.pl-live-card {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 0 0 4px var(--accent-tint);
}
.pl-live-empty {
  background: var(--surface);
  border: .5px dashed var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.pl-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.pl-stat {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.pl-stat-num {
  font-size: 30px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.pl-stat-label { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.pl-recent-row {
  appearance: none;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: .5px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 96px minmax(0, 1.1fr) auto 20px;
  gap: 20px;
  align-items: center;
  padding: 14px 22px;
}
.pl-recent-row:first-child { border-top: 0; }
.pl-recent-row:hover { background: var(--surface-sunken); }

/* Meetings list rows */
.pl-list-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 22px;
  border-top: .5px solid var(--border);
  flex-wrap: wrap;
}
.pl-list-row:first-child { border-top: 0; }
.pl-list-row.live { background: var(--accent-tint); }
.pl-list-name {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 15px;
  font-weight: 650;
  color: var(--fg);
  letter-spacing: -0.01em;
  padding: 0;
  text-align: left;
}
.pl-list-name:hover { text-decoration: underline; }
.pl-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Wizard */
.pl-wiz-top {
  padding: 20px 40px;
  border-bottom: .5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pl-wiz-wrap { padding: 40px 24px 80px; display: flex; justify-content: center; }
.pl-wiz-inner { width: 100%; max-width: 680px; }
.pl-wiz-steps {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  margin-bottom: 28px;
}
.pl-wiz-step {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pl-wiz-step .pl-wiz-row { display: flex; align-items: center; width: 100%; }
.pl-wiz-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  background: var(--surface);
  color: var(--muted);
  border: .5px solid var(--border);
}
.pl-wiz-step.on .pl-wiz-num,
.pl-wiz-step.done .pl-wiz-num {
  background: var(--accent);
  color: var(--on-accent);
  border: 0;
}
.pl-wiz-step.on .pl-wiz-num { box-shadow: 0 0 0 4px var(--ring); }
.pl-wiz-line { flex: 1; height: 2px; margin: 0 10px; border-radius: 1px; background: var(--border); }
.pl-wiz-step.done .pl-wiz-line { background: var(--accent); }
.pl-wiz-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.pl-wiz-step.on .pl-wiz-label, .pl-wiz-step.done .pl-wiz-label { color: var(--fg); }
.pl-wiz-step.on .pl-wiz-label { font-weight: 650; }
.pl-wiz-card {
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}
.pl-wiz-h { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.pl-wiz-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 20px;
  border-top: .5px solid var(--border);
}
.pl-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  border-top: .5px solid var(--border);
  padding-top: 16px;
}
.pl-lang-cell {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pl-lang-cell:hover { background: var(--surface-sunken); }
.pl-lang-cell.on { background: var(--accent-soft); }
.pl-lang-cell:disabled { opacity: .45; cursor: not-allowed; }
.pl-lang-cell .pl-box {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  flex-shrink: 0;
  background: var(--surface);
  border: .5px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--on-accent);
}
.pl-lang-cell.on .pl-box { background: var(--accent); border: 0; }
.pl-lang-cell span.name { font-size: 13px; color: var(--fg); }
.pl-sum-row {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: .5px solid var(--border);
}
.pl-sum-row:last-child { border-bottom: 0; }
.pl-sum-row > span:first-child { font-size: 12.5px; color: var(--muted); font-weight: 500; }

/* Detail */
.pl-detail-share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}
.pl-qr-actions { display: flex; gap: 8px; align-self: stretch; }
.pl-qr-actions .pl-btn { flex: 1; }
.pl-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pl-spk-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: .5px solid var(--border);
}
.pl-spk-row:first-child { border-top: 0; }

/* Editable speaker photo: click the avatar to replace it. */
.pl-spk-photo {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  cursor: pointer;
  display: inline-block;
  border-radius: 50%;
}
.pl-spk-photo .pl-avatar { width: 40px; height: 40px; }
.pl-spk-photo-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  border: 1.5px solid var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .12s ease;
}
.pl-spk-photo:hover .pl-spk-photo-badge { opacity: 1; }
.pl-spk-photo.busy { opacity: .5; pointer-events: none; }

/* Transcript view */
.pl-tv { flex: 1; min-width: 0; background: var(--bg); display: flex; flex-direction: column; min-height: 100vh; }
.pl-tv-head { padding: 14px 40px 18px; border-bottom: .5px solid var(--border); }
.pl-tv-controls {
  padding: 16px 40px;
  border-bottom: .5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.pl-tv-lang {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: .5px solid var(--border);
}
.pl-tv-lang.on {
  color: var(--fg);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  padding-left: 11px;
}
.pl-tv-iconbtn {
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: .5px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pl-tv-iconbtn.on { background: var(--accent-soft); color: var(--fg); }
.pl-tv-body { flex: 1; padding: 32px 40px 120px; max-width: 900px; display: flex; flex-direction: column; gap: 28px; }
.pl-tv-block { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; }
.pl-tv-cols { display: grid; gap: 24px; }
.pl-tv-collabel {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pl-tv-quote { font-size: 16px; line-height: 1.65; color: var(--fg); }
.pl-tv-extra { display: flex; gap: 8px; margin-top: 10px; }
.pl-tv-extra .bar { color: var(--faint); flex-shrink: 0; }
.pl-tv-extra .lab {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  margin-right: 8px;
  text-transform: uppercase;
}
.pl-tv-extra .txt { font-size: 14.5px; line-height: 1.55; color: var(--muted); }
.pl-tv-empty {
  max-width: 560px;
  margin: 40px auto;
  padding: 56px 40px;
  text-align: center;
  background: var(--surface);
  border: .5px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.pl-tv-empty .glyph {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--surface-sunken);
  border: .5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

/* Listener: show-original toggle + original line in a turn */
.pl-orig-toggle {
  appearance: none;
  font: inherit;
  cursor: pointer;
  margin-top: 10px;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  border: .5px solid rgba(255, 255, 255, .1);
  color: #fff;
}
.pl-orig-toggle.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.pl-switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 18px;
  border-radius: 999px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .18);
  transition: background .15s ease;
}
.pl-orig-toggle.on .pl-switch { background: var(--accent); }
.pl-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  transition: left .15s ease;
}
.pl-orig-toggle.on .pl-switch::after { left: 14px; }
.pl-turn-orig {
  margin-top: 10px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
}
.pl-turn-orig .lab {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.pl-turn-orig .txt { font-size: 14.5px; line-height: 1.55; color: var(--muted); margin-top: 3px; }

@media (max-width: 1100px) {
  .pl-studio-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }

  .pl-studio-pane {
    max-height: none;
  }
}

@media (max-width: 900px) {
  .pl-shell { display: block; }
  .pl-sidebar {
    width: auto;
    border-right: 0;
    border-bottom: .5px solid var(--border);
    flex-direction: row;
    align-items: center;
    gap: 18px;
    overflow-x: auto;
  }
  .pl-nav {
    margin-top: 0;
    flex-direction: row;
  }
  .pl-account { margin-top: 0; margin-left: auto; }
  .pl-header, .pl-content { padding-left: 20px; padding-right: 20px; }
  .pl-two { grid-template-columns: 1fr; }
  .pl-meeting-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .pl-stats { grid-template-columns: 1fr; }
  .pl-detail-share { grid-template-columns: 1fr; }
  .pl-recent-row { grid-template-columns: 1fr; gap: 8px; }
  .pl-tv-block { grid-template-columns: 1fr; gap: 8px; }
  .pl-tv-cols { grid-template-columns: 1fr !important; }
  .pl-tv-head, .pl-tv-controls, .pl-tv-body, .pl-wiz-top { padding-left: 20px; padding-right: 20px; }
  .pl-auth {
    grid-template-columns: 1fr;
  }
  .pl-auth-hero {
    padding: 36px 24px 18px;
  }
  .pl-auth-panel {
    border-left: 0;
    padding: 24px;
  }
}

@media (max-width: 720px) {
  .pl-turn,
  .pl-listener .pl-turn {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .pl-turn-meta {
    flex-direction: row;
    align-items: center;
  }
  .pl-turn-text {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001s !important;
  }
}
