:root {
  --ink: #17211b;
  --muted: #667168;
  --paper: #f5f3ed;
  --surface: #fffefa;
  --line: #dcded5;
  --green: #1d5c43;
  --green-dark: #12442f;
  --green-soft: #e7f0e9;
  --amber: #bb7534;
  --red: #a43a34;
  --red-soft: #f9e9e6;
  --shadow: 0 18px 50px rgba(26, 42, 32, 0.08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--paper); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select { font: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 14px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 5vw, 4.6rem); font-weight: 500; line-height: .98; letter-spacing: -.045em; }
h2 { font-size: 1.45rem; }
h3 { margin-bottom: 8px; font-size: 1.08rem; }

.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 12px clamp(20px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(255, 254, 250, .86); backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: .96rem; letter-spacing: .01em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .73rem; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--green); color: white; font-family: Georgia, serif; font-weight: 700; }
.account { display: flex; align-items: center; gap: 16px; text-align: right; }
.account strong, .account small { display: block; }
.account small { color: var(--muted); font-size: .72rem; }

.page { width: min(1360px, calc(100% - 40px)); margin: 0 auto; padding: 54px 0 88px; }
.page-narrow { width: min(820px, calc(100% - 40px)); }
.hero { display: flex; align-items: end; justify-content: space-between; min-height: 330px; padding: 56px clamp(24px, 5vw, 68px); margin-bottom: 58px; overflow: hidden; border-radius: 28px; background: var(--green); color: white; box-shadow: var(--shadow); position: relative; }
.hero::after { content: ""; position: absolute; right: -90px; top: -170px; width: 470px; height: 470px; border: 1px solid rgba(255,255,255,.14); border-radius: 50%; box-shadow: 0 0 0 55px rgba(255,255,255,.035), 0 0 0 110px rgba(255,255,255,.025); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin-bottom: 18px; }
.hero .lede { color: rgba(255,255,255,.74); }
.eyebrow { margin-bottom: 12px; color: var(--amber); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero .eyebrow { color: #f1bf83; }
.lede { max-width: 680px; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.status-chip { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 10px 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; background: rgba(255,255,255,.08); font-size: .8rem; }
.status-chip span { width: 8px; height: 8px; border-radius: 50%; background: #9ee0b5; box-shadow: 0 0 0 4px rgba(158,224,181,.12); }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 20px; }
.section-heading h2 { margin: 0; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card { min-height: 260px; padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-decoration: none; position: relative; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.tool-card p { margin-bottom: 0; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.tool-card-active:hover { transform: translateY(-3px); border-color: #9ab4a3; box-shadow: var(--shadow); }
.tool-icon { display: grid; width: 48px; height: 48px; margin-bottom: 34px; place-items: center; border-radius: 12px; background: var(--green-soft); color: var(--green); font-family: Georgia, serif; font-size: 1.15rem; font-weight: 700; }
.tool-card-muted { opacity: .68; }
.tool-card-muted .tool-icon { background: #ecece7; color: #6a716b; }
.tool-arrow { position: absolute; right: 28px; bottom: 25px; color: var(--green); font-size: 1.5rem; }
.badge { display: inline-block; margin-bottom: 12px; padding: 4px 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: .65rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.badge-muted { background: #ecece7; color: var(--muted); }

.login-shell { display: grid; min-height: calc(100vh - 50px); padding: 30px; place-items: center; }
.login-card { width: min(490px, 100%); padding: clamp(28px, 6vw, 54px); border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.brand-centered { margin-bottom: 54px; }
.login-card h1 { font-size: 3rem; }
.login-card .lede { margin-bottom: 28px; font-size: .94rem; }

.form-stack { display: grid; gap: 20px; }
label { display: grid; gap: 8px; font-size: .82rem; font-weight: 750; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #bdc3bb; border-radius: 9px; background: white; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,92,67,.1); }
.optional { color: var(--muted); font-weight: 500; }
.choice-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.choice-divider::before, .choice-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; text-decoration: none; font-weight: 750; }
.button-primary { background: var(--green); color: white; }
.button-primary:hover { background: var(--green-dark); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-small { min-height: 36px; padding: 7px 12px; font-size: .78rem; }
.button-quiet { border-color: var(--line); background: transparent; color: var(--ink); }

.back-link { display: inline-block; margin-bottom: 34px; color: var(--green); font-size: .86rem; font-weight: 750; text-decoration: none; }
.page-title { margin-bottom: 36px; }
.page-title h1 { font-size: clamp(2.35rem, 5vw, 4rem); }
.split-title { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.panel, .table-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 8px 30px rgba(26,42,32,.04); }
.panel { padding: clamp(24px, 5vw, 42px); }
.step { display: flex; align-items: start; gap: 15px; }
.step > span { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: .75rem; font-weight: 800; }
.step h2 { margin: 1px 0 5px; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.file-drop { padding: 26px; border: 1px dashed #96a39a; border-radius: 14px; background: #fafaf6; cursor: pointer; }
.file-drop strong, .file-drop span { display: block; }
.file-drop span { color: var(--muted); font-size: .76rem; font-weight: 500; }
.file-drop input { min-height: auto; margin-top: 16px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.info-box { display: grid; gap: 5px; padding: 16px 18px; border-left: 3px solid var(--amber); background: #fbf3e8; font-size: .82rem; }
.info-box span { color: var(--muted); }
.alert { margin-bottom: 22px; padding: 15px 18px; border-radius: 11px; font-size: .86rem; line-height: 1.5; }
.alert-error { border: 1px solid #e7bbb5; background: var(--red-soft); color: #7d2e29; }
.alert-success { border: 1px solid #bdd6c4; background: var(--green-soft); color: var(--green-dark); }

.summary-cards { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.summary-cards > div { min-width: 110px; padding: 16px 18px; border-right: 1px solid var(--line); }
.summary-cards > div:last-child { border-right: 0; }
.summary-cards strong, .summary-cards span { display: block; }
.summary-cards strong { font-family: Georgia, serif; font-size: 1.5rem; }
.summary-cards span { color: var(--muted); font-size: .7rem; }
.summary-error strong { color: var(--red); }
.table-panel { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .79rem; }
th { padding: 13px 15px; background: #f0f1eb; color: var(--muted); text-align: left; font-size: .66rem; letter-spacing: .07em; text-transform: uppercase; }
td { max-width: 480px; padding: 15px; border-top: 1px solid var(--line); vertical-align: top; }
code { color: var(--green-dark); font-size: .75rem; }
.ingredient-preview { min-width: 360px; line-height: 1.55; }
.row-error { background: #fff8f6; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 99px; font-size: .67rem; font-weight: 800; white-space: nowrap; }
.status-ready { background: var(--green-soft); color: var(--green); }
.status-error { background: var(--red-soft); color: var(--red); }
.status-running { background: #fbf0df; color: #925b27; }
.cell-errors { margin: 8px 0 0; padding-left: 16px; color: var(--red); line-height: 1.45; }
.confirm-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 22px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.confirm-bar strong, .confirm-bar span { display: block; }
.confirm-bar span { margin-top: 3px; color: var(--muted); font-size: .77rem; }
.job-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.job-heading h2 { margin: 12px 0 0; }
.job-heading > strong { font-family: Georgia, serif; font-size: 1.6rem; }
.progress-track { height: 12px; margin: 28px 0 15px; overflow: hidden; border-radius: 99px; background: #e7e8e2; }
.progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease; }
.job-current { color: var(--muted); font-size: .85rem; }
.job-summary { margin-top: 30px; }
.failure-list { margin-top: 28px; padding-top: 25px; border-top: 1px solid var(--line); }
.failure-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); font-size: .8rem; }
.failure-list span { color: var(--red); }
.error-page { margin-top: 10vh; text-align: center; }
.error-page h1 { margin-inline: auto; font-size: 3rem; }
.error-page .lede { margin: 0 auto 28px; }
.footer { padding: 18px 20px 30px; color: var(--muted); text-align: center; font-size: .7rem; }

@media (max-width: 900px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 210px; }
  .hero, .split-title { align-items: start; flex-direction: column; }
  .hero { min-height: 380px; }
  .split-title .summary-cards { width: 100%; }
}

@media (max-width: 620px) {
  .page { width: min(100% - 24px, 1360px); padding-top: 32px; }
  .site-header { padding-inline: 14px; }
  .account > span { display: none; }
  .hero { padding: 34px 24px; border-radius: 19px; }
  .hero h1 { font-size: 2.75rem; }
  .summary-cards { width: 100%; }
  .summary-cards > div { min-width: 0; padding: 12px; }
  .confirm-bar { align-items: stretch; flex-direction: column; }
  .confirm-bar .button { width: 100%; }
  .login-shell { padding: 12px; }
  .login-card { border-radius: 20px; }
}
