/* PlantHQ base styles. Colors come only from theme tokens (themes.css).
   Sizes are in rem so the Text size setting scales everything. */

:root {
  --font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-scale: 1;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 14px rgba(0, 0, 0, .05);
  --shadow-lift: 0 8px 28px rgba(0, 0, 0, .12);
  --sidebar-w: 248px;
  --nav-h: 64px;
  --gap: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(100% * var(--font-scale)); -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.2; color: var(--heading); margin: 0; overflow-wrap: anywhere; }
p { margin: 0; }
/* A pasted URL or a 60-letter plant name must never push the page sideways. */
p, li, td, th, dd, dt, figcaption, strong, small { overflow-wrap: anywhere; }
a { color: var(--link); text-underline-offset: 2px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
ul, ol { margin: 0; padding: 0; }
dl, dd { margin: 0; }
hr { border: 0; border-top: 1px solid var(--divider); }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 6px; }
h1:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Forms ---------- */
input, select, textarea {
  width: 100%; min-width: 0; min-height: 44px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text); font-size: 1rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--callout-bg); }
input[aria-invalid="true"] { border-color: var(--danger-text); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--accent-2-deep); flex-shrink: 0; }
input[type="file"] { padding: 8px; font-size: .9rem; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
/* iPhone draws date boxes at its own width and ignores width:100% unless the native look is removed. */
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; text-align: left;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
::placeholder { color: var(--text-muted); opacity: 1; }

.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field-label { display: block; font-size: .875rem; font-weight: 500; color: var(--text); margin-bottom: 6px; overflow-wrap: anywhere; }
.check-row, .toggle-row, .pick-tile, .room-plant, .tree a, .list-row-body, .supply-name, .species-option { overflow-wrap: anywhere; }
.field-hint { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }
.field-hint svg { vertical-align: -2px; }
.req { font-weight: 400; color: var(--text-muted); }
.check-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: .95rem; min-height: 44px; }
.check-row svg { flex-shrink: 0; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; cursor: pointer; }
.toggle-row small { display: block; font-size: .8rem; color: var(--text-muted); }
.switch { position: relative; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-slider { position: absolute; inset: 0; background: var(--progress-track); border: 1px solid var(--btn-ghost-border); border-radius: var(--radius-pill); transition: background .15s; }
.switch-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: var(--surface); border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.switch input:checked + .switch-slider { background: var(--accent-2-deep); border-color: var(--accent-2-deep); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form > input, .inline-form > select { flex: 1; }
.inline-label { display: inline-flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--text-muted); }
.inline-label select { width: auto; min-height: 40px; padding-top: 6px; padding-bottom: 6px; }
.form-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 14px; margin: 0 0 14px; background: var(--surface-alt); }
.form-section > summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 500; list-style: none; min-height: 44px; }
.form-section > summary::-webkit-details-marker { display: none; }
.form-section > summary::after { content: '+'; margin-left: auto; color: var(--text-muted); font-size: 1.2rem; }
.form-section[open] > summary::after { content: '–'; }
.form-section[open] { padding-bottom: 6px; }

/* ---------- Buttons, chips, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; text-align: center;
  border: 1px solid transparent; transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn svg { flex-shrink: 0; }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
.btn-primary:hover:not(:disabled) { background: var(--btn-primary-hover); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
.btn-secondary:hover:not(:disabled) { background: var(--btn-secondary-hover); }
.btn-ghost { background: transparent; color: var(--btn-ghost-text); border-color: var(--btn-ghost-border); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-alt); }
.btn-danger { background: transparent; color: var(--danger-text); border-color: var(--danger-text); }
.btn-danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger-text); color: var(--surface); }
.btn-full { width: 100%; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon-sm { width: 36px; min-height: 36px; padding: 0; border-color: transparent; flex-shrink: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row.center, .center { justify-content: center; text-align: center; }
.link-btn { color: var(--link); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }
.link-sm { font-size: .85rem; font-weight: 500; white-space: nowrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; margin-bottom: 12px; min-height: 44px; text-decoration: none; }

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px;
  border-radius: var(--radius-pill); border: 1px solid var(--btn-ghost-border);
  background: var(--surface); color: var(--text); font-size: .875rem; font-weight: 500; text-align: left;
  transition: background .15s ease;
}
.chip:hover { background: var(--surface-alt); }
.chip-active, .chip-active:hover { background: var(--chip-2-bg); color: var(--chip-2-text); border-color: var(--accent-2-deep); font-weight: 600; }
.chip-active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--chip-3-bg); color: var(--chip-3-text); font-size: .78rem; font-weight: 600; line-height: 1.4; }
.pill .plant-thumb { width: 18px; height: 18px; }
.pill-ok { background: var(--success-bg); color: var(--success-text); }
.pill-warn { background: var(--warning-bg); color: var(--warning-text); }
.pill-accent { background: var(--chip-1-bg); color: var(--chip-1-text); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--chip-1-bg); color: var(--chip-1-text); font-weight: 600; font-size: .8rem; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.care-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.care-water, .care-dot.care-water { background: var(--info-bg); color: var(--info-text); }
.care-fertilize, .care-dot.care-fertilize { background: var(--success-bg); color: var(--success-text); }
.care-mist, .care-dot.care-mist { background: var(--chip-1-bg); color: var(--chip-1-text); }
.care-inspect, .care-dot.care-inspect { background: var(--warning-bg); color: var(--warning-text); }
.care-rotate, .care-clean, .care-dot.care-rotate, .care-dot.care-clean { background: var(--chip-3-bg); color: var(--chip-3-text); }
.care-repot, .care-dot.care-repot { background: var(--chip-4-bg); color: var(--chip-4-text); }

/* ---------- App shell ---------- */
#update-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 400; display: none; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top)); background: var(--btn-primary-bg); color: var(--btn-primary-text); font-weight: 500; box-shadow: var(--shadow); }
#update-banner button { background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: var(--radius-pill); font-weight: 600; min-height: 40px; }
#app-splash { position: fixed; inset: 0; z-index: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg); color: var(--text-muted); }
#app-splash svg { color: var(--accent-2-deep); }

#app-root { min-height: 100vh; min-height: 100dvh; }
#app-main { max-width: 1240px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); padding-top: calc(16px + env(safe-area-inset-top)); min-width: 0; }
.page { min-width: 0; animation: page-in .25s ease; }
/* Movement only, no fade: if a browser pauses the animation, the page still reads at full strength. */
@keyframes page-in { from { transform: translateY(6px); } to { transform: none; } }

.sidebar { display: none; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--nav-bg); border-top: 1px solid var(--border);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border-radius: 12px; color: var(--nav-text); font-size: .7rem; font-weight: 500; text-decoration: none; }
.bottom-nav a svg { color: var(--nav-icon); }
.bottom-nav a.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; box-shadow: inset 0 3px 0 var(--accent-1-deep); }
.bottom-nav a.active svg { color: var(--accent-1-deep); }

@media (min-width: 1024px) {
  .bottom-nav { display: none; }
  .sidebar {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); z-index: 60;
    background: var(--nav-bg); border-right: 1px solid var(--border); padding: 0 14px 18px; overflow-y: auto;
  }
  .brand-stripe { height: 6px; margin: 0 -14px 18px; background: var(--brand-stripe); }
  .sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 12px 22px; font-family: var(--font-display); font-size: 1.5rem; color: var(--nav-active-text); text-decoration: none; }
  .sidebar-brand svg { color: var(--nav-icon); }
  .sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 10px 14px; border-radius: 12px; color: var(--nav-text); text-decoration: none; font-weight: 500; }
  .sidebar-nav a svg { color: var(--nav-icon); }
  .sidebar-nav a:hover { background: var(--nav-hover-bg); }
  .sidebar-nav a.active { background: var(--nav-active-bg); color: var(--nav-active-text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent-1-deep); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+1) svg { color: var(--chip-1-text); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+2) svg { color: var(--chip-2-text); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+3) svg { color: var(--chip-3-text); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+4) svg { color: var(--chip-4-text); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+5) svg { color: var(--chip-5-text); }
  [data-theme="rainbow-pastel"] .sidebar-nav a:nth-child(6n+6) svg { color: var(--chip-6-text); }
  .sidebar-foot { margin-top: auto; padding: 12px 14px 0; font-size: .8rem; color: var(--nav-text); }
  #app-root { padding-left: var(--sidebar-w); }
  #app-main { padding: 32px 36px 48px; }
}

.fab {
  position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 55;
  width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); box-shadow: var(--shadow-lift);
  transition: transform .15s ease, background .15s ease;
}
.fab:hover { background: var(--btn-primary-hover); transform: translateY(-2px); }
@media (min-width: 1024px) { .fab { bottom: 32px; right: 32px; } }

/* ---------- Page structure ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.page-header-text { min-width: 0; flex: 1 1 260px; }
.page-header h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.4rem); }
.page-header p { color: var(--text-muted); margin-top: 4px; }
.page-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-title { font-family: var(--font-body); font-size: .95rem; font-weight: 600; margin: 18px 0 8px; color: var(--heading); }
.group-title { display: flex; align-items: center; gap: 6px; font-family: var(--font-body); font-size: .9rem; font-weight: 600; margin: 14px 0 8px; color: var(--heading); }
.group-title:first-of-type { margin-top: 4px; }
.copyright { text-align: center; font-size: .8rem; color: var(--text-muted); margin: 28px 0 8px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card + .card, .col > * + * { margin-top: var(--gap); }
.card-accent { border-color: var(--border-accent); border-width: 1.5px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; min-width: 0; }
details > summary.card-title { cursor: pointer; list-style: none; min-height: 32px; }
details > summary.card-title::-webkit-details-marker { display: none; }
.card-title-icon { display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: 10px; background: var(--chip-2-bg); color: var(--chip-2-text); flex-shrink: 0; }

.callout { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--callout-bg); border: 1.5px solid var(--callout-border); color: var(--text); font-size: .9rem; }
.callout svg { flex-shrink: 0; margin-top: 2px; }
.callout-soft { background: var(--surface-alt); border-color: var(--border); }
.callout-warn { background: var(--warning-bg); border-color: transparent; color: var(--warning-text); }
.callout-warn a, .callout-warn .link-btn { color: var(--warning-text); }
.callout-link { text-decoration: none; color: var(--text); }
.callout-link:hover { border-color: var(--accent-1-deep); }
.callout-icon { display: inline-flex; width: 40px; height: 40px; border-radius: 12px; align-items: center; justify-content: center; background: var(--surface); color: var(--accent-1-deep); flex-shrink: 0; }
.callout-body { min-width: 0; flex: 1; }
.callout-body .card-title { font-size: 1.1rem; margin-bottom: 4px; }

.grid-dash, .grid-2-lg { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.grid-dash > .col { min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.grid-cards > .card + .card { margin-top: 0; }
.grid-2-lg > .card + .card { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.settings-grid > .card + .card { margin-top: 0; }
@media (min-width: 640px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .grid-dash { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .grid-2-lg, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .settings-wide { grid-column: 1 / -1; }
}
@media (min-width: 1200px) { .grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 380px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.stack > * + * { margin-top: 12px; }
.stack-sm > * + * { margin-top: 8px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.row-between > span, .row-between > label { min-width: 0; overflow-wrap: anywhere; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.text-sm { font-size: .875rem; } .text-xs { font-size: .78rem; }
.text-muted { color: var(--text-muted); } .text-secondary { color: var(--text-muted); }
.text-success { color: var(--success-text); } .text-warning-strong { color: var(--warning-text); }
.font-medium { font-weight: 600; }
[hidden] { display: none !important; }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; }
.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.stat-value { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.15; color: var(--heading); overflow-wrap: anywhere; }
.stat-note { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }

/* ---------- Tabs & segmented ---------- */
.tab-bar { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--divider); }
.tab { display: inline-flex; align-items: center; min-height: 40px; padding: 8px 14px; border-radius: var(--radius-pill); color: var(--text); text-decoration: none; font-size: .9rem; font-weight: 500; }
.tab:hover { background: var(--surface-alt); }
.tab.active { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--btn-ghost-border); border-radius: var(--radius-pill); overflow: hidden; }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 38px; color: var(--btn-ghost-text); }
.seg-btn.active { background: var(--chip-2-bg); color: var(--chip-2-text); }

/* ---------- Hero welcome panel ---------- */
.hero { container-type: inline-size; position: relative; overflow: hidden; background: var(--hero-bg); border: 1.5px solid var(--hero-border); border-radius: 22px; padding: 18px; margin-bottom: var(--gap); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px; grid-template-areas: "text art" "foot foot"; gap: 8px 12px; align-items: center; }
.hero-text { grid-area: text; min-width: 0; }
.hero-art-wrap { grid-area: art; align-self: center; }
.hero-art { display: block; width: 100%; height: auto; }
.hero-foot { grid-area: foot; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.hero-eyebrow { display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--hero-eyebrow-bg); color: var(--hero-eyebrow-text); font-size: .75rem; font-weight: 600; margin-bottom: 8px; }
.hero-title { font-family: var(--font-display); font-size: clamp(1.55rem, 1.1rem + 2vw, 2.3rem); line-height: 1.15; color: var(--heading); overflow-wrap: anywhere; }
.hero-message { margin-top: 6px; color: var(--text); max-width: 46ch; }
.hero-action { margin-top: 12px; }
.hero-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; min-width: 0; text-align: center; }
.hero-tile-value { display: block; font-family: var(--font-display); font-size: 1.35rem; line-height: 1.1; color: var(--heading); }
.hero-tile-label { display: block; font-size: .72rem; color: var(--text-muted); font-weight: 500; line-height: 1.25; }
@container (min-width: 600px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); }
}
@container (min-width: 880px) {
  .hero { padding: 24px 28px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); grid-template-areas: "text art" "foot art"; }
  .hero-art-wrap { align-self: end; }
  .hero-foot { max-width: 560px; }
}
@container (max-width: 360px) {
  .hero-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hero-art .ph-glow { fill: var(--art-glow); opacity: .7; }
.hero-art .ph-shadow { fill: var(--art-shadow); opacity: .08; }
.hero-art .ph-shelf { fill: var(--art-shelf); }
.hero-art .ph-pot { fill: var(--art-pot); }
.hero-art .ph-pot-rim { fill: var(--art-pot-rim); }
.hero-art .ph-pot2 { fill: var(--art-pot2); }
.hero-art .ph-pot2-rim { fill: var(--art-pot2-rim); }
.hero-art .ph-leaf { fill: var(--art-leaf); }
.hero-art .ph-leaf-light { fill: var(--art-leaf-light); }
.hero-art .ph-leaf2 { fill: var(--art-leaf2); }
.hero-art .ph-stem { fill: none; stroke: var(--art-stem); stroke-width: 3; stroke-linecap: round; }
.hero-art .ph-vine { fill: none; stroke: var(--art-leaf2); stroke-width: 2; stroke-linecap: round; }
.hero-art .ph-can { fill: var(--art-can); }
.hero-art .ph-can-dark { fill: var(--art-can-dark); }
.hero-art .ph-handle { fill: none; stroke: var(--art-can-dark); stroke-width: 7; stroke-linecap: round; }
.hero-art .ph-drop { fill: var(--art-drop); animation: ph-drip 3.2s ease-in infinite; }
.hero-art .ph-drop:nth-of-type(2n) { animation-delay: 1.1s; }
.hero-art .ph-ink { fill: none; stroke: var(--art-ink); stroke-opacity: .2; stroke-width: 1.6; stroke-linecap: round; }
.hero-art .ph-ink-soft { fill: none; stroke: var(--art-ink); stroke-opacity: .1; stroke-width: 2; }
.hero-art .ph-spark { fill: var(--art-spark); }
@keyframes ph-drip { 0% { transform: translateY(-4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }

/* ---------- Lists, rows, timelines ---------- */
.plain-list { list-style: none; }
.plain-list > li { padding: 6px 0; }
.plain-list > li + li { border-top: 1px solid var(--divider); }
.mini-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; text-align: left; width: 100%; }
.mini-row > span:not(.plant-thumb) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mini-row small { color: var(--text-muted); font-size: .8rem; }
.mini-row strong { overflow-wrap: anywhere; }
a.mini-row, button.mini-row { min-height: 48px; border-radius: 10px; padding: 4px; }
a.mini-row:hover, button.mini-row:hover { background: var(--surface-alt); }
.plant-thumb { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--surface-alt); }
.plant-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--accent-2-deep); background: var(--chip-2-bg); }

.timeline { list-style: none; }
.timeline-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; }
.timeline-item + .timeline-item { border-top: 1px solid var(--divider); }
.timeline-icon { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; background: var(--chip-2-bg); color: var(--chip-2-text); flex-shrink: 0; }
.timeline-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.timeline-title { font-weight: 500; overflow-wrap: anywhere; }
.timeline-meta { font-size: .8rem; color: var(--text-muted); }
.timeline-note { font-size: .875rem; margin-top: 4px; overflow-wrap: anywhere; }
.amount { font-family: var(--font-display); font-weight: 400; white-space: nowrap; }
.mini-timeline { list-style: none; font-size: .85rem; margin: 6px 0; border-left: 2px solid var(--border-accent); padding-left: 10px; }
.mini-timeline span { color: var(--text-muted); margin-right: 6px; }
.rank-list { padding-left: 22px; }
.rank-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.bullets { padding-left: 20px; }
.bullets li { margin: 4px 0; }
.steps { padding-left: 22px; }
.steps li { margin: 6px 0; padding-left: 2px; }
.checklist { list-style: none; }
.checklist li { display: flex; align-items: center; gap: 8px; }
.checklist li > .check-row { flex: 1; }
.checklist li > svg { color: var(--accent-2-deep); flex-shrink: 0; }
.checklist small { display: block; }
.checklist .check-row:has(input:checked) span { text-decoration: line-through; text-decoration-color: var(--border-accent); color: var(--text-muted); }

.day-list { list-style: none; }
.day-list li { display: flex; gap: 12px; padding: 10px 0; align-items: flex-start; }
.day-list li + li { border-top: 1px solid var(--divider); }
.day-list-date { display: flex; flex-direction: column; width: 52px; flex-shrink: 0; font-size: .8rem; color: var(--text-muted); }
.day-list-date strong { color: var(--heading); font-size: .9rem; }
.day-list-items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }

/* ---------- Task rows ---------- */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); min-width: 0; transition: opacity .35s ease, transform .35s ease; }
.task-late { border-left: 4px solid var(--warning-text); }
.task-row.is-done { opacity: .35; transform: translateX(8px); }
.task-check { display: inline-flex; width: 34px; height: 34px; border-radius: 50%; align-items: center; justify-content: center; border: 2px solid var(--accent-2-deep); color: transparent; flex-shrink: 0; transition: background .2s, color .2s; }
.task-check:hover { background: var(--chip-2-bg); color: var(--accent-2-deep); }
.task-row.is-done .task-check { background: var(--accent-2); border-color: var(--accent-2); color: var(--btn-primary-text); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; overflow-wrap: anywhere; }
.task-title a { color: var(--text); text-decoration: none; }
.task-title a:hover { text-decoration: underline; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.task-extra { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
@media (max-width: 420px) {
  .task-row { flex-wrap: wrap; }
  .task-extra { width: 100%; justify-content: flex-end; margin-top: -4px; }
  .task-extra .btn-sm span { display: inline; }
}
.all-done { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--text-muted); }
.all-done svg { color: var(--accent-1-deep); }

/* ---------- Plant cards & lists ---------- */
.grid-plants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid-plants { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-plants { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.grid-plants.grid-plants-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plant-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; min-width: 0; }
.plant-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.plant-card-photo { position: relative; aspect-ratio: 1; background: var(--chip-2-bg); display: flex; align-items: center; justify-content: center; }
.plant-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.plant-card-placeholder { color: var(--accent-2-deep); opacity: .7; }
.plant-card-flags { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.flag { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface); color: var(--accent-1-deep); box-shadow: var(--shadow); }
.flag-warn { background: var(--warning-bg); color: var(--warning-text); }
.plant-card-body { padding: 10px 12px 12px; min-width: 0; }
.plant-card-name { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.2; overflow-wrap: anywhere; }
.plant-card-species { font-size: .78rem; color: var(--text-muted); overflow-wrap: anywhere; }
.plant-card-status { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--info-bg); color: var(--info-text); }
.status-overdue, .status-due { background: var(--warning-bg); color: var(--warning-text); }
.status-fine { background: var(--surface-alt); color: var(--text-muted); }
.list-card { padding: 4px 8px; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; min-height: 56px; color: var(--text); text-decoration: none; border-radius: 10px; }
.list-row + .list-row { border-top: 1px solid var(--divider); }
.list-row:hover { background: var(--surface-alt); }
.list-row > svg { color: var(--nav-icon); flex-shrink: 0; }
.list-row-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.list-row-body small { color: var(--text-muted); font-size: .8rem; }
.list-row-meta { flex-shrink: 0; text-align: right; }
.filter-card { margin-bottom: 8px; }
.filter-card > * + * { margin-top: 12px; }
.filter-card .field { margin-bottom: 0; }
.search-box { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; background: var(--surface); }
.search-box:focus-within { border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--callout-bg); }
.search-box svg { color: var(--text-muted); flex-shrink: 0; }
.search-box input { border: 0; box-shadow: none !important; padding-left: 0; }
.result-count { min-height: 1.2em; margin: 4px 0 10px; }

/* ---------- Plant profile ---------- */
.profile-head { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; grid-template-areas: "photo title fav" "health health health"; gap: 12px 14px; align-items: center; margin-bottom: 14px; }
.profile-photo { grid-area: photo; width: 88px; height: 88px; border-radius: 20px; overflow: hidden; background: var(--chip-2-bg); color: var(--chip-2-text); display: flex; align-items: center; justify-content: center; border: 1px solid var(--border); }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo span { display: flex; flex-direction: column; align-items: center; font-size: .7rem; font-weight: 600; }
.profile-title { grid-area: title; min-width: 0; }
.profile-title h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.3rem); }
.profile-species { color: var(--text-muted); font-style: italic; font-size: .9rem; overflow-wrap: anywhere; }
.profile-health { grid-area: health; display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--text-muted); }
.fav-btn { grid-area: fav; color: var(--text-muted); align-self: start; }
.fav-btn.is-on { color: var(--danger-text); background: var(--danger-bg); border-color: transparent; }
.fav-btn.is-on svg { fill: currentColor; }
@media (min-width: 720px) {
  .profile-head { grid-template-columns: 112px minmax(0, 1fr) auto auto; grid-template-areas: "photo title health fav"; }
  .profile-photo { width: 112px; height: 112px; }
  .profile-health { flex-direction: column; gap: 2px; }
}
.schedule { list-style: none; }
.schedule-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.schedule-row + .schedule-row { border-top: 1px solid var(--divider); }
.schedule-icon { display: inline-flex; width: 36px; height: 36px; border-radius: 12px; align-items: center; justify-content: center; flex-shrink: 0; }
.schedule-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.schedule-body small { color: var(--text-muted); font-size: .8rem; }
.schedule-row.is-due .schedule-body strong::after { content: ' · due'; color: var(--warning-text); font-weight: 600; font-size: .8rem; }
.why { margin-top: 10px; font-size: .875rem; }
.why summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--link); font-weight: 500; min-height: 36px; }
.why ul { list-style: none; margin-top: 6px; padding: 10px 12px; background: var(--surface-alt); border-radius: 12px; }
.why li { padding: 2px 0; }
.action-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 380px) { .action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.action-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; padding: 8px 4px; border-radius: var(--radius); background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); font-size: .75rem; font-weight: 600; text-align: center; text-decoration: none; line-height: 1.2; }
.action-tile svg { color: var(--accent-2-deep); }
.action-tile:hover { background: var(--chip-2-bg); }
.facts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.fact { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--divider); }
.fact:first-child { border-top: 0; }
.fact dt { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--text-muted); font-weight: 500; }
.fact dd { font-size: .9rem; overflow-wrap: anywhere; }
.tip { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--callout-bg); font-size: .875rem; }
.tip svg { flex-shrink: 0; color: var(--accent-1-deep); margin-top: 2px; }
.issue-card.is-open { border-left: 4px solid var(--warning-text); }

.health-ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.health-ring svg { transform: rotate(-90deg); }
.ring-track { stroke: var(--chart-track); }
.ring-fill { transition: stroke-dashoffset .6s ease; }
.ring-good .ring-fill { stroke: var(--accent-2-deep); }
.ring-mid .ring-fill { stroke: var(--warning-text); }
.ring-low .ring-fill { stroke: var(--danger-text); }
.health-ring-value { position: absolute; font-family: var(--font-display); font-size: 1.25rem; color: var(--heading); }
.ring-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ring-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: var(--radius); border: 1px solid var(--border); color: var(--text); text-decoration: none; text-align: center; min-width: 0; }
.ring-tile:hover { background: var(--surface-alt); }
.ring-tile strong { font-size: .9rem; overflow-wrap: anywhere; }
.ring-tile small { font-size: .75rem; color: var(--text-muted); }

/* ---------- Photos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.photo-tile { display: flex; flex-direction: column; gap: 4px; text-align: left; min-width: 0; }
.photo-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.photo-date { font-size: .72rem; color: var(--text-muted); }
.photo-skel { aspect-ratio: 1; }
.compare { position: relative; overflow: hidden; border-radius: var(--radius); aspect-ratio: 4 / 5; background: var(--surface-alt); max-height: 70vh; margin: 0 auto; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before-wrap { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .4); pointer-events: none; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; min-height: 0; margin: 0; }
.compare-range:focus-visible + .compare-handle, .compare:focus-within .compare-handle { background: var(--focus-ring); }
.lightbox { position: fixed; inset: 0; z-index: 250; background: rgba(10, 10, 12, .88); display: flex; align-items: center; justify-content: center; padding: 16px; padding-top: calc(16px + env(safe-area-inset-top)); }
.lightbox-figure { margin: 0; max-width: 960px; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.lightbox-figure img { max-height: 68vh; width: auto; max-width: 100%; margin: 0 auto; border-radius: 14px; object-fit: contain; }
.lightbox-figure figcaption { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #F2F2F2; font-size: .9rem; }
.lightbox-caption { flex: 1; min-width: 180px; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .3); }
.lightbox-caption::placeholder { color: rgba(255, 255, 255, .75); }
.lightbox-actions { justify-content: center; }
.lightbox-close { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; display: flex; align-items: center; justify-content: center; }

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.cal-nav-title { font-size: 1.3rem; min-width: 10ch; text-align: center; }
.week-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 900px) { .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.week-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-width: 0; min-height: 64px; transition: background .15s; }
.week-day.is-today { border-color: var(--accent-1-deep); border-width: 2px; }
.week-day.is-past { background: var(--surface-alt); }
.week-day.is-over { background: var(--chip-2-bg); }
.week-day-head { display: flex; justify-content: space-between; font-family: var(--font-body); font-size: .85rem; font-weight: 600; margin-bottom: 8px; color: var(--heading); }
.week-day-items { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 900px) { .week-day-items { flex-direction: column; } .week-day { min-height: 180px; } }
.task-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 32px; padding: 4px 10px; border-radius: 10px; font-size: .8rem; font-weight: 600; text-align: left; }
.task-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.task-chip svg { flex-shrink: 0; }
.task-chip.is-late { box-shadow: inset 3px 0 0 var(--warning-text); }
.task-chip.is-dragging { opacity: .4; }
.task-chip[draggable="true"] { cursor: grab; }
.task-chip-wide { width: 100%; min-height: 44px; }
.task-chip-wide span { white-space: normal; }
.month-head, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month-head { text-align: center; font-size: .75rem; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.month-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 58px; padding: 6px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); text-align: left; min-width: 0; }
@media (min-width: 720px) { .month-day { min-height: 88px; } }
.month-day.is-out { background: transparent; color: var(--text-muted); border-color: transparent; }
.month-day.is-today { border: 2px solid var(--accent-1-deep); }
.month-num { font-size: .8rem; font-weight: 600; }
.month-icons { display: flex; flex-wrap: wrap; gap: 2px; }
.care-dot { display: inline-flex; width: 18px; height: 18px; border-radius: 6px; align-items: center; justify-content: center; }
.month-count { position: absolute; right: 6px; top: 5px; font-size: .7rem; color: var(--text-muted); font-weight: 600; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .78rem; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .care-tag { color: inherit; }
.legend-care .care-tag.care-water { color: var(--info-text); } .legend-care .care-tag.care-fertilize { color: var(--success-text); }
.legend-care .care-tag.care-mist { color: var(--chip-1-text); } .legend-care .care-tag.care-inspect { color: var(--warning-text); }
.legend-care .care-tag.care-rotate, .legend-care .care-tag.care-clean { color: var(--chip-3-text); } .legend-care .care-tag.care-repot { color: var(--chip-4-text); }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-edge) 35%, transparent); }
.sw-1 { background: var(--chart-1); } .sw-2 { background: var(--chart-2); } .sw-3 { background: var(--chart-3); }

.round-head .chip-group { flex-shrink: 0; }
.round-head .row-between { flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.round-done { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 600; color: var(--success-text); }
.round-room { margin-top: 18px; }
.round-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .round-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .round-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.round-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.round-card.is-done { opacity: .6; box-shadow: none; }
.round-card-top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.round-card-top > div { display: flex; flex-direction: column; min-width: 0; }
.round-card-top small { font-size: .8rem; color: var(--text-muted); }
.round-card-top strong { overflow-wrap: anywhere; }
.round-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.routine-card.is-done { border-color: var(--accent-2); }

.progress { height: 10px; border-radius: var(--radius-pill); background: var(--progress-track); overflow: hidden; box-shadow: inset 0 0 0 1px var(--btn-ghost-border); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--progress-fill); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-edge) 35%, transparent); transition: width .4s ease; }

/* ---------- Charts ---------- */
.bar-chart { margin: 0; }
.bars { display: grid; gap: 6px; align-items: end; height: var(--h); padding-top: 18px; }
.bar-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar-value { font-size: .7rem; font-weight: 600; color: var(--text-muted); margin-bottom: 2px; white-space: nowrap; }
/* Pastel fills are soft by design; the outline in muted text color gives every bar a 3:1 edge, and the value is printed above it. */
.bar-stack { width: 100%; max-width: 44px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 2px 2px; overflow: hidden; background: var(--chart-track); box-shadow: inset 0 0 0 1px var(--text-muted); }
.bar-seg { min-height: 2px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-edge) 35%, transparent); }
.seg-1 { background: var(--chart-2); } .seg-2 { background: var(--chart-1); } .seg-3 { background: var(--chart-3); }
.bar-label { font-size: .7rem; color: var(--text-muted); margin-top: 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-legend .sw-1 { background: var(--chart-2); } .chart-legend .sw-2 { background: var(--chart-1); }
.hbar { margin: 10px 0; }
.hbar-top { display: flex; justify-content: space-between; gap: 10px; font-size: .85rem; margin-bottom: 4px; }
.hbar-top span:first-child { overflow-wrap: anywhere; min-width: 0; }
.hbar-top span:last-child { flex-shrink: 0; }
.sparkline { width: 100%; height: auto; display: block; }

/* ---------- Journal / insights extras ---------- */
.tree, .tree ul { list-style: none; }
.tree ul { padding-left: 22px; border-left: 2px solid var(--border-accent); margin-left: 14px; }
.tree li { padding: 4px 0; }
.tree a { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; max-width: 100%; min-width: 0; }
.tree .plant-thumb { width: 28px; height: 28px; border-radius: 8px; }
.prop-card .chip-group { margin: 10px 0; }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow-y: auto; }
.pick-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.pick-row + .pick-row { border-top: 1px solid var(--divider); }
.pick-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; flex-shrink: 0; }
.pick-actions .is-done { background: var(--chip-2-bg); color: var(--chip-2-text); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pick-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: .85rem; font-weight: 600; text-align: center; min-width: 0; overflow-wrap: anywhere; }
.pick-tile:hover { background: var(--surface-alt); }
.pick-tile svg { color: var(--accent-2-deep); }
.room-board { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; padding: 10px; border-radius: var(--radius); background: var(--surface-alt); border: 1px dashed var(--border-accent); min-height: 64px; }
.room-plant { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; font-size: .7rem; color: var(--text); text-decoration: none; text-align: center; overflow-wrap: anywhere; }
.supply-list { list-style: none; }
.supply-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.supply-row + .supply-row { border-top: 1px solid var(--divider); }
.supply-row.is-low .supply-name strong::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning-text); margin-left: 6px; vertical-align: middle; }
.supply-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.supply-name small { color: var(--text-muted); font-size: .78rem; }
.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: var(--radius-pill); flex-shrink: 0; }
.stepper .btn { font-size: 1.1rem; }
.stepper-value { min-width: 2ch; text-align: center; font-weight: 600; }
.shop-list li.is-done span { text-decoration: line-through; color: var(--text-muted); }

/* ---------- Tools ---------- */
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tool-tile { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-decoration: none; min-width: 0; }
.tool-tile:hover { border-color: var(--border-accent); background: var(--surface-alt); }
.tool-tile > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.tool-tile small { color: var(--text-muted); font-size: .8rem; }
.tool-icon { display: inline-flex; width: 48px; height: 48px; border-radius: 14px; align-items: center; justify-content: center; background: var(--chip-2-bg); color: var(--chip-2-text); flex-shrink: 0; }
.tool-tile:nth-child(3n+2) .tool-icon { background: var(--chip-1-bg); color: var(--chip-1-text); }
.tool-tile:nth-child(3n+3) .tool-icon { background: var(--chip-4-bg); color: var(--chip-4-text); }

.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); text-align: left; min-height: 60px; transition: border-color .15s, background .15s; }
.choice:hover { border-color: var(--accent-2-deep); background: var(--surface-alt); }
.choice > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.choice small { color: var(--text-muted); font-size: .82rem; font-weight: 400; }
.choice-icon { display: inline-flex; width: 42px; height: 42px; border-radius: 12px; align-items: center; justify-content: center; background: var(--chip-2-bg); color: var(--chip-2-text); flex-shrink: 0; }
.doctor-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.doctor-steps { display: inline-flex; gap: 5px; }
.doctor-steps i { width: 10px; height: 10px; border-radius: 50%; background: var(--progress-track); border: 1px solid var(--btn-ghost-border); }
.doctor-steps i.on { background: var(--accent-1-deep); border-color: var(--accent-1-deep); }
.doctor-card { max-width: 760px; }
.doctor-q { font-size: 1.45rem; margin: 6px 0 10px; }
.doctor-result p { margin-bottom: 6px; }

.species-field { position: relative; }
.species-results { position: absolute; left: 0; right: 0; top: calc(100% - 20px); z-index: 20; max-height: 280px; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lift); padding: 4px; }
.species-option { display: flex; flex-direction: column; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; min-height: 44px; }
.species-option span { font-size: .8rem; color: var(--text-muted); font-style: italic; }
.species-option:hover, .species-option.active { background: var(--chip-2-bg); color: var(--chip-2-text); }
.species-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .species-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .species-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.species-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-align: left; box-shadow: var(--shadow); min-width: 0; }
.species-card:hover { border-color: var(--border-accent); }
.species-card em { font-size: .8rem; color: var(--text-muted); }
.species-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-family: var(--font-display); font-size: 1.1rem; }
.species-card-top strong { font-weight: 400; overflow-wrap: anywhere; }

.light-result { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; margin: 10px 0; }
.light-result svg { color: var(--accent-1-deep); }
.light-scale { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.light-scale span { text-align: center; font-size: .7rem; padding: 6px 2px; border-radius: 8px; background: var(--progress-track); color: var(--text-muted); font-weight: 600; line-height: 1.2; }
.light-scale span.on { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
.calc-out { display: block; margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--callout-bg); font-size: .925rem; }
.calc-out .plain-list li { padding: 4px 0; }

.label-sheet { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.plant-label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px dashed var(--border-accent); border-radius: 12px; background: var(--surface); break-inside: avoid; page-break-inside: avoid; }
.label-stake { width: 320px; max-width: 100%; }
.label-card { width: 400px; max-width: 100%; padding: 14px 16px; }
.plant-label-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.plant-label-name { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; line-height: 1.15; overflow-wrap: anywhere; }
.plant-label-text em { font-size: .78rem; color: var(--text-muted); }
.plant-label-care { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: .75rem; margin-top: 4px; }
.plant-label-qr { flex-shrink: 0; line-height: 0; }
.plant-label-qr .qr { display: block; }

.sitter-sheet { margin-top: 20px; }
.sitter-sheet h2 { margin-bottom: 6px; }
.sitter-sheet h3 { margin: 18px 0 8px; font-size: 1.2rem; }
.sitter-note { white-space: pre-wrap; margin: 10px 0; padding: 10px 12px; border-radius: 10px; background: var(--callout-bg); }
.sitter-rule { display: flex; gap: 6px; align-items: flex-start; font-weight: 500; margin: 8px 0; }
.sitter-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.sitter-table th, .sitter-table td { text-align: left; vertical-align: top; padding: 8px; border-bottom: 1px solid var(--divider); }
.sitter-table th { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.sitter-table img { float: left; margin-right: 8px; border-radius: 8px; object-fit: cover; }
.sitter-foot { margin-top: 16px; font-size: .8rem; color: var(--text-muted); }
@media (max-width: 560px) {
  .sitter-table thead { display: none; }
  .sitter-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--divider); }
  .sitter-table td { display: block; border: 0; padding: 2px 0; }
}

.review-card { max-width: 620px; margin: 0 auto; padding: 28px 24px; border-radius: 26px; background: var(--hero-bg); border: 1.5px solid var(--hero-border); box-shadow: var(--shadow); }
.review-eyebrow { color: var(--text-muted); font-weight: 600; }
.review-year { font-family: var(--font-display); font-size: clamp(3.5rem, 12vw, 6rem); line-height: 1; color: var(--heading); }
.review-lead { margin: 8px 0 18px; }
.review-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .review-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.review-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.review-tile svg { color: var(--accent-1-deep); }
.review-tile strong { font-family: var(--font-display); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.review-tile span { font-size: .8rem; color: var(--text-muted); }
.review-facts { list-style: none; margin-top: 16px; }
.review-facts li { padding: 4px 0; }
.review-foot { margin-top: 16px; font-size: .8rem; color: var(--text-muted); }

.report-plant { padding: 14px 0; border-bottom: 1px solid var(--divider); break-inside: avoid; page-break-inside: avoid; }
.report-plant header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.report-plant header img { border-radius: 10px; object-fit: cover; }
.report-plant h3 { font-size: 1.2rem; }
.report-plant header p { font-size: .85rem; color: var(--text-muted); }
.report-plant dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 16px; font-size: .875rem; }
.report-plant dt { font-weight: 600; font-size: .75rem; color: var(--text-muted); }
.report-notes { font-size: .875rem; margin-top: 6px; white-space: pre-wrap; }
.print-only { display: none; }

/* ---------- Settings ---------- */
.start-here { margin-bottom: var(--gap); }
.theme-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 8px; }
.theme-option { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border-radius: var(--radius); border: 1.5px solid var(--border); background: var(--surface); font-size: .85rem; font-weight: 600; text-align: left; }
.theme-option.is-on { border-color: var(--accent-1-deep); box-shadow: 0 0 0 2px var(--callout-bg); }
.theme-swatch { display: flex; width: 100%; height: 26px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0, 0, 0, .08); }
.theme-swatch i { flex: 1; }
.danger-card { border-color: var(--danger-bg); }
.sync-code { font-family: var(--font-display); font-size: 2.6rem; letter-spacing: .12em; text-align: center; margin: 8px 0; color: var(--heading); font-variant-numeric: tabular-nums; }
.sync-code-input { font-size: 1.6rem; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }
.sync-pics { display: flex; justify-content: center; gap: 22px; margin: 14px 0; flex-wrap: wrap; }
.sync-pics > span { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sync-pic { font-size: 2.6rem; line-height: 1; }
.sync-key { display: block; width: 100%; font-family: ui-monospace, 'Cascadia Mono', Menlo, monospace; font-size: .95rem; letter-spacing: .04em; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); text-align: left; overflow-wrap: anywhere; }
.sync-key-hidden { color: transparent; text-shadow: 0 0 10px var(--text-muted); user-select: none; }
.faq summary { font-size: 1.05rem; }

/* ---------- Modal, toast, misc ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center; background: rgba(18, 18, 22, .45); opacity: 0; transition: opacity .2s ease; }
.modal-backdrop.open { opacity: 1; }
.modal { width: 100%; min-width: 0; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); color: var(--text); border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(24px); transition: transform .22s ease; }
.modal-backdrop.open .modal { transform: none; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-width: 540px; border-radius: 22px; padding: 22px 24px; }
  .modal-wide { max-width: 720px; }
}
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; position: sticky; top: -20px; padding-top: 2px; background: var(--surface); z-index: 2; }
.modal-header h2 { font-size: 1.45rem; }
.modal-close { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; align-items: center; justify-content: center; background: var(--surface-alt); flex-shrink: 0; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

.toast-container { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 88px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 450; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
@media (min-width: 1024px) { .toast-container { bottom: 32px; left: auto; right: 104px; transform: none; } }
.toast { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px; background: var(--text); color: var(--surface); font-size: .9rem; box-shadow: var(--shadow-lift); pointer-events: auto; animation: toast-in .22s ease; transition: opacity .25s, transform .25s; }
.toast.leaving { opacity: 0; transform: translateY(6px); }
.toast-action { color: var(--surface); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; flex-shrink: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty-state { text-align: center; padding: 36px 16px; }
.empty-state .empty-icon { display: inline-flex; width: 76px; height: 76px; border-radius: 50%; align-items: center; justify-content: center; background: var(--chip-2-bg); color: var(--chip-2-text); margin-bottom: 14px; }
.empty-state h3, .empty-state h1 { font-size: 1.4rem; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); max-width: 44ch; margin: 0 auto 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--surface) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: skeleton 1.4s infinite; border-radius: 12px; }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.install-card { margin-bottom: var(--gap); }
.install-card + .grid-dash, .hero + .grid-dash { margin-top: 0; }
.callout + .grid-dash { margin-top: var(--gap); }

/* ---------- Demo hooks (inert in the paid app) ---------- */
html.is-demo .demo-hide { display: none !important; }
.demo-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 8px 16px; background: var(--callout-bg); border-bottom: 1px solid var(--callout-border); color: var(--text); font-size: .875rem; text-align: center; }
@media (min-width: 1024px) { .demo-bar { margin-left: var(--sidebar-w); } }

/* ---------- Comfort modes ---------- */
html[data-lowstim="on"] .hero-art-wrap { display: none; }
html[data-lowstim="on"] .hero { background: var(--surface); border-color: var(--border); }
html[data-lowstim="on"] .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "foot"; }
html[data-lowstim="on"] *, html[data-lowstim="on"] *::before, html[data-lowstim="on"] *::after { animation: none !important; transition: none !important; }
html[data-lowstim="on"] .plant-card:hover, html[data-lowstim="on"] .fab:hover { transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (hover: none) {
  .plant-card:hover { transform: none; box-shadow: var(--shadow); }
  .fab:hover { transform: none; }
}

/* ---------- Print ---------- */
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; color: #000 !important; }
  .sidebar, .bottom-nav, .fab, .toast-container, #update-banner, .demo-bar, .modal-backdrop, .no-print, .tab-bar, .page-header-actions, .btn, .hero-art-wrap, .back-link { display: none !important; }
  #app-root { padding: 0 !important; }
  #app-main { padding: 0 !important; max-width: none; }
  .page { animation: none; }
  .card, .stat, .plant-card, .task-row, .hero, .review-card { box-shadow: none !important; break-inside: avoid; border-color: #ccc !important; }
  .hero { background: #fff !important; }
  .hero-grid, .grid-dash, .grid-2-lg { display: block !important; }
  .print-only { display: block; }
  .print-area { margin: 0 !important; }
  .label-sheet { gap: 4mm; }
  .plant-label { border: 1px dashed #888; color: #000; background: #fff; }
  .plant-label-text em, .sitter-foot, .sitter-table th { color: #333 !important; }
  a { color: #000; text-decoration: none; }
  .sitter-note { background: #f3f3f3 !important; }
}
