/* Brand tokens and Tabler mappings. */
:root {
  --brand: #714B67;
  --brand-dark: #4c2e43;
  --teal: #00A09D;
  --day: #f0b429;
  --amber: #f0b429;
  --eve: #4A90D9;
  --night: #5B5F97;
  --bg: #f4f2f5;
  --app-bg: #f4f2f5;
  --card: #ffffff;
  --line: #ebe7eb;
  --card-border: #ebe7eb;
  --ink: #241c22;
  --inverse: #ffffff;
  --muted: rgba(76, 46, 67, 0.65);
  --brand-soft: rgba(113, 75, 103, 0.08);
  --brand-tint: rgba(113, 75, 103, 0.11);
  --tblr-primary: var(--brand);
  --tblr-primary-rgb: 113, 75, 103;
  --tblr-border-color: var(--card-border);
  --tblr-body-color: var(--ink);
  /* Feedback colors. The light values are the ones the templates used inline
     before; a dark theme overrides them so alert text and panels keep
     contrast on dark surfaces. */
  --ok: #2a9d8f;
  --ok-strong: #006f6d;
  --added: #080;
  --danger: #c00;
  --danger-line: #e00;
  --danger-bg: #fff0f0;
  --danger-soft: rgba(231, 111, 81, 0.13);
  --warn: #a60;
  --warn-line: #e9c46a;
  --warn-bg: #fff8e6;
  --warn-soft: rgba(233, 196, 106, 0.13);
  --pending: #e76f51;
  --neutral: #999;
  --overlay: rgba(0, 0, 0, 0.53);
  /* Focus ring drawn on a brand-filled surface (active nav dot). */
  --ring: rgba(255, 255, 255, 0.35);
}

body { font-size: 0.92rem; }

/* Tabler application shell */
.page { min-height: 100vh; background: var(--bg); }
.app-sidebar {
  position: fixed;
  inset-block: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  /* Tabler's .navbar sets flex-wrap:wrap + align-items:center +
     justify-content:space-between; all three fight a column sidebar:
     wrap pushes the nav into a second column beside the brand, and
     space-between wedges leftover height between brand and nav. */
  flex-wrap: nowrap;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  width: 15rem;
  padding: 1rem 0.75rem;
  overflow-y: auto;
  background: var(--card);
  border-right: 1px solid var(--card-border);
  box-shadow: none;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}
.app-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.app-sidebar .navbar-brand {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}
.app-sidebar .navbar-brand::before {
  content: '';
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.45rem;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 0.25rem var(--brand-tint);
}
.app-sidebar-toggle-input { display: none; }
.app-sidebar .navbar-toggler { border: 0; }
#app-sidebar-toggle:checked ~ .app-sidebar { transform: translateX(0); }
.app-sidebar-nav {
  --tblr-nav-link-padding-y: 0.45rem;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.125rem;
}
/* Tabler's .nav-item adds padding/margin on top of the link's own padding;
   zero it so every row (top level and submenu) starts on the same line. */
.app-sidebar-nav li,
.app-sidebar-nav details {
  width: 100%;
  padding: 0;
  margin: 0;
}
/* (0,3,1): outranks Tabler's .navbar .navbar-nav .nav-link which centers
   link content in navbars; sidebar rows must start on one vertical line. */
.navbar-vertical.app-sidebar .app-sidebar-nav a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-inline-start: 0.35rem;
  gap: 0.5rem;
  border-radius: 0.45rem;
  color: var(--ink);
  font-weight: 500;
}
.app-sidebar-nav a:hover,
.app-sidebar-nav a:focus,
.app-sidebar-nav summary:hover,
.app-sidebar-nav summary:focus {
  background: var(--brand-soft);
  color: var(--ink);
}
.app-sidebar-nav a.active,
.app-sidebar-nav a[aria-current='page'] {
  background: var(--brand);
  color: var(--inverse);
  font-weight: 650;
}
.app-sidebar-nav a.active .nav-dot { box-shadow: 0 0 0 0.15rem var(--ring); }
.app-nav-heading {
  margin: 0.85rem 0.35rem 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-dot {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--nav-dot-color, var(--brand));
}
.nav-dot-teal { --nav-dot-color: var(--teal); }
.nav-dot-amber { --nav-dot-color: var(--day); }
.nav-dot-eve { --nav-dot-color: var(--eve); }
.nav-dot-night { --nav-dot-color: var(--night); }
.app-sidebar-nav summary {
  display: block;
  cursor: pointer;
  list-style: none;
  padding-inline-start: 0.35rem;
  user-select: none;
}
.app-sidebar-nav summary::-webkit-details-marker { display: none; }
.app-sidebar-nav summary::marker { content: ''; }
.app-sidebar-nav summary::after {
  content: '⋯';
  float: right;
  color: var(--tblr-secondary, #6c7a91);
}
.app-nav-dropdown-menu {
  display: none;
  /* 0.3rem margin + 1px border puts submenu dots on the same start line
     as top-level items (0.35rem padding). */
  margin: 0.125rem 0 0.375rem 0.3rem;
  border-left: 1px solid var(--tblr-border-color, #e6e7e9);
}
.app-nav-dropdown[open] > .app-nav-dropdown-menu { display: flex; }
.navbar-vertical.app-sidebar .app-nav-dropdown-menu .nav-link { padding-inline-start: 0; }
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-topbar {
  position: relative;
  z-index: 1040;
  min-height: 3.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
}
.app-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.app-nav-user {
  max-width: 24rem;
  overflow: hidden;
  color: var(--tblr-secondary, #6c7a91);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.page-body {
  flex: 1 1 auto;
  width: 100%;
  padding-top: 1.25rem;
}
.app-footer {
  margin-top: 2rem;
  padding: 1rem 0;
  background: transparent;
}
.app-footer-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.app-footer-inner > small:nth-child(2) {
  flex: 1 1 auto;
  text-align: center;
}
.auth-page {
  min-height: calc(100vh - 8rem);
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-card {
  width: 100%;
  max-width: 28rem;
  margin: 0;
}
.auth-card .card-title { margin-bottom: 0.25rem; }
.auth-card .card-subtitle {
  margin-bottom: 1.5rem;
  color: var(--tblr-secondary, #6c7a91);
}
.page-initials {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--brand);
  color: var(--inverse);
  font-weight: 700;
}
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.page-header {
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 0.85rem;
}
.page-title {
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 750;
  margin-bottom: 0.15rem;
}
.page-description { color: var(--muted); margin-bottom: 0; }
.card {
  border-color: var(--card-border);
  border-radius: 0.7rem;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(76, 46, 67, 0.04);
}
.card-header {
  color: var(--brand-dark);
  font-weight: 650;
}
.table thead th {
  color: var(--brand-dark);
  font-size: 0.76rem;
  text-transform: uppercase;
}
.table td,
.table th { vertical-align: middle; }
.badge { font-weight: 600; }
.bg-brand { background: var(--brand); }
.bg-brand-lt { background: var(--brand-tint); color: var(--brand-dark); }
.text-brand { color: var(--brand); }

/* Data-table helpers missing from Tabler's compiled dist: keep every cell on
   one line (.table-responsive handles overflow) and center rows vertically. */
.table-nowrap th,
.table-nowrap td { white-space: nowrap; }
.table-vcenter th,
.table-vcenter td { vertical-align: middle; }
.table-compact { font-size: 0.82rem; }
.table-compact th,
.table-compact td { padding: 0.4rem 0.5rem; }
/* Explicit table-cell buttons remain flush with compact table rows. */
.table-compact td .btn,
.table-compact td .btn.active { margin: 0; }

/* Nurse dialog picker boxes: fixed base height but user-resizable so the
   visible info area adapts; min keeps at least a few rows visible. */
.picker-box {
  min-height: 7.5rem;
  height: 9rem;
  resize: vertical;
  overflow-y: auto;
  border: 1px solid var(--card-border);
  border-radius: 0.45rem;
  background: var(--card);
}
select.picker-box { resize: vertical; }

/* Draggable dialogs: grab the header (grip hints the affordance). base.js
   applies the drag offset as a transform and clears it on reopen. */
.dialog-drag-handle { cursor: move; user-select: none; touch-action: none; }
.dialog-drag-handle .drag-grip { margin-right: 0.45rem; opacity: 0.5; }
/* Native modals must clear the fixed topbar (z 1040) or their title bar —
   the drag handle — sits underneath it. */
dialog[open] { z-index: 1060; }
/* Responsive auto-fit grid for older classless forms. Explicit
   grid-template-columns in templates still win via inline style. */
.grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Classless form fallbacks for older templates that predate explicit
   Tabler form classes. Low-specificity element selectors let .form-control
   and .form-select keep priority. */
label:has(> input:not([type='checkbox'], [type='radio'])),
label:has(> select),
label:has(> textarea) {
  display: block;
  width: 100%;
}
label:has(> input[type='checkbox']), label:has(> input[type='radio']) { width: auto; }
input:not([type='checkbox'], [type='radio'], [type='button'], [type='submit'], [type='reset']),
select,
textarea {
  display: block;
  width: 100%;
  margin: 0;
  /* Match Tabler's .form-control/.form-select vertical rhythm (0.5625rem)
     so classless selects and text inputs render the same height. */
  padding: 0.5625rem 1rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.4rem;
  color: var(--ink);
  font: inherit;
}
select:not(.form-select, .form-control) {
  /* Keep room for the native arrow, as Tabler's .form-select does. */
  padding-right: 3rem;
  /* Chrome ignores line-height on native selects entirely, so equal heights
     need an explicit height: inherited leading (1.4286em) + vertical padding
     (2 * 0.5625rem) + borders (2px), mirroring what text inputs compute. */
  height: calc(1.4286em + 1.125rem + 2px);
}

.quick-card {
  display: grid;
  align-content: start;
  gap: 0.45rem;
  padding: 1rem;
}
.quick-card:hover,
.quick-card:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 14px rgba(76, 46, 67, 0.1);
}
.quick-icon {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 0.65rem;
  color: var(--inverse);
  font-weight: 700;
}
.quick-icon-brand { background: var(--brand); }
.quick-icon-eve { background: var(--eve); }
.quick-icon-teal { background: var(--teal); }
.quick-icon-night { background: var(--night); }
.quick-title { color: var(--brand-dark); font-size: 1rem; font-weight: 700; }
.quick-description { color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.application-card { max-width: 52rem; }
.form-grid {
  display: grid;
  gap: 0.75rem;
  align-items: end;
}
.preference-form-scroll { overflow-x: auto; }
.preference-form {
  display: grid;
  grid-template-columns:
    minmax(8.5rem, 1fr)
    minmax(8rem, 1.4fr)
    minmax(5rem, 0.8fr)
    minmax(4.5rem, 0.6fr)
    auto;
  gap: 0.75rem;
  align-items: start;
  min-width: max(100%, 23rem);
}
.preference-form > label {
  min-width: 0;
  white-space: nowrap;
}
.preference-form input,
.preference-form select {
  min-width: 0;
  height: 2.25rem;
}
.preference-form .btn {
  align-self: end;
  height: 2.25rem;
  min-height: 2.25rem;
  padding-block: 0;
}

@media (max-width: 560px) {
  .preference-form {
    grid-template-columns:
      minmax(6rem, 1.2fr)
      minmax(5rem, 1.4fr)
      minmax(3rem, 0.65fr)
      minmax(2.5rem, 0.45fr)
      auto;
    gap: 0.5rem 0.4rem;
    min-width: max(100%, 21rem);
  }

  .preference-form input,
  .preference-form select {
    padding: 0.3rem 0.4rem;
    font-size: 0.82rem;
  }

  .preference-form .btn {
    padding: 0 0.65rem;
    white-space: nowrap;
  }
}
.generate-config-fields {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(5.25rem, max-content) minmax(7rem, max-content);
  gap: 0.75rem 1rem;
  align-items: start;
}

@media (max-width: 480px) {
  .generate-config-fields {
    grid-template-columns: minmax(0, 1fr) minmax(5.25rem, max-content);
  }

  .generate-config-fields > label:nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 992px) {
  .app-sidebar {
    transform: none;
    box-shadow: none;
  }
  .app-sidebar .navbar-toggler { display: none; }
  .page-wrapper { margin-left: 15rem; }
  /* Keep content, topbar and footer in one column with a breathing gap
     next to the fixed sidebar. */
  .page-body { padding-inline: 1.5rem; }
  .app-topbar-inner,
  .app-footer-inner { padding-inline: 1.5rem; }
}
nav.container-fluid { padding-block: 0.6rem; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
nav.container-fluid > ul { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0; }
nav.container-fluid > ul > li { display: flex; align-items: center; }
nav.container-fluid > ul > li > a { display: flex; align-items: center; padding: 0.4rem 0.75rem; line-height: 1.4; }
/* Match sibling <a> links' -10px vertical margin: <details> carries a UA
 * margin-bottom, which under the nav flex centering pushes the summary up. */
nav.container-fluid > ul > li > details { display: flex; align-items: center; position: relative; margin: -10px; }
nav.container-fluid > ul > li > details > summary {
  display: flex;
  align-items: center;
  color: var(--brand);
  padding: 0.4rem 0.75rem;
  margin: 0;
  border: none;
  font-weight: inherit;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  user-select: none;
  /* Hide Pico's default summary marker/box */
  -webkit-appearance: none;
  appearance: none;
}
nav.container-fluid > ul > li > details > summary::-webkit-details-marker { display: none; }
nav.container-fluid > ul > li > details > summary::marker { display: none; content: ''; }
nav.container-fluid > ul > li > details > summary:hover { color: var(--brand-dark); background: var(--brand-soft); border-radius: 0.45rem; }

/* Dropdown menu: vertical stack */
nav.container-fluid > ul > li > details > ul {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  padding: 0.5rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 0.45rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 100;
}
nav.container-fluid > ul > li > details > ul > li {
  display: block;
  width: 100%;
}
nav.container-fluid > ul > li > details > ul > li > a {
  display: block;
  width: 100%;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
}
nav.container-fluid > ul > li > details > ul > li > a:hover {
  background: var(--brand-soft);
  border-radius: 0.45rem;
}

table.schedule-grid { width: 100%; border-collapse: collapse; }
table.schedule-grid th, table.schedule-grid td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.45rem;
  text-align: center;
  white-space: nowrap;
}
table.schedule-grid th {
  background: rgba(113, 75, 103, 0.06);
  color: var(--brand-dark);
  font-size: 0.75rem;
}
table.schedule-grid td { color: var(--ink); }
table.schedule-grid td.cell-shift { cursor: pointer; }
table.schedule-grid td.cell-shift:hover { background: var(--brand-soft); }
.schedule-table-card { padding: 0.75rem; }
.schedule-table-card.is-editing { outline: 2px solid var(--brand); outline-offset: 3px; }
.schedule-table-card .table-responsive { overflow-x: auto; }
.calendar-scroll {
  width: 100%;
  margin-top: 1rem;
  margin-inline: auto;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.calendar-month {
  width: 100%;
  min-width: 48rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.calendar-month + .calendar-month { margin-top: 1.5rem; }
.calendar-month-header {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--card-border);
}
.calendar-month-header h3 {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
}
.calendar-month-name {
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: 0;
}
.calendar-month-year {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(6rem, 1fr));
  grid-auto-rows: minmax(5.8rem, auto);
  width: 100%;
}
.calendar-weekday {
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  text-align: center;
}
.calendar-cell {
  min-width: 0;
  padding: 0.45rem 0.4rem 0.5rem;
  border-top: 1px solid var(--card-border);
  border-left: 1px solid var(--card-border);
}
.calendar-cell:nth-child(7n+1) { border-left: 0; }
.calendar-cell.is-outside-month,
.calendar-cell.is-outside-period { opacity: 0.42; }
.calendar-cell.is-today { opacity: 1; }
.calendar-cell.is-today .calendar-date {
  background: var(--teal);
  color: var(--inverse);
  box-shadow: 0 1px 4px rgba(0, 160, 157, 0.35);
}
.calendar-date {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  margin: 0 auto 0.4rem;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0;
}
.calendar-shifts {
  display: grid;
  gap: 0.25rem;
  max-height: 4.2rem;
  overflow-y: auto;
  padding: 0 0.1rem;
}
.calendar-shift {
  min-width: 0;
  padding: 0.12rem 0.28rem;
  border-radius: 0.35rem;
  background: var(--brand-tint);
  color: var(--brand-dark);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-actions {
  align-items: center;
  display: flex;
  gap: 0.3rem;
  white-space: nowrap;
}
.table-actions .btn {
  flex: 0 0 auto;
  margin: 0;
}
.tenant-name-link {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.2rem 0.5rem;
  border-radius: 0.45rem;
  color: var(--brand);
  font-weight: 600;
}
.tenant-name-link:hover,
.tenant-name-link:focus {
  color: var(--brand-dark);
  background: var(--brand-soft);
}
.honeypot-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
}
.application-review-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(22rem, 0.9fr);
  align-items: start;
}
.application-filters {
  display: flex;
  align-items: end;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.application-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0 0 0.9rem;
}
.application-detail div {
  min-width: 0;
}
.application-detail dt {
  margin-bottom: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.application-detail dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.selected-row {
  background: var(--brand-soft);
}
.form-success {
  color: #2a9d8f;
  font-weight: 600;
}

@media (max-width: 720px) {
  .application-review-layout {
    grid-template-columns: 1fr;
  }
  .application-detail {
    grid-template-columns: 1fr;
  }
}

/* 移除 details 默认下拉箭头，使下拉菜单项（护士）高度与其它导航项一致 */
nav.container-fluid > ul > li > details > summary::after { display: none; }

.landing {
  display: grid;
  gap: 2.5rem;
  padding-block: 1.5rem 2rem;
}
.landing-hero {
  max-width: 54rem;
}
.landing-eyebrow,
.landing-tagline,
.landing-grid p,
.landing-capabilities li {
  color: var(--muted);
}
.landing-eyebrow {
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.landing-hero h1 {
  margin: 0.4rem 0;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.05;
}
.landing-tagline {
  max-width: 42rem;
  font-size: 1.08rem;
  line-height: 1.65;
}
.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}
.landing-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-weight: 650;
}
.donate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.8rem;
  align-items: start;
}
.donate-channel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: 0.8rem;
  background: var(--card);
  font-weight: 650;
  cursor: pointer;
}
.donate-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.55);
}
.donate-qr-panel {
  width: min(90vw, 20rem);
  padding: 1.2rem;
  border-radius: 0.8rem;
  background: var(--card);
  text-align: center;
}
.donate-qr-image {
  display: block;
  margin: 0.75rem auto;
  width: 11rem;
  height: 11rem;
  object-fit: contain;
}
.donate-qr-slot {
  display: grid;
  justify-items: center;
  align-content: start;
}
.donate-inline-qr {
  margin: 0;
  text-align: center;
}
.donate-inline-qr figcaption {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Tenant theme picker */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.8rem;
}
.theme-card {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.8rem;
  background: var(--card);
  text-align: start;
  cursor: pointer;
}
.theme-card.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 0.2rem var(--brand-tint);
}
.theme-card-preview {
  position: relative;
  display: block;
  height: 2.5rem;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
}
.theme-card-bar {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 0.75rem;
}
.theme-card-name {
  color: var(--ink);
  font-weight: 600;
}
.theme-swatches {
  display: flex;
  gap: 0.3rem;
}
.theme-swatch {
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 50%;
}
.donate-admin-preview {
  display: block;
  width: 9rem;
  height: 9rem;
  object-fit: contain;
  margin-top: 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
}
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin: 0;
  padding: 0;
}
.plan-card {
  margin: 0;
}
.plan-card .plan-tier {
  margin: 0;
  font-weight: 700;
}
.plan-card .plan-subtitle {
  margin: 0.25rem 0 0;
  color: var(--secondary);
  font-size: 0.85em;
}
.plan-card .plan-price {
  margin: 0.5rem 0;
  font-size: 1.6rem;
  font-weight: 700;
}
.plan-card .plan-price small {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--secondary);
}
.plan-card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}
.plan-card li {
  margin-bottom: 0.35rem;
}
.plan-howto {
  line-height: 1.7;
  /* Shared by the profile support dialog and the public about page: cap the
     width so both render the same size instead of each stretching to its own
     container. */
  max-width: 50rem;
  margin-inline: auto;
}
.plan-howto ol {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.landing-primary {
  background: var(--brand);
  color: var(--inverse);
}
.landing-secondary {
  border: 1px solid var(--card-border);
}
.landing-section h2 {
  margin-bottom: 1.1rem;
}
.landing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}
.landing-grid article,
.landing-carousel-track article {
  height: 100%;
  padding: 1.1rem;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 8px 24px #0000000a;
}
.landing-grid h3,
.landing-carousel-track h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.landing-grid article {
  cursor: pointer;
}
.landing-grid article.is-active {
  border-color: var(--brand);
}
.landing-grid p,
.landing-carousel-track p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
}
.landing-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 1rem;
}
.landing-carousel-track::-webkit-scrollbar { display: none; }
.landing-carousel-track article {
  scroll-snap-align: start;
  display: grid;
  gap: 1rem;
  align-content: start;
  cursor: pointer;
}
.landing-carousel-track article.is-active {
  border-color: var(--brand);
}
.landing-carousel-track img {
  width: 100%;
  height: auto;
  border: 1px solid var(--card-border);
  border-radius: 0.7rem;
}
.landing-carousel-track span {
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.1em;
}
.landing-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}
.landing-carousel-controls button {
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  margin: 0;
  border-radius: 50%;
}
.landing-carousel-dots {
  display: flex;
  gap: 0.45rem;
}
.landing-carousel-dots button {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  background: var(--card-border);
}
.landing-carousel-dots button.active {
  width: 1.7rem;
  border-radius: 999px;
  background: var(--brand);
}
.login-register {
  margin: 1rem 0 0;
  text-align: center;
}
.landing-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.landing-capabilities li {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.86rem;
}
.landing-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
}
.landing-footer a {
  color: var(--muted);
}
.landing-footer a:hover,
.landing-footer a:focus {
  color: var(--brand);
}

@media (max-width: 900px) {
  .landing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .landing { gap: 2rem; }
  .landing-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-carousel-track { grid-auto-columns: 100%; }
}

/* API keys card */
.api-key-secret {
  display: block;
  margin: 0.5rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 0.5rem;
  background: var(--card-muted, rgba(127, 127, 127, 0.08));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}
