/* Saison. The Kitchen Garden Folio. */
@import url('/fonts/fonts.css');

:root {
  --paper: #FAF6EE;
  --ink: #26241F;
  --ink-soft: rgba(38, 36, 31, 0.62);
  --ink-faint: rgba(38, 36, 31, 0.14);
  --green: #3D6B35;
  --green-deep: #2E5227;
  --accent: #3D6B35;
  --accent-soft: rgba(61, 107, 53, 0.10);
  --danger: #A54832;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Karla', -apple-system, 'Helvetica Neue', sans-serif;
  --hairline: 1px solid var(--ink-faint);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
html[data-season='spring'] { --accent: #6E9B4F; --accent-soft: rgba(110, 155, 79, 0.12); }
html[data-season='summer'] { --accent: #C24A34; --accent-soft: rgba(194, 74, 52, 0.10); }
html[data-season='autumn'] { --accent: #B97F35; --accent-soft: rgba(185, 127, 53, 0.12); }
html[data-season='winter'] { --accent: #2E5940; --accent-soft: rgba(46, 89, 64, 0.10); }

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--sans); background: var(--paper); color: var(--ink);
  font-size: 16px; line-height: 1.45; overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 560; letter-spacing: -0.01em; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

/* Header */
header.top {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: calc(14px + var(--safe-t)) 20px 10px; border-bottom: var(--hairline);
}
.wordmark { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; }
.wordmark .dot { color: var(--accent); }
.state-pill {
  font-size: 0.8rem; letter-spacing: 0.06em; color: var(--ink-soft);
  border: var(--hairline); border-radius: 999px; padding: 4px 12px;
}

/* Main scroll area */
main { flex: 1; padding: 18px 20px 150px; }
.screen { display: none; }
.screen.active { display: block; }

/* Cards: hairline rule, no drop shadows */
.card {
  background: #fff; border: var(--hairline); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 12px;
}
.card.tappable:active { background: var(--accent-soft); }

/* Recipe cards */
.recipe-card { display: flex; gap: 14px; align-items: center; }
.recipe-card .meta { flex: 1; min-width: 0; }
.recipe-card h3 { font-size: 1.12rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recipe-card .sub { color: var(--ink-soft); font-size: 0.84rem; margin-top: 3px; }
#filter-pills {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
#filter-pills::-webkit-scrollbar { display: none; }
.fpill {
  flex: none; font-size: 0.8rem; letter-spacing: 0.05em; color: var(--ink-soft);
  border: var(--hairline); border-radius: 999px; padding: 6px 14px; background: transparent;
}
.fpill.active { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

.chip {
  display: inline-block; font-size: 0.72rem; letter-spacing: 0.05em;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; margin-left: 6px;
}
.week-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.week-chip { background: var(--green); color: #fff; margin-left: 0; flex: none; font-weight: 700; }
.btn.quiet.in-week { border-color: var(--green); color: var(--green); font-weight: 700; }
nav.tabs button { position: relative; }

/* Search */
.search { display: flex; margin-bottom: 14px; }
.search input {
  flex: 1; border: var(--hairline); border-radius: 999px; padding: 10px 18px;
  background: #fff; outline: none; font-size: 0.95rem;
}

/* Section titles */
.section-title { font-family: var(--serif); font-size: 1.35rem; margin: 6px 0 12px; }
.section-note { color: var(--ink-soft); font-size: 0.9rem; margin: -8px 0 14px; }

/* Empty states */
.empty { text-align: center; padding: 30px 24px 10px; }
.empty img { width: 200px; margin: 0 auto 6px; mix-blend-mode: multiply; }
.empty h3 { font-size: 1.3rem; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); font-size: 0.95rem; max-width: 300px; margin: 0 auto; }

/* Buttons */
.btn {
  display: block; width: 100%; text-align: center; font-weight: 700; font-size: 1rem;
  padding: 14px 18px; border-radius: 12px; border: 1px solid var(--green-deep);
  background: var(--green); color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn.quiet { background: #fff; color: var(--ink); border: var(--hairline); font-weight: 500; }
.btn.small { width: auto; display: inline-block; padding: 8px 16px; font-size: 0.88rem; }
.btn[disabled] { opacity: 0.45; }
.linkline { color: var(--green); font-size: 0.9rem; text-decoration: underline; background: none; }

/* Capture bar above tabs */
.capture-bar {
  position: fixed; left: 0; right: 0; bottom: calc(64px + var(--safe-b));
  display: flex; gap: 8px; justify-content: center; padding: 10px 16px;
  pointer-events: none;
}
.capture-bar > * { pointer-events: auto; }
.capture-main {
  background: var(--green); border: 1px solid var(--green-deep); color: #fff; font-weight: 700;
  border-radius: 999px; padding: 12px 22px; font-size: 0.95rem;
}
.capture-side { background: #fff; border: var(--hairline); border-radius: 999px; padding: 12px 16px; font-size: 0.9rem; }

/* Tabs */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper);
  border-top: var(--hairline); display: flex; padding-bottom: var(--safe-b);
  max-width: 560px; margin: 0 auto;
}
nav.tabs button { flex: 1; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--ink-soft); font-size: 0.72rem; letter-spacing: 0.04em; }
nav.tabs button.active { color: var(--green); }
nav.tabs button.active .glyphline { stroke: var(--green); }
nav.tabs svg { width: 24px; height: 24px; }
.glyphline { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
nav.tabs .badge { position: absolute; top: 4px; left: calc(50% + 8px); background: var(--green); color: #fff; font-size: 0.64rem; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 3px; }

/* Sheets */
.sheet-back {
  position: fixed; inset: 0; background: rgba(38, 36, 31, 0.4); z-index: 40;
  display: none; align-items: flex-end;
}
.sheet-back.open { display: flex; }
.sheet {
  background: var(--paper); width: 100%; max-width: 560px; margin: 0 auto;
  border-radius: 20px 20px 0 0; max-height: 92vh; overflow-y: auto;
  padding: 10px 20px calc(26px + var(--safe-b));
}
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--ink-faint); margin: 4px auto 10px; }
.back-pill {
  display: inline-block; font-size: 0.9rem; font-weight: 700; color: var(--ink);
  border: var(--hairline); background: #fff; border-radius: 999px; padding: 8px 18px; margin-bottom: 12px;
}
.peak-strip { font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 0.95rem; margin: 0 2px 14px; }
.weeknote { color: var(--accent); font-size: 0.86rem; font-style: italic; margin-top: 4px; }
.thisweek { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; margin-top: 16px; }
.thisweek h3 { font-size: 1.05rem; }
.thisweek .tw-sub { color: var(--ink-soft); font-size: 0.82rem; margin: 2px 0 6px; }
.cm-step.saison { font-style: italic; color: var(--accent); }
.cm-step.saison .tick { border-color: var(--accent); border-style: dashed; }

/* Recipe detail */
.detail-photo { width: 100%; max-height: 210px; object-fit: cover; border-radius: 12px; border: var(--hairline); margin-bottom: 12px; }
.detail-band { display: block; width: 100%; height: 88px; object-fit: cover; object-position: center 70%; border-radius: 12px; border: var(--hairline); background: var(--accent-soft); margin-bottom: 12px; }
.detail h2 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 4px; }
.detail .sub { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 14px; }
.ing-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: var(--hairline); }
.ing-row .qty { color: var(--green); font-weight: 700; white-space: nowrap; }
.ing-row .name { flex: 1; }
.ing-row .note { color: var(--ink-soft); font-style: italic; font-size: 0.85rem; }
.ing-row .edit { color: var(--ink-soft); font-size: 0.82rem; padding: 4px 8px; }
.ing-row.low { background: var(--accent-soft); border-radius: 8px; padding-left: 8px; padding-right: 8px; }
.ing-edit { display: flex; gap: 8px; flex: 1; }
.ing-edit input { flex: 1; border: var(--hairline); border-radius: 8px; padding: 6px 10px; background: #fff; min-width: 0; }
.method-steps { counter-reset: step; margin-top: 8px; }
.method-step { display: flex; gap: 12px; padding: 10px 0; border-bottom: var(--hairline); }
.method-step::before {
  counter-increment: step; content: counter(step);
  font-family: var(--serif); font-weight: 600; color: var(--accent); min-width: 22px; font-size: 1.05rem;
}
.method-step.illegible { color: var(--ink-soft); font-style: italic; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0 6px; }

/* Cook mode */
#cookmode { position: fixed; inset: 0; background: var(--paper); z-index: 60; display: none; flex-direction: column; }
#cookmode.open { display: flex; }
#cookmode .cm-head { padding: calc(14px + var(--safe-t)) 20px 10px; display: flex; justify-content: space-between; align-items: center; border-bottom: var(--hairline); }
#cookmode .cm-progress { height: 4px; background: var(--ink-faint); }
#cookmode .cm-progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.3s; }
#cookmode .cm-body { flex: 1; overflow-y: auto; padding: 16px 20px calc(30px + var(--safe-b)); max-width: 560px; margin: 0 auto; width: 100%; }
.cm-step { display: flex; gap: 12px; padding: 14px 0; border-bottom: var(--hairline); font-size: 1.08rem; }
.cm-step .tick { width: 26px; height: 26px; border: 1.4px solid var(--ink-soft); border-radius: 8px; flex: none; margin-top: 2px; }
.cm-step.done { color: var(--ink-soft); }
.cm-step.done .tick { background: var(--green); border-color: var(--green-deep); }
.cm-step.done .txt { text-decoration: line-through; text-decoration-thickness: 1px; }

/* THE LIST: utilitarian, big, high contrast */
#screen-list .aisle h2 {
  font-size: 1.02rem; font-weight: 700; font-family: var(--sans); letter-spacing: 0.02em;
  border-bottom: 2px solid var(--ink); padding-bottom: 5px; margin: 20px 0 2px;
}
.list-item { display: flex; align-items: center; gap: 12px; padding: 13px 2px; border-bottom: var(--hairline); font-size: 1.12rem; }
.list-item .box { width: 26px; height: 26px; border: 1.6px solid var(--ink); border-radius: 7px; flex: none; }
.list-item.done { color: var(--ink-soft); }
.list-item.done .box { background: var(--green); border-color: var(--green-deep); }
.list-item.done .nm { text-decoration: line-through; text-decoration-thickness: 1px; }
.list-item .nm { flex: 1; }
.list-item .q { font-weight: 700; white-space: nowrap; }
.list-item .snote { display: block; font-size: 0.78rem; color: var(--accent); font-weight: 500; }
.list-progress { position: sticky; top: 0; background: var(--paper); padding: 8px 0; z-index: 5; }
.list-progress .bar { height: 6px; background: var(--ink-faint); border-radius: 3px; }
.list-progress .bar i { display: block; height: 100%; background: var(--green); border-radius: 3px; width: 0; transition: width 0.2s; }
.list-progress .lbl { font-size: 0.8rem; color: var(--ink-soft); margin-top: 4px; }

/* Tips + greens */
.tips { background: var(--accent-soft); border: none; }
.tips h3 { font-size: 1.05rem; margin-bottom: 8px; }
.tips p { font-size: 0.93rem; margin-bottom: 8px; }
.greens-item { padding: 10px 0; border-bottom: var(--hairline); }
.greens-item .g-head { font-weight: 700; }
.greens-item .g-how { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; }
.greens-item .g-recipe { color: var(--accent); font-size: 0.8rem; letter-spacing: 0.03em; }
.greens-item .add { float: right; }

/* Week */
.week-row { display: flex; align-items: center; gap: 12px; }
.week-row .rm { color: var(--danger); font-size: 0.85rem; padding: 6px 8px; }

/* Splash + onboarding */
#splash { position: fixed; inset: 0; z-index: 100; background: var(--paper); display: none; flex-direction: column; align-items: center; justify-content: center; text-align: center; opacity: 1; transition: opacity 0.6s ease; }
#splash.intro .enter { display: none; }
#splash.intro .lockup { animation: settle 1s ease both; }
@keyframes settle { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#splash.fade { opacity: 0; pointer-events: none; }
#splash.open { display: flex; }
#splash .art { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; opacity: 0.94; }
#splash .film { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.7s ease; pointer-events: none; }
#splash.film-on .film { opacity: 1; }
#splash .lockup, #splash .enter { transition: opacity 0.7s ease; }
#splash.film-on .lockup, #splash.film-on .enter { opacity: 0; visibility: hidden; }
#splash.film-on .enter { animation: none; }
#splash .lockup { position: relative; padding: 30px 34px; }
#splash .lockup h1 { font-size: 3.4rem; font-weight: 600; }
#splash .lockup p { font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); margin-top: 4px; text-align: center; line-height: 1.35; }
#splash .enter { position: relative; margin-top: 26px; animation: pulse 2.4s infinite; font-size: 0.95rem; color: var(--ink); border: var(--hairline); background: rgba(250, 246, 238, 0.85); border-radius: 999px; padding: 12px 26px; }
@keyframes pulse { 50% { opacity: 0.55; } }
#onboard { position: fixed; inset: 0; z-index: 90; background: var(--paper); display: none; flex-direction: column; }
#onboard.open { display: flex; }
#onboard .slides { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
#onboard .slide { min-width: 100%; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 34px; }
#onboard .slide h2 { font-size: 1.9rem; margin-bottom: 10px; }
#onboard .slide p { color: var(--ink-soft); max-width: 300px; }
#onboard .slide img { width: 190px; margin-bottom: 18px; mix-blend-mode: multiply; }
#onboard .foot { padding: 0 34px calc(30px + var(--safe-b)); }
.dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 16px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); }
.dots i.on { background: var(--accent); }
.state-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.state-grid button { border: var(--hairline); background: #fff; border-radius: 10px; padding: 12px 0; font-weight: 700; }
.state-grid button.on { background: var(--green); color: #fff; border-color: var(--green-deep); }

/* Install card */
.install-entry { text-align: center; margin: 26px 0 4px; }
.install-icon { width: 58px; height: 58px; border-radius: 14px; border: var(--hairline); margin: 0 auto 10px; }
.install-steps { margin: 12px 0 4px 20px; }
.install-steps li { padding: 5px 0; }
.install-alt { color: var(--ink-soft); font-size: 0.86rem; margin: 8px 0 16px; }

/* Toast */
#toast { position: fixed; top: calc(12px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); border-radius: 16px; padding: 10px 18px; font-size: 0.9rem; line-height: 1.35; z-index: 120; display: none; max-width: min(88vw, 420px); text-align: center; }
.pair-line { font-family: var(--serif, Georgia, serif); font-size: 1.12rem; line-height: 1.45; font-style: italic; color: var(--ink); margin: 0 0 14px; }
.pair-card { background: var(--accent-soft); border-color: transparent; }
.pair-card .pair-line { margin: 0; }

/* Busy overlay */
#busy { position: fixed; inset: 0; z-index: 80; background: rgba(250, 246, 238, 0.9); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 0 40px; }
#busy.open { display: flex; }
#busy .leaf { width: 44px; height: 44px; border: 2px solid var(--accent); border-radius: 50% 0; animation: turn 1.6s ease-in-out infinite; }
@keyframes turn { 50% { transform: rotate(180deg); border-radius: 0 50%; } }
#busy p { font-family: var(--serif); font-style: italic; color: var(--ink-soft); }

/* Scan-time suggestions on the recipe sheet */
.sug-card { background: var(--accent-soft); border: none; margin-top: 14px; }
.sug { padding: 10px 0; border-bottom: var(--hairline); }
.sug:last-child { border-bottom: none; padding-bottom: 2px; }
.sug .g-head { font-weight: 700; padding-right: 90px; }
.sug .g-how { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; padding-right: 90px; }
.sug-add {
  float: right; font-size: 0.85rem; font-weight: 700; min-width: 82px; text-align: center;
  border: var(--hairline); border-radius: 999px; padding: 7px 14px; background: #fff; color: var(--ink);
}
.sug-add.on { background: var(--green); border-color: var(--green-deep); color: #fff; }
.sug-add[disabled] { opacity: 0.5; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 0; }
.two-up .btn { padding: 14px 8px; font-size: 0.86rem; letter-spacing: -0.005em; }

/* Accept or decline on the shopping list */
/* The container floats, not the button inside it, or .add and .no share a line reversed. */
.sug-btns { float: right; text-align: right; margin-left: 12px; }
.sug-btns .add { float: none; min-width: 78px; }
.sug-btns .no { display: block; margin-top: 6px; font-size: 0.82rem; }
.greens-item .g-head, .greens-item .g-how, .greens-item .g-recipe { padding-right: 96px; }

/* Cook mode: cooked is a deliberate tap, never a side effect of opening */
.cm-done { margin: 22px 0 40px; }

/* Bulk scan progress and the offline copy note */
.busy-log { margin-top: 10px; max-height: 34vh; overflow-y: auto; text-align: left; }
.busy-log p { font-size: 0.86rem; color: var(--ink-soft); padding: 2px 0; }
.busy-log p.ok::before { content: '+ '; color: var(--green); }
.busy-log p.miss::before { content: '- '; }
.offline-note { color: var(--ink-soft); font-size: 0.84rem; font-style: italic; margin: -4px 0 12px; }
.week-reset-line { text-align: center; margin-top: 16px; }

/* Paste a link sheet */
/* Account, and what Plus adds */
.top-right { display: flex; align-items: center; gap: 8px; }
#account-pill { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-field {
  display: block; width: 100%; border: var(--hairline); border-radius: 999px;
  padding: 11px 18px; background: #fff; outline: none; font-size: 0.95rem; margin-top: 10px;
}
.acc-field:focus { border-color: var(--accent); }
.acc-legal { margin-top: 14px; text-align: center; }
.acc-danger { color: var(--danger); }
.acc-delete-btn { background: var(--danger); }
.plus-list { list-style: none; padding: 0; margin: 0 0 18px; }
.plus-list li { padding: 9px 0 9px 22px; border-bottom: var(--hairline); position: relative; font-size: 0.98rem; }
.plus-list li:last-child { border-bottom: none; }
.plus-list li::before { content: ''; position: absolute; left: 2px; top: 17px; width: 8px; height: 8px; border-radius: 50% 0; background: var(--accent); }

.url-row { display: flex; gap: 8px; align-items: center; }
.url-row input {
  flex: 1; min-width: 0; border: var(--hairline); border-radius: 999px;
  padding: 11px 18px; background: #fff; outline: none; font-size: 0.95rem;
}
.url-row input:focus { border-color: var(--accent); }
