:root {
  color-scheme: light;
  --ink: #23352d;
  --muted: #64756d;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #e5e5dc;
  --sage: #dce8df;
  --green: #2d6a50;
  --green-dark: #23513f;
  --amber: #a96317;
  --red: #a34035;
  --shadow: 0 12px 34px rgba(52, 73, 64, 0.08);
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
main { max-width: 780px; margin: 0 auto; padding: 32px 18px 64px; }
header { padding: 8px 2px 20px; }
.header-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { margin: 2px 0 8px; font-size: clamp(2rem, 9vw, 3.5rem); line-height: .96; letter-spacing: -.06em; }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.03em; }
p { margin: 0; }
.eyebrow { color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.intro { max-width: 570px; color: var(--muted); line-height: 1.5; }
.helper { margin-top: 7px; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.section-kicker { color: var(--green); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 4px 0 18px; }
.step { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: .72rem; font-weight: 750; text-align: center; }
.step b { display: grid; width: 30px; height: 30px; place-content: center; border-radius: 50%; background: var(--line); color: var(--muted); }
.step.active b, .step.done b { background: var(--green); color: white; }
.step.active { color: var(--green-dark); }
.panel, .recipe-card {
  width: 100%;
  min-width: 0;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.drop-area {
  display: grid;
  min-height: 176px;
  place-content: center;
  gap: 7px;
  padding: 20px;
  border: 2px dashed #b8c9bd;
  border-radius: 16px;
  background: #f5f8f4;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}
.drop-area strong { color: var(--green); font-size: 1.12rem; }
.drop-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 3px;
  place-content: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 1.7rem;
  line-height: 1;
}
#files { position: absolute; width: 1px; height: 1px; opacity: 0; }
.selection { margin: 12px 2px; color: var(--muted); font-size: .88rem; }
.progress-track { height: 9px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: var(--line); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease; }
.progress-track.indeterminate span { width: 45%; animation: loading 1.25s ease-in-out infinite; }
.progress-percent { margin-top: 6px; color: var(--green-dark); font-size: .8rem; font-weight: 800; text-align: right; }
@keyframes loading { from { transform: translateX(-110%); } to { transform: translateX(245%); } }
.field { display: grid; min-width: 0; gap: 7px; margin-top: 18px; color: var(--ink); font-size: .9rem; font-weight: 700; }
small { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="password"], textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}
input[type="text"], input[type="password"] {
  min-height: 46px;
  padding: 0 12px;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.2;
}
textarea { min-height: 260px; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .75rem; }
.form-textarea { min-height: 112px; font-family: inherit; font-size: .9rem; line-height: 1.45; }
button, .button-link {
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.primary { width: 100%; margin-top: 16px; background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.secondary { background: var(--sage); color: var(--green-dark); }
.wide { width: 100%; margin-top: 10px; }
.text-button { min-height: auto; padding: 4px; background: transparent; color: var(--green); font-size: .82rem; }
.section-title { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; margin: 28px 2px 8px; }
.section-title > :first-child { min-width: 0; }
.panel .section-title { margin: 0 0 10px; }
.pill, .count { flex: 0 0 auto; white-space: nowrap; border-radius: 999px; padding: 5px 10px; background: var(--sage); color: var(--green-dark); font-size: .75rem; font-weight: 800; }
.document { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.document:first-child { border-top: 0; }
.document .failed, .error { color: var(--red); }
.notice { margin-top: 12px; padding: 11px 12px; border-radius: 12px; font-size: .88rem; line-height: 1.4; }
.notice.warning { background: #fff6e8; color: #875016; }
.notice.success { background: #edf7ef; color: var(--green-dark); }
.recipe-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.recipe-heading > div { min-width: 0; }
.recipe-card h3 { margin: 0 0 4px; font-size: 1.2rem; letter-spacing: -.03em; }
.meta { color: var(--muted); font-size: .82rem; }
.status-badge { flex: 0 0 auto; border-radius: 999px; padding: 5px 9px; background: var(--sage); color: var(--green-dark); font-size: .7rem; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.status-badge.success { background: #edf7ef; color: var(--green-dark); }
.status-badge.warning { background: #fff0d5; color: var(--amber); }
.recipe-card details { margin-top: 14px; }
.recipe-card summary { color: var(--green); font-size: .9rem; font-weight: 750; cursor: pointer; }
.recipe-card ul, .recipe-card ol { padding-left: 20px; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.edit-grid { display: grid; gap: 10px; margin-top: 12px; }
.edit-grid .field { margin-top: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.actions { display: flex; gap: 8px; margin-top: 16px; }
.actions button { flex: 1; }
.imported { margin-top: 14px; color: var(--green); font-size: .9rem; font-weight: 750; }
.button-link { display: inline-grid; align-content: center; background: var(--sage); color: var(--green-dark); text-decoration: none; }
.batch-actions { margin-top: 10px; }
.completion { margin: 14px 0 16px; padding: 12px; border-radius: 14px; background: #f6f8f5; }
.completion-line { display: flex; justify-content: space-between; gap: 10px; color: var(--green-dark); font-size: .85rem; }
.check-field { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .9rem; line-height: 1.35; }
.check-field input { width: 18px; height: 18px; accent-color: var(--green); }
.history-list { display: grid; gap: 8px; margin-top: 10px; }
.history-entry {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
}
.history-entry span { display: block; }
.history-entry .meta { margin-top: 3px; }
.empty { color: var(--muted); font-size: .9rem; }
.image-note { margin-top: 8px; color: var(--muted); font-size: .82rem; }
dialog { width: min(92vw, 430px); border: 0; border-radius: 20px; padding: 0; background: transparent; }
dialog::backdrop { background: rgba(23, 41, 34, .48); backdrop-filter: blur(2px); }
.dialog-card { padding: 22px; border-radius: 20px; background: white; box-shadow: var(--shadow); text-align: center; }
.dialog-icon { display: grid; width: 46px; height: 46px; margin: 0 auto 12px; place-content: center; border-radius: 50%; background: var(--sage); color: var(--green-dark); font-size: 1.25rem; font-weight: 850; }
.dialog-icon.warning { background: #fff0d5; color: var(--amber); }
.dialog-icon.success { background: var(--sage); color: var(--green-dark); }
.dialog-message { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.dialog-card .primary { margin-top: 18px; }
.login-main { max-width: 460px; padding-top: 64px; }
.login-panel { margin-top: 8px; }
.login-panel .field:first-child { margin-top: 0; }
.remember { margin-top: 18px; }
.login-error { min-height: 20px; margin-top: 12px; font-size: .88rem; }
.hidden { display: none; }
@media (min-width: 640px) {
  main { padding-top: 56px; }
  .panel, .recipe-card { padding: 20px; }
}
