:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #16263a;
  background: #f3f6fa;
  --surface: #fff;
  --line: #dce4ee;
  --muted: #4f6075;
  --accent: #134d73;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 2px solid #126c9f; outline-offset: 3px; }
.muted { color: var(--muted); }
.platform-shell { width: min(1170px, calc(100% - 64px)); margin-inline: auto; }
.platform-bar { background: #14283d; color: #fff; }
.bar-content { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; gap: 11px; align-items: center; font-weight: 700; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #ffe18f; color: #14283d; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 13px; min-height: 40px; border: 1px solid; border-radius: 8px; font-size: .88rem; font-weight: 650; }
.button-group { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px; }
.secondary { background: var(--surface); border-color: var(--line); color: var(--accent); }
.secondary:hover { background: #eef4fa; }
.platform-bar .secondary { color: #eff6ff; background: #233c54; border-color: #4a6076; }
.platform-bar .secondary:hover { background: #324e68; }
.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.primary:hover { background: #226692; }
button:disabled { opacity: .65; cursor: wait; }
.intro { padding-block: 49px 25px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.12; letter-spacing: -.04em; }
h2 { font-size: 1.27rem; letter-spacing: -.02em; }
.intro p { margin-top: 10px; }
.gate { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; max-width: 440px; padding: 24px; }
.gate p { line-height: 1.5; }
.gate form { display: grid; margin-top: 20px; }
.gate label, .control label { font-size: .81rem; font-weight: 700; margin-bottom: 6px; }
.gate input { margin-bottom: 14px; }
.gate > button { margin-top: 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric { text-align: left; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; color: inherit; }
.metric:hover { border-color: #7795ab; }
.metric[aria-pressed="true"] { background: #eaf3fa; border-color: #8eb2cc; }
.metric span { display: block; color: var(--muted); font-size: .88rem; font-weight: 650; }
.metric strong { display: block; margin-top: 7px; color: #14283d; font-size: 1.9rem; line-height: 1.15; font-variant-numeric: tabular-nums; }
.registry { margin-bottom: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.registry-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px; }
.registry-heading p { margin-top: 4px; font-size: .78rem; }
.registry-controls { display: flex; align-items: end; gap: 12px; padding: 0 20px 18px; }
.control { display: grid; }
.search { flex: 1 1 220px; max-width: 340px; }
input, select { min-width: 0; width: 100%; min-height: 40px; border: 1px solid #bfcddd; border-radius: 8px; background: var(--surface); color: inherit; padding: 8px 11px; }
.registry-scroll { overflow-x: auto; }
.registry-scroll:focus-visible { outline-offset: -2px; }
table { border-collapse: collapse; text-align: left; width: 100%; }
th, td { border-top: 1px solid var(--line); padding: 13px 16px; vertical-align: top; }
th:first-child { padding-left: 20px; width: 35%; }
thead { background: #f6f8fb; }
thead th { color: var(--muted); font-size: .78rem; font-weight: 650; }
tbody th { font-weight: 650; }
td { font-size: .84rem; }
.organization-name { display: flex; gap: 7px; flex-wrap: wrap; align-items: baseline; overflow-wrap: anywhere; }
.organization-link { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-align: left; overflow-wrap: anywhere; }
.organization-link:hover { text-decoration: underline; }
.organization-meta { font-size: .77rem; font-weight: 400; margin-top: 4px; overflow-wrap: anywhere; }
.organization-type { color: var(--muted); font-size: .76rem; font-weight: 500; margin-top: 4px; }
.pill, .tag { display: inline-block; padding: 3px 7px; border-radius: 6px; font-size: .75rem; font-weight: 650; background: #edf1f5; color: #47566a; }
.tag { background: #eaf3fa; color: #24536f; }
.pill[data-state="active"], .pill[data-state="clear"] { background: #dff3eb; color: #185c45; }
.pill[data-state="issues"], .pill[data-state="revoked"] { background: #fae7e7; color: #8c302f; }
.pill[data-state="stale"] { background: #fff0d1; color: #714a12; }
details { margin-top: 6px; max-width: 26ch; }
details ul { margin: 5px 0 0; padding-left: 18px; }
details li { padding-block: 2px; }
.registry-footer { padding: 12px 20px; border-top: 1px solid var(--line); font-size: .81rem; }
.mobile-label { display: none; }

dialog { margin: auto; width: min(510px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 22px; border: 1px solid var(--line); border-radius: 15px; color: inherit; background: var(--surface); }
dialog::backdrop { background: rgb(14 29 46 / 56%); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.dialog-header h2 { padding-top: 7px; overflow-wrap: anywhere; }
.dialog-header .button { font-size: 1.16rem; padding-inline: 12px; }
dialog fieldset { min-width: 0; border: 0; padding: 0; margin: 0; display: grid; }
dialog label { display: block; font-size: .83rem; font-weight: 650; margin-bottom: 6px; }
dialog fieldset input, dialog fieldset select { margin-bottom: 12px; }
dialog input, dialog select { font-size: 1rem; }
.field-help, .dialog-status { font-size: .83rem; color: var(--muted); line-height: 1.45; }
.dialog-status { margin-block: 12px; }
.dialog-status:empty { margin: 0; }
.dialog-actions { margin-top: 16px; }
.selected-organization { background: #eaf3fa; color: #214862; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; overflow-wrap: anywhere; }
.invite-box { margin-bottom: 16px; }
.reissue-invite { margin-block: 16px 0; }
.reissue-invite .field-help { margin-top: 6px; }
.invite-tools { display: flex; gap: 8px; margin-bottom: 6px; }
.invite-tools .button { flex-shrink: 0; }
.organization-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 0 0 16px; }
.organization-facts div { padding: 10px; background: #f3f6fa; border-radius: 8px; overflow-wrap: anywhere; }
.organization-facts dt { font-size: .77rem; color: var(--muted); margin-bottom: 4px; }
.organization-facts dd { font-weight: 600; font-size: .87rem; margin: 0; }

.platform-navigation { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 18px; border-bottom: 1px solid var(--line); }
.platform-navigation a { padding: 10px 14px; font-size: .9rem; color: var(--muted); border-bottom: 2px solid transparent; font-weight: 650; }
.platform-navigation a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.billing-metrics .metric:hover { border-color: var(--line); }
.billing-subscriptions, .billing-plans { display: grid; }
.billing-row { display: grid; grid-template-columns: minmax(180px, 1.6fr) minmax(120px, 1fr) minmax(122px, 1fr) minmax(120px, 1fr); gap: 15px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.billing-row strong { display: block; padding-bottom: 3px; }
.billing-row small { display: block; color: var(--muted); padding-top: 4px; }
.billing-plans .billing-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: center; }
.billing-empty { padding: 16px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.pill[data-state="paid"] { background: #dff3eb; color: #185c45; }
.pill[data-state="trial"] { background: #eaf3fa; color: #24536f; }
.pill[data-state="awaiting"] { background: #fff0d1; color: #714a12; }
.pill[data-state="overdue"] { background: #fae7e7; color: #8c302f; }
#billing-dialog form :is(input, select) { margin-bottom: 12px; }
#billing-dialog { width: min(570px, calc(100% - 24px)); }
#billing-dialog .dialog-actions { display: flex; justify-content: end; }
#billing-dialog .field-help { margin-top: 0; }
dialog .billing-organization-options { display: block; padding: 8px 10px 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.billing-organization-options legend { font-size: .83rem; font-weight: 650; }
#billing-organization-options { max-height: 160px; overflow-y: auto; }
#billing-organization-options label { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
#billing-organization-options input { width: auto; min-height: 18px; margin: 0; }
.billing-detail-actions { justify-content: start; }
.payment-form, .billing-confirmation { margin-top: 15px; padding: 14px; background: #f3f6fa; border-radius: 8px; }
.billing-confirmation button { margin: 10px 5px 0 0; }
.billing-payments-title { font-size: 1rem; margin: 18px 0 8px; }
.billing-payment-row { border-top: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
.billing-payment-row small { display: block; margin-top: 4px; color: var(--muted); }

@media (max-width: 700px) {
  .platform-shell { width: calc(100% - 28px); }
  .intro { padding-block: 29px 21px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 13px; }
  .registry-heading, .registry-controls, .registry-footer { padding-inline: 12px; }
  .registry-heading { align-items: start; flex-wrap: wrap; }
  .registry-heading .button-group { justify-content: start; }
  .billing-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-inline: 12px; }
  .billing-row > :first-child { grid-column: 1 / -1; }
  .billing-plans .billing-row { grid-template-columns: minmax(0, 1fr) auto; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; border-top: 1px solid var(--line); padding: 13px 12px; }
  tbody th:first-child { grid-column: 1 / -1; width: auto; padding: 0; }
  tbody th, tbody td { border: 0; padding: 0; }
  tbody td:last-child { grid-column: 1 / -1; }
  .mobile-label { display: block; color: var(--muted); font-size: .73rem; margin-bottom: 4px; }
}

@media (max-width: 400px) {
  .bar-content { gap: 8px; }
  .platform-bar .button { font-size: .76rem; padding-inline: 7px; }
  .registry-controls { flex-direction: column; align-items: stretch; }
  .search { flex: auto; max-width: none; }
  .invite-tools { flex-wrap: wrap; }
}
