/* climate-sensors - the Sensors popout and sensor pages of the Climate sheet (#732, U14).
 * Consumes only --v2-* tokens; load with /css/canopy-v2.css, climate-range.css, climate-dial.css
 * and nursery-chart.css. Dark mode is .dark on <html>; the tokens carry it.
 * Approved mockup: docs/design/mockups/climate-dial-732.html (frames g, h, i).
 */

/* ---- Popout (medium detent: sized to its rows, never taller than 70% of the screen) ---- */
.csn-overlay.open { background: var(--v2-bg-overlay); }
.csn-pop { background: var(--v2-bg-panel); color: var(--v2-text-primary); font-family: var(--v2-font-body); border-radius: var(--v2-radius-xl) var(--v2-radius-xl) 0 0; box-shadow: var(--v2-sheet-shadow); max-height: 70dvh; padding-bottom: 32px; }
.csn-pop::before { background: var(--v2-sheet-handle-bg); opacity: 1; width: 36px; height: 4px; margin: 8px auto 0; }
.csn-pop-body { overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.csn-pop-h { padding: 24px 20px 16px; }
.csn-pop-t, .csn-h { margin: 0; font-weight: 700; }
.csn-pop-t { font-size: 20px; line-height: 1.2; }
.csn-sub { margin: 0; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--v2-text-secondary); }

.csn-group { background: var(--v2-bg-card); border-radius: 16px; overflow: hidden; }
.csn-group-pop { margin: 0 20px; background: var(--v2-bg-secondary); }
.dark .csn-group-pop { background: var(--v2-bg-primary); }
.csn-srow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 16px; box-sizing: border-box; border: 0; background: none; text-align: left; color: var(--v2-text-primary); font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.csn-srow + .csn-srow { border-top: 0.5px solid var(--v2-border-strong); }
.csn-srow:focus-visible, .csn-back:focus-visible, .csn-tile:focus-visible, .csn-cal-link:focus-visible, .csn-retry:focus-visible { outline: 2px solid var(--v2-text-primary); outline-offset: 2px; }
.csn-rowtx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.csn-name { font-size: 17px; font-weight: 600; line-height: 1.25; }
.csn-reads { font-size: 13px; line-height: 1.35; color: var(--v2-text-secondary); }
.csn-sv { margin-top: 2px; font-size: 15px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.csn-tags { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--v2-text-secondary); }
.csn-tags .csn-slate, .csn-cal, .csn-attn .cr-row-label, .csn-attn .cr-row-val, .csn-row-ic { color: var(--v2-pop-slate-text); }
.csn-tags .csn-slate { font-weight: 600; }
.csn-ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.csn-srow > .csn-ic { width: 22px; height: 22px; color: var(--v2-text-tertiary); }

/* ---- Sensor page ---- */
.csn-slot { font-family: var(--v2-font-body); color: var(--v2-text-primary); }
.csn-slot * { box-sizing: border-box; }
.csn-slot button { font-family: inherit; }
.csn-nav { padding: 12px 12px 0; }
.csn-back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; border: 0; background: none; color: var(--v2-text-primary); font-size: 17px; font-weight: 500; cursor: pointer; }
.csn-back .csn-ic { width: 24px; height: 24px; }
.csn-pg { display: flex; flex-direction: column; gap: 32px; padding: 24px 20px 40px; }
.csn-shead { display: flex; flex-direction: column; gap: 4px; padding-left: 4px; }
.csn-h { font-size: 24px; line-height: 1.2; }
.csn-hero { display: flex; justify-content: center; margin: 0 -20px; }
.csn-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: -16px; }
.csn-cal { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 28px; margin: 0; font-size: 13px; font-weight: 500; line-height: 1.35; }
.csn-cal .csn-ic { width: 16px; height: 16px; }
.csn-cal-link { position: relative; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
/* The link reads small but takes a full 44px target. */
.csn-cal-link::after { content: ""; position: absolute; left: -12px; right: -12px; top: 50%; height: 44px; transform: translateY(-50%); }

.csn-tiles { display: grid; gap: 8px; }
.csn-tiles-3 { grid-template-columns: repeat(3, 1fr); }
.csn-tiles-2 { grid-template-columns: repeat(2, 1fr); }
.csn-tile { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 12px 10px; width: 100%; border: 0; border-radius: 16px; background: var(--v2-bg-card); color: var(--v2-text-primary); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.csn-tile.is-sel { box-shadow: inset 0 0 0 2px var(--v2-text-primary); }
.csn-tile-l { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--v2-text-secondary); }
.csn-tile-v { font-size: 22px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.csn-tile-u { font-size: 13px; font-weight: 500; color: var(--v2-text-secondary); }
.csn-tile-s { font-size: 13px; line-height: 1.35; color: var(--v2-text-secondary); min-height: 17.5px; }

.csn-sec { display: flex; flex-direction: column; gap: 16px; }
.csn-sh { margin: 0 4px; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--v2-text-secondary); }
.csn-chart { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.csn-state { margin: 0; padding: 24px 20px; text-align: center; font-size: 15px; line-height: 1.4; color: var(--v2-text-secondary); }
.csn-center { display: flex; justify-content: center; }
.csn-retry { min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--v2-text-primary); color: var(--v2-bg-primary); font-size: 15px; font-weight: 600; cursor: pointer; }

/* Status rows reuse .cr-row (climate-range.css); these two variants are only for the sensor page. */
.csn-static { cursor: default; }
.csn-row-ic { display: grid; place-items: center; width: 24px; flex: none; }
.csn-row-ic .csn-ic { width: 20px; height: 20px; }
.csn-attn .cr-row-val { font-weight: 600; }
