:root {
  --ink: #17224d;
  --ink-soft: #53607c;
  --muted: #7b859d;
  --line: #dce1ed;
  --line-soft: #eaedf5;
  --paper: #ffffff;
  --canvas: #f4f7fb;
  --blue: #293a82;
  --blue-dark: #1b285f;
  --blue-soft: #eef0fa;
  --teal: #10887f;
  --success: #087f5b;
  --danger: #c2414f;
  --shadow: 0 18px 52px rgba(34, 46, 102, .10);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 16px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
code { font-family: Consolas, "SFMono-Regular", monospace; font-size: .86rem; overflow-wrap: anywhere; }

.topbar {
  position: sticky; top: 0; z-index: 50; min-height: 72px; padding: 0 max(24px, calc((100vw - 1420px) / 2));
  display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(320px, 1fr); align-items: center;
  background: rgba(255,255,255,.92); border-bottom: 1px solid rgba(220,230,240,.9); backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.brand-symbol { position: relative; width: 40px; height: 40px; flex: 0 0 auto; overflow: hidden; border-radius: 50%; background: white; box-shadow: 0 7px 20px rgba(34,46,102,.18); }
.brand-symbol img { position: absolute; top: -1px; left: -7px; width: 54px; max-width: none; height: auto; }
.company-logo { display: block; width: 82px; height: auto; flex: 0 0 auto; }
.company-logo.inverse { filter: brightness(0) invert(1); }
.brand span:last-child, .account-copy { display: flex; flex-direction: column; }
.brand strong { font-size: 1rem; letter-spacing: -.01em; }
.brand small, .account-copy small { margin-top: 2px; color: var(--muted); font-size: .75rem; }
.topnav { height: 72px; display: flex; align-items: stretch; gap: 8px; }
.nav-link { display: grid; place-items: center; padding: 0 16px; color: var(--ink-soft); font-size: .9rem; font-weight: 650; border-bottom: 2px solid transparent; }
.nav-link:hover, .nav-link.active { color: var(--blue); border-color: var(--blue); }
.account { justify-self: end; display: flex; align-items: center; gap: 10px; }
.account form { margin: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e9f1fb; color: #24558f; font-weight: 750; }
.avatar.small { width: 34px; height: 34px; font-size: .84rem; }
.account-copy strong { font-size: .85rem; }
.account-copy small { max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.page-container { width: min(1420px, calc(100% - 48px)); margin: 0 auto; }
.portal-page { padding: 58px 0 80px; }
.portal-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 34px; }
.portal-heading h1, .section-heading h1 { margin: 7px 0 10px; letter-spacing: -.035em; font-size: clamp(1.75rem, 3vw, 2.55rem); line-height: 1.15; }
.portal-heading p, .section-heading p { margin: 0; color: var(--ink-soft); }
.eyebrow { color: var(--blue); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.light { color: #b9dcff; }
.portal-status { min-width: 220px; display: flex; align-items: center; gap: 12px; padding: 15px 18px; border: 1px solid #d5e6dc; background: #f6fbf8; }
.portal-status > span:last-child { display: flex; flex-direction: column; }
.portal-status strong { font-size: .86rem; }
.portal-status small { margin-top: 3px; color: #648173; font-size: .75rem; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #19a974; box-shadow: 0 0 0 5px rgba(25,169,116,.11); }

.filter-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 26px; }
.search-box { min-width: 340px; display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 15px; border: 1px solid var(--line); background: white; box-shadow: 0 8px 24px rgba(40,65,95,.04); }
.search-box.small { min-width: 280px; height: 42px; box-shadow: none; }
.search-box span { color: var(--muted); font-size: 1.3rem; }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .92rem; }
.filter-chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; padding: 3px; }
.chip { min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.chip:hover { background: white; border-color: var(--line); }
.chip.active { background: var(--ink); color: white; }
.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.app-card { min-height: 248px; display: flex; flex-direction: column; padding: 26px; background: white; border: 1px solid var(--line-soft); box-shadow: 0 8px 30px rgba(26,51,80,.055); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.app-card:hover { transform: translateY(-4px); border-color: #c7d8eb; box-shadow: var(--shadow); }
.app-card:focus-visible { outline: 3px solid rgba(23,100,215,.22); outline-offset: 3px; }
.app-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.app-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; color: var(--accent, var(--blue)); background: color-mix(in srgb, var(--accent, var(--blue)) 12%, white); font-weight: 800; }
.app-icon.small { width: 38px; height: 38px; border-radius: 10px; font-size: .86rem; }
.launch-icon { color: #a1afbf; font-size: 1.3rem; transition: color .18s, transform .18s; }
.app-card:hover .launch-icon { color: var(--blue); transform: translate(2px, -2px); }
.app-card h2 { margin-bottom: 9px; font-size: 1.08rem; letter-spacing: -.01em; }
.app-card p { flex: 1; margin-bottom: 22px; color: var(--ink-soft); font-size: .9rem; line-height: 1.65; }
.app-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .76rem; }

.empty-state { min-height: 390px; padding: 64px 30px; display: grid; place-items: center; align-content: center; text-align: center; background: white; border: 1px dashed #cbd8e5; }
.empty-state.portal-empty { min-height: 430px; }
.empty-state.compact { min-height: 280px; }
.empty-state h1, .empty-state h2 { margin: 8px 0 10px; font-size: 1.45rem; }
.empty-state p { max-width: 520px; color: var(--ink-soft); line-height: 1.65; }
.empty-icon { width: 52px; height: 52px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 14px; font-size: 1.35rem; font-weight: 700; }
.empty-visual { position: relative; width: 150px; height: 70px; margin-bottom: 20px; display: grid; place-items: center; }
.empty-visual i { position: absolute; width: 34px; height: 34px; border: 1px solid #dae5ef; background: #f8fafc; transform: rotate(8deg); }
.empty-visual i:nth-child(2) { left: 5px; top: 5px; }
.empty-visual i:nth-child(3) { right: 5px; top: 5px; transform: rotate(-8deg); }
.empty-visual i:nth-child(4) { left: 57px; bottom: -1px; z-index: 0; }
.empty-visual .empty-icon { z-index: 2; }
.hidden { display: none !important; }

.primary-button, .secondary-button, .ghost-button, .danger-button {
  min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-weight: 700; font-size: .88rem; transition: background .16s, border-color .16s, transform .16s;
}
.primary-button { color: white; background: var(--blue); box-shadow: 0 8px 20px rgba(34,46,102,.20); }
.primary-button:hover { background: var(--blue-dark); }
.secondary-button { color: var(--ink); background: white; border-color: var(--line); }
.secondary-button:hover { border-color: #b9cadb; background: #f9fbfd; }
.ghost-button { min-height: 36px; padding: 0 12px; color: var(--ink-soft); background: transparent; }
.ghost-button:hover { color: var(--danger); background: #fff2f3; }
.danger-button { color: #a62f3c; background: #fff5f5; border-color: #f1cbd0; }
.danger-button:hover { color: white; background: #b93644; }
.primary-button:active, .secondary-button:active, .ghost-button:active, .danger-button:active { transform: scale(.98); }
.primary-button.full { width: 100%; min-height: 48px; }
.text-link { color: var(--blue); font-size: .84rem; font-weight: 700; }
.text-link:hover { color: var(--blue-dark); text-decoration: underline; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--ink-soft); font-size: .86rem; font-weight: 650; }

.auth-page { overflow-x: hidden; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.auth-brand-panel { position: relative; overflow: hidden; padding: 54px clamp(40px, 6vw, 92px); display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(142deg, #151e4a 0%, #253477 58%, #176d76 120%); }
.auth-brand-panel::before { content: ""; position: absolute; inset: 0; opacity: .24; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom right, black, transparent 72%); }
.auth-brand-panel::after { content: ""; position: absolute; width: 440px; height: 440px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; right: -180px; bottom: -160px; box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.025); }
.auth-brand-top, .auth-message, .trust-strip { position: relative; z-index: 2; }
.auth-brand-top { display: inline-flex; align-items: center; gap: 14px; }
.auth-brand-top span:last-child { display: flex; flex-direction: column; }
.auth-brand-top strong { font-size: 1.05rem; }
.auth-brand-top small { margin-top: 3px; color: #b8d6f3; font-size: .68rem; letter-spacing: .15em; }
.brand-watermark { position: absolute; z-index: 1; right: clamp(-70px, 2vw, 24px); top: 50%; width: min(36vw, 430px); height: auto; opacity: .045; filter: brightness(0) invert(1); transform: translateY(-48%); pointer-events: none; }
.auth-message { max-width: 660px; }
.auth-message h1 { max-width: 620px; margin: 14px 0 20px; font-size: clamp(2.5rem, 5.4vw, 4.9rem); line-height: 1.02; letter-spacing: -.055em; }
.auth-message p { max-width: 520px; color: #d9e9f8; font-size: 1.05rem; line-height: 1.75; }
.trust-strip { display: flex; align-items: center; gap: 18px; color: #c6dff2; font-size: .82rem; }
.trust-strip i { width: 24px; height: 1px; background: rgba(255,255,255,.3); }
.auth-form-panel { display: grid; place-items: center; padding: 42px; background: #f7f9fc; }
.auth-card { width: min(420px, 100%); padding: 44px; background: white; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.auth-card h2 { margin: 9px 0 8px; font-size: 2rem; letter-spacing: -.035em; }
.auth-card .muted { margin-bottom: 30px; }
.mobile-brand { display: none; }
.mobile-brand > span:last-child { display: flex; flex-direction: column; }
.mobile-brand small { margin-top: 2px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.field-label, .stack-form label > span, .setup-card label > span, .wide-form label > span { display: block; margin: 15px 0 7px; color: #40546b; font-size: .82rem; font-weight: 750; }
.field-label:first-of-type { margin-top: 0; }
.field { width: 100%; min-height: 44px; padding: 10px 12px; color: var(--ink); background: white; border: 1px solid #cfdbe7; border-radius: 8px; outline: none; transition: border-color .16s, box-shadow .16s; }
textarea.field { line-height: 1.55; resize: vertical; }
.field:focus { border-color: #4b8ee7; box-shadow: 0 0 0 4px rgba(23,100,215,.1); }
.field:disabled { color: var(--ink-soft); background: #f1f4f8; }
.field.mono { font-family: Consolas, monospace; font-size: .84rem; }
.color-field { padding: 5px; }
.password-wrap { position: relative; margin-bottom: 24px; }
.password-wrap .field { padding-right: 66px; }
.password-toggle { position: absolute; right: 7px; top: 7px; height: 30px; padding: 0 8px; border: 0; background: transparent; color: var(--blue); font-size: .78rem; font-weight: 700; cursor: pointer; }
.form-note { margin: 17px 0 0; color: var(--muted); font-size: .76rem; line-height: 1.5; text-align: center; }
.form-note.aligned { text-align: left; }
.muted { color: var(--muted); }

.setup-page { background: #f0f2f8; }
.setup-shell { min-height: 100vh; padding: clamp(28px, 5vw, 72px); display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(28px, 5vw, 76px); align-items: center; }
.setup-intro { max-width: 560px; justify-self: end; }
.auth-brand-top.dark { color: var(--ink); margin-bottom: 62px; }
.auth-brand-top.dark .company-logo { width: 92px; }
.auth-brand-top.dark small { color: var(--muted); letter-spacing: 0; }
.step-pill { display: inline-flex; padding: 7px 10px; color: #356391; background: #e2edf8; border-radius: 7px; font-size: .75rem; font-weight: 750; }
.setup-intro h1 { margin: 18px 0 14px; font-size: clamp(2rem, 4vw, 3.6rem); letter-spacing: -.05em; }
.setup-intro > p { color: var(--ink-soft); line-height: 1.75; }
.setup-points { margin-top: 38px; display: grid; gap: 18px; }
.setup-points > div { display: flex; align-items: center; gap: 14px; }
.setup-points > div > span { color: var(--blue); font-family: Consolas, monospace; font-size: .72rem; font-weight: 800; }
.setup-points p { margin: 0; display: flex; flex-direction: column; }
.setup-points strong { font-size: .9rem; }
.setup-points small { margin-top: 3px; color: var(--muted); font-size: .78rem; }
.setup-form-panel { width: 100%; max-width: 680px; }
.setup-card { padding: clamp(28px, 5vw, 52px); background: white; border: 1px solid var(--line-soft); box-shadow: var(--shadow); }

.narrow-page { max-width: 760px; padding: 54px 0 90px; }
.panel { padding: 26px; background: white; border: 1px solid var(--line-soft); box-shadow: 0 8px 28px rgba(26,51,80,.045); }
.form-panel { padding: 34px; }
.section-heading { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading.compact { margin-bottom: 22px; }
.section-heading.compact h2 { margin: 6px 0 0; }
.panel-heading { margin-bottom: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading h2 { margin-bottom: 5px; font-size: 1.05rem; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.stack-form { display: grid; gap: 14px; }
.stack-form label > span { margin-top: 0; }
.stack-form label > small, .wide-form label > small { display: block; margin-top: 6px; color: var(--muted); font-size: .74rem; line-height: 1.45; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: 1fr 1fr 1fr; }
label em { color: var(--muted); font-size: .72rem; font-style: normal; font-weight: 500; }

.admin-layout { padding: 34px 0 78px; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 26px; align-items: start; }
.admin-nav { position: sticky; top: 106px; padding: 15px 10px; background: white; border: 1px solid var(--line-soft); box-shadow: 0 8px 25px rgba(26,51,80,.04); }
.admin-nav-title { margin: 5px 12px 11px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .12em; }
.admin-nav a { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 0 11px; color: var(--ink-soft); border-radius: 8px; font-size: .86rem; font-weight: 650; }
.admin-nav a:hover { color: var(--blue); background: #f5f8fc; }
.admin-nav a.active { color: white; background: var(--ink); }
.admin-nav a span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(114,137,163,.12); font-size: .7rem; font-weight: 800; }
.admin-nav a.active span { background: rgba(255,255,255,.14); }
.admin-content { min-width: 0; }
.admin-content > .section-heading h1 { font-size: 2rem; }
.metric-grid { margin-bottom: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-grid article { min-height: 146px; padding: 22px; display: flex; flex-direction: column; background: white; border: 1px solid var(--line-soft); }
.metric-grid span { color: var(--ink-soft); font-size: .8rem; font-weight: 700; }
.metric-grid strong { margin: 16px 0 7px; font-size: 2.1rem; line-height: 1; letter-spacing: -.04em; }
.metric-grid small { margin-top: auto; color: var(--muted); font-size: .75rem; }
.activity-list { display: grid; }
.activity-list > div { min-height: 58px; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 13px; border-top: 1px solid var(--line-soft); }
.activity-list > div:first-child { border-top: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #79a9df; }
.activity-list p { margin: 0; display: flex; flex-direction: column; }
.activity-list strong { font-size: .84rem; }
.activity-list small { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.activity-list time { color: var(--muted); font-size: .73rem; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .75fr); gap: 18px; align-items: start; }
.split-layout.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sticky-panel { position: sticky; top: 106px; }
.toolbar { margin-bottom: 20px; display: flex; gap: 10px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 12px; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); text-align: left; font-size: .72rem; font-weight: 800; letter-spacing: .04em; white-space: nowrap; }
td { padding: 15px 12px; border-bottom: 1px solid var(--line-soft); color: var(--ink-soft); font-size: .82rem; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfcfe; }
.person-cell { min-width: 190px; display: flex; align-items: center; gap: 10px; }
.person-cell p { margin: 0; display: flex; flex-direction: column; min-width: 0; }
.person-cell strong, .cell-main { color: var(--ink); font-size: .84rem; }
.person-cell small, .cell-sub { margin-top: 3px; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.cell-main, .cell-sub { display: block; }
.badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 7px; font-size: .72rem; font-weight: 750; }
.badge.success { color: #087251; background: #e8f7f0; }
.badge.muted-badge { color: #6f7b88; background: #eef1f4; }
.switch-row { min-height: 58px; display: flex !important; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--blue); }
.switch-row span { display: flex !important; flex-direction: column; margin: 0 !important; }
.switch-row strong { font-size: .82rem; }
.switch-row small { margin-top: 2px; color: var(--muted); font-size: .7rem; font-weight: 500; }
.check-field { margin: 0; padding: 13px; border: 1px solid var(--line); }
.check-field legend { padding: 0 5px; color: #40546b; font-size: .78rem; font-weight: 750; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-grid label { min-height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 10px; color: var(--ink-soft); background: #f7f9fc; border: 1px solid #e1e8f0; border-radius: 7px; cursor: pointer; font-size: .76rem; }
.check-grid input { accent-color: var(--blue); }
.simple-list { margin-bottom: 22px; display: grid; gap: 6px; }
.simple-list > div:not(.inline-empty) { min-height: 62px; padding: 8px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.simple-list p { margin: 0; display: flex; flex-direction: column; }
.simple-list strong { font-size: .85rem; }
.simple-list small { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.list-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; font-size: .7rem; font-weight: 800; }
.list-icon.blue { color: var(--blue); background: var(--blue-soft); }
.list-icon.teal { color: var(--teal); background: #e7f7f5; }
.inline-create { padding-top: 20px; display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 9px; border-top: 1px solid var(--line-soft); }
.inline-empty { padding: 34px 16px; color: var(--muted); text-align: center; font-size: .82rem; }
.app-table-panel { padding: 8px; }

.wide-form { display: grid; gap: 0; }
.form-section { padding: 28px 0; border-bottom: 1px solid var(--line-soft); }
.form-section:first-child { padding-top: 0; }
.form-section-title { margin-bottom: 20px; display: flex; align-items: flex-start; gap: 12px; }
.form-section-title > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; color: var(--blue); background: var(--blue-soft); border-radius: 8px; font-family: Consolas, monospace; font-size: .7rem; font-weight: 800; }
.form-section-title h2 { margin: 0 0 4px; font-size: .98rem; }
.form-section-title p { margin: 0; color: var(--muted); font-size: .76rem; }
.form-actions { padding-top: 26px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.visibility-options { margin-top: 15px; }
.secret-box { margin-bottom: 18px; padding: 26px; display: grid; grid-template-columns: .8fr 1.2fr; gap: 28px; color: white; background: linear-gradient(120deg, #17365a, #0d559b); box-shadow: 0 16px 38px rgba(15,56,98,.16); }
.secret-box h2 { margin: 7px 0; font-size: 1.2rem; }
.secret-box p { margin: 0; color: #c8dbec; font-size: .8rem; line-height: 1.6; }
.secret-box dl { margin: 0; }
.secret-box dt { margin: 0 0 5px; color: #adc8e0; font-size: .7rem; font-weight: 800; }
.secret-box dd { margin: 0 0 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.secret-box code { padding: 9px 10px; color: #eaf6ff; background: rgba(1,18,38,.3); border: 1px solid rgba(255,255,255,.12); }
.secret-box button { height: 36px; padding: 0 10px; color: white; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 7px; cursor: pointer; }
.danger-zone { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-color: #f0d6d9; }
.danger-zone h2 { margin-bottom: 5px; font-size: .95rem; }
.danger-zone p { margin: 0; color: var(--muted); font-size: .78rem; }
.integration-flow { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #143457; }
.integration-flow article { min-height: 180px; padding: 24px; color: white; border-right: 1px solid rgba(255,255,255,.12); }
.integration-flow article:last-child { border-right: 0; }
.integration-flow span { display: block; margin-bottom: 27px; color: #7fc6ff; font-family: Consolas, monospace; font-size: .75rem; font-weight: 800; }
.integration-flow h2 { margin-bottom: 8px; font-size: .95rem; }
.integration-flow p { margin: 0; color: #c0d2e3; font-size: .78rem; line-height: 1.55; }
.endpoint-list { margin: 0; display: grid; grid-template-columns: 110px minmax(0, 1fr); }
.endpoint-list dt, .endpoint-list dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: .78rem; }
.endpoint-list dt { color: var(--muted); font-weight: 750; }
.endpoint-list dd { color: var(--ink-soft); overflow-wrap: anywhere; }
.notice-panel { margin-top: 18px; padding: 20px 22px; display: flex; align-items: flex-start; gap: 18px; color: #335a7d; background: #edf5fc; border-left: 4px solid #4c91d4; }
.notice-panel strong { flex: 0 0 auto; font-size: .82rem; }
.notice-panel p { margin: 0; font-size: .8rem; line-height: 1.6; }

.toast-stack { position: fixed; z-index: 100; top: 84px; left: 50%; width: min(460px, calc(100% - 30px)); transform: translateX(-50%); display: grid; gap: 8px; }
.toast { padding: 13px 16px; color: var(--ink); background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(24,47,74,.14); font-size: .84rem; font-weight: 650; animation: toast-in .22s ease-out; }
.toast.success { border-left: 4px solid #20a979; }
.toast.error { border-left: 4px solid #d14e5a; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.error-state { margin-top: 40px; }
.error-code { color: #9ab0c6; font-size: 4rem; font-weight: 850; letter-spacing: -.06em; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; padding: 0 20px; }
  .topnav { grid-row: 2; grid-column: 1 / -1; height: 44px; justify-content: center; border-top: 1px solid var(--line-soft); }
  .nav-link { padding: 0 24px; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-nav, .sticky-panel { top: 138px; }
  .split-layout { grid-template-columns: 1fr; }
  .sticky-panel { position: static; }
  .integration-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .integration-flow article:nth-child(2) { border-right: 0; }
  .integration-flow article:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.12); }
}

@media (max-width: 800px) {
  .topbar { min-height: 64px; }
  .brand small, .account-copy, .account > .text-link { display: none; }
  .topnav { height: 42px; }
  .page-container { width: min(100% - 28px, 1420px); }
  .portal-page { padding-top: 34px; }
  .portal-heading, .section-heading { align-items: flex-start; flex-direction: column; }
  .portal-status { width: 100%; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .search-box { min-width: 0; width: 100%; }
  .app-grid { grid-template-columns: 1fr; }
  .app-card { min-height: 220px; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand-panel { display: none; }
  .auth-form-panel { padding: 24px; }
  .auth-card { padding: 32px 26px; }
  .mobile-brand { margin-bottom: 40px; display: flex; align-items: center; gap: 11px; }
  .setup-shell { padding: 24px; grid-template-columns: 1fr; }
  .setup-intro { justify-self: stretch; }
  .auth-brand-top.dark { margin-bottom: 36px; }
  .setup-points { display: none; }
  .setup-form-panel { max-width: none; }
  .admin-layout { grid-template-columns: 1fr; padding-top: 18px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .admin-nav-title { display: none; }
  .admin-nav a { flex: 0 0 auto; }
  .split-layout.even, .secret-box { grid-template-columns: 1fr; }
  .inline-create { grid-template-columns: 1fr; }
  .form-grid.three { grid-template-columns: 1fr 1fr; }
  .integration-flow { grid-template-columns: 1fr; }
  .integration-flow article { min-height: 145px; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .integration-flow article:last-child { border-bottom: 0; }
}

@media (max-width: 520px) {
  .topbar { padding: 0 13px; }
  .brand strong { font-size: .88rem; }
  .brand-symbol { width: 34px; height: 34px; }
  .brand-symbol img { left: -6px; width: 46px; }
  .account { gap: 4px; }
  .nav-link { padding: 0 18px; }
  .portal-heading h1, .section-heading h1 { font-size: 1.65rem; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-grid article { min-height: 128px; padding: 17px; }
  .metric-grid strong { font-size: 1.7rem; }
  .panel, .form-panel { padding: 20px; }
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
  .form-actions, .danger-zone { align-items: stretch; flex-direction: column; }
  .endpoint-list { grid-template-columns: 1fr; }
  .endpoint-list dt { padding-bottom: 3px; border-bottom: 0; }
  .endpoint-list dd { padding-top: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
