/* My Garden — warm botanical UI, mobile-first */
:root {
  --canvas: #FAF9F6;
  --card: #FFFFFF;
  --sage: #2E5A44;
  --sage-dark: #23473A;
  --sage-soft: #E6EEE9;
  --terracotta: #C86D51;
  --terracotta-soft: #F8E9E3;
  --amber: #D97706;
  --amber-soft: #FDF1DC;
  --amber-text: #92500A;
  --blue-soft: #E4EEF4;
  --blue-text: #2F5A73;
  --ink: #26302B;
  --muted: #6A746E;
  --line: #E7E3DA;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(38, 48, 43, .05), 0 6px 18px rgba(38, 48, 43, .06);
  --tabbar-h: 62px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 16px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(46, 90, 68, .45); outline-offset: 2px; }

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: rgba(250, 249, 246, .92);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 { font: 600 1.35rem/1.2 var(--serif); letter-spacing: -.01em; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: var(--muted);
}
.icon-btn:active { background: var(--sage-soft); color: var(--sage); }

/* ---------- Layout ---------- */
main {
  max-width: 640px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
  display: flex; flex-direction: column; gap: 14px;
  outline: none;
}
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid rgba(231, 227, 218, .7); padding: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card h2, .section-title { font: 600 1.08rem/1.25 var(--serif); }
.section-title { margin: 6px 2px -4px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ---------- Buttons ---------- */
.btn {
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 600; background: var(--sage); color: #fff; text-align: center;
  transition: transform .08s ease, background .15s ease;
}
.btn:active { transform: scale(.98); background: var(--sage-dark); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--sage-soft); color: var(--sage); }
.btn.ghost { background: transparent; color: var(--sage); border: 1.5px solid var(--sage-soft); }
.btn.accent { background: var(--terracotta); }
.btn.danger { background: transparent; color: #A63A2B; border: 1.5px solid #F0D5CF; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: .9rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link { color: var(--sage); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }

/* ---------- Forms ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 400; font-size: 16px;
  -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.500l5 5 5-5' fill='none' stroke='%236A746E' stroke-width='1.800' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.input:focus { border-color: var(--sage); outline: none; box-shadow: 0 0 0 3px rgba(46, 90, 68, .14); }
.inline-form { display: flex; gap: 8px; }
.inline-form .input { flex: 1; min-width: 0; }

.switch {
  flex: none; position: relative; width: 52px; height: 32px; border-radius: 999px;
  background: #D9D5CB; transition: background .18s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s ease;
}
.switch[aria-checked="true"] { background: var(--sage); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.toggle-row strong { display: block; font-weight: 600; }

.segmented { display: flex; background: #F1EEE7; border-radius: 999px; padding: 4px; gap: 4px; }
.segmented button {
  flex: 1; min-height: 40px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--muted); padding: 0 10px;
}
.segmented button[aria-pressed="true"] { background: #fff; color: var(--sage); box-shadow: 0 1px 3px rgba(38, 48, 43, .14); }

.stepper { display: inline-flex; align-items: center; gap: 4px; background: #F1EEE7; border-radius: 999px; padding: 3px; }
.stepper button { width: 40px; height: 40px; border-radius: 50%; background: #fff; font-size: 1.25rem; font-weight: 600; color: var(--sage); }
.stepper output { min-width: 34px; text-align: center; font-weight: 700; }

/* ---------- Chips & pills ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  background: #fff; border: 1.5px solid var(--line); color: var(--muted); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--sage); border-color: var(--sage); color: #fff; }
.chip.accent[aria-pressed="true"] { background: var(--terracotta); border-color: var(--terracotta); }
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; letter-spacing: .01em; background: #F1EEE7; color: var(--muted); white-space: nowrap;
}
.pill.sage { background: var(--sage-soft); color: var(--sage); }
.pill.terracotta { background: var(--terracotta-soft); color: #9C4A31; }
.pill.amber { background: var(--amber-soft); color: var(--amber-text); }
.pill.blue { background: var(--blue-soft); color: var(--blue-text); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Banners ---------- */
.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid transparent; }
.banner-icon { font-size: 1.4rem; line-height: 1.2; }
.banner h3 { font-size: .98rem; font-weight: 700; margin-bottom: 2px; }
.banner p { font-size: .9rem; }
.banner p + p { margin-top: 4px; }
.banner.frost, .banner.wait, .banner.warn { background: var(--amber-soft); border-color: #F3D9A8; color: #6B3D08; }
.banner.frost h3, .banner.wait h3, .banner.warn h3 { color: var(--amber-text); }
.banner.water { background: var(--blue-soft); border-color: #C9DDE8; color: #24495E; }
.banner.ready, .banner.good { background: var(--sage-soft); border-color: #CADBD1; color: var(--sage-dark); }
.banner.info { background: #F1EEE7; border-color: var(--line); color: var(--muted); }
.banner.tip { background: var(--terracotta-soft); border-color: #EFD2C6; color: #7C3A25; }
.banner .btn { margin-top: 10px; }

/* ---------- Rain washout on feeding days ---------- */
.banner.washout .small { opacity: .85; }
.banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.banner.washout .btn.ghost { border-color: #E5C891; color: var(--amber-text); }
.task-wx { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.task-wx .pill { white-space: normal; }
.pill.washout { background: var(--amber-soft); color: var(--amber-text); border: 1px solid #F3D9A8; }
.pill.washout.moderate { background: var(--blue-soft); color: var(--blue-text); border-color: #C9DDE8; }
.pill.water-in { background: linear-gradient(90deg, var(--sage-soft), var(--blue-soft)); color: var(--blue-text); }

/* ---------- Dormant spray windows ---------- */
.banner.spray { border-color: #A9C7B6; border-left: 4px solid var(--sage); box-shadow: var(--shadow); }
.banner.spray h3 { color: var(--sage); font-size: 1.02rem; }
.banner.spray .small { opacity: .9; }
.banner.spray .spray-caution { color: var(--amber-text); font-weight: 600; opacity: 1; }
.banner.spray .btn.ghost { border-color: #B7CEC1; color: var(--sage); }
.pill.spray-ok { background: var(--sage-soft); color: var(--sage); border: 1px solid #CADBD1; }
.pill.spray-warn { background: var(--amber-soft); color: var(--amber-text); border: 1px solid #F3D9A8; }
.spray-hold { margin: 2px 0 10px; }
.pill.spray-hold-pill { white-space: normal; font-weight: 600; border: 1px solid var(--line); line-height: 1.35; padding: 5px 12px; }
.task-moved { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.task-moved .link { min-height: 44px; }

/* ---------- Today ---------- */
.hero { display: flex; flex-direction: column; gap: 8px; }
.hero-loc { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hero-loc strong { font: 600 1.15rem/1.2 var(--serif); }
.now { display: flex; align-items: center; gap: 14px; }
.now-icon { font-size: 2.6rem; line-height: 1; }
.now-temp { font: 600 2.9rem/1 var(--serif); letter-spacing: -.02em; }
.now-temp sup { font-size: 1.2rem; vertical-align: top; position: relative; top: .3em; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--canvas); border-radius: var(--radius-sm); padding: 12px; border: 1px solid var(--line); }
.stat .k { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .v { font: 600 1.6rem/1.15 var(--serif); margin-top: 2px; }
.stat .n { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat.bed { background: #F1F6F3; border-color: #D8E6DE; }
.stat.pot { background: #FCF3EF; border-color: #F1DCD3; }
.forecast { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; }
.forecast::-webkit-scrollbar { display: none; }
.fday {
  flex: none; width: 62px; padding: 10px 4px; border-radius: 14px; background: var(--canvas); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .82rem;
}
.fday .d { font-weight: 700; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.fday .i { font-size: 1.35rem; line-height: 1.2; }
.fday .hi { font-weight: 700; }
.fday .lo { color: var(--muted); }
.fday.frosty { background: var(--amber-soft); border-color: #F3D9A8; }
.fday.frosty .lo { color: var(--amber-text); font-weight: 700; }
.fday .pop { font-size: .7rem; color: var(--blue-text); min-height: 1em; }

/* ---------- Tasks ---------- */
.tasks { display: flex; flex-direction: column; }
.task { display: flex; align-items: flex-start; gap: 6px; padding: 8px 0; }
.task + .task { border-top: 1px solid var(--line); }
.check { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.check::before {
  content: ""; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #C9C4B8; background: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.check[aria-checked="true"]::before {
  border-color: var(--sage);
  background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.500l4 4 8-9' fill='none' stroke='%23fff' stroke-width='2.800' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/18px no-repeat;
}
.task-body { flex: 1; min-width: 0; padding: 9px 0 6px; }
.task-body[data-action] { cursor: pointer; }
.task-title { font-weight: 600; line-height: 1.3; }
.task-meta { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.task-notes { font-size: .86rem; color: var(--muted); margin-top: 4px; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.task.done .task-notes { display: none; }
.overdue { color: #A63A2B; font-weight: 700; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); }
.empty .big { font-size: 2.2rem; display: block; margin-bottom: 6px; }

/* ---------- Garden spaces ---------- */
.space-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.space-head h2 { font-size: 1.15rem; }
.crop-row {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 0; text-align: left;
  border-top: 1px solid var(--line);
}
.crop-emoji {
  flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--canvas); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}
.crop-row .name { font-weight: 600; line-height: 1.25; }
.crop-row .sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.chev { flex: none; color: #B9B4A8; font-size: 1.3rem; }
.flag { flex: none; font-size: 1.05rem; }

/* ---------- Library ---------- */
.search { position: relative; }
.search .input { padding-left: 42px; border-radius: 999px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.plant-list { display: flex; flex-direction: column; gap: 10px; }
.plant-card {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid rgba(231, 227, 218, .7);
}
.plant-card .name { font-weight: 600; }
.plant-card .pills { margin-top: 5px; }

/* ---------- Calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h2 { font-size: 1.2rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell {
  min-height: 48px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.cal-num { font-size: .95rem; font-weight: 500; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.today .cal-num { color: var(--terracotta); font-weight: 800; }
.cal-cell.selected { background: var(--sage-soft); }
.cal-cell.selected .cal-num { background: var(--sage); color: #fff; font-weight: 700; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.legend li { display: flex; align-items: center; }

/* ---------- Timeline ---------- */
.timeline { position: relative; }
.tl-item { position: relative; display: flex; gap: 4px; padding: 0 0 14px 0; }
.tl-item::before { content: ""; position: absolute; left: 21px; top: 36px; bottom: -8px; width: 2px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-item .check { position: relative; z-index: 1; }
.tl-body { flex: 1; min-width: 0; padding-top: 9px; }
.tl-date { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.tl-title { font-weight: 600; margin-top: 1px; }
.tl-notes { font-size: .86rem; color: var(--muted); margin-top: 3px; }
.tl-item.done .tl-title { text-decoration: line-through; color: var(--muted); }

/* ---------- Detail blocks ---------- */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.fact .k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fact .v { font-weight: 600; margin-top: 2px; }
.rel { display: flex; gap: 10px; padding: 10px 0; }
.rel + .rel { border-top: 1px solid var(--line); }
.rel .name { font-weight: 600; }
.rel .why { font-size: .86rem; color: var(--muted); }
details.fold { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
details.fold + details.fold { margin-top: 8px; }
details.fold summary {
  min-height: 48px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; cursor: pointer; list-style: none;
}
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::after { content: "＋"; color: var(--muted); }
details.fold[open] summary::after { content: "－"; }
details.fold .fold-body { padding: 0 14px 12px; }
.feed { padding: 10px 0; }
.feed + .feed { border-top: 1px solid var(--line); }
.feed .when { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--terracotta); }
.feed .what { font-weight: 600; margin-top: 2px; }
.feed .how { font-size: .86rem; color: var(--muted); margin-top: 2px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 4px 2px calc(env(safe-area-inset-bottom) + 4px);
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab {
  min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: #8A938D; font-size: .7rem; font-weight: 600; border-radius: 14px;
}
.tab svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--sage); }
.tab[aria-current="page"] svg { stroke-width: 2.1; }

/* ---------- Bottom sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(30, 38, 34, .45); animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0 auto; max-width: 640px;
  max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--canvas); border-radius: 24px 24px 0 0; box-shadow: 0 -10px 40px rgba(0, 0, 0, .18);
  animation: rise .26s cubic-bezier(.2, .8, .2, 1);
}
.sheet-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 8px 8px 20px; border-bottom: 1px solid var(--line);
}
.sheet-head h2 { font: 600 1.2rem/1.25 var(--serif); }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px calc(env(safe-area-inset-bottom) + 24px); display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { flex: none; padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px); border-top: 1px solid var(--line); background: var(--canvas); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.plant-hero { display: flex; align-items: center; gap: 14px; }
.plant-hero .crop-emoji { width: 60px; height: 60px; font-size: 2.1rem; border-radius: 18px; background: #fff; }
.label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px); transform: translateX(-50%);
  z-index: 60; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: .92rem; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  animation: rise .2s ease;
}
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.500px solid var(--sage-soft); border-top-color: var(--sage); animation: spin .8s linear infinite; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.toast { animation-name: toast-in; }
@keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) {
  .sheet { bottom: 24px; border-radius: 24px; max-height: 86vh; }
}

/* ---------- My Garden: sort, reorder & established plants ---------- */
.garden-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sort-pill {
  display: inline-flex; align-items: center; min-width: 0; min-height: 44px; padding-left: 14px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line); color: var(--muted); font-weight: 600; font-size: .92rem;
}
.sort-pill select {
  min-width: 0; min-height: 41px; border: 0; background-color: transparent; color: var(--sage); font-weight: 700; font-size: 16px;
  padding: 0 30px 0 8px; border-radius: 999px; text-overflow: ellipsis; -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.500l5 5 5-5' fill='none' stroke='%232E5A44' stroke-width='1.800' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.space-list { display: flex; flex-direction: column; gap: 14px; }
.space-list.reordering { gap: 8px; }
.space-head .move-btn { margin-top: -4px; }
.space-head .link { margin-top: -8px; padding-left: 4px; }
.move-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--sage-soft); color: var(--sage);
  font-size: 1.2rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.move-btn:active { background: var(--sage); color: #fff; }
.move-btn[disabled] { opacity: .35; pointer-events: none; }
.reorder-row { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 4px; -webkit-user-select: none; user-select: none; }
.reorder-row h2 { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drag-handle {
  flex: none; width: 44px; height: 52px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: #B9B4A8; cursor: grab; touch-action: none; -webkit-touch-callout: none;
}
.space-card.dragging { border-color: var(--sage); box-shadow: 0 10px 28px rgba(38, 48, 43, .2); transform: scale(1.02); position: relative; z-index: 2; }
.space-card.dragging .drag-handle { color: var(--sage); cursor: grabbing; }
body.dragging-space { -webkit-user-select: none; user-select: none; overscroll-behavior: contain; }
.segmented.wrap { flex-wrap: wrap; border-radius: 24px; }
.segmented.wrap button { flex: 1 1 40%; }
.pill.in-garden { margin-left: 4px; vertical-align: 1px; font-size: .7rem; padding: 2px 8px; }
.rel.mine .name { color: var(--sage-dark); }
.care-row { display: flex; align-items: flex-start; gap: 4px; padding: 8px 0; }
.care-row + .care-row { border-top: 1px solid var(--line); }
.care-row .dot { margin-top: 6px; flex: none; }

/* ---------- Activity filter bar ---------- */
.card > .chips { margin: 0 -16px 6px; }
.chip .count {
  margin-left: 6px; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #F1EEE7; color: var(--muted);
  font-size: .72rem; font-weight: 700; text-align: center; display: inline-block;
}
.chip[aria-pressed="true"] .count { background: rgba(255, 255, 255, .22); color: #fff; }
.chip .dot { margin-right: 6px; }
.chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
.chip.good { color: var(--sage); border-color: #CADBD1; }

/* ---------- Seasons ---------- */
.pill.season { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.season-cards { display: flex; flex-direction: column; gap: 10px; }
.season-card { border-left: 4px solid var(--sage); }
.season-card.fall { border-left-color: #4A7A96; }
.season-card.fall.off { border-left-color: var(--amber); background: #FFFDF8; }
.season-card .card-head { margin-bottom: 6px; flex-wrap: wrap; }
.season-row { padding: 7px 0; border-top: 1px solid var(--line); }
.season-note { margin-top: 8px; }

/* ---------- Crop picker compatibility ---------- */
.compat-badge {
  display: block; margin-top: 6px; padding: 5px 10px; border-radius: 10px; font-size: .78rem; font-weight: 700; line-height: 1.3;
}
.compat-badge.good { background: var(--sage-soft); color: var(--sage-dark); }
.compat-badge.bad { background: var(--amber-soft); color: var(--amber-text); border: 1px solid #F3D9A8; }
.compat-badge.shade { background: #F1EEE7; color: var(--muted); font-weight: 500; }
.compat-badge.rotate { background: var(--amber-soft); color: var(--amber-text); font-weight: 600; }
.compat-badge.rotation { background: #DFF0EB; color: #1F5E55; }
.pick-divider.rotate { color: var(--amber-text); margin-top: 14px; }
.pick-divider.rotate::after { background: #F3D9A8; }

/* ---------- Crop rotation memory ---------- */
.banner.rotation-good { background: #DFF0EB; border-color: #BFDDD5; color: #1F5E55; }
.banner.rotation-notice p + p { margin-top: 6px; }
.hist-year {
  font-size: .78rem; font-weight: 700; letter-spacing: .05em; color: var(--sage-dark);
  padding: 8px 0 2px; border-bottom: 1px solid var(--line);
}
.hist-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; min-height: 48px; }
.hist-row + .hist-row { border-top: 1px solid var(--line); }
.hist-emoji { font-size: 1.3rem; width: 28px; text-align: center; flex: none; }
.hist-form { padding-top: 12px; border-top: 1px dashed var(--line); }
.hist-form .field { min-width: 0; }
.hist-form select { min-width: 0; width: 100%; }
.archive-box { display: flex; flex-direction: column; gap: 6px; }
.archive-box p { text-align: center; padding: 0 8px; }
.plant-card.muted-card { background: #F6F3EC; box-shadow: none; }
.plant-card.muted-card .crop-emoji, .plant-card.muted-card .name, .plant-card.muted-card .pills { opacity: .6; }
.pick-divider {
  display: flex; align-items: center; gap: 10px; margin: 6px 2px 0;
  font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.pick-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pick-divider.good { color: var(--sage); }
.pick-divider.bad { color: #9C4A31; margin-top: 14px; }
.pick-divider.bad::after { background: #EFD2C6; }

/* ---------- Fertilizer plan ---------- */
.fert-entry { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-left: 4px solid var(--terracotta); }
.fert-entry .name { display: block; font: 600 1.05rem/1.25 var(--serif); }
.fert-entry .sub { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.pill.fert-summary { font-size: .84rem; padding-top: 6px; padding-bottom: 6px; white-space: normal; }
.fert-card { display: flex; flex-direction: column; gap: 12px; }
.fert-card h2 .pill { vertical-align: 2px; margin-left: 2px; }
.fert-card.covered { background: #FBFCFA; }
.fert-need { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.fert-need .k { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fert-need .v { font: 600 1.12rem/1.3 var(--serif); margin-top: 2px; }
.fert-need .arrow { color: var(--terracotta); margin: 0 2px; }
.fert-hand { display: flex; align-items: center; gap: 6px; margin-left: -8px; }
.fert-qty { display: inline-flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); flex: none; }
.fert-qty .input { width: 84px; text-align: right; }
.fert-buy { padding: 10px 12px; border-radius: var(--radius-sm); font-size: .92rem; }
.fert-buy.need { background: var(--terracotta-soft); color: #7C3A25; }
.fert-buy.ok { background: var(--sage-soft); color: var(--sage-dark); font-weight: 600; }
.feed .how.rate { color: var(--sage-dark); }
.chips { flex-shrink: 0; }

/* ---------- Fertilizer: shelf inventory, ledger & task "grab" line ---------- */
.task-grab {
  margin-top: 6px; padding: 6px 10px; border-radius: 10px; background: var(--sage-soft); color: var(--sage-dark);
  font-size: .84rem; font-weight: 600; line-height: 1.35;
}
.fert-target .k, .fert-buy .k { display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.fert-target .v { font-weight: 700; color: var(--sage-dark); }
.fert-ledger { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 12px; font-size: .9rem; }
.fert-ledger .row { padding: 8px 0; align-items: flex-start; }
.fert-ledger .row + .row { border-top: 1px solid var(--line); }
.fert-ledger .row > span:first-child { color: var(--muted); flex: none; max-width: 42%; }
.fert-ledger .row > strong, .fert-ledger .row > span:last-child { text-align: right; }
.fert-ledger .cover strong { color: var(--sage); }
.fert-ledger .hint { padding: 8px 0; border-top: 1px solid var(--line); color: var(--amber-text); }
.fert-buy .arrow { color: var(--terracotta); margin: 0 2px; }
details.fold.shelf { background: #fff; }
.shelf-group + .shelf-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.shelf-group .label { margin-bottom: 2px; color: var(--sage-dark); }
.shelf-item { padding: 12px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.shelf-item + .shelf-item { border-top: 1px dashed var(--line); }
.shelf-item .name { font-weight: 700; }
.shelf-item .name .pill { margin-left: 4px; vertical-align: 1px; }
.shelf-item.out .name, .shelf-item.out .shelf-tag { opacity: .55; text-decoration: line-through; }
.shelf-tag { padding: 4px 10px; border-radius: 10px; font-size: .76rem; font-weight: 700; line-height: 1.3; background: var(--sage-soft); color: var(--sage-dark); }
.shelf-tag.addon { background: var(--blue-soft); color: var(--blue-text); }
.shelf-tag.amend { background: var(--amber-soft); color: var(--amber-text); }
.shelf-tag.custom { background: #F1EEE7; color: var(--muted); }
.shelf-warn { padding: 8px 10px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #F3D9A8; color: #6B3D08; font-size: .84rem; }
.shelf-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.shelf-controls .fert-qty select.input { width: auto; padding-right: 8px; }
.shelf-item .status { color: var(--sage-dark); font-weight: 600; }
.shelf-draft { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.shelf-controls .fert-qty select.input { width: 96px; padding: 10px 30px 10px 12px; text-align: left; }
details.fold.shelf > summary { padding-top: 10px; padding-bottom: 10px; gap: 10px; }

/* ---------- Fertilizer: formulation selector ---------- */
.fert-forms button { flex: 1 1 44%; min-height: 44px; padding: 6px 8px; font-size: .84rem; line-height: 1.2; }
.fert-target { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.fert-target .rate-line { color: var(--ink, inherit); }
.fert-target .cover-note { color: var(--sage-dark); font-weight: 600; }
.fert-target .btn { margin-top: 6px; }
.fert-estab { background: var(--sage-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.fert-estab strong { font-size: .92rem; }
.fert-estab .small { display: block; margin-top: 2px; }

/* ---------- Crop rows: quantity steppers & capacity ---------- */
div.crop-row { gap: 8px; }
.crop-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; min-height: 44px; text-align: left; }
.qty-step { flex: none; gap: 2px; padding: 2px; }
.qty-step button { width: 40px; height: 44px; border-radius: 22px; font-size: 1.15rem; }
.qty-step output { min-width: 30px; font-size: .88rem; white-space: nowrap; }
.crop-main .flag { font-size: .9rem; }
.qty-step.big .input { width: 64px; text-align: center; padding-left: 6px; padding-right: 6px; font-weight: 700; }
.pill.cap { font-weight: 700; }
.feed-group + .feed-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.feed-group .label { color: var(--sage-dark); margin-bottom: 2px; }

/* Toast action, shelf removal, application-rate badge, per-product mixing list */
.toast { display: flex; align-items: center; gap: 12px; width: max-content; }
.toast[hidden] { display: none; }
.toast-action { min-height: 44px; margin: -12px -10px -12px 0; padding: 0 12px; color: #F3C9B8; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .85rem; }
.link.danger-link { color: var(--terracotta); margin-left: auto; }
.rate-badge { margin-left: 4px; vertical-align: 1px; white-space: normal; }
.shelf-apprate { width: 100%; }
.shelf-uses { width: 100%; }
.pick-cats { margin-top: 10px; }

/* ---------- Bed succession timeline & open-space readout ---------- */
.pill.cap.opens { background: var(--terracotta-soft); color: #9C4A31; }
.pill.fit { background: var(--sage-soft); color: var(--sage); }
.compat-badge.fit { background: var(--terracotta-soft); color: #9C4A31; }
.compat-badge.nofit { background: #F1EEE7; color: var(--muted); font-weight: 600; }
.bed-timeline { display: block; width: 100%; margin-top: 12px; padding: 4px 0 2px; text-align: left; min-height: 44px; }
.bed-timeline > span { display: block; }
.tl-top { position: relative; height: 16px; }
.tl-frost { position: absolute; bottom: 2px; padding: 0 4px; font-size: .68rem; font-weight: 700; color: var(--blue-text); white-space: nowrap; }
.tl-bar { position: relative; height: 38px; border-radius: 10px; overflow: hidden; background: #F1EEE7; border: 1px solid var(--line); }
.tl-bar svg { display: block; width: 100%; height: 100%; }
.tl-capline { stroke: var(--amber); stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.tl-tick, .tl-today { position: absolute; top: 0; bottom: 0; width: 0; }
.tl-tick { border-left: 1.5px dashed var(--blue-text); opacity: .75; }
.tl-today { border-left: 2px solid var(--amber); }
.tl-months { display: flex !important; margin-top: 3px; }
.tl-months span { min-width: 0; font-size: .66rem; font-weight: 600; color: var(--muted); text-align: center; border-left: 1px solid var(--line); }
.tl-months span:first-child { border-left: 0; }
.tl-hint { display: flex !important; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: .74rem; color: var(--muted); }
.tl-more { color: var(--sage); font-weight: 700; white-space: nowrap; }
.tl-list { margin-top: 6px; padding: 2px 12px 8px; border-radius: var(--radius-sm); background: var(--canvas); border: 1px solid var(--line); }
.tl-crop { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 0; text-align: left; }
.tl-crop + .tl-crop { border-top: 1px solid var(--line); }
.tl-crop .name { display: block; font-weight: 600; font-size: .92rem; line-height: 1.25; }
.tl-crop .sub { display: block; font-size: .78rem; color: var(--muted); }
.tl-crop strong { white-space: nowrap; }
.tl-crop .dot, .tl-legend .dot { flex: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.tl-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.chip.good[aria-pressed="true"] { color: #fff; border-color: var(--sage); }

/* ---------- Square-foot bed grid ---------- */
.grid-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; margin-top: 4px; padding: 0 2px; text-align: left; font-size: .9rem; border-top: 1px solid var(--line); }
.grid-toggle strong { color: var(--sage); }
.grid-toggle .tl-more { font-size: .74rem; }
.grid-panel { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 6px; padding: 12px; border-radius: var(--radius-sm); background: var(--canvas); border: 1px solid var(--line); }
.grid-panel .segmented button { min-height: 40px; font-size: .86rem; }
.grid-tools, .grid-tray { display: flex; flex-wrap: wrap; gap: 8px; }
.grid-tools .chip, .grid-tray .chip { padding: 0 13px; font-size: .86rem; }
.grid-tools .chip:disabled { opacity: .45; }
.chip.compass { color: var(--blue-text); border-color: #C9DBE6; background: var(--blue-soft); }
.chip.brush { color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(38, 48, 43, .08); }
.chip.brush[aria-pressed="true"] { background: var(--sage); border-color: var(--sage); color: #fff; box-shadow: 0 0 0 3px var(--sage-soft); }
.sqf-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 2px; -webkit-overflow-scrolling: touch; }
.sqf-wrap { display: flex; flex-direction: column; gap: 5px; margin: 0 auto; }
.sqf-wrap.north-bottom { flex-direction: column-reverse; }
.sqf-wrap.north-left { flex-direction: row; }
.sqf-wrap.north-right { flex-direction: row-reverse; }
.sqf-north { display: flex; align-items: center; justify-content: center; min-height: 24px; padding: 3px 8px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-text); font-size: .64rem; font-weight: 800; letter-spacing: .06em; text-align: center; }
.north-left .sqf-north, .north-right .sqf-north { flex: none; width: 25px; min-height: 0; padding: 8px 0; }
.north-left .sqf-north span, .north-right .sqf-north span { writing-mode: vertical-rl; white-space: nowrap; }
.north-left .sqf-north span { transform: rotate(180deg); }
.sqf-grid { flex: 1; display: grid; gap: 0; border: 2px solid #B9A58C; border-radius: 10px; overflow: hidden; background: #EFE7DA; }
.sqf-cell { position: relative; aspect-ratio: 1; min-width: 48px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; overflow: hidden; background: #F6F0E6; box-shadow: inset 0 0 0 .5px #D6C8B2; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sqf-cell:active { background: #EADFCB; }
.sqf-cell.filled { background: #fff; }
.sqf-cell.tier-tall { box-shadow: inset 0 0 0 .5px #D6C8B2, inset 0 3px 0 var(--sage); }
.sqf-cell.tier-medium { box-shadow: inset 0 0 0 .5px #D6C8B2, inset 0 3px 0 #A9C6B6; }
.sqf-cell.mine { background: var(--sage-soft); }
.sqf-cell.nb-good { background: #DCEBE2; }
.sqf-cell.nb-bad { background: var(--amber-soft); }
.sqf-cell.sel { box-shadow: inset 0 0 0 3px var(--sage); background: var(--sage-soft); z-index: 1; }
.sqf-cell .e { font-size: 1.25rem; line-height: 1.1; }
.sqf-cell { container-type: inline-size; }
.sqf-cell .n { max-width: 100%; font-size: .56rem; font-weight: 600; line-height: 1.15; text-align: center; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@container (min-width: 64px) {
  .sqf-cell .n { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
.sqf-cell .x { font-size: .6rem; font-weight: 800; color: var(--sage); line-height: 1; }
.sqf-cell .sh { position: absolute; top: 1px; right: 2px; font-size: .7rem; line-height: 1; filter: drop-shadow(0 0 2px var(--amber)); }
.sqf-cell.shaded { box-shadow: inset 0 0 0 2px var(--amber); }
.grid-note { padding: 10px 12px; border-radius: var(--radius-sm); background: #fff; border: 1px solid var(--line); font-size: .86rem; line-height: 1.4; }
.grid-note p { margin: 0 0 8px; }
.grid-note .good { color: var(--sage); font-weight: 700; }
.grid-note .bad { color: var(--amber-text); font-weight: 700; }
.grid-note.shade { display: flex; gap: 8px; background: var(--amber-soft); border-color: #F3D9A8; color: var(--amber-text); }

/* ---------- Print Cheat Sheets: modal & entry points ---------- */
.print-btn { color: var(--sage); background: #fff; border: 1.5px solid var(--line); }
.sheet-head .print-btn { margin-left: auto; }
.btn svg { margin-right: 8px; vertical-align: -4px; }
.print-opt { display: flex; align-items: flex-start; gap: 12px; min-height: 56px; cursor: pointer; }
.print-opt input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--sage); }
.print-opt strong { display: block; font-weight: 600; }
.print-opt .small { display: block; margin-top: 2px; }
.print-summary { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--sage-soft); color: var(--sage-dark); border-left: 4px solid var(--terracotta); }
.print-summary strong, .print-summary .small { display: block; }

/* ---------- Harvest log & variety "Grow Again?" verdicts ---------- */
.segmented.verdict button { white-space: nowrap; padding: 0 6px; font-size: .86rem; }
.segmented.verdict button[aria-pressed="true"] { color: #fff; box-shadow: 0 1px 3px rgba(38, 48, 43, .2); }
.segmented.verdict .v-grow_again[aria-pressed="true"] { background: var(--sage); }
.segmented.verdict .v-maybe[aria-pressed="true"] { background: #E3D6BC; color: #5F5136; }
.segmented.verdict .v-skip[aria-pressed="true"] { background: var(--terracotta); }
.review-card textarea.input { resize: vertical; min-height: 64px; line-height: 1.4; }
.pill.verdict-grow { background: var(--sage); color: #fff; }
.pill.verdict-skip { background: transparent; border: 1px solid #E6C3B6; color: #9C4A31; }
.pill.first-pick { background: var(--terracotta-soft); color: #9C4A31; margin-left: 4px; vertical-align: 1px; }
.harvest-summary { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--sage-soft); color: var(--sage-dark); font-weight: 600; }
.check-row { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; cursor: pointer; }
.check-row input { flex: none; width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--sage); }
.check-row strong { display: block; font-weight: 600; }
.check-row .small { display: block; margin-top: 2px; }
.harvest-list { list-style: none; margin: 0; padding: 0; }
.harvest-entry { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.harvest-entry + .harvest-entry { border-top: 1px solid var(--line); }
.harvest-entry .grow { min-width: 0; overflow-wrap: anywhere; }
.harvest-entry .h-top { line-height: 1.35; }
.harvest-entry .h-notes { margin-top: 2px; font-style: italic; }
.harvest-entry .icon-btn { flex: none; margin: -4px -8px 0 0; color: var(--muted); font-size: 1.35rem; }
.harvest-log-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; text-align: left; }
.harvest-log-head .name { display: block; font: 600 1.05rem/1.25 var(--serif); }
.harvest-log-head .sub { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.harvest-log .harvest-list { margin-top: 4px; }
.task-actions { margin-top: 2px; }
.task-actions .link { color: #B4344D; }

/* ---------- House Plants ---------- */
.tab { min-width: 0; font-size: .66rem; letter-spacing: -.01em; white-space: nowrap; }
.tab svg { width: 24px; height: 24px; }
.hp-season { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: .86rem; line-height: 1.35; }
.hp-season.winter { background: var(--blue-soft); color: var(--blue-text); border: 1px solid #C9DDE8; }
.hp-season.active { background: var(--sage-soft); color: var(--sage-dark); border: 1px solid #CADBD1; }
.hp-card { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.hp-head { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; text-align: left; }
.hp-head .name { display: block; font-weight: 600; line-height: 1.25; }
.hp-head .sub { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.hp-due, .hp-when { font-weight: 700; color: var(--sage); }
.hp-due { flex: none; font-size: .78rem; padding: 5px 10px; border-radius: 999px; background: var(--sage-soft); white-space: nowrap; }
.hp-due.due, .hp-when.due { color: #9C4A31; }
.hp-due.due { background: var(--terracotta-soft); }
.hp-due.overdue, .hp-when.overdue { color: var(--amber-text); }
.hp-due.overdue { background: var(--amber-soft); border: 1px solid #F3D9A8; }
.hp-card .pill, #hp-list .pill { white-space: normal; }
.hp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hp-actions .btn { padding: 0 8px; font-size: .86rem; }
.hp-also { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hp-also .label { margin: 0; }
.hp-also .chip { white-space: normal; text-align: left; padding: 6px 14px; border-color: #CADBD1; color: var(--sage); }
.garden-bar .btn { flex: none; white-space: nowrap; }
.hp-seg button { min-height: 44px; }
.hp-botanical { display: block; font-size: .82rem; font-style: italic; color: var(--muted); }
.hp-line { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.hp-line + .hp-line, .hp-actions + .hp-line { border-top: 1px solid var(--line); }
.hp-line-icon { flex: none; width: 28px; text-align: center; font-size: 1.15rem; line-height: 1.4; }
.hp-line .what { font-weight: 600; }
.hp-line .how { font-size: .86rem; color: var(--muted); margin-top: 2px; }
.hp-line .btn { flex: none; }
.hp-quick .btn { min-height: 44px; }
.scope-bar { margin-bottom: 8px; }
.scope-bar button { flex: 1 1 auto; font-size: .82rem; padding: 0 8px; white-space: nowrap; }
div.field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
@media print { .ps-house td:first-child { width: 17%; } .ps-house td:nth-child(6) { width: 30%; } }

/* ---------- Printable cheat sheets (ink-friendly) ---------- */
#print-sheets-container { display: none; }

@media print {
  @page { margin: 0.5in; }
  html, body, body.sheet-open { background: #FFFFFF !important; overflow: visible !important; height: auto !important; }
  /* Hide every piece of interactive app UI; only the cheat sheets reach the paper. */
  body > *:not(#print-sheets-container), .app-header, .tabbar, .sheet, .sheet-backdrop, .toast, #view, button { display: none !important; }
  #print-sheets-container {
    display: block !important; background: #FFFFFF !important; color: #111827 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 10pt; line-height: 1.35;
  }
  #print-sheets-container * { animation: none !important; box-shadow: none !important; }
  .ps-sheet { break-after: page; page-break-after: always; }
  .ps-sheet:last-child { break-after: auto; page-break-after: auto; }
  .ps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12pt; border-bottom: 2px solid #111827; padding-bottom: 3pt; }
  .ps-head h1 { font: 700 15pt/1.2 Georgia, "Times New Roman", serif; }
  .ps-head span { font-size: 8pt; color: #4B5563; white-space: nowrap; }
  .ps-meta { margin: 4pt 0 0; font-size: 9pt; }
  .ps-sheet h2 { font: 700 10.5pt/1.3 inherit; font-family: inherit; text-transform: uppercase; letter-spacing: .04em; margin: 11pt 0 4pt; break-after: avoid; page-break-after: avoid; }
  .ps-sheet h3 { font-size: 10.5pt; font-weight: 700; margin: 0 0 1pt; break-after: avoid; page-break-after: avoid; }
  .ps-sheet h3 span { font-weight: 400; font-size: 8.5pt; color: #4B5563; margin-left: 6pt; }
  .ps-sub { font-size: 8pt; color: #4B5563; }
  p.ps-sub { margin: 0 0 3pt; }
  .ps-empty { font-style: italic; color: #4B5563; margin: 2pt 0; }
  .ps-foot { margin-top: 8pt; font-size: 8pt; color: #4B5563; }
  .ps-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  .ps-table th, .ps-table td { border: 1px solid #9CA3AF; padding: 3pt 5pt; text-align: left; vertical-align: top; }
  .ps-table th { background: #F3F4F6 !important; font-size: 8pt; font-weight: 700; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-table thead { display: table-header-group; }
  .ps-table tr, .ps-block, .ps-rates > div { break-inside: avoid; page-break-inside: avoid; }
  .ps-date { white-space: nowrap; }
  .ps-checks { white-space: nowrap; width: 1%; }
  .ps-check { display: block; font-size: 8pt; line-height: 1.5; }
  .ps-check i { display: inline-block; width: 8.5pt; height: 8.5pt; border: 1px solid #111827; margin-right: 4pt; vertical-align: -1.5pt; }
  .ps-rates { border: 1px solid #9CA3AF; padding: 5pt 8pt; column-count: 2; column-gap: 16pt; font-size: 8.5pt; }
  .ps-rates > div { margin-bottom: 3pt; }
  .ps-block { margin-bottom: 9pt; }
  .ps-est { font-size: 8pt; }
  .ps-est td:first-child { width: 13%; }
  .ps-bed { margin-bottom: 16pt; }
  .ps-gridwrap { display: flex; flex-direction: column; align-items: flex-start; width: max-content; margin: 4pt 0; }
  .ps-gridwrap.north-bottom { flex-direction: column-reverse; }
  .ps-gridwrap.north-left { flex-direction: row; align-items: stretch; }
  .ps-gridwrap.north-right { flex-direction: row-reverse; align-items: stretch; }
  .ps-north { align-self: stretch; text-align: center; font-size: 8pt; font-weight: 700; letter-spacing: .08em; padding: 2pt 4pt; border: 1.5px solid #111827; }
  .north-left .ps-north, .north-right .ps-north { writing-mode: vertical-rl; }
  .ps-grid { display: grid; border-top: 1px solid #111827; border-left: 1px solid #111827; }
  .ps-grid > div { border-right: 1px solid #111827; border-bottom: 1px solid #111827; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1pt; overflow: hidden; line-height: 1.15; overflow-wrap: anywhere; }
  .ps-grid b { font-size: 1.15em; }
}

/* ---------- Device sync link ---------- */
.header-actions { display: flex; align-items: center; flex: none; margin-right: -6px; }
.sync-card .btn svg { flex: none; }
.sync-summary { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sage-soft); color: var(--sage); font-size: .9rem; line-height: 1.4; }
.sync-summary strong { font-weight: 700; }
.sync-dot { flex: none; width: 8px; height: 8px; margin-top: .42em; border-radius: 50%; background: var(--sage); }
.sync-paste { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.sync-paste .inline-form { margin-top: 6px; }
.sync-stamp { font: 600 1.08rem/1.3 var(--serif); margin-top: -6px; }
.sync-rows { padding-top: 4px; padding-bottom: 4px; }
.sync-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sync-row:last-child { border-bottom: 0; }
.sync-row strong { text-align: right; overflow-wrap: anywhere; }
.sync-row .small:last-child { grid-column: 1 / -1; text-align: right; }
.sync-warn { padding: 10px 12px; border-radius: 12px; background: #FDF3E3; border: 1px solid #F3D9A8; color: #7A4A06; font-size: .88rem; line-height: 1.4; }
