:root {
  --bg: #f6f5f0; --card: #fff; --ink: #2b2b2b; --muted: #777;
  --amber: #f0a500; --amber-d: #c98600; --line: #e3e0d6;
  --green: #3c8c3c; --yellow: #e2b007; --orange: #e07b1a; --red: #c63b3b; --grey: #9a958a;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink); }
a { color: var(--amber-d); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .2em 0 .6em; }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; }
.muted { color: var(--muted); }
.error { color: var(--red); font-weight: 600; }
.back { display: inline-block; margin-bottom: 6px; font-size: .9rem; }

/* top bar */
.topbar { background: var(--amber); color: #3a2c00; display: flex; justify-content: space-between;
  align-items: center; padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
.topbar a { color: #3a2c00; }
.brand { font-weight: 800; font-size: 1.1rem; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.who { font-size: .85rem; opacity: .8; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: none; color: #3a2c00; cursor: pointer; font: inherit;
  text-decoration: underline; padding: 0; }

/* buttons + forms */
button.primary { background: var(--amber); color: #3a2c00; border: none; border-radius: var(--radius);
  padding: 12px 18px; font-weight: 700; cursor: pointer; }
button.primary:hover { background: var(--amber-d); }
button.secondary { background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px 14px; cursor: pointer; }
button.big { width: 100%; font-size: 1.05rem; padding: 14px; margin-top: 10px; }
label { display: block; margin: 10px 0; font-weight: 600; }
input, select, textarea { width: 100%; padding: 11px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; margin-top: 4px; background: #fff; }
.two-col { display: flex; gap: 10px; } .two-col label { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); margin: 14px 0; }
legend { font-weight: 700; padding: 0 6px; }

/* login */
.login-card { max-width: 360px; margin: 8vh auto; background: var(--card); padding: 28px;
  border-radius: var(--radius); box-shadow: 0 2px 16px rgba(0,0,0,.06); }
.login-card h1 { text-align: center; }

/* dashboard */
.stat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; background: #eee; }
.pill.open-issue { background: #f6d6d6; color: var(--red); }
.pill.overdue { background: #f7ddc8; color: var(--orange); }
.pill.never { background: #e6e3da; color: var(--grey); }
.pill.due-soon { background: #f7eec2; color: #8a6d00; }
.pill.current { background: #d6ecd6; color: var(--green); }

.yard-list, .log-list, .exc-list, .tags, .thumbs { list-style: none; padding: 0; margin: 0; }
.yard-card { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.yard-main { flex: 1; display: flex; align-items: center; gap: 10px; padding: 14px; color: var(--ink); }
.yard-main:hover { text-decoration: none; background: #fcfbf7; }
.yard-name { font-weight: 700; }
.yard-meta { margin-left: auto; font-size: .85rem; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grey); flex: none; }
.status-current .dot { background: var(--green); }
.status-due-soon .dot { background: var(--yellow); }
.status-overdue .dot { background: var(--orange); }
.status-open-issue .dot { background: var(--red); }
.status-never .dot { background: var(--grey); }
.log-btn { display: flex; align-items: center; padding: 0 16px; background: var(--amber);
  color: #3a2c00; font-weight: 700; }
.log-btn:hover { background: var(--amber-d); text-decoration: none; }

/* logging form */
.log-form, .history { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; }
.gps-status { font-size: .85rem; color: var(--muted); margin: 4px 0; }
.gps-status.ok { color: var(--green); } .gps-status.warn { color: var(--orange); }
.tap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 8px; }
.tap { display: flex; align-items: center; gap: 8px; background: #faf8f2; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; margin: 0; font-weight: 600; cursor: pointer; }
.tap input { width: auto; margin: 0; transform: scale(1.3); }
.tap:has(input:checked) { background: #fdf0cf; border-color: var(--amber); }
.exc-row { display: flex; gap: 6px; align-items: center; margin: 6px 8px; }
.exc-row select, .exc-row input { margin-top: 0; }
.exc-row .count { width: 64px; }
.file input { border: none; padding: 8px 0; }

/* history */
.log-entry { border-top: 1px solid var(--line); padding: 12px 0; }
.log-entry:first-child { border-top: none; }
.log-head { font-size: .9rem; }
.gps-ok { color: var(--green); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag { background: #eef3ee; color: var(--green); padding: 2px 8px; border-radius: 999px; font-size: .78rem; }
.exc-list { margin: 6px 0; }
.exc { font-size: .85rem; padding: 2px 0; color: var(--orange); }
.exc.deadout, .exc.queenless { color: var(--red); }
.log-notes { margin: 6px 0; font-style: italic; color: #555; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

/* flash banner */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.flash.ok { background: #e1f0df; color: var(--green); border: 1px solid #b9dab4; }
.flash.bad { background: #f6dada; color: var(--red); border: 1px solid #e3b4b4; }

/* small buttons + inline forms */
button.small { padding: 5px 10px; font-size: .82rem; }
.op-tag { font-weight: 400; font-size: .8rem; }
.treat-flag { color: var(--orange); font-weight: 600; }
.warn-line { color: var(--orange); font-weight: 600; }
.small { font-size: .82rem; } .row-form button { margin-top: 22px; }

/* mite-treatment card */
.treat-card { background: #fffaf0; border: 1px solid #f0e2bf; border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.treat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 10px; }
.treat-grid .label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.treat-grid strong { font-size: 1.05rem; }
.treat-grid .over { color: var(--red); }
.treat-actions { border-top: 1px solid #f0e2bf; padding-top: 8px; margin-top: 6px; }
.treat-actions summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.row-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row-form label { flex: 1; min-width: 130px; margin: 4px 0; }

/* admin user/op rows */
.user-row, .history .log-entry { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.reset-form input { width: 130px; padding: 6px 8px; margin: 0; }
.inactive { opacity: .6; }
.op-switch { margin-bottom: 12px; }
hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.access-line { margin-top: 4px; }
.access-line a { margin-left: 4px; }
.radio-line { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 8px 0; }
.radio-line input { width: auto; transform: scale(1.3); margin: 0; }

/* compact task chips (replaces the big tap cards on the log form) */
legend .hint, .hint { font-weight: 400; font-size: .8rem; color: var(--muted); }
.field-help { font-size: .85rem; color: var(--muted); margin: 6px 8px 10px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; }
.chip { display: inline-flex; align-items: center; margin: 0; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 999px; background: #faf8f2; font-weight: 600; font-size: .9rem; cursor: pointer; user-select: none; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span { pointer-events: none; }
.chip:has(input:checked) { background: var(--amber); border-color: var(--amber-d); color: #3a2c00; }

/* photo take/choose buttons */
.photo-buttons { display: flex; gap: 10px; flex-wrap: wrap; padding: 8px; }
.photo-btn { flex: 1; min-width: 140px; margin: 0; text-align: center; padding: 14px; border: 1px dashed var(--amber-d);
  border-radius: var(--radius); background: #fffaf0; font-weight: 700; cursor: pointer; }
.photo-btn input { display: none; }
.photo-chosen { font-size: .85rem; color: var(--green); margin: 4px 10px; }

/* settings hub */
.settings-list { list-style: none; padding: 0; margin: 0; }
.settings-list li { margin-bottom: 10px; }
.settings-list a, .settings-list li.coming span { display: block; padding: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--card); }
.settings-list a:hover { background: #fcfbf7; text-decoration: none; }
.settings-list strong { display: block; }
.settings-list .muted { font-weight: 400; }
.settings-list li.coming span { opacity: .65; cursor: default; }
.secondary-link { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* map location picker */
.yard-map { height: 280px; border-radius: var(--radius); border: 1px solid var(--line); margin: 6px 0; }
.locate-map { height: 200px; }
/* "you are here" pulsing dot */
.you-dot {
  background: #2b7cff; border: 2px solid #fff; border-radius: 50%;
  box-shadow: 0 0 0 rgba(43, 124, 255, .5); animation: you-pulse 2s infinite;
}
@keyframes you-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(43, 124, 255, .5); }
  70%  { box-shadow: 0 0 0 12px rgba(43, 124, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 124, 255, 0); }
}
.map-search { display: flex; gap: 8px; margin-top: 4px; }
.map-search input { margin: 0; }
.map-search button { white-space: nowrap; }

/* signup + pending requests */
.login-card.wide { max-width: 440px; }
.pending-box { background: #fff8e6; border: 1px solid #f0d98a; border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.pending-box h2 { margin-top: 0; }
.pending-row { align-items: center; }

/* weather + camera name-line */
.cam-icon { font-size: .85rem; margin-left: 4px; }
.cam-link { cursor: pointer; }
.cam-ok { color: var(--green); font-size: .85rem; }
.wx { color: var(--amber-d); font-size: .82rem; font-weight: 600; margin-left: 4px; }
.wx-clickable { cursor: pointer; text-decoration: underline dotted; }
.wx-strip { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 14px; margin-bottom: 16px; }
.wx-now { font-weight: 700; font-size: 1.05rem; }
.wx-days { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wx-day { display: flex; flex-direction: column; align-items: center; font-size: .8rem;
  background: #faf8f2; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 48px; }
.wx-day b { font-size: .72rem; color: var(--muted); }
.wx-rain { font-size: .68rem; color: #2b6cb0; margin-top: 2px; }
.wx-loading { color: var(--muted); font-size: .85rem; }

/* schedule step editor */
.prog-flag { color: #6a5acd; font-weight: 600; }
.step-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin: 8px 0;
  background: #faf8f2; border: 1px solid var(--line); border-radius: 10px; }
.step-row input, .step-row select { margin: 0; }
.step-row > input[name=action] { flex: 1 1 180px; }
.step-num { font-weight: 700; color: var(--muted); min-width: 22px; }
.inline-lbl { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.num { width: 70px; }
.wx-rule { flex: 1 1 200px; }
#add-step { margin-right: 10px; }

/* modal (weather forecast popup) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; max-width: 520px; width: 100%; max-height: 85vh; overflow: auto;
  position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.modal-title { margin: 0 28px 12px 0; font-size: 1.1rem; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none;
  font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 0; }
.wx-modal-now { margin: 0 0 12px; font-size: 1rem; }
.wx-modal-days { display: flex; flex-direction: column; gap: 6px; }
.wx-modal-day { display: grid; grid-template-columns: 90px 60px 56px 1fr; align-items: baseline;
  gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.wx-modal-day:last-child { border-bottom: none; }
.wx-modal-temp { font-weight: 700; }
.wx-modal-rain { color: #2b6cb0; font-size: .82rem; white-space: nowrap; }
.map-actions { margin: 10px 0 4px; }
.modal:has(.hive-map) { max-width: 780px; }
.hive-map { width: 100%; height: 480px; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .8rem; color: var(--muted); }
.map-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle; border: 1px solid rgba(0,0,0,.15); }

/* dashboard header */
.dash-header { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; }
.dash-header h1 { margin: 0; }
.hive-icon { flex: none; }

/* service calendar */
.cal-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 10px; }
.cal-title { font-weight: 700; min-width: 140px; text-align: center; }
.cal-overdue { background: #f6dada; border: 1px solid #e3b4b4; border-radius: var(--radius); padding: 10px 14px; margin: 12px 0; }
.cal-overdue h2 { margin: 0 0 6px; font-size: 1rem; color: var(--red); }
.overdue-list { list-style: none; padding: 0; margin: 0; }
.overdue-list li { padding: 3px 0; }
.cal-scroll { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 4px; margin-top: 12px; }
.cal-wd { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-cell { min-height: 92px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.cal-cell.out { background: #f3f1ea; }
.cal-cell.today { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }
.cal-daynum { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: right; }
.cal-cell.out .cal-daynum { opacity: .5; }
.cal-evt { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 4px; margin-top: 2px;
  border-radius: 4px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-evt:hover { text-decoration: none; opacity: .9; }
.cal-evt.kind-inspect { background: #c98600; }
.cal-evt.kind-treatment { background: #c63b3b; }
.cal-evt.kind-program { background: #2b6cb0; }
.cal-evt.od { outline: 2px solid #7a1010; }
.cam-frame { width: 100%; height: 360px; border: 1px solid var(--line); border-radius: 8px; background: #000; }
.cam-url-row { display: flex; gap: 8px; margin-top: 8px; }
.cam-url { flex: 1; font-family: monospace; font-size: .8rem; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #faf8f2; }
.cam-copy { white-space: nowrap; }
