:root {
    --ink: #142433;
    --muted: #647382;
    --line: #dce5ea;
    --surface: #ffffff;
    --soft: #f4f8fa;
    --navy: #0d3552;
    --blue: #176b8d;
    --teal: #138a86;
    --orange: #d77b2a;
    --green: #418865;
    --shadow: 0 14px 40px rgba(16, 47, 65, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0; color: var(--ink); background: #edf3f5;
    font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.55;
}
a { color: inherit; }
.topbar {
    height: 76px; padding: 0 max(24px, calc((100vw - 1440px)/2));
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.2px; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .7px; text-transform: uppercase; }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: var(--navy); position: relative; display: block; }
.brand-mark:before, .brand-mark:after, .brand-mark i, .brand-mark b { content: ""; position: absolute; background: #fff; border-radius: 3px; }
.brand-mark:before { width: 25px; height: 5px; left: 7px; top: 9px; }
.brand-mark:after { width: 25px; height: 5px; left: 7px; bottom: 9px; }
.brand-mark i { width: 5px; height: 22px; left: 11px; top: 8px; }
.brand-mark b { width: 5px; height: 22px; right: 11px; top: 8px; }
.nav { display: flex; gap: 6px; }
.nav a { padding: 10px 14px; border-radius: 8px; text-decoration: none; color: #51616d; font-size: 14px; font-weight: 650; }
.nav a:hover, .nav a.active { color: var(--navy); background: #eaf2f5; }
.page-shell { width: min(1440px, calc(100% - 48px)); margin: 28px auto 56px; }
.hero {
    color: #fff; border-radius: 20px; padding: 42px 46px; margin-bottom: 24px;
    background: linear-gradient(125deg, #0b304b 0%, #135b72 62%, #178a87 130%);
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero:after { content: ""; position: absolute; width: 380px; height: 380px; right: -180px; top: -230px; border: 60px solid rgba(255,255,255,.07); border-radius: 50%; }
.compact-hero { min-height: 210px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.hero h1 { margin: 7px 0 10px; max-width: 850px; font: 700 clamp(30px, 3vw, 46px)/1.12 Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
.hero p { max-width: 850px; margin: 0; color: rgba(255,255,255,.78); font-size: 15px; }
.eyebrow { font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: 1.8px; color: #a9e6df; }
.hero-stat-grid { display: grid; grid-template-columns: repeat(3, 112px); gap: 10px; z-index: 1; }
.hero-stat-grid article { padding: 16px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); border-radius: 14px; backdrop-filter: blur(10px); }
.hero-stat-grid strong { display: block; font: 700 24px Georgia, serif; }
.hero-stat-grid span { font-size: 11px; color: rgba(255,255,255,.72); }
.workspace-grid { display: grid; grid-template-columns: minmax(450px, .86fr) minmax(620px, 1.14fr); gap: 24px; align-items: stretch; }
.input-panel,
.results-panel {
    height: 100%;
}
.panel { background: var(--surface); border: 1px solid #e0e8ec; border-radius: 18px; box-shadow: var(--shadow); padding: 26px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.panel-heading > div { display: flex; align-items: center; gap: 11px; }
.panel h2 { margin: 0; font: 700 23px Georgia, "Times New Roman", serif; }
.step { display: inline-flex; width: 35px; height: 27px; align-items: center; justify-content: center; border-radius: 20px; color: var(--blue); background: #e6f1f5; font-size: 11px; font-weight: 800; letter-spacing: .5px; }
fieldset { border: 0; padding: 0; margin: 0 0 23px; }
legend { width: 100%; padding: 0 0 9px; margin-bottom: 14px; color: #526573; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; border-bottom: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; align-items: end; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
.field input, .field select {
    width: 100%; height: 44px; border: 1px solid #cbd9df; border-radius: 9px; padding: 0 12px;
    color: var(--ink); background: #fbfdfe; font: 600 14px inherit; outline: none; transition: .18s;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,141,.11); background: #fff; }
.field small { display: block; color: #8a98a3; margin-top: 5px; font-size: 10.5px; }
.primary-button, .outline-button {
    border: 0; border-radius: 10px; min-height: 46px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 18px;
    text-decoration: none; cursor: pointer; font: 750 14px inherit; transition: transform .15s, box-shadow .15s, background .15s;
}
.primary-button { width: 100%; color: #fff; background: linear-gradient(100deg, var(--navy), var(--blue)); box-shadow: 0 8px 18px rgba(13,53,82,.2); }
.primary-button:hover, .outline-button:hover { transform: translateY(-1px); }
.primary-button b { font-size: 19px; }
.primary-button.compact { width: auto; }
.outline-button { border: 1px solid #bfd0d8; background: #fff; color: var(--navy); }
.outline-button.small { min-height: 36px; padding: 0 13px; font-size: 12px; }
.outline-button.light { color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); z-index: 1; white-space: nowrap; }
.text-button { border: 0; background: none; color: var(--blue); font-weight: 700; cursor: pointer; }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.results-panel { min-height: 690px; }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-bottom: 18px; }
.metric-card { padding: 18px; border: 1px solid var(--line); border-top: 4px solid; border-radius: 13px; background: linear-gradient(180deg,#fff,#f8fbfc); }
.metric-card > span { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
.metric-card strong { display: block; margin: 7px 0 1px; font: 700 clamp(23px,2.2vw,34px) Georgia, serif; letter-spacing: -.4px; overflow-wrap: anywhere; }
.metric-card small { color: #84929d; }
.metric-card.blue { border-top-color: var(--blue); }.metric-card.orange { border-top-color: var(--orange); }.metric-card.green { border-top-color: var(--green); }
.chart-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.chart-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.chart-heading h3 { margin: 0; font: 700 18px Georgia, serif; }.chart-heading p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.curve-chart { width: 100%; height: 420px; }
.empty-state { min-height: 570px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px; border: 1px dashed #cbd9df; border-radius: 14px; background: #f9fbfc; }
.empty-state h3 { margin: 20px 0 5px; font: 700 22px Georgia, serif; }.empty-state p { max-width: 480px; margin: 0; color: var(--muted); font-size: 13px; }
.curve-placeholder { width: 140px; height: 85px; position: relative; border-left: 2px solid #9db1bc; border-bottom: 2px solid #9db1bc; }
.curve-placeholder:after { content:""; position:absolute; width:115px; height:65px; left:12px; bottom:7px; border-top:5px solid var(--blue); border-radius: 100% 0 0 0; transform: rotate(-12deg); }
.invalid-state span { width: 50px; height: 50px; display:grid; place-items:center; border-radius:50%; background:#fff0d8; color:#a45b16; font-size:25px; font-weight:800; }
.warning-box { margin: 0 0 16px; padding: 13px 15px; border-left: 4px solid #e1a24f; background: #fff8ea; border-radius: 7px; font-size: 12px; }.warning-box ul { margin: 6px 0 0; padding-left: 18px; }
.flash-stack { display: grid; gap: 8px; margin-bottom: 16px; }.flash { padding: 12px 15px; border-radius: 9px; border: 1px solid; font-size: 13px; }.flash-success{background:#eaf8f2;border-color:#b8dfce;color:#28664c}.flash-danger{background:#fff0ef;border-color:#efc0bd;color:#933c35}.flash-warning{background:#fff8e8;border-color:#ead3a4;color:#7b5922}.flash-info{background:#edf6fa;border-color:#c5dfe9;color:#285d72}
.recent-panel { margin-top: 24px; }.recent-list { display: grid; gap: 9px; }.recent-list article { display:grid; grid-template-columns:75px 1fr auto; align-items:center; gap:12px; padding:12px; border:1px solid var(--line); border-radius:10px; }.recent-list strong,.recent-list small{display:block}.recent-list small{color:var(--muted)}.recent-list a{color:var(--blue);font-weight:700;font-size:12px}.run-kind{font-size:11px;font-weight:800;text-transform:uppercase;color:var(--blue)}
.batch-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 24px; align-items: stretch; }.upload-panel,.requirement-panel{min-height:410px}
.drop-zone { min-height: 220px; border: 2px dashed #bfd0d8; border-radius: 14px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; background:#f8fbfc; cursor:pointer; padding:25px; transition:.18s; }.drop-zone:hover,.drop-zone.dragging{border-color:var(--blue);background:#eef7fa}.drop-zone input{display:none}.drop-zone strong{font-size:16px}.drop-zone small{color:var(--muted);margin-top:3px}.drop-zone b{margin-top:12px;color:var(--blue);font-size:12px}.upload-icon{width:44px;height:44px;display:grid;place-items:center;border-radius:50%;background:#e5f1f5;color:var(--blue);font-size:24px;margin-bottom:12px}
.check-row { display:flex; gap:12px; align-items:flex-start; margin:16px 0; padding:12px; border:1px solid var(--line); border-radius:10px; }.check-row input{margin-top:4px}.check-row strong,.check-row small{display:block}.check-row small{color:var(--muted)}
.column-pills { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }.column-pills code{padding:8px 11px;border-radius:7px;background:#eaf3f6;color:var(--navy);font-weight:800}.info-list{display:grid;gap:12px}.info-list article{padding-bottom:10px;border-bottom:1px solid var(--line)}.info-list b,.info-list span{display:block}.info-list b{font-size:13px}.info-list span{color:var(--muted);font-size:12px}
.preview-panel{margin-top:24px}.table-scroll{overflow:auto;border:1px solid var(--line);border-radius:12px;max-height:480px}table{border-collapse:collapse;width:100%;font-size:11px;white-space:nowrap}th,td{padding:9px 10px;border-bottom:1px solid #e8eef1;border-right:1px solid #eef2f4;text-align:left}th{position:sticky;top:0;background:#edf4f7;color:#324d5d;z-index:1}.table-note{color:var(--muted);font-size:11px}
.about-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px}.prose-panel.wide{grid-column:1/-1}.prose-panel h2{margin:8px 0 18px}.prose-panel p{color:#546773}.model-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.model-cards article{padding:16px;border:1px solid var(--line);border-radius:12px}.model-cards b,.model-cards strong,.model-cards span{display:block}.model-cards b{font:700 26px Georgia,serif;color:var(--blue)}.model-cards strong{font-size:13px;margin:4px 0}.model-cards span{color:var(--muted);font-size:11px}.formula-box{padding:18px;border-left:4px solid var(--teal);border-radius:8px;background:#eef8f7;font:600 18px Georgia,serif;overflow:auto}.equation-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:14px 0}.equation-grid div{padding:16px;border:1px solid var(--line);border-radius:10px;background:#fafcfd}.equation-grid small,.equation-grid strong{display:block}.equation-grid small{color:var(--muted);margin-bottom:8px}.equation-grid strong{font-family:Georgia,serif}.boundary-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:9px}.boundary-grid article{padding:12px;border-radius:9px;background:#f1f6f8}.boundary-grid b,.boundary-grid span{display:block}.boundary-grid b{color:var(--blue)}.boundary-grid span{font-size:11px;color:var(--muted)}.muted{font-size:12px!important;color:var(--muted)!important}
.footer { width:min(1440px,calc(100% - 48px)); margin:0 auto 25px; display:flex; justify-content:space-between; color:#74848e; font-size:11px; }
@media(max-width:1100px){.workspace-grid,.batch-grid{grid-template-columns:1fr}.results-panel{min-height:auto}.about-grid{grid-template-columns:1fr}.prose-panel.wide{grid-column:auto}.hero-stat-grid{display:none}.boundary-grid{grid-template-columns:repeat(3,1fr)}}
@media(max-width:720px){.topbar{height:auto;padding:14px 18px;align-items:flex-start;gap:12px}.nav{flex-wrap:wrap;justify-content:flex-end}.nav a{padding:7px 8px;font-size:11px}.brand small{display:none}.page-shell{width:calc(100% - 24px);margin-top:14px}.hero{padding:30px 24px}.compact-hero{min-height:auto}.hero h1{font-size:30px}.panel{padding:18px}.form-grid,.metric-grid,.model-cards,.equation-grid{grid-template-columns:1fr}.boundary-grid{grid-template-columns:repeat(2,1fr)}.footer{width:calc(100% - 24px);flex-direction:column;gap:4px}.recent-list article{grid-template-columns:1fr}.curve-chart{height:330px}}
