:root {
  --ink: #08041d;
  --ink-soft: #15102b;
  --paper: #f7f4ee;
  --paper-soft: #eee9f3;
  --line: rgba(247, 244, 238, .16);
  --line-dark: rgba(8, 4, 29, .16);
  --pink: #ed8db8;
  --magenta: #e33fe8;
  --violet: #7050b7;
  --blue: #35a6ff;
  --gold: #ffbd3f;
  --danger: #ff8291;
  --shadow: 0 20px 55px rgba(8, 4, 29, .24);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; background: var(--ink); color: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.55; }
body.light-mode { --ink: #f7f4ee; --ink-soft: #eee9f3; --paper: #181124; --paper-soft: #fff; --line: rgba(8, 4, 29, .16); --line-dark: rgba(8, 4, 29, .16); }
a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 50; top: -80px; left: 18px; padding: 12px 18px; background: var(--gold); color: #08041d; font-weight: 800; text-decoration: none; }
.skip-link:focus { top: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.meeting-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; }
.meeting-header { position: sticky; z-index: 20; top: 0; border-bottom: 1px solid var(--line); background: rgba(8, 4, 29, .88); backdrop-filter: blur(18px); }
.meeting-header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 78px; gap: 30px; }
.meeting-brand { display: inline-flex; width: 175px; }
.meeting-brand img { width: 100%; height: auto; }
.meeting-header nav { display: flex; align-items: center; gap: 24px; color: rgba(247, 244, 238, .74); font-size: 12px; font-weight: 800; }
.meeting-header nav a { text-decoration: none; }
.meeting-header nav a:hover { color: var(--pink); }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--paper); cursor: pointer; }
.meeting-main { padding: 72px 0 110px; }
.meeting-intro { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: center; gap: 40px; padding-bottom: 72px; }
.meeting-eyebrow, .panel-kicker { margin: 0 0 18px; color: var(--pink); font-size: 11px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.meeting-eyebrow { display: flex; align-items: center; gap: 10px; }
.meeting-eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 0 7px rgba(237, 141, 184, .13); }
h1, h2, h3, p { margin-top: 0; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; letter-spacing: -.055em; line-height: .98; }
h1 { max-width: 720px; margin-bottom: 28px; font-size: clamp(54px, 8vw, 100px); }
h2 { margin-bottom: 18px; font-size: clamp(32px, 4vw, 57px); }
h1 em, h2 em { color: var(--pink); font-style: italic; }
.meeting-lead { max-width: 650px; margin: 0; color: rgba(247, 244, 238, .68); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.6; }
.meeting-orbit-mark { position: relative; width: 190px; height: 190px; display: grid; place-items: center; border: 1px solid rgba(227, 63, 232, .42); border-radius: 50%; transform: rotate(12deg); }
.meeting-orbit-mark::before, .meeting-orbit-mark::after { position: absolute; inset: 15px -26px; border: 1px solid rgba(53, 166, 255, .36); border-radius: 50%; content: ""; transform: rotate(-25deg); }
.meeting-orbit-mark::after { inset: -19px 25px; border-color: rgba(255, 189, 63, .34); transform: rotate(58deg); }
.meeting-orbit-mark img { width: 100px; height: 100px; opacity: .95; transform: rotate(-12deg); }
.meeting-status { min-height: 28px; margin: -24px 0 23px; color: var(--gold); font-size: 14px; font-weight: 700; }
.meeting-landing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.meeting-panel { min-height: 590px; padding: clamp(28px, 4vw, 53px); border: 1px solid var(--line); background: linear-gradient(145deg, rgba(255, 255, 255, .08), rgba(112, 80, 183, .12)); box-shadow: 0 30px 80px rgba(0, 0, 0, .16); }
.join-panel { background: linear-gradient(145deg, rgba(227, 63, 232, .16), rgba(53, 166, 255, .09)); }
.meeting-panel p { max-width: 420px; color: rgba(247, 244, 238, .68); }
.meeting-form { margin-top: 33px; }
.meeting-form label, .created-links label { display: block; margin: 19px 0 7px; color: rgba(247, 244, 238, .63); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.meeting-form input, .meeting-form select, .created-links input { width: 100%; min-height: 48px; padding: 11px 0; border: 0; border-bottom: 1px solid rgba(247, 244, 238, .34); border-radius: 0; outline: 0; background: transparent; color: var(--paper); }
.meeting-form input:focus, .meeting-form select:focus, .created-links input:focus { border-color: var(--pink); box-shadow: 0 2px 0 var(--pink); }
.meeting-form select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--pink) 50%), linear-gradient(135deg, var(--pink) 50%, transparent 50%); background-position: calc(100% - 9px) 50%, calc(100% - 3px) 50%; background-repeat: no-repeat; background-size: 6px 6px, 6px 6px; }
.meeting-form select option { background: var(--ink-soft); color: var(--paper); }
.meeting-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; gap: 12px; padding: 11px 17px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; font-size: 13px; font-weight: 900; transition: transform .2s ease, background .2s ease, border-color .2s ease; }
.meeting-button:hover { transform: translateY(-2px); }
.meeting-button-primary { width: 100%; margin-top: 31px; background: linear-gradient(105deg, var(--magenta), var(--violet) 58%, var(--blue)); color: #fff; box-shadow: 0 14px 32px rgba(227, 63, 232, .25); }
.meeting-button-outline { border-color: rgba(247, 244, 238, .36); background: transparent; color: var(--paper); }
.meeting-button-outline:hover { border-color: var(--pink); background: rgba(237, 141, 184, .12); }
.meeting-button-danger { border-color: rgba(255, 130, 145, .42); background: transparent; color: var(--danger); }
.meeting-button-danger:hover { background: rgba(255, 130, 145, .14); }
.meeting-button-small { min-height: 38px; padding: 8px 13px; font-size: 11px; }
.created-links { margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); }
.link-success { color: var(--gold) !important; font-weight: 800; }
.copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; align-items: end; }
.copy-row input { min-width: 0; color: var(--paper); font-size: 12px; text-overflow: ellipsis; }
.form-hint { margin: 16px 0 0; color: rgba(247, 244, 238, .46) !important; font-size: 12px; line-height: 1.5; }
.privacy-note { display: flex; gap: 15px; align-items: flex-start; padding: 21px 0 0; margin-top: 82px; border-top: 1px solid var(--line); }
.privacy-note span { color: var(--pink); font-size: 27px; line-height: 1; }
.privacy-note p { margin: 0; color: rgba(247, 244, 238, .56); font-size: 13px; }

/* Room */
.room-view { border: 1px solid var(--line); background: rgba(255, 255, 255, .045); box-shadow: 0 30px 100px rgba(0, 0, 0, .25); }
.room-topbar { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 25px 29px; border-bottom: 1px solid var(--line); }
.room-topbar h2 { margin: 0 0 4px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.room-topbar .panel-kicker { margin-bottom: 4px; font-size: 9px; }
.room-meta { color: rgba(247, 244, 238, .48); font-size: 12px; }
.room-top-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.room-lobby { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 42px; padding: 40px; }
.lobby-preview { position: relative; min-height: 430px; overflow: hidden; display: grid; place-items: center; background: #03020d; border: 1px solid var(--line); }
.lobby-preview video { width: 100%; height: 100%; min-height: 430px; display: block; object-fit: cover; transform: scaleX(-1); }
.video-placeholder { position: absolute; display: grid; place-items: center; color: rgba(247, 244, 238, .48); text-align: center; }
.video-placeholder span { color: var(--pink); font-size: 44px; }
.video-placeholder p { margin: 8px 0; font-size: 13px; }
.preview-label { position: absolute; top: 16px; left: 16px; padding: 5px 9px; border: 1px solid rgba(247, 244, 238, .25); border-radius: 999px; background: rgba(8, 4, 29, .65); color: var(--paper); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.lobby-controls { align-self: center; }
.lobby-controls h2 { margin-bottom: 22px; }
.lobby-controls > div > p:not(.panel-kicker) { color: rgba(247, 244, 238, .62); font-size: 14px; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lobby-buttons { display: flex; gap: 8px; margin-top: 25px; }
.lobby-buttons .meeting-button { flex: 1; }
.call-view { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 650px; }
.call-stage { position: relative; min-width: 0; min-height: 650px; padding: 18px 18px 86px; background: #03020d; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; align-content: start; height: 100%; overflow: auto; }
.video-tile { position: relative; min-height: 180px; overflow: hidden; border: 1px solid rgba(247, 244, 238, .2); border-radius: 6px; background: #111024; }
.video-tile video { width: 100%; height: 100%; min-height: 180px; display: block; object-fit: cover; }
.video-tile.local video { transform: scaleX(-1); }
.video-tile.is-speaking { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 189, 63, .18); }
.video-tile-label { position: absolute; right: 9px; bottom: 8px; left: 9px; display: flex; justify-content: space-between; gap: 10px; padding: 5px 8px; background: linear-gradient(90deg, rgba(8, 4, 29, .8), transparent); color: #fff; font-size: 12px; font-weight: 800; }
.tile-muted { color: var(--danger); }
.call-status-pill { position: absolute; top: 17px; left: 18px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; background: rgba(8, 4, 29, .74); color: rgba(247, 244, 238, .74); font-size: 11px; }
.call-status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.call-status-pill.connected span { background: #73dd9a; }
.call-controls { position: absolute; right: 18px; bottom: 15px; left: 18px; display: flex; justify-content: center; gap: 8px; padding: 10px; border: 1px solid rgba(247, 244, 238, .16); border-radius: 999px; background: rgba(8, 4, 29, .9); backdrop-filter: blur(12px); }
.call-control { display: grid; min-width: 59px; min-height: 48px; place-items: center; gap: 2px; padding: 6px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--paper); cursor: pointer; }
.call-control:hover, .call-control[aria-pressed="true"] { border-color: rgba(237, 141, 184, .5); background: rgba(237, 141, 184, .12); }
.call-control span { font-size: 19px; line-height: 1; }
.call-control small { font-size: 10px; font-weight: 800; }
.call-control-record span { color: var(--danger); }
.call-control-end { color: var(--danger); }
.call-sidebar { display: flex; min-width: 0; flex-direction: column; border-left: 1px solid var(--line); background: rgba(247, 244, 238, .055); }
.sidebar-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.sidebar-tab { padding: 17px 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: rgba(247, 244, 238, .58); cursor: pointer; font-size: 12px; font-weight: 900; }
.sidebar-tab.is-active { border-color: var(--pink); color: var(--paper); }
.sidebar-panel { min-height: 0; padding: 22px; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sidebar-heading h3 { margin: 0; font-size: 15px; }
.sidebar-heading span { display: grid; min-width: 25px; min-height: 25px; place-items: center; border-radius: 50%; background: rgba(237, 141, 184, .14); color: var(--pink); font-size: 11px; font-weight: 900; }
.participants-list { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }
.participant-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0; border-bottom: 1px solid rgba(247, 244, 238, .1); font-size: 13px; }
.participant-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant-role { color: var(--pink); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.participant-actions { display: flex; gap: 4px; }
.tiny-button { padding: 4px 6px; border: 1px solid rgba(247, 244, 238, .24); border-radius: 5px; background: transparent; color: var(--paper); cursor: pointer; font-size: 10px; }
.tiny-button:hover { border-color: var(--pink); }
.waiting-list-wrap { padding-top: 26px; margin-top: 25px; border-top: 1px solid var(--line); }
.host-actions { display: grid; gap: 8px; padding-top: 25px; margin-top: 25px; border-top: 1px solid var(--line); }
.chat-panel { display: flex; height: 100%; flex-direction: column; }
.chat-messages { flex: 1; min-height: 460px; max-height: 520px; overflow: auto; }
.chat-message { padding: 10px 0; border-bottom: 1px solid rgba(247, 244, 238, .1); }
.chat-message-head { display: flex; justify-content: space-between; gap: 10px; color: var(--pink); font-size: 11px; font-weight: 800; }
.chat-message-time { color: rgba(247, 244, 238, .4); font-size: 10px; font-weight: 500; }
.chat-message p { margin: 4px 0 0; color: rgba(247, 244, 238, .78); font-size: 13px; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr 39px; gap: 7px; padding-top: 14px; border-top: 1px solid var(--line); }
.chat-form input { min-width: 0; padding: 10px; border: 1px solid rgba(247, 244, 238, .24); border-radius: 7px; background: rgba(0, 0, 0, .16); color: var(--paper); outline: 0; }
.chat-form button { border: 0; border-radius: 7px; background: var(--magenta); color: #fff; cursor: pointer; font-weight: 900; }
.recording-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 11px 16px; background: #461626; color: #fff; font-size: 13px; }
.recording-banner span:last-child { color: rgba(255, 255, 255, .7); font-size: 11px; }
.recording-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff687d; box-shadow: 0 0 0 5px rgba(255, 104, 125, .14); animation: pulse-recording 1.3s infinite; }
@keyframes pulse-recording { 50% { opacity: .4; } }
.meeting-live-status { min-height: 36px; padding: 10px 18px; color: var(--gold); font-size: 13px; }
.meeting-dialog { width: min(560px, calc(100% - 32px)); padding: 35px; border: 1px solid rgba(247, 244, 238, .24); border-radius: 16px; background: var(--ink-soft); color: var(--paper); box-shadow: 0 35px 100px rgba(0, 0, 0, .5); }
.meeting-dialog::backdrop { background: rgba(3, 2, 13, .74); backdrop-filter: blur(5px); }
.meeting-dialog p { color: rgba(247, 244, 238, .72); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 28px; }
.dialog-actions .meeting-button { width: auto; margin-top: 0; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin-bottom: 0; }
.dialog-close { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--paper); cursor: pointer; font-size: 20px; }
.recordings-dialog { width: min(760px, calc(100% - 32px)); }
.recording-player { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); background: #03020d; }
.recording-player video { display: block; width: 100%; max-height: 420px; background: #03020d; }
.recordings-list { display: grid; gap: 9px; max-height: 55vh; overflow: auto; margin-top: 24px; }
.recording-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.recording-row strong { display: block; font-size: 14px; }
.recording-row small { color: rgba(247, 244, 238, .52); }
.recording-row-actions { display: flex; gap: 6px; }
.empty-state { color: rgba(247, 244, 238, .52); }
.meeting-footer { padding: 25px 0; border-top: 1px solid var(--line); color: rgba(247, 244, 238, .48); font-size: 11px; }
.meeting-footer .meeting-shell { display: flex; justify-content: space-between; gap: 20px; }
.meeting-footer a { margin-left: 20px; text-decoration: none; }
.meeting-footer a:hover { color: var(--pink); }
[hidden] { display: none !important; }

@media (max-width: 880px) {
  .meeting-main { padding-top: 52px; }
  .meeting-intro { grid-template-columns: 1fr; padding-bottom: 45px; }
  .meeting-orbit-mark { display: none; }
  .meeting-landing, .room-lobby { grid-template-columns: 1fr; }
  .meeting-panel { min-height: 0; }
  .privacy-note { margin-top: 42px; }
  .call-view { grid-template-columns: 1fr; }
  .call-stage { min-height: 580px; }
  .call-sidebar { min-height: 350px; border-top: 1px solid var(--line); border-left: 0; }
  .chat-messages { min-height: 190px; max-height: 300px; }
}

@media (max-width: 600px) {
  .meeting-shell { width: min(100% - 28px, 1180px); }
  .meeting-header-inner { min-height: 68px; }
  .meeting-brand { width: 145px; }
  .meeting-header nav { gap: 10px; font-size: 11px; }
  .meeting-header nav a:nth-child(2) { display: none; }
  .meeting-main { padding: 38px 0 70px; }
  h1 { font-size: clamp(47px, 15vw, 75px); }
  .meeting-panel { padding: 24px 20px; }
  .room-topbar { align-items: flex-start; flex-direction: column; padding: 20px; }
  .room-top-actions { justify-content: flex-start; }
  .room-lobby { padding: 20px; gap: 28px; }
  .lobby-preview, .lobby-preview video { min-height: 255px; }
  .device-grid { grid-template-columns: 1fr; gap: 0; }
  .call-stage { min-height: 490px; padding: 14px 10px 85px; }
  .video-grid { grid-template-columns: 1fr; }
  .video-tile, .video-tile video { min-height: 210px; }
  .call-controls { right: 8px; bottom: 10px; left: 8px; gap: 2px; padding: 6px 3px; }
  .call-control { min-width: 42px; padding: 5px 4px; }
  .call-control small { font-size: 9px; }
  .recording-row { align-items: flex-start; flex-direction: column; }
  .meeting-footer .meeting-shell { align-items: flex-start; flex-direction: column; }
  .meeting-footer a:first-child { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
