:root {
  --ink: #07111f;
  --ink-2: #0d1b2d;
  --ink-3: #13253c;
  --surface: #f4f7fb;
  --card: #ffffff;
  --line: #dce4ee;
  --muted: #607086;
  --blue: #1687ff;
  --cyan: #32d5ff;
  --green: #22c987;
  --amber: #f2b84b;
  --red: #f05c63;
  --purple: #8c74ff;
  --shadow: 0 18px 50px rgba(8, 25, 47, .10);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; background: #050b14; color: white; position: relative; overflow: hidden; padding: 28px; }
.auth-grid { position: absolute; inset: -20%; background-image: linear-gradient(rgba(44, 177, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(44, 177, 255, .08) 1px, transparent 1px); background-size: 52px 52px; transform: perspective(700px) rotateX(58deg) translateY(25%); mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent); }
.auth-screen::before, .auth-screen::after { content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .3; }
.auth-screen::before { width: 420px; height: 420px; background: var(--blue); top: -180px; left: -120px; }
.auth-screen::after { width: 360px; height: 360px; background: #17bfaa; right: -100px; bottom: -170px; }
.auth-card { width: min(480px, 100%); border: 1px solid rgba(255,255,255,.13); background: rgba(10, 22, 38, .82); backdrop-filter: blur(24px); border-radius: 28px; padding: 46px; box-shadow: 0 30px 90px rgba(0,0,0,.45); position: relative; z-index: 2; }
.auth-mark, .brand-mark { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: white; font-weight: 900; letter-spacing: -.04em; background: linear-gradient(135deg, var(--blue), #2ad9d0); box-shadow: 0 10px 30px rgba(22,135,255,.3); }
.auth-card .eyebrow { margin-top: 32px; }
.auth-card h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.05; letter-spacing: -.045em; margin: 14px 0 18px; }
.auth-copy { color: #aebbd0; line-height: 1.7; margin-bottom: 32px; }
.auth-card label { display: block; color: #d7e3f4; font-size: 13px; font-weight: 800; margin-bottom: 9px; }
.password-row { position: relative; }
.password-row input { width: 100%; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: white; padding: 15px 78px 15px 16px; border-radius: 12px; outline: none; }
.password-row input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(50,213,255,.11); }
.reveal { position: absolute; right: 7px; top: 7px; bottom: 7px; border: 0; border-radius: 8px; color: #9fb0c8; background: rgba(255,255,255,.08); font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.auth-error { min-height: 22px; margin: 8px 0 2px; color: #ff8b91; font-size: 12px; }
.primary-button { border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--blue), #0874df); color: white; font-weight: 800; padding: 13px 18px; box-shadow: 0 10px 24px rgba(22,135,255,.24); display: inline-flex; align-items: center; gap: 20px; justify-content: center; }
.primary-button:hover { transform: translateY(-1px); filter: brightness(1.05); }
.auth-submit { width: 100%; padding: 15px; }
.auth-foot { margin-top: 26px; font-size: 11px; color: #8091aa; display: flex; align-items: center; gap: 9px; justify-content: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(34,201,135,.12); }

.site-shell { min-height: 100vh; }
.sidebar { width: 282px; position: fixed; inset: 0 auto 0 0; background: #fff; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; z-index: 20; transition: transform .25s ease; }
.brand-block { display: flex; gap: 13px; align-items: center; padding: 0 5px 21px; border-bottom: 2px solid var(--blue); }
.brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 14px; }
.brand-block strong, .brand-block span { display: block; }
.brand-block strong { letter-spacing: .04em; font-size: 15px; }
.brand-block span { color: var(--muted); font-size: 10px; margin-top: 4px; letter-spacing: .08em; }
.document-card, .language-card, .baseline-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-top: 18px; }
.document-card { display: flex; align-items: center; gap: 11px; background: linear-gradient(135deg, #f4f9ff, #fff); border-color: #cfe5ff; }
.document-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #e7f3ff; color: var(--blue); }
.document-card strong, .document-card small { display: block; }
.document-card strong { font-size: 12px; }
.document-card small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.language-card { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); padding: 11px 13px; }
.language-card strong { color: white; background: var(--blue); padding: 7px 10px; border-radius: 7px; font-size: 9px; letter-spacing: .08em; }
.nav-label { font-size: 9px; font-weight: 900; color: #8995a5; letter-spacing: .18em; margin: 23px 10px 10px; }
.chapter-nav { overflow: auto; flex: 1; padding-right: 4px; scrollbar-width: thin; }
.nav-item { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 28px 1fr 12px; gap: 8px; align-items: center; text-align: left; padding: 10px 9px; border-radius: 11px; color: #56667a; margin-bottom: 3px; }
.nav-item:hover { background: #f3f6fa; }
.nav-item.active { background: #eaf4ff; color: #0875df; }
.nav-item .nav-index { font-size: 9px; font-weight: 900; color: #9ba8b8; }
.nav-item.active .nav-index { color: var(--blue); }
.nav-copy strong, .nav-copy small { display: block; }
.nav-copy strong { font-size: 11px; }
.nav-copy small { color: #8b98a9; font-size: 8px; margin-top: 3px; }
.nav-chevron { font-size: 14px; color: #abb7c5; }
.baseline-card { display: flex; gap: 10px; align-items: flex-start; margin-top: 10px; }
.shield { width: 25px; height: 25px; flex: 0 0 25px; background: #e9fff6; color: var(--green); display: grid; place-items: center; border-radius: 8px; font-weight: 900; }
.baseline-card strong, .baseline-card small { display: block; }
.baseline-card strong { font-size: 10px; }
.baseline-card small { color: var(--muted); font-size: 8px; line-height: 1.45; margin-top: 4px; }
.sidebar-toggle { border: 1px solid var(--line); border-radius: 11px; background: white; margin-top: 11px; padding: 11px; color: #6a788a; font-size: 10px; font-weight: 800; }

.workspace { margin-left: 282px; min-height: 100vh; transition: margin .25s ease; }
.topbar { height: 78px; position: sticky; top: 0; z-index: 15; background: rgba(255,255,255,.9); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); padding: 0 30px; display: flex; align-items: center; justify-content: space-between; }
.topbar p { margin: 0 0 4px; color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.topbar strong { font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.status-pill { border: 1px solid; border-radius: 999px; padding: 6px 10px; font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.status-pill.green { color: #13895d; border-color: #b9eed8; background: #effcf7; }
.status-pill.blue { color: #0d72cf; border-color: #c6e2ff; background: #f0f7ff; }
.status-pill i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); }
.top-actions button { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 9px 13px; font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.top-actions button:hover { border-color: #aac8e9; background: #f7fbff; }

.content { padding: 24px 26px 46px; max-width: 1540px; margin: 0 auto; }
.section-control { border: 1px solid var(--line); background: white; border-radius: 16px; box-shadow: 0 8px 24px rgba(8,25,47,.05); display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; margin-bottom: 20px; }
.section-control > div:first-child { display: flex; flex-direction: column; gap: 3px; }
.section-control strong { font-size: 10px; }
.section-control span { color: var(--muted); font-size: 8px; }
.view-button { border: 1px solid var(--line); background: white; color: #65768b; border-radius: 9px; padding: 9px 12px; font-size: 9px; font-weight: 800; margin-left: 5px; }
.view-button.active { background: #eaf4ff; color: #0875df; border-color: #b9ddff; }

.chapter { display: none; animation: chapterIn .38s ease both; }
.chapter.active, .chapters.show-all .chapter { display: block; }
.chapters.show-all .chapter { margin-bottom: 70px; padding-bottom: 70px; border-bottom: 1px dashed #bdcad8; }
@keyframes chapterIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.eyebrow { color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .18em; margin: 0; }
.eyebrow.cyan { color: var(--cyan); }
.eyebrow.amber { color: var(--amber); }
.hero-panel { min-height: 510px; color: white; border-radius: 25px; padding: clamp(34px, 5vw, 66px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); align-items: center; gap: clamp(32px, 5vw, 75px); background: radial-gradient(circle at 82% 24%, rgba(22,135,255,.3), transparent 25%), radial-gradient(circle at 75% 90%, rgba(34,201,135,.14), transparent 30%), linear-gradient(130deg, #07111f 0%, #0a1b31 58%, #07101d 100%); box-shadow: 0 25px 70px rgba(3,15,30,.22); overflow: hidden; position: relative; }
.hero-panel::before { content: ""; position: absolute; width: 370px; height: 370px; border: 1px solid rgba(50,213,255,.14); border-radius: 50%; right: -160px; top: -140px; box-shadow: 0 0 0 45px rgba(50,213,255,.025), 0 0 0 90px rgba(50,213,255,.018); }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h1 { font-size: clamp(40px, 4.6vw, 72px); line-height: 1.02; letter-spacing: -.055em; margin: 20px 0 25px; max-width: 900px; }
.hero-copy > p:not(.eyebrow) { color: #a9b8cb; line-height: 1.7; max-width: 720px; font-size: 14px; }
.hero-actions { margin-top: 34px; display: flex; gap: 10px; }
.ghost-button { border: 1px solid rgba(255,255,255,.18); color: white; background: rgba(255,255,255,.06); border-radius: 11px; padding: 13px 18px; font-weight: 800; }
.hero-principles { border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: rgba(255,255,255,.055); backdrop-filter: blur(12px); position: relative; z-index: 1; }
.panel-caption { padding: 15px 18px; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,.12); font-size: 8px; font-weight: 900; letter-spacing: .12em; color: #aebbd0; }
.panel-caption b { background: #06101e; color: var(--cyan); padding: 5px 8px; border-radius: 999px; }
.hero-principles article { display: flex; gap: 14px; padding: 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.hero-principles article:last-child { border: 0; }
.hero-principles article i { color: var(--cyan); font-style: normal; font-size: 10px; font-weight: 900; }
.hero-principles strong, .hero-principles span { display: block; }
.hero-principles strong { font-size: 11px; }
.hero-principles span { color: #91a2b7; font-size: 9px; line-height: 1.5; margin-top: 5px; }

.metric-grid { display: grid; gap: 14px; margin: 18px 0; }
.metric-grid.four { grid-template-columns: repeat(4, 1fr); }
.metric-grid article { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 19px; display: grid; grid-template-columns: auto 1fr; column-gap: 13px; align-items: center; }
.metric-grid article span { grid-row: span 2; color: var(--blue); font-size: 28px; font-weight: 900; letter-spacing: -.05em; }
.metric-grid strong { font-size: 10px; }
.metric-grid small { color: var(--muted); font-size: 8px; margin-top: 3px; }
.landscape-card, .mapping-card { background: white; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.section-heading span, .mapping-head span { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.section-heading h2, .mapping-head h2 { font-size: 23px; letter-spacing: -.03em; margin: 7px 0 0; }
.section-heading > p { color: var(--muted); font-size: 9px; max-width: 270px; text-align: right; }
.landscape-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 9px; margin-top: 28px; }
.system-node { min-height: 115px; border-radius: 15px; padding: 18px; display: flex; flex-direction: column; justify-content: center; border: 1px solid; }
.system-node small { font-size: 7px; font-weight: 900; letter-spacing: .12em; opacity: .65; }
.system-node strong { font-size: 16px; margin: 8px 0 5px; }
.system-node span { font-size: 8px; opacity: .7; }
.system-node.device { border-color: #c9d7e6; background: #f7f9fc; }
.system-node.core { border-color: #87c5ff; background: #eaf5ff; color: #075ca9; }
.system-node.data { border-color: #91e3c5; background: #edfcf6; color: #087854; }
.system-node.people { border-color: #d8ccff; background: #f5f1ff; color: #6047bc; }
.flow-arrow { color: #8594a6; text-align: center; }
.flow-arrow b { display: block; font-size: 6px; letter-spacing: .08em; }
.flow-arrow span { font-size: 21px; }

.chapter-intro { padding: 22px 7px 30px; display: grid; grid-template-columns: 1.35fr .65fr; gap: 65px; align-items: end; }
.chapter-intro h1 { font-size: clamp(34px, 4vw, 61px); line-height: 1.06; letter-spacing: -.05em; margin: 14px 0 0; }
.chapter-intro > p { color: var(--muted); line-height: 1.7; font-size: 13px; padding-bottom: 5px; }
.before-after { display: grid; grid-template-columns: 1fr 80px 1fr; align-items: center; }
.before-after article { border-radius: 22px; padding: 31px; min-height: 340px; }
.before-after article > span, .objective-grid b { font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.before-after h3 { font-size: 27px; margin: 12px 0 24px; }
.before-after ul, .mode-card ul, .app-card ul, .gate-grid ul { list-style: none; padding: 0; margin: 0; }
.before-after li { position: relative; padding: 12px 0 12px 23px; border-top: 1px solid; font-size: 11px; line-height: 1.45; }
.before-after li::before { content: "×"; position: absolute; left: 0; font-weight: 900; }
.before { color: #5c6879; background: #f1f3f6; border: 1px solid #d9dfe7; }
.before li { border-color: #d8dee6; }
.before li::before { color: var(--red); }
.after { color: white; background: linear-gradient(140deg, #087eea, #0759b7); border: 1px solid #258ff4; box-shadow: 0 22px 55px rgba(8,116,223,.24); }
.after li { border-color: rgba(255,255,255,.18); }
.after li::before { content: "✓"; color: #8af3ca; }
.transform-mark { text-align: center; color: var(--blue); }
.transform-mark span { display: block; font-size: 30px; }
.transform-mark small { writing-mode: vertical-rl; font-size: 7px; font-weight: 900; letter-spacing: .16em; margin-top: 9px; }
.objective-grid, .responsibility-grid, .database-grid, .acceptance-grid { display: grid; gap: 14px; margin-top: 18px; }
.objective-grid { grid-template-columns: repeat(4, 1fr); }
.objective-grid article, .responsibility-grid article, .database-grid article, .acceptance-grid article { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 21px; }
.objective-grid b { color: var(--blue); }
.objective-grid strong { display: block; margin: 20px 0 8px; }
.objective-grid p, .responsibility-grid p, .database-grid p, .acceptance-grid p { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 0; }

.architecture-stack { max-width: 1040px; margin: 0 auto; }
.layer { border: 1px solid; border-radius: 16px; padding: 19px 23px; display: grid; grid-template-columns: 150px 1fr 220px; align-items: center; gap: 15px; }
.layer > span { font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.layer > div { display: flex; gap: 8px; }
.layer strong { padding: 9px 12px; border-radius: 8px; font-size: 10px; background: rgba(255,255,255,.72); }
.layer small { text-align: right; font-size: 8px; opacity: .7; }
.layer.surfaces { background: #f3f0ff; border-color: #cec2ff; color: #5b43b4; }
.layer.api { background: #eaf5ff; border-color: #9ccfff; color: #075da9; }
.layer.runtime { background: #ebfbf6; border-color: #9ce1c7; color: #097450; }
.layer.foundation { background: #101f32; border-color: #233d5c; color: white; }
.layer.foundation strong { background: rgba(255,255,255,.1); }
.stack-link { text-align: center; color: #7e8da0; font-size: 7px; font-weight: 900; letter-spacing: .1em; padding: 10px; position: relative; }
.stack-link::before, .stack-link::after { content: ""; display: inline-block; width: 24%; max-width: 190px; border-top: 1px dashed #b9c5d2; vertical-align: middle; margin: 0 14px; }
.responsibility-grid { grid-template-columns: repeat(4, 1fr); }
.responsibility-grid span, .database-grid span { color: var(--blue); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.responsibility-grid strong { display: block; margin: 12px 0 8px; }

.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mode-card { background: white; border: 1px solid var(--line); border-radius: 19px; padding: 25px; position: relative; overflow: hidden; }
.mode-card::before { content: ""; position: absolute; height: 4px; inset: 0 0 auto; }
.mode-card.mc::before { background: var(--blue); }
.mode-card.master::before { background: var(--green); }
.mode-card.slave::before { background: var(--purple); }
.mode-card header { display: flex; justify-content: space-between; color: #8492a4; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.mode-card header span { font-size: 22px; color: #d5dde7; }
.mode-card h3 { font-size: 21px; margin: 24px 0 10px; }
.mode-card > p { color: var(--muted); font-size: 10px; line-height: 1.6; min-height: 50px; }
.mini-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px; background: #f5f7fa; border-radius: 10px; margin: 18px 0; }
.mini-flow i { font-style: normal; font-size: 8px; font-weight: 800; }
.mini-flow em { color: var(--blue); font-style: normal; font-size: 7px; font-weight: 900; }
.mode-card li, .app-card li { font-size: 9px; padding: 7px 0 7px 17px; border-top: 1px solid #edf1f5; position: relative; }
.mode-card li::before, .app-card li::before { content: "✓"; color: var(--green); position: absolute; left: 0; font-weight: 900; }
.mapping-card { margin-top: 17px; }
.mapping-head { display: flex; justify-content: space-between; align-items: end; }
.range-chip { padding: 9px 12px; background: #07111f; color: var(--cyan); border-radius: 9px; font-family: ui-monospace, monospace; font-size: 10px; }
.mapping-table { margin-top: 22px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.mapping-row { display: grid; grid-template-columns: 1.3fr .65fr 1.25fr 1fr 1fr; gap: 10px; align-items: center; min-width: 700px; padding: 13px 16px; border-top: 1px solid var(--line); font-size: 9px; }
.mapping-row:first-child { border: 0; }
.mapping-row.table-header { background: #f4f7fa; color: #8492a4; font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.mapping-row code { color: var(--blue); font-weight: 800; }
.mapping-row b { font-size: 7px; color: #67778b; letter-spacing: .05em; }
.mapping-row b.trigger { color: #b47b0b; }
.mapping-row em { font-style: normal; font-weight: 800; }

.lifecycle-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.lifecycle-flow article { background: white; border: 1px solid var(--line); border-radius: 15px; padding: 20px; min-height: 170px; }
.lifecycle-flow article span { color: var(--blue); font-size: 22px; font-weight: 900; }
.lifecycle-flow article strong { display: block; margin: 17px 0 8px; font-size: 12px; }
.lifecycle-flow article p { color: var(--muted); font-size: 9px; line-height: 1.55; margin: 0; }
.lifecycle-flow > i { color: var(--blue); font-style: normal; }
.validation-layout { display: grid; grid-template-columns: 1.4fr .6fr; gap: 17px; margin-top: 18px; }
.validation-list, .revision-card { background: white; border: 1px solid var(--line); border-radius: 19px; padding: 25px; }
.validation-list ul { list-style: none; padding: 0; margin: 20px 0 0; }
.validation-list li { display: grid; grid-template-columns: 190px 1fr; gap: 15px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 9px; }
.validation-list b { color: var(--red); font-family: ui-monospace, monospace; }
.validation-list span { color: var(--muted); }
.revision-card { background: linear-gradient(145deg, #081526, #0c2541); color: white; }
.revision-card > span { color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.revision-number { font-size: 42px; font-weight: 900; letter-spacing: -.05em; margin: 18px 0; }
.revision-card dl { margin: 0; }
.revision-card dl div { display: flex; justify-content: space-between; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.11); font-size: 9px; }
.revision-card dt { color: #8fa3bb; }
.revision-card dd { margin: 0; font-weight: 800; }
.revision-card p { color: #8fa3bb; font-size: 8px; line-height: 1.5; margin: 17px 0 0; }

.pipeline { position: relative; }
.pipeline-track { position: absolute; left: 25px; top: 25px; bottom: 25px; width: 2px; background: linear-gradient(var(--blue), var(--green)); }
.pipeline article { position: relative; display: grid; grid-template-columns: 52px 1fr 150px; align-items: center; gap: 20px; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px 16px 0; margin-bottom: 10px; }
.pipeline article > span { position: relative; z-index: 1; margin-left: 8px; width: 35px; height: 35px; display: grid; place-items: center; background: #eaf5ff; border: 1px solid #9ed0ff; color: var(--blue); border-radius: 50%; font-size: 9px; font-weight: 900; }
.pipeline article small { color: var(--blue); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.pipeline article strong { display: block; font-size: 13px; margin: 4px 0; }
.pipeline article p { color: var(--muted); font-size: 9px; margin: 0; }
.pipeline article > b { text-align: right; color: #6f8094; font-family: ui-monospace, monospace; font-size: 8px; }
.data-contract-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.data-contract-grid article { background: #07111f; color: white; border-radius: 16px; padding: 20px; overflow: hidden; }
.data-contract-grid article > span { color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.data-contract-grid pre { margin: 14px 0 0; color: #a9bfd7; font-size: 10px; line-height: 1.65; }
.data-contract-grid .lineage { grid-column: 1 / -1; background: white; color: var(--ink); border: 1px solid var(--line); }
.lineage div { display: flex; align-items: center; gap: 20px; margin: 18px 0 7px; }
.lineage div b { color: var(--blue); }
.lineage p { color: var(--muted); font-size: 9px; margin: 0; }

.machine-hero { min-height: 360px; border-radius: 24px; padding: 48px; color: white; background: radial-gradient(circle at 75% 20%, rgba(242,184,75,.25), transparent 25%), linear-gradient(135deg, #15130d, #2a1f0e 60%, #10151d); display: grid; grid-template-columns: 1.2fr .8fr; gap: 50px; align-items: center; }
.machine-hero h1 { font-size: clamp(36px, 4.3vw, 62px); letter-spacing: -.05em; line-height: 1.05; margin: 16px 0 20px; }
.machine-hero p:not(.eyebrow) { color: #c2bba9; line-height: 1.65; font-size: 12px; }
.machine-badge { border: 1px solid rgba(242,184,75,.28); background: rgba(242,184,75,.07); border-radius: 17px; padding: 26px; }
.machine-badge small, .machine-badge strong, .machine-badge span { display: block; }
.machine-badge small { color: var(--amber); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.machine-badge strong { font-size: 20px; margin: 17px 0 8px; }
.machine-badge span { color: #bbae91; font-size: 9px; }
.machine-output { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 17px; }
.output-card, .processing-states { background: white; border: 1px solid var(--line); border-radius: 19px; padding: 24px; }
.output-head { display: flex; justify-content: space-between; font-size: 8px; font-weight: 900; letter-spacing: .1em; color: #7b8a9d; }
.output-head b { color: var(--blue); }
.output-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 30px; margin: 20px 0 0; }
.output-card dl div { padding: 13px 0; border-top: 1px solid var(--line); }
.output-card dt { color: var(--muted); font-size: 8px; }
.output-card dd { margin: 5px 0 0; font-size: 12px; font-weight: 800; }
.output-card dd.ok { color: var(--green); }
.processing-states article { display: grid; grid-template-columns: 15px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.processing-states article:first-child { border-top: 0; }
.state-dot { width: 10px; height: 10px; margin-top: 2px; border-radius: 50%; }
.state-dot.pending { background: #a9b5c4; }.state-dot.processing { background: var(--blue); }.state-dot.processed { background: var(--green); }.state-dot.retry { background: var(--amber); }.state-dot.quarantine { background: var(--red); }
.processing-states strong { font-size: 10px; }
.processing-states p { color: var(--muted); font-size: 8px; margin: 3px 0 0; }
.proof-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 17px; }
.proof-strip article { padding: 16px; border-radius: 13px; background: #101d2d; color: white; }
.proof-strip strong, .proof-strip span { display: block; }
.proof-strip strong { color: var(--amber); font-size: 9px; }
.proof-strip span { color: #96a7bb; font-size: 8px; line-height: 1.45; margin-top: 6px; }

.app-showcase { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.app-card { border: 1px solid var(--line); background: white; border-radius: 19px; padding: 19px; }
.app-card > header { display: flex; justify-content: space-between; color: #77879a; font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.app-card > header span { color: var(--blue); }
.app-window { height: 185px; background: #0a1728; border-radius: 11px; margin: 18px 0 20px; overflow: hidden; border: 1px solid #142b47; }
.app-window.light { background: #edf2f8; border-color: #d3dde8; }
.app-window.purple { background: #17142c; border-color: #332c64; }
.window-bar { height: 20px; border-bottom: 1px solid rgba(255,255,255,.08); padding: 6px 8px; display: flex; gap: 4px; }
.window-bar i { width: 5px; height: 5px; border-radius: 50%; background: #41536b; }
.mock-dashboard, .mock-control, .mock-simulator { height: calc(100% - 20px); display: grid; grid-template-columns: 26% 1fr; }
.mock-dashboard aside { background: #0d2139; }
.mock-dashboard main, .mock-control main, .mock-simulator main { padding: 12px; }
.mock-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.mock-cards i { height: 34px; border-radius: 5px; background: #153353; border: 1px solid #1d466e; }
.mock-table { height: 76px; border-radius: 5px; background: repeating-linear-gradient(#102945 0 17px, #183653 18px); margin-top: 8px; }
.mock-control aside { background: #dce5ef; }
.mock-status { height: 34px; background: white; border-radius: 5px; }
.mock-form { height: 82px; background: repeating-linear-gradient(90deg, white 0 48%, transparent 48% 52%, white 52% 100%); border-radius: 5px; margin-top: 8px; }
.mock-simulator aside { background: #211b42; }
.mock-simulator main { display: grid; gap: 7px; }
.mock-simulator main div { background: #292250; border-radius: 5px; border: 1px solid #3b3271; }
.app-card h3 { font-size: 18px; margin: 0 0 9px; }
.app-card > p { color: var(--muted); font-size: 9px; line-height: 1.6; min-height: 45px; }

.deployment-map { display: grid; grid-template-columns: 1fr 260px; gap: 17px; align-items: stretch; }
.pc-frame { background: #0a1728; color: white; border: 1px solid #1c3858; border-radius: 22px; padding: 26px; }
.pc-title { display: flex; justify-content: space-between; color: var(--cyan); font-size: 8px; font-weight: 900; letter-spacing: .12em; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.1); }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.pc-grid article { background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; padding: 19px; }
.pc-grid small, .pc-grid strong, .pc-grid span { display: block; }
.pc-grid small { color: #6684a7; font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.pc-grid strong { margin: 12px 0 6px; font-size: 13px; }
.pc-grid span { color: #8fa5be; font-size: 8px; }
.external-links { display: grid; gap: 10px; }
.external-links article { background: white; border: 1px solid var(--line); border-radius: 15px; display: flex; gap: 15px; align-items: center; padding: 20px; }
.external-links article > span { width: 35px; height: 35px; border-radius: 50%; background: #eaf5ff; color: var(--blue); display: grid; place-items: center; font-weight: 900; }
.external-links strong, .external-links small { display: block; }
.external-links strong { font-size: 10px; }
.external-links small { color: var(--muted); font-size: 8px; margin-top: 5px; }
.database-grid { grid-template-columns: repeat(3, 1fr); }
.database-grid h3 { font-size: 24px; margin: 13px 0 8px; }

.readiness-score { background: linear-gradient(130deg, #07111f, #0c2742); color: white; border-radius: 23px; padding: 34px 45px; display: grid; grid-template-columns: 190px 1fr; gap: 45px; align-items: center; }
.score-ring { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: radial-gradient(circle, #0a1b2d 57%, transparent 58%), conic-gradient(var(--green) 0 72%, #263c52 72%); }
.score-ring strong { font-size: 48px; line-height: 1; }
.score-ring span { color: #87a0ba; text-align: center; font-size: 7px; font-weight: 900; letter-spacing: .13em; margin-top: 8px; }
.score-copy > span { color: var(--green); font-size: 8px; font-weight: 900; letter-spacing: .14em; }
.score-copy h2 { font-size: 30px; letter-spacing: -.03em; margin: 11px 0; }
.score-copy p { color: #9aadc2; line-height: 1.65; font-size: 10px; }
.gate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 17px; }
.gate-grid article { background: white; border: 1px solid var(--line); border-radius: 17px; padding: 22px; }
.gate-grid header { display: flex; gap: 9px; align-items: center; font-size: 9px; letter-spacing: .08em; }
.gate-grid header span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; }
.gate-grid .done header span { background: #e9fff6; color: var(--green); }
.gate-grid .attention header span { background: #fff7e7; color: #b77800; }
.gate-grid .pending header span { background: #fff0f1; color: var(--red); }
.gate-grid ul { margin-top: 17px; }
.gate-grid li { font-size: 9px; color: var(--muted); padding: 9px 0 9px 17px; border-top: 1px solid var(--line); position: relative; }
.gate-grid li::before { content: "•"; position: absolute; left: 1px; color: var(--blue); }

.roadmap { position: relative; }
.roadmap::before { content: ""; position: absolute; left: 35px; top: 38px; bottom: 38px; width: 1px; background: #b7c6d7; }
.roadmap article { display: grid; grid-template-columns: 70px 1fr 60px; gap: 20px; align-items: center; background: white; border: 1px solid var(--line); border-radius: 15px; padding: 18px 20px 18px 0; margin-bottom: 10px; position: relative; }
.roadmap-index { margin-left: 15px; width: 41px; height: 41px; border-radius: 50%; display: grid; place-items: center; background: #07111f; color: var(--cyan); font-size: 10px; font-weight: 900; position: relative; z-index: 1; }
.roadmap article span { color: var(--blue); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.roadmap article h3 { font-size: 15px; margin: 5px 0; }
.roadmap article p { color: var(--muted); font-size: 9px; margin: 0; }
.roadmap article > b { justify-self: end; background: #eaf4ff; color: var(--blue); border-radius: 999px; padding: 7px 10px; font-size: 8px; }
.decision-board { margin-top: 18px; background: linear-gradient(135deg, #117de4, #0758b3); color: white; border-radius: 19px; padding: 28px; display: grid; grid-template-columns: .7fr 1.3fr; gap: 30px; align-items: center; }
.decision-board span { font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.decision-board h2 { margin: 8px 0 0; font-size: 24px; }
.decision-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.decision-tags span { border: 1px solid rgba(255,255,255,.26); background: rgba(255,255,255,.09); padding: 9px 11px; border-radius: 8px; }

.completion-hero { min-height: 330px; border-radius: 24px; color: white; text-align: center; padding: 55px; display: grid; place-items: center; align-content: center; background: radial-gradient(circle at 50% 100%, rgba(50,213,255,.2), transparent 40%), #07111f; }
.completion-hero h1 { font-size: clamp(38px, 5vw, 72px); max-width: 1000px; letter-spacing: -.055em; line-height: 1.03; margin: 18px auto; }
.completion-hero > p:last-child { color: #9eb0c5; font-size: 12px; }
.acceptance-grid { grid-template-columns: repeat(3, 1fr); }
.acceptance-grid span { color: var(--blue); font-size: 23px; font-weight: 900; }
.acceptance-grid strong { display: block; margin: 16px 0 8px; }
.closing-card { margin-top: 18px; color: white; background: linear-gradient(135deg, #087be4, #0c4a93); border-radius: 20px; padding: 32px; display: flex; justify-content: space-between; align-items: center; }
.closing-card > div > span { font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.closing-card h2 { font-size: 28px; margin: 10px 0 0; }
.closing-status { display: grid; grid-template-columns: auto auto; gap: 8px 12px; font-size: 9px; }
.closing-status strong { color: #b5d9ff; }
.closing-status span { background: white; color: #0964ba; border-radius: 999px; padding: 6px 9px; font-weight: 900; }

footer { height: 42px; padding: 0 28px; color: #7c8b9d; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 8px; background: white; }
.presentation-controls { display: none; }
.sidebar-collapsed .sidebar { transform: translateX(-282px); }
.sidebar-collapsed .workspace { margin-left: 0; }

body.presentation-mode { overflow: hidden; background: #02070d; }
body.presentation-mode .sidebar, body.presentation-mode .topbar, body.presentation-mode .section-control, body.presentation-mode footer { display: none; }
body.presentation-mode .workspace { margin: 0; height: 100vh; }
body.presentation-mode .content { max-width: none; height: 100vh; padding: 0; }
body.presentation-mode .chapters, body.presentation-mode .chapter.active { height: 100%; }
body.presentation-mode .chapter.active { overflow: auto; padding: 28px 4vw 90px; }
body.presentation-mode .presentation-controls { position: fixed; z-index: 100; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px; border: 1px solid rgba(255,255,255,.13); background: rgba(5,14,25,.86); backdrop-filter: blur(14px); border-radius: 999px; color: white; }
.presentation-controls button { color: white; background: rgba(255,255,255,.08); border: 0; border-radius: 999px; height: 32px; min-width: 32px; padding: 0 12px; font-size: 10px; }
.presentation-controls span { min-width: 58px; text-align: center; color: #9db0c7; font-size: 9px; }

@media (max-width: 1150px) {
  .sidebar { width: 240px; }
  .workspace { margin-left: 240px; }
  .sidebar-collapsed .sidebar { transform: translateX(-240px); }
  .hero-panel { grid-template-columns: 1fr; }
  .hero-principles { max-width: 660px; }
  .chapter-intro { grid-template-columns: 1fr; gap: 15px; }
  .chapter-intro > p { max-width: 700px; }
  .landscape-flow { grid-template-columns: 1fr 30px 1fr; }
  .landscape-flow .flow-arrow:nth-of-type(2) { display: none; }
  .layer { grid-template-columns: 120px 1fr; }
  .layer small { grid-column: 2; text-align: left; }
  .lifecycle-flow { grid-template-columns: 1fr; }
  .lifecycle-flow > i { text-align: center; transform: rotate(90deg); }
}

@media (max-width: 850px) {
  .sidebar { transform: translateX(-282px); box-shadow: var(--shadow); }
  .workspace { margin-left: 0; }
  .sidebar.mobile-open { transform: none; }
  .topbar { padding: 0 16px; }
  .topbar::before { content: "☰"; margin-right: 12px; cursor: pointer; }
  .topbar > div:first-of-type { margin-right: auto; }
  .status-pill { display: none; }
  .top-actions button span { display: none; }
  .content { padding: 15px; }
  .section-control { align-items: flex-start; gap: 15px; }
  .section-control > div:last-child { white-space: nowrap; }
  .metric-grid.four, .objective-grid, .responsibility-grid, .proof-strip { grid-template-columns: 1fr 1fr; }
  .before-after { grid-template-columns: 1fr; gap: 12px; }
  .transform-mark { transform: rotate(90deg); }
  .mode-grid, .app-showcase, .gate-grid, .database-grid, .acceptance-grid { grid-template-columns: 1fr; }
  .validation-layout, .machine-output, .deployment-map, .readiness-score, .decision-board { grid-template-columns: 1fr; }
  .data-contract-grid { grid-template-columns: 1fr; }
  .data-contract-grid .lineage { grid-column: auto; }
  .machine-hero { grid-template-columns: 1fr; }
  .score-ring { margin: auto; }
}

@media (max-width: 560px) {
  .auth-card { padding: 30px 23px; }
  .section-control { display: block; }
  .section-control > div:last-child { margin-top: 12px; }
  .view-button { margin: 0 3px 0 0; }
  .hero-panel, .machine-hero { padding: 30px 23px; }
  .hero-copy h1 { font-size: 38px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .metric-grid.four, .objective-grid, .responsibility-grid, .proof-strip { grid-template-columns: 1fr; }
  .landscape-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
  .layer { grid-template-columns: 1fr; }
  .layer > div { flex-wrap: wrap; }
  .layer small { grid-column: auto; }
  .mapping-card { overflow: auto; }
  .pipeline article { grid-template-columns: 52px 1fr; }
  .pipeline article > b { grid-column: 2; text-align: left; }
  .output-card dl, .pc-grid { grid-template-columns: 1fr; }
  .roadmap article { grid-template-columns: 65px 1fr; }
  .roadmap article > b { grid-column: 2; justify-self: start; }
  .closing-card { display: block; }
  .closing-status { margin-top: 25px; }
  footer span:first-child, footer span:last-child { display: none; }
  footer { justify-content: center; }
}

@media print {
  .auth-screen, .sidebar, .topbar, .section-control, footer, .presentation-controls { display: none !important; }
  .site-shell { display: block !important; }
  .workspace { margin: 0; }
  .content { max-width: none; padding: 0; }
  .chapter { display: block !important; break-after: page; padding: 12mm; }
  .hero-panel, .machine-hero, .completion-hero { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  button { display: none !important; }
}
