/**
 * Portal shell — subset from export/portal-shell-standalone-demo.html
 * See export/AGENT_COPY_PORTAL_SHELL.md (contracts: is-auth-open, data-portal-view, portalSection*).
 */
:root {
  --bg: #0f1115;
  --panel: #141823;
  --text: #e9edf3;
  --muted: #aab3c2;
  --line: rgba(255, 255, 255, 0.08);
  --chip: rgba(255, 255, 255, 0.06);
  --accent: #ffd84a;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.topbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.brand,
.brand *,
.brand-title,
.brand-sub {
  cursor: default;
  user-select: none;
}
.brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.topbar button {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.topbar input[type="search"],
.topbar .auth-btn {
  height: 40px;
  padding: 0 12px;
}
.topbar .auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 64px;
}
.topbar button:hover {
  border-color: rgba(255, 255, 255, 0.18);
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}
.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}
.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  position: relative;
}
.auth-name {
  font-size: 12px;
  color: rgba(233, 237, 243, 0.9);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(233, 237, 243, 0.92);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-top: 0;
  margin-bottom: 0;
}
.auth-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.topbar-inner {
  align-items: center;
}
.auth-panel {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  max-width: calc(100vw - 16px);
  width: min(360px, calc(100vw - 16px));
  padding: 10px;
  padding-bottom: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(8px);
}
.topbar.is-auth-open #authPanel {
  display: block;
}
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.auth-label {
  font-size: 11px;
  color: rgba(233, 237, 243, 0.75);
  margin-top: 2px;
}
.auth-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(233, 237, 243, 0.92);
  border-radius: 10px;
  padding: 10px 10px;
  font-size: 13px;
  outline: none;
  margin-top: 6px;
  margin-bottom: 6px;
}
.auth-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 216, 74, 0.12);
}
.auth-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.auth-row .auth-btn {
  flex: 0 0 auto;
}
.auth-msg {
  font-size: 12px;
  color: rgba(233, 237, 243, 0.75);
  min-height: 16px;
}
.auth-msg.is-error {
  color: rgba(255, 120, 120, 0.95);
}
.auth-msg.is-ok {
  color: rgba(140, 255, 170, 0.95);
}
.auth-user {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.auth-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  z-index: 20;
}
.auth-user-menu .auth-btn {
  display: block;
  width: 100%;
  padding: 8px 10px;
}
.auth-user.is-open .auth-user-menu {
  display: block;
}

/* portal.css subset */
.auth-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px -4px 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.auth-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(233, 237, 243, 0.95);
}
.auth-panel-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(233, 237, 243, 0.85);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.auth-panel-close:hover {
  background: rgba(255, 255, 255, 0.08);
}
.auth-create-hint {
  font-size: 12px;
  color: rgba(233, 237, 243, 0.72);
  margin: 0 0 10px;
  line-height: 1.4;
}
.auth-mode-switch {
  margin: 10px 0 0;
  font-size: 12px;
}
.auth-mode-switch-secondary {
  margin-top: 6px;
}
.auth-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 216, 74, 0.88);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
}
.auth-link-btn:hover {
  color: rgba(255, 230, 160, 0.95);
}

.topbar-main {
  flex-wrap: wrap;
  row-gap: 10px;
}
.topbar-nav {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-sizing: border-box;
}
.topbar-nav-tab-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.topbar-nav-tab-icon {
  flex-shrink: 0;
  opacity: 0.75;
}
.topbar .topbar-nav-tab.is-active .topbar-nav-tab-icon {
  opacity: 1;
}
.topbar .topbar-nav-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: auto;
  min-height: 34px;
  padding: 7px 8px;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(233, 237, 243, 0.52);
  cursor: pointer;
  line-height: 1.15;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.topbar .topbar-nav-tab:hover {
  color: rgba(233, 237, 243, 0.88);
  border-color: transparent;
}
.topbar .topbar-nav-tab:focus-visible {
  outline: 2px solid rgba(255, 216, 74, 0.45);
  outline-offset: 2px;
}
.topbar .topbar-nav-tab.is-active {
  background: rgba(255, 255, 255, 0.07);
  color: rgba(233, 237, 243, 0.94);
  font-weight: 600;
}
@media (max-width: 640px) {
  .topbar-nav {
    flex: 1 1 100%;
    order: 3;
    justify-content: stretch;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .auth-area {
    flex: 0 0 auto;
  }
  .topbar .topbar-nav-tab {
    min-height: 38px;
    padding: 8px 6px;
    font-size: 11px;
  }
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-logo {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  object-fit: contain;
}
.topbar .brand-title {
  display: block;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  color: rgba(233, 237, 243, 0.88);
  letter-spacing: 0.02em;
}
.topbar .brand-version {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(233, 237, 243, 0.45);
  letter-spacing: 0.04em;
  white-space: nowrap;
  user-select: none;
}
.wave-panel-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: var(--panel);
  padding: 16px 18px;
}

/* Logged out: hide app until sign-in */
body.waveform-logged-out {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

body.waveform-logged-out > .topbar {
  flex-shrink: 0;
}

body.waveform-logged-out #loggedInView,
body.waveform-logged-out #topbarNav,
body.waveform-logged-out #feedHostModal,
body.waveform-logged-out #scheduleSlotModal {
  display: none !important;
}

body.waveform-logged-out main.container {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  min-height: 0;
}

body.waveform-logged-out .logged-out-landing {
  text-align: center;
  max-width: 26rem;
  color: var(--muted);
}

body.waveform-logged-out .logged-out-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  object-fit: contain;
}

body.waveform-logged-out .logged-out-title {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
}

body.waveform-logged-out .logged-out-lead {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

body.waveform-logged-out .logged-out-hint {
  margin: 0;
  font-size: 0.875rem;
  opacity: 0.85;
}

body.waveform-logged-out:has(.topbar.is-auth-open) .logged-out-hint {
  display: none;
}
