:root {
  --ink: #172321;
  --muted: #66736f;
  --line: #dfe8e5;
  --soft: #f3f7f6;
  --panel: #ffffff;
  --green: #0f4c45;
  --green-2: #176b60;
  --mint: #d9eee8;
  --orange: #e2643b;
  --red: #b73636;
  --blue: #2563a8;
  --shadow: 0 14px 36px rgba(26, 56, 50, .08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f6f9f8; color: var(--ink); font-family: "Segoe UI", Arial, system-ui, sans-serif; font-size: 14px; }
h1, h2, h3 { margin: 0; font-family: "Segoe UI", Arial, system-ui, sans-serif; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }
p { color: var(--muted); line-height: 1.6; }
a { color: var(--green-2); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.topbar { height: 68px; padding: 0 max(24px, calc((100vw - 1440px)/2)); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: white; background: linear-gradient(145deg, var(--green-2), var(--green)); font-family: "Segoe UI", Arial, sans-serif; font-weight: 800; box-shadow: 0 6px 14px rgba(15,76,69,.22); }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; }
.brand small { margin-top: 3px; color: var(--green-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav > a:not(.button) { color: var(--muted); font-weight: 600; }
.user-chip { padding-left: 16px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.inline { display: inline; }
.link-button { border: 0; background: none; color: var(--green-2); cursor: pointer; padding: 0; font-weight: 600; }
.page-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 38px 0 72px; }
.page-heading { margin-bottom: 26px; }
.page-heading p { margin: 8px 0 0; font-size: 15px; }
.eyebrow { margin-bottom: 9px; color: var(--green-2); font-size: 11px; font-weight: 800; letter-spacing: .15em; }
.eyebrow.light { color: #aee3d7; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.button { display: inline-flex; min-height: 42px; padding: 0 18px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; cursor: pointer; font-weight: 700; transition: .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--green); color: white; box-shadow: 0 8px 20px rgba(15,76,69,.16); }
.button.primary:hover { background: var(--green-2); }
.button.ghost { background: white; border-color: var(--line); color: var(--ink); box-shadow: none; }
.button.small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button.wide { width: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-header { padding: 23px 24px 18px; }
.card-header p { margin: 4px 0 0; font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0 0 24px; }
.metric { min-height: 112px; padding: 21px 22px; background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(26,56,50,.055); }
.metric span, .metric small { display: block; color: var(--muted); font-size: 12px; }
.metric strong { display: block; margin-top: 10px; font: 800 31px/1 "Segoe UI", Arial, sans-serif; }
.metric small { margin-top: 6px; }
.engine-card { min-width: 230px; padding: 13px 16px; border-radius: 12px; display: flex; align-items: center; gap: 11px; }
.engine-card.ready { background: #eaf6f1; color: #18594f; }
.engine-card.warning { background: #fff2df; color: #8a5311; }
.engine-card strong, .engine-card small { display: block; }
.engine-card small { margin-top: 3px; opacity: .78; font-size: 11px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px rgba(23,107,96,.12); }
.project-list { border-top: 1px solid var(--line); }
.project-row { display: grid; grid-template-columns: 44px minmax(260px, 1.4fr) auto minmax(220px, .8fr) 20px; gap: 16px; align-items: center; padding: 17px 24px; color: var(--ink); border-bottom: 1px solid var(--line); transition: .16s; }
.project-row:last-child { border-bottom: 0; }
.project-row:hover { background: #f8fbfa; }
.project-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--mint); color: var(--green); font-weight: 800; }
.project-main strong, .project-main small, .project-meta small { display: block; }
.project-main small, .project-meta, .project-meta small { color: var(--muted); font-size: 11px; }
.project-main small { margin-top: 5px; }
.project-meta small { margin-top: 4px; }
.arrow { color: var(--green-2); font-size: 18px; }
.tag { display: inline-flex; padding: 5px 9px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.tag.large { padding: 7px 12px; }
.empty-state { padding: 58px 24px; text-align: center; }
.empty-state strong { font: 700 18px "Segoe UI", Arial, sans-serif; }
.empty-state p { margin: 7px 0 18px; }
.empty-inline { padding: 28px 24px; color: var(--muted); border-top: 1px dashed var(--line); text-align: center; }
.flash { margin: -12px 0 22px; padding: 14px 17px; border-radius: 10px; border: 1px solid; }
.flash.success { color: #145e49; background: #ebf8f2; border-color: #b9e2d4; }
.flash.error { color: #922c2c; background: #fff0f0; border-color: #f1c6c6; }
.flash.info { color: #255b91; background: #eef6ff; border-color: #c9def3; }
.form-card { overflow: hidden; }
.form-section { padding: 25px 28px; border-bottom: 1px solid var(--line); }
.form-section h2 { margin-bottom: 18px; }
.form-grid { display: grid; gap: 16px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: block; color: #3c4b48; font-size: 11px; font-weight: 700; letter-spacing: .015em; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 11px 12px; color: var(--ink); background: white; border: 1px solid #cfdbd8; border-radius: 9px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(23,107,96,.1); }
textarea { resize: vertical; }
.form-note { margin: 11px 0 0; color: #788581; font-size: 11px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 20px 28px; }
.back-link { display: inline-block; margin-bottom: 19px; color: var(--muted); font-size: 12px; font-weight: 600; }
.heading-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-nav { display: flex; gap: 5px; margin: -4px 0 22px; padding: 6px; position: sticky; top: 76px; z-index: 30; background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 7px 24px rgba(26,56,50,.07); backdrop-filter: blur(8px); }
.section-nav a { padding: 9px 14px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.section-nav a:hover { background: var(--soft); color: var(--green); }
.workspace-grid { display: grid; grid-template-columns: 1fr 1.4fr .9fr; gap: 18px; margin-bottom: 22px; }
.readiness-card, .project-facts { min-height: 310px; }
.check-list { list-style: none; padding: 0 23px 18px; margin: 0; }
.check-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 9px; align-items: center; padding: 11px 0; color: var(--muted); border-top: 1px solid var(--line); font-size: 12px; }
.check-list li span { width: 16px; height: 16px; border: 2px solid #c5d1ce; border-radius: 50%; }
.check-list li.done { color: var(--ink); }
.check-list li.done span { background: var(--green-2); border-color: var(--green-2); box-shadow: inset 0 0 0 3px white; }
.check-list li strong { color: var(--ink); }
.map-card { overflow: hidden; min-height: 310px; }
#site-map { height: 100%; min-height: 310px; }
.project-facts dl, .run-facts { display: grid; grid-template-columns: 1fr 1.35fr; padding: 0 24px 18px; margin: 0; }
dt, dd { padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 600; }
.section-card { margin-bottom: 22px; scroll-margin-top: 135px; }
.collapsible-form { margin: 0 24px 22px; padding: 22px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.collapsible-form > .form-grid, .source-fields { margin-bottom: 16px; }
.hidden { display: none !important; }
.source-list { border-top: 1px solid var(--line); }
.source-item { padding: 19px 24px; border-bottom: 1px solid var(--line); }
.source-item:last-child { border-bottom: 0; }
.source-summary { display: flex; align-items: center; gap: 13px; }
.source-summary strong, .source-summary small { display: block; }
.source-summary small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.source-badge { display: grid; place-items: center; min-width: 56px; height: 34px; border-radius: 8px; color: white; font-size: 10px; font-weight: 800; }
.source-badge.point { background: var(--orange); }
.source-badge.area { background: var(--blue); }
.source-badge.volume { background: #7956a8; }
.emission-chips { display: flex; gap: 7px; flex-wrap: wrap; margin: 14px 0 10px 69px; }
.emission-chips span { padding: 6px 9px; background: var(--soft); border-radius: 7px; color: var(--muted); font-size: 10px; }
.emission-chips strong { color: var(--ink); }
.warning-chip { color: #8a5311 !important; background: #fff2df !important; }
details { margin-left: 69px; }
summary { color: var(--green-2); cursor: pointer; font-size: 11px; font-weight: 700; }
.inline-form { display: grid; grid-template-columns: .7fr .6fr .6fr 1.2fr 1.2fr auto; gap: 10px; align-items: end; margin-top: 13px; padding: 15px; background: var(--soft); border-radius: 10px; }
.inline-form .button { margin-bottom: 0; }
.form-pair { display: grid; grid-template-columns: 1fr; }
.checkbox { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; }
.checkbox input { width: auto; margin: 0; }
.table-wrap { overflow: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: 11px; }
th { color: var(--muted); background: #f8fbfa; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.table-note { padding: 0 16px; font-size: 11px; }
.dataset-list { border-top: 1px solid var(--line); }
.dataset-list article { display: flex; align-items: center; gap: 13px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.dataset-list article > div { flex: 1; }
.dataset-list strong, .dataset-list small { display: block; }
.dataset-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.file-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 9px; background: var(--mint); color: var(--green); font-size: 9px; font-weight: 800; }
.run-form { display: grid; grid-template-columns: 1.1fr .7fr .8fr 1.6fr auto; gap: 12px; align-items: end; margin: 0 24px 24px; padding: 18px; background: var(--soft); border-radius: 12px; }
fieldset { min-height: 63px; margin: 0; padding: 5px 10px 8px; border: 1px solid #cfdbd8; border-radius: 9px; }
legend { color: #3c4b48; font-size: 10px; font-weight: 700; }
fieldset .checkbox { margin: 5px 8px 0 0; font-size: 10px; }
.callout { margin: 0 24px 24px; padding: 15px 17px; border-radius: 10px; line-height: 1.55; }
.callout.warning { color: #76501c; background: #fff5e8; border: 1px solid #efd6b0; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.status.completed { color: #145e49; background: #dff3ea; }
.status.failed, .status.engine_missing { color: #922c2c; background: #ffe5e5; }
.status.running, .status.queued { color: #255b91; background: #e5f1ff; }
.status.large { padding: 9px 15px; font-size: 12px; }
.run-metrics .metric:first-child { grid-column: span 1; }
.coordinate { font-size: 17px !important; }
.run-layout { display: grid; grid-template-columns: 1.25fr .75fr; gap: 18px; margin-bottom: 22px; }
.run-facts { grid-template-columns: 180px 1fr; }
.hash { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.download-card { padding-bottom: 10px; }
.download-link { display: flex; align-items: center; gap: 12px; margin: 0 15px 9px; padding: 12px; color: var(--ink); background: var(--soft); border-radius: 10px; }
.download-link > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; color: white; background: var(--green); font-size: 9px; font-weight: 800; }
.download-link strong, .download-link small { display: block; }
.download-link small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.contour-card { margin-bottom: 22px; overflow: hidden; }
.contour-card img { display: block; width: min(100%, 900px); margin: 0 auto 24px; }
.model-log { margin: 0; padding: 20px 24px; max-height: 360px; overflow: auto; border-top: 1px solid var(--line); color: #dbeae6; background: #162421; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.processing { display: flex; align-items: center; gap: 14px; padding: 18px 22px; margin-bottom: 20px; }
.processing p { margin: 3px 0 0; font-size: 11px; }
.spinner { width: 27px; height: 27px; border: 3px solid var(--mint); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-page { min-height: 100vh; background: var(--green); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-visual { padding: clamp(55px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: white; background: radial-gradient(circle at 15% 15%, rgba(105,205,181,.26), transparent 35%), linear-gradient(145deg, #0f4c45, #092f2b); }
.login-visual h1 { max-width: 720px; font-size: clamp(38px, 5vw, 68px); }
.login-visual p { max-width: 620px; color: #c6ded8; font-size: 17px; }
.login-features { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.login-features span { padding: 8px 11px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #dcece8; font-size: 11px; }
.login-panel { padding: 30px; display: grid; place-items: center; background: #f4f8f7; }
.login-card { width: min(430px, 100%); padding: 34px; }
.login-brand { margin-bottom: 34px; }
.login-card h2 { font-size: 27px; }
.login-card > p { margin: 5px 0 23px; }
.login-card label { margin-top: 15px; }
.login-card .button { margin-top: 22px; }
.login-card .form-note { text-align: center; }
@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: 1fr 1fr; }
  .project-facts { grid-column: span 2; min-height: auto; }
  .inline-form { grid-template-columns: repeat(3, 1fr); }
  .run-form { grid-template-columns: repeat(2, 1fr); }
  .run-form fieldset { grid-column: span 2; }
  .form-grid.four { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .page-shell { width: min(100% - 24px, 1440px); padding-top: 24px; }
  .topbar { padding: 0 12px; }
  .topnav > a:not(.button), .user-chip { display: none; }
  .split { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .project-row { grid-template-columns: 42px 1fr 18px; }
  .project-row .tag, .project-meta { display: none; }
  .workspace-grid, .run-layout { grid-template-columns: 1fr; }
  .project-facts { grid-column: auto; }
  .section-nav { overflow-x: auto; top: 72px; }
  .form-grid.two, .form-grid.four, .inline-form, .run-form { grid-template-columns: 1fr; }
  .span-2, .run-form fieldset { grid-column: auto; }
  .emission-chips, details { margin-left: 0; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 14px; }
}
