/* Shared component colours: Bootstrap utilities must follow the selected theme. */
html[data-theme="dark"] {
  --bs-body-color: #e8eefb;
  --bs-body-color-rgb: 232,238,251;
  --bs-secondary-color: #adbcd0;
  --bs-secondary-color-rgb: 173,188,208;
  --bs-tertiary-color: #a2b2c8;
  --bs-emphasis-color: #f4f7ff;
  --bs-emphasis-color-rgb: 244,247,255;
  --bs-border-color: #32435d;
  --bs-body-bg: #0d1523;
  --bs-secondary-bg: #172438;
  --bs-tertiary-bg: #131e2e;
}
html[data-theme="dark"] .portal-user {
  --bs-btn-color: #e8eefb;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-color: #fff;
  color: #e8eefb;
}
html[data-theme="dark"] .portal-user:hover,
html[data-theme="dark"] .portal-user:focus-visible { background: #263952; }
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary { color: #adbcd0 !important; }
html[data-theme="dark"] .dash-tile small,
html[data-theme="dark"] .dash-tile em,
html[data-theme="dark"] .kpi-tile small,
html[data-theme="dark"] .kpi-tile em,
html[data-theme="dark"] .filter-bar .form-label { color: #adbcd0; }
html[data-theme="dark"] .dash-tile.current small,
html[data-theme="dark"] .dash-tile.current em { color: #d7e5ff; }
html[data-theme="dark"] .btn-outline-secondary {
  --bs-btn-color: #c4d1e3;
  --bs-btn-border-color: #7e93b0;
  --bs-btn-hover-bg: #2b405d;
  --bs-btn-hover-color: #fff;
}
/* Badges inside flex headers must hug their label rather than stretch vertically. */
.status-pill, .status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: .3rem .65rem;
  line-height: 1.25;
  white-space: nowrap;
  vertical-align: middle;
  border-radius: 999px;
}
html[data-theme="dark"] .status-pill { background: #26364e; color: #dbe7fa; }
html[data-theme="dark"] .status-pill.ok,
html[data-theme="dark"] .status-badge { background: #173f32; color: #a3ebbc; }
html[data-theme="dark"] .status-pill.warn { background: #49371a; color: #ffdb8a; }
html[data-theme="dark"] .status-pill.bad { background: #4a2430; color: #ffc1cb; }
/* Keep active workflow pills readable after the per-user theme rules. */
.portal-app .workflow-tabs .nav-link.active,
.portal-app .workflow-tabs .nav-link.active:hover,
.portal-app .workflow-tabs .nav-link.active:focus-visible {
  background: var(--portal-primary-strong, #214ac4);
  border-color: var(--portal-primary-strong, #214ac4) !important;
  color: #fff;
}
.portal-app .workflow-tabs .nav-link.active span {
  background: rgba(255,255,255,.2);
  color: #fff;
}
html[data-theme="dark"] .workflow-steps>.active,
html[data-theme="dark"] .workflow-steps>.current,
html[data-theme="dark"] .workflow-steps>.done { background: #18356a !important; color: #e4edff !important; }
html[data-theme="dark"] .workflow-steps>li>span,
html[data-theme="dark"] .workflow-steps>span>i { background: #294776; color: #fff; }
/* Transaction pages use compact, functional typography rather than marketing headings. */
.booknip-public .purchase-shell { padding: 24px 0 48px; }
.booknip-public .purchase-layout { gap: 24px; grid-template-columns: minmax(0,1fr) minmax(280px,360px); }
.booknip-public .purchase-main,
.booknip-public .purchase-summary { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel,#fff); box-shadow: 0 8px 24px rgba(20,45,85,.04); }
.booknip-public .purchase-main h1 { font-size: clamp(1.45rem,2.4vw,2rem); line-height: 1.2; margin: 8px 0 20px; overflow-wrap: anywhere; }
.booknip-public .purchase-main h2,
.booknip-public .purchase-summary h2 { font-size: 1.2rem; line-height: 1.35; margin: 0 0 16px; }
.booknip-public .purchase-summary { position: sticky; top: 104px; }
.booknip-public .purchase-summary .table { margin-bottom: 16px; }
.booknip-public .purchase-summary .table td { padding: 12px 0; font-size: .875rem; }
.booknip-public .purchase-summary .table td:last-child { padding-left: 16px; white-space: nowrap; }
.booknip-public .purchase-main .portal-form-card { box-shadow: none; padding: 20px; border-radius: 12px; }
.booknip-public .purchase-main .alert { font-size: .875rem; line-height: 1.6; }
@media(max-width:991px) {
  .booknip-public .purchase-layout { grid-template-columns: minmax(0,1fr); }
  .booknip-public .purchase-summary { position: static; }
}
@media(max-width:620px) {
  .booknip-public .purchase-shell { padding: 16px 0 32px; }
  .booknip-public .purchase-main,.booknip-public .purchase-summary { padding: 18px; }
}
html[data-theme="dark"] .workflow-tabs .nav-link:not(.active) span {
  background: #293d58;
  color: #e4edff;
}
html[data-theme="dark"] .portal-app .btn-primary {
  --bs-btn-bg: var(--portal-primary-strong, #214ac4);
  --bs-btn-border-color: var(--portal-primary-strong, #214ac4);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}
/* Support categories reserve separate columns for icon, copy and native radio. */
.support-option-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.support-option-grid label {
  display: grid;
  grid-template-columns: 22px minmax(0,1fr) 18px;
  align-items: start;
  gap: 10px;
  padding: 16px;
  margin: 0;
  min-width: 0;
  border: 1px solid var(--line,#dce5f2);
  border-radius: 12px;
  background: var(--panel,#fff);
}
.support-option-grid label>i { font-size: 20px; line-height: 1.3; }
.support-option-grid label>span { min-width: 0; }
.support-option-grid strong { font-size: 13px; line-height: 1.4; margin: 0 0 4px; color: var(--ink,#10203a); }
.support-option-grid small { font-size: 12px; line-height: 1.5; color: #60718a; overflow-wrap: break-word; }
.support-option-grid input[type="radio"] {
  appearance: auto;
  position: static;
  inset: auto;
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 2px 0 0;
  border: 0;
  border-radius: 50%;
  box-shadow: none;
  accent-color: #2454cc;
  cursor: pointer;
}
.support-option-grid label:has(input:checked) { background: #edf3ff; border-color: #2454cc; box-shadow: inset 0 0 0 1px #2454cc; }
.support-option-grid label:has(input:focus-visible) { outline: 3px solid #779eeb; outline-offset: 3px; }
html[data-theme="dark"] .support-option-grid label { background: #172438; border-color: #3b506e; }
html[data-theme="dark"] .support-option-grid strong { color: #edf3ff; }
html[data-theme="dark"] .support-option-grid small { color: #bdcbe0; }
html[data-theme="dark"] .support-option-grid label:has(input:checked) { background: #1b3560; border-color: #88b0ff; box-shadow: inset 0 0 0 1px #88b0ff; }
html[data-theme="dark"] .support-option-grid input[type="radio"] { accent-color: #9bbfff; }
@media(max-width:991px) { .support-option-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:480px) { .support-option-grid { grid-template-columns: minmax(0,1fr); } }
html[data-theme="dark"] .support-modal .form-label { color: #c4d1e3; }
html[data-theme="dark"] .support-option-grid label>i { color: #9bbfff; }
html[data-theme="dark"] .support-modal .btn-close { filter: invert(1) grayscale(1) brightness(1.8); opacity: .85; }
/* Compact desktop typography and spacing; keep browser zoom and user font scaling. */
@media(min-width:992px) {
  .booknip-public { font-size: 1rem; line-height: 1.55; }
  .booknip-public h1 { font-size: clamp(2rem,3vw,2.75rem); line-height: 1.14; letter-spacing: -.035em; }
  .booknip-public h2 { font-size: clamp(1.6rem,2.2vw,2.125rem); line-height: 1.2; letter-spacing: -.025em; }
  .booknip-public h3 { font-size: 1.25rem; line-height: 1.3; letter-spacing: -.015em; }
  .booknip-public h4 { font-size: 1.0625rem; line-height: 1.4; }
  .booknip-public .header { height: 70px; }
  .booknip-public .header .btn { padding: 10px 18px; font-size: .875rem; }
  .booknip-public .hero {
    /* Utility bar + navigation + services strip occupy about 147px.
       Fill the remaining first screen, expanding naturally when content needs it. */
    min-height: calc(100svh - 147px);
    padding-top: 48px;
    padding-bottom: 48px;
    gap: 40px;
    grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr);
    align-items: center;
  }
  .booknip-public .hero h1 {
    font-size: clamp(2.5rem,4vw,3.75rem);
    line-height: 1.08;
    letter-spacing: -.04em;
    max-width: 650px;
    margin: 12px 0 16px;
    text-wrap: balance;
  }
  .booknip-public .hero-intro,
  .booknip-public .hero-intro p { font-size: 1rem; line-height: 1.6; max-width: 620px; margin-bottom: 0; }
  .booknip-public .hero .actions { margin: 28px 0 32px; gap: 12px; flex-wrap: wrap; }
  .booknip-public .hero .btn { padding: 11px 18px; font-size: .875rem; }
  .booknip-public .hero .btn.ghost { background: transparent; color: var(--text); border-color: var(--line); box-shadow: none; }
  .booknip-public .hero .stats { gap: 26px; font-size: .6875rem; line-height: 1.35; }
  .booknip-public .hero .stats b { font-size: 1.375rem; line-height: 1.3; }
  .booknip-public .hero-art { width: 100%; max-width: 420px; height: clamp(320px,44vh,460px); justify-self: center; }
  .booknip-public .hero-art .core { width: min(280px,75%); padding: 22px; }
  .booknip-public .hero-art .core strong { font-size: 1.5rem; }
  .booknip-public .ticker { padding-top: 12px; padding-bottom: 12px; font-size: .875rem; line-height: 1.4; }
  .booknip-public .section { padding-top: 60px; padding-bottom: 60px; }
  .booknip-public .section-head { margin-bottom: 28px; }
  .booknip-public .section-head h2 { margin: 10px 0 14px; }
  .booknip-public .section-head p,
  .booknip-public .page-hero p,
  .booknip-public .contact>div p { font-size: 1rem; line-height: 1.6; }
  .booknip-public .page-hero { min-height: 0; padding-top: 44px; padding-bottom: 44px; }
  .booknip-public .page-hero h1 { font-size: clamp(2rem,3.5vw,3rem); max-width: 850px; margin: 12px 0 16px; }
  .booknip-public .marketplace-banner { padding-top: 40px; padding-bottom: 40px; }
  .booknip-public .marketplace-copy h2 { font-size: clamp(1.6rem,2.5vw,2.25rem); }
  .booknip-public .band { padding-top: 48px; padding-bottom: 48px; }
  .booknip-public .band h2 { font-size: clamp(1.75rem,2.8vw,2.5rem); }
  .booknip-public .commerce-content .page-shell { padding-top: 28px; padding-bottom: 44px; }
  .booknip-public .catalog-hero,.booknip-public .app-detail-hero { padding-top: 32px; padding-bottom: 40px; }
  .booknip-public .purchase-shell { padding-top: 20px; }
  .portal-app .portal-content { padding-top: 24px; }
  .portal-app .portal-page-heading { margin-bottom: 20px; }
  .portal-app .portal-page-heading h1 { font-size: 1.875rem; line-height: 1.2; }
  .portal-app .portal-page-heading p { font-size: .9375rem; line-height: 1.5; }
}
