:root {
  --mobile-fullscreen-width: 100vw;
  --mobile-fullscreen-height: 100vh;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif; color: #0b132b; background: #f7f9fc; }
.container { max-width: 960px; margin: 0 auto; padding: 24px; }
header { display: flex; align-items: center; justify-content: space-between; }
header h1 { margin: 0; font-size: 1.5rem; }
#inviteInfo { color: #4f5d75; }

.card { background: white; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); margin-top: 16px; display: block; }
.actions { display: flex; gap: 12px; margin-top: 12px; }
button { padding: 10px 16px; border: 1px solid #d1d5db; background: #111827; color: white; border-radius: 8px; cursor: pointer; }
button.secondary { background: white; color: #111827; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.status { margin-top: 8px; color: #374151; }
.status-warning { color: #b45309; }
.step-progress { font-weight: 600; color: #1f2937; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.25rem; margin-left: 8px; }
.timer.overtime { color: #b91c1c; font-weight: 800; animation: timerPulse 1s infinite alternate; background: #fee2e2; border: 1px solid #fecaca; border-radius: 9999px; padding: 2px 10px; box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.12); font-size: 1.35rem; }
@keyframes timerPulse { from { transform: none; } to { transform: scale(1.08); } }

.video-wrapper { position: relative; width: 100%; max-width: 800px; margin: 12px auto; }
video { width: 100%; height: auto; background: #111; border-radius: 12px; }
.mobile-fullscreen-hint {
  margin: 8px auto 0;
  max-width: 800px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #bae6fd;
  background: #eff6ff;
  color: #0369a1;
  font-size: 0.95rem;
  display: none;
}
.video-wrapper .fullscreen-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  pointer-events: auto;
  z-index: 5;
  transition: background 0.2s ease;
}
.video-wrapper .fullscreen-toggle:focus-visible {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}
.video-wrapper.fullscreen-available .fullscreen-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.video-wrapper.fullscreen-active .fullscreen-toggle {
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  right: max(12px, calc(env(safe-area-inset-right, 0px) + 12px));
  background: rgba(0, 0, 0, 0.55);
}
.video-wrapper.fullscreen-active {
  position: fixed;
  inset: 0;
  width: var(--mobile-fullscreen-width, 100vw);
  height: var(--mobile-fullscreen-height, 100vh);
  min-height: var(--mobile-fullscreen-height, 100vh);
  max-width: none;
  margin: 0;
  border-radius: 0;
  background: #000;
  z-index: 1100;
}
.video-wrapper.fullscreen-active video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}
.video-wrapper.fullscreen-active .overlay {
  border-radius: 0;
}
.video-wrapper.fullscreen-active .frame-controls {
  bottom: max(16px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  gap: 12px;
}
.video-wrapper.fullscreen-active .frame-controls button {
  font-size: 1rem;
  padding: 8px 14px;
}
.video-wrapper.fullscreen-active .question-overlay-inner {
  max-width: min(900px, 92vw);
}
.video-wrapper.fullscreen-active .question-overlay,
.video-wrapper.fullscreen-active .controls-overlay,
.video-wrapper.fullscreen-active .countdown-overlay {
  border-radius: 0;
}
.video-wrapper.fullscreen-active .countdown-number {
  font-size: clamp(64px, 15vw, 140px);
}
body.mobile-fullscreen {
  overflow: hidden;
  background: #000;
  height: var(--mobile-fullscreen-height, 100vh);
}
@media (min-width: 1025px) {
  .video-wrapper.fullscreen-available .fullscreen-toggle {
    display: none;
  }
}
.overlay { position: absolute; pointer-events: none; inset: 0; display: flex; align-items: center; justify-content: center; }
.overlay img, .overlay svg { width: 70%; height: 70%; opacity: 0.7; }

/* Device controls (camera/mic selection) */
.device-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
  margin: 8px 0 4px;
}
.device-controls .device-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 8px;
}
.device-controls label {
  margin: 0;
  font-weight: 600;
  color: #374151;
  text-align: right;
}
.device-controls select {
  width: 100%;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}
.device-controls .device-refresh {
  width: fit-content;
}
@media (max-width: 700px) {
  .device-controls .device-row { grid-template-columns: 1fr; }
  .device-controls label { text-align: left; }
}

/* In-frame question overlay (question text + Start) */
.question-overlay {
  background: #000; /* solid black */
  color: #fff;
  pointer-events: none; /* allow clicks to pass through to bottom controls overlay */
  border-radius: 12px;
}
.question-overlay-inner {
  width: 100%;
  max-width: 900px;
  padding: 16px;
  text-align: center;
  position: relative;
}
.question-overlay-text {
  color: #fff;
  font-weight: 700;
  line-height: 1.35;
  font-size: clamp(18px, 2.2vw, 28px);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.frame-controls {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: flex;
  gap: 8px;
  pointer-events: auto; /* clickable buttons inside overlay */
}

/* In-recording controls overlay (Pause/Finished at bottom) */
.controls-overlay {
  background: linear-gradient(to top, rgba(0,0,0,0.45), rgba(0,0,0,0));
  align-items: flex-end; /* push controls to bottom */
  pointer-events: none; /* allow video controls below unless interacting with buttons */
}
.controls-overlay .frame-controls {
  margin-bottom: 8px;
  pointer-events: auto;
}

.review-controls-overlay {
  display: none;
  align-items: flex-end;
  padding: 16px;
}
.video-wrapper.fullscreen-active .review-controls-overlay {
  display: flex;
}
.review-controls-overlay .frame-controls {
  margin-bottom: 56px;
  gap: 12px;
}

.review-controls-overlay button {
  min-width: 140px;
  font-weight: 600;
}

/* Smaller overlay buttons */
.controls-overlay .frame-controls button {
  padding: 6px 10px;
  font-size: 0.9rem;
  border-radius: 6px;
}

.mobile-controls {
  display: none;
  pointer-events: auto;
}

@media (max-width: 700px) {
  .mobile-controls {
    margin-top: 12px;
    display: none;
    justify-content: center;
    align-items: stretch;
    gap: 10px;
  }

  .mobile-controls .frame-controls {
    position: static;
    transform: none;
    bottom: auto;
    margin-bottom: 0;
    width: 100%;
    justify-content: center;
    gap: 10px;
  }

  .mobile-controls .frame-controls button {
    flex: 1 1 auto;
  }
}

/* Light meter (camera framing step) */
.light-meter { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.light-badge { display: inline-block; font-size: 0.9rem; font-weight: 600; padding: 4px 10px; border-radius: 9999px; border: 1px solid; }
.light-badge.light-ok { color: #065f46; background: #ecfdf5; border-color: #a7f3d0; }
.light-badge.light-dark { color: #92400e; background: #fffbeb; border-color: #fcd34d; }
.light-badge.light-bright { color: #7f1d1d; background: #fef2f2; border-color: #fecaca; }
.light-bar { position: relative; height: 10px; background: #e5e7eb; border-radius: 9999px; overflow: hidden; }
.light-bar-fill { height: 100%; width: 0%; border-radius: 9999px; transition: width 0.25s ease; background: linear-gradient(90deg, #34d399, #059669); }
.light-bar-fill.light-dark { background: linear-gradient(90deg, #f59e0b, #b45309); }
.light-bar-fill.light-bright { background: linear-gradient(90deg, #f87171, #b91c1c); }
.light-hint { font-size: 0.85rem; color: #6b7280; }

/* Countdown overlay (pre-roll before recording) */
.countdown-overlay { background: rgba(0,0,0,0.55); backdrop-filter: blur(1px); border-radius: 12px; }
.countdown-number { 
  color: #fff; font-weight: 800; 
  font-size: clamp(48px, 12vw, 120px);
  display: block;
  line-height: 1;
  text-align: center; 
  font-variant-numeric: tabular-nums lining-nums;
  transform-origin: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
  animation: countdownPop 1s ease-in-out infinite;
}
@keyframes countdownPop { 0% { transform: scale(0.85); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }

.instructions-card { display: flex; flex-direction: column; gap: 20px; }
.instructions-subtitle { margin: 0; color: #4f5d75; line-height: 1.5; font-size: 1.05rem; }
.instructions-grid { display: grid; gap: 14px; }
.instructions-compat-warning { padding: 12px 14px; border-radius: 10px; border: 1px solid #fcd34d; background: #fff7ed; color: #92400e; font-size: 0.95rem; line-height: 1.45; }
.instructions-compat-warning strong { font-weight: 600; }
.instructions-compat-warning p { margin: 0 0 6px; }
.instructions-compat-warning ul { margin: 6px 0 0 18px; padding: 0; }
.instructions-compat-warning li { margin: 4px 0; }
.instructions-compat-warning .compat-recommendation { margin-top: 8px; font-weight: 500; }
.instruction-step { display: flex; gap: 14px; background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(37,99,235,0.06)); border: 1px solid rgba(59,130,246,0.25); border-radius: 12px; padding: 14px 16px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.45); }
.instruction-number { flex-shrink: 0; width: 38px; height: 38px; border-radius: 9999px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.05rem; box-shadow: 0 4px 12px rgba(37,99,235,0.25); }
.instruction-copy h3 { margin: 0 0 4px; font-size: 1.05rem; color: #111827; }
.instruction-copy p { margin: 0; color: #1f2937; line-height: 1.45; font-size: 0.98rem; }
.instructions-footnote { font-size: 0.95rem; color: #374151; padding: 12px 14px; background: #f3f4f6; border-radius: 10px; border: 1px solid #e5e7eb; }

@media (min-width: 720px) {
  .instructions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

footer { margin-top: 24px; color: #6b7280; }

/* Admin tables */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; }
.admin-table th, .admin-table td { padding: 8px; border-bottom: 1px solid #eee; vertical-align: middle; }
.admin-table .center { text-align: center; }
.admin-table .cell-actions { white-space: nowrap; }
/* Invite ID column layout: left group (icon + link) and right-aligned Qs badge */
.admin-table .cell-invite {
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-table .cell-invite .badge-qs {
  margin-left: auto;
}
/* Fixed-width columns */
.admin-table .col-uploads { width: 7ch; text-align: center; font-variant-numeric: tabular-nums; }
.admin-table .col-completed { width: 8ch; text-align: center; }

/* Smaller buttons within the Invites table only */
.invites-table button {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
}

/* Icon-only copy button in invites table */
.invites-table .btn-icon {
  padding: 4px 6px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.invites-table .btn-icon svg { display: block; }

/* Settings form layout */
#settingsCard #settingsForm { margin-top: 12px; }
.settings-tabs { margin-bottom: 8px; }
.settings-form { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.settings-form .form-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 10px;
}

/* Landing page */
.landing-page {
  background: radial-gradient(circle at top left, rgba(79, 93, 117, 0.12), transparent 55%),
    radial-gradient(circle at bottom right, rgba(17, 24, 39, 0.14), transparent 60%),
    #f7f9fc;
  min-height: 100vh;
  color: #0b132b;
}

.landing-hero {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.94), rgba(55, 65, 81, 0.82));
  color: #f9fafb;
  padding: 80px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
}

.landing-hero__content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.landing-hero__eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: rgba(236, 253, 245, 0.85);
}

.landing-hero__title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
}

.landing-hero__subtitle {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(241, 245, 249, 0.9);
}

.landing-hero__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: #22c55e;
  color: #052e16;
  text-decoration: none;
  border-radius: 9999px;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
}

.landing-hero__cta:hover,
.landing-hero__cta:focus {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(34, 197, 94, 0.45);
}

.landing-main {
  padding: 48px 0 64px;
}

.landing-intro {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 32px;
}

.landing-intro__card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.landing-intro__card h2,
.landing-intro__card h3 {
  margin-top: 0;
  color: #0b132b;
}

.landing-intro__card ul {
  padding-left: 20px;
  margin: 12px 0 0;
  color: #1f2937;
  line-height: 1.5;
}

.landing-form__card {
  max-width: 720px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.landing-form__lead {
  margin-top: 0;
  color: #4f5d75;
  font-size: 1.05rem;
}

.landing-form__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.landing-form__field label {
  font-weight: 600;
  color: #111827;
}

.landing-form__field input,
.landing-form__field textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.landing-form__field input:focus,
.landing-form__field textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.landing-form__field small {
  color: #6b7280;
  font-size: 0.85rem;
}

.landing-form__actions {
  display: flex;
  justify-content: flex-start;
}

.landing-form__actions button {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-color: transparent;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 9999px;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.35);
}

.landing-form__actions button:hover,
.landing-form__actions button:focus {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(22, 163, 74, 0.45);
}

.landing-footer {
  padding: 32px 0 48px;
  color: #6b7280;
  text-align: center;
}

.status-success {
  color: #047857;
}

.status-error {
  color: #b91c1c;
}

@media (max-width: 720px) {
  .landing-hero {
    padding: 64px 20px;
  }

  .landing-hero__cta {
    width: 100%;
    text-align: center;
  }

  .landing-form__card {
    padding: 20px;
  }
}
.settings-form .form-row label { 
  margin: 0; 
  font-weight: 600; 
  color: #374151; 
  text-align: right;
}
.settings-form .form-row input[type="text"],
.settings-form .form-row input[type="number"],
.settings-form .form-row input[list] {
  width: 100%;
  padding: 8px; 
  border: 1px solid #d1d5db; 
  border-radius: 6px; 
  background: #fff;
}
.settings-form .form-row input[type="checkbox"] { justify-self: start; }

@media (max-width: 700px) {
  .settings-form { max-width: 100%; }
  .settings-form .form-row { grid-template-columns: 1fr; }
  .settings-form .form-row label { text-align: left; }
}

/* Transcript UI */
.transcript-block { margin-top: 8px; }
.transcript { white-space: pre-wrap; background: #f3f4f6; border: 1px solid #e5e7eb; padding: 10px; border-radius: 8px; max-height: 200px; overflow: auto; }
.transcript-input { width: 100%; min-height: 120px; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; resize: vertical; }
.stt-status { color: #6b7280; }

/* Loading popup overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.loading-popup {
  background: white;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 400px;
  width: 90%;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e5e7eb;
  border-top: 4px solid #111827;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}

.loading-subtext {
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.4;
}

/* Consent UI */
.consent-text { font-size: 0.95rem; color: #1f2937; line-height: 1.55; display: flex; flex-direction: column; gap: 0.75rem; }
.consent-text p { margin: 0; }
.consent-text ul { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.5rem; }
.consent-text li { margin: 0; }
.consent-text a { color: #0b5ed7; text-decoration: underline; }
/* Screen-reader only utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Interview Recorder: Sidebar layout */
.record-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.record-content { flex: 1; }
.sidebar {
  width: 220px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 16px;
}
.sidebar-title {
  font-weight: 700;
  color: #374151;
  font-size: 0.95rem;
  margin-bottom: 8px;
}
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-item {
  width: 100%;
  text-align: left;
  background: #f9fafb;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.sidebar-item:hover { background: #f3f4f6; }
.sidebar-item.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}
/* Treat locked and disabled items the same visually (but only .locked blocks pointer events) */
.sidebar-item.locked,
.sidebar-item[disabled] {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: default;
}
/* Only the custom .locked state should suppress pointer events */
.sidebar-item.locked { pointer-events: none; }
/* Suppress focus visuals for non-interactive sidebar items */
.sidebar-item.locked:focus-visible,
.sidebar-item[disabled]:focus-visible {
  box-shadow: none;
  outline: none;
  background: #f3f4f6;
  border-color: #e5e7eb;
}
/* Override global button:disabled opacity for consistent look with .locked */
.sidebar-item[disabled] { opacity: 1; }
/* Keyboard focus styles for accessibility */
.sidebar-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45); /* blue ring */
  border-color: #2563eb;
  background: #eef2ff;
}
.sidebar-item.active:focus-visible {
  /* keep active contrast while showing focus */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.45);
}
/* Follow-up sub-items */
.sidebar-sublist {
  list-style: none;
  padding-left: 14px;
  margin: 6px 0 0 8px;
  border-left: 2px dashed #e5e7eb;
}
.sidebar-subitem {
  font-size: 0.86rem;
  color: #374151;
  background: transparent;
  padding: 4px 0 4px 8px;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
}
.sidebar-subitem.active {
  color: #111827;
  font-weight: 700;
}
.sidebar-subitem:hover { background: #f3f4f6; }
/* Treat locked and disabled subitems the same visually (but only .locked blocks pointer events) */
.sidebar-subitem.locked,
.sidebar-subitem[disabled] {
  color: #9ca3af;
  cursor: default;
  background: transparent;
  border: none;
}
/* Only the custom .locked state should suppress pointer events */
.sidebar-subitem.locked { pointer-events: none; }
/* Override global button:disabled opacity for consistent look with .locked */
.sidebar-subitem[disabled] { opacity: 1; }
/* Suppress focus visuals for non-interactive subitems */
.sidebar-subitem.locked:focus-visible,
.sidebar-subitem[disabled]:focus-visible {
  box-shadow: none;
  outline: none;
  background: transparent;
}
/* Focus styles for subitems */
.sidebar-subitem:focus-visible {
  outline: none;
  background: #eef2ff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35);
  color: #111827;
}

.question-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .record-layout { flex-direction: column; }
  .sidebar { position: static; width: auto; }
  .sidebar-list { flex-direction: row; flex-wrap: wrap; }
  .sidebar-item { flex: 1 1 120px; }
}

/* Invite Details toolbar */
.details-toolbar {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
}
.details-toolbar .badge { font-weight: 700; }
.details-toolbar .toolbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
@media (max-width: 700px) {
  .details-toolbar { flex-wrap: wrap; }
  .details-toolbar .toolbar-actions { width: 100%; justify-content: flex-end; }
}

/* Floating icon toolbar (Invite Details) */
.floating-toolbar {
  position: absolute;
  top: 44px; /* sit just beneath the close X (which is at top:12px) */
  right: 12px; /* align with the close X horizontal margin */
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
}
.floating-toolbar .toolbar-btn {
  padding: 6px 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.floating-toolbar .toolbar-btn .btn-label { margin-left: 6px; font-weight: 600; }
@media (max-width: 900px) {
  .floating-toolbar .toolbar-btn .btn-label { display: none; }
}
@media (max-width: 700px) {
  .floating-toolbar { right: 12px; gap: 6px; }
}

