html,
body {
  height: 100%;
}

body {
  background: #ffffff;
}

.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
}

.auth-card {
  width: 560px;
  max-width: calc(100vw - 36px);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 14px;
  padding: 18px;
  box-shadow:
    0 26px 70px rgba(0,0,0,0.08),
    0 8px 22px rgba(0,0,0,0.05);
}

.auth-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.auth-title {
  margin: 0;
  font-size: 20px;
  color: #1f2a44;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  background: #0078d4;
  border-color: #0078d4;
  color: #fff;
}

.auth-panel.hidden {
  display: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.auth-field label {
  font-size: 13px;
  color: #4b5563;
  font-weight: 600;
}

.auth-field input {
  border: 1px solid rgba(0,0,0,0.18);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(42, 77, 143, 0.55);
  box-shadow: 0 0 0 3px rgba(42, 77, 143, 0.14);
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap input {
  width: 100%;
  box-sizing: border-box;
  padding-right: 4.25rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  margin: 0;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: #374151;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.auth-password-toggle:hover {
  background: #f3f4f6;
  border-color: rgba(42, 77, 143, 0.35);
}

.auth-password-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(42, 77, 143, 0.2);
}

.auth-message {
  display: none;
  margin: 10px 0 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  border: 1px solid rgba(0,0,0,0.10);
  white-space: pre-line;
}

.auth-message[data-type="error"] {
  background: rgba(220, 53, 69, 0.08);
  border-color: rgba(220, 53, 69, 0.30);
  color: #8a1f2c;
}

.auth-message[data-type="success"] {
  background: rgba(40, 167, 69, 0.08);
  border-color: rgba(40, 167, 69, 0.28);
  color: #1f6b35;
}

.auth-confirm-block {
  margin: -6px 0 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.10);
  background: rgba(0, 120, 212, 0.06);
  color: #1f2a44;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-confirm-block a {
  color: #0078d4;
  text-decoration: none;
  word-break: break-all;
}

.auth-confirm-block a:hover {
  text-decoration: underline;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.pill-btn {
  border-radius: 999px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

a.pill-btn {
  display: inline-block;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  text-align: center;
}

/* Blue underlined label inside the pill; keep same color on :visited */
.pill-btn--link .pill-btn__link {
  color: #0078d4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

a.pill-btn--link,
a.pill-btn--link:visited {
  color: inherit;
}

a.pill-btn--link .pill-btn__link,
a.pill-btn--link:visited .pill-btn__link,
a.pill-btn--link:link .pill-btn__link {
  color: #0078d4;
}

button.pill-btn--link {
  color: inherit;
}

button.pill-btn--link .pill-btn__link {
  color: #0078d4;
}

.pill-btn.primary {
  border-color: #0078d4;
  background: #0078d4;
  color: #fff;
}

.auth-inline-links {
  font-size: 14px;
  font-weight: 700;
}

.auth-inline-link {
  color: #0078d4;
  text-decoration: none;
}

.auth-inline-link:hover {
  text-decoration: underline;
}

.auth-inline-sep {
  color: #6b7280;
  margin: 0 8px;
  font-weight: 700;
}

/* ============================================================
   Index landing header — actions + settings gear
============================================================ */
.index-header {
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.index-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.index-header__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
  flex-shrink: 0;
}

.index-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.index-header__nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: flex-end;
  font-size: 14px;
}

.index-header__nav-sep {
  color: var(--text-muted, #9ca3af);
  user-select: none;
}

.index-header__nav-link {
  color: var(--text, #1f2937);
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 0 0 2px;
  background: none;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 -2px 0 0 transparent;
}

.index-header__nav-link:hover {
  color: var(--text, #1f2937);
  text-decoration: none;
  box-shadow: inset 0 -2px 0 0 color-mix(in srgb, var(--accent, #2a4d8f) 45%, transparent);
}

.index-header__nav-link[aria-current="page"] {
  color: var(--accent, #2a4d8f);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 -2px 0 0 var(--accent, #2a4d8f);
}

.index-header__nav-link--btn.hidden {
  display: none;
}

/* Screen-reader page title when logo-adjacent h1 was removed */
.bb-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Site footer nav (index, Cockpit, help) */
.index-footer {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 20px;
}

.index-footer__copy {
  color: var(--text-muted, #475569);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

a.index-footer__copy:hover {
  color: var(--accent);
  text-decoration: underline;
}

.index-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.index-footer__nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.index-footer__nav a:hover {
  text-decoration: underline;
}

.index-footer__nav a[aria-current="page"] {
  color: var(--text, #1f2937);
  text-decoration: underline;
}

.index-footer__nav a.index-footer__support {
  color: color-mix(in srgb, var(--accent, #2a4d8f) 88%, #059669);
}

.index-footer__support-group {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.index-footer__nav .index-footer__alpha-sticker {
  font-size: 0.58rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.1em;
  transform: rotate(-2deg) scale(0.92);
  transform-origin: center center;
}

button.mode-bar-alpha-sticker,
button.index-footer__alpha-sticker,
a.mode-bar-alpha-sticker,
a.index-footer__alpha-sticker {
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
}

button.mode-bar-alpha-sticker:hover,
button.index-footer__alpha-sticker:hover,
a.mode-bar-alpha-sticker:hover,
a.index-footer__alpha-sticker:hover {
  filter: brightness(1.05);
}

button.mode-bar-alpha-sticker:focus-visible,
button.index-footer__alpha-sticker:focus-visible,
a.mode-bar-alpha-sticker:focus-visible,
a.index-footer__alpha-sticker:focus-visible {
  outline: 2px solid #b45309;
  outline-offset: 2px;
}

/* Founding Member Alpha — read-more overlay (index + cockpit) */
.founding-alpha-modal {
  z-index: 100000;
}

body.founding-alpha-modal-open {
  overflow: hidden;
}

.founding-alpha-card.modal-content.dialog-card {
  width: min(640px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
}

.founding-alpha-header {
  margin-bottom: 0;
}

.founding-alpha-body {
  margin: 0;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.58;
  color: #374151;
}

.founding-alpha-body p {
  margin: 0 0 12px;
}

.founding-alpha-lead {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.founding-alpha-perks {
  margin: 0 0 12px 1.1em;
  padding: 0;
}

.founding-alpha-perks li {
  margin: 0 0 8px;
}

.founding-alpha-perks li:last-child {
  margin-bottom: 0;
}

.founding-alpha-closing {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
}

.founding-alpha-actions {
  flex-wrap: wrap;
  gap: 8px;
}

.index-landing-hint {
  margin: 14px auto 0;
  max-width: 640px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #4b5563;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  text-align: left;
}

.auth-panel-footer {
  margin: 14px 0 0;
  font-size: 13px;
  color: #6b7280;
}

.auth-text-btn {
  margin: 0;
  padding: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #0078d4;
  cursor: pointer;
  text-decoration: underline;
}

.auth-text-btn:hover {
  color: #005a9e;
}

/* Sign-in modal — alpha test header */
.auth-dialog-header {
  align-items: flex-start;
}

.auth-dialog-header-main {
  align-items: flex-start;
}

.auth-dialog-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.auth-alpha-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  margin: 0;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #92400e;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fcd34d;
  box-shadow: 0 1px 2px rgba(146, 64, 14, 0.12);
}

.auth-dialog-heading h2 {
  margin: 2px 0 0;
}

.auth-alpha-note {
  margin: 2px 0 0;
  max-width: 36em;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: #4b5563;
}

.auth-dialog-card.modal-content.dialog-card {
  width: min(580px, calc(100vw - 36px));
}

/* Session expired re-auth (shared hosting idle timeout) — above system dialogs */
.bb-session-expired-modal {
  z-index: 100260;
}

body.bb-session-expired-open {
  overflow: hidden;
}

.bb-session-expired-card.modal-content.dialog-card {
  width: min(480px, calc(100vw - 36px));
  border: 2px solid color-mix(in srgb, #dc2626 55%, var(--border, #cbd5e1));
  box-shadow: 0 12px 40px rgba(153, 27, 27, 0.18);
}

.bb-session-expired-card #bbSessionExpiredTitle {
  color: #991b1b;
}

.bb-session-expired-lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text, #1f2937);
}

.bb-session-expired-msg {
  min-height: 1.25em;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.bb-session-expired-msg--error {
  color: #b91c1c;
}

.bb-session-expired-msg--ok {
  color: #0f766e;
}

.bb-session-expired-form .auth-field {
  margin-bottom: 10px;
}

.bb-session-expired-actions {
  margin-top: 4px;
}

.bb-session-expired-foot {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted, #64748b);
}

.bb-session-restored-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(120%);
  z-index: 100060;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #0f766e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.bb-session-restored-toast--show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Post-sign-in alpha terms (blocking) */
.alpha-terms-modal {
  z-index: 100001;
}

body.alpha-terms-modal-open {
  overflow: hidden;
}

.alpha-terms-card.modal-content.dialog-card {
  width: min(620px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
}

.alpha-terms-header {
  margin-bottom: 0;
}

.alpha-terms-body {
  margin: 0;
  max-height: min(42vh, 340px);
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
}

.alpha-terms-body p {
  margin: 0 0 10px;
}

.alpha-terms-body ul {
  margin: 0 0 10px;
  padding-left: 1.25rem;
}

.alpha-terms-body li {
  margin-bottom: 8px;
}

.alpha-terms-body li:last-child {
  margin-bottom: 0;
}

.alpha-terms-foot {
  font-size: 12px;
  color: #6b7280;
}

.alpha-terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 120, 212, 0.05);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #1f2a44;
  cursor: pointer;
  user-select: none;
}

.alpha-terms-agree input {
  margin-top: 3px;
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
  accent-color: #0078d4;
  cursor: pointer;
}

.alpha-terms-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.alpha-terms-actions .pill-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Cockpit / inner pages — text links in mode bar (less chrome than pill buttons) */
.mode-bar-text-sep {
  color: var(--text-muted, #94a3b8);
  user-select: none;
  font-size: 13px;
}

.mode-bar-text-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #0078d4);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: 4px;
}

.mode-bar-text-link:hover {
  text-decoration: underline;
}

.mode-bar-text-link--btn {
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent, #0078d4);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}

.mode-bar-text-link--btn:hover {
  text-decoration: underline;
}

.app-trial-notice {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: #5c4a24;
  background: #fff8e6;
  border-bottom: 1px solid #f0d090;
  text-align: center;
}

.app-trial-notice a {
  color: #0078d4;
  font-weight: 600;
}

html[data-bizbarrel-signed-in="true"] .app-trial-notice {
  display: none;
}

html[data-theme="dark"] .app-trial-notice,
html[data-theme="soft"] .app-trial-notice {
  color: #e7e1d4;
  background: rgba(251, 191, 36, 0.12);
  border-bottom-color: rgba(251, 191, 36, 0.28);
}

html[data-theme="dark"] .app-trial-notice a,
html[data-theme="soft"] .app-trial-notice a {
  color: #93c5fd;
}

.header,
.index-header,
.public-forums-header {
  position: relative;
  z-index: 100100;
}

.index-header__settings,
.inner-nav-settings {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}

.public-forums-header__account {
  position: relative;
  z-index: 2;
}

.header-dropdown__username {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: #1f2a44;
  line-height: 1.35;
  word-break: break-word;
}

html[data-theme="dark"] .header-dropdown__username,
html[data-theme="soft"] .header-dropdown__username {
  color: var(--text);
}

.gear-icon-btn,
.account-menu-btn {
  border: 1px solid #ccc;
  border-radius: 999px;
  background: #f8f8f8;
  padding: 6px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f2a44;
  line-height: 0;
}

.account-menu-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  overflow: hidden;
}

.account-menu-btn__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

.account-menu-btn--has-avatar .account-menu-btn__gear {
  display: none;
}

.gear-icon-btn:hover {
  background: #f0f0f0;
}

html[data-theme="dark"] .gear-icon-btn,
html[data-theme="soft"] .gear-icon-btn {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="dark"] .gear-icon-btn:hover,
html[data-theme="soft"] .gear-icon-btn:hover {
  background: #2a2f3a;
}

.mode-bar .mode-bar-nav-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Match anchor and button pill labels (anchors default to higher baseline than buttons) */
.mode-bar .pill-btn.mode-bar-nav-btn,
.mode-bar a.pill-btn.mode-bar-nav-btn,
.mode-bar button.pill-btn.mode-bar-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  min-height: 32px;
  box-sizing: border-box;
}

/* Cockpit mode bar: keep display/theme/sticky left of a flex fill; account + gear flush right */
.mode-bar-middle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mode-bar-fill {
  flex: 1;
  min-width: 0;
}

.mode-bar-account {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mode-inline-tip {
  position: absolute;
  z-index: 1200;
  max-width: min(360px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
  font-size: 12px;
  line-height: 1.35;
}

.mode-inline-tip__close {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.mode-inline-tip__close:hover {
  background: #e2e8f0;
}

html[data-theme="dark"] .mode-inline-tip,
html[data-theme="soft"] .mode-inline-tip {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .mode-inline-tip__close,
html[data-theme="soft"] .mode-inline-tip__close {
  background: var(--surface-muted);
  border-color: var(--border);
  color: var(--text);
}

.gear-icon-btn__svg {
  display: block;
}

.header-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  z-index: 100200;
  padding: 6px 0;
}

html[data-theme="dark"] .header-dropdown,
html[data-theme="soft"] .header-dropdown {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.header-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  font-size: 14px;
  cursor: pointer;
  color: #1f2a44;
  text-decoration: none;
  font-family: inherit;
  font-weight: 600;
  box-sizing: border-box;
}

a.header-dropdown__item {
  color: #1f2a44;
}

.header-dropdown__item:hover {
  background: rgba(0, 120, 212, 0.08);
}

html[data-theme="dark"] .header-dropdown__item,
html[data-theme="soft"] .header-dropdown__item,
html[data-theme="dark"] a.header-dropdown__item,
html[data-theme="soft"] a.header-dropdown__item {
  color: var(--text);
}

html[data-theme="dark"] .header-dropdown__item:hover,
html[data-theme="soft"] .header-dropdown__item:hover {
  background: rgba(138, 180, 248, 0.12);
}

.header-dropdown__item--sign-out {
  color: #b91c1c;
}

html[data-theme="dark"] .header-dropdown__item--sign-out,
html[data-theme="soft"] .header-dropdown__item--sign-out {
  color: #fca5a5;
}

.header-dropdown__item--sign-out:hover {
  background: rgba(185, 28, 28, 0.08);
}

html[data-theme="dark"] .header-dropdown__item--sign-out:hover,
html[data-theme="soft"] .header-dropdown__item--sign-out:hover {
  background: rgba(127, 29, 29, 0.35);
}

