/* The console's Displays page (#/displays, js/displays.js) and the layout editor (js/display-editor.js);
   docs/SITE-DISPLAY.md. The grid and the tiles themselves: css/display-tiles.css (shared with the screen). */

/* ---------------------------------------------------------------- the list */
.dsp .btn.danger,.de .btn.danger{border-color:rgba(224,86,86,.5);color:var(--red,#FF6B5E);background:var(--fault-soft,rgba(224,86,86,.13))}
.dsp-list{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.dsp-row{border:1px solid var(--line);border-radius:var(--r,10px);background:var(--panel-2);padding:12px 14px;display:flex;flex-wrap:wrap;gap:10px 16px;align-items:flex-start}
.dsp-main{flex:1 1 320px;min-width:0}
.dsp-name{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:4px}
.dsp-name strong{font-size:15px}
.dsp-btns{flex:0 1 auto;display:flex;flex-wrap:wrap;gap:6px}
.dsp-form{flex:1 0 100%;border-top:1px solid var(--line-soft);padding-top:10px}
.dsp-code-in{font-family:var(--disp);font-size:20px;letter-spacing:.2em;text-transform:uppercase;max-width:12em}
.dsp-address{flex:1 0 100%;display:flex;flex-wrap:wrap;gap:16px;border-top:1px solid var(--line-soft);padding-top:12px}
.dsp-qr{flex:0 0 auto;width:180px;max-width:100%}
.dsp-qr .qr{display:block;width:100%;height:auto;border-radius:6px}
.dsp-addr-side{flex:1 1 300px;min-width:0}
.dsp-addr-side input[readonly]{width:100%;font-family:ui-monospace,Consolas,monospace;font-size:12px;user-select:all}
.dsp-addr-side .btnrow{margin:8px 0}
.dsp-key-note{margin-top:8px}

/* ---------------------------------------------------------------- the layout editor */
.de{display:flex;flex-direction:column;gap:12px}
.de-top{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:flex-end;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--r,10px);padding:12px 14px}
.de-top h3{margin:0 12px 0 0}
.de-top label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--ink-mut)}
.de-top .btnrow{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.de-dirty{color:var(--warn);font-weight:600}
.de-main{display:grid;grid-template-columns:170px minmax(0,1fr) 280px;gap:12px;align-items:start}
.de-ro .de-main{grid-template-columns:minmax(0,1fr) 280px}
.de-palette,.de-side{background:var(--panel);border:1px solid var(--line);border-radius:var(--r,10px);padding:12px}
.de-palette h4,.de-side h4{margin:0 0 8px;font-family:var(--disp);letter-spacing:.06em;text-transform:uppercase;font-size:12px;color:var(--ink-mut)}
.de-palette{display:flex;flex-direction:column;gap:6px}
.de-add{text-align:left;width:100%}
.de-stage{min-width:0}
.de-grid{border:1px solid var(--line);border-radius:var(--r,10px);user-select:none;margin:0 auto}
.de-grid.dg-landscape{width:min(100%,calc(72vh * 16 / 9))}
.de-grid.dg-portrait{width:min(100%,calc(72vh * 9 / 16))}
.de-cell{border:1px dashed rgba(140,160,186,.13);border-radius:4px}
.de-tile{cursor:grab;touch-action:none;outline-offset:2px}
.de-ro .de-tile{cursor:pointer}
.de-tile:hover{border-color:#2B3E5C}
.de-sel{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent)}
.de-dragging{cursor:grabbing;opacity:.92;z-index:2}
.de-refused{box-shadow:0 0 0 2px var(--fault,#E05656)}
.de-handle{position:absolute;right:0;bottom:0;width:18px;height:18px;cursor:nwse-resize;touch-action:none;
  background:linear-gradient(135deg,transparent 50%,var(--accent) 50%);border-bottom-right-radius:9px;opacity:.75}
.de-sel .de-handle,.de-handle:hover{opacity:1}
.de-keys{margin:8px 0 0;font-size:12px}
.de-live{min-height:1.4em;margin:4px 0 0;color:var(--accent);font-size:12.5px}
.de-fields{display:flex;flex-direction:column;gap:10px;margin:10px 0}
.de-fields label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--ink-mut)}
.de-fields label.de-check{flex-direction:row;align-items:center;gap:8px;color:var(--ink)}
.de-fields input[type="text"],.de-fields select,.de-fields textarea{width:100%}
/* In the editor a Do Not Drink tile with no notice active still shows where it is. */
.de .dt-hidden-off{border-style:dashed}
/* In the editor a Reading / Trend tile whose input is switched off at the site is greyed (the screen leaves it out). */
.de .dt-input-off{border-style:dashed;opacity:.55;filter:grayscale(1)}

@media (max-width:1100px){
  .de-main,.de-ro .de-main{grid-template-columns:minmax(0,1fr)}
  .de-palette{flex-direction:row;flex-wrap:wrap}
  .de-palette h4{flex:1 0 100%}
  .de-add{width:auto}
}
.de-sites{border:1px solid var(--line);border-radius:7px;padding:6px 10px;margin:0;display:flex;flex-direction:column;gap:4px;max-height:220px;overflow:auto}
.de-sites legend{font-size:12px;color:var(--ink-mut);padding:0 4px}
/* Rotating pages (widget set 1): one tab per page, add / move / remove, and the seconds each page shows. */
.de-pages{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px}
.de-page-tab{min-width:0}
.de-page-tab.de-page-on{background:var(--accent);color:#fff;border-color:var(--accent)}
.de-pages label{display:flex;align-items:center;gap:6px;margin-left:auto;font-size:13px}
