:root {
  color-scheme: dark;
  --ink: #111214;
  --surface: #1b1d21;
  --paper: #f4f5f7;
  --muted: #adb3be;
  --line: #333538;
  --lime: #d6f56a;
  --coral: #ff8a80;
  font-family: Arial, "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--ink);
  color: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { word-break: keep-all; overflow-wrap: anywhere; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
::selection { background: var(--lime); color: var(--ink); }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
.skip {
  position: absolute; left: 12px; top: 12px; padding: 10px 16px;
  background: var(--lime); color: var(--ink); transform: translateY(-160%); z-index: 20;
}
.skip:focus { transform: none; }
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line);
  background: rgba(17, 18, 20, .96); position: sticky; top: 0; z-index: 10;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 140px; height: 40px; display: block; object-fit: contain; }
.nav { display: flex; gap: 22px; align-items: center; font-size: 14px; }
.nav a, .nav button {
  color: var(--paper); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; transition: color .2s;
}
.nav a:hover, .nav button:hover { color: var(--lime); }
.nav-status { color: var(--muted); font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; }
.card-wrap, .wide { width: min(520px, calc(100% - 40px)); margin: 56px auto 90px; }
.wide { width: min(720px, calc(100% - 40px)); }
.admin-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 36px auto 80px;
}
.card { background: var(--surface); padding: 40px 36px 32px; }
.eyebrow {
  display: flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: 1.5px;
  font-weight: 600; color: var(--muted); margin: 0 0 12px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lime); flex-shrink: 0;
}
h1 { font-size: 32px; letter-spacing: -1.4px; font-weight: 750; line-height: 1.25; margin: 0 0 14px; }
.lead, .hint, .alt { color: var(--muted); line-height: 1.75; letter-spacing: -.2px; }
.lead { margin: 0 0 28px; }
.hint { font-size: 13px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 13px; }
input {
  background: var(--ink); color: var(--paper); border: 1px solid var(--line);
  min-height: 46px; padding: 0 12px; transition: border-color .2s;
}
input:hover { border-color: #4a4d52; }
label.check { display: flex; align-items: flex-start; gap: 10px; line-height: 1.5; cursor: pointer; }
label.check a { color: var(--lime); }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; padding: 0; margin: 2px 0 0; flex: none; accent-color: var(--lime); }
select {
  -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; border-radius: 0;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%239a9da3' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--paper); border: 1px solid var(--line);
  min-height: 46px; padding: 0 40px 0 12px; line-height: 1.3; text-overflow: ellipsis; cursor: pointer;
}
select:hover, select:focus { border-color: #4a4d52; }
select option { background: var(--surface); color: var(--paper); }
/* Checkbox rows: the whole row is the tap target (44px+), with a custom box
   so iOS/Android render the same lime check as desktop. */
.check-group { display: grid; gap: 0; border: 1px solid var(--line); padding: 4px 16px 8px; margin: 0; min-width: 0; }
.check-group legend { padding: 0 6px; font-weight: 700; font-size: 14px; }
.check-option {
  display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; cursor: pointer;
  border-bottom: 1px solid var(--line); -webkit-tap-highlight-color: transparent;
}
.check-group .check-option:last-child { border-bottom: 0; }
.check-option input[type="checkbox"], label.check input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin: 0; flex: none;
  border: 1.5px solid #5a5d63; border-radius: 4px; background: var(--ink); display: grid; place-content: center;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.check-option input[type="checkbox"]::after, label.check input[type="checkbox"]::after {
  content: ""; width: 11px; height: 6px; border: 2px solid var(--ink); border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s;
}
.check-option input[type="checkbox"]:checked, label.check input[type="checkbox"]:checked { background: var(--lime); border-color: var(--lime); }
.check-option input[type="checkbox"]:checked::after, label.check input[type="checkbox"]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.check-option input[type="checkbox"]:focus-visible, label.check input[type="checkbox"]:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.check-option:has(input:checked) span { color: var(--lime); }
.admin-summary-actions { flex-wrap: wrap; gap: 8px; }
.admin-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-invite-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border: 1px dashed var(--line); }
.admin-invite-bar > div { display: grid; gap: 4px; }
.check-option small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.check-option input[type="radio"] {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin: 0; flex: none; min-height: 0; padding: 0;
  border: 1.5px solid #5a5d63; border-radius: 50%; background: var(--ink); display: grid; place-content: center; cursor: pointer;
}
.check-option input[type="radio"]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); transform: scale(0); transition: transform .12s; }
.check-option input[type="radio"]:checked { border-color: var(--lime); }
.check-option input[type="radio"]:checked::after { transform: scale(1); }
.check-option input[type="radio"]:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.check-option.is-disabled { cursor: not-allowed; opacity: .55; }
.invite-row > div:first-child { display: grid; gap: 4px; }
.invite-head { gap: 6px; }
.invite-kind, .invite-state { display: inline-flex; padding: 2px 8px; border: 1px solid var(--line); font-size: 12px; }
.invite-kind-operator { border-color: var(--coral); color: var(--coral); }
.invite-accepted .invite-state { border-color: var(--lime); color: var(--lime); }
.invite-expired .invite-state, .invite-account_deleted .invite-state, .invite-account_trashed .invite-state { color: var(--muted); }
.invite-counts { justify-content: flex-start; gap: 32px; }
.account-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.account-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.account-tab span { padding: 1px 7px; background: var(--ink); border: 1px solid var(--line); font-size: 12px; }
.account-tab:hover { color: var(--paper); }
.account-tab.is-active { color: var(--lime); border-bottom-color: var(--lime); font-weight: 700; }
.account-badges { gap: 6px; flex-wrap: wrap; }
.account-badge { display: inline-flex; padding: 2px 8px; border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.account-user { color: var(--paper); }
.account-operator { border-color: var(--coral); color: var(--coral); background: rgba(255, 128, 115, .08); }
.account-request { border-color: #e0b44a; color: #e0b44a; }
.account-status-active { color: var(--lime); border-color: rgba(214, 255, 94, .35); }
.account-status-locked, .account-status-pending_deletion { color: var(--coral); }
.admin-user-row.is-operator { border-left: 3px solid var(--coral); padding-left: 12px; }
.admin-modal-label { margin: 18px 0 8px; font-size: 13px; color: var(--muted); }
.button-link.is-on { border-color: var(--lime); color: var(--lime); }
.registration-panel { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); background: var(--ink); border-left-width: 4px; }
.registration-panel.is-open { border-left-color: var(--lime); }
.registration-panel.is-closed { border-left-color: var(--coral); }
.registration-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.registration-head > div { display: grid; gap: 4px; }
.registration-label { font-weight: 750; font-size: 16px; }
.registration-scope { color: var(--muted); font-size: 12px; }
.registration-state { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 18px; font-weight: 750; }
.is-open .registration-state { color: var(--lime); }
.is-closed .registration-state { color: var(--coral); }
.state-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.registration-last { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.registration-last span { color: var(--paper); }
.switch {
  position: relative; flex: none; width: 58px; height: 32px; min-height: 0; padding: 0; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #3a1d1d; transition: background .2s, border-color .2s;
}
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--coral); transition: transform .2s, background .2s; }
.switch.is-on { background: #243015; border-color: var(--lime); }
.switch.is-on .switch-thumb { transform: translateX(26px); background: var(--lime); }
.switch:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
textarea { background: var(--ink); color: var(--paper); border: 1px solid var(--line); padding: 10px 12px; font: inherit; resize: vertical; }
.audit-reason { color: var(--paper); font-family: inherit; }
.admin-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-page-head h1 { margin-bottom: 6px; }
.admin-page-head .lead { margin: 0; }
.admin-head-actions { flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.account-table-wrap { border: 1px solid var(--line); overflow-x: auto; }
.account-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.account-table th { position: sticky; top: 0; background: var(--ink); font-size: 12px; }
.account-table td { vertical-align: middle; }
.account-table td strong { display: block; font-size: 14px; }
.account-table td > span { margin-top: 2px; }
.account-table tbody tr:hover { background: rgba(255, 255, 255, .02); }
.account-row.is-operator td:first-child { box-shadow: inset 3px 0 0 var(--coral); }
.account-actions { text-align: right; white-space: nowrap; }
/* Every popup scrolls on its own and never hands the scroll on to the page (header-menu.js). */
[popover] { overscroll-behavior: contain; }
/* Popups opened from a table cell must not inherit the cell's alignment or no-wrap. */
.modal[popover], .sitemap-panel[popover] { text-align: left; white-space: normal; }
.manage-button { min-height: 36px; padding: 0 14px; font-size: 13px; }
.account-empty { text-align: center; color: var(--muted); padding: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex !important; margin: 0 !important; padding: 2px 8px; border: 1px solid var(--line); font-size: 12px; color: var(--paper) !important; white-space: nowrap; }
.chip-on { border-color: rgba(214, 255, 94, .45); color: var(--lime) !important; }
.chip-operator { border-color: rgba(255, 128, 115, .45); color: var(--coral) !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.admin-user-modal { width: min(560px, calc(100% - 48px)) !important; }
.admin-user-modal h2 { margin-bottom: 8px !important; }
.manage-meta { margin: 0 0 12px; color: var(--muted); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.manage-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; display: grid; gap: 12px; }
.manage-section h3 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 700; }
.manage-products { list-style: none; margin: 0; padding: 0; }
.manage-products li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.manage-products li:last-child { border-bottom: 0; }
.manage-products .button-link { min-height: 36px; padding: 0 14px; }
.danger-link { color: var(--coral); }
.danger-link:hover { border-color: var(--coral); color: var(--coral); }
.usage { display: grid; gap: 6px; min-width: 120px; }
.usage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.usage-top span { margin: 0 !important; font-size: 12px; white-space: nowrap; }
.usage-bar { height: 6px; background: #25272b; overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--lime); }
.usage-bar.is-warning i { background: #e0b44a; }
.usage-bar.is-critical i { background: var(--coral); }
.server-up { color: var(--lime); }
.server-stale, .server-missing { color: var(--coral); }
.monitoring-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 12px; }
.monitoring-summary article { display: grid; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); background: var(--ink); border-top-width: 3px; min-width: 0; }
.monitoring-summary article > span { color: var(--muted); font-size: 12px; }
.monitoring-summary article > strong { font-size: 26px; line-height: 1.1; }
.monitoring-summary .is-up { border-top-color: var(--lime); }
.monitoring-summary .is-up strong { color: var(--lime); }
.monitoring-summary .is-warning { border-top-color: #e0b44a; }
.monitoring-summary .is-warning strong { color: #e0b44a; }
.monitoring-summary .is-down { border-top-color: var(--coral); }
.monitoring-summary .is-down strong { color: var(--coral); }
.monitoring-summary .monitoring-updated strong { font-size: 15px; font-weight: 600; }
.service-up { color: var(--lime); }
.service-down { color: var(--coral); }
.sitemap-panel[popover] {
  position: fixed; inset: 64px 20px auto auto; margin: 0; width: min(320px, calc(100% - 32px));
  background: var(--surface); color: var(--paper); border: 1px solid var(--line); padding: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.sitemap-panel::backdrop { background: rgba(6, 7, 8, .74); backdrop-filter: blur(3px); }
.sitemap-title { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.sitemap-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sitemap-panel li a, .sitemap-panel li.is-missing { display: grid; gap: 2px; padding: 10px 12px; min-height: 48px; text-decoration: none; color: var(--paper); border: 1px solid transparent; }
.sitemap-panel li a:hover, .sitemap-panel li a:focus-visible { border-color: var(--lime); }
.sitemap-panel li a strong::after { content: " ↗"; color: var(--muted); font-weight: 400; }
.sitemap-panel li span { color: var(--muted); font-size: 12px; }
.sitemap-panel li.is-missing { opacity: .55; }
.client-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; }
.client-card { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); background: var(--ink); min-width: 0; }
.client-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.client-head > div { display: grid; gap: 4px; }
.client-policy-form fieldset label { font-size: 13px; }
.client-policy-form .check-group { gap: 10px; padding: 8px 14px 14px; }
.client-events { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 12px; }
.event-delivered { color: var(--lime); }
.event-failed { color: var(--coral); }
.secret-once { display: inline-block; margin: 6px 0; padding: 6px 8px; background: var(--ink); color: var(--paper); user-select: all; overflow-wrap: anywhere; }
.passkey-login { display: grid; gap: 6px; margin-top: 10px; }
.passkey-button { width: 100%; }
.passkey-section .passkey-button { width: auto; }
.passkey-status:empty { display: none; }
.passkey-status.is-error { color: var(--coral); }
.passkey-list { margin-bottom: 8px; }
.client-preset-now { margin: 0; font-size: 14px; }
.client-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border: 1px solid var(--line); }
.client-status li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.client-status li:last-child { border-bottom: 0; }
.client-status li span { color: var(--muted); }
.client-status li strong { color: var(--muted); font-weight: 600; text-align: right; }
.client-status li.is-on strong { color: var(--lime); }
.client-actions { flex-wrap: wrap; gap: 8px; }
.client-actions button { min-height: 40px; padding: 0 14px; font-size: 13px; }
.client-modal { width: min(600px, calc(100% - 48px)) !important; }
.preset-option { min-height: 0; padding: 12px 0; align-items: flex-start; }
.preset-option small { margin-top: 4px; line-height: 1.5; }
.preset-option input { margin-top: 2px; }
.client-advanced { border: 1px solid var(--line); padding: 10px 14px; }
/* details does not lay out its children as a grid in Safari, so the fields get their own box. */
.client-advanced-body { display: grid; gap: 16px; margin-top: 14px; }
.client-advanced-body > label:not(.check-option) { display: grid; gap: 8px; }
.client-advanced-body .check-option + .check-option { margin-top: -16px; }
.client-advanced-body .check-option:last-child { border-bottom: 0; }
.client-advanced[open] { padding-bottom: 14px; }
.client-advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.notice-inline { border-left: 3px solid #e0b44a; padding: 8px 12px; background: var(--ink); }
.client-actions .needs-attention { border-color: var(--coral); color: var(--coral); }
.client-events-title { margin: 12px 0 0; font-weight: 700; color: var(--coral); }
.client-events-ok { margin: 12px 0; color: var(--lime); }
.client-events-more summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.federation-section { display: grid; gap: 14px; margin-top: 12px; }
.federation-section h2 { margin: 0; }
.federation-summary { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important; }
.federation-summary small { color: var(--muted); font-size: 12px; }
.monitoring-chart.federation-chart { min-height: 240px; min-width: 0; width: 100%; }
.federation-summary article strong { color: var(--lime) !important; }
.federation-summary .fed-failed { color: var(--coral); font-weight: 700; }
.federation-failures-title { margin: 6px 0 0; font-size: 15px; color: var(--coral); }
.audit-filter { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.audit-range { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }
.audit-range.is-hidden { display: none; }
.audit-filter:has(select[name=period] option[value=custom]:checked) .audit-range { display: grid; }
.audit-filter-actions { gap: 8px; }
.audit-filter-actions > * { min-height: 46px; }
.audit-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.audit-chips::-webkit-scrollbar { display: none; }
.audit-chip { flex: none; padding: 6px 12px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px; border-radius: 999px; }
.audit-chip.is-active { border-color: var(--lime); color: var(--lime); }
.audit-count { margin: 0; color: var(--muted); font-size: 13px; }
.audit-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); }
.audit-day { padding: 8px 14px; background: var(--ink); color: var(--muted); font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.audit-row { display: grid; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.audit-row:last-child { border-bottom: 0; }
.audit-row.is-warning { box-shadow: inset 3px 0 0 var(--coral); }
.audit-row.is-warning strong { color: var(--coral); }
.audit-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.audit-time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.audit-main strong { font-size: 14px; }
.audit-cat { font-size: 11px; padding: 1px 7px; margin-left: auto; }
.audit-sub { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.audit-code { opacity: .6; }
.audit-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.audit-pair { display: inline-flex; gap: 6px; padding: 2px 8px; background: var(--ink); border: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; max-width: 100%; }
.audit-pair em { font-style: normal; color: var(--muted); white-space: nowrap; flex: none; }
.audit-pages { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.audit-pages .ghost { min-height: 40px; }
.env-badge { flex: none; padding: 3px 10px; border: 1px solid; font-size: 12px; font-weight: 800; letter-spacing: .02em; margin-right: auto; margin-left: 12px; }
.env-production { color: var(--coral); border-color: var(--coral); background: rgba(255, 128, 115, .12); }
.env-staging { color: #e0b44a; border-color: #e0b44a; background: rgba(224, 180, 74, .12); }
.env-dev { color: var(--muted); border-color: var(--line); }
.admin-menu-panel[popover] { width: min(360px, calc(100% - 32px)); display: none; }
.admin-menu-panel[popover]:popover-open { display: grid; gap: 14px; }
.admin-menu-group { display: grid; gap: 2px; align-content: start; }
.admin-menu-group p { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.admin-menu-group a { color: var(--paper); text-decoration: none; padding: 9px 10px; border: 1px solid transparent; }
.nav .admin-menu-group a { display: flex; min-height: 40px; padding: 8px 10px; font-size: 14px; }
.admin-menu-group a:focus-visible { border-color: var(--lime); }
@media (hover: hover) { .admin-menu-group a:hover { border-color: var(--lime); } }
.admin-menu-panel[popover] { height: auto; bottom: auto; max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain; }
.admin-menu-panel[popover]:popover-open { align-content: start; align-items: start; grid-auto-rows: max-content; }
/* Both header menus dim the page the same way; header-menu.js keeps the page still. */
.sitemap-panel[popover] { max-height: calc(100dvh - 88px); overflow-y: auto; overscroll-behavior: contain; }

.acl-grant-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.acl-grant-card { display: grid !important; grid-template-columns: 1fr !important; gap: 10px; padding: 16px; border: 1px solid var(--line); background: var(--ink); align-content: start; }
.acl-grant-card h2 { margin: 0; font-size: 16px; }
.acl-list-title { margin: 8px 0 0; font-size: 16px; }
.admin-acl-row .chips { margin-top: 6px; }
.recovery-warning { margin: 0 0 8px; padding: 10px 12px; border-left: 3px solid #e0b44a; background: var(--ink); color: #e0b44a; font-size: 13px; line-height: 1.6; }
.recovery-warning.is-critical { border-left-color: var(--coral); color: var(--coral); }
details.manual-entry > summary { list-style: none; cursor: pointer; }
details.manual-entry > summary::-webkit-details-marker { display: none; }
details.manual-entry > summary h2::after { content: " +"; color: var(--muted); font-weight: 400; }
details.manual-entry[open] > summary h2::after { content: " −"; }
details.manual-entry:not([open]) { padding-bottom: 16px; }
.invite-counts { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px !important; }
/* Operator invites never carry product grants. */
.admin-invite-modal form:has(input[name="kind"][value="operator"]:checked) .invite-products { display: none; }
.admin-invite-modal form { gap: 16px; }
.primary, .danger, .ghost, .button-link, .social {
  min-height: 48px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; text-decoration: none; border: 0; cursor: pointer; font-weight: 700; font-size: 14px;
  transition: background .2s, border-color .2s, color .2s;
}
.primary { background: var(--lime); color: var(--ink); }
.primary:hover { background: #e1ff7d; }
.danger { background: var(--coral); color: var(--ink); }
.danger:hover { background: #ff9f96; }
.ghost, .button-link { background: transparent; color: var(--paper); border: 1px solid var(--line); }
.ghost:hover, .button-link:hover { border-color: var(--lime); color: var(--lime); }
.socials { display: grid; gap: 10px; margin: 18px 0; }
.social { gap: 10px; border: 1px solid transparent; border-radius: 4px; }
.social svg { flex: 0 0 auto; }
.social.naver { background: #03c75a; color: #fff; }
.social.kakao { background: #fee500; color: #191919; }
.social.google { background: #fff; color: #1f1f1f; border-color: #747775; }
.social:hover { filter: brightness(1.05); }
.or, .alt { text-align: center; font-size: 13px; }
.alt a { color: var(--lime); }
.alt a:hover { text-decoration: underline; }
.banner { padding: 12px 14px; margin-bottom: 16px; border-left: 3px solid transparent; }
.banner.error { background: #3a1d1d; color: var(--coral); border-color: var(--coral); }
.banner.notice { background: #243015; color: var(--lime); border-color: var(--lime); }
.list { list-style: none; padding: 0; margin: 0 0 24px; }
.list li {
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.list li > div:first-child { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.list li > form, .list li > a, .list li .row { flex-shrink: 0; white-space: nowrap; }
.list span, .muted { color: var(--muted); font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; }
.inline-form { display: inline-flex; }
.admin-card { display: grid; gap: 22px; }
.admin-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px; border: 1px solid var(--line); background: var(--ink);
}
.admin-summary > div { display: grid; gap: 5px; }
.admin-summary span { color: var(--muted); font-size: 13px; }
.admin-links, .admin-actions, .acl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-search { grid-template-columns: minmax(0, 1fr) minmax(160px, .4fr) auto; align-items: end; }
.admin-user-manage { margin-top: 4px; }
.admin-user-manage summary { cursor: pointer; font-weight: 700; }
.admin-user-manage form { margin-top: 12px; }
.manual-card { gap: 18px; }
.manual-search { grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr) auto; align-items: end; }
.manual-categories { display: flex; flex-wrap: wrap; gap: 8px; }
.manual-chip {
  min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 700;
}
.manual-chip:hover, .manual-chip.active { border-color: var(--lime); color: var(--lime); }
.manual-result { margin: 0; color: var(--muted); font-size: 13px; }
.manual-result strong { color: var(--paper); }
.manual-results { display: grid; gap: 14px; }
.manual-entry { padding: 22px; border: 1px solid var(--line); background: var(--ink); }
.manual-entry-head { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.manual-entry-head h2 { margin: 0; font-size: 21px; letter-spacing: -.5px; }
.manual-entry-head p { margin: 0; color: var(--muted); line-height: 1.65; }
.manual-category { color: var(--lime); font-size: 12px; font-weight: 700; letter-spacing: .4px; }
.manual-body { color: var(--muted); line-height: 1.75; }
.manual-body p { margin: 10px 0; }
.manual-body h3 { margin: 18px 0 8px; color: var(--paper); font-size: 16px; }
.manual-body ol, .manual-body ul { padding-left: 22px; }
.manual-body li + li { margin-top: 7px; }
.manual-body strong, .manual-body code { color: var(--paper); }
.manual-body a { color: var(--lime); text-decoration: underline; text-underline-offset: 3px; }
.manual-editor-field { display: grid; gap: 8px; }
.manual-editor-label { font-size: 12px; font-weight: 700; }
.manual-toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.manual-toolbar .ghost { min-height: 34px; padding: 0 10px; font-size: 12px; }
.manual-editor textarea { width: 100%; min-height: 330px; resize: vertical; }
.manual-preview-panel, .manual-shortcut { border: 1px solid var(--line); padding: 16px; margin: 0; }
.manual-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.manual-preview-head span { color: var(--muted); font-size: 12px; }
.manual-preview { min-height: 76px; padding-top: 4px; }
.manual-shortcut { display: grid; gap: 12px; }
.manual-shortcut legend { padding: 0 6px; font-weight: 700; }
.manual-shortcut-preview { margin: 0; padding: 10px 12px; border-left: 2px solid var(--lime); background: var(--ink); color: var(--muted); font-size: 13px; }
.manual-action { margin-top: 6px; min-height: 40px; }
.manual-empty { display: grid; gap: 8px; padding: 30px 22px; border: 1px dashed var(--line); text-align: center; }
.manual-empty span { color: var(--muted); font-size: 13px; }
.manual-empty a { color: var(--lime); font-size: 13px; }
.admin-users { margin-bottom: 0; }
.admin-user-row { align-items: flex-start !important; }
.admin-actions { justify-content: flex-end; }
.admin-actions form, .acl-actions form { display: block; }
.admin-actions .button-link, .acl-actions .button-link { min-height: 38px; padding: 0 12px; font-size: 12px; }
.admin-grant {
  display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end; gap: 12px;
}
.admin-acl-row { align-items: flex-start !important; }
.mono { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12px !important; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td span { display: block; margin-top: 4px; color: var(--muted); }
.table-scroll tr:last-child td { border-bottom: 0; }
.legal .prose { color: var(--muted); line-height: 1.8; }
.profile-summary { margin: 0 0 28px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.password-summary { margin: 0 0 28px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.profile-summary p, .password-summary p { margin: 0 0 6px; }
.profile-summary button, .password-summary button { margin-top: 10px; }
.mfa-key, .mfa-uri, .recovery-codes { margin: 18px 0; }
.mfa-qr { display: flex; justify-content: center; margin: 20px 0; }
.mfa-qr img { display: block; width: min(240px, 100%); height: auto; padding: 10px; background: #fff; border-radius: 10px; }
.mfa-key { display: grid; gap: 8px; }
.mfa-key code, .mfa-uri code, .recovery-codes code { overflow-wrap: anywhere; font-size: .92rem; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding-left: 24px; }
.mfa-recovery-management { margin: -12px 0 24px; }
.mfa-recovery-management .hint { margin-bottom: 10px; }
.mfa-recovery-management .hint strong { color: var(--paper); }
.mfa-recovery-actions { display: grid; gap: 10px; margin-top: 24px; }
.mfa-uri summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.mfa-uri summary:hover { color: var(--lime); }
.mfa-uri[open] summary { margin-bottom: 12px; }
.mfa-help-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -16px 0 28px; }
.mfa-help-actions .ghost { min-height: 40px; padding: 0 12px; font-size: 13px; }
.mfa-help-steps { display: grid; gap: 14px; margin: 20px 0; padding-left: 24px; color: var(--muted); line-height: 1.65; }
.mfa-help-steps strong { display: block; margin-bottom: 3px; color: var(--paper); }
.mfa-help-note { margin: 20px 0 0; padding: 12px 14px; border-left: 3px solid var(--lime); background: #202718; color: var(--muted); line-height: 1.65; }
.mfa-help-note strong { color: var(--paper); }
.modal[popover] {
  position: fixed; inset: 0; margin: auto;
  background: var(--surface); color: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 48px 44px 40px; width: min(520px, calc(100% - 48px)); max-height: calc(100% - 48px); overflow: auto;
  box-shadow: 0 32px 80px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(14px) scale(.98);
  transition: opacity .28s ease, transform .28s ease, overlay .28s ease allow-discrete, display .28s ease allow-discrete;
}
.modal[popover]:popover-open { opacity: 1; transform: translateY(0) scale(1); }
@starting-style {
  .modal[popover]:popover-open { opacity: 0; transform: translateY(14px) scale(.98); }
}
.modal[popover]::backdrop {
  background: rgba(6, 7, 8, 0); backdrop-filter: blur(0);
  transition: background .28s ease, backdrop-filter .28s ease, overlay .28s ease allow-discrete, display .28s ease allow-discrete;
}
.modal[popover]:popover-open::backdrop { background: rgba(6, 7, 8, .74); backdrop-filter: blur(3px); }
.modal[popover] h2 { font-size: 28px; letter-spacing: -1.2px; margin: 0 0 24px; }
.modal-close {
  position: absolute; top: 22px; right: 22px; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 22px; line-height: 1;
}
.modal-close:hover { border-color: var(--lime); color: var(--lime); }
.deploy-target { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.deploy-target:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.deploy-target h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; margin: 0; }
.deploy-target h2 .eyebrow { margin: 0; }
.deploy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.deploy-grid article { display: grid; gap: 7px; padding: 16px; border: 1px solid var(--line); background: var(--ink); min-width: 0; }
.deploy-grid article > span { color: var(--muted); font-size: 12px; }
.deploy-grid code { overflow-wrap: anywhere; }
.monitoring-history-heading { display: flex; gap: 18px; align-items: end; justify-content: space-between; }
.monitoring-history-heading h2 { margin-bottom: 6px; }
.monitoring-history-heading .hint { margin: 0; }
.monitoring-history-toolbar { display: flex; gap: 18px; align-items: end; justify-content: space-between; }
.monitoring-history-toolbar h2 { margin-bottom: 6px; }
.monitoring-history-toolbar .hint { margin: 0; }
.monitoring-range-selector { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.monitoring-range-button { padding: 8px 12px; border: 1px solid var(--line); background: var(--ink); color: var(--muted); font-size: 12px; }
.monitoring-range-button:hover, .monitoring-range-button.active { border-color: var(--lime); color: var(--paper); }
.monitoring-range-button.active { background: rgba(214, 245, 106, .08); }
.monitoring-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.monitoring-legend span { display: inline-flex; align-items: center; gap: 6px; }
.monitoring-legend i { width: 10px; height: 10px; border: 1px solid var(--line); display: inline-block; }
.monitoring-legend .up { background: var(--lime); }
.monitoring-legend .down { background: var(--coral); }
.monitoring-legend .stale { background: var(--coral); }
.monitoring-legend .unknown { background: #25272b; }
/* isolation keeps the chart canvas and ECharts' high z-index tooltip inside this box,
   so they never paint over the sticky site header. */
.monitoring-chart-shell { overflow-x: auto; border: 1px solid var(--line); background: var(--ink); position: relative; z-index: 0; isolation: isolate; }
.monitoring-chart { width: 100%; min-width: 660px; min-height: 280px; }
.monitoring-history-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -10px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.monitoring-history-summary li { display: inline-flex; gap: 7px; }
.monitoring-history-summary strong { color: var(--paper); }
.deploy-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.deploy-actions form { padding: 18px; border: 1px solid var(--line); background: var(--ink); align-content: start; }
.deploy-actions h2 { font-size: 18px; margin: 0; }
.deploy-result { display: grid; gap: 6px; padding: 14px; border-left: 3px solid var(--line); background: var(--ink); }
.deploy-result.ok { border-color: var(--lime); }
.deploy-result.fail { border-color: var(--coral); }
.deploy-result > span { color: var(--muted); font-size: 12px; }
.deploy-result pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; line-height: 1.6; }
.deploy-help { border-top: 1px solid var(--line); padding-top: 16px; }
.deploy-help summary { cursor: pointer; font-weight: 700; }
.deploy-help p { margin-bottom: 0; }
.platform-registry { display: grid; gap: 28px; }
.platform-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.platform-heading > div:first-child { min-width: 0; max-width: 780px; }
.platform-heading .lead { margin-bottom: 0; }
.platform-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }
.platform-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--ink); }
.platform-summary article { display: grid; gap: 8px; padding: 16px 18px; border-right: 1px solid var(--line); }
.platform-summary article:last-child { border-right: 0; }
.platform-summary span { color: var(--muted); font-size: 12px; }
.platform-summary strong { color: var(--paper); font-size: 24px; line-height: 1; }
.platform-section { display: grid; gap: 16px; border-top: 1px solid var(--line); padding-top: 24px; }
.platform-section h2, .platform-registry h2, .platform-registry h3 { margin: 0; }
.platform-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.platform-section-head .hint { margin: 6px 0 0; }
.platform-filter { display: flex; align-items: end; gap: 10px; flex: 0 0 auto; }
.platform-filter label { min-width: 210px; }
.platform-table { background: var(--ink); }
.platform-table table { min-width: 980px; }
.platform-table.compact table { min-width: 720px; }
.platform-table th { background: rgba(255, 255, 255, .02); }
.platform-table td { vertical-align: middle; }
.platform-table code { overflow-wrap: anywhere; }
.platform-name, .platform-client, .platform-dates { min-width: 150px; }
.platform-name strong { display: block; margin-bottom: 5px; }
.platform-name code, .platform-client code { display: block; color: var(--paper); }
.platform-client span, .platform-dates span, .platform-endpoint-url { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.platform-environment-badge { display: inline-flex; margin: 0 0 6px; padding: 4px 8px; border: 1px solid var(--line); color: var(--paper); font-size: 12px; }
.platform-status { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border: 1px solid var(--line); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.platform-status.configured { border-color: var(--lime); color: var(--lime); }
.platform-status.missing { border-color: var(--coral); color: var(--coral); }
.platform-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 160px; }
.platform-actions button { min-height: 34px; padding: 0 10px; font-size: 12px; }
.platform-actions .ghost-danger { background: transparent; }
.platform-service { display: inline-flex; width: fit-content; margin: 2px 4px 2px 0; padding: 3px 7px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.platform-empty { padding: 22px 10px; color: var(--muted); text-align: center; }
.platform-modal-summary { margin-top: -10px; margin-bottom: 20px; }
.platform-edit-modal { width: min(620px, calc(100% - 48px)) !important; }
.admin-confirm-modal { width: min(500px, calc(100% - 48px)) !important; }
.admin-confirm-warning { margin: -8px 0 22px; padding: 14px 16px; border-left: 3px solid var(--coral); background: var(--ink); color: var(--muted); line-height: 1.65; }
.admin-confirm-actions { justify-content: flex-start; }
button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: 12px; }
  .nav { flex-wrap: wrap; gap: 12px; }
  .admin-shell { width: calc(100% - 24px); margin: 24px auto 56px; }
  h1 { font-size: 26px; }
  .admin-summary, .admin-user-row, .admin-acl-row { align-items: stretch !important; flex-direction: column; }
  .admin-search, .admin-grant, .manual-search { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; } /* iOS zooms into inputs under 16px */
  .admin-summary-actions > *, .admin-summary-actions form, .admin-summary-actions button { width: 100%; }
  .admin-panels { grid-template-columns: 1fr; }
  .env-badge { margin-left: 0; font-size: 11px; padding: 2px 8px; }
  .acl-grant-grid { grid-template-columns: 1fr; }
  .platform-table { border: 0; overflow: visible; }
  .platform-table thead { display: none; }
  .platform-table table, .platform-table tbody, .platform-table tr, .platform-table td { display: block; width: 100%; min-width: 0 !important; }
  .platform-table tr { border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; background: var(--ink); }
  .platform-table td { border: 0; padding: 6px 0; overflow-wrap: anywhere; }
  .platform-table td > * { justify-self: start; }
  .platform-table td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 12px; }
  .platform-table td:first-child { display: block; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .platform-table td:first-child::before, .platform-table .platform-actions-cell::before { content: none; }
  .platform-table .platform-actions-cell { display: block; padding-top: 10px; }
  .platform-table td > span, .platform-table td > code { display: block; width: fit-content; max-width: 100%; }
  .audit-filter { grid-template-columns: 1fr 1fr; }
  .audit-filter .audit-q, .audit-filter-actions { grid-column: 1 / -1; }
  .audit-filter-actions > * { flex: 1; }
  .audit-range { grid-template-columns: 1fr 1fr; }
  .audit-cat { margin-left: 0; }
  .client-grid { grid-template-columns: 1fr; }
  /* Compact header: logo and menu on one scrollable row instead of three wrapped rows. */
  .site-header { flex-wrap: nowrap !important; gap: 14px !important; padding: 8px 16px; }
  .brand img { width: 96px; height: 30px; }
  .nav { flex-wrap: nowrap !important; gap: 16px !important; overflow-x: auto; scrollbar-width: none; font-size: 13px; min-width: 0;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 24px; }
  .nav::-webkit-scrollbar { display: none; }
  .sitemap-panel[popover] { inset: 52px 12px auto 12px; width: auto; }
  .nav a, .nav button, .nav form { white-space: nowrap; flex: none; }
  .card { padding: 24px 16px 24px; }
  .admin-shell { width: calc(100% - 16px) !important; margin: 12px auto 48px !important; }
  .admin-card { gap: 16px; }
  .admin-card h2 { font-size: 20px; margin: 8px 0 0; }
  .lead { margin-bottom: 8px; font-size: 14px; }
  .monitoring-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .monitoring-summary article { padding: 10px 12px; }
  .monitoring-summary article > strong { font-size: 22px; }
  .monitoring-summary .monitoring-updated { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; }
  .monitoring-summary .monitoring-updated strong { font-size: 13px; text-align: right; }
  .service-table { border: 0; overflow: visible; }
  .service-table thead { display: none; }
  .service-table table, .service-table tbody, .service-table tr, .service-table td { display: block; width: 100%; }
  .service-table tr { border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; background: var(--ink); }
  .service-table td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: baseline; overflow-wrap: anywhere; }
  .service-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .service-table td:first-child { display: block; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .service-table td:first-child::before { content: none; }
  .service-table td > span { grid-column: 2; margin-top: -2px; }
  .server-table { border: 0; overflow: visible; }
  .server-table thead { display: none; }
  .server-table table, .server-table tbody, .server-table tr, .server-table td { display: block; width: 100%; }
  .server-table tr { border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 10px; }
  .server-table td { border: 0; padding: 6px 0; display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; }
  .server-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; }
  .admin-page-head { flex-direction: column; }
  .admin-head-actions, .admin-head-actions > * { width: 100%; }
  /* Table rows become cards on phones. */
  .account-table-wrap { border: 0; overflow: visible; }
  .account-table thead { display: none; }
  .account-table, .account-table tbody, .account-table tr, .account-table td { display: block; width: 100%; }
  .account-table tr { border: 1px solid var(--line); margin-bottom: 10px; padding: 12px 14px; background: var(--ink); }
  .account-row.is-operator { border-left: 3px solid var(--coral); }
  .account-row.is-operator td:first-child { box-shadow: none; }
  .account-table td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
  .account-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; flex: none; }
  .account-table td:first-child { display: block; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .account-table td:first-child::before { content: none; }
  .account-table td .chips { justify-content: flex-end; }
  .account-table td .modal .chips { justify-content: flex-start; }
  .account-actions { padding-top: 10px !important; }
  .account-actions::before { content: none !important; }
  .manage-button { width: 100%; min-height: 44px; }
  .admin-invite-bar { flex-direction: column; align-items: stretch; }
  .modal[popover] { padding: 56px 20px 28px; width: calc(100% - 24px); max-height: calc(100dvh - 24px); }
  .modal[popover] h2 { font-size: 24px; margin-bottom: 18px; }
  .modal-close { top: 14px; right: 14px; width: 40px; height: 40px; }
  .admin-actions { justify-content: flex-start; }
  .deploy-grid, .deploy-actions { grid-template-columns: 1fr; }
  .platform-heading, .platform-section-head { align-items: stretch; flex-direction: column; }
  .platform-toolbar { justify-content: flex-start; }
  .platform-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-summary article:nth-child(2) { border-right: 0; }
  .platform-summary article:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .platform-filter { align-items: stretch; flex-direction: column; }
  .platform-filter label { min-width: 0; }
  .monitoring-history-heading, .monitoring-history-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.admin-user-modal {
  max-width: 560px;
}
.admin-user-modal form {
  display: grid;
  gap: 14px;
}
.admin-user-modal .admin-actions {
  margin-top: 20px;
  flex-wrap: wrap;
}
.error-card .eyebrow { color: var(--coral); }
.error-card .eyebrow::before { background: var(--coral); }
.error-card .lead { margin-bottom: 12px; color: var(--paper); }
.error-actions { display: grid; margin-top: 28px; }
/* Six-box one-time code (otp.js). Without the script the plain input shows. */
.otp { display: grid; gap: 8px; }
.otp label { display: block; font-size: 13px; }
.otp-track { position: relative; }
.otp-boxes { display: none; }
.otp-ready .otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 56px)); gap: 10px; justify-content: center; }
.otp-box {
  display: grid; place-items: center; aspect-ratio: 5 / 6; min-height: 52px;
  background: var(--ink); border: 1px solid var(--line); border-radius: 10px;
  font: 600 26px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; color: var(--paper);
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.otp-box.filled { border-color: #4a4d52; }
.otp-box.active { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(214, 245, 106, .18); }
.otp-box.active:empty::after { content: ""; width: 2px; height: 26px; background: var(--lime); animation: otp-caret 1s steps(1) infinite; }
@keyframes otp-caret { 50% { opacity: 0; } }
.otp-shake { animation: otp-shake .42s cubic-bezier(.36, .07, .19, .97); }
@keyframes otp-shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .otp-shake { animation: none; } }
.otp-haptic { position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; clip-path: inset(50%); }
@media (prefers-reduced-motion: reduce) { .otp-box.active:empty::after { animation: none; } }
.otp-ready input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0;
  background: transparent; color: transparent; caret-color: transparent; font-size: 16px;
  letter-spacing: 0; outline: none; cursor: text; z-index: 1;
}
.otp-ready input::selection { background: transparent; }
/* Draw the boxes from the first paint when scripts run, so the plain input never flashes. */
@media (scripting: enabled) {
  .otp .otp-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 56px)); gap: 10px; justify-content: center; }
  .otp input {
    position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0;
    background: transparent; color: transparent; caret-color: transparent; font-size: 16px;
    letter-spacing: 0; outline: none; cursor: text; z-index: 1;
  }
  .otp input::selection { background: transparent; }
}
@media (max-width: 380px) { .otp-ready .otp-boxes, .otp .otp-boxes { gap: 6px; } .otp-box { font-size: 22px; min-height: 44px; } }
.field-error { margin: 2px 0 0; color: var(--coral); font-size: 13px; line-height: 1.6; text-align: center; }
.field-error span { display: block; color: var(--muted); font-size: 12px; }
.otp-invalid .otp-box { border-color: rgba(255, 138, 128, .7); }
.otp-invalid .otp-box.active { border-color: var(--lime); }
input[aria-invalid="true"] { border-color: rgba(255, 138, 128, .7); }
.otp-locked .otp-box { opacity: .45; border-style: dashed; }
.otp-locked input { cursor: not-allowed; }

/* Phones: direct admin links live in the grouped menu, so the header fits one line. */
@media (max-width: 720px) {
  .admin-nav > a { display: none; }
  .admin-nav { overflow: visible; }
}

@media (max-width: 720px) {
  .admin-menu-panel[popover]:popover-open { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; padding: 14px 12px; }
  .nav .admin-menu-group a { min-height: 40px; padding: 8px 6px; }
}

.pow-status { margin: 0; font-size: 12px; }

.passkey-nudge { display: flex; gap: 14px 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px; border: 1px solid var(--lime); background: var(--surface); }
.passkey-nudge[hidden] { display: none; }
.passkey-nudge p { margin: 0; }
.passkey-nudge-title { margin-bottom: 4px !important; }
.passkey-nudge-actions { display: flex; gap: 8px; flex: none; }
.passkey-nudge .passkey-status:empty { display: none; }
@media (max-width: 720px) { .passkey-nudge-actions { width: 100%; } .passkey-nudge-actions button { flex: 1; } }

/* PC: the header shows these admin links, so the menu leaves them out. */
@media (min-width: 721px) {
  .nav .admin-menu-group a.is-header-link, .nav .admin-menu-group.is-header-group { display: none; }
}

/* Sign-in: form then passkey; on a passkey device the passkey comes first (login-mode.js). */
.login-stack { display: flex; flex-direction: column; }
.login-other { display: none; }
.passkey-first .login-stack .password-login { display: none; }
.passkey-first .login-stack .passkey-login { order: -1; margin-top: 0; }
.passkey-first .login-stack .passkey-button { background: var(--lime); color: var(--ink); border-color: var(--lime); }
.passkey-first .login-stack .login-other { display: block; width: 100%; margin-top: 12px; text-align: center; }
