:root {
  --bg: #f7f9fc;
  --panel: #fff;
  --ink: #111827;
  --muted: #64748b;
  --line: #e5eaf1;
  --blue: #2563eb;
  --indigo: #4338ca;
  --cyan: #0891b2;
  --shadow: 0 18px 50px rgba(15, 23, 42, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; }
main { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 14px 28px; background: rgba(255,255,255,.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; font-weight: 800; letter-spacing: 0; }
.brand-lockup { width: 294px; height: auto; display: block; object-fit: contain; }
.eyebrow { color: var(--blue); }
.nav { display: flex; gap: 18px; align-items: center; font-size: 14px; }
.nav-group { position: relative; display: inline-flex; align-items: center; }
.nav-parent { font-weight: 800; }
.nav-submenu { display: none; position: absolute; top: calc(100% + 10px); left: 0; min-width: 220px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 20; }
.nav-submenu a { display: block; padding: 9px 10px; border-radius: 6px; color: #334155; white-space: nowrap; }
.nav-submenu a:hover { background: #eef4ff; color: #1d4ed8; }
.nav-group:hover .nav-submenu, .nav-group:focus-within .nav-submenu { display: block; }
.nav-toggle { display: none; background: transparent; border: 0; font-size: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 700; cursor: pointer; }
.btn.primary { background: linear-gradient(135deg, var(--blue), var(--indigo)); border-color: transparent; color: #fff; }
.btn.ghost { background: #eef4ff; color: #1d4ed8; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 72px 0 48px; }
.eyebrow { font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
.hero h1, .page-hero h1 { font-size: clamp(42px, 7vw, 76px); line-height: .96; margin: 10px 0 18px; letter-spacing: 0; }
.lead, .page-hero p { font-size: 20px; color: var(--muted); max-width: 760px; }
.actions, .form-inline { display: flex; gap: 12px; flex-wrap: wrap; }
.form-stack { display: grid; gap: 14px; }
.actions { margin-top: 26px; }
.console-card, .card, .price-card, .stat, .service-card, .api-doc { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); }
.console-card { overflow: hidden; }
.console-head { height: 42px; background: #111827; display: flex; gap: 8px; align-items: center; padding: 0 16px; }
.console-head span { width: 11px; height: 11px; border-radius: 50%; background: #60a5fa; }
.console-card pre, .api-doc pre, pre { margin: 0; padding: 22px; overflow: auto; background: #0f172a; color: #dbeafe; border-radius: 0 0 8px 8px; }
.grid-3, .catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 24px 0; }
.card, .price-card, .api-doc { padding: 22px; }
.split-section { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; padding: 52px 0; }
.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.metric-grid div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.metric-grid b, .metric-grid span { display: block; }
.metric-grid span, .muted { color: var(--muted); }
.section-head { margin-top: 40px; }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 20px 0 48px; }
.price { font-size: 42px; font-weight: 900; margin: 8px 0; }
.price span { font-size: 15px; color: var(--muted); }
.price-card ul { padding-left: 20px; color: var(--muted); }
.tabs-shell { margin: 18px 0 48px; }
.tab-list { display: inline-flex; gap: 6px; padding: 6px; background: #eaf0fb; border: 1px solid var(--line); border-radius: 8px; }
.tab-button { min-height: 42px; padding: 8px 16px; border: 0; border-radius: 6px; background: transparent; color: #475569; font: inherit; font-weight: 800; cursor: pointer; }
.tab-button.active { background: #fff; color: #1d4ed8; box-shadow: 0 8px 22px rgba(15,23,42,.08); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel .section-head { margin-top: 30px; }
.cta { text-align: center; background: #101827; color: #fff; border-radius: 8px; padding: 44px; margin: 40px auto; }
.page-hero { padding: 58px 0 24px; }
.service-list { display: grid; gap: 18px; margin-bottom: 48px; }
.service-card { display: grid; grid-template-columns: 1fr 280px; gap: 24px; padding: 24px; }
.service-card aside { border-left: 1px solid var(--line); padding-left: 20px; }
.pill { display: inline-block; padding: 5px 10px; border-radius: 999px; background: #e0f2fe; color: #0369a1; font-weight: 800; font-size: 12px; }
.model-card code, .service-card code, .notice code { display: block; margin-top: 8px; white-space: normal; }
.auth-page { min-height: 70vh; display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); }
.account-type-grid { border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin: 14px 0; }
.account-type-grid legend { padding: 0 6px; font-weight: 800; color: #334155; }
.account-type-option { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; cursor: pointer; }
.account-type-option input { width: auto; margin-top: 4px; }
.account-type-option b, .account-type-option small { display: block; }
.account-type-option small { color: var(--muted); font-weight: 600; margin-top: 2px; }
label { display: grid; gap: 6px; font-weight: 700; color: #334155; margin: 12px 0; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font: inherit; background: #fff; }
textarea { min-height: 120px; }
.error, .notice { border-radius: 8px; padding: 12px 14px; margin: 12px 0; }
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; font-weight: 700; }
.job-error { max-width: 980px; white-space: pre-wrap; word-break: break-word; }
.notice { background: #eff6ff; color: #1e3a8a; border: 1px solid #bfdbfe; }
.app-shell { width: 100%; display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 0; margin: 0; }
.sidebar { min-height: calc(100vh - 70px); background: #fff; border-right: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.sidebar a { padding: 10px 12px; border-radius: 8px; color: #334155; font-weight: 700; }
.sidebar a:hover, .sidebar.admin a:first-child { background: #eef4ff; color: #1d4ed8; }
.sidebar-dropdown { display: grid; gap: 4px; }
.sidebar-dropdown summary { list-style: none; padding: 10px 12px; border-radius: 8px; color: #334155; font-weight: 800; cursor: pointer; background: #f8fafc; }
.sidebar-dropdown summary::-webkit-details-marker { display: none; }
.sidebar-dropdown summary::after { content: "▾"; float: right; color: var(--muted); transition: transform .15s ease; }
.sidebar-dropdown[open] summary::after { transform: rotate(180deg); }
.sidebar-dropdown summary:hover { background: #eef4ff; color: #1d4ed8; }
.sidebar-sub { margin-left: 12px; padding: 8px 12px 8px 18px !important; border-left: 2px solid var(--line); font-size: 14px; font-weight: 700 !important; color: #475569 !important; }
.sidebar-sub:hover { border-left-color: var(--blue); }
.workspace { padding: 28px; min-width: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 18px 0; }
.stat { padding: 18px; }
.stat b { display: block; font-size: 28px; }
.stat b.workflow-name { font-size: 16px; line-height: 1.35; }
.stat span { color: var(--muted); }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 16px 0; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: #64748b; background: #f8fafc; }
td code { word-break: break-word; }
.preview { max-height: 190px; overflow: hidden; white-space: pre-wrap; word-break: break-word; cursor: pointer; position: relative; border-radius: 8px; }
.preview::after { content: "Click to expand"; position: absolute; right: 12px; bottom: 10px; padding: 4px 8px; border-radius: 6px; background: #eff6ff; color: #1d4ed8; font-size: 12px; font-weight: 800; }
.business-result { white-space: pre-wrap; word-break: break-word; border-radius: 8px; }
.modal-backdrop { display: none; position: fixed; inset: 0; z-index: 30; background: rgba(15, 23, 42, .58); padding: 28px; }
.modal-backdrop.open { display: block; }
.modal { width: min(1100px, 100%); max-height: 90vh; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; }
.modal-body { overflow: auto; padding: 16px; }
.modal-body pre { white-space: pre-wrap; word-break: break-word; margin: 0; }
.form-inline { align-items: end; }
.form-inline label { min-width: 220px; }
.job-upload-form { max-width: 980px; }
.workflow-picker { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.workflow-picker legend { padding: 0 6px; font-weight: 800; color: #334155; }
.workflow-picker label { display: flex; grid-template-columns: none; align-items: center; gap: 10px; margin: 6px 0; }
.workflow-picker input { width: auto; }
.workflow-actions { margin-top: 18px; }
.workflow-status-card { margin: 22px 0; }
.workflow-path { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.workflow-step { position: relative; min-height: 78px; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #f8fafc; }
.workflow-step b, .workflow-step span { display: block; }
.workflow-step b { color: #111827; }
.workflow-step span { color: var(--muted); font-weight: 800; margin-top: 4px; }
.workflow-step.complete { border-color: #bbf7d0; background: #f0fdf4; }
.workflow-step.complete span { color: #15803d; }
.workflow-step.error-step { border-color: #fecaca; background: #fef2f2; }
.workflow-step.error-step span { color: #991b1b; }
.workflow-results { margin-top: 14px; }
.i9-results-row { display: grid; grid-template-columns: repeat(3, 260px); gap: 14px; margin: 24px 0; align-items: start; overflow-x: auto; padding-bottom: 8px; scrollbar-gutter: stable; }
.result-panel { min-width: 0; display: grid; gap: 12px; align-content: start; }
.result-panel .form-section-head { align-items: center; margin: 0; }
.result-panel h2 { font-size: 18px; }
.result-preview { width: 100%; height: 130px; overflow: scroll; white-space: pre; word-break: normal; border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.4; scrollbar-gutter: stable both-edges; }
.validation-panel { margin: 18px 0; }
.result-modal { width: min(620px, calc(100vw - 56px)); height: min(41vh, 430px); max-height: none; }
.result-modal .modal-body { min-height: 0; }
.result-modal .modal-body pre { min-height: 100%; overflow: scroll; white-space: pre; word-break: normal; border-radius: 8px; scrollbar-gutter: stable both-edges; }
.modal-actions { margin-top: 0; }
.i9-review-grid { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); gap: 18px; align-items: start; }
.i9-review-grid pre { max-height: 70vh; white-space: pre-wrap; word-break: break-word; overflow: auto; }
.compliance-note { margin-top: 22px; max-width: 980px; }
.job-panel { display: none; border-top: 1px solid var(--line); padding-top: 10px; }
.job-panel.active { display: grid; gap: 12px; }
.form-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-top: 4px; }
.form-section-head h2 { margin: 0; font-size: 20px; }
.form-section-head span { color: var(--muted); font-weight: 700; font-size: 13px; }
.compact-options { align-items: center; }
.compact-options label { min-width: auto; display: flex; align-items: center; gap: 8px; margin: 0; }
.compact-options input[type="checkbox"] { width: auto; }
.plan-form { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.usage-bars { display: grid; gap: 12px; }
.usage-bars div { display: grid; grid-template-columns: 180px 1fr 80px; gap: 12px; align-items: center; }
.usage-bars b { height: 14px; background: linear-gradient(90deg, var(--cyan), var(--blue)); border-radius: 999px; min-width: 3%; }
.footer { display: flex; justify-content: space-between; gap: 20px; padding: 36px 28px; border-top: 1px solid var(--line); background: #fff; color: #475569; }
.footer div:last-child { display: flex; gap: 16px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 16px; right: 16px; top: 62px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 14px; box-shadow: var(--shadow); flex-direction: column; align-items: flex-start; }
  .nav.open { display: flex; }
  .nav-group { display: grid; gap: 6px; width: 100%; }
  .nav-submenu { position: static; display: grid; min-width: 0; width: 100%; padding: 4px 0 0 12px; border: 0; box-shadow: none; background: transparent; }
  .hero, .grid-2, .grid-3, .catalog-grid, .pricing-grid, .split-section, .service-card, .app-shell, .i9-review-grid, .i9-results-row { grid-template-columns: 1fr; }
  .hero h1, .page-hero h1 { font-size: 42px; }
  .service-card aside { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .sidebar { min-height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow: auto; }
  .sidebar-dropdown { display: flex; gap: 8px; }
  .sidebar-dropdown[open] { align-items: center; }
  .sidebar-dropdown summary { white-space: nowrap; }
  .sidebar-sub { margin-left: 0; border-left: 0; white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-form { grid-template-columns: 1fr; }
  .footer { display: block; }
  .usage-bars div { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  main { width: min(100% - 20px, 1180px); }
  .topbar { padding: 12px; }
  .stat-grid { grid-template-columns: 1fr; }
  th, td { font-size: 13px; padding: 9px; }
  .hero { padding-top: 36px; }
  .tab-list { display: grid; grid-template-columns: 1fr; width: 100%; }
  .tab-button { width: 100%; }
}
