:root {
  --bg: var(--brand-background);
  --surface: #ffffff;
  --surface-soft: var(--brand-background);
  --ink: var(--brand-primary);
  --muted: var(--brand-muted);
  --line: var(--brand-line);
  --line-strong: var(--brand-line);
  --green: var(--brand-primary);
  --green-dark: var(--brand-primary);
  --green-soft: var(--brand-soft);
  --lime: var(--brand-accent);
  --warning: #a34a28;
  --shadow: 0 12px 34px rgba(16,44,60,.06);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, Arial, sans-serif; }
.app { max-width: 1180px; margin: auto; padding: 26px 28px 72px; }
header { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.logo { font-weight: 900; font-size: 22px; letter-spacing: -.06em; }
.logo span { color: var(--green); }
.header-actions { display: flex; gap: 20px; align-items: center; }
.header-actions > a { padding: 7px 0; font-size: 12px; font-weight: 800; color: var(--muted); text-decoration: none; }
.header-actions > a:hover, .header-actions > a.active { color: var(--green); }
.local { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.local i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-accent); box-shadow: 0 0 0 4px var(--brand-soft); }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 40px; padding: 58px 4px 38px; }
.intro p, .section-number { margin: 0 0 9px; color: var(--green); font-size: 10px; text-transform: uppercase; letter-spacing: .15em; font-weight: 900; }
.intro h1 { margin: 0; font-size: clamp(40px, 6vw, 66px); line-height: .96; letter-spacing: -.065em; }
.intro > span { max-width: 380px; padding-bottom: 5px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.panel { margin-bottom: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.step-panel { position: relative; overflow: hidden; }
.step-panel::before { position: absolute; top: 0; left: 0; width: 100%; height: 3px; content: ""; background: linear-gradient(90deg, var(--green), var(--lime) 45%, transparent 85%); opacity: .85; }
.panel-head { display: flex; justify-content: space-between; align-items: start; gap: 24px; }
.panel h2 { margin: 0; font-size: 22px; letter-spacing: -.035em; }
.panel p { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
code { padding: 2px 5px; border-radius: 4px; background: var(--brand-soft); }

.action, .outline, .stop, .download, .text-button { border: 0; border-radius: 9px; cursor: pointer; font: inherit; font-size: 12px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.action { padding: 12px 16px; background: var(--green); color: #fff; box-shadow: 0 7px 18px rgba(16,44,60,.16); }
.action:hover { background: var(--green-dark); }
.outline { padding: 10px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.download { padding: 12px 16px; background: var(--green-soft); color: var(--green); }
.stop { padding: 8px 11px; border: 1px solid #f0c4b6; background: #fff1ed; color: var(--warning); }
.text-button { padding: 5px; background: transparent; color: var(--green); }
.action:disabled, .stop:disabled, .download.disabled, .outline:disabled, select:disabled { opacity: .42; cursor: not-allowed; pointer-events: none; }

.compact-setting { max-width: 760px; }
.upload-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(310px, .8fr); gap: 18px; margin-top: 20px; }
.drop { min-height: 238px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1.5px dashed var(--brand-muted); border-radius: 14px; background: var(--surface-soft); cursor: pointer; transition: .2s ease; }
.drop:hover, .drop.over { border-color: var(--green); background: var(--brand-background); transform: translateY(-1px); }
.drop input { display: none; }
.drop-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 5px; border-radius: 50%; background: var(--lime); color: var(--green-dark); font-size: 22px; font-weight: 900; }
.drop > span:last-child, .notice { color: var(--muted); font-size: 12px; }
.notice { min-height: 18px; margin: 9px 0 0 !important; color: var(--green) !important; font-weight: 750; }
.source-browser { min-height: 238px; max-height: 274px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.browser-head { height: 58px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.browser-head b, .browser-head span { display: block; }
.browser-head b { font-size: 13px; }
.browser-head span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.files { max-height: 215px; overflow-y: auto; }
.source-item { min-width: 0; display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--brand-soft); cursor: pointer; }
.source-item:last-child { border-bottom: 0; }
.source-item:hover { background: var(--brand-background); }
.source-item input { flex: 0 0 auto; accent-color: var(--green); }
.source-item span { min-width: 0; }
.source-item b, .source-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-item b { font-size: 12px; }
.source-item small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 28px 16px; color: var(--muted); text-align: center; }

.extraction { margin-top: 18px; padding: 16px; border: 1px solid var(--brand-line); border-radius: 12px; background: var(--brand-background); }
.extraction-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.extraction-head b { font-size: 13px; }
.extraction-head span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.progress-track { height: 7px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: var(--brand-line); }
.progress-track div { width: 0; height: 100%; background: var(--green); transition: width .45s ease; }
.extraction pre { max-height: 74px; margin: 11px 0 0; overflow: auto; color: var(--muted); font-size: 10px; white-space: pre-wrap; }

.metric-strip { display: grid; grid-template-columns: 1.15fr repeat(4, 1fr); gap: 9px; margin: 22px 0 12px; }
.metric-strip article { min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.metric-strip span, .metric-strip b, .metric-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-strip span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.metric-strip b { margin-top: 7px; font-size: 15px; }
.metric-strip small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.metric-strip .metric-warning { border-color: #e9cbbb; background: #fff8f4; }
.metric-strip .metric-warning b { color: var(--warning); }
.runtime-metrics-head { display: flex; justify-content: space-between; gap: 16px; margin-top: 17px; color: var(--muted); font-size: 10px; }
.runtime-metrics-head b { color: var(--ink); font-size: 11px; }
.runtime-metric-strip { margin-top: 8px; }
.runtime-metric-strip article { background: var(--brand-background); }

.json-workspace { min-height: 390px; display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 13px; }
.json-list { max-height: 510px; overflow-y: auto; border-right: 1px solid var(--line); background: #fff; }
.json-item { width: 100%; display: block; padding: 14px; border: 0; border-bottom: 1px solid var(--brand-soft); background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.json-item:hover, .json-item.active { background: var(--brand-background); }
.json-item.active { box-shadow: inset 3px 0 var(--green); }
.json-item b, .json-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.json-item b { font-size: 12px; }
.json-item small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.json-preview { min-width: 0; background: var(--brand-primary); color: var(--brand-accent); }
.json-toolbar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--brand-primary); }
.json-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 800; }
.view-switch { display: flex; gap: 3px; padding: 3px; border-radius: 7px; background: var(--brand-primary); }
.view-switch button { padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--brand-muted); font-size: 9px; font-weight: 850; cursor: pointer; }
.view-switch button.active { background: var(--lime); color: var(--brand-primary); }
.view-switch button:disabled { opacity: .35; cursor: not-allowed; }
.json-preview pre { max-height: 460px; margin: 0; padding: 18px; overflow: auto; font-size: 10px; line-height: 1.55; white-space: pre-wrap; }

.selector { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.choice { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--brand-soft); cursor: pointer; }
.choice:last-child { border-bottom: 0; }
.choice:hover, .choice:has(input:checked) { background: var(--green-soft); }
.choice input { flex: 0 0 auto; accent-color: var(--green); }
.choice span { min-width: 0; }
.choice b, .choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice b { font-size: 12px; }
.choice small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.selected-profile { padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.selected-profile span, .selected-profile b, .selected-profile small { display: block; }
.selected-profile span { color: var(--green); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.selected-profile b { margin-top: 7px; font-size: 18px; }
.selected-profile small { margin-top: 5px; color: var(--muted); font-size: 11px; }
.result { margin-top: 16px; padding: 13px 14px; border-radius: 9px; background: var(--brand-background); color: var(--muted); font-size: 12px; }
.evaluation-cta .result { max-width: 760px; }

.architecture-page .intro { padding-bottom: 34px; }
.architecture-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 22px; }
.architecture-grid article { padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.architecture-grid article > b { font-size: 13px; }
.architecture-grid article p { min-height: 58px; line-height: 1.5; }
.architecture-grid article code { font-size: 10px; }
.folder-table { margin-top: 20px; border-top: 1px solid var(--line); }
.folder-table div { display: grid; grid-template-columns: 210px 1fr; gap: 15px; padding: 12px 0; border-bottom: 1px solid var(--brand-soft); font-size: 12px; }
.folder-table span { color: var(--muted); line-height: 1.45; }
.commands { display: grid; grid-template-columns: max-content 1fr; gap: 12px 16px; margin-top: 21px; padding: 15px; border-radius: 10px; background: var(--brand-background); color: var(--muted); font-size: 12px; align-items: center; }

@media (max-width: 850px) {
  .upload-workspace { grid-template-columns: 1fr; }
  .source-browser { max-height: 260px; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-strip article:first-child { grid-column: span 2; }
  .runtime-metrics-head { display: block; }
  .runtime-metrics-head span { display: block; margin-top: 4px; }
}

@media (max-width: 700px) {
  .app { padding: 20px 14px 50px; }
  header { align-items: flex-start; }
  .header-actions { gap: 11px; flex-wrap: wrap; justify-content: flex-end; }
  .header-actions > a { font-size: 10px; }
  .local { display: none; }
  .intro { padding: 45px 2px 28px; display: block; }
  .intro > span { display: block; margin-top: 18px; }
  .panel { padding: 21px 17px; }
  .panel-head, .extraction-head { flex-direction: column; align-items: stretch; }
  .json-workspace { grid-template-columns: 1fr; }
  .json-list { max-height: 220px; border-right: 0; border-bottom: 1px solid var(--line); }
  .json-toolbar { align-items: flex-start; flex-direction: column; }
  .architecture-grid { grid-template-columns: 1fr; }
  .folder-table div, .commands { grid-template-columns: 1fr; gap: 7px; }
}
