:root {
  color-scheme: light;
  font: 16px/1.65 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
  color: #18342f;
  background: #f4f2eb;
  --ink: #18342f;
  --muted: #65736f;
  --line: #d8ded8;
  --paper: #fffefb;
  --brand: #156658;
  --brand-dark: #0f4f45;
  --accent: #e8f2ec;
  --warning: #fff2d7;
  --danger: #a53d37;
  --shadow: 0 18px 50px rgba(28, 57, 50, .08);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, textarea, select { font: inherit; }
button, .file-button { min-height: 44px; }
button { border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .file-button:focus-within {
  outline: 3px solid #e8a831;
  outline-offset: 2px;
}

.hero { background: linear-gradient(145deg, #123f38, #176f60); color: white; }
.hero-inner { max-width: 1180px; margin: auto; padding: 50px 28px 42px; }
.eyebrow, .step { margin: 0 0 6px; color: #c7e9dd; font-size: .78rem; font-weight: 750; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.18; }
.tagline { margin: 12px 0 24px; font-size: clamp(1.08rem, 2vw, 1.35rem); }
.local-note { max-width: 780px; margin: 0; padding: 14px 16px; color: #15352f; background: #f7f0d8; border-radius: 10px; }

.alert, .status { max-width: 1180px; margin: 16px auto 0; padding: 12px 18px; border-radius: 8px; overflow-wrap: anywhere; }
.alert { background: var(--warning); border: 1px solid #e2bd67; }
.status { min-height: 24px; padding-block: 4px; color: var(--brand-dark); }

.app-shell { display: grid; grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto; padding: 10px 28px 50px; }
.panel { min-width: 0; padding: 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.projects-panel { align-self: start; position: sticky; top: 16px; }
.section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-heading h2, .section-heading h3 { margin: 0; line-height: 1.35; }
.section-heading p:not(.step) { margin: 4px 0 0; color: var(--muted); }
.section-heading .step { color: var(--brand); }
.section-heading.minor { margin-top: 28px; }

.button-stack { display: grid; gap: 8px; }
.button-stack.compact { margin-top: 12px; }
button, .file-button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; color: white; background: var(--brand); border-radius: 8px; font-weight: 700; text-align: center; }
button:hover, .file-button:hover { background: var(--brand-dark); }
.secondary { color: var(--brand-dark); background: var(--accent); border: 1px solid #b8d2c8; }
.secondary:hover { background: #d9ebe3; }
.text-button { min-height: auto; color: var(--brand); background: transparent; text-decoration: underline; }
.text-button:hover { color: var(--brand-dark); background: transparent; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.project-list { display: grid; gap: 8px; margin: 20px 0; }
.project-list button { justify-content: start; width: 100%; color: var(--ink); background: white; border: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }
.project-list button[aria-current="true"] { background: var(--accent); border-color: var(--brand); box-shadow: inset 4px 0 var(--brand); }
.project-list .empty-list { color: var(--muted); }
.backup-box { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.backup-box h3, .backup-box p { margin-top: 0; }
.backup-box p { color: var(--muted); font-size: .9rem; }

.empty-state { padding: 70px 10px; text-align: center; }
.empty-state p { color: var(--muted); }
.project-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr); gap: 12px; }
.project-form .wide { grid-column: 1 / -1; }
label { display: block; color: var(--ink); font-weight: 700; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; color: var(--ink); background: white; border: 1px solid #889992; border-radius: 7px; }
textarea { min-height: 92px; resize: vertical; }

.count-badge { flex: none; padding: 5px 10px; color: var(--brand-dark); background: var(--accent); border-radius: 999px; font-size: .88rem; font-weight: 750; }
.item-list { display: grid; gap: 12px; }
.item-card { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(150px, .65fr) auto; gap: 10px; align-items: end; padding: 14px; background: #fafbf8; border: 1px solid var(--line); border-radius: 10px; }
.item-card .item-note { grid-column: 1 / 3; }
.item-card .remove-item { align-self: end; min-width: 44px; color: var(--danger); background: transparent; border: 1px solid #ddb8b5; }
.item-card .remove-item:hover { color: white; background: var(--danger); }
.add-item-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 14px; padding: 14px; background: var(--accent); border-radius: 10px; }

.request-box { margin-top: 32px; padding: 20px; background: #edf5f1; border: 1px solid #bcd6cd; border-radius: 12px; }
#request-output { min-height: 300px; background: white; }
.delivery-note { margin-bottom: 0; color: var(--muted); }
.danger-zone { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); text-align: right; }
.danger { color: var(--danger); background: white; border: 1px solid #d8a6a2; }
.danger:hover { color: white; background: var(--danger); }
footer { padding: 10px 24px 36px; color: var(--muted); text-align: center; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .hero-inner { padding: 34px 18px 30px; }
  .app-shell { grid-template-columns: 1fr; padding: 8px 12px 36px; }
  .projects-panel { position: static; }
  .panel { padding: 18px; }
  .project-form { grid-template-columns: 1fr; }
  .project-form .wide { grid-column: auto; }
  .item-card { grid-template-columns: 1fr; }
  .item-card .item-note { grid-column: auto; }
  .item-card .remove-item { width: 100%; }
  .add-item-form { grid-template-columns: 1fr; }
  .request-box .section-heading { display: grid; }
  .request-box .section-heading button { width: 100%; }
}

@media print {
  .hero, .projects-panel, .status, .alert, button, .add-item-form, .danger-zone, footer { display: none !important; }
  .app-shell { display: block; padding: 0; }
  .panel, .request-box { border: 0; box-shadow: none; }
}
