:root {
  --brand: #163aa9;
  --brand-deep: #0b236d;
  --brand-soft: #e9edff;
  --accent: #f59e0b;
  --canvas: #f3f5fa;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --ink: #101629;
  --muted: #657087;
  --line: #dfe4ee;
  --success: #16a34a;
  --danger: #dc2626;
  --sidebar: #0c1731;
  --sidebar-ink: #f6f8ff;
  --shadow: 0 16px 50px rgba(15, 23, 42, 0.1);
  --radius: 22px;
  --content: 1220px;
}

html[data-brand="norte"] {
  --brand: #075d54;
  --brand-deep: #063d38;
  --brand-soft: #dff4ee;
  --accent: #f97316;
  --sidebar: #061f1c;
}

html[data-theme="dark"] {
  --canvas: #0c1120;
  --surface: #141b2d;
  --surface-2: #192237;
  --ink: #f4f6ff;
  --muted: #a9b3ca;
  --line: #2d3852;
  --brand-soft: color-mix(in srgb, var(--brand) 25%, #171e30);
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 82px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 200; padding: 12px 18px; background: var(--surface); border-radius: 10px; }
.skip-link:focus { top: 20px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 268px;
  padding: 30px 22px;
  color: var(--sidebar-ink);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 32%),
    var(--sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.brand-lockup { display: grid; gap: 9px; padding: 0 6px 24px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-lockup small { display: block; color: rgba(255,255,255,.52); font-size: 10px; letter-spacing: .13em; text-align: center; text-transform: uppercase; }
.project-logo { height: 132px; padding: 10px 14px; display: grid; place-items: center; border-radius: 16px; background: #f9fafc; box-shadow: 0 9px 24px rgba(0,0,0,.18), inset 0 0 0 1px rgba(255,255,255,.45); overflow: hidden; }
.project-logo img { width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.project-logo:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.side-nav { padding: 25px 0; display: grid; gap: 5px; }
.nav-link { min-height: 48px; display: flex; align-items: center; gap: 13px; padding: 0 14px; border-radius: 12px; color: rgba(255,255,255,.62); text-decoration: none; font-weight: 600; transition: .2s ease; }
.nav-link span { font-size: 10px; letter-spacing: .08em; color: rgba(255,255,255,.34); }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: color-mix(in srgb, var(--brand) 60%, transparent); box-shadow: inset 3px 0 0 #fff; }
.nav-link.active span { color: rgba(255,255,255,.72); }
.sidebar-note { margin-top: auto; padding: 16px; display: flex; gap: 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.045); }
.sidebar-note p { margin: 0; color: rgba(255,255,255,.55); font-size: 11px; line-height: 1.45; }
.sidebar-note strong { color: rgba(255,255,255,.87); }
.live-dot { width: 8px; height: 8px; margin-top: 4px; flex: none; border-radius: 50%; background: #55d98d; box-shadow: 0 0 0 4px rgba(85,217,141,.12); }

.page { margin-left: 268px; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  background: color-mix(in srgb, var(--canvas) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 85%, transparent);
  backdrop-filter: blur(18px);
}
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.crumb span { color: var(--muted); }
.crumb b { color: var(--line); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.icon-button:hover { border-color: var(--brand); color: var(--brand); }
.theme-icon { font-size: 21px; line-height: 1; }
.menu-button { display: none; gap: 4px; align-content: center; }
.menu-button span { width: 18px; height: 2px; display: block; border-radius: 2px; background: currentColor; }
.brand-picker select { height: 44px; padding: 0 34px 0 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; outline: none; }

.section { max-width: var(--content); margin: 0 auto; padding: 108px 54px; }
.hero { max-width: none; padding-top: 86px; padding-bottom: 90px; background:
  radial-gradient(circle at 85% 13%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 24%),
  linear-gradient(180deg, color-mix(in srgb, var(--surface) 55%, transparent), transparent 78%);
}
.hero > * { max-width: calc(var(--content) - 108px); margin-left: auto; margin-right: auto; }
.eyebrow, .kicker, .overline { color: var(--brand); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 24px; }
.eyebrow span { width: 24px; height: 2px; background: var(--brand); }
.hero-grid { display: grid; grid-template-columns: 1.5fr .82fr; gap: clamp(40px, 7vw, 98px); align-items: stretch; }
.hero-copy h1 { margin: 0; max-width: 720px; font-size: clamp(48px, 6vw, 84px); line-height: .98; letter-spacing: -.065em; }
.hero-copy h1 em { color: var(--brand); font-style: normal; }
.hero-lead { max-width: 680px; margin: 30px 0 0; color: var(--muted); font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.button { min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; text-decoration: none; cursor: pointer; transition: .2s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 9px 24px color-mix(in srgb, var(--brand) 25%, transparent); }
.button-primary:hover { background: var(--brand-deep); }
.button-secondary { color: var(--brand); background: transparent; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.button-secondary:hover { background: var(--brand-soft); }
.button-ghost { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-ghost:hover { border-color: var(--brand); }
.hero-panel { min-height: 390px; padding: 28px; color: #fff; border-radius: 28px; background:
  linear-gradient(145deg, color-mix(in srgb, var(--brand) 78%, #050b1f), var(--brand-deep));
  box-shadow: 0 28px 70px color-mix(in srgb, var(--brand) 24%, transparent);
  display: flex; flex-direction: column; overflow: hidden; position: relative;
}
.hero-panel::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -85px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 70px rgba(255,255,255,.02); }
.hero-panel-top { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.pill { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.pill-brand { color: #fff; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.13); }
.hero-panel .muted { color: rgba(255,255,255,.48); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.hero-metric { margin: auto 0 28px; display: flex; align-items: flex-end; gap: 18px; position: relative; z-index: 1; }
.hero-metric strong { font-size: 86px; line-height: .8; letter-spacing: -.08em; }
.hero-metric span { color: rgba(255,255,255,.6); font-size: 13px; line-height: 1.35; text-transform: uppercase; letter-spacing: .08em; }
.metric-row { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid rgba(255,255,255,.15); border-bottom: 1px solid rgba(255,255,255,.15); }
.metric-row > div { padding: 17px 0; display: grid; gap: 2px; }
.metric-row strong { font-size: 22px; }
.metric-row span { color: rgba(255,255,255,.5); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.signal { display: flex; gap: 10px; align-items: flex-start; padding-top: 18px; }
.signal span { width: 8px; height: 8px; margin-top: 5px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(255,255,255,.08); }
.signal p { margin: 0; color: rgba(255,255,255,.66); font-size: 11px; line-height: 1.5; }

.principles-grid { margin-top: 70px; display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 14px; }
.principle-card { min-height: 220px; padding: 25px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); display: flex; flex-direction: column; }
.principle-card.feature { background: var(--brand-soft); border-color: transparent; }
.card-number { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.principle-card h3 { margin: auto 0 9px; font-size: 20px; letter-spacing: -.025em; }
.principle-card p { margin: 0; color: var(--muted); font-size: 13px; }
.role-comparison { margin-top: 100px; }
.section-intro { display: flex; justify-content: space-between; align-items: end; gap: 50px; margin-bottom: 38px; }
.section-intro > div { max-width: 650px; }
.section-intro h2 { margin: 7px 0 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -.045em; }
.section-intro > p { max-width: 420px; margin: 0; color: var(--muted); }
.section-intro.compact h2 { font-size: clamp(28px, 3vw, 40px); }
.role-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.role-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.role-icon { width: 44px; height: 44px; margin-bottom: 30px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 13px; font-weight: 800; }
.role-card > div:nth-child(2) > span { color: var(--brand); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.role-card h3 { margin: 7px 0 10px; font-size: 19px; letter-spacing: -.025em; }
.role-card p { min-height: 68px; margin: 0; color: var(--muted); font-size: 13px; }
.role-card ul { margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 7px; list-style: none; }
.role-card li { padding: 5px 9px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 10px; font-weight: 700; }
.role-card.manager .role-icon { color: #9a5a00; background: #fff1d6; }
.role-card.dual .role-icon { color: #6941c6; background: #f0eaff; }

.prototypes-section { max-width: none; color: #fff; background: #09152f; }
.prototypes-section > * { max-width: calc(var(--content) - 108px); margin-left: auto; margin-right: auto; }
.prototypes-section .kicker { color: #8ea8ff; }
.prototypes-section .section-intro > p, .interaction-hint { color: rgba(255,255,255,.57); }
.prototype-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: start; }
.prototype-card { padding: 0; color: #fff; text-align: left; background: #111f3e; border: 1px solid rgba(255,255,255,.1); border-radius: 19px; overflow: hidden; cursor: pointer; transition: .25s ease; }
.prototype-card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.35); box-shadow: 0 24px 45px rgba(0,0,0,.3); }
.prototype-meta { height: 78px; padding: 0 15px; display: grid; grid-template-columns: 38px 1fr 24px; gap: 10px; align-items: center; }
.prototype-meta > span { width: 36px; height: 36px; display: grid; place-items: center; color: #afc0ff; background: rgba(119,145,255,.12); border-radius: 10px; font-size: 11px; font-weight: 800; }
.prototype-meta strong, .prototype-meta small { display: block; }
.prototype-meta strong { font-size: 13px; }
.prototype-meta small { color: rgba(255,255,255,.43); font-size: 10px; margin-top: 2px; }
.prototype-meta b { color: rgba(255,255,255,.42); font-weight: 400; }
.phone-crop { height: 370px; margin: 0 10px 10px; overflow: hidden; border-radius: 12px; background: #f8f7ff; }
.prototype-card.tall .phone-crop { height: 430px; }
.phone-crop img { width: 100%; height: auto; transition: transform 1.5s cubic-bezier(.2,.8,.2,1); }
.prototype-card:hover .phone-crop img { transform: translateY(-8%); }
.interaction-hint { margin-top: 18px; font-size: 12px; }
.interaction-hint span { margin-right: 5px; color: #9fb2ff; }

.screen-map-section { max-width: none; background: var(--surface-2); }
.screen-map-section > * { max-width: calc(var(--content) - 108px); margin-left: auto; margin-right: auto; }
.catalog-toolbar { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.search-box { min-width: 290px; flex: 1; height: 50px; display: flex; align-items: center; gap: 11px; padding: 0 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.search-box span { color: var(--muted); font-size: 21px; }
.search-box input { width: 100%; color: var(--ink); background: transparent; border: 0; outline: 0; }
.search-box input::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
.filter-group { display: flex; gap: 7px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.filter-chip { min-height: 38px; padding: 0 13px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; cursor: pointer; font-size: 12px; font-weight: 700; }
.filter-chip span { margin-left: 4px; opacity: .55; }
.filter-chip:hover, .filter-chip.active { color: #fff; background: var(--brand); }
.block-tabs { margin-bottom: 24px; display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.block-tab { min-height: 42px; flex: none; padding: 0 14px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 700; }
.block-tab b { margin-right: 4px; color: var(--brand); }
.block-tab.active { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.screen-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.screen-card { min-height: 205px; padding: 20px; color: var(--ink); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; cursor: pointer; display: flex; flex-direction: column; transition: .2s ease; }
.screen-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: 0 14px 30px rgba(15,23,42,.08); }
.screen-card-top { display: flex; align-items: center; justify-content: space-between; }
.screen-code { min-width: 35px; height: 28px; padding: 0 9px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 8px; font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.screen-arrow { color: var(--muted); font-size: 16px; transition: transform .2s; }
.screen-card:hover .screen-arrow { color: var(--brand); transform: translate(2px,-2px); }
.screen-card h3 { margin: auto 0 8px; font-size: 17px; line-height: 1.25; letter-spacing: -.02em; }
.screen-card p { margin: 0; min-height: 41px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.screen-roles { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 5px; }
.screen-role { padding: 4px 7px; color: var(--muted); background: var(--surface-2); border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.empty-results { padding: 70px 20px; text-align: center; }
.empty-results span, .empty-results strong { display: block; }
.empty-results span { color: var(--brand); font-size: 34px; }
.empty-results strong { margin-top: 8px; }
.empty-results p { margin: 4px 0 0; color: var(--muted); }

.flow-board { padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.flow-column { max-width: 250px; margin: auto; text-align: center; }
.flow-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.flow-label span { width: 26px; height: 26px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 7px; }
.flow-label.blue span { color: #1641bc; background: #e5ebff; }
.flow-label.violet span { color: #7044c7; background: #f0e9ff; }
.flow-label.amber span { color: #a45b00; background: #fff0d4; }
.flow-node { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; font-weight: 750; }
.flow-node.strong { color: #fff; background: var(--brand); border-color: var(--brand); }
.flow-node.subtle { color: var(--muted); border-style: dashed; }
.flow-column i, .flow-outcomes i { display: block; padding: 5px 0; color: var(--muted); font-style: normal; }
.flow-split { height: 54px; margin: 0 auto 8px; max-width: 720px; position: relative; }
.flow-split::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 27px; background: var(--line); }
.flow-split::after { content: ""; position: absolute; top: 27px; left: 16.5%; right: 16.5%; height: 1px; background: var(--line); }
.flow-split span { position: absolute; top: 27px; width: 1px; height: 27px; background: var(--line); }
.flow-split span:nth-child(1) { left: 16.5%; }.flow-split span:nth-child(2) { left: 50%; }.flow-split span:nth-child(3) { right: 16.5%; }
.flow-outcomes { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; text-align: center; }
.mini-flow { margin-top: 10px; display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.mini-flow span { padding: 7px 4px; color: var(--muted); background: var(--surface-2); border-radius: 7px; font-size: 9px; font-weight: 700; }
.journey-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.journey-grid article { min-height: 180px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.journey-grid span { color: var(--brand); font-size: 10px; font-weight: 900; letter-spacing: .09em; }
.journey-grid h3 { margin: 36px 0 7px; font-size: 16px; }
.journey-grid p { margin: 0; color: var(--muted); font-size: 12px; }

.system-section { max-width: none; background: var(--surface-2); }
.system-section > * { max-width: calc(var(--content) - 108px); margin-left: auto; margin-right: auto; }
.design-system-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 12px; }
.design-system-grid article { min-height: 330px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.design-system-grid h3 { margin: 11px 0 20px; font-size: 20px; letter-spacing: -.025em; }
.swatches { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.swatch { min-width: 0; }
.swatch > span { height: 76px; margin-bottom: 9px; display: block; border-radius: 10px; background: var(--brand); }
.swatch.secondary > span { background: var(--accent); }.swatch.success > span { background: var(--success); }.swatch.danger > span { background: var(--danger); }
.swatch b, .swatch small { display: block; overflow: hidden; text-overflow: ellipsis; }
.swatch b { font-size: 10px; }.swatch small { color: var(--muted); font-size: 9px; }
.rule-callout { margin: 22px 0 0; padding: 12px; color: var(--muted); background: var(--surface-2); border-radius: 10px; font-size: 11px; }
.type-card { display: flex; flex-direction: column; }
.type-sample { margin-top: 24px; }
.type-sample strong, .type-sample span { display: block; }
.type-sample strong { font-size: 35px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.type-sample span { margin-top: 7px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.type-sample.medium { margin-top: 32px; }.type-sample.medium strong { font-size: 22px; }
.type-card p, .touch-card p { margin: auto 0 0; color: var(--muted); font-size: 12px; }
.touch-demo { height: 130px; margin: 22px 0 0; padding: 24px; display: flex; align-items: center; gap: 12px; background: var(--brand-soft); border-radius: 14px; }
.touch-demo button { height: 56px; padding: 0 18px; color: #fff; background: var(--brand); border: 0; border-radius: 11px; font-weight: 700; }
.touch-demo span { color: var(--brand); font-size: 11px; font-weight: 800; }
.component-list { margin-top: 14px; padding: 24px; display: grid; grid-template-columns: 1fr 2fr; gap: 40px; align-items: center; border-radius: 18px; color: #fff; background: var(--sidebar); }
.component-heading span { color: #9eb1f7; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.component-heading p { margin: 8px 0 0; color: rgba(255,255,255,.55); font-size: 12px; }
.component-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.component-chips span { padding: 7px 10px; color: rgba(255,255,255,.76); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 8px; font-size: 10px; }

.states-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 0; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); overflow: hidden; }
.states-strip article { min-height: 190px; padding: 23px; border-right: 1px solid var(--line); }
.states-strip article:last-child { border-right: 0; }
.states-strip strong { display: block; margin: 24px 0 7px; }
.states-strip p { margin: 0; color: var(--muted); font-size: 11px; }
.state-icon { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-weight: 900; }
.state-icon.loading { position: relative; overflow: hidden; }
.state-icon.loading::before { content: ""; width: 19px; height: 7px; background: color-mix(in srgb, var(--brand) 25%, transparent); border-radius: 4px; }
.state-icon.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.state-icon.error { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.state-icon.offline { color: #9a5a00; background: #fff3d9; }
.states-note { margin: -4px 0 18px; padding: 12px 15px; color: var(--muted); background: var(--brand-soft); border-radius: 11px; font-size: 11px; }
.states-note strong { color: var(--ink); }
.rules-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.config-card { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.config-head { display: flex; justify-content: space-between; gap: 20px; }
.config-head h3 { margin: 7px 0 0; font-size: 20px; }
.count-badge { height: 28px; padding: 0 9px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 8px; font-size: 10px; font-weight: 800; }
.check-list { margin: 24px 0 0; padding: 0; list-style: none; }
.check-list li { min-height: 47px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--line); font-size: 11px; }
.check-list span { font-weight: 700; }.check-list b { color: var(--muted); text-align: right; font-size: 10px; font-weight: 600; }
.privacy-demo { margin-top: 14px; padding: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; color: #fff; border-radius: 18px; background: linear-gradient(135deg, var(--brand-deep), var(--brand)); }
.privacy-demo .overline { color: rgba(255,255,255,.58); }
.privacy-demo h3 { margin: 8px 0; font-size: 24px; }.privacy-demo p { margin: 0; color: rgba(255,255,255,.62); font-size: 12px; }
.privacy-values { display: grid; justify-items: end; }
.privacy-values > span { color: rgba(255,255,255,.6); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; }
.privacy-values strong { margin: 3px 0 16px; font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.privacy-values .button { color: #fff; border-color: rgba(255,255,255,.34); }
.privacy-values .button:hover { background: rgba(255,255,255,.1); }
.microcopy-panel { margin-top: 14px; padding: 28px; display: grid; grid-template-columns: 1fr 1.5fr; gap: 40px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.microcopy-panel h3 { margin: 8px 0; font-size: 22px; }.microcopy-panel p { margin: 0; color: var(--muted); font-size: 12px; }
.quote-stack { display: grid; gap: 8px; }
blockquote { margin: 0; padding: 12px 15px; color: var(--muted); background: var(--surface-2); border-left: 3px solid var(--brand); border-radius: 0 9px 9px 0; font-size: 11px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; color: var(--muted); background: var(--surface-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
td { font-size: 11px; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 750; }
.access-yes { color: var(--success); font-weight: 800; }.access-no { color: var(--muted); opacity: .5; }.access-note { color: var(--brand); font-weight: 700; }
.table-note { margin: 14px 0 0; padding: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--muted); background: var(--brand-soft); border-radius: 11px; font-size: 11px; }
.table-note span { width: 19px; height: 19px; flex: none; display: grid; place-items: center; color: #fff; background: var(--brand); border-radius: 50%; font-size: 10px; font-weight: 800; }

.deliverables-section { max-width: none; background: var(--surface-2); }
.deliverables-section > * { max-width: calc(var(--content) - 108px); margin-left: auto; margin-right: auto; }
.deliverable-list { margin-top: 0; padding: 0; display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; list-style: none; counter-reset: item; }
.deliverable-list li { min-height: 96px; padding: 18px; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.deliverable-list li > span { width: 36px; height: 36px; display: grid; place-items: center; color: var(--brand); background: var(--brand-soft); border-radius: 10px; font-size: 10px; font-weight: 900; }
.deliverable-list strong { font-size: 13px; }.deliverable-list p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

footer { min-height: 150px; padding: 44px 54px; display: flex; align-items: center; justify-content: space-between; gap: 30px; color: rgba(255,255,255,.68); background: var(--sidebar); }
footer strong, footer span { display: block; } footer strong { color: #fff; } footer span { font-size: 11px; } footer p { font-size: 11px; } footer a { color: #fff; }

dialog { padding: 0; color: var(--ink); border: 0; background: transparent; }
dialog::backdrop { background: rgba(4,9,22,.72); backdrop-filter: blur(5px); }
.screen-dialog { width: min(860px, calc(100% - 28px)); max-height: calc(100vh - 30px); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.dialog-shell { min-height: 550px; display: grid; grid-template-columns: 160px 1fr; position: relative; }
.dialog-code { display: grid; place-items: center; color: #fff; background: linear-gradient(165deg,var(--brand),var(--brand-deep)); font-size: 54px; font-weight: 900; letter-spacing: -.06em; }
.dialog-content { padding: 40px; overflow: auto; }
.dialog-content h2 { margin: 8px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.dialog-summary { margin: 0; color: var(--muted); font-size: 15px; }
.dialog-role-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.dialog-columns { margin-top: 32px; display: grid; grid-template-columns: repeat(2,1fr); gap: 34px; }
.dialog-columns ul { margin: 12px 0 0; padding: 0; list-style: none; }
.dialog-columns li { padding: 9px 0 9px 16px; position: relative; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 12px; }
.dialog-columns li::before { content: ""; position: absolute; left: 0; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.dialog-footer { margin-top: 30px; padding-top: 18px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.dialog-close { position: absolute; z-index: 2; right: 14px; top: 14px; font-size: 21px; }
.image-dialog { width: min(950px, calc(100% - 24px)); max-height: calc(100vh - 20px); border-radius: 18px; background: #0b1225; box-shadow: 0 30px 90px rgba(0,0,0,.5); overflow: hidden; }
.image-dialog-bar { height: 60px; padding: 0 14px 0 21px; display: flex; justify-content: space-between; align-items: center; color: #fff; border-bottom: 1px solid rgba(255,255,255,.1); }
.image-dialog-bar .icon-button { color: #fff; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.1); }
.image-stage { max-height: calc(100vh - 80px); padding: 24px; overflow: auto; display: grid; justify-content: center; background: repeating-linear-gradient(45deg,#0a1123,#0a1123 14px,#0c152a 14px,#0c152a 28px); }
.image-stage img { width: min(430px, 100%); border-radius: 22px; box-shadow: 0 20px 55px rgba(0,0,0,.45); }
.mobile-scrim { display: none; }

@media (max-width: 1180px) {
  .sidebar { width: 232px; }.page { margin-left: 232px; }
  .section { padding-left: 34px; padding-right: 34px; }
  .hero > *, .prototypes-section > *, .screen-map-section > *, .system-section > *, .deliverables-section > * { max-width: calc(var(--content) - 68px); }
  .screen-grid { grid-template-columns: repeat(3,1fr); }
  .prototype-grid { grid-template-columns: repeat(2,1fr); }.phone-crop, .prototype-card.tall .phone-crop { height: 460px; }
  .design-system-grid { grid-template-columns: 1.25fr 1fr; }.touch-card { grid-column: span 2; min-height: 250px !important; }
  .touch-card .touch-demo { float: left; width: 48%; margin-right: 24px; }
}

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); width: 274px; transition: transform .25s ease; }.sidebar.open { transform: translateX(0); }
  .page { margin-left: 0; }.menu-button { display: grid; }
  .mobile-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(4,9,22,.55); }.mobile-scrim.visible { display: block; }
  .hero-grid { grid-template-columns: 1fr; }.hero-panel { min-height: 330px; }
  .principles-grid, .role-grid { grid-template-columns: 1fr 1fr; }.principle-card.feature, .role-card.dual { grid-column: span 2; }
  .section-intro { align-items: start; flex-direction: column; gap: 15px; }
  .catalog-toolbar { align-items: stretch; flex-direction: column; }.filter-group { overflow-x: auto; }.filter-chip { flex: none; }
  .screen-grid { grid-template-columns: repeat(2,1fr); }
  .flow-outcomes { gap: 10px; }.journey-grid { grid-template-columns: repeat(2,1fr); }
  .states-strip { grid-template-columns: repeat(2,1fr); }.states-strip article:nth-child(2) { border-right: 0; }.states-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .rules-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 66px; }
  .topbar { height: 64px; padding: 0 14px; }.crumb, .brand-picker, .spec-link { display: none; }
  .section { padding: 72px 18px; }
  .hero { padding-top: 52px; }
  .hero > *, .prototypes-section > *, .screen-map-section > *, .system-section > *, .deliverables-section > * { max-width: none; }
  .hero-copy h1 { font-size: clamp(45px, 14vw, 68px); }.hero-lead { font-size: 16px; }.hero-actions .button { flex: 1; }
  .hero-panel { min-height: 320px; padding: 22px; }.hero-metric strong { font-size: 72px; }
  .principles-grid, .role-grid { grid-template-columns: 1fr; margin-top: 46px; }.principle-card.feature, .role-card.dual { grid-column: auto; }.principle-card { min-height: 180px; }
  .role-comparison { margin-top: 70px; }.role-card p { min-height: 0; }
  .section-intro { margin-bottom: 28px; }.section-intro h2 { font-size: 34px; }
  .prototype-grid { grid-template-columns: 1fr 1fr; gap: 9px; }.prototype-meta { height: 68px; grid-template-columns: 34px 1fr; padding: 0 9px; }.prototype-meta b, .prototype-meta small { display: none; }.prototype-meta strong { font-size: 11px; }.phone-crop, .prototype-card.tall .phone-crop { height: 315px; margin: 0 6px 6px; }
  .search-box { min-width: 0; }.filter-group { padding: 4px; }
  .screen-grid { grid-template-columns: 1fr; }.screen-card { min-height: 170px; }
  .flow-board { padding: 24px 14px; }.flow-split { display: none; }.flow-outcomes { grid-template-columns: 1fr; margin-top: 22px; gap: 25px; }.mini-flow { grid-template-columns: repeat(3,1fr); }
  .journey-grid { grid-template-columns: 1fr; }.journey-grid article { min-height: 140px; }.journey-grid h3 { margin-top: 20px; }
  .design-system-grid { grid-template-columns: 1fr; }.touch-card { grid-column: auto; }.touch-card .touch-demo { float: none; width: auto; margin-right: 0; }.swatches { grid-template-columns: repeat(2,1fr); }.component-list { grid-template-columns: 1fr; gap: 20px; }
  .states-strip { grid-template-columns: 1fr; }.states-strip article { min-height: 155px; border-right: 0; border-bottom: 1px solid var(--line); }.states-strip article:last-child { border-bottom: 0; }
  .privacy-demo, .microcopy-panel { grid-template-columns: 1fr; gap: 25px; }.privacy-values { justify-items: start; }.privacy-values strong { font-size: 30px; }
  .deliverable-list { grid-template-columns: 1fr; }
  footer { padding: 38px 18px; align-items: start; flex-direction: column; }
  .dialog-shell { display: block; }.dialog-code { height: 110px; }.dialog-content { padding: 26px 20px; }.dialog-content h2 { font-size: 27px; }.dialog-columns { grid-template-columns: 1fr; gap: 24px; }.dialog-footer { align-items: stretch; flex-direction: column; gap: 12px; }.dialog-footer .button { width: 100%; }
}

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