#fdtTable td{text-align:center}
#fdtTable td:first-child{white-space:nowrap}
/* DISP, FLAG and the clear button hold a glyph or a short word. Their share of the width is
   set on the colgroup; this only stops the cell padding from being most of what is left. */
#fdtTable th.narrowcol,#fdtTable td.narrowcol{padding-left:2px;padding-right:2px}
/* The header stays put while the log scrolls under it. `.tablewrap` is the scrolling box, so
   the cells stick to its top edge.
   Row 2 has to be told exactly how far down to stick, and getting it wrong by a few pixels
   leaves a strip between the two header rows with the LOG SCROLLING THROUGH IT — which is
   what shipped. The first attempt measured row 1 at build time; that build runs while the FDT
   tab is still hidden, so the measurement was zero, the guard skipped it, and a default that
   did not match the real height stood.
   So row 1's height is DECLARED rather than measured. One number, used by the height and by
   the offset, and nothing has to run at the right moment for them to agree. Every row-1
   header is a single line — that is why FLIGHT (h) and REST LIMIT are not split across two. */
#fdtTable{--fdt-h1:34px}
#fdtTable thead tr:first-child th{height:var(--fdt-h1);padding-top:0;padding-bottom:0}
#fdtTable thead th{position:sticky;z-index:3}
#fdtTable thead tr:first-child th{top:0}
#fdtTable thead tr.sub th{top:var(--fdt-h1)}
/* Sticky cells paint over the rows sliding under them, so they need a solid edge of their
   own — without it the last body row shows through the join as it passes. */
#fdtTable thead tr.sub th{box-shadow:inset 0 -1px 0 var(--line)}
/* A time input needs room for hh:mm and the browser's own spacing; below this it clips to
   "- - :" and the pilot cannot read what they entered. */

/* EQUAL COLUMNS, WITH A FLOOR. Both halves are load-bearing and the first shipped without
   the second.
   `table-layout:fixed` is what makes every column the same width, which is what this table
   should look like — under auto layout each column sized to its own content, so they were
   all different and, worse, a column changed width whenever its content did.
   But fixed layout ALONE divides whatever width is available, however little that is: at
   eighteen columns in a laptop window each got about 30 px, headers overflowed into their
   neighbours (DATE and DAY reading as "DATEDAY"), the time inputs clipped, and the last
   column fell off the edge. The missing piece was a minimum: below it `.tablewrap` scrolls
   rather than crushing. The floor is set in script, from the number of columns actually on
   screen — see applyFdtCollapsed(), which is also the only place that knows whether the
   limit block is folded away.
   Headers do not wrap: a wrapped two-word header is what made the collisions unreadable. */
#fdtTable{table-layout:fixed;width:100%}
/* Headers WRAP. They were held on one line while row 1's height was the sticky offset and a
   second line would have broken it — but a header that cannot wrap in a fixed-width column
   does not stay on one line, it gets CUT OFF, which is how FLIGHT (H) and REST LIMIT lost
   their ends. The declared height below allows two lines, so wrapping is free. */
#fdtTable th{white-space:normal;line-height:1.15}
/* Nothing may spill into the column next door. In a fixed-layout table a cell cannot grow to
   fit its content, so anything too wide simply paints over its neighbour — which is what put
   "Tue 03:00" on top of the DISP button and a focus ring into the cell beside it. */
#fdtTable th,#fdtTable td{overflow:hidden}
/* And the inputs stop carrying a min-width of their own: with a fixed column narrower than
   the input, the input is what overflows. The column floor already guarantees the room. */
#fdtTable td.input-cell input{min-width:0;width:100%}
/* The chrome-stripping lives on .clockfield — see there. This is only this table's sizing. */
#fdtTable td.input-cell input[type="time"]{font-size:13px;line-height:1.2;padding:6px 2px}
/* The MANUAL box for the same reason: a number input's spinner is chrome the pilot never
   uses, and it takes the same bite out of the right-hand side. */
#fdtTable td.input-cell input[type="number"]{padding:6px 2px;text-align:center}
#fdtTable td.input-cell input[type="number"]::-webkit-inner-spin-button,
#fdtTable td.input-cell input[type="number"]::-webkit-outer-spin-button{
  -webkit-appearance:none;appearance:none;margin:0}
/* A STICKY HEADER CANNOT LIVE IN A COLLAPSED-BORDER TABLE.
   With `border-collapse:collapse` a cell's borders belong to the TABLE, not to the cell, so
   they do not travel with a sticky cell: the header's own bottom edge scrolls away and leaves
   a hairline with the rows visibly sliding through it. That is the gap above the header.
   `separate` gives each cell its own borders, which do travel. Cells then draw only their
   right and bottom edges so adjacent borders do not double into 2px lines, and the outer
   edge comes from .tablewrap, which already has one. */
#fdtTable{border-collapse:separate;border-spacing:0}
#fdtTable th,#fdtTable td{border-width:0 1px 1px 0}
/* The calculated DUTY figure stays visible when an override is in charge — dimmed and
   tagged, never erased, so the pilot can see what the times would have produced. Same
   treatment the Quick Reference gives an overruled entry. */
/* AUTO, once MANUAL overrules it: struck through and dimmed, never erased — the pilot can
   still see what the times would have given. line-through and opacity are chosen over
   italics because italics reshape every glyph, and nothing here may change a cell's size. */
#fdtTable td.fdt-calcduty.src-inactive{opacity:.5;
  text-decoration:line-through;text-decoration-color:var(--muted)}
/* MANUAL, when it is the figure in charge: the app's own "this is the active source" blue —
   the same mark NEW TIME and NEW FUEL carry on OFP. Background and an inset ring only. The
   weight is deliberately left alone: `font-weight` is the property that reflowed this table
   once already, and the blue says enough on its own. */
/* AN OUTLINE, AND NOTHING ELSE. The mark used to fill the cell and recolour its text, which
   made the DUTY TIME pair the loudest thing on a row — and the duty and flight LIMIT figures
   beside it are what a pilot is actually scanning. Two already-painted cells in the middle of
   that scan break the run of plain numbers the eye is following.
   `box-shadow` inset rather than `outline` because it is clipped by the cell like a border
   would be, and because neither occupies space: this table reflowed once over a hover state
   and must not do it again. */
#fdtTable td.input-cell.src-active,#fdtTable td.fdt-calcduty.src-active{
  box-shadow:inset 0 0 0 2px var(--accent)}
/* AUTO, when nothing has been typed into MANUAL, is set at the size of the MANUAL box beside
   it (14px, from the input rule in forms.css) rather than the 13px the table gives a plain
   cell. The two figures then read as one pair in which the live one is simply the larger,
   and the pilot does not have to work out which of two same-sized numbers is being counted.
   Overruled AUTO stays at 13px — with the strike-through, that is the whole contrast.

   THE LINE HEIGHT IS PINNED, and that is the load-bearing half of this rule. Left at `normal`
   the taller figure makes the cell a pixel taller, so every row below shifts the moment a
   pilot types a manual figure or clears one. 1.2 keeps the cell shorter than the input cell
   next to it, which is what sets the row height, so the row cannot move either way. Column
   widths are already safe — the table is `table-layout:fixed`. */
#fdtTable td.fdt-calcduty{line-height:1.2}
#fdtTable td.fdt-calcduty.src-active{font-size:14px}
/* The app-wide active-source rule fills the cell and bolds its input. Both are cancelled here
   rather than the rule being left off, because leaving it off is not the same as overriding
   it — OFP still wants the filled version, and without this the global one simply applies.
   `font-weight:inherit` is doing safety work too: a bolder figure is a wider figure, and this
   table has reflowed over exactly that once already. */
#fdtTable td.input-cell.src-active{background:none}
#fdtTable td.input-cell.src-active input{color:inherit;font-weight:inherit}
/* A dispensation is a permanent state, not an event: an outline, never a warning pill.
   Same reasoning as the governing-cell outline on OFP. */
#fdtTable td.fdt-disp{outline:2px solid var(--warn);outline-offset:-2px}
/* On a card the figure has no box of its own, so an outline would be drawn round bare text.
   A dotted underline says the same thing in the same colour; text-decoration is chosen over
   a border because a border would add height and shift the row it sits in. */
.fdt-avail.fdt-disp,.fdt-availf.fdt-disp{
  text-decoration:underline dotted var(--warn);text-underline-offset:4px;
  text-decoration-thickness:2px}
#fdtTable td.fdt-dispbtn button{background:none;border:1px solid var(--line);border-radius:6px;
  color:var(--muted);font:inherit;font-size:11px;padding:3px 8px;cursor:pointer;min-height:24px}
#fdtTable td.fdt-dispbtn button.on{border-color:var(--warn);color:var(--warn);font-weight:800}
#fdtTable td.fdt-dispbtn button:hover{border-color:var(--accent);color:var(--accent)}
/* Per-day clear. Muted until hovered so a column of red crosses does not read as a column of
   warnings, and dimmed to nothing when the day is already empty. */
#fdtTable td.clrcol{padding:0}
#fdtTable button.clrbtn{background:none;border:none;color:var(--muted);cursor:pointer;
  font-size:13px;line-height:1;padding:6px 4px;min-height:24px;width:100%}
#fdtTable button.clrbtn:hover{color:var(--bad)}
#fdtTable button.clrbtn:disabled{opacity:.25;cursor:default}
/* Rest beyond the top band: the table has no entry, so the figure is this tool's arithmetic
   and not the operator's rule. Marked permanently so nobody reads it as a limit. */
#fdtTable td.fdt-beyond{outline:2px dashed var(--bad);outline-offset:-2px}
#fdtTable td.fdt-breach input{color:var(--bad);font-weight:800}
#fdtTable td.fdt-breach{background:var(--badbg)!important}
/* Duty Available: ONE card per day, holding that day's two answers. The card is what carries
   the box — the figures inside it do not each get their own, because a bordered box around
   every number is what made four cards read as eight unrelated readouts. The date is the
   card's header and the two halves sit under it with a rule between them. */
.fdt-cards .field{background:var(--ro);border:1px solid var(--line);border-radius:8px;
  padding:10px 12px;gap:0}
.fdt-cards .field > label{color:var(--ink);font-weight:700;padding-bottom:8px;
  border-bottom:1px solid var(--line);margin-bottom:8px}
.fdt-split{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.fdt-split .half{min-width:0}
.fdt-split .half + .half{border-left:1px solid var(--line);padding-left:12px}
.fdt-split .cap{display:block;font-size:9px;letter-spacing:1px;text-transform:uppercase;
  color:var(--muted);margin-bottom:2px}
/* Same size, because they are peers — one is not a footnote to the other. No box of their
   own: the card is the box. */
.fdt-avail,.fdt-availf{font-size:20px;font-weight:800;background:none;border:none;
  padding:0;color:var(--ink)}
.fdt-cards .hint{margin-top:2px}
/* A cumulative window binding recolours the NUMBER, not the cell. A filled panel behind one
   figure competes with the over-limit red elsewhere on the tab and shouts louder than the
   thing it is qualifying — this is a note about which limit you met, not a breach. */
.fdt-avail.fdt-cum,.fdt-availf.fdt-cum{color:var(--warn)}
.swatch.fdt-sw-cum{background:var(--warn);border-color:var(--warn)}
.swatch.fdt-sw-disp{background:transparent;border:2px solid var(--warn)}
/* ===== Limits summary on the tab face =====
   Five groups of figures, one card each, each holding a small TABLE rather than a run-on
   string. "1d 14/16 · 5d 60 · 7d 72/76" is a sentence a pilot has to parse; a column of
   windows beside a column of hours is something they can scan. Same figures, read instead of
   decoded. */
.fdt-limsum{display:grid;grid-template-columns:repeat(auto-fit,minmax(228px,1fr));gap:10px;margin-top:12px}
.fdt-limsum .g{background:var(--ro);border:1px solid var(--line);border-radius:8px;padding:9px 11px}
.fdt-limsum .g > b{display:block;font-size:10px;letter-spacing:1px;color:var(--muted);
  text-transform:uppercase;margin-bottom:6px}
.fdt-limsum table{width:100%;border-collapse:collapse;font-size:12.5px}
.fdt-limsum td{border:none;padding:2px 0;white-space:nowrap;
  font-variant-numeric:tabular-nums;color:var(--ink)}
.fdt-limsum td.k{color:var(--muted);width:38%}          /* the window / name */
.fdt-limsum td.v{text-align:right}                       /* the figure */
/* The dispensed figure is a SECOND limit, not a decoration on the first — same colour it
   carries everywhere else on this tab, so the eye connects them. */
.fdt-limsum td.d{text-align:right;width:26%;color:var(--warn)}
.fdt-limsum td.d:empty::after{content:'–';color:var(--line)}
/* A window not shown in the log still binds. The mark says which have a column, and reads as
   a note rather than as a switch — the switch is in the modal, where it can be changed. */
.fdt-limsum tr.nolog td{opacity:.62}
.fdt-limsum .lg{font-size:9px;letter-spacing:.5px;color:var(--muted);
  display:block;margin-top:6px;white-space:normal}
/* Limits modal: one small editable table per group */
.modal.wide{max-width:860px}
.fdtlim-g{margin-bottom:18px}
.fdtlim-g > h3{font-size:11px;letter-spacing:1px;text-transform:uppercase;color:var(--muted);
  margin:0 0 6px}
/* Equal columns, sized to their content rather than to a minimum that was guesswork. Fixed
   layout divides the table evenly; the delete column is the one exception, because it holds
   one glyph. The table is capped rather than filling the modal — five narrow columns stretched
   across 860px is a lot of whitespace between a label and its figure. */
.fdtlim-g table{width:100%;max-width:498px;table-layout:fixed}
.fdtlim-g th{font-size:10px;white-space:normal;line-height:1.2;padding:4px 3px;
  vertical-align:bottom}
.fdtlim-g th:last-child,.fdtlim-g td:last-child{width:34px}
.fdtlim-g td{padding:2px}
.fdtlim-g input[type="number"],.fdtlim-g input[type="text"],.fdtlim-g input[type="time"]{
  width:100%;min-width:0;padding:4px 6px}
/* The start-time windows put two clock fields in one narrow row. `min-width:64px` above was
   the old floor and it was beside the point: a native time field ignores it and holds its own
   intrinsic width, so FROM and TO overlapped on an iPad. .clockfield lets them shrink; the
   column is what decides their width now. */
.fdtlim-g input[type="time"]{font-size:13px}
.fdtlim-g .xbtn{background:none;border:none;color:var(--muted);cursor:pointer;font-size:14px;padding:0 6px}
.fdtlim-g .xbtn:hover{color:var(--bad)}
/* A group-wide option, sitting with the table it belongs to. The global `input{width:100%}`
   stretches a checkbox to the full row and centres its glyph, which pushed the label to the
   far edge and made the control read as a stray unrelated to any group — so the box is sized
   explicitly here rather than inheriting a rule written for text fields. */
/* `display:flex`, not inline-flex: the option is a row of its own under the Add button, not
   something that shares a line with it. Inline-flex let the two sit side by side, which put
   the checkbox to the LEFT of "+ Add band" and read as a caption for it. */
.fdtlim-g label.opt{display:flex;align-items:center;gap:8px;margin:10px 0 0;
  font-size:12px;color:var(--ink);cursor:pointer}
/* ===== SHOW IN LOG: a switch, not a tick =====
   A tick reads as "this is done" or "this is true". This setting is neither — it turns a
   column on and off, and a switch is the control people already read that way. It matters
   more here than it would elsewhere on the tab: the thing being switched is a COLUMN, and a
   pilot must never read it as switching the LIMIT. A tick sitting in a row of legal figures
   invites exactly that misreading.
   Still a real <input type="checkbox">, only restyled: it keeps the keyboard behaviour, the
   focus ring and the label association that a div dressed as a switch would have to rebuild
   by hand. */
.switch{-webkit-appearance:none;appearance:none;flex:none;width:38px;height:21px;min-width:0;
  padding:0;border-radius:11px;background:var(--panel2);border:1px solid var(--line);
  position:relative;cursor:pointer;transition:background .15s,border-color .15s;
  vertical-align:middle}
.switch::after{content:'';position:absolute;top:2px;left:2px;width:15px;height:15px;
  border-radius:50%;background:var(--muted);transition:transform .15s,background .15s}
.switch:checked{background:var(--accent);border-color:var(--accent)}
.switch:checked::after{transform:translateX(17px);background:#fff}
.switch:focus{outline:2px solid var(--accent);outline-offset:2px}
.switch:disabled{opacity:.4;cursor:default}
/* Centred in its cell, where a bare checkbox sat left against the column edge. */
.fdtlim-g td.sw{text-align:center}
.fdtlim-note{font-size:11px;color:var(--muted);margin-top:4px;max-width:560px}
/* Dispensation picker */
.fdtdisp-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--line)}
.fdtdisp-row input{width:auto;min-height:20px}
.fdtdisp-row .lbl{flex:1}
.fdtdisp-row .fig{font-variant-numeric:tabular-nums;color:var(--muted)}
/* ===== The collapsible limit block, exactly as OFP does it =====
   Hidden, never removed: every cell is built every time, so refresh() never meets a missing
   cell and the print stylesheet simply declines to apply the rule. Folding may change how
   much you see; it may never change whether you are warned — which is why the stub carries
   an over-limit mark for anything hidden behind it. */
#fdtTable .stub{display:none}
#fdtTable.fdt-collapsed .fold{display:none}
#fdtTable.fdt-collapsed th.stub,#fdtTable.fdt-collapsed td.stub{display:table-cell}
#fdtTable th.foldable{cursor:pointer}
#fdtTable th.foldable:hover{color:var(--accent)}
#fdtTable th.foldable .foldchev{font-size:10px;opacity:.75}
#fdtTable th.stub{cursor:pointer;color:var(--accent);font-size:15px;padding:0 4px}
#fdtTable td.stub{cursor:pointer;text-align:center;font-weight:700}
#fdtTable th.stub:hover{background:var(--ro)}
/* Daily Duty Log: even column widths when there's room; content-sized + scrollable
   on narrow screens (matches the fuel tables' behaviour). */
tr.fdt-future td{opacity:.62}
tr.fdt-today td{border-top:2px solid var(--accent);border-bottom:2px solid var(--accent)}
tr.fdt-today td:first-child{font-weight:800;color:var(--accent);opacity:1}
/* Rolling-window source highlight: DUTY(h) cells summed into a hovered/tapped 5/7/28-day cell */
/* The highlight has to reach the DUTY cells, and after the times model those are CALCULATED
   cells (AUTO) as well as an input (MANUAL) — the old rule was written when the day's duty
   was a single input and matched `td.input-cell` only, so the class went on and nothing
   happened. "The rule is applied" and "the rule is visible" are different claims, and only
   the second is what a highlight promises; suite_fdt.js resolves the cascade rather than
   asserting the class. */
/* NOTHING IN A HOVER STATE MAY CHANGE THE LAYOUT.
   The duty log is an auto-layout table, so a column is exactly as wide as its widest cell —
   which means bolding a figure on hover makes it wider, makes its column wider, and shoves
   every column beside it sideways. The whole table twitched as the pilot moved across it,
   and it was worst around a dispensation, where the neighbouring outline made the shift
   easy to see. The emphasis these rules are allowed is colour, background and the inset
   bars: `box-shadow` and `outline` are painted outside the box model and cost no space.
   font-weight, font-size, padding, border, margin, letter-spacing and width are all
   forbidden here — suite_fdt.js section 11d scans these rules for them. */
#fdtTable td.fdt-src,#fdtTable td.fdt-src-pin{background:var(--liftbg)!important;
  box-shadow:inset 3px 0 0 var(--accent),inset -3px 0 0 var(--accent);
  opacity:1;color:var(--lifttext)}
#fdtTable td.fdt-src input,#fdtTable td.fdt-src-pin input{color:var(--lifttext)}
#fdtTable td[data-win].fdt-win-hover,#fdtTable td[data-win].fdt-win-pin{
  outline:2px solid var(--accent);outline-offset:-2px;
  background:var(--liftbg)!important;color:var(--lifttext);cursor:pointer}
#fdtTable td[data-win]{cursor:pointer}
