:root {
  --black: #050505;
  --charcoal: #293033;
  --slate: #5c6c73;
  --muted: #77858a;
  --line: #d9dfdc;
  --surface: #ffffff;
  --canvas: #f3f5f1;
  --lime: #e0e650;
  --lime-soft: #f5f7c9;
  --teal: #1d7d90;
  --teal-soft: #dff1f3;
  --error: #a93838;
  --error-soft: #fbeaea;
  --shadow: 0 18px 50px rgba(20, 31, 34, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--charcoal);
  background: var(--canvas);
  font-family: "Jost", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  color: var(--surface);
  background: var(--black);
  border-radius: 8px;
}
.skip-link:focus { top: 16px; }

.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  background: var(--surface);
  border-bottom: 4px solid var(--lime);
}

.header-inner {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: var(--black);
  text-decoration: none;
}
.brand img { width: 62px; height: 62px; object-fit: contain; }
.brand-divider { width: 1px; height: 38px; background: var(--line); }
.product-name { font-family: "Dela Gothic One", sans-serif; font-size: 18px; letter-spacing: -0.02em; }

.service-badge {
  padding: 7px 12px;
  color: var(--charcoal);
  background: var(--lime-soft);
  border: 1px solid #dce249;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 72px;
  align-items: end;
  padding-block: 72px 44px;
}

.eyebrow, .step-label {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2 { color: var(--black); }
h1 {
  max-width: 800px;
  margin-bottom: 22px;
  font-family: "Dela Gothic One", sans-serif;
  font-size: clamp(38px, 5.4vw, 66px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.045em;
}
h2 { margin-bottom: 12px; font-size: clamp(24px, 3vw, 31px); line-height: 1.18; }
h3 { color: var(--black); font-size: 17px; }

.intro-copy { max-width: 760px; margin: 0; color: var(--slate); font-size: 20px; line-height: 1.55; }

.trust-note {
  display: flex;
  gap: 14px;
  padding: 20px;
  background: var(--lime-soft);
  border-left: 5px solid var(--lime);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.trust-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: var(--surface);
  background: var(--black);
  border-radius: 50%;
  font-weight: 700;
}
.trust-note strong, .trust-note span { display: block; }
.trust-note strong { color: var(--black); }
.trust-note div > span { color: var(--slate); font-size: 15px; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr); gap: 28px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.search-card { padding: clamp(26px, 4vw, 44px); }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.section-heading h2 { margin: 0; }
.time-estimate { white-space: nowrap; padding: 7px 11px; color: var(--slate); background: var(--canvas); border-radius: 999px; font-size: 14px; }

label { display: block; margin-bottom: 3px; color: var(--black); font-weight: 700; }
.field-help { margin-bottom: 12px; color: var(--slate); font-size: 15px; }
textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 18px 20px;
  color: var(--charcoal);
  background: #fbfcfa;
  border: 1px solid #aeb9b5;
  border-radius: 12px;
  outline: none;
  line-height: 1.65;
}
textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(29, 125, 144, 0.13); }
textarea[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 4px rgba(169, 56, 56, 0.1); }
.field-feedback { min-height: 27px; margin-top: 7px; color: var(--error); font-size: 14px; }

.logic-preview { margin-top: 22px; padding: 20px; background: var(--canvas); border-radius: var(--radius-md); }
.preview-heading { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.preview-heading h3 { margin: 0; }
.preview-heading > span { color: var(--muted); font-size: 14px; }
.logic-groups { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.condition-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.term-pill { padding: 5px 10px; color: var(--black); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: 14px; font-weight: 600; }
.operator { color: var(--teal); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; }
.or-divider { color: var(--slate); font-size: 12px; font-weight: 700; }

.help-panel, .excel-help, .log-panel { margin-top: 20px; border-top: 1px solid var(--line); }
summary { cursor: pointer; color: var(--black); font-weight: 600; }
.help-panel summary, .excel-help summary, .log-panel summary { padding-block: 17px 8px; }
.help-content { padding-bottom: 6px; color: var(--slate); font-size: 15px; }
.help-content p { margin-bottom: 12px; }
.help-example { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start; margin-bottom: 12px; }
code { padding: 3px 7px; color: var(--charcoal); background: #edf0ed; border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.88em; }

.form-actions { display: flex; align-items: center; gap: 20px; margin-top: 26px; }
.form-actions p { max-width: 330px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible, .prototype-controls button:focus-visible, summary:focus-visible { outline: 3px solid rgba(29, 125, 144, 0.4); outline-offset: 3px; }
.button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-primary { color: var(--black); background: var(--lime); box-shadow: 0 7px 18px rgba(178, 184, 44, 0.28); }
.button-primary:hover { background: #d5dc3f; }
.button-dark { color: var(--surface); background: var(--black); }
.button-dark:hover { background: var(--charcoal); }
.button-secondary { color: var(--black); background: var(--surface); border-color: #98a5a1; }
.text-button { padding: 10px 4px; color: var(--teal); background: none; border: 0; font-weight: 700; cursor: pointer; }

.side-column { display: grid; gap: 24px; }
.outcome-card { padding: 30px; }
.outcome-card h2 { font-size: 26px; }
.feature-list { margin: 28px 0 0; padding: 0; list-style: none; }
.feature-list li { display: grid; grid-template-columns: 34px 1fr; gap: 13px; padding: 17px 0; border-top: 1px solid var(--line); }
.feature-list li > span { color: var(--teal); font-size: 13px; font-weight: 700; }
.feature-list strong { display: block; color: var(--black); }
.feature-list p { margin: 2px 0 0; color: var(--slate); font-size: 14px; }
.demo-card { padding: 28px; color: var(--surface); background: var(--black); border-radius: var(--radius-lg); }
.demo-kicker { display: block; margin-bottom: 17px; color: var(--lime); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.demo-card h2 { color: var(--surface); font-size: 21px; }
.demo-card p { margin: 0; color: #b8c1c4; font-size: 14px; }

.state-panel { margin-top: 0; }
.state-panel[hidden], .workspace[hidden], .intro[hidden] { display: none !important; }
.status-card, .completion-card { padding: clamp(26px, 4vw, 44px); }
.status-topline, .completion-heading { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.status-identity, .completion-heading { display: flex; gap: 18px; }
.status-identity h2, .completion-heading h2 { margin-bottom: 7px; }
.spinner { width: 42px; height: 42px; flex: 0 0 42px; border: 4px solid #e7e9e5; border-top-color: var(--teal); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
.elapsed { color: var(--slate); font-size: 14px; }
.progress-track { height: 9px; margin: 28px 0 20px; overflow: hidden; background: #e4e8e4; border-radius: 999px; }
.progress-track span { display: block; height: 100%; background: var(--lime); border-radius: inherit; }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 30px; padding: 0; list-style: none; color: var(--muted); font-size: 13px; }
.progress-steps li { display: flex; gap: 8px; align-items: center; }
.progress-steps li span { width: 10px; height: 10px; flex: 0 0 10px; background: #ccd3d0; border-radius: 50%; }
.progress-steps .done { color: var(--charcoal); }
.progress-steps .done span { background: var(--teal); }
.progress-steps .active { color: var(--black); font-weight: 700; }
.progress-steps .active span { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }
.live-metrics, .summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-md); }
.live-metrics div, .summary-grid div { padding: 18px; background: var(--surface); }
.live-metrics span, .summary-grid dt { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.live-metrics strong, .summary-grid dd { color: var(--black); font-size: 21px; font-weight: 700; }
.log-panel summary { display: flex; justify-content: space-between; }
.log-panel summary span { color: var(--teal); font-size: 12px; text-transform: uppercase; }
.log-panel pre, .message-card pre { overflow: auto; margin: 10px 0 0; padding: 18px; color: #dce4df; background: #14191b; border-radius: 10px; font: 13px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }

.completion-heading { justify-content: flex-start; }
.completion-heading p:last-child { margin: 0; color: var(--slate); }
.success-mark { width: 50px; height: 50px; flex: 0 0 50px; display: grid; place-items: center; color: var(--black); background: var(--lime); border-radius: 50%; font-size: 25px; font-weight: 700; }
.summary-grid { grid-template-columns: repeat(3, 1fr); margin-top: 30px; }
.summary-grid dd { margin: 0; font-size: 26px; }
.result-definition { margin: 14px 2px 0; color: var(--slate); font-size: 14px; line-height: 1.55; }
.conditions-summary { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 24px; }
.conditions-summary > span { margin-right: 5px; color: var(--muted); font-size: 13px; }
.completion-actions, .message-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.excel-help p { color: var(--slate); }

.message-card { display: grid; grid-template-columns: 54px 1fr; gap: 22px; padding: clamp(26px, 4vw, 42px); border-left: 6px solid; }
.message-card h2 { margin-bottom: 9px; }
.message-card p { color: var(--slate); }
.message-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; font-size: 22px; font-weight: 700; }
.message-error { border-left-color: var(--error); }
.message-error .message-icon { color: var(--error); background: var(--error-soft); }
.message-busy { border-left-color: var(--teal); }
.message-busy .message-icon { color: var(--teal); background: var(--teal-soft); }
.message-card details { margin-top: 18px; }

body:not([data-view="idle"]) .intro,
body:not([data-view="idle"]) .workspace { display: none; }
body[data-view="running"] [data-visible-in="running"],
body[data-view="completed"] [data-visible-in="completed"],
body[data-view="error"] [data-visible-in="error"],
body[data-view="busy"] [data-visible-in="busy"] { display: block; margin-top: 64px; }

.site-footer { margin-top: 76px; padding: 28px 0 100px; color: var(--slate); border-top: 1px solid var(--line); font-size: 13px; }
.site-footer .shell { display: flex; justify-content: space-between; align-items: flex-start; gap: 32px; }
.site-footer .shell > div { display: flex; flex-direction: column; gap: 6px; }
.site-footer .privacy-note { max-width: 620px; margin: 0; line-height: 1.55; }

.prototype-controls {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 8px 10px 8px 14px;
  color: var(--surface);
  background: rgba(5, 5, 5, 0.94);
  border: 1px solid #42494b;
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.26);
  font-size: 12px;
}
.prototype-controls > span { color: #b5bec0; white-space: nowrap; }
.prototype-controls div { display: flex; gap: 3px; }
.prototype-controls button { padding: 6px 9px; color: #dfe5e3; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 12px; }
.prototype-controls button.active { color: var(--black); background: var(--lime); font-weight: 700; }

@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: 28px; padding-top: 54px; }
  .trust-note { max-width: 520px; }
  .workspace { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: 1fr 1fr; }
  .live-metrics, .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 24px, 1120px); }
  .header-inner { min-height: 76px; }
  .brand { gap: 11px; }
  .brand img { width: 48px; height: 48px; }
  .brand-divider { height: 30px; }
  .product-name { font-size: 14px; }
  .service-badge { display: none; }
  .intro { padding-block: 42px 28px; }
  h1 { font-size: 37px; }
  .intro-copy { font-size: 18px; }
  .section-heading, .status-topline { display: block; }
  .time-estimate, .elapsed { display: inline-block; margin-top: 12px; }
  .search-card, .outcome-card, .demo-card, .status-card, .completion-card { border-radius: 16px; }
  .form-actions, .completion-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button, .completion-actions .button { width: 100%; }
  .form-actions p { max-width: none; }
  .side-column { grid-template-columns: 1fr; }
  .progress-steps { grid-template-columns: 1fr 1fr; }
  .live-metrics, .summary-grid { grid-template-columns: 1fr 1fr; }
  .message-card { grid-template-columns: 1fr; }
  .site-footer .shell { flex-direction: column; }
  .prototype-controls { overflow-x: auto; justify-content: flex-start; }
  .prototype-controls > span { display: none; }
}

@media (max-width: 420px) {
  .product-name { max-width: 128px; line-height: 1.2; }
  .preview-heading { display: block; }
  .preview-heading > span { display: block; margin-top: 4px; }
  .help-example { grid-template-columns: 1fr; }
  .live-metrics, .summary-grid { grid-template-columns: 1fr; }
  .status-identity, .completion-heading { align-items: flex-start; }
}
