/* Site displays: the grid and the tiles, shared by the screen (/display, css/display.css) and the console's layout
   editor (css/displays.css). docs/SITE-DISPLAY.md. A tile's place is a class (gx-/gy-/gw-/gh-, js/display-tiles.js),
   never a style attribute. Type sizes follow the TILE's own size (container query units), so a big tile has big
   numbers and the editor's small preview is the screen drawn smaller. The grid is a container too: a tile's ordinary
   text size follows the size of the whole screen. Dark theme from the console's tokens. */

.dg{--dg-bg:#0A111E;--dg-panel:#101B2D;--dg-line:#1D2B42;--dg-ink:#E9F0F9;--dg-mut:#8CA0BA;--dg-dim:#7A8FAA;
  --dg-good:#3FBF7F;--dg-warn:#E9B23C;--dg-fault:#E05656;--dg-off:#5C7089;--dg-accent:#41B9DC;
  --dg-disp:"Bahnschrift","Barlow Condensed","Arial Narrow",Arial,sans-serif;--dg-body:"Segoe UI",system-ui,-apple-system,sans-serif;
  display:grid;gap:1.1%;padding:1.1%;background:var(--dg-bg);color:var(--dg-ink);font-family:var(--dg-body);
  position:relative;overflow:hidden;container-type:size}
.dg-landscape{grid-template-columns:repeat(12,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:16/9}
.dg-portrait{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(12,minmax(0,1fr));aspect-ratio:9/16}

/* Placement: column/row start (0-based) and span. */
.gx-0{grid-column-start:1}.gx-1{grid-column-start:2}.gx-2{grid-column-start:3}.gx-3{grid-column-start:4}
.gx-4{grid-column-start:5}.gx-5{grid-column-start:6}.gx-6{grid-column-start:7}.gx-7{grid-column-start:8}
.gx-8{grid-column-start:9}.gx-9{grid-column-start:10}.gx-10{grid-column-start:11}.gx-11{grid-column-start:12}
.gy-0{grid-row-start:1}.gy-1{grid-row-start:2}.gy-2{grid-row-start:3}.gy-3{grid-row-start:4}
.gy-4{grid-row-start:5}.gy-5{grid-row-start:6}.gy-6{grid-row-start:7}.gy-7{grid-row-start:8}
.gy-8{grid-row-start:9}.gy-9{grid-row-start:10}.gy-10{grid-row-start:11}.gy-11{grid-row-start:12}
.gw-1{grid-column-end:span 1}.gw-2{grid-column-end:span 2}.gw-3{grid-column-end:span 3}.gw-4{grid-column-end:span 4}
.gw-5{grid-column-end:span 5}.gw-6{grid-column-end:span 6}.gw-7{grid-column-end:span 7}.gw-8{grid-column-end:span 8}
.gw-9{grid-column-end:span 9}.gw-10{grid-column-end:span 10}.gw-11{grid-column-end:span 11}.gw-12{grid-column-end:span 12}
.gh-1{grid-row-end:span 1}.gh-2{grid-row-end:span 2}.gh-3{grid-row-end:span 3}.gh-4{grid-row-end:span 4}
.gh-5{grid-row-end:span 5}.gh-6{grid-row-end:span 6}.gh-7{grid-row-end:span 7}.gh-8{grid-row-end:span 8}
.gh-9{grid-row-end:span 9}.gh-10{grid-row-end:span 10}.gh-11{grid-row-end:span 11}.gh-12{grid-row-end:span 12}

/* One tile. */
.dt{position:relative;min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;
  background:var(--dg-panel);border:1px solid var(--dg-line);border-radius:10px;padding:3% 4%;
  /* The same padding on every tile, from the screen's size (a % padding is of the tile's WIDTH, so a wide tile lost a
     third of its height to it and its heading sat lower than its neighbours' - 22 Nov 2026). */
  padding:1.3cqmin 1.7cqmin;
  container-type:size;font-size:14px;font-size:clamp(8px,2.7cqmin,54px)}
.dt-head{display:flex;justify-content:space-between;align-items:baseline;gap:.5em;flex:0 0 auto;
  color:var(--dg-mut);font-family:var(--dg-disp);text-transform:uppercase;letter-spacing:.04em;
  font-size:1em;font-size:clamp(9px,min(10cqh,6cqw),40px);white-space:nowrap;overflow:hidden}
.dt-title{overflow:hidden;text-overflow:ellipsis}
.dt-site{color:var(--dg-dim);text-transform:none;letter-spacing:0;overflow:hidden;text-overflow:ellipsis}
.dt-body{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;justify-content:center;overflow:hidden}
.dt-empty{color:var(--dg-dim);text-align:center;font-size:.9em}
.dt-dim{color:var(--dg-dim);font-size:.8em}
.dt-sub{color:var(--dg-mut);font-size:.85em;margin-top:.2em}
.dt-row{display:flex;flex-wrap:wrap;gap:.4em;align-items:center;margin-top:.4em;font-size:.85em}

/* Colours by state. */
.dt-chip{display:inline-block;padding:.12em .55em;border-radius:999px;font-weight:600;font-size:.85em;white-space:nowrap;
  background:rgba(92,112,137,.18);color:var(--dg-mut)}
.dt-chip.dt-good{background:rgba(63,191,127,.16);color:var(--dg-good)}
.dt-chip.dt-warn{background:rgba(233,178,60,.17);color:var(--dg-warn)}
.dt-chip.dt-fault{background:rgba(224,86,86,.17);color:#FF6B5E}
.dt-chip.dt-off{background:rgba(92,112,137,.18);color:var(--dg-mut)}

/* Reading. */
.dt-reading{text-align:center}
.dt-value{display:flex;justify-content:center;align-items:baseline;gap:.15em;line-height:1}
.dt-num{font-family:var(--dg-disp);font-weight:700;font-size:4em;font-size:clamp(14px,min(48cqh,26cqw),400px)}
.dt-unit{color:var(--dg-mut);font-size:1.2em;font-size:clamp(9px,min(14cqh,8cqw),90px)}
.dt-reading.dt-good .dt-num{color:var(--dg-good)}
.dt-reading.dt-warn .dt-num{color:var(--dg-warn)}
.dt-reading.dt-fault .dt-num{color:#FF6B5E}
.dt-reading.dt-off .dt-num{color:var(--dg-off)}
.dt-range,.dt-age,.dt-tank{color:var(--dg-dim);font-size:.8em;margin-top:.25em}
.dt-stale .dt-age{color:var(--dg-warn)}

/* Trend. */
.dt-trend{display:flex;flex-direction:column;height:100%;min-height:0}
.dt-trend-now{flex:0 0 auto;display:flex;align-items:baseline;gap:.35em}
.dt-num-s{font-family:var(--dg-disp);font-weight:700;font-size:1.8em}
.dt-unit-s{color:var(--dg-mut)}
.dt-trend-now .dt-dim{margin-left:auto}
.dt-trend-body{flex:1 1 auto;display:flex;min-height:0;gap:.35em;margin-top:.3em}
.dt-yaxis{flex:0 0 auto;display:flex;flex-direction:column;justify-content:space-between;text-align:right;font-size:.55em;line-height:1;opacity:.72;font-variant-numeric:tabular-nums}
.dt-chart{flex:1 1 auto;width:100%;min-height:0;display:block}
.dt-band{fill:rgba(63,191,127,.14)}
.dt-line{fill:none;stroke:var(--dg-accent);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}

/* Status and compliance. */
.dt-status{text-align:center}
.dt-word{font-family:var(--dg-disp);font-weight:700;line-height:1.05;font-size:2.6em;font-size:clamp(14px,min(34cqh,16cqw),260px)}
.dt-status .dt-row{justify-content:center}
.dt-status.dt-good .dt-word{color:var(--dg-good)}
.dt-status.dt-warn .dt-word{color:var(--dg-warn)}
.dt-status.dt-fault .dt-word{color:#FF6B5E}
.dt-status.dt-off .dt-word{color:var(--dg-mut)}
.dt-lamp{display:inline-block;width:.9em;height:.9em;border-radius:50%;background:var(--dg-off)}
.dt-lamp-green{background:var(--dg-good)}
.dt-lamp-amber{background:var(--dg-warn)}
.dt-lamp-red{background:var(--dg-fault)}

/* Lists: alarms, jobs, maintenance. */
.dt-list{display:flex;flex-direction:column;height:100%;min-height:0;justify-content:flex-start}
.dt-count{font-family:var(--dg-disp);font-weight:700;font-size:1.4em;color:#FF6B5E}
.dt-list ul{list-style:none;margin:.3em 0 0;padding:0;overflow:hidden}
.dt-list li{display:flex;flex-wrap:wrap;align-items:center;gap:.2em .5em;padding:.25em 0;border-top:1px solid var(--dg-line)}
.dt-list li:first-child{border-top:0}
.dt-what{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dt-when{color:var(--dg-mut);font-size:.85em;white-space:nowrap}
.dt-overdue .dt-what,.dt-overdue .dt-when{color:#FF6B5E}
.dt-allclear{text-align:center;font-size:1.3em}
.dt-bar{flex:1 0 100%;height:.45em;border-radius:999px;background:rgba(92,112,137,.25);overflow:hidden}
.dt-fill{display:block;height:100%;width:0;background:var(--dg-good)}
.dt-fill.dt-warn{background:var(--dg-warn)}
.dt-fill.dt-fault{background:var(--dg-fault)}
.dt-fill.dt-off{background:var(--dg-off)}

/* Clock. */
.dt-clock{text-align:center}
.dt-time{font-family:var(--dg-disp);font-weight:700;line-height:1;font-variant-numeric:tabular-nums;font-size:4em;font-size:clamp(14px,min(50cqh,22cqw),400px)}
.dt-secs{color:var(--dg-mut);font-size:.5em}
.dt-date{color:var(--dg-mut);margin-top:.3em;font-size:1em;font-size:clamp(9px,min(14cqh,7cqw),80px)}

/* Text. */
.dt-text{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.2}
.dt-text-s{font-size:1em}
.dt-text-m{font-size:1.5em;font-family:var(--dg-disp)}
.dt-text-l{font-size:2.4em;font-family:var(--dg-disp);font-weight:700}

/* Do Not Drink. */
.dt-dnd-on{background:#7A1010;border-color:#FF6B5E}
.dt-dnd{text-align:center;color:#fff}
.dt-dnd-word{font-family:var(--dg-disp);font-weight:800;letter-spacing:.03em;line-height:1.05;font-size:2.6em;font-size:clamp(14px,min(32cqh,9cqw),240px)}
.dt-dnd .dt-sub,.dt-dnd .dt-dim{color:#FFE3E0}
.dt-dnd-off{text-align:center}
.dt-dnd-note{color:var(--dg-dim);font-size:.85em}

/* All sites board: one row per site, as many as the tile holds; the type grows with the room each row has. */
.dt-sites{--rows:6;justify-content:flex-start}
.dt-sr-1{--rows:1}.dt-sr-2{--rows:2}.dt-sr-3{--rows:3}.dt-sr-4{--rows:4}.dt-sr-5{--rows:5}.dt-sr-6{--rows:6}.dt-sr-7{--rows:7}.dt-sr-8{--rows:8}
.dt-sr-9{--rows:9}.dt-sr-10{--rows:10}.dt-sr-11{--rows:11}.dt-sr-12{--rows:12}.dt-sr-13{--rows:13}.dt-sr-14{--rows:14}.dt-sr-15{--rows:15}.dt-sr-16{--rows:16}
.dt-sr-17{--rows:17}.dt-sr-18{--rows:18}.dt-sr-19{--rows:19}.dt-sr-20{--rows:20}.dt-sr-21{--rows:21}.dt-sr-22{--rows:22}.dt-sr-23{--rows:23}.dt-sr-24{--rows:24}
.dt-sites ul{margin:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.dt-sites li.dt-site-row{flex:1 1 0;min-height:0;flex-wrap:nowrap;gap:.6em;padding:0;
  font-size:1em;font-size:clamp(8px,min(calc(52cqh / var(--rows)),4.2cqw),72px)}
.dt-sites .dt-what{font-weight:600}
.dt-sites .dt-chip{font-size:.8em}
.dt-site-alarms{color:var(--dg-mut);font-size:.8em;white-space:nowrap}
.dt-site-alarms.dt-has{color:#FF6B5E;font-weight:700}
.dt-dot{flex:0 0 auto;width:.6em;height:.6em;border-radius:50%;background:var(--dg-off)}
.dt-dot-on{background:var(--dg-good)}
.dt-dot-off{background:var(--dg-fault)}
/* Reminders (22 Nov 2026): the same rows as the All sites board - as many as the tile holds, each one line, the type
   growing with the room each row has; a long title is cut with "..." on its own line, never on top of another. */
.dt-rem{--rows:5;justify-content:flex-start}
.dt-rem ul{margin:0;display:flex;flex-direction:column;flex:1 1 auto;min-height:0}
.dt-rem li.dt-rem-row{flex:0 1 calc(100% / var(--rows));min-height:0;flex-wrap:nowrap;gap:.5em;padding:0;
  font-size:1em;font-size:clamp(8px,min(calc(44cqh / var(--rows)),3.6cqw),64px)}
.dt-rem .dt-chip{font-size:.75em;flex:0 0 auto}
.dt-rem-kind{color:var(--dg-mut)}
.dt-rem-site{color:var(--dg-mut);font-size:.8em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:30%;flex:0 1 auto}
.dt-rem .dt-when{flex:0 0 auto}
.dt-rem .dt-overdue .dt-when{color:#FF6B5E}
.dt-rem .dt-more{flex:0 0 auto;padding-top:.2em;font-size:clamp(8px,min(calc(36cqh / var(--rows)),3cqw),48px)}
@container (max-width:20em){ .dt-rem .dt-when{display:none} }
.dt-sites .dt-more{flex:0 0 auto;padding-top:.2em;font-size:clamp(8px,min(calc(40cqh / var(--rows)),3.4cqw),56px)}

/* Widget set 1 (21 Nov 2026): weather, warnings, notices, days since, water used, next due, logo. */
.dt-foot{flex:0 0 auto;margin-top:auto;padding-top:.2em;color:var(--dg-dim);font-size:.7em;font-size:max(.7em,10px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt-wrap{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.dt-chip.dt-orange{background:rgba(240,128,48,.18);color:#F59B52}
.dt-weather{display:flex;flex-direction:column;height:100%;min-height:0}
/* Everything but the credit: the part that gives way on a small tile. The credit (.dt-foot) is outside it. */
.dt-wx-main{flex:1 1 auto;min-height:0;overflow:hidden;display:flex;flex-direction:column}
.dt-wx-now{display:flex;align-items:center;gap:.5em;flex:0 0 auto;min-width:0;white-space:nowrap}
.dt-wx-icon{width:2.6em;height:2.6em;flex:0 0 auto}
.dt-wx-now .dt-wx-icon{width:3.4em;height:3.4em;width:min(3.4em,26cqh);height:min(3.4em,26cqh)}
.dt-wx-sun{fill:#F2C14E}
.dt-wx-ray{fill:none;stroke:#F2C14E;stroke-width:1.4;stroke-linecap:round}
.dt-wx-moon{fill:#C9D6EA}
.dt-wx-cloud{fill:#9FB2CC;stroke:#0A111E;stroke-width:.6}
.dt-wx-rain{fill:none;stroke:var(--dg-accent);stroke-width:1.4;stroke-linecap:round}
.dt-wx-snow{fill:none;stroke:#E9F0F9;stroke-width:2.2;stroke-linecap:round}
.dt-wx-fog{fill:none;stroke:#9FB2CC;stroke-width:1.4;stroke-linecap:round}
.dt-wx-bolt{fill:none;stroke:#F2C14E;stroke-width:1.5;stroke-linejoin:round;stroke-linecap:round}
.dt-wx-temp{font-family:var(--dg-disp);font-weight:700;line-height:1;font-size:2.6em;font-size:clamp(14px,min(24cqh,14cqw),200px)}
.dt-wx-words{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:1.05em}
.dt-wx-rainline{flex:0 0 auto;margin-top:.3em;font-size:.95em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dt-wx-rainline strong{color:var(--dg-accent)}
.dt-wx-rl-short,.dt-wx-heavyflag,.dt-wx-ds{display:none}
.dt-wx-heavyflag{color:var(--dg-warn);font-weight:600}
.dt-wx-heavy{flex:0 0 auto;margin-top:.3em;padding:.25em .5em;border-radius:6px;background:rgba(233,178,60,.17);color:var(--dg-warn);font-weight:600;font-size:.85em;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
/* The days: one column each, as many as the width holds (the rest are left out whole, never cut). */
.dt-wx-days{list-style:none;margin:.4em 0 0;padding:0;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:.3em;flex:0 0 auto;min-height:0}
.dt-wx-days li{display:flex;flex-direction:column;align-items:center;text-align:center;gap:.1em;min-width:0;overflow:hidden;
  border-top:1px solid var(--dg-line);padding-top:.2em;font-size:.85em}
.dt-wx-days .dt-wx-icon{width:2em;height:2em}
.dt-wx-day{color:var(--dg-mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.dt-wx-hl{font-weight:600;white-space:nowrap}
.dt-wx-mm{color:var(--dg-accent);font-size:.9em;white-space:nowrap}

/* The weather tile by its own size (22 Nov 2026: a 6 x 3 tablet tile cut its days and ran over the credit). The sizes
   are in em of the TILE's text size (a container query's em is the container's), so they hold on any screen: about
   8 em is a 2-row landscape tile, 12.6 em 3 rows, 17 em 4 rows (portrait rows are taller: 9.4 / 15 / 20.5 em). */
@container (max-height:21em){ .dt-wx-heavy{display:block;white-space:nowrap;text-overflow:ellipsis} }
@container (max-width:26em){ .dt-wx-wind{display:none} }
@container (max-width:19em){ .dt-wx-rl-long{display:none} .dt-wx-rl-short{display:inline} }
/* Days as tall columns: icon, day, high / low, rain. */
@container (max-width:21em){ .dt-wx-days li:nth-child(n+4){display:none} }
@container (max-width:15.5em){ .dt-wx-days li:nth-child(n+3){display:none} }
@container (max-width:10em){ .dt-wx-days li:nth-child(n+2){display:none} }
/* Shorter: each day two lines beside its icon (day / high-low), no rain per day. */
@container (max-height:17.5em){
  .dt-wx-days li{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;column-gap:.35em;row-gap:0;
    align-items:center;justify-items:start;text-align:left}
  .dt-wx-days li .dt-wx-icon{grid-row:1 / span 2;width:1.7em;height:1.7em}
  .dt-wx-days .dt-wx-mm{display:none}
}
@container (max-height:17.5em) and (max-width:27em){ .dt-wx-days li:nth-child(n+4){display:none} }
@container (max-height:17.5em) and (max-width:20em){ .dt-wx-days li:nth-child(n+3){display:none} }
@container (max-height:17.5em) and (max-width:13em){ .dt-wx-days li:nth-child(n+2){display:none} }
/* Shorter still: each day on one line with its short name ("Wed 20 / 11"). */
@container (max-height:13.2em){
  .dt-wx-days li{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:.3em}
  .dt-wx-days li .dt-wx-icon{width:1.3em;height:1.3em}
  .dt-wx-dl{display:none} .dt-wx-ds{display:inline}
}
@container (max-height:13.2em) and (max-width:32em){ .dt-wx-days li:nth-child(n+4){display:none} }
@container (max-height:13.2em) and (max-width:23em){ .dt-wx-days li:nth-child(n+3){display:none} }
@container (max-height:13.2em) and (max-width:15em){ .dt-wx-days li:nth-child(n+2){display:none} }
/* No room for the days: now and the rain expected only. */
@container (max-height:10.6em){ .dt-wx-days{display:none} }
/* The smallest: the heavy-rain line becomes "- heavy" on the rain line. */
@container (max-height:8.6em){ .dt-wx-heavy{display:none} .dt-wx-heavyflag{display:inline} }
.dt-wa-area{flex:1 0 100%;margin-top:0}
.dt-notices li{flex-wrap:nowrap;align-items:flex-start}
.dt-streak{text-align:center}
.dt-streak .dt-num{line-height:1}
.dt-streak.dt-good .dt-num{color:var(--dg-good)}
.dt-streak.dt-fault .dt-num{color:#FF6B5E}
/* Which red alarm (22 Nov 2026): its short name on one line; the full title (two lines at most) on a tall tile. */
.dt-streak-what{color:var(--dg-dim);font-size:.8em;margin-top:.15em;overflow:hidden}
.dt-streak-short{white-space:nowrap;text-overflow:ellipsis}
.dt-streak-full{display:none}
@container (min-height:15em){
  .dt-streak-short.dt-has-full{display:none}
  .dt-streak-full{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
}
.dt-water{display:flex;flex-direction:column;justify-content:center;gap:.4em;height:100%}
.dt-wu{display:flex;justify-content:space-between;align-items:baseline;gap:.5em;border-top:1px solid var(--dg-line);padding-top:.2em}
.dt-wu:first-child{border-top:0}
.dt-water .dt-num-s{color:var(--dg-accent);font-size:clamp(12px,min(20cqh,11cqw),140px)}
.dt-due li{display:block}
.dt-due .dt-what{display:block;white-space:normal}
.dt-due .dt-when{display:block}
.dt-logo{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:0}
.dt-logo-img{display:block;width:100%;height:100%;min-height:0}
.dt-fit-contain{object-fit:contain}
.dt-fit-cover{object-fit:cover}
.dt-type-logo .dt-body{justify-content:stretch}
