/* Browser portals (v1 §6, images 15–18): desktop at 1280 px and wider, sidebar collapses on
   tablet and phone, no hover-only actions. Palette from the v1 shared visual system. */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --side: #f1f5fb;
  --text: #152238;
  --muted: #4a5568;
  --border: #d5dce6;
  --head: #e8eef7;
  --accent: #155eef;
  --accent-soft: #e3ecfd;
  --ok: #067647;
  --ok-bg: #e7f4ec;
  --bad: #b42318;
  --bad-bg: #fdecea;
  --warn: #92400e;
  --warn-bg: #fff4e0;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
body {
  font:
    14px/1.5 'Inter',
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  font-variant-numeric: tabular-nums;
}
button,
input,
select {
  font: inherit;
}
a {
  color: var(--accent);
}

.preview-banner {
  background: var(--warn-bg);
  color: var(--warn);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 6px 16px;
}
.topstrip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #edf1f6;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}
.topstrip .sep {
  opacity: 0.6;
}
.topstrip .switch {
  margin-left: auto;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 80px);
}
.sidebar {
  background: var(--side);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}
.brand {
  font-size: 26px;
  font-weight: 700;
  padding: 8px 8px 20px;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.nav {
  display: block;
  padding: 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
}
.nav-on {
  background: var(--accent-soft);
  font-weight: 700;
}

.main {
  padding: 24px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.titlebar h1 {
  margin: 0;
  font-size: 28px;
  overflow-wrap: anywhere;
}
.who {
  color: var(--muted);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  color: var(--muted);
}
.kpi-value {
  font-size: 28px;
  font-weight: 700;
}
.kpi-ok .kpi-value {
  color: var(--ok);
}
.kpi-warn .kpi-value {
  color: var(--warn);
}
.kpi-bad .kpi-value {
  color: var(--bad);
}

.block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.block h2 {
  margin: 0;
  font-size: 20px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  text-align: left;
  padding: 14px 16px;
  white-space: nowrap;
}
th {
  background: var(--head);
  font-weight: 700;
}
tbody tr:nth-child(even) {
  background: #f8fafc;
}
tbody tr + tr td {
  border-top: 1px solid #eef1f5;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}
.pill-ok {
  background: var(--ok-bg);
  color: var(--ok);
}
.pill-warn {
  background: var(--warn-bg);
  color: var(--warn);
}
.pill-bad {
  background: var(--bad-bg);
  color: var(--bad);
}
.pill-info {
  background: var(--head);
  color: var(--text);
}

.page-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 12px;
}
.note {
  color: var(--muted);
  margin: 0;
  max-width: 70ch;
}
.foot-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  min-height: 48px;
  padding: 0 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 0;
}
.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.setup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 0 0 16px;
}
.setup-form .btn {
  margin-bottom: 0;
}
.secret {
  white-space: pre-wrap;
  font:
    600 18px/1.4 ui-monospace,
    monospace;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 14px;
  max-width: 480px;
}
.field input,
.field select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}
.pairs {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 6px 24px;
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  justify-self: start;
}
.pairs dt {
  color: var(--muted);
}
.pairs dd {
  margin: 0;
  text-align: right;
  font-weight: 600;
}

.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
}
.steps li::before {
  content: counter(step) '. ';
}
.steps .step-done {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: transparent;
}
.steps .step-now {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.checklist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  align-items: center;
  flex-wrap: wrap;
}
.checklist li + li {
  border-top: 1px solid #eef1f5;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    min-width: 0;
  }
  .brand {
    display: none;
  }
  .sidebar nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .nav {
    white-space: nowrap;
  }
  .main {
    padding: 16px;
  }
  .topstrip {
    padding: 10px 16px;
    flex-wrap: wrap;
  }
  .topstrip .switch {
    margin-left: 0;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
  .foot-actions {
    width: 100%;
  }
}

/* v1.2 shared product components. Applies to live API-rendered panels as well as classed controls. */
button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}
button:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
button:hover:not(:disabled),
.btn:hover {
  border-color: var(--accent);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #b57600;
  outline-offset: 3px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}
input:not([type='checkbox']):not([type='radio']),
select,
textarea {
  min-height: 48px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  color: var(--text);
}
textarea {
  font: inherit;
}
label {
  line-height: 1.5;
}
.topstrip {
  min-height: 80px;
  flex-wrap: wrap;
  gap: 12px;
  background: white;
}
.topstrip strong {
  color: var(--text);
  margin-right: auto;
}
.topstrip a {
  text-underline-offset: 3px;
}
.sidebar details {
  padding: 8px 4px;
}
.sidebar summary {
  min-height: 48px;
  padding: 12px 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sidebar .nav {
  margin-top: 4px;
}
.sidebar .nav[aria-current='page'] {
  background: var(--accent-soft);
  color: #174db0;
  font-weight: 700;
}
.main h1 {
  font-size: 28px;
  margin: 0;
}
.main h2 {
  font-size: 20px;
}
.main h3 {
  font-size: 18px;
}
.main section,
.main article {
  min-width: 0;
}
.main dl {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr);
  gap: 10px 20px;
  margin: 16px 0;
}
.main dl dt {
  color: var(--muted);
}
.main dl dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.auth-layout {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
}
.auth-brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
}
.auth-card h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 16px;
}
.auth-description {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 28px;
}
.auth-submit {
  width: 100%;
}
.auth-card.auth-card--signin {
  max-width: 420px;
  padding: 24px;
}
.auth-card--signin .auth-brand {
  margin-bottom: 20px;
}
.auth-card--signin h1 {
  margin-bottom: 12px;
}
.auth-card--signin .auth-description {
  margin-bottom: 16px;
}
@media (max-width: 600px) {
  .auth-layout {
    padding: 16px;
  }
  .auth-card {
    padding: 24px;
  }
  .topstrip > * {
    min-width: 0;
  }
  .sidebar nav {
    flex-direction: column;
    overflow: visible;
  }
  .main dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .main dl dd {
    margin-bottom: 12px;
  }
  table {
    display: block;
    overflow-x: auto;
  }
}
/* Compact portal typography follows the user-requested Cloudflare/Kumo type scale. */
body {
  font-size: 14px;
}
th,
td {
  font-size: 14px;
}
.auth-card h1,
.main h1 {
  font-size: 24px;
}

/* v1.2 O00B/O00V/O01/P01: explicit cards, persistent context and grouped navigation. */
.picker-layout {
  min-height: 100dvh;
  padding: 24px;
}
.picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto 24px;
}
.picker-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.picker-card h1 {
  font-size: 24px;
  margin: 0 0 16px;
}
.workspace-choices {
  padding: 0;
  border: 0;
  margin: 24px 0;
  display: grid;
  gap: 16px;
}
.workspace-choices legend {
  color: var(--muted);
  margin-bottom: 12px;
}
.workspace-choice {
  display: flex;
  align-items: start;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
}
.workspace-choice:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.workspace-choice input {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 4px 0;
}
.workspace-choice > span {
  display: grid;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.workspace-choice > span > span {
  font-size: 14px;
  color: var(--muted);
}
.picker-actions,
.overview-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 12px;
  align-items: start;
  margin-top: 24px;
}
.picker-actions > *,
.overview-actions > * {
  min-width: 0;
  width: 100%;
}
.overview-actions > span {
  display: grid;
  gap: 6px;
}
.overview-actions > span > button {
  width: 100%;
}
.topstrip p {
  margin: 0;
  flex-basis: 100%;
  color: var(--muted);
}
.nav-branch {
  border-left: 1px solid var(--border);
  padding-left: 8px;
}
.overview-subtitle {
  margin: 0 0 8px;
  color: var(--muted);
}
.overview-asof {
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 24px;
}
.overview-actions small {
  display: block;
  max-width: 24ch;
  color: var(--muted);
  font-size: 14px;
}
.venue-overview {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.venue-overview .overview-intro {
  display: grid;
  gap: 8px;
}
.venue-overview .overview-subtitle,
.venue-overview .overview-asof,
.venue-overview > p,
.venue-overview .overview-actions {
  margin: 0;
}
.venue-overview > [data-overview-retry] {
  align-self: flex-start;
}

/* Shared shell keeps account controls together without moving their handlers. */
.account-menu {
  position: relative;
  margin-inline-start: auto;
  max-width: 100%;
  min-width: 0;
}
.account-menu-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  list-style: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.account-menu-trigger::-webkit-details-marker {
  display: none;
}
.account-menu-trigger::after {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg);
}
.account-menu[open] .account-menu-trigger::after {
  transform: rotate(225deg);
}
.account-menu-items {
  position: absolute;
  z-index: 50;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 8px;
  width: max-content;
  min-width: min(240px, calc(100vw - 32px));
  max-width: min(320px, calc(100vw - 32px));
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px #1522381f;
}
.account-menu-items > :is(a, button, .btn) {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  text-align: start;
  white-space: normal;
}
.portal-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-width: 0;
  color: var(--muted);
}
.portal-context > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.portal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 160px;
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}
.portal-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: portal-spin 0.8s linear infinite;
}
@keyframes portal-spin {
  to {
    transform: rotate(1turn);
  }
}
@media (prefers-reduced-motion: reduce) {
  .portal-spinner {
    animation: none;
  }
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.table-wrap input[type='radio'] {
  width: 24px;
  height: 24px;
  margin: 12px;
}
.directory-choice {
  display: inline-flex;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  cursor: pointer;
}
@media (max-width: 600px) {
  .picker-layout {
    padding: 16px;
  }
  .picker-card {
    padding: 20px;
  }
  .overview-actions > *,
  .picker-actions > * {
    flex: 1 1 100%;
  }
  .overview-actions button,
  .overview-actions a,
  .picker-actions button {
    width: 100%;
  }
  .main th,
  .main td {
    white-space: normal;
    min-width: 120px;
  }
  .kpis {
    gap: 12px;
  }
  .venue-overview > [data-overview-retry] {
    width: 100%;
  }
}

.organization-create {
  max-width: 800px;
}
.organization-create fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  min-width: 0;
}
.organization-create legend {
  font-weight: 600;
}
.organization-create .field-help {
  font-size: 14px;
  color: var(--muted);
}
.organization-create label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
  min-width: 0;
}
.organization-create input {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* v1.2 organization workspaces: readable legal profiles and explicit review forms. */
.organization-workspace {
  max-width: 1040px;
  min-width: 0;
}
.organization-profile {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
  margin: 24px 0;
}
.organization-profile dt {
  color: var(--muted);
  font-size: 14px;
}
.organization-profile dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}
.organization-form {
  max-width: 800px;
}
.organization-form label,
.organization-workspace form label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  min-width: 0;
}
.organization-form input,
.organization-form select,
.organization-workspace form input:not([type='checkbox']),
.organization-workspace form select {
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.organization-form label:has(input[type='checkbox']),
.organization-workspace form label:has(input[type='checkbox']) {
  flex-direction: row;
  align-items: center;
  min-height: 48px;
  gap: 12px;
}
.organization-form input[type='checkbox'],
.organization-workspace form input[type='checkbox'] {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
}
.organization-form fieldset {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
}
.organization-invitation {
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.organization-blockers li {
  margin: 12px 0;
}
@media (max-width: 640px) {
  .organization-profile {
    grid-template-columns: 1fr;
  }
}
.workspace-nav-toggle {
  display: none;
}
.organization-form button[type='submit'],
.organization-form button.btn-primary {
  min-height: 56px;
}
@media (max-width: 960px) {
  .workspace-nav-toggle {
    display: block;
    margin: 12px 16px;
    width: calc(100% - 32px);
  }
  .layout:not([data-navigation-open]) > .sidebar {
    display: none;
  }
}
.organization-workspace summary {
  min-height: 48px;
  align-content: center;
  padding: 8px 0;
  box-sizing: border-box;
}
.organization-workspace article {
  overflow-wrap: anywhere;
}
.organization-workspace form .btn-primary {
  min-height: 56px;
}
.organization-workspace .overview-actions {
  gap: 16px;
}
/* Billing tables use one keyboard-focusable horizontal viewport on narrow screens. */
.billing-workspace .table-wrap > table {
  display: table;
  min-width: 760px;
  overflow: visible;
}

.billing-workspace [hidden] {
  display: none;
}
.billing-workspace fieldset label span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.billing-workspace fieldset small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.event-workspace [hidden] {
  display: none;
}
.event-workspace textarea {
  min-height: 120px;
  width: 100%;
  box-sizing: border-box;
}
.event-workspace .table-wrap > table {
  display: table;
  min-width: 640px;
  overflow: visible;
}
.event-workspace td label {
  min-height: 48px;
  display: flex;
  align-items: center;
}
.event-workspace td input[type='radio'] {
  width: 24px;
  height: 24px;
}

.merchant-workspace .table-wrap > table {
  display: table;
  min-width: 640px;
  overflow: visible;
}

.audit-workspace .table-wrap > table {
  display: table;
  min-width: 760px;
  overflow: visible;
}
.audit-workspace dd {
  overflow-wrap: anywhere;
}

.report-workspace dd {
  overflow-wrap: anywhere;
}
.report-workspace .table-wrap > table {
  display: table;
  min-width: 640px;
  overflow: visible;
}
.report-workspace form {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.report-workspace .report-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.report-workspace .report-consent input {
  width: 24px;
  min-height: 24px;
  flex: 0 0 24px;
}

.support-workspace .support-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.support-workspace .support-consent input {
  width: 24px;
  height: 24px;
  flex: none;
}
.support-workspace article {
  padding: 16px 0;
  border-bottom: 1px solid #d6dfed;
  overflow-wrap: anywhere;
}

.station-workspace textarea {
  width: 100%;
  min-height: 96px;
  box-sizing: border-box;
  font: inherit;
}
.station-workspace dl {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr);
  gap: 12px;
}
.station-workspace dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.station-workspace article {
  margin: 20px 0;
  padding: 20px;
  border: 1px solid var(--line, #d5deeb);
  border-radius: 12px;
}
.station-workspace output {
  display: block;
  padding: 20px;
  font-size: 24px;
  overflow-wrap: anywhere;
}

/* Workforce tables retain readable cells in their keyboard-focusable viewport. */
.platform-access-workspace .table-wrap > table {
  display: table;
  min-width: 760px;
}

.organizer-access-workspace .table-wrap {
  overflow-x: auto;
}
.organizer-access-workspace table {
  min-width: 760px;
}
.organizer-access-workspace .table-wrap:focus-visible {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
}

.account-menu-items > .account-signout {
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.topstrip .account-menu {
  flex: 0 1 auto;
  width: auto;
}
.topstrip .portal-context {
  order: 2;
}
.topstrip .account-menu {
  order: 1;
}
.kpis + .table-wrap {
  margin-top: 24px;
}
.venue-overview > .kpis + .table-wrap {
  margin-top: 0;
}
.account-menu-items > :is(a, button, .btn) {
  display: flex;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}
.account-menu-items > :is(a, button, .btn):hover {
  background: var(--accent-soft);
}
.account-menu-items > .account-signout {
  border-top: 1px solid var(--border);
  border-radius: 0 0 6px 6px;
}

/* Keep parallel actions equal, including wrapped labels, throughout both portals. */
.picker-actions,
.overview-actions,
.actions,
.portal-actions,
:where(.main, .picker-card)
  :is(div, section, article, nav, form):not(
    .account-menu-items,
    .table-actions
  ):has(> :is(button, a.btn) + :is(button, a.btn)) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  align-items: stretch;
  gap: 12px;
}
:where(.main, .picker-card)
  :is(div, section, article, nav, form):has(
    > :is(button, a.btn) + :is(button, a.btn)
  )
  > :not(button, a.btn, span:has(> button)) {
  grid-column: 1 / -1;
}
:is(.picker-actions, .overview-actions, .actions, .portal-actions)
  > :is(button, a.btn) {
  align-self: stretch;
  height: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.overview-actions > p {
  grid-column: 1 / -1;
  margin: 0;
}
:is(.overview-actions, .actions, .portal-actions) + :is(button, a.btn),
.entity-create-action {
  margin-top: 16px;
}
.table-wrap td > :is(button, a.btn):only-of-type {
  width: 100%;
  min-inline-size: max-content;
  white-space: nowrap;
  overflow-wrap: normal;
}
.main dl.source-family-summary {
  display: block;
  margin: 24px 0;
}
.source-family-summary > div {
  display: grid;
  grid-template-columns: minmax(12rem, 24rem) minmax(0, 1fr);
  align-items: start;
  gap: 12px 24px;
  margin-block: 16px;
}
.source-family-summary dt .btn {
  width: 100%;
}
@media (max-width: 640px) {
  .source-family-summary > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

@font-face {
  font-family: 'Inter';
  src: url('/portal/fonts/inter-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
body {
  font-family:
    'Inter',
    ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  line-height: 1.5;
}
.main h1,
.auth-card h1 {
  font-size: 24px;
  font-weight: 600;
}
.main h2 {
  font-size: 20px;
  font-weight: 600;
}
.main h3 {
  font-size: 16px;
  font-weight: 600;
}
.topstrip strong {
  font-size: 16px;
  font-weight: 600;
}
.kpi-value {
  font-size: 24px;
}
.auth-description {
  font-size: 16px;
}
button,
.btn {
  font-weight: 500;
}
.btn-primary {
  font-weight: 600;
}
label:has(> select) {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 100%;
}
label > select {
  min-width: 0;
  max-width: 100%;
}
form label:has(> select) {
  display: grid;
  gap: 8px;
  text-align: left;
  align-items: stretch;
  justify-items: stretch;
}
form label > select {
  width: 100%;
  box-sizing: border-box;
}
.prose-lines {
  display: grid;
  gap: 4px;
}
.prose-lines > span {
  display: block;
}
.portal-icon {
  flex: 0 0 18px;
  vertical-align: middle;
}
.sidebar summary .portal-icon {
  margin-inline-end: 8px;
}
.sidebar .nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar .nav > span {
  min-width: 0;
}
.account-menu-trigger .portal-icon {
  margin-inline-end: 2px;
}
@media (max-width: 640px) {
  label:has(> select) {
    display: grid;
    gap: 8px;
  }
  label > select {
    width: 100%;
  }
  input,
  select,
  textarea,
  .field input,
  .field select {
    font-size: 16px;
  }
}

/* One page title and one navigation tree; empty context-switch groups add no space. */
.main .portal-duplicate-title,
.overview-actions:empty,
.picker-actions:empty {
  display: none;
}
.main > h1 {
  margin: 0;
}
.account-menu-items > :is(a, button, .btn) {
  gap: 12px;
}
.table-actions {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(11rem, 1fr);
  align-items: stretch;
  gap: 8px;
  margin: 0;
  width: 100%;
}
.table-actions > :is(a.btn, button) {
  width: 100%;
  height: 100%;
  min-width: 0;
  white-space: normal;
}
/* Shared table density avoids radio controls inflating otherwise one-line rows. */
.table-wrap :is(th, td) {
  padding: 12px 16px;
  height: 48px;
  vertical-align: middle;
}
.table-wrap .pill {
  line-height: 20px;
}
.table-wrap :is(button, a.btn) {
  min-height: 36px;
  padding: 8px 12px;
}
.directory-choice {
  position: relative;
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  margin: 0;
  justify-content: center;
}
.directory-choice::before {
  content: '';
  position: absolute;
  inset: -10px;
}
.table-wrap .directory-choice > input[type='radio'] {
  width: 18px;
  height: 18px;
  margin: 0;
}
@media (max-width: 640px), (pointer: coarse) {
  .table-wrap :is(button, a.btn) {
    min-height: 44px;
  }
}
.table-wrap .directory-choice > input[type='radio'] {
  position: relative;
  z-index: 1;
}

/* Content grids must not distribute spare viewport height between prose rows. */
:where(.main, .picker-card)
  :is(div, section, article, nav, form):has(
    > :is(button, a.btn) + :is(button, a.btn)
  ) {
  align-content: start;
}
.main {
  justify-content: flex-start;
  gap: 16px;
}
.main :is(h1, h2, h3) {
  margin-block: 0 12px;
}
.main p {
  margin-block: 0 12px;
}
.main .portal-duplicate-title {
  display: none !important;
}
.audit-workspace > form.overview-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
  max-width: 800px;
  align-content: start;
}
.audit-workspace > form.overview-form > label {
  margin: 0;
  text-align: left;
  align-items: stretch;
}
.audit-workspace > form.overview-form > :is(h3, p) {
  grid-column: 1 / -1;
  margin: 0;
}
.audit-workspace > form.overview-form > button {
  justify-self: start;
}
@media (max-width: 640px) {
  .audit-workspace > form.overview-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact controls share the same density in Events and all other tables. */
.table-wrap td label:has(> input:is([type='radio'], [type='checkbox'])) {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  margin: 0;
}
.table-wrap td input:is([type='radio'], [type='checkbox']) {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}
.topstrip .account-menu-items > :is(a, button) {
  display: flex;
  align-items: center;
  column-gap: 12px;
}
.main .portal-empty-actions {
  display: none !important;
  margin: 0;
}
.main > section {
  align-self: stretch;
}

/* Reserve text space and inset the arrow on single-choice dropdowns. */
select:not([multiple]):not([size]),
select:not([multiple])[size='1'] {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23344054' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px 16px;
  padding-right: 44px;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]),
  select:not([multiple])[size='1'] {
    appearance: auto;
    background-image: none;
  }
}

/* Keep onboarding section actions consistent across single- and multi-action rows. */
.main
  :is(.onboarding-checklist, .verification-workflow)
  .overview-actions.overview-actions {
  grid-template-columns: repeat(auto-fit, minmax(0, min(100%, 20rem)));
  justify-content: start;
  margin-block: 16px 24px;
}

.verification-workflow :is(button, a.btn):not(table *) {
  width: min(100%, 20rem);
  max-width: 100%;
}
.verification-workflow > section {
  margin-block: 24px;
}

.request-result-reason {
  max-width: 50rem;
  margin-block: 16px;
  padding: 16px 20px;
  border: 1px solid #c43c35;
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff1f0;
  color: #84231f;
}
.request-result-reason strong {
  display: block;
}
.request-result-reason p {
  margin: 8px 0 0;
}

.admin-invitations-page {
  max-width: 1200px;
  margin-inline: auto;
  padding: 24px;
}
.admin-invitations-page h1 {
  margin: 0 0 16px;
}
.admin-invitations-page > p {
  margin: 0 0 16px;
}
.admin-invitations-page > article {
  margin-block: 24px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, white);
}
.admin-invitations-page .overview-actions {
  grid-template-columns: repeat(auto-fit, minmax(0, min(100%, 20rem)));
  margin-block: 24px;
  align-items: stretch;
}
@media (max-width: 600px) {
  .admin-invitations-page {
    padding: 16px;
  }
}

.main > [data-personal-invitations] {
  padding: 0;
  max-width: none;
  margin: 0;
}
[data-personal-invitations] > a {
  display: inline-flex;
  margin-block: 12px;
}

/* Stack the organization picker label against the control's left edge. */
label.billing-organization-picker:has(> select) {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 480px;
  text-align: left;
  align-items: stretch;
  justify-items: stretch;
}
.billing-organization-picker > select {
  width: 100%;
  box-sizing: border-box;
}

.organization-form [role='alert'] {
  white-space: pre-line;
}

/* Compact form rhythm: avoid adding label margins to the action-grid gap. */
.main form {
  align-content: start;
  row-gap: 16px;
}
.main form label {
  margin-block: 0;
}
.main form fieldset {
  margin-block: 0;
  padding: 16px;
}
.main form fieldset > label:has(input:is([type='checkbox'], [type='radio'])) {
  margin-block: 8px;
  min-height: 32px;
}
.main form .field-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: normal;
}

/* Keep field guidance below its control in both authenticated portals. */
.main
  form
  label:has(
    > input:not([type='checkbox']):not([type='radio']):not([type='hidden'])
  ),
.main form label:has(> textarea),
.main form label:has(> select) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  justify-items: stretch;
  text-align: left;
}
.main form label > .field-help {
  display: block;
}

/* Recovery is a sequence: inspect result, confirm unchanged retry, then retry. */
.main .access-recovery-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  gap: 16px;
}
.main .access-recovery-actions > label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* The original one-use PIN setup code must be easy to read and transcribe. */
output[data-staff-original-code] {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 16px 0 24px;
  padding: 20px 28px;
  border: 2px solid var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.16em;
  overflow-wrap: anywhere;
  user-select: all;
}

/* Native vault counting forms: keep each label with its control. */
.vault-action-form {
  display: grid;
  gap: 16px;
  max-width: 960px;
  min-width: 0;
  margin-top: 24px;
  overflow-wrap: anywhere;
}
.vault-action-form h2,
.vault-action-form p {
  margin: 0;
}
.vault-action-form .vault-denominations {
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--border, #d9e1ee);
  border-radius: 16px;
}
.vault-denominations legend {
  padding: 0 6px;
  font-weight: 600;
}
.vault-denomination-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.vault-action-form .vault-denomination-grid label,
.vault-action-form .vault-reason {
  display: grid;
  gap: 8px;
  min-width: 0;
  text-align: left;
}
.vault-action-form .vault-denomination-grid input,
.vault-action-form .vault-reason textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
}
.vault-action-form .vault-reason textarea {
  min-height: 96px;
}
.vault-action-form .vault-count-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  text-align: left;
}
.vault-action-form .vault-count-consent input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 24px;
  margin: 0;
}
.vault-action-form [data-vault-submit] {
  justify-self: start;
}
@media (max-width: 520px) {
  .vault-denomination-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
