/* Top-level navigation (views.js): the filter bar (Region, Ranch, Variety, Block) and the two views.
   Map       the map with its tools, full size.
   Overview  summary tiles, the chart, and the tabbed insights column.
   The printed report shows everything, so the view rules step aside for html.print-layout. */

#app { grid-template-columns: minmax(0, 1fr); }
#btnRanch, #btnChartFold { display: none; }
.brand { width: auto; padding-right: 6px; }
.seg.views { margin-left: 8px; flex: none; }

/* Filter bar: its own row under the top bar, in both views. Each filter is a labelled picker;
   one with nothing to choose (its select is hidden) disappears with its label. */
.filterbar { display: flex; align-items: center; gap: 8px 18px; flex: none; flex-wrap: wrap; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.filt { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filt > span { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filt select { height: 32px; min-width: 130px; max-width: 220px; font-weight: 500; }
.filt.block select { min-width: 180px; max-width: 280px; font-weight: 650; }
.filt:has(select[hidden]) { display: none; }
.filterbar .crumb { margin-left: auto; border-left: none; padding-left: 0; }
html.no-blocks #btnPrint { display: none; }
.filterbar #btnPrint { margin-left: auto; flex: none; }
.filterbar .crumb:not(:empty) + #btnPrint { margin-left: 0; }
.crumb b { display: none; }                       /* the Block picker already shows the name */
.seg.views span { padding: 5px 16px; font-size: 13px; }

.maptools { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; }
.maptools .place { flex: 1 1 240px; max-width: 420px; margin: 0; position: relative; }
.maptools .btns { display: flex; gap: 6px; }
#blockActs { margin-left: auto; }

html:not(.print-layout)[data-view="map"] #overview,
html:not(.print-layout)[data-view="map"] #insights,
html:not(.print-layout)[data-view="map"] #chartWrap,
html:not(.print-layout)[data-view="map"] #ranch,
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #mapWrap,
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #mapTools { display: none; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #timeBar, html.print-layout #timeBar, html.no-blocks #timeBar,
html.print-layout #mapTools { display: none; }

/* Time slider under the map (timeslider.js) */
.timebar { display: flex; align-items: center; gap: 8px; flex: none; padding: 7px 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); }
.timebar input[type=range] { flex: 1; min-width: 80px; accent-color: var(--accent); }
.time-label { min-width: 250px; text-align: right; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.time-label b { font-weight: 650; }
.time-label span { color: var(--ink-2); margin-left: 6px; }
.time-label .m { color: var(--muted); }
html:not(.print-layout)[data-view="map"] .work { grid-template-columns: minmax(0, 1fr); }

/* Overview: tiles across the top, the chart on the left, insights on the right.
   Water (css/water.css) uses the same layout with the water chart and the water cards. */
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) main { display: grid; grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: max-content max-content minmax(420px, 1fr); overflow-y: auto; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #filterBar,
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #overview { grid-column: 1 / -1; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) .work { display: contents; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #chartWrap { grid-column: 1; grid-row: 3; height: auto; max-height: none; min-height: 0; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #insights { grid-column: 2; grid-row: 3; }

/* "All blocks": the comparison table takes the place of the tiles, chart and insights, under the filter bar */
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) #ranch { position: static; inset: auto; z-index: auto; padding: 4px 2px 12px; background: none;
  overflow: visible; grid-column: 1 / -1; }
html:not(.print-layout):is([data-view="overview"], [data-view="water"], [data-view="weather"]) main:has(> #ranch:not([hidden])) > :is(#overview, .work, #chartWrap) { display: none; }
html.print-layout #filterBar { display: none; }

/* Downloads live where their data is: outlines and zones here in the map tools, readings on the chart, the report on the Overview */
.maptools .menu-list { left: 0; right: auto; }
.maptools .menu button svg { width: 12px; height: 12px; }
html.print-layout #btnPrint { display: none; }
