/* ============================================================================
   redesign:web-WS2b-records-2 — styling for Maintenance, the Documents / Manuals
   vault (+ Insurance), the Library reader, Checklists (+ the structured editor)
   and the Garmin G1000 NXi checklist editor chrome.

   Loaded AFTER kit.css. Tokens only (--c-*): a theme change recolours every rule
   with no JS. The two deliberate carve-outs are bespoke palettes the handoff keeps
   on purpose and that are NOT app chrome:
     - the Library reader's sepia / night page (inline colours set by openReader)
     - the Garmin MFD preview + simulator (a real avionics screen: black ground,
       Garmin's own entry-type colours)
   Nothing animates; nothing flashes (the old 2.2 s reader hit flash is a static
   outline now). Radius 0 everywhere.
   ============================================================================ */

/* ---- shared page furniture ------------------------------------------------ */
/* (the .bh-aside shrink/wrap rule moved into kit.css — redesign:web-integrator) */
.rec2-head .bh-actions { max-width: 100%; }
.rec2-sub { margin-top: 8px; font-size: 13px; color: var(--c-ink-2); max-width: 78ch; }
.rec2-body { margin-top: 16px; }
.rec2-ico { vertical-align: -2px; flex: 0 0 auto; }
.rec2-clip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--c-ink-2); }
.rec2-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.rec2-card { padding: 14px 16px; }
.rec2-card + .rec2-card { margin-top: 14px; }
.rec2-card h3, .rec2-card .sec-label { margin: 0 0 8px; }
.rec2-date { white-space: nowrap; }
.rec2-note { font-size: 12px; color: var(--c-ink-3); margin-top: 10px; max-width: 80ch; }
.rec2-back { display: inline-block; margin-bottom: 8px; font: 600 13px/1 var(--font-heading); letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent-ink); }
.rec2-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.rec2-actions .push { margin-left: auto; }
.rec2-file { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--c-line-2); }
.rec2-file:last-child { border-bottom: 0; }
.rec2-file > a { display: inline-flex; align-items: center; gap: 8px; color: var(--c-accent-ink); min-height: 44px; }
.rec2-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.rec2-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; font: 600 12px/1 var(--font-heading); letter-spacing: .04em; color: var(--c-accent-ink); background: var(--c-accent-tint); border: 1px solid var(--c-line); border-radius: 0; }
@media (max-width: 767.98px) { }
.rec2-check { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; cursor: pointer; font-size: 14px; color: var(--c-ink); }
.rec2-check input { margin-top: 3px; }
.rec2-check b { color: var(--c-ink); }
.rec2-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.rec2-fields > .field { flex: 1 1 160px; min-width: 0; }
.rec2-fields > .field.sm { flex: 0 1 120px; }
.rec2-desc { max-width: 52ch; color: var(--c-ink-2); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767.98px) { .rec2-desc { white-space: normal; } }

/* ---- Library / vault -------------------------------------------------------- */
.lib-search { margin: 0 0 14px; }
.lib-search-box { display: flex; align-items: center; gap: 8px; max-width: 720px; min-height: 44px; padding: 0 4px 0 12px; border: 1px solid var(--c-line-control); border-radius: 0; background: var(--c-surface); }
.lib-search-box:focus-within { border-color: var(--c-accent); outline: 2px solid var(--c-accent); outline-offset: 0; box-shadow: none; }
.lib-search-box svg { color: var(--c-ink-2); flex: 0 0 auto; }
.lib-search-box input { flex: 1; width: auto; min-height: 40px; padding: 0; background: transparent; border: 0; outline: 0; font-size: 15px; color: var(--c-ink); }
.lib-search-box input:focus-visible { outline: 0; }
.lib-search-box input::placeholder { color: var(--c-ink-2); }
.lib-search-clear { position: relative; min-width: 36px; min-height: 36px; background: transparent; border: 0; color: var(--c-ink-2); cursor: pointer; font-size: 13px; border-radius: 0; }
.lib-search-clear::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--kit-hit); transform: translateY(-50%); }
.lib-search-clear:hover { color: var(--c-ink); background: var(--c-hover-btn); }
.lib-results-status { color: var(--c-ink-2); font-size: 13px; margin: 4px 2px 12px; }
.lib-result { max-width: 780px; padding: 12px 2px 14px; border-bottom: 1px solid var(--c-line-2); }
.lib-result-title { font: 600 18px/1.2 var(--font-heading); color: var(--c-ink); }
.lib-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 0; font: 600 11px/1 var(--font-heading); letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--c-line-control); color: var(--c-ink-2); }
.lib-chip-tail { color: var(--c-accent-ink); border-color: var(--c-accent); }
.lib-chip-type { color: var(--c-accent-ink); border-color: var(--c-line-control); }
.lib-chip-global { color: var(--c-ink-2); }
.lib-hit { font-size: 14px; line-height: 1.5; }
.lib-hit-pg { position: relative; min-height: 30px; padding: 0 9px; background: transparent; border: 1px solid var(--c-line-control); border-radius: 0; color: var(--c-ink-2); font: 600 13px/1 var(--font-heading); cursor: pointer; }
.lib-hit-pg::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--kit-hit); transform: translateY(-50%); }
.lib-hit-pg:hover { color: var(--c-ink); border-color: var(--c-accent); background: var(--c-hover-btn); }
.lib-hit-snip { color: var(--c-ink-2); }
.lib-hit-snip mark { background: color-mix(in srgb, var(--c-caution-fill) 30%, transparent); color: var(--c-ink); padding: 0 1px; border-radius: 0; }
.lib-hit-more { font-size: 12px; color: var(--c-ink-3); }
.lib-card { margin-top: 12px; }

/* The reader keeps its own sepia / night palette (inline, set by openReader). The page hit that
   used to flash for 2.2 s is a static outline in the text colour, so it can never vanish and
   always contrasts with whichever ground the reader is on. */
/* (.lib-reader-pg-hit is defined once in styles.css as that static outline — redesign:web-integrator) */
.lib-reader-bar .btn { min-height: 34px; border-radius: 0; }
.lib-reader-bar .btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lib-reader-body .state-band { max-width: 680px; margin: 24px auto; }

/* ---- Maintenance forms ------------------------------------------------------- */
.mnt-tags-box { columns: 2; column-gap: 24px; }
@media (max-width: 767.98px) { .mnt-tags-box { columns: 1; } }

/* ---- Checklist structured editor ------------------------------------------- */
.ce-meta { padding: 14px 16px; }
.ce-list { position: relative; margin-top: 14px; padding: 14px 16px; border-left: 3px solid var(--c-accent); }
.ce-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.ce-head > .field { margin-bottom: 0; }
.ce-head .grow { flex: 1 1 220px; min-width: 0; }
.ce-section { position: relative; margin-top: 12px; padding: 12px 14px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 0; }
.ce-section-head { display: flex; gap: 8px; align-items: center; }
.ce-section-head input { flex: 1; min-width: 0; }
.ce-item { margin: 10px 0; padding-bottom: 10px; border-bottom: 1px solid var(--c-line-2); }
.ce-item:last-of-type { border-bottom: 0; }
.ce-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ce-row > input { flex: 1 1 150px; min-width: 120px; width: auto; }
.ce-row > input.wide { flex: 2 1 220px; }
.ce-row > select { width: auto; max-width: 150px; flex: 0 0 auto; }
.ce-note { margin-top: 6px; }
.ce-note textarea { min-height: 54px; }
.ce-foot { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* ---- Garmin G1000 NXi checklist editor chrome ------------------------------- */
.gcl-wrap { gap: 14px; }
.gcl-side { padding: 0; background: transparent; max-height: none; overflow: visible; }
.gcl-side-scroll { padding: 12px; max-height: calc(100vh - 190px); overflow: auto; }
.gcl-edit { padding: 0; overflow: visible; }
.gcl-title input { width: 100%; max-width: 560px; margin-top: 6px; font: 600 30px/1.1 var(--font-heading); letter-spacing: 0; padding: 4px 8px; min-height: 44px; }
.gcl-grp { margin-bottom: 12px; }
.gcl-grp-hd { gap: 2px; padding: 2px 0; }
.gcl-grp-name { flex: 1; min-width: 0; min-height: 34px; padding: 3px 6px; font: 600 13px/1.2 var(--font-heading); letter-spacing: .03em; text-transform: uppercase; color: var(--c-ink); background: transparent; border: 1px solid transparent; border-radius: 0; text-overflow: ellipsis; }
.gcl-grp-name:hover, .gcl-grp-name:focus { border-color: var(--c-line-control); background: var(--c-surface); }
.gcl-cl { position: relative; display: flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 2px 0 12px; border-radius: 0; cursor: pointer; font-size: 14px; color: var(--c-ink); }
.gcl-cl:hover { background: var(--c-hover-row); }
.gcl-cl.sel { background: var(--c-accent-tint); box-shadow: inset 3px 0 0 var(--c-accent); }
.gcl-cl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; min-height: 34px; padding: 0 6px; background: transparent; border: 0; border-radius: 0; font: inherit; font-size: 14px; color: inherit; cursor: pointer; }
.gcl-cl-name:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.gcl-star, .gcl-cl-x { position: relative; flex: 0 0 auto; display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; margin: 0; background: transparent; border: 0; border-radius: 0; color: var(--c-ink-2); font: inherit; font-size: 13px; line-height: 1; cursor: pointer; user-select: none; }
.gcl-star::before, .gcl-cl-x::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--kit-hit); transform: translateY(-50%); }
.gcl-star { color: var(--c-ink-3); font-size: 14px; }
.gcl-star.on { color: var(--c-accent-ink); }
.gcl-star:hover, .gcl-cl-x:hover { color: var(--c-ink); background: var(--c-hover-btn); }
.gcl-cl-x.danger { color: var(--c-blocking); }
.gcl-cl-x.danger:hover { color: var(--c-blocking); background: color-mix(in srgb, var(--c-blocking) 10%, transparent); }
.gcl-star:focus-visible, .gcl-cl-x:focus-visible { outline: 2px solid var(--c-accent); outline-offset: -2px; }
.gcl-edit-hd { gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-line); background: transparent; }
.gcl-edit-hd input { flex: 1; font: 600 16px/1.2 var(--font-heading); letter-spacing: .02em; }
/* The MFD preview is a real avionics screen: a dark island with Garmin's own colours (--gcl-*, styles.css). Its controls
   read the NIGHT tokens locally so the kit inputs / buttons look right on the black ground: the values below are the Night
   block's, copied on purpose (a custom property cannot be inherited from a theme that is not active) and pinned to it by
   scripts/web_sweep_other_test.js, so they cannot drift. redesign:web-sweep-other */
.gcl-mfd-preview { color-scheme: dark; background: var(--gcl-glass); color: var(--c-ink); --c-surface: #182029; --c-ink: #bccad8; --c-ink-2: #9aa6b2; --c-ink-3: #7b8894;
  --c-line-control: #6f7b87; --c-line: rgba(210,218,226,.18); --c-line-2: rgba(210,218,226,.09); --c-accent: #94bce3; --c-accent-ink: #b5d9fd; --c-hover-btn: color-mix(in srgb, var(--c-ink) 7%, transparent); --c-blocking: #ec8276; }
.gcl-row { padding: 8px 12px; border-bottom: 1px solid var(--c-line-2); }
.gcl-ctl { gap: 6px; }
.gcl-ctl select, .gcl-ctl input { width: auto; min-height: 34px; font-size: 13px; padding: 3px 7px; }
.gcl-ctl input[data-gcl-text] { flex: 1; min-width: 140px; }
.gcl-ctl input[data-gcl-resp] { width: 130px; }
.gcl-ctl input[data-gcl-blank] { width: 62px; }
.gcl-swatch { border-radius: 0; }
.gcl-info { padding: 14px 16px; margin-bottom: 14px; }
@media (max-width: 767.98px) {
  .gcl-side-scroll { max-height: 44vh; }
  .gcl-mfd-preview { max-height: none; }
  .gcl-ctl select, .gcl-ctl input[data-gcl-text] { flex: 1 1 100%; max-width: none; }
}

/* long unbroken sub-lines (insurer · broker · hull · premium) wrap inside the stacked <520px card instead of running past the frame */
.rec2-body .datatable td .sub { overflow-wrap: anywhere; }
