/* Shared operating views. The typography and colour tokens belong to the building shell. */
.content, .portal { max-width:none; width:100%; }
.content { padding:clamp(.85rem,1.8vw,2rem); }
.content section, .columns > *, .stack, .period-report, .block { min-width:0; }
.login-points { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
.login-points > div { min-width:0; }
.login-box .service-entry { display:inline-block; color:var(--cyan); text-underline-offset:.2em; }
.site-credit { display:flex; align-items:center; justify-content:space-between; gap:.8rem; border-top:1px solid #375775; background:#091a2a; color:#a9c7dc; padding:.85rem clamp(1rem,2.5vw,2.4rem); }
.site-credit strong { color:#e4f1f7; }
.alarm-indicator { display:inline-flex; align-items:center; gap:.43rem; border:1px solid #3c5a6b; border-radius:20px; color:#bcd0da; padding:.3rem .62rem; text-decoration:none; }
.alarm-indicator i { width:.52rem; height:.52rem; border-radius:50%; background:#699a91; }
.alarm-indicator.on { border-color:#aa5760; color:#ffb8b7; background:#44252f; }
.alarm-indicator.on i { background:#ff776f; box-shadow:0 0 0 3px #722e38; }
.period-toolbar { display:flex; align-items:end; flex-wrap:wrap; gap:.55rem .8rem; padding:.72rem .92rem; background:#0c2033; border:1px solid #29475e; border-left:3px solid #54d6d0; border-radius:10px; margin:0 0 1rem; }
.period-toolbar label { display:grid; gap:.2rem; margin:0; font-size:.78rem; color:#bed5e2; }
.period-toolbar input, .period-toolbar select { width:auto; min-width:5.5rem; max-width:100%; padding:.33rem .48rem; font:inherit; font-size:.9rem; }
.period-toolbar [hidden], [data-live-page][hidden] { display:none!important; }
.period-zone { margin-left:auto; align-self:center; }
.period-error { color:#ffb5ac; }
.period-report { display:grid; align-content:start; gap:.65rem; border-top:2px solid #56d6c8; }
[data-live-page] > .period-report, [data-activity-log] > section { margin-top:1rem; }
.period-stats { display:flex; flex-wrap:wrap; gap:.55rem; margin:.8rem 0; }
.period-stats > div { flex:1 1 10rem; display:grid; gap:.2rem; padding:.7rem; background:#132d41; border-radius:8px; }
.period-stats strong { color:#69e4d3; font-size:1.55rem; }
.log-viewport { overflow:auto; max-height:32rem; border:1px solid #45647a; border-radius:.5rem; scrollbar-width:thin; }
.log-sheet { width:100%; min-width:42rem; table-layout:fixed; border-collapse:separate; border-spacing:0; }
.log-sheet .date-col { width:7.8rem; }
.log-sheet .time-col { width:4.7rem; }
.log-sheet .source-col { width:20%; }
.log-sheet .status-col { width:18%; }
.log-sheet th, .log-sheet td { text-align:left; vertical-align:middle; overflow-wrap:anywhere; padding:.56rem .78rem; border:0; }
.log-sheet tr > :not(:last-child) { border-inline-end:1px solid #36576c; }
.log-sheet th { position:sticky; top:0; z-index:1; background:#1a3d53; color:#eaf7fa; box-shadow:inset 0 -1px #4c7184; }
.log-sheet tbody + tbody > tr:first-child > td, .log-sheet .log-detail > td { border-top:1px solid #39586b; }
.log-sheet .activity-record:nth-of-type(even) { background:#112b41; }
.log-sheet [data-log-row] { cursor:pointer; }
.log-sheet [data-log-row]:is(:hover,:focus-within), .log-sheet [data-log-row]:has([aria-expanded="true"]) { background:#173d51; }
.log-date, .log-time { font-variant-numeric:tabular-nums; white-space:nowrap; color:#c5dbe6; }
.log-toggle { display:flex; align-items:baseline; gap:.55rem; width:100%; padding:.1rem 0; background:transparent; border:0; color:var(--text); text-align:left; overflow-wrap:anywhere; font-weight:600; cursor:pointer; }
.log-chevron { flex:none; width:.43rem; height:.43rem; border:solid #80d6d9; border-width:0 1.5px 1.5px 0; transform:rotate(-45deg); }
.log-toggle[aria-expanded="true"] .log-chevron { transform:translateY(-.14rem) rotate(45deg); }
.log-sheet .tag { white-space:normal; line-height:1.35; }
.log-sheet .log-detail > td { padding:.8rem 1rem; background:#102f41; color:#deedf4; }
.log-detail small, .asset-area { color:var(--muted); font-size:.81rem; }
.log-detail small, .asset-area { display:block; margin-top:.3rem; }
.log-sheet .log-empty { color:var(--muted); padding:1rem; }
.plant-kpis { margin-top:.7rem; margin-bottom:.7rem; }
.trend-bars { height:12rem; display:flex; align-items:end; gap:clamp(1px,.45vw,.4rem); margin:.7rem 0; padding:.5rem; border-bottom:1px solid #476377; background:repeating-linear-gradient(to top,#4763774a 0 1px,transparent 1px 25%); }
.trend-bars > div { display:flex; align-items:end; height:100%; flex:1; min-width:0; gap:1px; }
.trend-bars i, .trend-bars b { display:block; width:50%; border-radius:2px 2px 0 0; }
.trend-bars i { background:#6396a9; }
.trend-bars b { background:linear-gradient(#61e0d2,#22998f); }
.camera-card, .control-log { margin-top:.65rem; padding:.7rem; border-radius:8px; border:1px solid #35556b; }
.camera-card img { width:100%; max-height:18rem; object-fit:cover; }
.written-observation, .sound-written-evidence, .incident-written-evidence, .cctv-empty-stage { display:grid; align-content:center; gap:.65rem; background:linear-gradient(135deg,#16384d,#142b3c); color:#d7e9f1; padding:1rem; border-radius:8px; }
.work-tabs { display:flex; flex-wrap:wrap; gap:.4rem; padding:.15rem 0; }
.work-tabs a { text-decoration:none; border:1px solid #34546a; padding:.55rem .85rem; border-radius:8px; color:#c6dce8; }
.work-tabs a[aria-current], .work-tabs a:hover { border-color:#66dcce; background:#153d43; color:#b3fff1; }
.robot-stat { text-decoration:none; color:inherit; border-top:2px solid #388f93; }
.robot-stat:hover, .robot-stat:focus-visible { border-color:#69ded3; }
.scene-track { position:relative; border-bottom:2px solid #39566c; padding:1rem 0 .35rem; margin:.6rem 0; }
.scene-track i { position:absolute; bottom:-.3rem; width:.6rem; height:.6rem; border-radius:50%; background:#6fe7d1; left:min(calc(100% - .6rem),var(--progress,0%)); transition:left 1.3s; }
.robot-camera { position:relative; }
.robot-camera [data-robot-marker] { position:absolute; left:23%; top:70%; display:grid; place-items:center; width:1.5rem; height:1.5rem; color:#03222a; background:#85f9e7; border:2px solid white; border-radius:50%; box-shadow:0 0 .75rem #083655; transition:left 1.3s,top 1.3s; }
.dispatch .period-report { margin-top:.25rem; padding:.75rem; }
.tower-stage { position:relative; display:grid; place-items:center; height:22rem; overflow:hidden; border-radius:10px; background:radial-gradient(ellipse at 50% 59%,#235571,#0a1c2f 72%); perspective:750px; }
.tower-structure { width:12rem; height:8rem; transform-style:preserve-3d; transform:translateY(2.4rem) rotateX(61deg) rotateZ(var(--tower-rotation,-24deg)); }
.tower-deck { position:absolute; inset:0; border:1.3px solid #75bfcd; background:linear-gradient(120deg,#265a70cc,#173546e8); transform:translateZ(var(--z)); box-shadow:0 0 0 1px #132b3640; }
.tower-deck.hazard { border-color:#ff9e83; background:#8d5048ee; }
.tower-deck.picked,.tower-deck:hover,.tower-deck:focus-visible { border:2px solid #b1fff2; background:#469f9c; }
.tower-caption { position:absolute; bottom:.65rem; left:.7rem; color:#c5e0ee; }
.unit-plan { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.25rem; padding:.55rem; background:#0b1c2c; border:1px solid #477289; }
.unit-plan a,.rooms span { padding:.7rem .3rem; text-align:center; border:1px solid #4d7386; color:#c8e1ea; background:#193c4f; text-decoration:none; }
.unit-plan a:hover,.unit-plan .selected { background:#25685f; border-color:#80e4d0; }
.unit-detail { margin:.65rem 0; }
.rooms { display:grid; grid-template-columns:1.4fr repeat(2,1fr); gap:.2rem; }
.rooms span { font-size:.78rem; background:#264451; }
.visit-photo { margin:.6rem 0; }
.visit-photo img,.survey-figure img { display:block; max-width:100%; max-height:20rem; object-fit:contain; }
.contractor-shell { width:min(64rem,100%); margin:0 auto; min-height:85svh; padding:1.5rem clamp(1rem,4vw,3rem); }
.service-brand { display:flex; align-items:center; gap:.65rem; border-bottom:1px solid #375775; padding-bottom:.9rem; margin-bottom:.9rem; }
.service-brand img { width:110px; }
.form-stack .check { display:flex; align-items:center; gap:.6rem; }
.form-stack .check input { width:auto; }
.block details > summary { cursor:pointer; }
@media(max-width:680px) {
  .login-points { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .period-toolbar { gap:.45rem; }
  .period-zone { width:100%; }
  .alarm-indicator { padding:.32rem .45rem; max-width:7.1rem; line-height:1.12; font-size:.74rem; }
  .contractor-shell { padding:.8rem; }
}
@media(prefers-reduced-motion:reduce) { .scene-track i { animation:none; } }

[data-equipment-list], [data-equipment-metrics], .table-wrap, .block > div, .stack > *, .content > div, .log-book { min-width:0; max-width:100%; }
.survey-figure { position:relative; margin:.5rem 0; width:fit-content; }
.survey-figure i { position:absolute; display:grid; place-items:center; width:1.45rem; height:1.45rem; background:#12695d; color:#fff; border:2px solid #c8fff2; border-radius:50%; font-style:normal; }
.equip-current { border-left:3px solid var(--cyan); padding:.5rem .8rem; background:#142f43; }

.form-stack fieldset { border:1px solid #35556b; border-radius:8px; padding:.5rem .8rem; }
.form-stack legend { color:var(--muted); padding:0 .3rem; }

/* Rows use their available width even when access or the selected period changes the number of items. */
.metric-row, .module-links, .dashboard-register .card-list, .alert-register { display:flex; flex-wrap:wrap; }
.metric-row > .metric { flex:1 1 max(min(100%,9.5rem),calc((100% - 2.1rem)/4)); }
.dispatch-metrics > .metric { flex-basis:max(min(100%,7rem),calc((100% - .7rem)/2)); }
.dashboard-top .building-scene { min-height:clamp(15rem,24vw,21rem); }
.dashboard-top .dispatch { align-content:space-between; }
.compact-entrance { grid-template-columns:minmax(0,1fr); }
.compact-entrance .dispatch { display:flex; flex-wrap:wrap; align-items:center; gap:.75rem 1rem; }
.compact-entrance .dispatch header, .compact-entrance .dispatch-metrics { flex:1 1 min(100%,19rem); }
.dashboard-stamp { max-width:100%; flex-wrap:wrap; }
.trend-line.previous, .utility-trend ~ .row .key.yesterday { background:#688cb7; }
.trend-point { position:absolute; width:.4rem; height:.4rem; transform:translate(-25%,-30%); background:#9ef2ed; border-radius:50%; }
.module-directory { display:grid; gap:1.1rem; margin-top:1.1rem; }
.module-directory h2 { font-size:1.04rem; line-height:1.4; color:#dfeef5; margin:0 0 .48rem; }
.module-links, .alert-register { gap:.6rem; }
.module-link {
  display:flex; align-items:center; gap:.72rem; flex:1 1 max(min(100%,12.7rem),calc((100% - 1.8rem)/4));
  padding:.7rem; min-width:0; border:1px solid #31556a; border-radius:.65rem; background:linear-gradient(110deg,#153248,#11283b);
}
.module-link:hover, .module-link:focus-visible { background:#1a3d51; border-color:#75c5ce; }
.module-link img, .module-link .glyph { width:clamp(2.8rem,4vw,4rem); height:3.6rem; flex:none; object-fit:cover; border-radius:.38rem; }
.module-link picture { flex:none; }
.module-link .glyph { font-size:1.35rem; }
.module-link span:last-child { min-width:0; }
.module-link strong, .module-link small { display:block; overflow-wrap:anywhere; }
.module-link small { color:#b6ccda; line-height:1.35; margin-top:.18rem; font-size:.8rem; }
.module-links:has(> :nth-child(5):last-child) .module-link { flex-basis:max(min(100%,12.7rem),calc((100% - 1.2rem)/3)); }
[data-entrance-report]:not(:empty) { margin-top:.9rem; }
.dashboard-register .card-list > .record, .alert-register > .record {
  flex:1 1 max(min(100%,17rem),calc((100% - 1.2rem)/3)); min-width:0;
}
.alert-register > .record { flex-basis:max(min(100%,18rem),calc((100% - .6rem)/2)); }
.alert-register a[aria-current] { border-color:#75d7d6; background:#173c4d; }
.alarm-facts { display:flex; flex-wrap:wrap; margin:0; border:1px solid var(--line); border-radius:.5rem; overflow:hidden; gap:1px; background:var(--line); }
.alarm-facts > div { flex:1 1 9.6rem; padding:.6rem .8rem; background:#122e42; }
.alarm-facts dt { color:var(--muted); }
.alarm-facts dd { margin:.18rem 0 0; font-weight:600; }
.alarm-detail > .form-stack { display:flex; flex-wrap:wrap; align-items:end; }
.alarm-detail > .form-stack label { flex:1 1 18rem; }
.alarm-detail > .form-stack textarea { min-height:2.65rem; height:2.65rem; resize:vertical; }
.alarm-detail > .form-stack button { align-self:end; }
.alarm-detail > details { border-top:1px solid var(--line); padding-top:.6rem; }
.submeter-register .table-wrap td:nth-child(n+3), .submeter-register .table-wrap th:nth-child(n+3) { text-align:right; font-variant-numeric:tabular-nums; }
.meter-share { display:inline-flex; align-items:center; justify-content:end; gap:.5rem; }
.meter-share > i { width:clamp(2.5rem,6vw,6rem); height:.32rem; background:#2c485d; border-radius:2px; }
.meter-share b { display:block; height:100%; background:var(--teal); border-radius:2px; }
.columns[data-panel-layout="rows"], .two[data-panel-layout="rows"], .feed[data-panel-layout="rows"], .dashboard-analytics[data-panel-layout="rows"] { grid-template-columns:minmax(0,1fr); }
.content .measure-panels { align-items:start; }
.dashboard-analytics[data-panel-layout="rows"] > .stack { display:flex; flex-wrap:wrap; gap:.85rem; }
.dashboard-analytics[data-panel-layout="rows"] > .stack > .block { flex:1 1 min(100%,20rem); }
.contractor-shell > .columns { display:grid; grid-template-columns:minmax(0,1fr); margin-top:.9rem; }
@media(min-width:901px) {
  .sidebar { position:sticky; top:4.2rem; max-height:calc(100dvh - 4.2rem); overflow-y:auto; align-self:start; scrollbar-width:thin; }
}
@media(min-width:780px) {
  [data-entrance-report] .period-report, .dashboard-register > .period-report {
    display:flex; flex-wrap:wrap; align-items:center; gap:1rem; padding:.85rem 1rem;
  }
  [data-entrance-report] .period-report header, .dashboard-register > .period-report header { flex:0 1 auto; gap:.75rem; }
  [data-entrance-report] .period-report > div:not(.flow), .dashboard-register > .period-report > div:not(.flow) { flex:1 1 14rem; }
  .period-report .flow:has([data-action="period-report"]) { align-items:flex-start; flex-direction:column; gap:.18rem; }
}
@media(max-width:640px) {
  .module-links { gap:.48rem; }
  .module-link, .module-links:has(> :nth-child(5):last-child) .module-link { flex-basis:max(min(100%,10rem),calc((100% - .48rem)/2)); }
  .module-link { gap:.48rem; }
  .module-link img, .module-link .glyph { width:2rem; height:2.3rem; }
  .submeter-register table { min-width:36rem; }
  .alarm-detail > .form-stack label { flex-basis:100%; }
}
@media(max-width:375px) {
  .topbar { grid-template-columns:minmax(0,1fr) auto; gap:.4rem; }
  .topbar .brand { grid-area:1/1; }
  .topbar .building-location { grid-area:1/2; display:grid; gap:0; text-align:right; }
  .topbar .top-actions { grid-area:2/1/3/-1; justify-content:space-between; }
}
