:root {
  color-scheme: light;
  --navy: #07162c;
  --blue: #1769aa;
  --blue-light: #eaf4fc;
  --text: #132238;
  --muted: #68768a;
  --line: #dce4ed;
  --surface: #ffffff;
  --background: #f4f7fa;
  --shadow-sm: 0 8px 24px rgba(7, 22, 44, .06);
  --shadow-md: 0 18px 45px rgba(7, 22, 44, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--background);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.shell {
  display: grid;
  grid-template-columns: minmax(360px, 42%) 1fr;
  min-height: 100vh;
}

.brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 76px);
  color: white;
  background:
    radial-gradient(circle at 92% 15%, rgba(59, 153, 220, .34), transparent 30%),
    linear-gradient(145deg, #061326, #0a2746 65%, #0c3b66);
}

.brand-panel::after {
  position: absolute;
  right: -150px;
  bottom: -190px;
  width: 430px;
  height: 430px;
  content: "";
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(255,255,255,.035), 0 0 0 124px rgba(255,255,255,.025);
}

.brand { position: relative; z-index: 1; font-size: 1.45rem; font-weight: 900; letter-spacing: .12em; }
.brand span { color: #48a7e6; }
.brand-copy { position: relative; z-index: 1; max-width: 560px; }
.eyebrow { margin: 0 0 16px; color: #2b83c4; font-size: .72rem; font-weight: 800; letter-spacing: .18em; }
.brand-copy .eyebrow { color: #78bce9; }
.brand-copy h1 { margin: 0 0 24px; font-size: clamp(2.4rem, 5vw, 4.8rem); line-height: .98; letter-spacing: -.055em; }
.brand-copy > p:last-child { max-width: 520px; margin: 0; color: #bbcad9; font-size: 1rem; line-height: 1.75; }
.security-note { position: relative; z-index: 1; margin: 0; color: #8da2b7; font-size: .78rem; }

.main-panel { display: grid; place-items: center; padding: clamp(28px, 6vw, 90px); }
.auth-card { width: min(100%, 480px); }
.auth-card h2, .dashboard h2 { margin: 0; color: var(--navy); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.04em; }
.intro { margin: 16px 0 38px; color: var(--muted); }
form { display: grid; gap: 10px; }
label { margin-top: 12px; font-size: .82rem; font-weight: 750; }
input {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,105,170,.1); }
.password-field { position: relative; }
.password-field input { padding-right: 90px; }
.text-button { position: absolute; top: 0; right: 10px; height: 54px; padding: 0 8px; color: var(--blue); border: 0; background: transparent; font-size: .76rem; font-weight: 750; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  margin-top: 18px;
  padding: 0 20px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}
.primary-button { color: white; background: var(--blue); }
.primary-button:hover { background: #0e5c99; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.secondary-button { margin: 0; color: var(--blue); border: 1px solid #b9d3e7; background: white; }
.privacy { margin: 20px 0 0; color: #8490a0; font-size: .74rem; line-height: 1.55; }
.error { margin: 8px 0 0; color: #b42318; font-size: .82rem; }

.dashboard { width: min(100%, 960px); }
.dashboard-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; margin-bottom: 42px; }
.dashboard-header p:not(.eyebrow) { color: var(--muted); }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.resource-card { position: relative; min-height: 180px; overflow: hidden; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); transition: transform .2s,box-shadow .2s,border-color .2s; }
.resource-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 3px; content: ""; background: linear-gradient(90deg,var(--blue),#62b3e6); opacity: 0; transition: opacity .2s; }
.resource-card:hover { border-color: #c9dce9; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.resource-card:hover::before { opacity: 1; }
.resource-card header { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.resource-card h3 { margin: 0; font-size: 1rem; }
.resource-count { color: var(--blue); font-size: 1.55rem; font-weight: 850; }
.resource-card ul { margin: 18px 0 0; padding: 0; list-style: none; }
.resource-card li { overflow: hidden; padding: 7px 0; color: var(--muted); border-top: 1px solid #edf1f5; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.resource-state { margin: 22px 0 0; color: var(--muted); font-size: .82rem; }

.portal-mode .shell { grid-template-columns: 1fr; }
.portal-mode .brand-panel { display: none; }
.portal-mode .main-panel { display: block; padding: 0; }
.portal { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; background: #f5f7fa; }
.portal-sidebar { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 34px 22px 24px; color: white; background: linear-gradient(180deg,#07162c 0%,#092443 100%); }
.portal-sidebar::after { position: absolute; right: -105px; bottom: 90px; width: 240px; height: 240px; content: ""; border: 1px solid rgba(100,182,235,.11); border-radius: 50%; box-shadow: 0 0 0 40px rgba(92,166,218,.025),0 0 0 80px rgba(92,166,218,.018); pointer-events: none; }
.portal-brand { margin: 0; font-size: 1.05rem; font-weight: 900; letter-spacing: .1em; }
.portal-brand span { color: #58ace3; }
.portal-caption { margin: 5px 0 34px; color: #8294a9; font-size: .72rem; }
.portal-nav { position: relative; z-index: 1; display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 12px 14px; color: #9cafc2; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: left; font-size: .84rem; font-weight: 700; transition: color .18s,background .18s,transform .18s; }
.nav-item::before { display: grid; width: 25px; height: 25px; place-items: center; content: "•"; color: #68aeda; border-radius: 7px; background: rgba(91,168,219,.09); font-size: .75rem; }
.nav-item[data-view="overview"]::before { content: "▦"; }
.nav-item[data-view="applications"]::before { content: "◇"; }
.nav-item[data-view="analytics"]::before { content: "↗"; }
.nav-item[data-view="documentation"]::before { content: "≡"; }
.nav-item:hover { color: white; transform: translateX(2px); }
.nav-item.active { color: white; border-color: rgba(105,183,234,.12); background: linear-gradient(90deg,rgba(43,131,196,.28),rgba(43,131,196,.10)); box-shadow: inset 3px 0 #3b99dc; }
.portal-user { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1); }
.portal-user > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: #1769aa; font-weight: 850; }
.portal-user div { display: grid; min-width: 0; }
.portal-user strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.portal-user small { color: #7f92a7; font-size: .66rem; }
.portal-content { min-width: 0; padding: 0 clamp(24px, 4vw, 58px) 60px; }
.portal-topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 calc(clamp(24px, 4vw, 58px) * -1) 32px; padding: 24px clamp(24px, 4vw, 58px) 20px; border-bottom: 1px solid rgba(220,228,237,.8); background: rgba(245,247,250,.88); backdrop-filter: blur(14px); }
.portal-topbar .eyebrow { margin-bottom: 6px; }
.portal-topbar h2 { margin: 0; font-size: 1.85rem; letter-spacing: -.035em; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; color: #28734d; border: 1px solid #cde9d9; border-radius: 999px; background: #f0fbf5; font-size: .72rem; font-weight: 750; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #26a269; }
.welcome-card { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden; margin-bottom: 22px; padding: 34px; color: white; border: 1px solid rgba(94,174,225,.16); border-radius: 18px; background: radial-gradient(circle at 88% 15%,rgba(65,160,220,.32),transparent 30%),linear-gradient(120deg,#081c35,#0d4776); box-shadow: var(--shadow-md); }
.welcome-card::after { position: absolute; right: 100px; bottom: -100px; width: 210px; height: 210px; content: ""; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; box-shadow: 0 0 0 40px rgba(255,255,255,.025); }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card .eyebrow { color: #75b8e5; }
.welcome-card h3 { max-width: 650px; margin: 0; font-size: clamp(1.45rem,3vw,2.2rem); letter-spacing: -.035em; }
.welcome-card p:last-child { margin: 10px 0 0; color: #b5c9dc; }
.api-badge { display: grid; width: 90px; height: 90px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; background: rgba(255,255,255,.08); }
.api-badge span { align-self: end; font-size: .72rem; letter-spacing: .15em; }
.api-badge strong { align-self: start; font-size: 1.8rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.section-heading h3, .docs-content h3 { margin: 0; font-size: 1.5rem; }
.section-heading p { margin: 7px 0 0; color: var(--muted); }
.primary-button.compact { min-height: 44px; margin: 0; }
.applications-list { display: grid; gap: 14px; }
.empty-state { padding: 50px 25px; color: var(--muted); border: 1px dashed #cbd7e2; border-radius: 12px; background: white; text-align: center; }
.empty-state strong { color: var(--text); }
.application-card { display: grid; grid-template-columns: 52px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); transition: border-color .2s,box-shadow .2s; }
.application-card:hover { border-color: #c7dae8; box-shadow: var(--shadow-md); }
.application-icon { display: grid; width: 48px; height: 48px; place-items: center; color: var(--blue); border-radius: 11px; background: var(--blue-light); font-weight: 900; }
.application-title { display: flex; align-items: center; gap: 10px; }
.application-title h4 { margin: 0; }
.application-title span { padding: 4px 7px; color: #28734d; border-radius: 5px; background: #eaf8f0; font-size: .65rem; font-weight: 800; }
.application-card p { margin: 7px 0; color: var(--muted); font-size: .8rem; }
.application-card code { color: var(--blue); font-size: .75rem; }
.application-card small { display: block; margin-top: 8px; color: #8b96a5; }
.application-card.is-suspended { opacity: .72; }
.application-body { min-width: 0; }
.status-tag.active { color: #28734d; background: #eaf8f0; }
.status-tag.suspended { color: #9b4d18; background: #fff1e6; }
.client-id { display: flex; align-items: center; gap: 10px; margin: 14px 0 11px; padding: 9px 11px; border-radius: 7px; background: #f5f8fb; }
.client-id span { color: var(--muted); font-size: .65rem; font-weight: 850; text-transform: uppercase; }
.client-id code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-id button, .application-footer button { margin-left: auto; padding: 5px 8px; color: var(--blue); border: 0; border-radius: 5px; background: #e8f3fb; font-size: .68rem; font-weight: 800; }
.scope-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.scope-tags span { padding: 5px 8px; color: #536477; border: 1px solid #dce5ed; border-radius: 999px; font-size: .65rem; }
.application-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 13px; }
.application-footer div { display: flex; gap: 7px; }
.application-footer button { margin: 0; color: #526579; background: #eef2f6; }
.docs-layout { display: grid; grid-template-columns: 180px minmax(0,760px); gap: 42px; }
.docs-menu { position: sticky; top: 30px; display: grid; align-content: start; gap: 12px; height: fit-content; }
.docs-menu a { color: var(--muted); text-decoration: none; font-size: .8rem; }
.docs-content { padding: clamp(26px,4vw,44px); border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow-sm); }
.docs-content > p { color: var(--muted); line-height: 1.7; }
.docs-content h4 { margin: 34px 0 10px; font-size: 1.05rem; }
.base-url { display: flex; align-items: center; gap: 12px; margin: 25px 0; padding: 14px; border-radius: 8px; background: #f4f7fa; }
.base-url span { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.base-url code { overflow: hidden; text-overflow: ellipsis; }
.copy-button { margin-left: auto; color: var(--blue); border: 0; background: transparent; font-size: .72rem; font-weight: 800; }
pre { overflow: auto; padding: 18px; color: #c7d9eb; border-radius: 9px; background: #07162c; line-height: 1.65; }
.endpoint-list { display: grid; gap: 8px; }
.endpoint-list > div { display: grid; grid-template-columns: 48px 140px 1fr; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e5ebf1; border-radius: 7px; }
.endpoint-list p { margin: 0; color: var(--muted); font-size: .78rem; }
.method { color: #22734c; font-size: .68rem; font-weight: 900; }
.method.post { color: #1769aa; }
.app-modal { width: min(92vw,540px); padding: 0; border: 0; border-radius: 15px; box-shadow: 0 28px 80px rgba(7,22,44,.28); }
.app-modal::backdrop { background: rgba(4,14,28,.62); backdrop-filter: blur(3px); }
.app-modal form { padding: 28px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-heading h3 { margin: 0; font-size: 1.5rem; }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #eef2f6; font-size: 1.25rem; }
select { width: 100%; height: 54px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.scope-fieldset { margin: 18px 0 6px; padding: 0; border: 0; }
.scope-fieldset legend { margin-bottom: 9px; font-size: .76rem; font-weight: 750; }
.scope-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.scope-grid label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; font-size: .75rem; }
.scope-grid input { width: auto; }
.compact-button { width: auto; min-height: 42px; }
.usage-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 18px; }
.usage-summary > article { position: relative; display: grid; gap: 9px; overflow: hidden; padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: white; box-shadow: var(--shadow-sm); }
.usage-summary > article::after { position: absolute; top: 0; right: 0; width: 48px; height: 48px; content: ""; border-radius: 0 0 0 48px; background: var(--blue-light); }
.usage-summary span { color: var(--muted); font-size: .72rem; }
.usage-summary strong { font-size: 1.75rem; letter-spacing: -.04em; }
.usage-summary .empty-state { grid-column: 1 / -1; }
.usage-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); }
.usage-panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.usage-panel-heading h4 { margin: 0; }
.usage-panel-heading span { color: var(--muted); font-size: .68rem; }
.usage-table-wrap { overflow-x: auto; }
.usage-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.usage-table th, .usage-table td { padding: 13px 18px; border-bottom: 1px solid #edf1f5; text-align: left; white-space: nowrap; }
.usage-table th { color: var(--muted); background: #fafbfd; font-size: .66rem; text-transform: uppercase; letter-spacing: .04em; }
.result-tag { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: .65rem; font-weight: 800; }
.result-tag.success { color: #28734d; background: #eaf8f0; }
.result-tag.error { color: #a63b31; background: #fceceb; }
.table-empty { padding: 35px !important; color: var(--muted); text-align: center !important; }

@media (max-width: 1100px) {
  .resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 840px) {
  .shell { grid-template-columns: 1fr; }
  .brand-panel { min-height: 280px; padding: 32px 24px; }
  .brand-copy h1 { margin-bottom: 14px; font-size: 2.5rem; }
  .brand-copy > p:last-child { display: none; }
  .main-panel { place-items: start center; padding: 54px 22px; }
  .portal-mode .main-panel { padding: 0; }
  .portal { grid-template-columns: 1fr; }
  .portal-sidebar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr; align-items: center; padding: 15px 20px; }
  .portal-caption, .portal-user { display: none; }
  .portal-nav { display: flex; justify-content: flex-end; }
  .nav-item { padding: 9px 10px; }
  .docs-layout { grid-template-columns: 1fr; }
  .docs-menu { position: static; display: flex; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .dashboard-header { flex-direction: column; }
  .resource-grid { grid-template-columns: 1fr; }
  .secondary-button { width: 100%; justify-content: center; }
  .portal-content { padding: 22px 16px 40px; }
  .portal-topbar { align-items: flex-start; }
  .topbar-actions .status-pill { display: none; }
  .topbar-actions .secondary-button { width: auto; }
  .welcome-card { padding: 23px; }
  .api-badge { display: none; }
  .resource-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .portal-sidebar { grid-template-columns: 1fr; gap: 12px; }
  .portal-nav { justify-content: flex-start; overflow-x: auto; }
  .docs-content { padding: 22px 17px; }
  .endpoint-list > div { grid-template-columns: 45px 1fr; }
  .endpoint-list p { grid-column: 2; }
  .application-footer { align-items: stretch; flex-direction: column; }
  .application-footer div { flex-wrap: wrap; }
  .usage-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Corporate flat direction */
.brand-panel { background: #071d36; }
.brand-panel::after, .portal-sidebar::after, .welcome-card::after, .usage-summary > article::after { display: none; }
.brand-copy h1 { max-width: 620px; font-size: clamp(2.7rem,5vw,5.2rem); line-height: 1.02; }
.main-panel { background: #fff; }
.auth-card { width: min(100%,440px); }
.auth-card .eyebrow { margin-bottom: 22px; }
.auth-card h2 { max-width: 400px; font-size: clamp(2.2rem,4vw,3.4rem); }
.auth-card .intro { margin: 18px 0 42px; font-size: .95rem; line-height: 1.6; }
.auth-card input, .app-modal input, .app-modal select { border: 0; border-radius: 0; background: #f0f3f6; box-shadow: inset 0 -2px transparent; }
.auth-card input:focus, .app-modal input:focus, .app-modal select:focus { border: 0; box-shadow: inset 0 -2px var(--blue); }
.primary-button, .secondary-button { border: 0; border-radius: 0; }
.secondary-button { background: #eaf0f5; }
.portal { background: #f3f5f7; }
.portal-sidebar { background: #071d36; }
.nav-item, .nav-item::before, .nav-item.active { border: 0; border-radius: 0; box-shadow: none; }
.nav-item::before { background: transparent; }
.nav-item.active { background: #123b62; box-shadow: none; }
.portal-user > span { border-radius: 0; }
.portal-topbar { border: 0; background: rgba(243,245,247,.94); }
.status-pill, .result-tag { border: 0; border-radius: 0; }
.welcome-card { border: 0; border-radius: 0; background: #0a3157; box-shadow: none; }
.api-badge { border: 0; border-radius: 0; background: #124a79; }
.resource-card { border: 0; border-radius: 0; box-shadow: none; }
.resource-card:hover { border: 0; box-shadow: none; transform: none; }
.resource-card::before { display: none; }
.empty-state { border: 0; border-radius: 0; background: #fff; }
.application-card { border: 0; border-radius: 0; box-shadow: none; }
.application-card:hover { border: 0; box-shadow: none; }
.application-icon, .application-title span, .client-id, .client-id button, .application-footer button, .scope-tags span { border: 0; border-radius: 0; }
.scope-tags span { background: #eef2f5; }
.docs-content { border: 0; border-radius: 0; box-shadow: none; }
.base-url, pre, .endpoint-list > div { border: 0; border-radius: 0; }
.endpoint-list > div { border-bottom: 1px solid #e6ebef; }
.usage-summary > article, .usage-panel { border: 0; border-radius: 0; box-shadow: none; }
.app-modal { width: min(94vw,720px); max-height: 92vh; padding: 0; overflow: auto; border: 0; border-radius: 0; box-shadow: 0 32px 90px rgba(2,17,33,.35); }
.app-modal:focus { outline: none; }
.app-modal::backdrop { background: rgba(3,17,32,.72); backdrop-filter: blur(2px); }
.app-modal form { display: block; padding: 0; }
.modal-heading { margin: 0; padding: 30px 34px 28px; color: #fff; background: #071d36; }
.modal-heading .eyebrow { margin-bottom: 10px; color: #62b3e6; }
.modal-heading h3 { color: #fff; font-size: 1.75rem; }
.modal-heading p:last-child { max-width: 520px; margin: 9px 0 0; color: #adbdcb; font-size: .83rem; line-height: 1.55; }
.icon-button { width: 38px; height: 38px; color: #fff; border: 0; border-radius: 0; background: rgba(255,255,255,.1); }
.modal-body { display: grid; gap: 19px; padding: 30px 34px 26px; }
.field-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.form-field { display: grid; gap: 8px; }
.form-field label { margin: 0; }
.form-field small { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.scope-fieldset { margin: 4px 0 0; }
.scope-fieldset legend { margin: 0 0 5px; font-size: .84rem; }
.scope-fieldset > p { margin: 0 0 12px; color: var(--muted); font-size: .73rem; }
.scope-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.scope-grid label { margin: 0; border: 0; border-radius: 0; background: #f0f3f6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 34px; background: #f3f5f7; }
.modal-actions .primary-button, .modal-actions .secondary-button { min-height: 48px; margin: 0; }
.modal-actions .secondary-button { color: #42546a; }

@media (max-width: 620px) {
  .field-grid, .scope-grid { grid-template-columns: 1fr; }
  .modal-heading, .modal-body { padding-right: 22px; padding-left: 22px; }
  .modal-actions { padding: 16px 22px; }
}

/* Overview, header and sidebar refinement */
.portal-sidebar { position: sticky; top: 0; height: 100vh; padding: 34px 24px 24px; }
.portal-branding { padding-bottom: 32px; }
.portal-brand { font-size: 1.15rem; letter-spacing: .13em; }
.portal-brand span { color: #48a7e6; }
.portal-caption { margin: 7px 0 0; color: #8195a9; font-size: .69rem; letter-spacing: .03em; }
.nav-label { margin: 0 14px 10px; color: #60778e; font-size: .62rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.portal-nav { gap: 3px; }
.nav-item { min-height: 48px; padding: 11px 14px; color: #9fb0c0; }
.nav-item:hover { background: #0d2b4a; transform: none; }
.nav-item.active { color: #fff; background: #1769aa; }
.nav-item.active::before { color: #fff; }
.sidebar-footer { position: relative; z-index: 1; display: grid; gap: 18px; margin-top: auto; }
.portal-environment { display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: #0d2b4a; }
.portal-environment > span { width: 8px; height: 8px; flex: 0 0 auto; background: #57c489; }
.portal-environment div { display: grid; gap: 2px; }
.portal-environment small { color: #7790a6; font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; }
.portal-environment strong { color: #d9e3ec; font-size: .75rem; }
.portal-user { margin: 0; padding-top: 18px; }
.portal-topbar { padding-top: 22px; padding-bottom: 22px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(7,22,44,.035); }
.topbar-title .eyebrow { margin-bottom: 6px; }
.topbar-title > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: .76rem; }
.portal-topbar h2 { font-size: 1.7rem; }
.status-pill { padding: 10px 13px; background: #edf7f1; }
.welcome-card { min-height: 270px; padding: 40px 44px; background: #0a3157; }
.welcome-copy { max-width: 650px; }
.welcome-card h3 { font-size: clamp(2rem,3.5vw,3.35rem); font-weight: 750; }
.welcome-card p:last-of-type { max-width: 520px; font-size: .96rem; line-height: 1.65; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.welcome-actions button { min-height: 44px; padding: 0 16px; color: #0a3157; border: 0; background: #fff; font-size: .73rem; font-weight: 800; }
.welcome-actions button + button { color: #fff; background: #1769aa; }
.overview-facts { display: grid; width: 190px; flex: 0 0 auto; }
.overview-facts > div { display: grid; gap: 3px; padding: 18px 20px; background: #082846; }
.overview-facts > div + div { margin-top: 2px; }
.overview-facts strong { color: #fff; font-size: 1.7rem; }
.overview-facts span { color: #8fabbe; font-size: .68rem; }
.overview-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin: 38px 0 18px; }
.overview-heading .eyebrow { margin-bottom: 7px; }
.overview-heading h3 { margin: 0; font-size: 1.42rem; }
.overview-heading > p { max-width: 420px; margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.55; text-align: right; }

@media (max-width: 840px) {
  .portal-sidebar { position: sticky; height: auto; padding: 15px 20px; }
  .portal-branding { padding: 0; }
  .nav-label, .sidebar-footer { display: none; }
  .topbar-title > p:last-child { display: none; }
}

@media (max-width: 620px) {
  .portal-content { padding-top: 0; }
  .portal-topbar { margin-bottom: 20px; padding-top: 18px; padding-bottom: 16px; }
  .welcome-card { min-height: 0; padding: 28px 22px; }
  .welcome-card h3 { font-size: 2.15rem; }
  .welcome-actions { align-items: stretch; flex-direction: column; }
  .overview-facts { display: none; }
  .overview-heading { align-items: flex-start; flex-direction: column; margin-top: 30px; }
  .overview-heading > p { text-align: left; }
}

/* Restrained administration interface */
.portal { grid-template-columns: 230px minmax(0,1fr); background: #f4f5f6; }
.portal-sidebar { padding: 28px 18px 22px; background: #0b2038; }
.portal-branding { padding: 0 10px 30px; }
.portal-brand { font-size: 1rem; }
.portal-caption { color: #8797a8; }
.portal-nav { gap: 2px; }
.nav-item { min-height: 44px; padding: 0 12px; font-size: .8rem; }
.nav-item::before { display: none; }
.nav-item:hover { background: #102b48; }
.nav-item.active { background: #174e7e; }
.sidebar-footer { gap: 0; }
.portal-user { padding: 18px 10px 0; }
.portal-user > span { width: 32px; height: 32px; background: #174e7e; font-size: .75rem; }
.portal-content { padding-right: clamp(24px,3vw,42px); padding-left: clamp(24px,3vw,42px); }
.portal-topbar { margin-right: calc(clamp(24px,3vw,42px) * -1); margin-left: calc(clamp(24px,3vw,42px) * -1); padding: 22px clamp(24px,3vw,42px); background: #fff; box-shadow: none; }
.portal-topbar h2 { font-size: 1.55rem; }
.status-pill { padding: 8px 10px; background: #edf5f0; font-size: .68rem; }
.overview-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 22px; padding: 8px 0 20px; }
.overview-intro h3 { margin: 0; font-size: 1.25rem; }
.overview-intro p { margin: 6px 0 0; color: var(--muted); font-size: .8rem; }
.overview-intro > span { color: #778699; font-size: .7rem; }
.resource-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.resource-card { min-height: 165px; padding: 20px; }
.resource-card h3 { font-size: .9rem; }
.resource-count { font-size: 1.35rem; }
.resource-card li { font-size: .76rem; }

@media (max-width: 840px) {
  .portal { grid-template-columns: 1fr; }
  .portal-sidebar { padding: 14px 18px; }
  .portal-branding { padding: 0; }
}

@media (max-width: 620px) {
  .resource-grid { grid-template-columns: 1fr; }
  .overview-intro { align-items: flex-start; flex-direction: column; }
}

/* Extended API documentation */
.docs-layout { grid-template-columns: 190px minmax(0,900px); gap: 44px; }
.docs-menu { top: 112px; gap: 0; }
.docs-menu strong { margin-bottom: 12px; font-size: .78rem; }
.docs-menu a { padding: 7px 0; color: #667789; font-size: .74rem; }
.docs-menu a:hover { color: var(--blue); }
.docs-content { padding: 38px 42px 56px; }
.docs-content > h3 { font-size: 1.8rem; }
.doc-section { margin-top: 48px; scroll-margin-top: 120px; }
.doc-section h4 { margin: 0 0 12px; font-size: 1.2rem; }
.doc-section h5 { margin: 26px 0 9px; font-size: .88rem; }
.doc-section > p { color: var(--muted); font-size: .83rem; line-height: 1.7; }
.doc-steps { display: grid; gap: 2px; margin: 20px 0 0; padding: 0; list-style: none; counter-reset: steps; }
.doc-steps li { display: grid; grid-template-columns: 34px 1fr; column-gap: 13px; padding: 15px 16px; background: #f3f5f7; counter-increment: steps; }
.doc-steps li::before { grid-row: 1 / 3; content: counter(steps,decimal-leading-zero); color: var(--blue); font-size: .72rem; font-weight: 850; }
.doc-steps strong { font-size: .8rem; }
.doc-steps span { margin-top: 3px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.doc-note { padding: 15px 17px; color: #40536a !important; background: #edf3f7; }
.doc-note strong { color: var(--navy); }
.parameter-table, .permission-table, .error-list { display: grid; gap: 2px; margin: 18px 0; }
.parameter-table > div { display: grid; grid-template-columns: 100px 80px 1fr; gap: 14px; padding: 12px 14px; background: #f5f6f7; font-size: .73rem; }
.parameter-table .parameter-head { color: #627184; background: #e9edf0; font-size: .64rem; font-weight: 800; text-transform: uppercase; }
.permission-table > div { display: grid; grid-template-columns: 130px 1fr; gap: 16px; padding: 11px 14px; background: #f5f6f7; font-size: .74rem; }
.permission-table > div:first-child { color: #627184; background: #e9edf0; font-size: .64rem; text-transform: uppercase; }
.error-list > div { display: grid; grid-template-columns: 52px 1fr; gap: 13px; padding: 12px 14px; background: #f5f6f7; font-size: .74rem; line-height: 1.5; }
.error-list code { color: #a43a32; font-weight: 800; }
.security-list { display: grid; gap: 8px; margin: 17px 0 22px; padding-left: 20px; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.docs-content pre { margin: 14px 0 20px; padding: 20px; font-size: .76rem; }

@media (max-width: 840px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-menu { position: static; display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; white-space: nowrap; }
  .docs-menu strong { display: none; }
}

@media (max-width: 620px) {
  .docs-content { padding: 26px 20px 40px; }
  .parameter-table > div { grid-template-columns: 80px 1fr; }
  .parameter-table > div span:last-child { grid-column: 1 / -1; }
  .parameter-table .parameter-head { display: none; }
  .permission-table > div { grid-template-columns: 100px 1fr; }
}
