/* p5-115 (R-1013-22/22a) - the Tree Shop command board, COMPUTER VIEW only
   (900 px and wider). Token names only (tokens.css + storm-look.css, the
   Office look); no new colour. Status is always a WORD as well as a colour.
   Below 900 px #tsb stays hidden and the phone page is exactly as before. */
#tsb[hidden] { display: none !important; }
@media (min-width: 900px), (min-width: 740px) and (max-width: 1023.98px) and (orientation: landscape) and (max-height: 500px) {
  body.tsb-on { max-width: none; padding: 12px 24px 96px; }
  body.tsb-on #ts-screen-home { display: none !important; }
  #tsb { max-width: 1440px; margin: 0 auto; font-size: 18px; }
  .tsb-hdr { display: flex; align-items: center; gap: 16px; padding: 6px 0 10px; border-bottom: 2px solid var(--c-rule); }
  .tsb-hdr h1 { margin: 0; border: 0; padding: 0; }
  .tsb-right { margin-left: auto; display: flex; gap: 8px; }
  .tsb-btn { min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; padding: 0 16px;
    border: 2px solid var(--c-border); border-radius: var(--radius); background: var(--c-panel); color: var(--c-text);
    font: 700 18px var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; }
  .tsb-btn.primary { border-color: var(--c-accent); color: var(--c-accent); }
  .tsb-pickers { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 14px 0 4px; }
  .tsb-asof { margin-left: auto; color: var(--c-text-3); }
  .tsb-muted { color: var(--c-text-3); }
  .tsb-note { color: var(--c-text-3); margin: 6px 2px; }
  .tsb-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
  .tsb-tile { --tc: var(--c-blue-2); display: flex; flex-direction: column; justify-content: center; min-height: 84px; padding: 8px 16px;
    background: var(--c-panel); color: var(--c-text); border: 2px solid var(--c-border); border-left: 6px solid var(--tc);
    border-radius: 14px; text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
  .tsb-tile b { font-size: 34px; line-height: 1; }
  .tsb-tile span { color: var(--c-text-3); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
  .tsb-red { --tc: var(--c-red-text); } .tsb-orange { --tc: var(--c-orange); } .tsb-amber { --tc: var(--c-amber); }
  .tsb-violet { --tc: var(--c-violet-text); } .tsb-cyan { --tc: var(--c-cyan); } .tsb-green { --tc: var(--c-green); }
  .tsb-steel { --tc: var(--c-border); }
  .tsb-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 400px; gap: 16px; margin-top: 14px; align-items: start; }
  .tsb-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
  @media (max-width: 1180px) { .tsb-grid { grid-template-columns: 220px minmax(0, 1fr); } .tsb-col { grid-column: 1 / -1; }
    .tsb-g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .tsb-col { display: grid; gap: 16px; }
  .tsb-card { background: var(--c-panel-2); border: 1px solid var(--c-line); border-top: 4px solid var(--tc); border-radius: 14px; padding: 4px 16px 14px; min-width: 0; }
  .tsb-head { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--c-text-3); margin: 12px 2px 10px; }
  .tsb-n { margin-left: auto; letter-spacing: 0; color: var(--c-text); text-transform: none; }
  .tsb-door { --tc: var(--c-border); display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0 0 6px; padding: 6px 14px;
    background: var(--c-panel); color: var(--c-text); border: 2px solid var(--c-border); border-left: 6px solid var(--tc);
    border-radius: 14px; font: 700 18px var(--font-ui); text-align: left; cursor: pointer; }
  .tsb-door .tsb-meta { margin-left: auto; font-weight: 800; white-space: nowrap; }
  .tsb-door.on { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); }
  .tsb-door.tsb-sub { margin-left: 14px; width: calc(100% - 14px); }
  .tsb-door:disabled { cursor: default; color: var(--c-text-3); }
  .tsb-door:disabled .tsb-meta { font-weight: 600; font-size: 18px; }
  .tsb-seg { display: flex; }
  .tsb-seg button { flex: 1; min-height: var(--tap); border: 2px solid var(--c-border); background: var(--c-panel); color: var(--c-text); font: 700 18px var(--font-ui); cursor: pointer; }
  .tsb-seg button + button { border-left-width: 0; }
  .tsb-seg button.on { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); }
  #tsb-q { width: 100%; min-height: var(--tap); padding: 0 12px; border: 2px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-panel); color: var(--c-text); font: 700 18px var(--font-ui); }
  .tsb-types { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
  .tsb-chip { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border: 2px solid var(--c-border); border-radius: 999px;
    background: var(--c-panel); color: var(--c-text); font: 700 18px var(--font-ui); cursor: pointer; }
  .tsb-chip.on { background: var(--c-accent); color: var(--c-on-accent); border-color: var(--c-accent); }
  .tsb-q { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 6px;
    border: 2px dashed var(--c-amber); border-radius: 50%; color: var(--c-amber); font-weight: 800; }
  .tsb-statehead { display: flex; align-items: center; gap: 10px; margin: 16px 0 0; padding: 6px 12px; border-radius: 10px; background: var(--c-panel);
    border-left: 6px solid var(--c-accent); font-weight: 800; letter-spacing: .12em; color: var(--c-accent); text-transform: uppercase; }
  .tsb-gfh { margin: 10px 2px 0; font-weight: 800; color: var(--c-text-2); letter-spacing: .04em; }
  .tsb-su { --sc: var(--c-green); display: flex; gap: 12px; align-items: center; width: 100%; min-height: 60px; margin: 8px 0; padding: 8px 12px;
    background: var(--c-panel); color: var(--c-text); border: 1px solid var(--c-line); border-left: 6px solid var(--sc); border-radius: 12px;
    font: 18px var(--font-ui); text-align: left; cursor: pointer; }
  .tsb-st-down { --sc: var(--c-red-text); } .tsb-st-idle { --sc: var(--c-amber); } .tsb-st-in_work, .tsb-st-waiting_parts { --sc: var(--c-cyan); }
  .tsb-st-working { --sc: var(--c-green); } .tsb-st-no_data { --sc: var(--c-border); }
  .tsb-id { font: 700 20px/1.1 "SF Mono", Menlo, Consolas, monospace; min-width: 124px; }
  .tsb-id small { display: block; font: 500 18px/1.3 var(--font-ui); color: var(--c-text-3); margin-top: 3px; }
  .tsb-mid { flex: 1; min-width: 0; color: var(--c-text-2); }
  .tsb-stw { font-weight: 800; letter-spacing: .06em; color: var(--sc); }
  .tsb-r { text-align: right; color: var(--c-text-3); min-width: 84px; } .tsb-r b { display: block; color: var(--c-text); font-size: 20px; }
  .tsb-nm, .tsb-fl { display: inline-block; margin: 4px 6px 0 0; font-weight: 800; border: 2px solid; border-radius: 8px; padding: 0 8px; text-transform: uppercase; }
  .tsb-nm.tsb-red { color: var(--c-red-text); } .tsb-nm.tsb-orange { color: var(--c-orange); } .tsb-nm.tsb-amber { color: var(--c-amber); }
  .tsb-fl { color: var(--c-violet-text); border-style: dashed; }
  .tsb-rest { display: flex; align-items: center; width: 100%; min-height: 56px; padding: 0 14px; border: 2px solid var(--c-border); border-radius: 12px;
    margin-top: 10px; background: transparent; color: var(--c-text); font: 700 18px var(--font-ui); text-align: left; cursor: pointer; }
  .tsb-ln { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 4px 0; border: 0; border-bottom: 1px solid var(--c-line);
    background: transparent; color: var(--c-text); font: 18px var(--font-ui); text-align: left; }
  button.tsb-ln { cursor: pointer; }
  .tsb-ln b { font-family: "SF Mono", Menlo, monospace; }
  .tsb-ln .tsb-v { margin-left: auto; font-weight: 800; white-space: nowrap; } .tsb-ln .tsb-v.red { color: var(--c-red-text); }
  .tsb-more { color: var(--c-accent); font-weight: 700; }
  .tsb-parts { margin-top: 8px; padding: 8px 12px; border: 2px solid var(--c-cyan); border-radius: 10px; font-weight: 800; }
  .tsb-sheet { position: fixed; right: 24px; top: 120px; width: 460px; max-height: 70vh; overflow: auto; background: var(--c-panel-2);
    border: 2px solid var(--c-accent); border-radius: 14px; padding: 8px 18px 16px; z-index: 20; box-shadow: 0 10px 40px var(--c-bg); }
  .tsb-sheet h3 { margin: 10px 0 8px; font-size: 20px; }
  .tsb-iss { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 4px 12px; margin: 0 0 8px; border: 2px solid var(--c-border);
    border-left: 6px solid var(--c-red-text); border-radius: 10px; background: var(--c-panel); color: var(--c-text); font: 700 18px var(--font-ui); text-align: left; cursor: pointer; }
  .tsb-iss .tsb-other { margin-left: auto; color: var(--c-accent); white-space: nowrap; }
  .tsb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
}
/* p5-121h (R-1014-01, JD on his phone 2026-10-14 1:0x AM): a PHONE IN
   LANDSCAPE gets a "Command center" button (#tsb-phone-cc, made by
   tree-shop-board.js only here) and, when tapped (body.tsb-phone), p5-121f's
   iPad screen scaled to the phone: LEFT 150 / CENTRE / RIGHT 190, text
   >= 14 px, every tap >= 44 px, the map kept, the ten tiles one scrolling
   row, the drawer FULL-SCREEN. "Phone view" (#tsb-phone-view) goes back.
   Portrait never matches this block. */
@media (min-width: 740px) and (max-width: 1023.98px) and (orientation: landscape) and (max-height: 500px) {
  #tsb-phone-cc { min-height: 44px; margin: 0 0 8px; }
  body.tsb-on.tsb-phone { padding: 4px 8px 72px; }
  body.tsb-phone #tsb { font-size: 14px; }
  body.tsb-phone .tsb-hdr { padding: 2px 0 4px; gap: 8px; }
  body.tsb-phone .tsb-hdr h1 { font-size: 16px; }
  body.tsb-phone .tsb-btn, body.tsb-phone .tsb-chip, body.tsb-phone .tsb-seg button, body.tsb-phone #tsb-q,
  body.tsb-phone .fmoc-select, body.tsb-phone .fmoc-sort, body.tsb-phone .fmoc-notsafe, body.tsb-phone .fmoc-cols,
  body.tsb-phone .fmoc-zoom button, body.tsb-phone .fmoc-dhead button, body.tsb-phone .tsb-door, body.tsb-phone .tsb-iss,
  body.tsb-phone .tsb-ln { min-height: 44px; min-width: 44px; font-size: 14px; padding: 0 8px; }
  body.tsb-phone .fmoc-actions { margin: 4px 0 2px; gap: 6px; overflow-x: auto; }
  body.tsb-phone .fmoc-kpis { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 150px;
    gap: 6px; margin-top: 6px; overflow-x: auto; scroll-snap-type: x proximity; }
  body.tsb-phone .fmoc-kpi { min-height: 64px; max-height: 84px; padding: 4px 8px; scroll-snap-align: start; }
  body.tsb-phone .fmoc-kpi .fmoc-kpi-name, body.tsb-phone .fmoc-kpi small { font-size: 14px; line-height: 18px; }
  body.tsb-phone .fmoc-kpi b { font-size: 22px; line-height: 28px; }
  body.tsb-phone .fmoc-kpi b.fmoc-nof { font-size: 16px; }
  body.tsb-phone .fmoc-grid { grid-template-columns: 150px minmax(0, 1fr) 190px; gap: 6px; margin-top: 6px; }
  body.tsb-phone .fmoc-rail { grid-column: auto; grid-template-columns: 1fr; gap: 6px; }
  body.tsb-phone .tsb-card { padding: 2px 8px 8px; }
  body.tsb-phone .tsb-head { margin: 6px 2px 4px; font-size: 14px; letter-spacing: .06em; }
  body.tsb-phone .fmoc-map { height: 220px; }
  body.tsb-phone .fmoc-attr, body.tsb-phone .fmoc-tip { font-size: 14px; }
  body.tsb-phone .fmoc-table, body.tsb-phone .fmoc-row td:first-child { font-size: 14px; }
  body.tsb-phone .fmoc-row { height: 44px; }
  body.tsb-phone .fmoc-row td.fmoc-c-seen, body.tsb-phone .fmoc-row .fmoc-seen { min-width: 9em; }
  body.tsb-phone .fmoc-cols { display: inline-flex; margin: 0 0 6px; }
  body.tsb-phone .fmoc-table:not(.fmoc-allcols) :is(.fmoc-c-type, .fmoc-c-year, .fmoc-c-meter, .fmoc-c-dot,
    .fmoc-c-lift, .fmoc-c-tag, .fmoc-c-shopdays) { display: none; }
  body.tsb-phone .fmoc-drawer { position: fixed; inset: 0; width: 100vw; max-width: 100vw; height: 100%;
    border-radius: 0; z-index: 40; padding: 4px 12px 16px; }
  body.tsb-phone .fmoc-dhead h2 { font-size: 18px; }
  body.tsb-phone .fmoc-drawer h3, body.tsb-phone .fmoc-dl, body.tsb-phone .fmoc-li { font-size: 14px; }
  body.tsb-phone .tsb-sheet { position: fixed; inset: 0; width: 100vw; max-width: 100vw; max-height: none; border-radius: 0; z-index: 40; }
}
@media print {
  body.tsb-on nav.bb-bar, #tsb .tsb-side, #tsb .tsb-right, #tsb .tsb-pickers button, #tsb-sheet { display: none !important; }
}
