:root {
  color-scheme: light;
  --atlantic: #0b1f3a;
  --navy: #10294a;
  --cobalt: #1556d1;
  --cobalt-dark: #0d43ad;
  --ice: #edf4ff;
  --porcelain: #f6f8fb;
  --paper: #ffffff;
  --ink: #142033;
  --slate: #5d6b7e;
  --line: #dce3ec;
  --line-dark: #bbc7d7;
  --amber: #e9a23b;
  --green: #137a5a;
  --red: #b53a45;
  --display: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --body: "Avenir Next", "Avenir", "Segoe UI", sans-serif;
  --utility: "SFMono-Regular", "IBM Plex Mono", "Menlo", monospace;
  --shadow: 0 18px 55px rgba(11, 31, 58, 0.12);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--porcelain); }
body { margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(21, 86, 209, 0.35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr); background: var(--paper); }
.login-story { position: relative; min-height: 100vh; padding: 46px clamp(34px, 6vw, 92px); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; color: white; background: var(--atlantic); }
.login-story::after { content: ""; position: absolute; width: 540px; height: 540px; right: -260px; top: 18%; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; box-shadow: 0 0 0 90px rgba(255,255,255,.025), 0 0 0 180px rgba(255,255,255,.02); }
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; color: var(--atlantic); text-decoration: none; font-family: var(--utility); font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand small { margin-left: 3px; color: var(--cobalt); font-family: var(--body); font-size: 10px; font-weight: 800; letter-spacing: .11em; vertical-align: 2px; }
.brand--light { color: white; }
.brand--light small { color: #84aef8; }
.brand-mark { width: 30px; height: 30px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 5px; border: 1px solid currentColor; border-radius: 7px; }
.brand-mark i { display: block; background: currentColor; border-radius: 1px; }
.brand-mark i:nth-child(1) { height: 40%; opacity: .55; }
.brand-mark i:nth-child(2) { height: 70%; opacity: .75; }
.brand-mark i:nth-child(3) { height: 100%; }
.login-thesis { position: relative; z-index: 1; max-width: 720px; margin: auto 0; padding: 90px 0 70px; }
.eyebrow { margin: 0 0 9px; color: var(--cobalt); font-family: var(--utility); font-size: 10px; font-weight: 800; letter-spacing: .15em; line-height: 1.3; text-transform: uppercase; }
.login-thesis .eyebrow { color: #8eb4f7; }
.login-thesis h1 { max-width: 690px; margin: 0; font-family: var(--display); font-size: clamp(48px, 6.1vw, 88px); font-weight: 500; letter-spacing: -.045em; line-height: .94; }
.login-thesis > p:last-child { max-width: 590px; margin: 30px 0 0; color: #bfd0e7; font-size: clamp(17px, 1.7vw, 21px); line-height: 1.55; }
.login-flow { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto 1fr auto 1fr auto; align-items: center; gap: 12px; max-width: 720px; color: #afc4df; font-family: var(--utility); font-size: 10px; letter-spacing: .07em; text-transform: uppercase; }
.login-flow b { display: block; height: 1px; background: #49617f; }
.login-panel { display: grid; place-items: center; padding: 48px; background: radial-gradient(circle at 70% 15%, #f5f8fd 0, #fff 42%); }
.login-card { width: min(100%, 430px); display: grid; gap: 22px; }
.login-card h2 { margin: 0; font-family: var(--display); font-size: 40px; font-weight: 600; letter-spacing: -.035em; }
.muted { margin: 7px 0 0; color: var(--slate); line-height: 1.55; }
label { display: grid; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line-dark); border-radius: var(--radius-sm); background: white; color: var(--ink); padding: 12px 13px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--cobalt); outline: 0; box-shadow: 0 0 0 3px rgba(21,86,209,.1); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.form-error { min-height: 18px; margin: -8px 0 -6px; color: var(--red); font-size: 13px; }
.login-help { margin: 0; color: #8a95a5; font-family: var(--utility); font-size: 10px; text-align: center; }

.button { min-height: 40px; border: 1px solid transparent; border-radius: var(--radius-sm); padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: white; color: var(--ink); font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }
.button:hover { transform: translateY(-1px); }
.button--primary { background: var(--cobalt); color: white; box-shadow: 0 7px 18px rgba(21,86,209,.18); }
.button--primary:hover { background: var(--cobalt-dark); }
.button--quiet { border-color: var(--line); background: white; }
.button--quiet:hover { border-color: var(--line-dark); background: var(--porcelain); }
.button--full { width: 100%; min-height: 46px; }
.icon-button { width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--slate); font-size: 20px; line-height: 1; }
.icon-button:hover { border-color: var(--line-dark); color: var(--ink); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: 248px; padding: 28px 18px 20px; display: flex; flex-direction: column; background: white; border-right: 1px solid var(--line); }
.sidebar .brand { margin: 0 12px 35px; }
.primary-nav { display: grid; gap: 4px; }
.nav-item { width: 100%; border: 0; border-radius: 9px; padding: 10px 12px; display: grid; grid-template-columns: 26px 1fr auto; gap: 9px; align-items: center; background: transparent; color: var(--slate); text-align: left; font-size: 13px; font-weight: 700; }
.nav-item:hover { background: var(--porcelain); color: var(--ink); }
.nav-item[aria-current="page"] { background: var(--ice); color: var(--cobalt); }
.nav-glyph { width: 23px; height: 23px; border: 1px solid currentColor; border-radius: 6px; display: grid; place-items: center; font-family: var(--utility); font-size: 8px; opacity: .82; }
.nav-count { color: #91a0b4; font-family: var(--utility); font-size: 10px; }
.sidebar-foot { margin-top: auto; padding: 14px 12px 2px; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); }
.environment-dot { width: 9px; height: 9px; border: 2px solid white; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 1px rgba(19,122,90,.35); }
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { font-size: 11px; }
.sidebar-foot small { margin-top: 2px; color: var(--slate); font-size: 10px; }

.workspace { min-width: 0; grid-column: 2; }
.topbar { height: 88px; padding: 0 clamp(22px, 3vw, 46px); display: flex; align-items: center; justify-content: space-between; gap: 22px; background: rgba(246,248,251,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 15; }
.topbar h1 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.topbar .eyebrow { margin-bottom: 1px; color: #7d8a9b; font-size: 8px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.user-pill { border: 0; padding: 4px 9px 4px 4px; display: flex; align-items: center; gap: 9px; background: transparent; text-align: left; }
.user-pill > span:first-child { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--atlantic); color: white; font-family: var(--utility); font-size: 10px; }
.user-pill strong, .user-pill small { display: block; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill strong { font-size: 11px; }
.user-pill small { margin-top: 2px; color: var(--slate); font-size: 9px; }
.mobile-menu { display: none; }

#main-content { min-height: calc(100vh - 88px); padding: clamp(24px, 3.4vw, 50px); }
.page-stack { display: grid; gap: 26px; max-width: 1500px; margin: 0 auto; }
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-intro h2 { margin: 0; font-family: var(--display); font-size: clamp(29px, 3vw, 42px); font-weight: 600; letter-spacing: -.035em; }
.page-intro p { max-width: 720px; margin: 8px 0 0; color: var(--slate); line-height: 1.55; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); overflow: hidden; }
.stat { min-height: 118px; padding: 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat span { display: block; color: var(--slate); font-family: var(--utility); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.stat strong { display: block; margin-top: 8px; font-family: var(--display); font-size: 35px; font-weight: 600; line-height: 1; }
.stat small { display: block; margin-top: 8px; color: var(--green); font-size: 10px; }

.intelligence-map { padding: clamp(23px, 3vw, 40px); overflow: hidden; border-radius: var(--radius-lg); background: var(--atlantic); color: white; box-shadow: var(--shadow); }
.map-head { display: flex; justify-content: space-between; align-items: start; gap: 25px; }
.map-head h3 { max-width: 620px; margin: 0; font-family: var(--display); font-size: clamp(27px, 3vw, 39px); font-weight: 500; letter-spacing: -.03em; }
.map-head p { max-width: 400px; margin: 2px 0 0; color: #aebfd6; font-size: 13px; line-height: 1.6; }
.map-flow { position: relative; margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.map-flow::before { content: ""; position: absolute; left: 10%; right: 10%; top: 28px; height: 1px; background: #405674; }
.map-node { position: relative; z-index: 1; min-height: 122px; padding: 18px; border: 1px solid #354e6d; border-radius: 13px; background: #102a4b; transition: transform .2s, border-color .2s; }
.map-node:hover { transform: translateY(-3px); border-color: #7894b9; }
.map-node-index { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: #dce8fb; color: var(--atlantic); font-family: var(--utility); font-size: 9px; font-weight: 800; }
.map-node strong { display: block; margin-top: 18px; font-size: 13px; }
.map-node small { display: block; margin-top: 5px; color: #9eb2cb; font-size: 10px; }
.map-node:last-child { background: var(--cobalt); border-color: #4e82e3; }
.map-node:last-child .map-node-index { background: white; color: var(--cobalt); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 20px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.panel-head { min-height: 68px; padding: 17px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 14px; }
.panel-head p { margin: 3px 0 0; color: var(--slate); font-size: 11px; }
.text-button { border: 0; padding: 5px; background: transparent; color: var(--cobalt); font-size: 11px; font-weight: 800; }
.review-list, .activity-list { display: grid; }
.review-row, .activity-row { min-height: 68px; padding: 14px 20px; display: grid; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.review-row:last-child, .activity-row:last-child { border-bottom: 0; }
.review-row { grid-template-columns: 1fr auto; }
.activity-row { grid-template-columns: 35px 1fr auto; }
.review-row strong, .activity-row strong { display: block; font-size: 12px; }
.review-row small, .activity-row small { display: block; margin-top: 4px; color: var(--slate); font-size: 10px; }
.activity-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--ice); color: var(--cobalt); font-family: var(--utility); font-size: 8px; }

.catalog-toolbar { padding: 12px; display: flex; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.search-wrap { position: relative; flex: 1; }
.search-wrap::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: #8794a7; font-size: 19px; }
.search-wrap input { padding-left: 39px; border-color: transparent; background: var(--porcelain); }
.catalog-toolbar select { width: 180px; }
.catalog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.catalog-card { min-height: 236px; padding: 21px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: white; text-align: left; transition: border-color .18s, transform .18s, box-shadow .18s; }
.catalog-card:hover { transform: translateY(-2px); border-color: #aebdd1; box-shadow: 0 12px 30px rgba(20,32,51,.07); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.entity-glyph { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #b9c9df; border-radius: 10px; background: var(--ice); color: var(--cobalt); font-family: var(--utility); font-size: 9px; font-weight: 800; }
.status { padding: 4px 7px; border-radius: 999px; background: #eef1f5; color: #69778b; font-family: var(--utility); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.status--active { background: #e8f6f1; color: var(--green); }
.status--review { background: #fff3df; color: #986414; }
.status--failed { background: #faeaec; color: var(--red); }
.catalog-card h3 { margin: 18px 0 0; font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.catalog-card > p { margin: 8px 0 16px; color: var(--slate); font-size: 12px; line-height: 1.55; }
.card-meta { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); color: #7a8799; font-family: var(--utility); font-size: 8px; text-transform: uppercase; }
.empty-state { grid-column: 1 / -1; padding: 55px; border: 1px dashed var(--line-dark); border-radius: var(--radius); color: var(--slate); text-align: center; }

.execute-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); min-height: 620px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.execute-form { padding: clamp(22px, 3vw, 36px); display: grid; align-content: start; gap: 20px; border-right: 1px solid var(--line); }
.execute-form h2 { margin: 0; font-family: var(--display); font-size: 31px; }
.execute-form textarea { min-height: 205px; }
.execute-form fieldset { margin: 0; padding: 0; border: 0; }
.execute-form legend { margin-bottom: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
.provider-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.provider-choice { position: relative; }
.provider-choice input { position: absolute; opacity: 0; pointer-events: none; }
.provider-choice span { min-height: 64px; padding: 10px; display: grid; align-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 9px; color: var(--slate); font-size: 10px; }
.provider-choice strong { color: var(--ink); font-size: 11px; }
.provider-choice input:checked + span { border-color: var(--cobalt); background: var(--ice); color: var(--cobalt); }
.provider-choice input:disabled + span { opacity: .45; cursor: not-allowed; }
.orchestrator-card { padding: 14px; display: grid; gap: 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--porcelain); }
.orchestrator-head { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px; }
.orchestrator-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--atlantic); color: white; font-family: var(--utility); font-size: 9px; font-weight: 800; }
.orchestrator-head strong, .orchestrator-head small { display: block; }
.orchestrator-head strong { font-size: 12px; }
.orchestrator-head small { margin-top: 3px; color: var(--slate); font-size: 9px; }
.execution-layers { display: grid; gap: 10px; }
.layer-choice { padding: 14px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.layer-choice--review { border-color: var(--line-dark); background: var(--porcelain); }
.layer-number { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--atlantic); color: white; font-family: var(--utility); font-size: 9px; font-weight: 800; }
.layer-copy strong, .layer-copy small { display: block; }
.layer-copy strong { font-size: 12px; }
.layer-copy small { margin-top: 3px; color: var(--slate); font-size: 9px; line-height: 1.4; }
.layer-choice select { grid-column: 1 / -1; }
.layer-connector { height: 16px; display: grid; place-items: center; color: var(--cobalt); font-family: var(--utility); font-size: 17px; font-weight: 800; }
.execution-result { min-width: 0; padding: clamp(22px, 3vw, 38px); background: #fbfcfe; }
.result-placeholder { min-height: 480px; display: grid; place-items: center; color: #8b98aa; text-align: center; }
.result-placeholder div { max-width: 330px; }
.result-placeholder .large-glyph { width: 62px; height: 62px; margin: 0 auto 16px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 18px; color: var(--cobalt); font-family: var(--utility); }
.result-content header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 19px; border-bottom: 1px solid var(--line); }
.result-content h3 { margin: 0; font-family: var(--display); font-size: 25px; }
.result-content pre { margin: 25px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--body); font-size: 13px; line-height: 1.75; }
.layer-results { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.agent-route { margin-top: 20px; padding: 14px; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--porcelain); }
.agent-route-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.agent-route-head strong, .agent-route-head small { display: block; }
.agent-route-head strong { font-size: 11px; }
.agent-route-head small { color: var(--slate); font-size: 8px; }
.agent-route-card { padding: 10px 0; display: grid; grid-template-columns: 46px 1fr; gap: 10px; border-bottom: 1px solid var(--line); }
.agent-route-card:last-child { border-bottom: 0; }
.agent-route-card > span { color: var(--cobalt); font-family: var(--utility); font-size: 8px; font-weight: 800; }
.agent-route-card strong, .agent-route-card small { display: block; }
.agent-route-card strong { font-size: 11px; }
.agent-route-card small { margin-top: 3px; color: var(--slate); font-size: 9px; line-height: 1.45; }
.layer-result { padding: 12px; display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.layer-result > span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ice); color: var(--ink); font-family: var(--utility); font-size: 8px; font-weight: 800; }
.layer-result strong, .layer-result small { display: block; }
.layer-result strong { font-size: 11px; }
.layer-result small { margin-top: 3px; color: var(--slate); font-size: 8px; line-height: 1.4; }
.layer-draft { margin-top: 22px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.layer-draft summary { cursor: pointer; color: var(--ink); font-size: 10px; font-weight: 800; }
.result-content .layer-draft pre { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--slate); font-size: 11px; }
.trace-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 28px; }
.trace-chip { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--slate); font-family: var(--utility); font-size: 8px; }

.simulator-layout { display: grid; grid-template-columns: minmax(320px, .8fr) minmax(0, 1.2fr); gap: 20px; }
.sim-form { padding: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sim-form .full { grid-column: 1 / -1; }
.sim-results { padding: 24px; }
.scenario-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.scenario-table th, .scenario-table td { padding: 13px 11px; border-bottom: 1px solid var(--line); text-align: right; }
.scenario-table th:first-child, .scenario-table td:first-child { text-align: left; }
.scenario-table th { color: var(--slate); font-family: var(--utility); font-size: 8px; text-transform: uppercase; }
.warning-box { margin-top: 18px; padding: 13px; border-left: 3px solid var(--amber); background: #fff9ef; color: #725320; font-size: 11px; line-height: 1.55; }

.table-panel { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th, .data-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table th { background: #fafbfd; color: #748196; font-family: var(--utility); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.data-table td strong { display: block; font-size: 11px; }
.data-table td small { display: block; margin-top: 4px; color: var(--slate); }
.data-table .input-cell { max-width: 360px; line-height: 1.45; }
.text-button--center { display: block; margin: 12px auto 0; }
.dialog-note { margin: 0; padding: 12px 24px; color: var(--atlantic); background: #eef7f5; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.45; }

.governance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.policy-list { padding: 3px 20px; }
.policy-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.policy-row:last-child { border-bottom: 0; }
.policy-row strong { display: block; font-size: 12px; }
.policy-row p { margin: 5px 0 0; color: var(--slate); font-size: 11px; line-height: 1.5; }
.provider-row { padding: 16px 20px; display: grid; grid-template-columns: 1fr auto; gap: 15px; border-bottom: 1px solid var(--line); }
.provider-row:last-child { border-bottom: 0; }
.provider-row strong, .provider-row small { display: block; }
.provider-row strong { font-size: 12px; }
.provider-row small { margin-top: 4px; color: var(--slate); font-size: 10px; }
.integrations-panel { overflow: hidden; }
.integration-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.integration-card { min-height: 150px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg, #fff, #f8fafc); }
.integration-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.integration-card strong, .integration-card small { display: block; }
.integration-category { display: block; margin-bottom: 5px; color: var(--slate); font-family: var(--utility); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.integration-card p { margin: 14px 0 10px; color: var(--slate); font-size: 11px; line-height: 1.5; }
.integration-card small { color: var(--atlantic); font-size: 10px; line-height: 1.4; }

.dialog { width: min(760px, calc(100vw - 30px)); max-height: min(88vh, 880px); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: 0 30px 90px rgba(4,18,36,.28); }
.dialog::backdrop { background: rgba(5,20,38,.57); backdrop-filter: blur(3px); }
.dialog form { max-height: inherit; display: flex; flex-direction: column; }
.dialog-header { padding: 22px 24px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 0; font-family: var(--display); font-size: 29px; }
.dialog-body { padding: 23px 24px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.dialog-body .field-full { grid-column: 1 / -1; }
.dialog-body textarea { min-height: 150px; }
.dialog-footer { padding: 15px 24px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); background: #fafbfd; }
.detail-copy { white-space: pre-wrap; color: var(--slate); font-size: 12px; line-height: 1.65; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: 390px; padding: 13px 17px; border-radius: 10px; background: var(--atlantic); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.skeleton { border-radius: 7px; background: linear-gradient(90deg, #eef1f5 20%, #f8f9fb 45%, #eef1f5 70%); background-size: 250% 100%; animation: loading 1.5s infinite; }
.page-stack > .skeleton:nth-child(1) { height: 82px; }
.page-stack > .skeleton:nth-child(2) { height: 150px; }
.page-stack > .skeleton:nth-child(3) { height: 330px; }
@keyframes loading { to { background-position: -250% 0; } }

@media (max-width: 1120px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dashboard-grid, .simulator-layout { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-view { grid-template-columns: 1fr; }
  .login-story { min-height: 410px; padding: 30px 25px; }
  .login-thesis { padding: 65px 0 45px; }
  .login-thesis h1 { font-size: clamp(43px, 13vw, 64px); }
  .login-flow { display: none; }
  .login-panel { padding: 55px 25px; }
  .app-shell { display: block; }
  .sidebar { transform: translate3d(-110vw, 0, 0); transition: transform .2s; box-shadow: var(--shadow); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .workspace { width: 100%; }
  .topbar { height: 76px; padding: 0 17px; }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .topbar h1 { font-size: 21px; }
  .mobile-menu { display: inline-grid; place-items: center; }
  .user-pill span:last-child, .desktop-only { display: none; }
  #main-content { min-height: calc(100vh - 76px); padding: 25px 17px; }
  .page-intro { align-items: start; flex-direction: column; }
  .map-head { display: block; }
  .map-head p { margin-top: 15px; }
  .map-flow { grid-template-columns: 1fr 1fr; }
  .map-flow::before { display: none; }
  .execute-layout { grid-template-columns: 1fr; }
  .execute-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .governance-grid { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .catalog-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }
  .catalog-toolbar select { width: 100%; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 100px; padding: 18px; }
  .stat strong { font-size: 29px; }
  .map-flow { grid-template-columns: 1fr; }
  .provider-options { grid-template-columns: 1fr; }
  .layer-results { grid-template-columns: 1fr; }
  .sim-form, .dialog-body { grid-template-columns: 1fr; }
  .integration-grid { grid-template-columns: 1fr; }
  .sim-form .full, .dialog-body .field-full { grid-column: auto; }
  .data-table th:nth-child(3), .data-table td:nth-child(3) { display: none; }
}

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