:root {
  color-scheme: light;
  --ink: #102a43;
  --muted: #627d98;
  --faint: #f0f4f8;
  --line: #d9e2ec;
  --paper: #ffffff;
  --canvas: #f7f9fb;
  --accent: #d97706;
  --accent-dark: #b45309;
  --success: #16825d;
  --danger: #b42318;
  --shadow: 0 18px 46px rgba(16, 42, 67, 0.08);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.site-header { background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--line); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 720; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; letter-spacing: .04em; }
.brand-mark.brand-icon { background: #fff url('/brand-icon.svg') center / 27px 27px no-repeat; border: 1px solid var(--line); }
.nav-links { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 14px; }
.nav-links a:hover, .text-link:hover { color: var(--accent-dark); }
.page-content { min-height: calc(100vh - 138px); padding-top: 60px; padding-bottom: 72px; }
.site-footer { min-height: 66px; display: flex; align-items: center; justify-content: space-between; color: #829ab1; font-size: 12px; border-top: 1px solid var(--line); }
.eyebrow { margin: 0 0 10px; color: var(--accent-dark); font-size: 11px; font-weight: 750; letter-spacing: .16em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 14px; font-size: clamp(32px, 5vw, 58px); line-height: 1.07; letter-spacing: -0.045em; }
h2 { margin-bottom: 10px; font-size: 25px; line-height: 1.2; letter-spacing: -0.025em; }
h3 { margin-bottom: 8px; font-size: 17px; }
.muted { color: var(--muted); }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 88px; align-items: center; min-height: 500px; }
.hero-lede { max-width: 520px; margin-bottom: 28px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; padding: 0 17px; border: 1px solid transparent; border-radius: 7px; font-weight: 650; font-size: 14px; transition: transform .18s ease, background .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: var(--accent-dark); }
.button-dark { background: var(--ink); color: #fff; }
.button-dark:hover { background: #243b53; }
.button-quiet { background: #fff; color: var(--ink); border-color: var(--line); }
.button-quiet:hover { border-color: #9fb3c8; background: var(--faint); }
.button-danger { background: #fff5f5; color: var(--danger); border-color: #f4c7c3; }
.button-danger:hover { background: #fee4e2; }
.button-small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.full-width { width: 100%; }
.text-link { color: var(--accent-dark); font-size: 14px; font-weight: 650; }
.hero-panel { padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.signal-line { display: flex; align-items: center; gap: 9px; padding-bottom: 25px; color: var(--muted); font-size: 13px; border-bottom: 1px solid var(--line); }
.signal-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px #d7f0e7; }
.signal-status { margin-left: auto; color: var(--success); font-size: 12px; font-weight: 700; }
.endpoint-preview { padding-top: 11px; }
.endpoint-preview div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--faint); color: var(--muted); font-size: 13px; }
.endpoint-preview div:last-child { border-bottom: 0; }
code { color: #334e68; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; overflow-wrap: anywhere; }
.home-band { padding-top: 56px; border-top: 1px solid var(--line); }
.section-heading, .page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > .muted { max-width: 300px; margin-bottom: 2px; font-size: 14px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.feature-item { padding-top: 18px; border-top: 2px solid var(--ink); }
.feature-index { display: block; margin-bottom: 22px; color: var(--accent-dark); font: 700 12px/1 "SFMono-Regular", Consolas, monospace; }
.feature-item p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.page-heading { align-items: center; }
.page-heading h1 { margin-bottom: 7px; font-size: 38px; }
.compact-heading { margin-bottom: 38px; }
.empty-state, .center-state { padding: 78px 24px; background: var(--paper); border: 1px dashed #b6c6d6; border-radius: 8px; text-align: center; }
.empty-mark, .error-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto 20px; border-radius: 50%; background: var(--faint); color: var(--accent-dark); font-size: 25px; }
.empty-state h2, .center-state h1 { margin-bottom: 8px; font-size: 26px; }
.empty-state p, .center-state .muted { max-width: 390px; margin: 0 auto 23px; font-size: 14px; }
.app-list { border-top: 1px solid var(--line); }
.app-row { display: flex; align-items: center; gap: 15px; min-height: 86px; padding: 14px 3px; border-bottom: 1px solid var(--line); transition: padding .18s ease, background .18s ease; }
.app-row:hover { padding-right: 10px; padding-left: 10px; background: #fff; }
.app-avatar, .user-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 9px; background: #d9e2ec; background-position: center; background-size: cover; color: #334e68; font-weight: 750; }
.app-avatar.has-image, .user-avatar.has-image, .auth-brand-mark.has-image { color: transparent; }
.app-avatar-large { width: 52px; height: 52px; }
.app-row-main { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 4px; }
.app-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row-main small, .app-row-meta small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row-meta { display: flex; align-items: center; gap: 20px; color: var(--muted); }
.form-card, .detail-card { padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 22px rgba(16, 42, 67, .035); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 23px 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-span-2 { grid-column: span 2; }
.field > span { color: var(--ink); font-size: 13px; font-weight: 700; }
.field em { color: var(--accent-dark); font-style: normal; }
.field small { color: var(--muted); font-size: 12px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; border: 1px solid #bcccdc; border-radius: 6px; outline: 0; background: #fff; color: var(--ink); }
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 119, 6, .13); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 28px; margin-top: 28px; border-top: 1px solid var(--line); }
.alert { padding: 14px 16px; margin-bottom: 24px; border: 1px solid; border-radius: 7px; font-size: 14px; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.alert-danger { border-color: #f4c7c3; background: #fff5f5; color: var(--danger); }
.alert-success { border-color: #b8dfcf; background: #f0fbf6; color: #126b4c; }
.heading-with-icon { display: flex; align-items: center; gap: 16px; min-width: 0; }
.heading-with-icon h1 { margin-bottom: 4px; }
.heading-with-icon .muted { margin-bottom: 0; max-width: 650px; }
.heading-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(270px, .8fr); gap: 20px; align-items: start; }
.detail-main, .detail-side { display: grid; gap: 20px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.card-heading h2 { margin-bottom: 0; font-size: 21px; }
.status-chip { padding: 5px 9px; border-radius: 20px; background: #e8f7f0; color: var(--success); font-size: 11px; font-weight: 700; }
.credential-list, .endpoint-list { border-top: 1px solid var(--line); }
.credential-row, .endpoint-list > div { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 15px; min-height: 55px; border-bottom: 1px solid var(--line); }
.credential-row > span, .endpoint-list > div > span { color: var(--muted); font-size: 12px; }
.copy-button { padding: 4px 7px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); font-size: 11px; }
.copy-button:hover { color: var(--ink); border-color: #9fb3c8; }
.card-note { margin: 17px 0 0; color: var(--muted); font-size: 12px; }
.meta-list { margin: 0; }
.meta-list div { display: flex; justify-content: space-between; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.meta-list div:last-child { border-bottom: 0; }
.meta-list dt { color: var(--muted); font-size: 12px; }
.meta-list dd { margin: 0; font-size: 13px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.danger-card { border-color: #f0d2cf; }
.danger-card .eyebrow { color: var(--danger); }
.danger-card h2 { margin-bottom: 19px; font-size: 18px; }
.danger-card form + form { margin-top: 10px; }
.redirect-card { margin-top: 20px; }
.uri-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.uri-list li { padding: 11px 12px; background: var(--faint); border-radius: 5px; }
.auth-wrap { display: grid; place-items: center; min-height: 650px; }
.auth-card { width: min(520px, 100%); padding: 42px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.auth-brand-mark { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 25px; border-radius: 16px; background: var(--ink); background-position: center; background-size: cover; color: #fff; font-size: 23px; font-weight: 800; }
.auth-card > .eyebrow { text-align: center; }
.auth-card h1 { margin-bottom: 12px; font-size: 28px; text-align: center; }
.auth-description { margin-bottom: 27px; color: var(--muted); font-size: 14px; text-align: center; }
.account-strip { display: flex; align-items: center; gap: 11px; padding: 12px; margin-bottom: 28px; background: var(--faint); border: 1px solid var(--line); border-radius: 7px; }
.account-strip > span:nth-child(2) { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.account-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-strip small { color: var(--muted); font-size: 11px; }
.account-strip a { color: var(--accent-dark); font-size: 11px; white-space: nowrap; }
.permission-block { padding: 20px 0 5px; border-top: 1px solid var(--line); }
.permission-block ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.permission-block li { display: flex; align-items: center; gap: 11px; }
.permission-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e8f7f0; color: var(--success); font-size: 12px; font-weight: 800; }
.permission-block li > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.permission-block strong { font-size: 13px; }
.permission-block small { color: var(--muted); font-size: 11px; }
.auth-consent-note { margin: 25px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.auth-actions form { display: flex; justify-content: flex-end; gap: 10px; width: 100%; }
.status-chip.status-pending { background: #fff4d6; color: #9a6700; }
.status-chip.status-approved { background: #e8f7f0; color: var(--success); }
.status-chip.status-rejected, .status-chip.status-suspended { background: #fff0ef; color: var(--danger); }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 26px; }
.admin-stat { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.admin-stat span, .admin-stat small { display: block; color: var(--muted); font-size: 12px; }
.admin-stat strong { display: block; margin: 7px 0 2px; font-size: 32px; line-height: 1; }
.admin-link-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.admin-link-card { display: flex; min-height: 140px; flex-direction: column; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; transition: border-color .18s ease, transform .18s ease; }
.admin-link-card:hover { border-color: #9fb3c8; transform: translateY(-1px); }
.admin-link-card strong { margin-bottom: 8px; font-size: 17px; }
.admin-link-card small { color: var(--muted); font-size: 12px; }
.admin-recent-card { margin-top: 20px; }
.admin-table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 920px; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
.admin-table th { background: var(--faint); color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table td > strong, .admin-table td > small, .admin-table td > code { display: block; }
.admin-table td small { color: var(--muted); margin-top: 4px; font-size: 11px; }
.admin-table .table-note { max-width: 180px; overflow-wrap: anywhere; }
.admin-action-stack { display: grid; gap: 6px; min-width: 250px; }
.admin-action-stack form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.admin-action-stack input { min-width: 0; padding: 6px 8px; border: 1px solid #bcccdc; border-radius: 5px; font-size: 11px; }
.admin-audit-list { display: grid; gap: 0; }
.admin-audit-list > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.admin-audit-list > div:last-child { border-bottom: 0; }
.admin-audit-list span { color: var(--muted); font-size: 12px; }
.admin-audit-list code { flex-basis: 100%; }
.admin-audit-full > div { padding: 16px 0; }
.privacy-grid { display: grid; gap: 0; }
.privacy-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) minmax(220px, 1.4fr); gap: 20px; align-items: end; padding: 18px 0; border-bottom: 1px solid var(--line); }
.privacy-row > div { display: flex; flex-direction: column; gap: 4px; }
.privacy-row > div strong { font-size: 14px; }
.privacy-row > div small { color: var(--muted); font-size: 11px; }
.privacy-row .field { gap: 6px; }
.privacy-row .field > span { font-size: 11px; }
.access-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; margin-top: 22px; }
.admin-note-card { margin-top: 20px; }
.admin-note-card p:last-child { margin-bottom: 0; font-size: 13px; }
.admin-list { display: grid; border-top: 1px solid var(--line); }
.admin-list-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.admin-list-row > div { display: flex; min-width: 0; flex-direction: column; gap: 4px; }
.admin-list-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.admin-form-card { margin-top: 20px; }
.permission-check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 22px; }
.permission-check-grid label { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 12px; }
.permission-check-grid input { accent-color: var(--accent); }

@media (max-width: 780px) {
  .shell { width: min(100% - 28px, 600px); }
  .page-content { padding-top: 38px; }
  .topbar { min-height: 62px; }
  .brand > span:last-child { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { grid-template-columns: 1fr; gap: 42px; min-height: auto; padding: 38px 0 65px; }
  h1 { font-size: 42px; }
  .feature-grid, .detail-grid { grid-template-columns: 1fr; }
  .section-heading, .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { align-self: stretch; }
  .form-grid { grid-template-columns: 1fr; }
  .field-span-2 { grid-column: auto; }
  .form-card, .detail-card, .auth-card { padding: 22px; }
  .credential-row, .endpoint-list > div { grid-template-columns: 1fr; gap: 5px; padding: 12px 0; }
  .credential-row .copy-button { justify-self: start; }
  .auth-wrap { min-height: auto; }
  .auth-card { margin: 20px 0; }
  .admin-stat-grid, .admin-link-grid { grid-template-columns: repeat(2, 1fr); }
  .privacy-row, .access-grid { grid-template-columns: 1fr; gap: 12px; }
  .permission-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 450px) {
  .nav-links { gap: 10px; }
  .nav-links > a:not(.button) { display: none; }
  h1 { font-size: 35px; }
  .auth-card h1 { font-size: 25px; }
  .hero-actions, .hero-actions .button { width: 100%; }
  .hero-actions { align-items: stretch; }
  .text-link { text-align: center; }
  .app-row-meta small { display: none; }
  .admin-stat-grid, .admin-link-grid, .permission-check-grid { grid-template-columns: 1fr; }
}
