:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #64748b;
  --line: #e6eaf0;
  --paper: #f6f8fb;
  --white: #fff;
  --blue: #2864e8;
  --blue-dark: #1849b8;
  --cyan: #dff5f4;
  --mint: #dff4eb;
  --amber: #fff1d7;
  --shadow: 0 12px 36px rgba(31, 50, 81, .07);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 "Avenir Next", Avenir, "Segoe UI", sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
h1, h2, h3, strong, .brand { font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif; }
h1 { font-size: clamp(1.75rem, 3vw, 2.3rem); letter-spacing: -.045em; margin: .15rem 0 0; }
h2 { font-size: 1.18rem; letter-spacing: -.025em; margin: .25rem 0 .6rem; }
h3 { font-size: .98rem; margin: .7rem 0 .25rem; }
p { margin: .35rem 0 .8rem; color: var(--muted); }
code { border-radius: 5px; background: #f0f3f8; color: #334b69; padding: .12rem .35rem; font-size: .88em; overflow-wrap: anywhere; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(28px, calc((100vw - 1180px) / 2)); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 1.05rem; }
.brand:hover { color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: white; background: linear-gradient(140deg, #326ff0, #21b1aa); font-weight: 800; }
nav { display: flex; align-items: center; gap: 5px; }
nav a { color: #627086; font-size: .88rem; padding: 9px 12px; border-radius: 8px; }
nav a:hover, nav a[aria-current="page"] { background: #eef4ff; color: var(--blue); }
.container { max-width: 1180px; padding: 40px 24px 24px; margin: auto; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-heading { margin-bottom: 26px; }
.eyebrow { color: #6d7f98; text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; font-weight: 700; margin: 0; }
.hero { display: flex; align-items: center; justify-content: space-between; min-height: 270px; padding: 42px 54px; border-radius: 18px; background: linear-gradient(115deg, #e8f0ff 0%, #edf8f9 56%, #edf8f2 100%); overflow: hidden; position: relative; }
.hero > div:first-child { max-width: 600px; position: relative; z-index: 1; }
.hero h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); max-width: 540px; margin: .65rem 0; letter-spacing: -.055em; line-height: 1.15; }
.hero p { max-width: 570px; }
.hero-art { width: 230px; height: 190px; margin-right: 50px; border-radius: 28px; transform: rotate(-8deg); background: linear-gradient(145deg, #fff, #e5f5f2); box-shadow: 20px 28px 50px #8da9ca50; position: relative; display: grid; place-items: center; color: #2b6be8; font-size: 90px; }
.hero-art:before, .hero-art:after { content: ""; position: absolute; border-radius: 12px; background: white; box-shadow: 0 8px 20px #6684a322; }
.hero-art:before { width: 65px; height: 48px; top: 23px; right: -28px; }
.hero-art:after { width: 92px; height: 17px; bottom: 24px; left: -33px; }
.hero-art i { position: absolute; height: 7px; width: 62px; background: #75cbb5; border-radius: 9px; top: 45px; right: -14px; z-index: 1; }
.hero-art b { position: absolute; height: 7px; width: 60px; background: #7a9ef1; border-radius: 9px; bottom: 29px; left: -16px; z-index: 1; }
.button { border: 0; border-radius: 8px; padding: 11px 17px; background: var(--blue); color: white; font: 700 .9rem "Avenir Next", Avenir, "Segoe UI", sans-serif; cursor: pointer; box-shadow: 0 4px 10px #2864e833; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; }
.button:hover { background: var(--blue-dark); color: white; }
.button-secondary { background: #eef4ff; color: var(--blue); box-shadow: none; }
.button-secondary:hover, .button-quiet:hover { background: #e3ecff; color: var(--blue-dark); }
.button-quiet { border: 1px solid var(--line); background: white; color: #40516a; box-shadow: none; }
.button-small { min-height: 34px; padding: 7px 11px; font-size: .8rem; }
.button-row { display: flex; gap: 10px; margin-top: 8px; }
.status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 19px 0 22px; }
.status-card { display: flex; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.status-card p { margin: 1px 0 0; font-size: .8rem; }
.status-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: #c6ced9; box-shadow: 0 0 0 4px #f1f3f6; }
.status-dot.is-ready { background: #28aa79; box-shadow: 0 0 0 4px #e2f5ed; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: var(--shadow); }
.section-heading { margin-bottom: 17px; }
.count { border-radius: 20px; padding: 5px 10px; color: #64748b; background: #f2f5f9; font-size: .78rem; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { display: flex; align-items: flex-start; gap: 13px; }
.steps li > span { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; color: var(--blue); background: #edf3ff; border-radius: 10px; font-weight: 700; }
.steps p { font-size: .86rem; margin: .2rem 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th { color: #718097; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; background: #f7f9fc; }
td, th { padding: 13px 14px; border-bottom: 1px solid #edf0f4; }
tr:last-child td { border-bottom: 0; }
.muted { color: #9aa5b4; }
.empty { border: 1px dashed #dce3ec; border-radius: 12px; text-align: center; padding: 38px 20px; }
.empty > span { font-size: 1.8rem; color: #80a2ec; }
.empty h3 { margin-top: .5rem; }
.empty p { margin: .35rem auto 1rem; max-width: 440px; }
.relationship-list { display: grid; gap: 12px; }
.relationship { display: flex; justify-content: space-between; gap: 22px; border: 1px solid var(--line); border-radius: 11px; padding: 17px 18px; }
.relation-main { min-width: 0; }
.relation-label { display: flex; align-items: center; gap: 10px; }
.badge { border-radius: 20px; padding: 4px 9px; font-size: .72rem; font-weight: 700; }
.badge-blue { color: #2864e8; background: #edf3ff; }
.badge-amber { color: #a3610a; background: var(--amber); }
.confidence, .state { color: var(--muted); font-size: .78rem; }
.relationship h3 code { white-space: normal; }
.arrow { color: #9cabc0; padding: 0 .3rem; }
.relation-actions { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 10px; }
.relation-actions form { display: flex; gap: 7px; }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr); gap: 18px; align-items: start; }
.form-stack { display: flex; flex-direction: column; gap: 9px; margin-top: 19px; }
label, legend { color: #37465b; font-size: .85rem; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #dce3ec; border-radius: 8px; background: white; color: var(--ink); padding: 10px 12px; font: inherit; }
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dbe8ff; border-color: #79a0f4; }
.form-stack > .button { align-self: flex-start; margin-top: 8px; }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin: 8px 0; }
.check-row, .consent { display: flex; align-items: flex-start; gap: 9px; margin: 9px 0; font-weight: 400; }
.check-row input, .consent input { width: auto; margin-top: 4px; accent-color: var(--blue); }
.consent { padding: 12px; border-radius: 9px; background: #f3f7ff; color: #465b78; font-size: .8rem; }
.hint { border-left: 3px solid #96aed0; padding: 9px 12px; font-size: .82rem; background: #f6f8fc; }
.document-list, .check-list { list-style: none; padding: 0; margin: 14px 0; }
.document-list li { display: flex; gap: 11px; align-items: center; padding: 13px 0; border-bottom: 1px solid #edf0f4; }
.document-list small { display: block; color: var(--muted); margin-top: 2px; }
.doc-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #267a5b; background: var(--mint); font-size: .68rem; font-weight: 700; }
.aside-card { background: linear-gradient(145deg, #f3f7ff, #fff); }
.check-list li { padding: 8px 0; color: #516179; }
.check-list li:before { content: "✓"; display: inline-block; margin-right: 9px; color: #23936c; font-weight: 700; }
.preview { padding: 20px; margin: 20px 0; border-radius: 11px; border: 1px solid #dfe7f3; background: linear-gradient(135deg, #f8faff, #f3f9f7); }
.preview-kicker { color: #7990ad; font-size: .68rem; font-weight: 700; letter-spacing: .12em; }
.preview h3 { font-size: 1.12rem; }
.preview code { display: block; padding: 11px; margin-top: 14px; background: #eaf0f8; }
.notice { padding: 12px 15px; border: 1px solid #cae5d9; border-radius: 9px; background: #effaf4; color: #28694e; margin: 0 0 16px; }
.notice-error { border-color: #f0d3cc; color: #9e4133; background: #fff5f2; }
.help-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.help-grid .card { position: relative; }
.help-intro { grid-column: 1 / -1; background: linear-gradient(115deg, #edf3ff, #eff9f7); }
.help-number { color: #82a0d4; font: 800 1.6rem "Avenir Next", Avenir, "Segoe UI", sans-serif; }
.docs-links a { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; gap: 15px; color: #8692a3; font-size: .76rem; padding: 30px 3px 10px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbff; }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; color: #1e3558; }
.stat-label { color: var(--muted); font-size: .78rem; }
.help-list { margin: 0; padding-left: 20px; color: #516179; }
.help-list li { padding: 6px 0; }

@media (max-width: 860px) {
  .topbar { height: auto; min-height: 66px; flex-wrap: wrap; padding: 12px 20px; gap: 8px; }
  nav { width: 100%; overflow-x: auto; }
  nav a { white-space: nowrap; }
  .hero { padding: 34px 30px; }
  .hero-art { margin-right: 8px; transform: scale(.8) rotate(-8deg); }
  .status-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .container { padding: 28px 16px 18px; }
  .page-heading { align-items: flex-start; }
  .page-heading .button { font-size: .75rem; padding: 8px; }
  .hero { min-height: 0; padding: 28px 22px; }
  .hero-art { display: none; }
  .status-grid, .steps, .split, .help-grid { grid-template-columns: 1fr; }
  .help-intro { grid-column: auto; }
  .steps { gap: 14px; }
  .relationship { flex-direction: column; }
  .relation-actions { align-items: flex-start; }
  footer { flex-direction: column; }
}
