/* ==========================================================================
   Gumboot — Australian rural styling
   Red earth, eucalyptus, straw, corrugated iron and sun-bleached paper.
   ========================================================================== */

:root {
  /* Earth & bush palette */
  --ochre: #B4532A;        /* red earth */
  --ochre-deep: #7A3B1E;   /* rusted iron */
  --ochre-pale: #EBC9B3;
  --gum: #5F7A61;          /* eucalyptus */
  --gum-light: #A9BFA3;
  --gum-pale: #E2EADF;
  --straw: #D8B55C;        /* dry grass / wheat */
  --straw-pale: #F0E3B8;
  --iron: #6E7B80;         /* corrugated iron */
  --iron-light: #B7C0C3;
  --bark: #3E2C22;         /* ironbark */
  --bark-soft: #6B5546;
  --sky: #4F86A8;          /* water */
  --sky-pale: #D8E7F0;
  --berry: #9B3D5A;        /* fruit */
  --pumpkin: #D27D2D;      /* veggie */

  /* Surfaces */
  --bg: #F4EBD9;
  --bg-alt: #ECE0C8;
  --card: #FFFDF7;
  --card-edge: #DACBB0;
  --line: #E3D7C0;
  --text: #2E211A;
  --text-soft: #6B5546;
  --text-faint: #9A8775;
  --topbar: var(--ochre-deep);
  --nav: #3E2C22;
  --nav-text: #D9C8AE;
  --nav-active: var(--straw);
  --focus: #E39A3B;
  --boot-band: #F4EBD9;

  --cat-veggie: var(--pumpkin);
  --cat-fruit: var(--berry);
  --cat-herb: var(--gum);
  --water: var(--sky);
  --danger: #A33A2A;
  --ok: #4C7A4E;

  --font-display: "Rockwell", "Roboto Slab", "Zilla Slab", "Bitter", "Arvo", Georgia, "Times New Roman", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(62, 44, 34, 0.08), 0 4px 14px rgba(62, 44, 34, 0.06);
  --nav-h: 62px;
  --topbar-h: 56px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1E1A16;
    --bg-alt: #26211B;
    --card: #2B251F;
    --card-edge: #3F362D;
    --line: #3A3129;
    --text: #F1E7D4;
    --text-soft: #C9B9A2;
    --text-faint: #8E8070;
    --topbar: #4A2614;
    --nav: #171310;
    --nav-text: #B9A88E;
    --ochre-pale: #5A3524;
    --gum-pale: #2C3A2E;
    --straw-pale: #4A3F26;
    --sky-pale: #243946;
    --gum-light: #6E8A6F;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    --boot-band: #1E1A16;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1E1A16;
  --bg-alt: #26211B;
  --card: #2B251F;
  --card-edge: #3F362D;
  --line: #3A3129;
  --text: #F1E7D4;
  --text-soft: #C9B9A2;
  --text-faint: #8E8070;
  --topbar: #4A2614;
  --nav: #171310;
  --nav-text: #B9A88E;
  --ochre-pale: #5A3524;
  --gum-pale: #2C3A2E;
  --straw-pale: #4A3F26;
  --sky-pale: #243946;
  --gum-light: #6E8A6F;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  --boot-band: #1E1A16;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.35), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(180,83,42,.07), transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  overscroll-behavior-y: contain;
}
a { color: var(--ochre); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0; letter-spacing: .01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
svg.icon { width: 22px; height: 22px; flex: 0 0 auto; }
svg.icon.small { width: 16px; height: 16px; }
.spin { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* --------------------------------------------------------------------------
   Layout: phone = top bar + bottom nav; desktop = sidebar
   -------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "top" "main";
  min-height: 100vh;
  min-height: 100dvh;
}
.topbar {
  grid-area: top;
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  padding-top: env(safe-area-inset-top);
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  color: #F6EEDC;
  background-color: var(--topbar);
  /* corrugated iron */
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,.18)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 7px, rgba(0,0,0,.10) 7px 14px);
  border-bottom: 4px solid var(--straw);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-icon { width: 30px; height: 30px; color: var(--gum-light); filter: drop-shadow(0 1px 0 rgba(0,0,0,.4)); }
.brand-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; text-shadow: 0 1px 0 rgba(0,0,0,.45); }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,.12); }
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 .78rem var(--font-body);
  color: #F6EEDC; background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 5px 10px 5px 8px; cursor: pointer;
}
.sync-pill .icon { width: 16px; height: 16px; }
.sync-pill.offline { background: rgba(62,44,34,.75); color: var(--straw); }
.sync-pill.pending { background: rgba(216,181,92,.25); }
.sync-pill.error { background: rgba(163,58,42,.55); }

.nav {
  grid-area: nav;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav);
  border-top: 3px solid var(--straw);
  box-shadow: 0 -2px 10px rgba(0,0,0,.25);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: .68rem; font-weight: 600; letter-spacing: .02em; text-decoration: none;
  color: var(--nav-text);
}
.nav a .icon { width: 24px; height: 24px; }
.nav a.active { color: var(--nav-active); }
.nav a.active .icon { filter: drop-shadow(0 0 6px rgba(216,181,92,.45)); }

.main {
  grid-area: main;
  padding-block: var(--gutter) calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
  max-width: 1100px; width: 100%; margin: 0 auto;
  outline: none;
}

@media (min-width: 900px) {
  .app {
    grid-template-columns: 220px 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "top top" "nav main";
  }
  .nav {
    position: sticky; top: var(--topbar-h); bottom: auto;
    height: calc(100vh - var(--topbar-h));
    display: flex; flex-direction: column; gap: 2px;
    padding: 14px 10px; border-top: 0; border-right: 3px solid var(--straw);
    box-shadow: none;
    background-image: repeating-linear-gradient(180deg, transparent 0 48px, rgba(255,255,255,.03) 48px 50px);
  }
  .nav a { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: .95rem; }
  .nav a.active { background: rgba(216,181,92,.14); }
  .main { padding-block: 24px 48px; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
}

/* --------------------------------------------------------------------------
   Page furniture
   -------------------------------------------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head .lead { color: var(--text-soft); font-size: .92rem; margin: 2px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--text-soft); text-decoration: none; font-size: .9rem; margin-bottom: 8px; }

/* Wooden sign plate for section headings */
.sign {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: .92rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bark);
  background: linear-gradient(180deg, #E7C86E, #D8B55C);
  border: 2px solid #8C6A20; border-radius: 6px;
  padding: 4px 12px; margin: 18px 0 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 0 #6B4F14;
  position: relative;
}
.sign::before, .sign::after {
  content: ""; position: absolute; top: 50%; width: 5px; height: 5px; border-radius: 50%;
  background: #6B4F14; transform: translateY(-50%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.sign::before { left: 4px; } .sign::after { right: 4px; }
.sign .icon { width: 16px; height: 16px; }
.sign .count { font-family: var(--font-body); font-weight: 600; font-size: .78rem; color: #6B4F14; margin-left: 2px; }

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.card.flush { padding: 0; overflow: hidden; }
.card h3 { margin-bottom: 6px; }
.muted { color: var(--text-soft); }
.faint { color: var(--text-faint); font-size: .85rem; }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: grid; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.center { text-align: center; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }

/* Lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius);
  padding: 12px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  min-height: 60px;
}
.item:hover { border-color: var(--straw); }
.item .title { font-weight: 600; }
.item .sub { color: var(--text-soft); font-size: .85rem; }
.item .chev { color: var(--text-faint); }
.cat-dot {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  background: var(--iron);
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18);
}
.cat-dot .icon { width: 22px; height: 22px; }
.cat-dot.Veggie { background: var(--cat-veggie); }
.cat-dot.Fruit { background: var(--cat-fruit); }
.cat-dot.Herb { background: var(--cat-herb); }
.cat-dot.bed { background: var(--bark-soft); }
.cat-dot.photo { background: var(--iron); }

/* Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px;
  background: var(--bg-alt); color: var(--text-soft);
}
.badge .icon { width: 12px; height: 12px; }
.badge.due { background: var(--sky-pale); color: var(--sky); }
.badge.overdue { background: #F3D6CE; color: var(--danger); }
.badge.ok { background: var(--gum-pale); color: var(--ok); }
.badge.warn { background: var(--straw-pale); color: #7A5A10; }
.badge.Veggie { background: #F7E0CB; color: #8A4B14; }
.badge.Fruit { background: #F0D5DE; color: var(--berry); }
.badge.Herb { background: var(--gum-pale); color: var(--gum); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.overdue { background: #4B2A24; color: #F0A090; }
  :root:not([data-theme="light"]) .badge.Veggie { background: #4A3220; color: #F0B882; }
  :root:not([data-theme="light"]) .badge.Fruit { background: #4A2A35; color: #E8A5BC; }
  :root:not([data-theme="light"]) .badge.due { color: #9CC7E3; }
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1.5px solid var(--card-edge); background: var(--card); color: var(--text-soft);
  border-radius: 999px; padding: 6px 12px; font: 600 .82rem var(--font-body); cursor: pointer;
}
.chip.active { background: var(--bark); border-color: var(--bark); color: var(--straw); }

/* Stats tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.tile {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius);
  padding: 12px 10px; text-align: center; box-shadow: var(--shadow);
  border-top: 4px solid var(--gum);
}
.tile:nth-child(2) { border-top-color: var(--ochre); }
.tile:nth-child(3) { border-top-color: var(--straw); }
.tile .num { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.tile .num.small-num { font-size: 1rem; line-height: 1.25; }
.tile .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); margin-top: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .95rem var(--font-body); color: #F6EEDC; background: var(--ochre);
  border: 0; border-radius: var(--radius-sm); padding: 10px 16px; cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); text-decoration: none; line-height: 1.2;
  min-height: 42px; white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0,0,0,.18); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 18px; height: 18px; }
.btn.green { background: var(--gum); }
.btn.water { background: var(--sky); }
.btn.straw { background: var(--straw); color: var(--bark); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--card-edge); box-shadow: none; }
.btn.ghost:hover { border-color: var(--text-soft); }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 10px; min-height: 34px; font-size: .82rem; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 20px; font-size: 1.05rem; min-height: 52px; }
.fab {
  position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ochre); color: #F6EEDC; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(62,44,34,.35), inset 0 -3px 0 rgba(0,0,0,.2); text-decoration: none;
}
.fab .icon { width: 28px; height: 28px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 auto; }

/* Forms */
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field label, .label { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-soft); }
input[type="text"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], select, textarea {
  width: 100%; font: 1rem var(--font-body); color: var(--text);
  background: var(--card); border: 1.5px solid var(--card-edge); border-radius: var(--radius-sm);
  padding: 10px 12px; min-height: 44px;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 3px solid rgba(227,154,59,.55); outline-offset: 1px; }
input[type="range"] { width: 100%; accent-color: var(--ochre); }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1.5px solid var(--card-edge); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); }
.segmented button { border: 0; background: transparent; padding: 10px 6px; font: 600 .9rem var(--font-body); color: var(--text-soft); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.segmented button + button { border-left: 1.5px solid var(--card-edge); }
.segmented button.active { background: var(--bark); color: var(--straw); }
.segmented button .icon { width: 16px; height: 16px; }
.inline-fields { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.help { font-size: .8rem; color: var(--text-faint); }

/* Empty state */
.empty { text-align: center; padding: 36px 16px; color: var(--text-soft); }
.empty .icon { width: 48px; height: 48px; color: var(--gum-light); }
.empty h3 { margin: 10px 0 6px; }

/* Today page */
.gday {
  background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); padding: 14px 16px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
  border-left: 6px solid var(--ochre);
}
.gday .sun { width: 40px; height: 40px; color: var(--straw); }
.gday h1 { font-size: 1.4rem; }
.water-group { margin-bottom: 10px; }
.water-group .item { padding: 10px 12px; min-height: 56px; }
.water-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 2px; }
.water-head .name { font-weight: 700; font-family: var(--font-display); }

/* Photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-tile { position: relative; display: block; border-radius: var(--radius); overflow: hidden; background: var(--bg-alt); aspect-ratio: 4/3; border: 1px solid var(--card-edge); box-shadow: var(--shadow); text-decoration: none; color: #fff; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: .75rem; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.photo-tile .bearing { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.55); border-radius: 999px; padding: 2px 7px; font-size: .7rem; display: inline-flex; gap: 3px; align-items: center; }
.photo-tile .bearing .icon { width: 12px; height: 12px; }
.photo-tile .placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--text-faint); }

.photo-stage { position: relative; border-radius: var(--radius); overflow: hidden; background: #1a1612; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.photo-stage img { width: 100%; height: auto; display: block; }
.photo-stage.tagging { cursor: crosshair; outline: 3px dashed var(--straw); outline-offset: -3px; }
.tag-pin {
  position: absolute; transform: translate(-50%, -100%);
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bark); color: var(--straw); border: 2px solid var(--straw);
  border-radius: 999px; padding: 2px 8px 2px 4px; font-size: .75rem; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.4); pointer-events: auto; cursor: pointer;
}
.tag-pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 2px; height: 8px; background: var(--straw); transform: translateX(-50%); }
.tag-pin .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.sensor-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sensor { background: var(--bg-alt); border-radius: var(--radius-sm); padding: 10px; }
.sensor .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-soft); }
.sensor .val { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.sensor .val.bad { color: var(--danger); }
.compass-rose { width: 54px; height: 54px; float: right; }
.capture-btn { height: 72px; font-size: 1.15rem; }

/* Map */
.map-wrap { position: relative; background: var(--card); border: 1px solid var(--card-edge); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.map-svg { width: 100%; height: 62vh; min-height: 360px; display: block; touch-action: none; background:
  radial-gradient(circle at 50% 50%, rgba(95,122,97,.08), transparent 60%), var(--card); }
.map-toolbar { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-toolbar .btn { padding: 0; width: 38px; min-height: 38px; }
.map-legend { position: absolute; left: 8px; bottom: 8px; background: rgba(255,253,247,.9); border: 1px solid var(--card-edge); border-radius: 8px; padding: 6px 8px; font-size: .72rem; display: flex; gap: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map-legend { background: rgba(43,37,31,.92); } }
.map-legend span { display: inline-flex; align-items: center; gap: 4px; }
.map-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-popover { position: absolute; left: 8px; top: 8px; max-width: 70%; }
.map-hint { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); background: var(--bark); color: var(--straw); padding: 4px 10px; border-radius: 999px; font-size: .75rem; white-space: nowrap; }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl { display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl:last-child { border-bottom: 0; }
.tl .ico { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.tl .ico .icon { width: 16px; height: 16px; }
.tl .ico.water { background: var(--water); }
.tl .ico.harvest { background: var(--straw); color: var(--bark); }
.tl .when { color: var(--text-faint); font-size: .8rem; }

/* Toasts & dialog */
.toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 6px; pointer-events: none; width: min(92vw, 420px); }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--bark); color: var(--straw-pale); padding: 10px 14px; border-radius: 10px; font-size: .9rem; box-shadow: 0 4px 14px rgba(0,0,0,.35); animation: rise .25s ease-out; border-left: 4px solid var(--straw); }
.toast.error { border-left-color: #E07A6A; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(92vw, 460px); width: 100%; background: var(--card); color: var(--text); box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.dialog::backdrop { background: rgba(30,22,16,.55); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 3px solid var(--straw); background: var(--topbar); color: #F6EEDC;
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 7px, rgba(0,0,0,.10) 7px 14px); }
.dialog-head h3 { font-size: 1.1rem; }
.dialog-head .icon-btn { width: 34px; height: 34px; }
.dialog-body { padding: 16px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px 16px; }

.loading { display: flex; align-items: center; gap: 10px; color: var(--text-soft); padding: 40px 0; justify-content: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .9rem; }
.kv dt { color: var(--text-soft); } .kv dd { margin: 0; }
.notice { background: var(--straw-pale); border-left: 4px solid var(--straw); padding: 10px 12px; border-radius: 6px; font-size: .88rem; margin-bottom: 12px; }
.notice.info { background: var(--sky-pale); border-left-color: var(--sky); }
.plant-list-inline { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--card-edge); background: var(--card); border-radius: 999px; padding: 6px 12px 6px 6px; font: 600 .85rem var(--font-body); color: var(--text); cursor: pointer; }
.pill-btn .cat-dot { width: 22px; height: 22px; } .pill-btn .cat-dot .icon { width: 13px; height: 13px; }
.pill-btn.active { border-color: var(--bark); background: var(--straw-pale); }
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--bg-alt); flex: 0 0 auto; }
details.card summary { cursor: pointer; font-weight: 600; }
hr.fence { border: 0; height: 6px; margin: 16px 0; background: repeating-linear-gradient(90deg, var(--bark-soft) 0 14px, transparent 14px 20px); opacity: .35; border-radius: 3px; }
