.t-fertilize { --c: var(--series-1); }
.t-prune     { --c: var(--series-2); }
.t-harvest   { --c: var(--series-3); }
.t-mulch     { --c: var(--series-4); }
.t-pest      { --c: var(--series-5); }
.t-soil      { --c: var(--series-6); }
.t-protect   { --c: var(--series-7); }
.t-other     { --c: var(--series-8); }

.grid-top {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.4fr);
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 820px) { .grid-top { grid-template-columns: 1fr; } }

/* Weather */
.stats { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
.stat .v { font-size: 26px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--text-secondary); }
.alert {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--status-critical);
  background: var(--surface-2);
  margin-top: 8px;
  font-size: 14px;
}

/* Watering list */
.water-list { list-style: none; margin: 0; padding: 0; }
.water-list li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
}
.water-list li:first-child { border-top: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.pill::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sc);
}
.s-water { --sc: var(--status-warning); }
.s-ok    { --sc: var(--status-good); }
.s-hold  { --sc: var(--status-info); }

/* Tasks */
.tasks-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tasks-head h2 { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--text-secondary); }
.legend span::before, .chip::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px;
  background: var(--c); margin-right: 6px; vertical-align: -1px;
}
.task-list { list-style: none; margin: 0; padding: 0; }
.task {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--hairline);
}
.task:first-child { border-top: 0; }
.task input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.task .title { font-weight: 600; }
.task .meta { font-size: 13px; color: var(--text-secondary); }
.task details { font-size: 14px; margin-top: 4px; }
.task details summary { cursor: pointer; color: var(--text-secondary); font-size: 13px; }
.task.done .title { text-decoration: line-through; color: var(--text-secondary); }
.chip { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.when { font-size: 13px; color: var(--text-secondary); white-space: nowrap; text-align: right; }
.empty { color: var(--text-secondary); font-size: 14px; padding: 6px 0; }

.section { margin-bottom: 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Plants + year strip */
.plants { display: grid; gap: 16px; }
.plants-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 10px; }
.plants-head .section-title { margin: 0; }
.plants-head .spacer { flex: 1; }
.plant-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; margin-bottom: 12px; }
.plant-head h3 { margin: 0; font-size: 16px; }
.ph-meta { font-size: 13px; }
.ph-actions { display: flex; gap: 8px; align-items: center; }
.sunline { font-size: 13px; margin-top: 4px; }
.sunline .warn { color: var(--status-warning); }
.badge { align-self: center; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-secondary); }
.sun-mini { background: none; border: 0; padding: 0; cursor: pointer; line-height: 0; }

.year { --cols: minmax(150px, 260px) repeat(var(--n, 12), minmax(0, 1fr)) max-content; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.yr-row { display: grid; grid-template-columns: var(--cols); column-gap: 2px; align-items: center; position: relative; border-radius: 2px; outline: none; }
.yr-row:not(.yr-head):hover, .yr-row:focus-within { background: color-mix(in srgb, var(--text-primary) 6%, transparent); }
.yr-row .m { color: var(--text-secondary); text-align: center; padding-bottom: 2px; border-bottom: 1px solid var(--baseline); }
.yr-row .m .ms { display: none; }
.yr-row .m.now { color: var(--text-primary); font-weight: 700; }
.yr-row .lbl { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 8px 2px 2px; }
.yr-row .lbl .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.cell { height: 14px; background: var(--surface-2); border-radius: 2px; }
.cell.on { background: var(--c); border-radius: 4px; box-shadow: 0 0 6px color-mix(in srgb, var(--c) 45%, transparent); }
.cell.nowcol { box-shadow: inset 0 0 0 1px var(--baseline); }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; opacity: .35; }
.yr-row:hover .row-actions, .yr-row:focus-within .row-actions { opacity: 1; }
.icon-btn { font: inherit; font-size: 14px; line-height: 1; width: 24px; height: 22px; border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text-primary); cursor: pointer; border-radius: var(--radius-sm); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.yr-row > .pop { display: none; }
.pop {
  position: fixed; z-index: 40; display: none;
  width: min(420px, calc(100vw - 24px)); padding: 10px 12px;
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--accent); box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  font-size: 13px; line-height: 1.45;
}
.pop.show { display: block; }
.pop-title { font-weight: 700; }
.pop-dates { color: var(--text-secondary); font-size: 12px; margin-bottom: 6px; }
.pop-note { white-space: pre-wrap; padding: 6px 8px; margin: 6px 0; background: var(--surface-2); border-left: 3px solid var(--accent); }
.pop-link { display: inline-block; margin: 2px 0 6px; font-weight: 600; }
.pop-how { color: var(--text-secondary); }
.pop-src { display: block; margin-top: 6px; font-size: 12px; }
.task-note { font-size: 13px; margin-top: 4px; padding: 4px 8px; background: var(--surface-2); border-left: 3px solid var(--accent); white-space: pre-wrap; }

.plant-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.plant-foot .hint { font-size: 12px; margin-left: auto; }
.plant-notes { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; margin: 10px 0 0; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--accent); cursor: pointer; text-decoration: underline; }
.small { font-size: 12px; }

/* Sun dial */
.sun-dial .seg { stroke: none; }
.sun-dial .seg.night { fill: color-mix(in srgb, var(--text-secondary) 18%, transparent); }
.sun-dial .seg.shade { fill: var(--surface-2); stroke: var(--hairline); stroke-width: .4; }
.sun-dial .seg.sun { fill: var(--status-warning); }
.sun-dial .big { font: 700 20px var(--font-mono, var(--font)); fill: var(--text-primary); text-anchor: middle; dominant-baseline: middle; }
.sun-dial.edit { touch-action: none; user-select: none; }
.sun-dial.edit .seg[data-hour] { cursor: pointer; }
.sun-dial.edit .seg.shade:hover { fill: color-mix(in srgb, var(--status-warning) 35%, var(--surface-2)); }
.sun-dial.edit .big { font-size: 14px; }
.sun-dial .tick { font: 7px var(--font-mono, var(--font)); fill: var(--text-secondary); text-anchor: middle; }

/* Dialog */
.dlg { width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; padding: 20px; border: 1px solid var(--accent); background: var(--surface-1); color: var(--text-primary); }
.dlg::backdrop { background: rgb(0 0 0 / 60%); }
.dlg h2 { margin: 0 0 14px; font-size: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.dlg input, .dlg select, .dlg textarea {
  font: inherit; font-size: 16px; color: var(--text-primary); background: var(--page);
  border: 1px solid var(--hairline); padding: 8px 10px; border-radius: var(--radius-sm); min-width: 0;
}
.dlg input:focus, .dlg select:focus, .dlg textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.date-pair { display: grid; grid-template-columns: 1fr 72px; gap: 6px; }
.sun-edit { border: 1px solid var(--hairline); margin: 16px 0 0; padding: 12px 14px; }
.sun-edit legend { padding: 0 6px; color: var(--text-secondary); font-size: 13px; }
.sun-edit-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; align-items: center; }
.sun-edit-row p { margin: 0 0 8px; font-size: 14px; }
.sun-text { margin: 6px 0 10px; }
.sun-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.dlg-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.dlg-actions .spacer { flex: 1; }
.btn.danger { color: var(--status-critical); border-color: var(--status-critical); }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); opacity: 0; transition: .2s; background: var(--surface-1); border: 1px solid var(--accent); padding: 8px 14px; font-size: 14px; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.footer-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.year > *, .grid-top > *, .water-list li > * { min-width: 0; }
@media (max-width: 640px) {
  .year.open { --cols: 84px repeat(12, minmax(0, 1fr)); }
  .year.compact { --cols: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
  .yr-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; padding: 2px 0 6px; }
  .yr-row.yr-head > .spacer-actions { display: none; }
  .year { font-size: 11px; }
  .yr-row { column-gap: 1px; }
  .yr-row .m { font-size: 10px; letter-spacing: 0; }
  .yr-row .m .ml { display: none; }
  .yr-row .m .ms { display: inline; }
  .year.compact .yr-row .m .ml { display: inline; }
  .year.compact .yr-row .m .ms { display: none; }
  .row-actions { opacity: 1; }
  .plant-head { grid-template-columns: auto minmax(0, 1fr); }
  .ph-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .plant-foot .hint { margin-left: 0; }
  .water-list li { grid-template-columns: 1fr; gap: 2px; }
  .task { grid-template-columns: 22px 1fr; }
  .task .when { grid-column: 2; text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .sun-edit-row { grid-template-columns: 1fr; justify-items: center; }
}

footer { font-size: 13px; color: var(--text-secondary); padding: 8px 0 40px; }
.sample-note { border-left: 4px solid var(--status-info); }

/* Fit the shared cyberpunk theme: mono numbers and labels, neon accents. */
.stat .v, .when, .chip, .year .m, .pill, .card h2, #place-date {
  font-family: var(--font-mono, var(--font));
}
.card h2 { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; color: var(--neon-2, var(--text-primary)); }
.card { padding: 16px 18px; }
.plant-head h3 { text-transform: uppercase; letter-spacing: .04em; }
.year .cell.on { box-shadow: 0 0 6px color-mix(in srgb, var(--c) 45%, transparent); }
.section-title { font-size: 14px; margin: 28px 0 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--neon, var(--text-primary)); }

/* Add-to (pin) */
.icon-btn.add-to { font-weight: 700; color: var(--accent); }
.pin-mark { color: var(--accent); margin-right: 4px; }
.pinned-tag { color: var(--accent); font-size: 12px; }
.pin-choices { display: grid; gap: 10px; margin-top: 8px; }
.pin-choice { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; padding: 10px 12px; border: 1px solid var(--hairline); cursor: pointer; }
.pin-choice:has(input:checked) { border-color: var(--accent); }
.pin-choice input[type=radio] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.pin-choice input[type=date] { margin-left: 6px; padding: 4px 8px; }

/* Bigger, labeled row buttons */
.row-btn {
  font: 600 13px var(--font-mono, var(--font)); min-height: 32px; padding: 4px 10px;
  border: 1px solid var(--hairline); background: var(--surface-1); color: var(--text-primary);
  cursor: pointer; white-space: nowrap; border-radius: var(--radius-sm);
}
.row-btn:hover, .row-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.row-btn.add-to { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.row-btn.x { min-width: 32px; padding: 4px 8px; }
.row-actions { gap: 6px; padding-left: 8px; opacity: .6; }
.year.compact .cell { height: 20px; }
.year.compact .yr-row .m { font-size: 13px; }
.yr-row { min-height: 34px; }
.plant { cursor: pointer; }
.plant .yr-row, .plant .plant-head, .plant .plant-foot { cursor: auto; }
.plant.is-open { outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -1px; }
.spacer-actions { visibility: hidden; height: 0; overflow: hidden; }

.row-btn.ok { color: var(--status-good); border-color: color-mix(in srgb, var(--status-good) 55%, transparent); }
.row-btn.x:hover { color: var(--status-critical); border-color: var(--status-critical); }
.yr-row.is-done .lbl { color: var(--text-secondary); text-decoration: line-through; }
.yr-row.is-done .cell.on { opacity: .35; box-shadow: none; }

/* Quick info */
.info-btn { color: var(--neon-2, var(--accent)); }
.info-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; border-bottom: 1px solid var(--hairline); }
.info-tab { font: 600 13px var(--font-mono, var(--font)); padding: 8px 12px; min-height: 40px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-secondary); cursor: pointer; }
.info-tab.on { color: var(--text-primary); border-bottom-color: var(--accent); }
.info-facts { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; margin: 0; font-size: 14px; }
.info-facts dt { font-weight: 700; color: var(--neon-2, var(--text-primary)); }
.info-facts dd { margin: 0; }
.info-season { padding: 10px 12px; border: 1px solid var(--hairline); margin-bottom: 8px; font-size: 14px; }
.info-season.now { border-color: var(--accent); }
.info-season p { margin: 4px 0 0; }
.info-pest { padding: 10px 12px; border: 1px solid var(--hairline); margin-bottom: 8px; font-size: 14px; display: grid; gap: 4px; }
.pest-name { font-weight: 700; color: var(--status-warning); }
.info-pest .lab { display: inline-block; min-width: 62px; font: 600 11px var(--font-mono, var(--font)); text-transform: uppercase; color: var(--text-secondary); }
.info-sources { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-size: 13px; }
@media (max-width: 640px) { .info-facts { grid-template-columns: 1fr; gap: 2px 0; } .info-facts dd { margin-bottom: 8px; } }

/* Watering meters */
.wm-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 18px; }
.wm { --water: #3d9bff; --water-fc: color-mix(in srgb, #3d9bff 40%, transparent); cursor: help; }
.wm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.wm-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; background: var(--dot); box-shadow: 0 0 8px color-mix(in srgb, var(--dot) 60%, transparent); }
.wm.s-ok { --dot: var(--status-good); }
.wm.s-water { --dot: var(--status-warning); }
.wm.s-hold { --dot: var(--status-info); }
.wm-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-state { margin-left: auto; font: 600 12px var(--font-mono, var(--font)); color: var(--dot); white-space: nowrap; }
.wm-meter { position: relative; display: flex; height: 12px; background: var(--surface-2); border: 1px solid var(--hairline); overflow: visible; }
.wm-got { background: var(--water); height: 100%; }
.wm-fc { background: repeating-linear-gradient(135deg, var(--water-fc) 0 4px, transparent 4px 7px); height: 100%; border-right: 0; }
.wm-target { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-primary); transform: translateX(-1px); }
.wm-nums { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font: 12px var(--font-mono, var(--font)); color: var(--text-secondary); }
.wm-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--text-secondary); margin: -4px 0 12px; }
.wm-legend .k { display: inline-block; width: 14px; height: 10px; margin-right: -6px; vertical-align: -1px; }
.wm-legend .k.got { background: #3d9bff; }
.wm-legend .k.fc { background: repeating-linear-gradient(135deg, color-mix(in srgb, #3d9bff 40%, transparent) 0 4px, transparent 4px 7px); border: 1px solid color-mix(in srgb, #3d9bff 50%, transparent); }
.wm-legend .k.tgt { width: 2px; height: 14px; background: var(--text-primary); margin-left: 6px; }

/* Plain look (shared theme.js sets html[data-ui="plain"]): drop glow and caps */
[data-ui="plain"] .cell.on, [data-ui="plain"] .wm-dot { box-shadow: none; }
[data-ui="plain"] .card h2, [data-ui="plain"] .plant-head h3, [data-ui="plain"] .section-title { text-transform: none; letter-spacing: 0; }
[data-ui="plain"] .card h2 { font-size: 15px; }
[data-ui="plain"] .row-btn, [data-ui="plain"] .icon-btn, [data-ui="plain"] .wm-meter, [data-ui="plain"] .dlg, [data-ui="plain"] .pop { border-radius: 6px; }
[data-ui="plain"] .wm-meter { overflow: hidden; }
[data-ui="plain"] .cell { border-radius: 3px; }

/* Rain & sky: one column per day (4 back, today, 4 ahead) */
.wx { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 4px; }
.wx-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 55%, transparent); cursor: default; min-width: 0; }
.wx-day.today { outline: 2px solid var(--neon, var(--text-primary)); outline-offset: -2px; }
.wx-d { font-size: 11px; font-weight: 700; color: var(--text-secondary); }
.wx-day.today .wx-d { color: var(--text-primary); }
.wx-bar { height: 56px; width: 60%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--baseline, var(--line)); }
.wx-bar .b { display: block; width: 100%; background: var(--neon-2, var(--series-1)); border-radius: 3px 3px 0 0; min-height: 2px; }
.wx-day.future .wx-bar .b { opacity: .5; background: repeating-linear-gradient(135deg, var(--neon-2, var(--series-1)) 0 3px, transparent 3px 5px); }
.wx-in { font: 11px/1.2 var(--font-mono, monospace); color: var(--text-primary); }
.sky-i { width: 28px; height: 28px; display: block; }
.wx-c { font: 11px/1.2 var(--font-mono, monospace); color: var(--text-secondary); min-height: 1em; }
@media (max-width: 420px) { .wx { gap: 2px; } .sky-i { width: 22px; height: 22px; } .wx-in, .wx-c, .wx-d { font-size: 10px; } }
.i-sun circle { fill: #ffd23d; }
.i-sun line { stroke: #ffd23d; stroke-width: 1.8; stroke-linecap: round; }
.i-cloud { fill: #b9c3df; stroke: #e4e9f7; stroke-width: .8; }
.k-rain .i-cloud, .k-storm .i-cloud { fill: #8592b5; }
.i-rain line { stroke: #4dc3ff; stroke-width: 1.8; stroke-linecap: round; }
.i-bolt { fill: #ffd23d; }
.i-snow circle { fill: #ffffff; }
.i-fog line { stroke: #b9c3df; stroke-width: 2; stroke-linecap: round; }
:root:not([data-ui="plain"]) .i-sun { filter: drop-shadow(0 0 3px #ffd23d); }

/* Bigger, easier-to-read plant names */
.plant-head h3 { font-size: 22px; line-height: 1.2; text-transform: none; letter-spacing: .01em; color: var(--text-primary); }
.wm-name { font-size: 17px; font-weight: 700; color: var(--text-primary); }
@media (max-width: 640px) { .plant-head h3 { font-size: 20px; } }
