/* Rooted: a garden plan and logbook. Quiet neutral chrome; the plan carries the color. */
:root {
  color-scheme: light;
  /* Neutral ramp, a touch toward leaf green */
  --bg: #f3f4f1;
  --surface: #ffffff;
  --surface-2: #eceeea;
  --surface-3: #e2e5e0;
  --line: rgba(24, 33, 27, .09);
  --line-strong: rgba(24, 33, 27, .16);
  --text: #1b221e;
  --text-2: #4b5650;
  --text-3: #66706a;
  /* One accent from the garden: leaf green. Earth only for harvest figures */
  --accent: #2e5c45;
  --accent-strong: #234a37;
  --accent-wash: #e5ede7;
  --earth: #8a5a34;
  --danger: #a3453c;
  --danger-wash: #f6e9e6;
  --warn: #8a6420;
  --warn-wash: #f5eedf;
  /* Plan material: soil, bed and plant */
  --plan-paper: #f7f7f2;
  --plan-grid: rgba(56, 80, 62, .10);
  --bed-fill: #c9d8bd;
  --bed-edge: #7c9670;
  --plant: #2e5c45;
  /* Older names used across the file */
  --forest: var(--accent);
  --forest-deep: var(--text);
  --forest-soft: var(--text-2);
  --sage: #b9c9b5;
  --sage-wash: var(--accent-wash);
  --cream: var(--bg);
  --paper: var(--surface);
  --ink: var(--text);
  --muted: var(--text-3);
  --gold: #c9a35c;
  --shadow: 0 1px 2px rgba(20, 28, 24, .05), 0 2px 8px rgba(20, 28, 24, .03);
  --glass: var(--surface);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --fast: 120ms;
  --base: 200ms;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: #cfdccf; color: var(--text); }
h1, h2, h3, h4 { font-weight: 500; }
strong, b { font-weight: 500; }

.app-root { min-height: 100vh; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.icon { display: inline-flex; width: 16px; height: 16px; flex: none; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand { display: inline-flex; gap: 8px; align-items: center; text-decoration: none; color: var(--text); }
.brand-mark { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #f4f6f2; background: var(--accent); }
.brand-mark svg { width: 18px; height: 18px; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.eyebrow { margin: 0 0 4px; color: var(--text-3); font-size: 13px; font-weight: 400; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.glass { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 12px 16px; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar .brand { padding: 0 8px 24px; }
.nav-section-label { padding: 0 8px; margin: 0 0 8px; color: var(--text-3); font-size: 12px; font-weight: 400; }
.side-nav { display: grid; gap: 2px; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 36px; width: 100%; padding: 0 8px; color: var(--text-2); background: none; border: 0; border-radius: 8px; text-align: left; font-size: 14px; font-weight: 400; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; }
.nav-item[aria-current="page"] .icon { color: var(--accent); }
.nav-item .icon { width: 16px; height: 16px; color: var(--text-3); }
.sidebar-spacer { flex: 1; min-height: 12px; }
.sidebar > .brand, .sidebar > .nav-section-label, .sidebar-note, .sidebar > .profile { flex-shrink: 0; }
.sidebar-note { display: none; }
.profile { display: flex; align-items: center; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 500; }
.profile-copy small { color: var(--text-3); font-size: 12px; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button .icon { width: 16px; height: 16px; }
.mobile-logout { display: none; }

.workspace { min-width: 0; }
.topbar { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px clamp(24px, 3vw, 40px); border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .brand { display: none; }
.topbar-greeting { color: var(--text-3); font-size: 13px; }
.topbar-greeting strong { display: inline; color: var(--text); font-size: 13px; font-weight: 500; margin: 0 0 0 4px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.date-pill, .status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; color: var(--text-3); font-size: 13px; font-weight: 400; white-space: nowrap; }
.date-pill .icon { color: var(--text-3); }
.status-dot { width: 6px; height: 6px; background: #4f8a5e; border-radius: 50%; }
.content { width: min(100%, 1520px); margin: 0 auto; padding: 32px clamp(24px, 3vw, 40px) 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 2.4vw, 32px); font-weight: 500; letter-spacing: -.015em; line-height: 1.15; color: var(--text); }
.page-head p:last-child { margin: 8px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-3); }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; font-size: 14px; font-weight: 500; text-decoration: none; line-height: 1.2; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease); }
.button:active:not(:disabled) { transform: scale(.98); }
.button .icon { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover:not(:disabled) { background: var(--accent-strong); }
.button-plain { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.button-plain:hover:not(:disabled) { background: var(--surface-2); }
.button-tonal { color: var(--text); background: var(--surface-2); }
.button-tonal:hover:not(:disabled) { background: var(--surface-3); }
.button-danger { color: var(--danger); background: var(--danger-wash); }
.button-block { width: 100%; }

.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { display: flex; align-items: center; min-height: 0; padding: 16px 20px; border-radius: 12px; }
.stat-icon { display: none; }
.stat > div { display: flex; flex-direction: column-reverse; gap: 4px; }
.stat strong { display: block; font-size: 26px; font-weight: 500; letter-spacing: -.01em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span:last-child { color: var(--text-3); font-size: 13px; }

.garden-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.board-card { min-width: 0; overflow: hidden; border-radius: 12px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 20px 16px; }
.board-head h2, .detail-card h2, .section-card h2 { margin: 0; color: var(--text); font-size: 16px; font-weight: 500; }
.board-head p { margin: 4px 0 0; font-size: 13px; color: var(--text-3); }
.board-head .icon-button { width: 32px; height: 32px; }
.board-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 16px; }
.mode-group { display: inline-flex; gap: 2px; padding: 2px; background: var(--surface-2); border-radius: 8px; }
.mode-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; color: var(--text-2); background: transparent; border: 0; border-radius: 6px; font-size: 13px; font-weight: 400; white-space: nowrap; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.mode-button:hover { color: var(--text); }
.mode-button .icon { width: 14px; height: 14px; }
.mode-button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(20,28,24,.06); font-weight: 500; }
.toolbar-note { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* The plan: the one place with color and material */
.map-wrap { background: var(--surface-2); border-top: 1px solid var(--line); }
.map-scroll { max-height: 70vh; overflow: auto; padding: 24px; }
.map-frame { position: relative; margin: auto; padding-right: 28px; padding-bottom: 28px; }
.map-surface { position: relative; width: 100%; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--plan-paper); box-shadow: 0 1px 2px rgba(20,28,24,.06), 0 8px 24px rgba(20,28,24,.06); user-select: none; }
.map-surface.mode-draw, .map-surface.mode-plant { cursor: crosshair; touch-action: none; }
.map-grid-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: .7; }
.map-empty-hint { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; pointer-events: none; text-align: center; color: var(--text-3); font-size: 13px; }
.map-empty-hint .icon { margin: auto; width: 24px; height: 24px; opacity: .7; }
.map-empty-hint strong { color: var(--text-2); font-size: 14px; }
.map-axis-x, .map-axis-y { position: absolute; color: var(--text-3); font-family: var(--mono); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.map-axis-x { left: 0; right: 28px; bottom: 4px; display: flex; justify-content: space-between; }
.map-axis-y { top: 0; bottom: 28px; right: 0; writing-mode: vertical-rl; display: flex; justify-content: space-between; }
.bed-shape { position: absolute; z-index: 1; display: grid; place-items: start; align-content: start; gap: 2px; min-width: 4px; min-height: 4px; padding: 4px 6px; overflow: hidden; border: 1.5px solid var(--bed-edge); border-radius: 4px; background-color: var(--bed-fill); background-image: radial-gradient(rgba(70, 96, 58, .22) 1px, transparent 1.5px); background-size: 8px 8px; color: #2f4733; text-align: left; font-size: 11px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; transition: border-color var(--fast) var(--ease), background-color var(--fast) var(--ease); }
.bed-shape:hover, .bed-shape.is-selected { border-color: var(--accent-strong); background-color: #bdd0ae; box-shadow: 0 0 0 3px rgba(46, 92, 69, .16); }
.bed-shape span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.plant-point { position: absolute; z-index: 3; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; transform: translate(-50%, -50%); border: 2px solid #fff; border-radius: 50%; background: var(--plant); color: #fff; box-shadow: 0 1px 3px rgba(20, 40, 28, .3); transition: background-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.plant-point:hover, .plant-point.is-selected { background: var(--earth); box-shadow: 0 0 0 3px rgba(138, 90, 52, .22), 0 1px 3px rgba(20, 40, 28, .3); }
.plant-point .icon { width: 11px; height: 11px; }
.map-draft { position: absolute; z-index: 2; border: 1.5px dashed var(--accent); border-radius: 4px; background: rgba(46, 92, 69, .10); pointer-events: none; }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-3); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 12px; height: 12px; border: 1.5px solid var(--bed-edge); border-radius: 2px; background: var(--bed-fill); }
.legend-dot { width: 12px; height: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--plant); box-shadow: 0 0 0 1px var(--line-strong); }
.board-foot > span:last-child { color: var(--text-3); font-size: 12px; text-align: right; }
.detail-card { border-radius: 12px; padding: 20px; min-height: 0; }
.detail-card .detail-icon { display: grid; place-items: center; width: 32px; height: 32px; margin-bottom: 12px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; }
.detail-card .detail-icon .icon { width: 16px; height: 16px; }
.detail-card p { color: var(--text-3); font-size: 13px; line-height: 1.55; }
.detail-card .button { margin-top: 12px; }
.detail-kicker { margin: 0 0 4px !important; color: var(--text-3) !important; font-size: 12px !important; font-weight: 400; }
.detail-list { display: grid; gap: 8px; margin: 16px 0 8px; }
.detail-list > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; font-size: 13px; }
.detail-list dt { color: var(--text-3); }
.detail-list dd { margin: 0; color: var(--text); text-align: right; font-family: var(--mono); font-size: 12px; font-weight: 400; font-variant-numeric: tabular-nums; }
.step-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.step-list li { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.step-number { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-3); font-size: 11px; font-weight: 500; }
.step-done .step-number { color: #fff; background: var(--accent); border-color: var(--accent); }
.garden-switcher { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.garden-chip { min-height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 400; transition: background-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.garden-chip:hover { background: var(--surface-2); }
.garden-chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 500; }
.garden-chip-add { width: 32px; padding: 0; font-size: 18px; line-height: 1; }

.section-card { padding: 24px; border-radius: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13px; }
.section-head > .icon { color: var(--text-3); }
.journal-list, .people-list { display: grid; gap: 8px; }
.journal-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.journal-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; color: var(--text-2); background: var(--surface-2); }
.journal-item strong { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.journal-item p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.journal-edit { min-height: 32px; margin-top: 12px; padding-inline: 10px; font-size: 13px; }
.journal-date { color: var(--text-3); font-family: var(--mono); font-size: 12px; font-weight: 400; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty-state { display: grid; justify-items: center; padding: 48px 24px; color: var(--text-3); text-align: center; }
.empty-state .empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 16px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); }
.empty-state .empty-icon .icon { width: 20px; height: 20px; }
.empty-state h2, .empty-state h3 { margin: 0 0 4px; color: var(--text); font-size: 16px; font-weight: 500; }
.empty-state p { max-width: 320px; margin: 0 0 16px; font-size: 13px; line-height: 1.55; }
.person-card { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.person-card .avatar { grid-row: span 2; width: 36px; height: 36px; }
.person-name { align-self: end; font-size: 14px; font-weight: 500; }
.person-role { color: var(--text-3); font-size: 13px; }
.permission-list { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.permission-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text-2); text-align: left; font-size: 13px; font-weight: 400; transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.permission-toggle[aria-pressed="true"] { color: var(--text); background: var(--accent-wash); border-color: rgba(46, 92, 69, .28); }
.permission-toggle .toggle-dot { width: 16px; height: 16px; flex: none; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); }
.permission-toggle[aria-pressed="true"] .toggle-dot { border: 5px solid var(--accent); }
.permission-toggle:disabled { opacity: .7; }
.help-copy { line-height: 1.65; color: var(--text-2); font-size: 14px; }
.help-copy ol { padding-left: 20px; }
.help-copy li { margin: 8px 0; }
.help-copy strong { color: var(--text); }

/* Sign-in: a small, true garden plan beside the form */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.login-art { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; min-height: 100vh; overflow: hidden; padding: 40px clamp(32px, 4vw, 64px); background: var(--surface-2); color: var(--text); border-right: 1px solid var(--line); }
.login-art .brand { color: var(--text); position: relative; z-index: 2; }
.login-visual { position: relative; z-index: 1; width: min(100%, 520px); aspect-ratio: 3 / 2; margin: 0 auto; border: 1px solid var(--line-strong); border-radius: 4px; background-color: var(--plan-paper); background-image: linear-gradient(var(--plan-grid) 1px, transparent 1px), linear-gradient(90deg, var(--plan-grid) 1px, transparent 1px); background-size: 24px 24px; box-shadow: 0 1px 2px rgba(20,28,24,.06), 0 16px 40px rgba(20,28,24,.08); }
.login-visual::before { content: "1800 × 1200 cm"; position: absolute; right: 12px; bottom: 8px; color: var(--text-3); font-family: var(--mono); font-size: 11px; }
.login-visual::after { content: ""; position: absolute; left: 8%; top: 62%; width: 46%; height: 18%; border: 1.5px solid var(--bed-edge); border-radius: 4px; background-color: var(--bed-fill); background-image: radial-gradient(rgba(70, 96, 58, .22) 1px, transparent 1.5px); background-size: 8px 8px; }
.login-plot { position: absolute; left: 60%; top: 14%; width: 30%; height: 40%; border: 1.5px solid var(--bed-edge); border-radius: 4px; background-color: var(--bed-fill); background-image: radial-gradient(rgba(70, 96, 58, .22) 1px, transparent 1.5px); background-size: 8px 8px; }
.login-seed { position: absolute; z-index: 2; width: 16px; height: 16px; border: 2px solid #fff; border-radius: 50%; background: var(--plant); box-shadow: 0 1px 3px rgba(20, 40, 28, .3); }
.login-seed.one { left: 68%; top: 26%; }
.login-seed.two { left: 80%; top: 40%; background: var(--earth); }
.login-art-copy { position: relative; z-index: 2; max-width: 520px; }
.login-art-copy h1 { margin: 0 0 12px; font-size: clamp(28px, 2.6vw, 36px); line-height: 1.15; letter-spacing: -.015em; font-weight: 500; }
.login-art-copy p:last-child { max-width: 440px; margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.6; }
.login-form-pane { display: grid; place-items: center; padding: 24px clamp(24px, 5vw, 80px); background: var(--surface); }
.login-form-wrap { width: min(100%, 360px); }
.login-form-wrap .eyebrow { margin-bottom: 8px; }
.login-form-wrap h2 { margin: 0 0 8px; color: var(--text); font-size: 24px; font-weight: 500; line-height: 1.2; }
.login-form-wrap > p { color: var(--text-3); font-size: 14px; line-height: 1.55; margin: 0 0 32px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; min-height: 40px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
.field textarea { min-height: 112px; padding: 8px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(46, 92, 69, .14); }
.field input::placeholder, .field textarea::placeholder { color: #9aa29c; }
.field-help { margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.field-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.login-form .button { min-height: 40px; margin-top: 8px; }
.login-alt { margin-top: 16px; display: grid; gap: 12px; }
.login-alt > span { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; }
.login-alt > span::before, .login-alt > span::after { content: ""; flex: 1; height: 1px; background: var(--line, currentColor); opacity: .4; }
.profile-link { display: block; padding: 0; border: 0; background: none; color: var(--accent, inherit); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.login-foot { margin-top: 24px; display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.login-foot .icon { width: 14px; height: 14px; }
.form-error { margin: 0 0 16px; padding: 8px 12px; border-radius: 8px; background: var(--danger-wash); color: var(--danger); font-size: 13px; line-height: 1.5; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20, 28, 24, .32); }
.modal { width: min(100%, 520px); max-height: min(90vh, 860px); overflow: auto; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(20, 28, 24, .18); animation: rise var(--base) var(--ease); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 16px; }
.modal-head h2 { margin: 0; color: var(--text); font-size: 20px; font-weight: 500; line-height: 1.25; }
.modal-head p { margin: 8px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.55; }
.modal-body { padding: 8px 24px 24px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.modal-actions .button { min-width: 96px; }
.modal .permission-list { margin: 8px 0 20px; }
.modal .checkbox-line { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--text-2); font-size: 13px; }
.modal .checkbox-line input { accent-color: var(--accent); width: 16px; height: 16px; }
.modal-tip { display: flex; gap: 8px; padding: 12px; margin: 0 0 16px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 13px; line-height: 1.5; }
.modal-tip .icon { width: 16px; height: 16px; color: var(--text-3); }
.toast-region { position: fixed; z-index: 50; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; border-radius: 10px; color: #fff; background: var(--text); box-shadow: 0 8px 24px rgba(20, 28, 24, .18); font-size: 13px; line-height: 1.45; pointer-events: auto; animation: rise var(--base) var(--ease); }
.toast.error { background: var(--danger); }
.toast .icon { width: 16px; height: 16px; margin-top: 1px; }
.mobile-nav { display: none; }
.loading-page { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--text-3); }
.loading-ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.content > .page-head, .content > section { animation: rise var(--base) var(--ease) both; }

@media (max-width: 1120px) {
  .garden-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-card { min-height: unset; }
  .detail-list { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .detail-list > div { display: block; }
  .detail-list dd { margin-top: 4px; text-align: left; }
}

@media (max-width: 800px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 56px; padding: 8px 16px; }
  .topbar .brand { display: inline-flex; }
  .mobile-logout { display: inline-grid; }
  .topbar .icon-button { width: 40px; height: 40px; }
  .topbar-greeting { display: none; }
  .date-pill { display: none; }
  .content { padding: 24px 16px calc(96px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px 8px max(4px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-nav button { min-height: 52px; display: grid; align-content: center; justify-items: center; gap: 4px; color: var(--text-3); background: none; border: 0; border-radius: 8px; font-size: 11px; font-weight: 400; }
  .mobile-nav button[aria-current="page"] { color: var(--accent); font-weight: 500; }
  .mobile-nav .icon { width: 18px; height: 18px; }
  .toast-region { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (max-width: 600px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-head h1 { font-size: 26px; }
  .head-actions { width: 100%; justify-content: flex-start; }
  .stat-row { gap: 8px; }
  .stat { padding: 12px; border-radius: 10px; }
  .stat strong { font-size: 20px; }
  .stat span:last-child { font-size: 12px; }
  .board-card, .detail-card, .section-card { border-radius: 12px; }
  .board-head { padding: 16px 16px 12px; }
  .board-toolbar { padding: 0 12px 12px; }
  .mode-group { width: 100%; }
  .mode-button { justify-content: center; flex: 1; min-height: 40px; font-size: 12px; padding: 0 4px; }
  .garden-chip { min-height: 40px; }
  .garden-chip-add { width: 40px; }
  .toolbar-note { display: none; }
  .map-scroll { padding: 12px; max-height: 56vh; }
  .map-frame { padding-right: 20px; padding-bottom: 20px; }
  .board-foot { padding: 12px 16px; }
  .board-foot > span:last-child { display: none; }
  .detail-card, .section-card { padding: 16px; }
  .detail-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .permission-list { grid-template-columns: 1fr; }
  .journal-item { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .journal-date { grid-column: 2; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 20px 16px 12px; }
  .modal-body { padding: 4px 16px 20px; }
  .field-grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 760px) {
  .login-page { display: block; }
  .login-art { min-height: 0; padding: 24px 16px; gap: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-visual { width: 100%; }
  .login-art-copy h1 { font-size: 24px; margin-bottom: 8px; }
  .login-art-copy p:last-child { font-size: 14px; }
  .login-form-pane { padding: 32px 16px 64px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Profiles, catalog, journal filters and the daily overview. */
.plant-list { display: grid; gap: 12px; }
.plant-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plant-card .detail-icon { color: var(--text-2); width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; }
.plant-card h2 { font-size: 16px; overflow-wrap: anywhere; }
.plant-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 8px; margin-left: 8px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; white-space: normal; }
.profile-summary > .tag { margin-left: 0; }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-summary p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.profile-summary .head-actions { justify-content: flex-start; }
.timeline-heading { margin-top: 28px; color: var(--forest); font-size: 16px; }
.more-menu { display: grid; gap: 8px; padding: 4px 0 16px; }
.harvest-quantity { display: inline-block; color: var(--earth); font-family: var(--mono); font-variant-numeric: tabular-nums; margin-left: 8px; font-size: 13px; font-weight: 500; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.filter-bar .field { flex: 1 1 140px; min-width: 0; margin: 0; }
.filter-bar .filter-search { flex-grow: 2; flex-basis: 220px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar.compact { justify-content: flex-start; }
.filter-bar.compact .field { flex: 0 1 170px; }
.result-count { color: var(--muted); margin: -3px 0 16px; font-size: 13px; }
.harvest-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.harvest-totals > div { padding: 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.harvest-totals strong { display: block; color: var(--earth); font-weight: 500; font-size: 26px; font-variant-numeric: tabular-nums; }
.harvest-totals small { font-size: 14px; letter-spacing: 0; }
.harvest-totals span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.spaced-card { margin-top: 16px; }
[hidden] { display: none !important; }

/* Map navigation and centimeter snapping. */
.mode-group { flex-wrap: wrap; }
.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; margin-top: 4px; }
.map-controls output { color: var(--forest); min-width: 52px; text-align: center; font-size: 13px; font-weight: 500; }
.map-controls label { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; }
.map-controls select { min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--forest); padding: 4px 8px; }
.map-frame { max-width: none; }
.map-surface.mode-pan { cursor: grab; touch-action: none; }
.map-surface.mode-pan:active { cursor: grabbing; }
.map-surface.mode-move-bed, .map-surface.mode-move-plant { cursor: move; touch-action: none; }
.bed-shape { align-content: end; gap: 0; }
.bed-shape small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: rgba(47, 71, 51, .8); font-family: var(--mono); font-size: 10px; font-weight: 400; pointer-events: none; }
.bed-shape.is-flat { overflow: visible; }
.bed-shape.is-flat > span, .bed-shape.is-flat > small { position: absolute; left: 0; bottom: calc(100% + 2px); display: none; }
.bed-shape.is-flat > span { display: block; max-width: none; padding: 0 2px; color: #2f4733; text-shadow: 0 0 2px #fff, 0 0 4px #fff; }
.plant-map-label.is-hidden, .bed-shape small.is-hidden { visibility: hidden; }
.plant-map-label { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); max-width: 120px; padding: 0 2px; color: var(--text); font-size: 11px; font-weight: 500; text-shadow: 0 0 2px #fff, 0 0 4px #fff, 0 0 6px rgba(255,255,255,.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; }
.sidebar { overflow-y: auto; }
.sidebar .brand { padding-bottom: 24px; }
.sidebar-note { margin-top: 16px; }
.modal .journal-item { grid-template-columns: 33px minmax(0, 1fr); }
.modal .journal-item .journal-date { grid-column: 2; }
@media (max-width: 600px) {
  .plant-card { grid-template-columns: 37px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .plant-card > .button { grid-column: 2; justify-self: start; }
  .plant-card .detail-icon { width: 37px; height: 37px; }
  .filter-bar .field, .filter-bar .filter-search { flex-basis: calc(50% - 8px); }
  .filter-bar .filter-search { flex-basis: 100%; }
  .filter-actions { width: 100%; }
  .filter-actions .button { flex: 1; }
  .harvest-totals { gap: 8px; }
  .harvest-totals > div { padding: 12px; }
  .harvest-totals strong { font-size: 22px; }
  .harvest-totals small { font-size: 12px; }
  .map-controls .icon-button { width: 42px; height: 42px; }
  .map-controls label { margin-left: 0; }
  .mode-group { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mode-group .mode-button { white-space: normal; }
}

/* Tasks, preserved history and local data downloads. */
.task-list { display: grid; gap: 12px; }
.task-card { display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.task-state { display: grid; place-items: center; width: 35px; height: 35px; color: var(--text-2); background: var(--surface-2); border-radius: 10px; }
.task-card h3 { margin: 0; color: var(--forest-deep); font-size: 14px; overflow-wrap: anywhere; }
.task-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.task-card.is-done { background: var(--surface-2); }
.task-card.is-done .task-state { background: var(--accent-wash); }
.overdue { color: var(--danger); font-weight: 500; }
.week-day { display: grid; gap: 8px; border-bottom: 1px solid var(--line); padding: 4px 0 16px; }
.week-day > h3 { font-size: 14px; color: var(--forest); margin: 8px 0 4px; }
.week-day > p { margin: 0; }
.archive-heading { margin: 24px 0 16px !important; }
.archive-tag { background: var(--surface-2); color: var(--text-2); }
.export-list { display: grid; gap: 12px; }
.export-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.export-card .detail-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--forest); background: var(--surface-2); }
.export-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.export-note { margin: 20px 0 0; }
@media (max-width: 1120px) {
  .task-card { grid-template-columns: 35px minmax(0, 1fr); }
  .task-card > .inline-actions { grid-column: 2; }
  .plant-card { grid-template-columns: 42px minmax(0, 1fr); }
  .plant-card > .inline-actions { grid-column: 2; }
}
@media (max-width: 600px) {
  .task-card { padding: 12px; gap: 8px; }
  .task-card .button { font-size: 12px; }
  .export-card { grid-template-columns: 35px minmax(0, 1fr); padding: 16px; gap: 12px; }
  .export-card > .button { grid-column: 2; justify-self: start; }
  .plant-card > .inline-actions { grid-column: 2; }
  .sidebar-note { display: none; }
}

/* Shared care selection, personal templates and dated locations. */
.section-card, .modal-body, .field { min-width: 0; }
.section-head > div, .page-head > div { min-width: 0; }
.section-head h2, .page-head h1, .page-head p { overflow-wrap: anywhere; }
.checkbox-line { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--forest-soft); font-size: 13px; line-height: 1.5; }
.checkbox-line input { width: 18px; height: 18px; flex: none; accent-color: var(--forest); }
.batch-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); align-items: end; gap: 12px 16px; margin: 0 0 24px; padding: 16px; border: 1px solid #cdddc6; border-radius: 12px; background: var(--surface-2); }
.batch-controls .field { margin: 0; }
.batch-controls > .inline-actions { justify-content: flex-end; }
.batch-controls > .field-help { grid-column: 1 / -1; color: var(--text-2); }
.plant-card.selectable { grid-template-columns: 28px 42px minmax(0, 1fr) auto; }
.plant-card.selectable:has(input:checked) { border-color: #8eaf88; background: var(--accent-wash); box-shadow: inset 0 0 0 1px rgba(75,116,72,.1); }
.plant-select { display: grid; place-items: center; width: 28px; min-height: 44px; cursor: pointer; }
.plant-select input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); cursor: pointer; }
.target-summary { margin: 0 0 20px; padding: 16px; border: 1px solid #cfdfc9; border-radius: 12px; background: var(--accent-wash); }
.target-summary > strong { display: block; color: var(--forest); font-size: 14px; }
.target-summary ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 12px 0 0; padding: 0; }
.target-summary li { max-width: 100%; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--forest-soft); font-size: 12px; overflow-wrap: anywhere; }
.template-list { display: grid; gap: 12px; margin-top: 16px; }
.template-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.template-card h2 { font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.template-card p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.template-card p > .tag { margin-left: 0; }
.template-card .inline-actions { justify-content: flex-end; }
.template-apply-actions { display: grid; gap: 8px; margin: 24px 0 3px; }
.template-apply-actions .button { min-height: 48px; padding: 12px 16px; white-space: normal; overflow-wrap: anywhere; }
.repeat-shortcuts { margin-top: 3px; }
.repeat-shortcuts .button { min-height: 38px; padding-inline: 12px; font-size: 12px; }
#task-next-preview { margin: 12px 0 16px; padding: 12px 16px; border-radius: 10px; background: var(--sage-wash); color: var(--forest-soft); font-size: 13px; line-height: 1.65; }
.location-list { display: grid; gap: 8px; margin-top: 16px; }
.location-entry { position: relative; padding: 16px 16px; border: 1px solid var(--line); border-left: 3px solid #a6bea0; border-radius: 12px; background: var(--surface); }
.location-entry > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.location-entry strong { color: var(--forest); font-size: 13px; }
.location-entry time { font-family: var(--mono); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.location-entry p { margin: 8px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.location-entry .field-help { color: var(--muted); font-size: 12px; }

/* Seven-day desktop calendar, with a readable day list on smaller screens. */
.calendar-navigation { display: grid; grid-template-columns: 42px minmax(0, 1fr) 42px auto; align-items: center; gap: 8px; margin: 3px 0 20px; }
.calendar-navigation h2 { text-align: center; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.calendar-navigation > .button { padding: 0 12px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.calendar-weekdays { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 2px; }
.calendar-weekdays span { color: var(--muted); font-size: 12px; font-weight: 500; text-align: center; padding-block: 8px; }
.calendar-day { min-width: 0; min-height: 112px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.calendar-grid.week .calendar-day { min-height: 180px; }
.calendar-day header { display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: start; gap: 4px; margin-bottom: 12px; }
.calendar-day time { font-family: var(--mono); color: var(--forest-soft); font-size: 12px; font-weight: 500; line-height: 1.6; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.calendar-day.is-today { border-color: #8aab80; background: var(--accent-wash); box-shadow: inset 0 0 0 1px rgba(72,109,68,.08); }
.calendar-day.is-today time { color: var(--forest-deep); }
.calendar-day.outside-month { background: var(--surface-2); }
.calendar-day.outside-month time { color: var(--text-3); }
.calendar-add { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--forest); background: var(--paper); font-size: 16px; }
.calendar-add:hover { background: var(--accent-wash); }
.calendar-task { display: block; width: 100%; min-height: 35px; margin-top: 8px; padding: 8px 8px; border: 1px solid #d5e1cd; border-radius: 8px; color: var(--forest); background: var(--accent-wash); text-align: left; font-size: 12px; font-weight: 500; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.calendar-task:hover { background: var(--accent-wash); }
.calendar-task.is-done { border-color: #dae0d3; color: var(--text-2); background: var(--surface-2); }
.calendar-task.overdue { border-color: #e8c9bd; color: var(--danger); background: #f8ece3; }
.calendar-daylist { display: none; }
.calendar-list-day { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.calendar-list-day.is-today { border-color: #9ebc95; background: var(--accent-wash); }
.calendar-list-day > .section-head { margin-bottom: 12px; }
.calendar-list-day h3 { margin: 0; color: var(--forest); font-size: 14px; line-height: 1.4; }
.calendar-list-day .task-card + .task-card { margin-top: 8px; }
.calendar-list-day > .muted { margin: 4px 0; }

/* Harvest quantities retain a separate scale for each unit. */
.harvest-charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 24px; }
.harvest-chart { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.harvest-chart h3 { margin: 0 0 16px; color: var(--forest); font-size: 13px; line-height: 1.4; }
.harvest-chart-row { display: grid; grid-template-columns: minmax(60px, .9fr) minmax(0, 1fr) minmax(28px, auto); align-items: center; gap: 8px; margin-top: 12px; }
.harvest-chart-row > span { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.harvest-chart-row > strong { min-width: 0; color: var(--forest); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.harvest-chart-row meter { width: 100%; min-width: 0; height: 13px; accent-color: #5f8859; }
.harvest-chart-row meter::-webkit-meter-bar { border: 0; border-radius: 8px; background: #e0e8d9; }
.harvest-chart-row meter::-webkit-meter-optimum-value { border-radius: 8px; background: var(--accent); }
.harvest-chart-row meter::-moz-meter-bar { border-radius: 8px; background: #638b59; }
.table-scroll { width: 100%; min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.data-table { width: 100%; min-width: 540px; border-collapse: collapse; color: var(--forest-soft); font-size: 13px; line-height: 1.55; }
.data-table caption { padding: 16px 16px; color: var(--muted); text-align: left; font-size: 12px; }
.data-table th, .data-table td { padding: 12px 16px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.data-table thead th { color: var(--forest); background: var(--surface-2); font-size: 12px; font-weight: 500; }
.data-table tbody th { color: var(--forest); font-weight: 500; }
.data-table tbody tr:nth-child(even) { background: rgba(240,243,232,.52); }
.data-table td { font-variant-numeric: tabular-nums; }
.data-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.data-table .button { min-height: 36px; padding-inline: 12px; font-size: 12px; white-space: normal; }

/* Garden work mode favors large controls and a calm, direct object selection. */
.work-card { background: var(--surface); }
.work-card > .field { max-width: 650px; }
.work-card > .field label { font-size: 14px; }
.work-card > .field select { min-height: 58px; padding-inline: 16px; border-radius: 12px; }
.work-object { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0 20px; padding: 16px 0 20px; border-bottom: 1px solid var(--line); color: var(--forest); }
.work-object > .icon { width: 26px; height: 26px; }
.work-object strong { flex: 1 1 160px; min-width: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.work-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.work-actions > .button { min-height: 90px; display: flex; flex-direction: column; gap: 12px; padding: 16px 12px; border-radius: 12px; font-size: 16px; white-space: normal; overflow-wrap: anywhere; }
.work-actions > .button .icon { width: 25px; height: 25px; }
.work-actions > .button[data-type="harvest"] { grid-column: span 2; }
.work-secondary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.work-secondary .button { min-height: 52px; padding: 12px 16px; font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.work-toggle[aria-pressed="true"] { border-color: #abc79f; background: var(--accent-wash); color: var(--forest-deep); }
.work-mode .content .button, .work-mode .modal .button { min-height: 52px; font-size: 14px; padding-block: 12px; white-space: normal; overflow-wrap: anywhere; }
.work-mode .work-actions > .button { min-height: 100px; font-size: 16px; }
.work-mode .field input, .work-mode .field select { min-height: 54px; font-size: 16px; }
.work-mode .checkbox-line { min-height: 48px; font-size: 14px; }
.work-mode .field-help { color: var(--text-2); font-size: 13px; }
.work-mode .mobile-nav button { min-height: 60px; }

/* A retained draft is compared explicitly before the form can be saved again. */
.conflict-panel { min-width: 0; margin: 0 0 20px; padding: 16px; border: 1px solid #dcc99c; border-radius: 12px; background: var(--warn-wash); }
.conflict-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.conflict-head h2, .conflict-head h3 { margin: 0; color: #685329; font-size: 16px; line-height: 1.35; }
.conflict-head > .icon { color: #967138; margin-top: 2px; }
.conflict-panel p { color: var(--text-2); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.conflict-context { margin: 16px 0; color: var(--text-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.conflict-context h4 { margin: 12px 0 4px; color: var(--text); font-size: 13px; }
.conflict-context ul { margin: 8px 0; padding-left: 16px; }
.conflict-panel .table-scroll { margin-top: 16px; border-color: #dacda9; background: var(--surface); }
.conflict-table { min-width: 0; table-layout: fixed; }
.conflict-table th, .conflict-table td { padding: 8px 8px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.conflict-table thead th { background: var(--surface-2); color: var(--text); }
.conflict-table th:first-child { width: 22%; }
.conflict-table th:last-child { width: 23%; }
.conflict-table tbody tr:nth-child(even) { background: var(--surface-2); }
.conflict-choice { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; color: var(--text-2); font-size: 12px; line-height: 1.5; cursor: pointer; }
.conflict-choice input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--forest); }
.conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.conflict-actions .button { flex: 1 1 160px; min-height: 46px; padding: 12px 12px; white-space: normal; overflow-wrap: anywhere; }
.conflict-status { margin: 12px 0 0; padding: 12px 12px; border-left: 3px solid #7e9f73; border-radius: 8px; background: var(--accent-wash); color: var(--forest) !important; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.conflict-status:empty { display: none; }

/* Seasons and observed phases keep their dates visible beside the context. */
.season-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.season-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.season-card h2 { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.season-card p { margin: 8px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.season-card .inline-actions { margin-top: 16px; }
.phase-current { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; padding: 12px 16px; border: 1px solid #cbdcc2; border-radius: 12px; background: var(--accent-wash); color: var(--forest); font-size: 13px; line-height: 1.6; }
.phase-list { display: grid; gap: 12px; margin-block: 16px; }
.phase-entry { min-width: 0; display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: start; gap: 12px; padding: 16px 16px; border: 1px solid var(--line); border-left: 3px solid #90ad87; border-radius: 12px; background: var(--surface); }
.phase-date { padding-top: 2px; line-height: 1.6; }
.phase-content { min-width: 0; }
.phase-content .inline-actions { margin-top: 12px; }
.phase-entry strong { color: var(--forest); font-size: 14px; }
.phase-entry time, .phase-entry small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.phase-entry p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Planned points use their own visual language, apart from the actual map. */
.plan-layout { display: grid; grid-template-columns: minmax(220px, .72fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.plan-sidebar, .plan-card, .plan-list { min-width: 0; }
.plan-sidebar { display: grid; gap: 12px; }
.plan-card { width: 100%; text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plan-card > strong { display: block; color: var(--forest); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.plan-card > span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.plan-card h2, .plan-card h3 { margin: 0; color: var(--forest); font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.plan-card p { color: var(--muted); margin: 8px 0 12px; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.plan-card[aria-current="true"], .plan-card[aria-pressed="true"], .plan-card.is-selected { border-color: #92ad86; background: var(--accent-wash); }
.plan-card .button { white-space: normal; overflow-wrap: anywhere; }
.plan-map { position: relative; width: 100%; min-width: 0; margin: 16px 0; overflow: hidden; border: 1px dashed #9eaf95; border-radius: 12px; background-color: var(--plan-paper); background-image: linear-gradient(var(--plan-grid) 1px, transparent 1px), linear-gradient(90deg, var(--plan-grid) 1px, transparent 1px); background-size: 24px 24px; }
.plan-bed { position: absolute; display: grid; place-items: center; min-width: 4px; min-height: 4px; padding: 3px; overflow: hidden; border: 1px solid #8fa47e; border-radius: 5px; background: rgba(165,187,145,.35); color: var(--text-2); font-size: 12px; text-align: center; overflow-wrap: anywhere; }
.plan-point { position: absolute; z-index: 2; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; transform: translate(-50%, -50%); border: 2px solid var(--paper); border-radius: 50%; background: #9b753c; color: #fffefa; box-shadow: 0 2px 8px rgba(109,81,39,.19); font-size: 12px; font-weight: 500; }
.plan-point:hover { background: #785727; }
.plan-point > .icon { width: 14px; height: 14px; }
.plan-point > span:not(.icon) { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 115px; padding: 3px 8px; border-radius: 8px; background: var(--surface); color: #755727; font-size: 12px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; pointer-events: none; }
.plan-point.transferred, .plan-point.is-transferred { background: #738d64; }
.plan-list { display: grid; gap: 12px; }
.plan-entry { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plan-entry:has(.plan-selection) { grid-template-columns: 28px minmax(0, 1fr) auto; }
.plan-selection { display: grid; place-items: center; min-height: 44px; cursor: pointer; }
.plan-selection input { width: 20px; height: 20px; margin: 0; accent-color: var(--forest); }
.plan-entry > div { min-width: 0; }
.plan-entry h3 { margin: 0; color: var(--forest); font-size: 14px; overflow-wrap: anywhere; }
.plan-entry p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.plan-status { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border-radius: 8px; color: #85632e; background: var(--surface-2); font-size: 12px; font-weight: 500; line-height: 1.4; }
.plan-status.transferred, .plan-status.is-transferred { color: var(--text-2); background: var(--accent-wash); }
.plan-transfer-preview { margin-block: 16px; padding: 16px; border: 1px solid #d6c79d; border-radius: 12px; background: #f8f3e4; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.plan-transfer-preview h3 { margin: 0 0 8px; color: #695129; font-size: 14px; }
.plan-transfer-preview p { margin: 8px 0; overflow-wrap: anywhere; }
.plan-transfer-entry { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.plan-transfer-entry > .checkbox-line { font-weight: 500; color: var(--forest); }
.plan-transfer-entry .field-grid { margin-top: 16px; }
.plan-transfer-entry .checkbox-line { align-items: flex-start; }
.plan-transfer-entry .checkbox-line input { margin-top: 2px; }

/* Supply fields describe one operation; the report keeps unlike units apart. */
.supply-fields { margin: 16px 0; padding: 16px; border: 1px solid #d3dfcb; border-radius: 12px; background: var(--surface-2); }
.supply-fields .field:last-child { margin-bottom: 0; }
.supply-note { margin: 12px 0; padding: 12px 16px; border-left: 3px solid #90ab82; border-radius: 8px; color: var(--text-2); background: #eef3e7; font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.supply-report { min-width: 0; }
.supply-report .table-scroll { margin-top: 16px; }
.supply-report h3 { margin: 24px 0 12px; color: var(--forest); font-size: 14px; }
.supply-report .harvest-totals strong { overflow-wrap: anywhere; }
.supply-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
.supply-total { min-width: 0; display: grid; gap: 8px; align-content: start; padding: 16px; border: 1px solid #d7e0cf; border-radius: 12px; background: var(--surface-2); }
.supply-total strong { color: var(--forest); font-size: 26px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.supply-total span { color: var(--forest-soft); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.supply-total small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.supply-report + .section-card .plant-card { grid-template-columns: minmax(0, 1fr) auto; }

/* Saved views belong to the current account; search targets stay identifiable. */
.saved-views { min-width: 0; margin: 16px 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.saved-views > .section-head { margin-bottom: 12px; }
.saved-views h3 { margin: 0; color: var(--forest); font-size: 14px; }
.saved-view-list { display: flex; flex-wrap: wrap; gap: 8px; }
.saved-view { min-width: 0; display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; max-width: 100%; padding: 4px; border: 1px solid #d0deca; border-radius: 10px; background: var(--surface); }
.saved-view .button { max-width: 100%; min-height: 38px; padding: 8px 8px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.saved-view .icon-button { width: 34px; height: 34px; border-radius: 8px; }
.search-results { display: grid; gap: 12px; margin-top: 20px; }
.search-result { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-result > div { min-width: 0; }
.search-result h2, .search-result h3 { margin: 0; color: var(--forest); font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.search-result p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.search-kind { display: inline-flex; margin: 0 0 8px; padding: 3px 8px; border-radius: 8px; color: var(--text-2); background: var(--surface-2); font-size: 12px; font-weight: 500; }

/* A separate printable sheet preserves its title and chosen filter context. */
.print-sheet { display: none; }
.modal .print-sheet { display: block; width: 100%; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.modal .print-table { table-layout: fixed; font-size: 12px; }
.print-preview-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 16px; }
.print-preview-controls .button { flex: 1 1 140px; white-space: normal; }
.printing .print-sheet { display: block; width: min(100%, 960px); margin: 24px auto; padding: 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); }
.print-heading { margin: 0 0 8px; color: var(--forest-deep); font-size: 28px; line-height: 1.2; overflow-wrap: anywhere; }
.print-heading h1 { margin: 8px 0 12px; font-size: 28px; line-height: 1.25; }
.print-heading > p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.print-meta { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.print-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.print-table th, .print-table td { padding: 8px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.print-table th { color: var(--forest); background: var(--surface-2); }
.print-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.print-label { min-width: 0; padding: 16px; border: 1px solid #aab8a0; border-radius: 10px; break-inside: avoid; }
.print-label strong { display: block; margin-bottom: 8px; font-size: 16px; overflow-wrap: anywhere; }
.print-label p { margin: 4px 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.print-label > span, .print-label > small { display: block; margin-top: 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.print-only { display: none; }

@media (max-width: 1120px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .plan-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-sidebar > .checkbox-line, .plan-sidebar > .plan-list { grid-column: 1 / -1; }
  .plan-sidebar > .plan-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-entry { grid-template-columns: minmax(0, 1fr); }
  .plan-entry:has(.plan-selection) { grid-template-columns: 28px minmax(0, 1fr); }
  .plan-entry:has(.plan-selection) > .inline-actions { grid-column: 2; }
  .plan-entry .inline-actions { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .season-grid, .plan-sidebar { grid-template-columns: minmax(0, 1fr); }
  .plan-sidebar > .plan-list { grid-template-columns: minmax(0, 1fr); }
  .season-card { padding: 16px; }
  .phase-entry, .search-result { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .phase-entry .inline-actions { justify-content: flex-start; }
  .search-result > .button { justify-self: start; }
  .search-kind { margin-left: 0; justify-self: start; }
  .plan-entry:has(.plan-selection) { grid-template-columns: minmax(0, 1fr); }
  .plan-entry:has(.plan-selection) > .inline-actions { grid-column: 1; }
  .plan-selection { justify-self: start; }
  .plan-card, .plan-entry, .plan-transfer-entry { padding: 16px; }
  .plan-entry .inline-actions .button, .season-card .inline-actions .button { flex: 1 1 110px; min-height: 44px; padding: 8px 12px; white-space: normal; overflow-wrap: anywhere; }
  .plan-transfer-preview, .supply-fields { padding: 12px; }
  .saved-views { padding: 12px; }
  .saved-views > .section-head { flex-wrap: wrap; }
  .saved-view { width: 100%; flex-wrap: wrap; }
  .saved-view > .button { flex: 1; justify-content: flex-start; }
  .printing .print-sheet { margin: 16px 0; padding: 16px; border-radius: 12px; }
  .print-heading { font-size: 23px; }
  .print-heading h1 { font-size: 23px; }
  .modal .print-sheet { padding: 12px; }
  .modal .print-table th, .modal .print-table td { padding: 8px 4px; font-size: 12px; }
  .supply-total { padding: 16px; }
  .supply-report + .section-card .plant-card { grid-template-columns: minmax(0, 1fr); }
  .print-labels { grid-template-columns: minmax(0, 1fr); }
}

@page { size: A4; margin: 14mm; }
@media print {
  html, body { min-width: 0; background: #fff !important; color: #000; }
  body.printing { margin: 0; overflow: visible !important; }
  body.printing .shell, body.printing .modal-backdrop, body.printing .toast-region,
  body.printing .mobile-nav, body.printing .topbar, body.printing .sidebar,
  body.printing .screen-only, body.printing .print-preview-controls { display: none !important; }
  body.printing .app-root { min-height: 0; }
  body.printing .print-sheet { display: block; width: auto; max-width: none; margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 0; background: #fff; box-shadow: none; backdrop-filter: none; }
  .print-sheet .button, .print-sheet .icon-button, .print-sheet button { display: none !important; }
  .print-sheet, .print-sheet * { color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
  .print-heading { font-size: 20pt; break-after: avoid; }
  .print-heading h1 { font-size: 20pt; }
  .print-heading > p, .print-label > span, .print-label > small { font-size: 9pt; }
  .print-meta { font-size: 9pt; break-after: avoid; }
  .print-sheet h2, .print-sheet h3 { break-after: avoid; }
  .print-sheet p { orphans: 3; widows: 3; }
  .print-sheet .table-scroll { overflow: visible; max-height: none; border: 0; border-radius: 0; }
  .print-table, .print-sheet .data-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 9pt; }
  .print-table thead, .print-sheet .data-table thead { display: table-header-group; }
  .print-table th, .print-table td, .print-sheet .data-table th, .print-sheet .data-table td { padding: 2.5mm 2mm; border-color: #aaa; white-space: pre-wrap; overflow-wrap: anywhere; background: transparent; }
  .print-table tr, .print-sheet .data-table tr { break-inside: avoid; }
  .print-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4mm; }
  .print-label { min-height: 32mm; padding: 4mm; border: 1px solid #777; border-radius: 0; break-inside: avoid; }
  .print-label strong { font-size: 12pt; }
  .print-label p { font-size: 9pt; }
  .print-only { display: block; }
}

@media (max-width: 1120px) {
  .batch-controls { grid-template-columns: minmax(0, 1fr); }
  .batch-controls > .inline-actions { justify-content: flex-start; }
  .template-card { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .template-card .inline-actions { justify-content: flex-start; }
  .plant-card.selectable { grid-template-columns: 28px 42px minmax(0, 1fr); }
  .plant-card.selectable > .inline-actions { grid-column: 3; }
  .harvest-charts { grid-template-columns: minmax(0, 1fr); }
  .harvest-chart-row { grid-template-columns: 86px minmax(0, 1fr) 58px; }
}

@media (max-width: 800px) {
  .topbar-actions { gap: 8px; }
  .topbar .status-pill { display: none; }
  .topbar .work-toggle { width: 44px; min-width: 44px; min-height: 44px; padding: 0; gap: 0; font-size: 0; }
  .topbar .work-toggle .icon { width: 20px; height: 20px; }
  .calendar-grid { display: none; }
  .calendar-daylist { display: grid; gap: 12px; }
  .calendar-navigation { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .calendar-navigation > .button:last-child { grid-column: 2; justify-self: center; }
  .work-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-actions > .button[data-type="harvest"] { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .batch-controls { padding: 16px; }
  .batch-controls .inline-actions .button { flex: 1 1 120px; min-height: 44px; padding: 8px 12px; white-space: normal; }
  .plant-card.selectable { grid-template-columns: 26px 34px minmax(0, 1fr); gap: 8px; }
  .plant-card.selectable > .inline-actions { grid-column: 2 / -1; }
  .plant-card.selectable .detail-icon { width: 34px; height: 34px; }
  .template-card { padding: 16px; }
  .template-card .inline-actions .button { flex: 1 1 110px; padding: 8px 12px; }
  .calendar-list-day { padding: 12px; }
  .calendar-list-day > .section-head { gap: 8px; }
  .calendar-list-day .task-card { grid-template-columns: 30px minmax(0, 1fr); padding: 12px; }
  .calendar-list-day .task-state { width: 30px; height: 30px; }
  .calendar-list-day .task-card .inline-actions { grid-column: 1 / -1; }
  .calendar-list-day .inline-actions .button { flex: 1 1 110px; padding: 8px; white-space: normal; }
  .harvest-totals strong { overflow-wrap: anywhere; }
  .harvest-chart { padding: 16px; }
  .harvest-chart-row { grid-template-columns: 76px minmax(0, 1fr) 45px; gap: 8px; }
  .table-scroll { border-radius: 10px; }
  .data-table th, .data-table td { padding: 12px 12px; }
  .work-actions { gap: 8px; }
  .work-actions > .button { min-height: 91px; padding: 16px 8px; }
  .work-secondary { grid-template-columns: minmax(0, 1fr); }
  .work-object > .button { flex-basis: 100%; }
  .conflict-panel { padding: 12px; border-radius: 12px; }
  .conflict-table th, .conflict-table td { padding: 8px 4px; font-size: 12px; }
  .conflict-choice { display: grid; justify-items: start; gap: 4px; font-size: 12px; }
  .conflict-actions { flex-direction: column; }
  .conflict-actions .button { flex: auto; width: 100%; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .button { flex: 1 1 110px; white-space: normal; padding: 12px 16px; }
}

/* Each editing mode unlocks exactly one object kind. */
.mode-move-bed .plant-point { pointer-events: none; }
.mode-move-plant .bed-shape { cursor: default; }
.map-surface.mode-move-bed, .map-surface.mode-move-plant { outline: 2px solid rgba(112, 142, 79, .55); outline-offset: 3px; }

.care-source {display:block; font-size:.75rem; color:var(--muted); margin-top:.35rem;}
.care-profile {margin-top:1rem;}
.care-profile dd {white-space:pre-line;}
.catalog-card details,.profile-care {margin:1rem 0;}
.catalog-card summary,.profile-care summary {cursor:pointer; font-weight: 500;}

.creation-palette {padding:.8rem 1rem; border:1px solid var(--line); border-radius:12px; margin-bottom:1rem;}
.creation-palette summary {cursor:pointer; font-weight: 500;}
.palette-tools {display:flex; flex-wrap:wrap; align-items:center; gap:.7rem;}
.palette-tools .field {margin:0; flex:1 1 180px;}
.palette-item {touch-action:none; cursor:grab;}
.palette-ghost {position:fixed;pointer-events:none;z-index:1000;padding:.7rem 1rem;border-radius:12px;background:var(--text);color:#fff;transform:translate(-50%,-110%);box-shadow:0 6px 20px #0003;}

.photo-grid {display:grid;grid-template-columns:repeat(auto-fill,minmax(min(240px,100%),1fr));gap:1rem;margin-top:1rem;}
.photo-card {margin:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--paper);}
.photo-card img {display:block;width:100%;height:220px;object-fit:cover;}
.photo-card figcaption {padding:1rem;}
.photo-preview {max-width:100%;max-height:280px;object-fit:contain;border-radius:12px;margin-bottom:1rem;}

.plant-quantity {position:absolute;right:-6px;top:-6px;background:var(--accent);color:#fff;border:2px solid #fff;border-radius:16px;padding:1px 4px;font-size:.7rem;}
