/* Shared screen typography and surfaces. Print layouts and authentication keep their own styles. */
@media screen {
  #app {
    --ui-ink:#111b2d;
    --ui-copy:#526175;
    --ui-line:#e3e7ed;
    --ui-radius:22px;
    --ui-shadow:0 3px 12px rgba(17,27,45,.025);
    --shadow:var(--ui-shadow);
    --shadow-soft:var(--ui-shadow);
    --button-primary-shadow:0 3px 8px rgba(30,58,138,.10);
    --button-primary-shadow-hover:0 5px 12px rgba(30,58,138,.14);
    --button-secondary-shadow:none;
    background:#f6f7f9;
  }

  /* A clear hierarchy: strong page titles, compact card titles, readable descriptions. */
  #app :is(.screen-title, .tt-site-hero-title, .tt-site-detail-title,
    .enterprise-control-child-head h2, .enterprise-admin-title, .tt-help-title) {
    font-weight:800;
    color:var(--ui-ink);
    letter-spacing:-.025em;
    line-height:1.16;
  }
  #app .screen-title { font-size:32px; }
  #app :is(.screen-head .asset-title, .tt-site-detail-title) {
    font-size:28px;
    font-weight:800;
    line-height:1.18;
    letter-spacing:-.025em;
  }
  #app :is(.tt-site-card-title, .tt-home-panel-title, .tt-home-card-title,
    .tt-home-status-title, .checklist-card-title, .tile-title, .logs-block-title,
    .portfolio-scope-title, .portfolio-title, .enterprise-admin-row-title) {
    font-weight:700;
    letter-spacing:-.015em;
    line-height:1.28;
  }
  #app .tt-site-card-title { font-size:21px; color:var(--ui-ink); }
  #app :is(.tt-site-card-body, .tt-site-hero-text, .tt-site-detail-text,
    .enterprise-control-child-head p, .enterprise-admin-sub, .tt-settings-section-sub,
    .checklist-card-sub, .checklist-card-meta, .logs-block-sub,
    .portfolio-sub, .portfolio-scope-foot, .portfolio-kpi-label) {
    color:var(--ui-copy);
    font-weight:500;
    line-height:1.5;
  }
  #app .tt-site-card-body { font-size:14px; margin-top:9px; }
  #app :is(.tt-site-card-meta, .enterprise-control-section-title, .site-control-section-title,
    .tt-site-card-eyebrow, .tt-site-hero-eyebrow, .enterprise-control-org-selector,
    .portfolio-label, .portfolio-kpi-chip-label, .tt-home-previous-label, .tile-previous-label) {
    font-weight:600;
    line-height:1.4;
  }
  #app :is(.enterprise-control-section-title, .site-control-section-title) {
    color:var(--ui-copy);
    font-size:13px;
    padding-bottom:12px;
    border-color:var(--ui-line);
  }
  #app .tt-site-card-meta { font-size:12px; color:#344054; }
  #app :is(.portfolio-value, .portfolio-kpi-value, .portfolio-kpi-chip-value,
    .portfolio-rollup-value, .enterprise-admin-kpi-value) {
    font-weight:800;
    letter-spacing:-.025em;
    font-variant-numeric:tabular-nums;
  }
  #app :is(.brand-subtitle, .enterprise-control-org-selector select,
    .logs-select, .ops-tab, .home-toggle, .logs-tab, .logs-view-btn) { font-weight:600; }
  #app :is(.btn-primary, .btn-secondary, .btn-ghost, .btn-export, .tt-btn,
    .tt-activation-btn, .tt-site-back) { font-weight:600; }

  /* Flat white surfaces and a quiet edge replace the stacked gradients and deep shadows. */
  #app :is(.tt-site-card, .tt-site-hero-card, .tt-site-detail-panel, .tt-site-section-card,
    .enterprise-admin-hero, .enterprise-control-child-head, .portfolio-scope-card,
    .portfolio-kpi-chip, .portfolio-kpi, .logs-block, .checklist-card,
    .tt-home-card, .tt-home-split-card, .week-report) {
    background:#fff;
    border-radius:var(--ui-radius);
    box-shadow:var(--ui-shadow);
  }
  #app :is(.tt-site-card, .tt-site-hero-card, .tt-site-detail-panel,
    .tt-site-section-card, .enterprise-admin-hero, .enterprise-control-child-head,
    .logs-block, .checklist-card, .week-report) { border:1px solid var(--ui-line); }
  #app :is(.tt-site-card, .enterprise-control-home .enterprise-control-card,
    .site-control-home .tt-site-card) { padding:22px; }
  #app .tt-site-card-footer {
    margin-top:auto;
    padding-top:18px;
    gap:12px;
  }
  #app .tt-site-card-arrow { font-weight:600; }
  #app :is(.tt-site-card-grid, .enterprise-control-section .enterprise-control-grid,
    .site-control-section .site-control-grid) { gap:18px; }
  #app :is(.enterprise-control-home, .site-control-home) { gap:26px; }
  #app :is(.tt-site-card, .portfolio-scope-card):hover {
    transform:none;
    border-color:#b8c7df;
    box-shadow:0 5px 18px rgba(17,27,45,.055);
  }
  #app :is(.tt-site-card, .checklist-card, .tt-home-due-card):focus-visible {
    outline:3px solid #6f91d8;
    outline-offset:3px;
  }

  /* Checks retain their operational colours and large touch targets. */
  #app .tt-home-focus-panel { border-radius:var(--ui-radius); box-shadow:none; background:#172237; }
  #app .tt-home-focus-panel.is-clear { background:#fff; border-color:#d8e8df; }
  #app .tt-home-focus-panel.is-clear .tt-home-panel-sub { color:var(--ui-copy); }
  #app .tt-home-panel-sub { font-weight:500; line-height:1.4; }
  #app .tt-home-due-card { border-radius:18px; box-shadow:0 2px 8px rgba(17,27,45,.04); }
  #app .tt-home-due-card.is-critical { box-shadow:0 0 0 1px rgba(244,63,94,.2); }
  #app .tt-home-due-name { font-size:16px; font-weight:700; line-height:1.3; white-space:normal; overflow-wrap:anywhere; }
  #app .tt-home-due-target { font-size:13px; font-weight:500; line-height:1.4; }
  #app :is(.tt-home-previous-outcome, .tile-previous-outcome, .tt-home-due-value) { font-weight:700; line-height:1.3; }
  #app .tt-home-previous-label { color:#637084; font-size:10px; }
  #app .tt-home-status-pill { font-weight:600; line-height:1.35; padding-block:7px; }
  #app :is(.tile, .checklist-card) { border-radius:18px; box-shadow:var(--ui-shadow); }
  #app :is(.ops-tabs, .ops-glider-wrap) { box-shadow:none; }
  #app .ops-tab { font-size:14px; }
  #app .checklist-card-title { font-size:17px; }
  #app :is(.checklist-card-sub, .checklist-card-meta) { font-size:13px; }
  #app :is(.week-toolbar .btn-secondary, .week-toolbar .btn-ghost, .week-options input[type=search]) { box-shadow:none; }
  #app .week-toolbar :is(.btn-secondary, .btn-ghost) { border-radius:14px; }
  #app .week-summary { background:#f7f8fa; }

  @media (max-width:680px) {
    #app { --ui-radius:20px; }
    #app .ops-screen .ops-tab { flex:1 1 0; min-width:0; padding-inline:10px; }
    #app .screen-title { font-size:30px; }
    #app :is(.screen-head .asset-title, .tt-site-hero-title, .tt-site-detail-title,
      .enterprise-control-child-head h2, .enterprise-admin-title) { font-size:26px; }
    #app :is(.tt-site-card, .enterprise-control-home .enterprise-control-card,
      .site-control-home .tt-site-card) { min-height:0; padding:18px; }
    #app .tt-site-card-title { font-size:20px; }
    #app :is(.tt-site-card-grid, .enterprise-control-section .enterprise-control-grid,
      .site-control-section .site-control-grid) { gap:12px; }
    #app :is(.enterprise-control-home, .site-control-home) { gap:22px; }
    #app .tt-home-focus-panel { padding:16px; }
    #app .tt-home-panel-title { font-size:20px; }
    #app .tt-home-panel-head { margin-bottom:14px; }
    #app .tt-home-due-card { padding:15px; }
    #app .tt-home-due-icon { width:44px; height:44px; border-radius:14px; }
  }
}

@media screen {
  #screenTemp .screen-head:has(> #btnCabinetDefrost:not(.hidden)){
    flex-wrap:wrap;
  }
  #screenTemp .screen-head:has(> #btnCabinetDefrost:not(.hidden)) .screen-head-center{
    flex:1 1 12rem;
  }
  #btnCabinetDefrost{
    flex:none;
    flex-direction:column;
    gap:3px;
    height:auto;
    min-height:44px;
    padding:8px 16px;
    color:#1e3a8a;
    font-size:14px;
    line-height:1.15;
  }
  #btnCabinetDefrost span{
    color:#475569;
    font-size:12px;
    font-weight:500;
  }
}

#screenTemp.is-cabinet-pair :is(#tempDisplay,#btnToggleMinus,.keypad > .keys){display:none}
.cabinet-pair-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.cabinet-pair-fields label{display:block;margin-bottom:6px;color:#17233a;font-size:14px;font-weight:700}
.cabinet-pair-fields label span{color:#536077;font-weight:500}
.cabinet-pair-entry{display:flex;align-items:center;border:1px solid #bdc8d8;border-radius:12px;background:#fff;padding:2px}
.cabinet-pair-entry:focus-within{outline:2px solid #21438b;outline-offset:1px}
.cabinet-pair-entry input{box-sizing:border-box;width:100%;min-width:0;padding:9px;border:0;outline:none;border-radius:10px;background:transparent;color:#142239;font:inherit;font-size:24px;font-weight:650}
.cabinet-pair-entry button{flex:none;min-width:44px;height:44px;border:0;border-radius:9px;background:#f1f4f9;color:#243f72;font-size:19px}
.cabinet-pair-group{grid-column:1/-1}
.cabinet-pair-group select{width:100%;min-height:44px}
@media(max-width:420px){.cabinet-pair-fields{grid-template-columns:minmax(0,1fr);gap:12px}}

#cabinetReadingReview {
  box-sizing: border-box;
  width: min(420px, calc(100% - 32px));
  max-height: 88dvh;
  padding: 24px;
  border: 1px solid #dce2ea;
  border-radius: 20px;
  color: #17233a;
  background: #fff;
  font: inherit;
  text-align: left;
  box-shadow: 0 16px 64px #14223930;
}
#cabinetReadingReview::backdrop { background: #14223966; }
#cabinetReviewTitle { margin: 0 0 16px; font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
#cabinetReviewValues > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 12px;
  padding: 10px 14px;
  background: #fff7e8;
  border-radius: 12px;
}
#cabinetReviewValues > div + div { margin-top: 8px; }
#cabinetReviewValues span { font-weight: 650; }
#cabinetReviewValues strong { color: #833c09; font-size: 1.65rem; }
#cabinetReviewValues small { grid-column: 1 / -1; color: #4b5563; font-size: .9rem; }
#cabinetReviewHelp { margin: 14px 0 18px; }
.cabinet-review-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cabinet-review-actions button { flex: 1 1 130px; width: auto; min-height: 46px; margin: 0; }
@media (max-width: 480px) {
  .cabinet-review-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .cabinet-review-actions button { width: 100%; }
}
