/* uifit.css -- ONE sizing rule for every dialog and table, used unchanged by both sites:
   Fleet Control (web\uifit.css) and the ALMAG site (css\uifit.css). The owner's rule of 2026-11-21. Visual only.
   PC view only (1041 px and wider): nothing in this file applies to a tablet or a phone.
   - A dialog opens at ONE fixed size: 96 % of the window wide (max 2400 px) x 1000 px high, or 96 % of the window when that is smaller. The frame never
     changes with the tab shown or the content loaded; the content scrolls inside it. One-question prompts stay small.
   - A size or position set by hand is used instead (uifit.js on Fleet Control, gsdialog.js on the ALMAG site).
   - A table that does not fit its frame wraps its text instead of being cut off or scrolling sideways. */
@media (min-width: 1041px) {
  /* 2026-11-24 owner: "yes, wider" -- the dialog uses the free width of the screen (96 %), up to 2400 px */
  :root { --uf-w: min(2400px, 96vw); --uf-h: min(1000px, 96vh); }

  /* ---- 1. the standard dialog size: Fleet Control (.modal, tagged by uifit.js) and the three ALMAG dialog kinds ---- */
  .modal-overlay > .modal.uf-std:not(.uf-user),
  .ed-modal.gsdf-std:not(.gsdf-user),
  .td-modal-box.gsdf-std:not(.gsdf-user),
  .ta-pop.gsdf-std:not(.gsdf-user) {
    width: var(--uf-w) !important; height: var(--uf-h) !important;
    max-width: none !important; max-height: none !important;
  }
  /* Fleet Control frame: centred, never resized by the browser's own corner, sized by hand through uifit.js */
  .modal-overlay.uf-ov { padding: 0 !important; align-items: center !important; justify-content: center !important; }
  .modal-overlay > .modal.uf-std, .modal-overlay > .modal.uf-prompt { resize: none !important; position: relative; margin: 0 !important; }
  .modal-overlay > .modal.uf-std.uf-user { width: var(--uf-uw) !important; height: var(--uf-uh) !important; max-width: 98vw !important; max-height: 98vh !important; }
  .modal-overlay.uf-ov.uf-placed { display: block !important; }
  .modal-overlay.uf-ov.uf-placed[hidden] { display: none !important; }
  .modal-overlay.uf-ov.uf-placed > .modal { position: absolute !important; left: var(--uf-x) !important; top: var(--uf-y) !important; }
  .modal.uf-std > .dlg-head, .modal.uf-prompt > .dlg-head { cursor: move; user-select: none; }
  .uf-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 6; opacity: .45;
             background: linear-gradient(135deg, transparent 0 55%, currentColor 55% 62%, transparent 62% 72%, currentColor 72% 79%, transparent 79%); }
  .uf-grip:hover { opacity: .9; }

  /* ---- 2. tables: fit the frame; text wraps, nothing is cut off and nothing scrolls sideways ---- */
  table.uf-squeeze { table-layout: auto !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  table.uf-squeeze th, table.uf-squeeze td {
    white-space: normal !important; overflow-wrap: anywhere; text-overflow: clip !important;
    min-width: 0 !important; max-width: none !important;
  }
  /* fields typed into inside such a table shrink with their column */
  table.uf-squeeze input:not([type=checkbox]):not([type=radio]), table.uf-squeeze select, table.uf-squeeze textarea { min-width: 0 !important; max-width: 100% !important; }

  /* 2b (2026-11-24, owner: "boxes open unreadable, hidden letters"): in EVERY dialog a table's cells never cut
     their text with "..." -- the columns take the width their content needs and long text wraps onto a second
     line. A buttons-only last column shrinks to its buttons instead of keeping an empty 176 px. */
  :is(.modal-overlay > .modal, .ed-modal, .td-modal-box, .ta-pop) table { table-layout: auto !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
  :is(.modal-overlay > .modal, .ed-modal, .td-modal-box, .ta-pop) table :is(th, td) {
    width: auto !important; min-width: 0 !important; max-width: none !important;
    white-space: normal !important; text-overflow: clip !important; overflow-wrap: break-word;
  }
  :is(.modal-overlay > .modal, .ed-modal, .td-modal-box, .ta-pop) table td,
  :is(.modal-overlay > .modal, .ed-modal, .td-modal-box, .ta-pop) table td > * { overflow: visible !important; text-overflow: clip !important; }
  :is(.modal-overlay > .modal, .ed-modal, .td-modal-box, .ta-pop) table.cp-table:not(.tc-day-table) :is(th, td):last-child { width: 1% !important; white-space: nowrap !important; }

  /* ---- 3. pages keep their width from menu to menu: the page scrollbar is always there (set by uifit.js only on a
     site whose pages scroll as a whole) ---- */
  html.uf-vscroll { overflow-y: scroll; }
}
