/* Zona piloților (și masa și centrajul): compact, pentru telefon și tabletă, în portret și în peisaj.
   O coloană pe telefon în portret; pe ecrane mai late, cardurile și câmpurile se așază singure pe mai multe coloane. */
:root {
  color-scheme: light;
  --accent: #9A6112; --link: #9A6112; --ink: #1c1c1c; --ink2: #333; --muted: #666; --line: #e3e1dc; --bg: #f3f2ef;
  --surface: #fff; --rule: #eee; --field-line: #c9c6c0; --header: #1f2a33; --shadow: rgba(0,0,0,.08);
  --red: #b3261e; --red-bg: #fde8e6; --red-ink: #5c120d; --yellow: #7a5200; --yellow-bg: #fff3cd; --yellow-line: #d39b00;
  --ok: #1a7a2e; --ok-bg: #e6f4ea; --ok-ink: #0f4a1c; --grey-bg: #eee; --grey-ink: #555;
  --chart-grid: #e3e3e3; --chart-text: #666; --chart-zfm: #2563a8; --chart-tom: #A86A15; --chart-ldm: #1a7a2e;
  --r: 8px;
  --tl-block: #e9e5dc; --tl-field: #fff; --tl-field-line: #857f74; --tl-label: #3d3a34; --tl-hover: #fff6e6; --tl-hover-line: #9A6112; --tl-focus: rgba(154,97,18,.35); --tl-readonly: #ebe8e2;
}
/* Modul întunecat: implicit după setarea dispozitivului; butonul ☾/☀ din antet îl fixează (data-theme pe <html>). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --link: #e0a75a; --ink: #e6e3dd; --ink2: #d4d0c9; --muted: #a29d94; --line: #3a3d42; --bg: #15171a;
  --surface: #1f2226; --rule: #33363b; --field-line: #4a4d52; --header: #0e1114; --shadow: rgba(0,0,0,.45);
  --red: #f2786d; --red-bg: #3a1c1a; --red-ink: #f6b1aa; --yellow: #f0c75e; --yellow-bg: #332a12; --yellow-line: #b88a12;
  --ok: #6cc47f; --ok-bg: #16301d; --ok-ink: #a9dfb4; --grey-bg: #2c2f33; --grey-ink: #bdb8b0;
  --chart-grid: #3b3f45; --chart-text: #a8a39a; --chart-zfm: #7fb0ea; --chart-tom: #e0a75a; --chart-ldm: #6cc47f;
  --tl-block: #262a2f; --tl-field: #121417; --tl-field-line: #6b7078; --tl-label: #cdc8bf; --tl-hover: #2d2519; --tl-hover-line: #e0a75a; --tl-focus: rgba(224,167,90,.45); --tl-readonly: #1c1f23;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --link: #e0a75a; --ink: #e6e3dd; --ink2: #d4d0c9; --muted: #a29d94; --line: #3a3d42; --bg: #15171a;
    --surface: #1f2226; --rule: #33363b; --field-line: #4a4d52; --header: #0e1114; --shadow: rgba(0,0,0,.45);
    --red: #f2786d; --red-bg: #3a1c1a; --red-ink: #f6b1aa; --yellow: #f0c75e; --yellow-bg: #332a12; --yellow-line: #b88a12;
    --ok: #6cc47f; --ok-bg: #16301d; --ok-ink: #a9dfb4; --grey-bg: #2c2f33; --grey-ink: #bdb8b0;
    --chart-grid: #3b3f45; --chart-text: #a8a39a; --chart-zfm: #7fb0ea; --chart-tom: #e0a75a; --chart-ldm: #6cc47f;
    --tl-block: #262a2f; --tl-field: #121417; --tl-field-line: #6b7078; --tl-label: #cdc8bf; --tl-hover: #2d2519; --tl-hover-line: #e0a75a; --tl-focus: rgba(224,167,90,.45); --tl-readonly: #1c1f23;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); overflow-wrap: anywhere; }
a { color: var(--link); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }  /* contrast AA pe ambele teme */

/* antet + meniu */
header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .75rem; background: var(--header); color: #fff; font-size: .88rem; }
header a { color: #fff; text-decoration: none; }
header a.brand { display: inline-flex; align-items: center; gap: .4em; }
header .brand-logo { flex: none; width: 1.35em; height: 1.35em; }
header .who { font-size: .8rem; opacity: .9; white-space: nowrap; }
header .who button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; padding: 0; font: inherit; }
header .tools { display: flex; align-items: center; gap: .6rem; }
/* „Ieșire” pentru piloți: buton vizibil (tableta din elicopter e folosită de mai mulți piloți) */
header .logout-form { margin: 0; }
header .logout-btn { display: inline-flex; align-items: center; gap: .35em; padding: .3rem .75rem; border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--r); background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
header .logout-btn:hover { background: rgba(255,255,255,.25); }
header .logout-btn { white-space: nowrap; }
header .logout-ico { flex: none; }
header a.brand { white-space: nowrap; min-width: 0; flex: 0 1 auto; overflow: hidden; }
header a.brand strong { overflow: hidden; text-overflow: ellipsis; }
/* telefon îngust: numele pilotului se vede pe pagină, în antet rămân sigla, tema și „Ieșire” */
header a.who-link { text-decoration: underline; text-decoration-color: rgba(255,255,255,.45); text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; }
header a.who-link:hover { text-decoration-color: #fff; }
/* telefon îngust: fără „· pilot”; numele (link spre schimbarea parolei) se scurtează */
@media (max-width: 480px) { header .brand-role { display: none; } header .who { max-width: 6.5rem; } }
/* telefoane foarte înguste: în antet rămâne doar sigla, ca numele pilotului și „Deconectare” să încapă întregi */
@media (max-width: 400px) { header a.brand strong { display: none; } }
.theme-toggle { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 1rem; padding: .05rem .5rem; font-size: .9rem; line-height: 1.4; cursor: pointer; }
/* meniul trece pe al doilea rând când nu încape (pe telefon), ca toate opțiunile să se vadă — fără derulare ascunsă */
nav { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; column-gap: .1rem; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 .25rem; }
nav a { padding: .45rem .5rem; text-decoration: none; color: var(--ink2); white-space: nowrap; font-size: .88rem; border-bottom: 3px solid transparent; }
nav a.on { border-bottom-color: var(--accent); font-weight: 600; }
@media (max-height: 500px) { nav { position: static; } }   /* telefon în peisaj: meniul nu ocupă ecranul */
.badge { display: inline-block; min-width: 1.25em; padding: 0 .3em; border-radius: 1em; font-size: .72rem; font-weight: 700; text-align: center; color: #fff; line-height: 1.35; }
.badge.red { background: #b3261e; } .badge.yellow { background: #b88a00; }

main { max-width: 1200px; margin: 0 auto; padding: .6rem .75rem 1.5rem; }
/* paginile biroului (jurnalul, rapoartele): FHD first, pe toată lățimea pe ecranele mari */
@media (min-width: 1200px) {
  main.wide { max-width: none; padding-inline: clamp(1rem, 1.6vw, 2.5rem); }
  main.wide .btn.block { display: inline-block; width: auto; min-width: 14rem; padding-inline: 2rem; }  /* nu o bară pe tot ecranul */
}
h1 { font-size: 1.15rem; margin: .1rem 0 .5rem; line-height: 1.25; }
h2 { font-size: .98rem; margin: .9rem 0 .4rem; }
p { margin: 0 0 .5rem; }

/* blocuri */
.card { background: var(--surface); border-radius: var(--r); padding: .5rem .7rem; margin: 0 0 .4rem; box-shadow: 0 1px 2px var(--shadow); min-width: 0; }
a.card { display: block; text-decoration: none; color: inherit; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: .4rem; margin-bottom: .4rem; }
.grid > .card, .grid > .alert { margin: 0; }
.cols { display: grid; gap: .2rem .9rem; }
@media (min-width: 880px) { .cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; } }
.row { display: flex; justify-content: space-between; align-items: center; gap: .3rem .6rem; flex-wrap: wrap; min-width: 0; }
.row > * { min-width: 0; }
.muted { color: var(--muted); font-size: .82rem; }
.alert { border-radius: var(--r); padding: .4rem .6rem; margin: 0 0 .4rem; border-left: 4px solid; font-size: .9rem; }
.alert.red { background: var(--red-bg); border-color: var(--red); color: var(--red-ink); }
.alert.yellow { background: var(--yellow-bg); border-color: var(--yellow-line); color: var(--yellow); }
.alert.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok-ink); }
.tag { display: inline-block; padding: .05rem .45rem; border-radius: 1rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.tag.red { background: var(--red-bg); color: var(--red); } .tag.yellow { background: var(--yellow-bg); color: var(--yellow); }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.grey { background: var(--grey-bg); color: var(--grey-ink); }
.msg { background: var(--ok-bg); color: var(--ok-ink); padding: .45rem .7rem; border-radius: var(--r); margin-bottom: .5rem; font-size: .9rem; }
.warning { background: var(--yellow-bg); border: 1px solid var(--yellow-line); color: var(--yellow); padding: .45rem .7rem; border-radius: var(--r); margin-bottom: .5rem; font-size: .88rem; }
ul.plain { list-style: none; padding: 0; margin: .2rem 0 0; } ul.plain li { padding: .15rem 0; }
details > summary { cursor: pointer; padding: .2rem 0; }

/* tabele */
table { width: 100%; border-collapse: collapse; font-size: .86rem; }
td, th { text-align: left; padding: .25rem .3rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 600; color: var(--ink2); }
table.kv th { width: 34%; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }

/* butoane */
.btn { display: inline-block; padding: .45rem .85rem; background: var(--accent); color: #fff; border: 0; border-radius: var(--r); font-size: .92rem; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; }
.btn.small { padding: .25rem .55rem; font-size: .8rem; }
.btn.grey { background: #6b6b6b; } .btn.green { background: #1a7a2e; } .btn.red { background: #b3261e; }
.btn.block, button[type=submit].block { display: block; width: 100%; text-align: center; padding: .6rem; font-size: 1rem; margin-top: .3rem; }

/* formulare: câmpurile scurte se pun câte 2–4 pe rând, după lățime; cele lungi pe tot rândul */
label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: .15rem; color: var(--ink2); }
input, select, textarea { width: 100%; padding: .35rem .5rem; font-size: 16px; /* 16px: iPhone nu mai face zoom */ border: 1px solid var(--field-line); border-radius: 6px; background: var(--surface); color: var(--ink); min-height: 2.25rem; font-family: inherit; }
textarea { min-height: 0; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin: 0 .35rem 0 0; vertical-align: -2px; }
.fuel-unit { display: flex; gap: 1.2rem; margin: 0 0 .6rem; }
.fuel-unit label { display: inline-flex; align-items: center; font-size: .9rem; font-weight: 600; margin: 0; }
.fuel-conv { display: block; min-height: 1.1em; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
input[type=file] { padding: .25rem; font-size: .85rem; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: .1rem .6rem; }
.fields > div { margin-bottom: .4rem; min-width: 0; }
.fields > .wide { grid-column: 1 / -1; }
.fields > .check label { font-weight: 400; font-size: .9rem; display: flex; align-items: center; min-height: 2.25rem; margin: 0; }
/* pe fiecare rând al grilei câmpurile încep la aceeași înălțime, chiar dacă unele etichete au două rânduri: fiecare
   câmp ia 3 rânduri ale grilei (eticheta, câmpul, explicația / erorile), iar etichetele se aliniază jos */
@supports (grid-template-rows: subgrid) {
  .fields > div { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
  .fields > div > label { grid-row: 1; align-self: end; }
  .fields > div > input, .fields > div > select, .fields > div > textarea { grid-row: 2; }
  .fields > div > .field-extra { grid-row: 3; }
  .fields > div > * { min-width: 0; }  /* câmpurile de dată nu ies din celulă */
  .fields > .check > label { grid-row: 2; }
}
.helptext { display: block; color: var(--muted); font-size: .75rem; margin-top: .1rem; }
.errorlist { color: var(--red); margin: .15rem 0; padding-left: 1rem; font-size: .8rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 .5rem; padding: .3rem .6rem .4rem; background: var(--surface); min-width: 0; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }
.quickfill { display: flex; gap: .3rem; margin-top: .2rem; flex-wrap: wrap; }
.quickfill button { flex: 1; padding: .2rem .25rem; font-size: .74rem; white-space: nowrap; border: 1px solid var(--link); background: var(--surface); color: var(--link); border-radius: 6px; cursor: pointer; }

/* masă și centraj */
.type { color: var(--muted); font-size: .88rem; margin: 0 0 .4rem; }
.card .reg { font-weight: 700; font-size: 1.05rem; }
.result-row { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.result-row:last-child { border-bottom: 0; }
.status-ok { color: var(--ok); font-weight: 700; } .status-bad { color: var(--red); font-weight: 700; } .status-unknown { color: var(--muted); font-weight: 600; }
svg { max-width: 100%; height: auto; }
.back { margin: -.2rem 0 .6rem; font-size: .9rem; }

/* graficele plicului CG (SVG): culorile urmează tema */
.ch-grid { stroke: var(--chart-grid); } .ch-text { fill: var(--chart-text); } .ch-text-stroke { stroke: var(--chart-text); }
.ch-track { stroke: var(--rule); } .ch-dot { stroke: var(--surface); }
.ch-zfm { fill: var(--chart-zfm); } .ch-tom { fill: var(--chart-tom); } .ch-ldm { fill: var(--chart-ldm); }
.ch-lbl-zfm { fill: var(--chart-zfm); } .ch-lbl-tom { fill: var(--chart-tom); } .ch-lbl-ldm { fill: var(--chart-ldm); }
.months { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 .6rem; }
.months .tag { text-decoration: none; font-size: .8rem; padding: .15rem .55rem; }
.tag.on { background: var(--accent); color: #fff; }
/* Jurnalul de zbor (pagina FTL): pe PC/tabletă în peisaj, foaia aranjată ca formularul din Access; pe telefon, fișele. */
.tl-sheet { display: none; }
@media (min-width: 1000px) {
  .tl-sheet { display: block; } .tl-mobile { display: none; }
  .tl-head { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; background: var(--surface); border-radius: var(--r); padding: .45rem .7rem; margin-bottom: .4rem; box-shadow: 0 1px 2px var(--shadow); }
  .tl-head .muted { font-size: .75rem; }
  .tl-nav a, .tl-nav span { margin: 0 .15rem; text-decoration: none; }
  .tl-head-actions { margin-left: auto; display: flex; gap: .35rem; } .tl-head-actions form { margin: 0; }
  .tl-leg { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .35rem .5rem; margin-bottom: .35rem; }
  /* rândul pentru zborul nou: separat vizual de zborurile salvate (chenar întrerupt în culoarea aplicației, fundal
     nuanțat, bandă de titlu, spațiu deasupra) */
  .tl-leg.tl-new { border: 2px dashed var(--accent) !important; background: color-mix(in srgb, var(--accent) 7%, var(--surface)) !important; margin-top: 1.1rem; }
  .tl-new-title { margin: -.35rem -.5rem .4rem; padding: .3rem .6rem .3rem 2.6rem; background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-radius: var(--r) var(--r) 0 0; color: var(--accent); font-size: .85rem; }
  .tl-new-title span { color: var(--muted); font-size: .8rem; }
  .tl-new-title .when-dirty, .tl-leg.tl-new:not(.tl-dirty) .tl-new-title .when-clean { display: inline; }
  .tl-new-title .when-clean, .tl-leg.tl-new:not(.tl-dirty) .tl-new-title .when-dirty { display: none; }
  /* cât are doar valorile propuse (nimic scris de mână), rândul nou e estompat; evidențiat abia de la prima modificare
     (clasa tl-dirty, din unsaved.js) */
  .tl-leg.tl-new:not(.tl-dirty) { border-color: var(--tl-field-line) !important; background: var(--tl-block, var(--surface)) !important; opacity: .6; transition: opacity .15s; }
  .tl-leg.tl-new:not(.tl-dirty):hover, .tl-leg.tl-new:not(.tl-dirty):focus-within { opacity: 1; }
  .tl-leg.tl-new:not(.tl-dirty) .tl-new-title { background: transparent; color: var(--muted); }
  .tl-fs { border: 0; padding: 0; margin: 0; min-width: 0; background: transparent; box-shadow: none; }
  .tl-row { display: grid; gap: .25rem .4rem; align-items: start; margin-bottom: .2rem; }
  .tl-r1 { grid-template-columns: 1.6rem 4.4rem 4.4rem minmax(8rem,1fr) minmax(10rem,1.3fr) minmax(11rem,1.3fr) 5.6rem 5.6rem 4.6rem 3.6rem; }
  .tl-r2 { grid-template-columns: 1.6rem minmax(0,3fr) minmax(0,2fr) 4.4rem 5.2rem 6.2rem auto auto auto; }
  .tl-r2 > :first-child { grid-column: 2; }
  .tl-r3 { grid-template-columns: 1.6rem minmax(0,1fr) auto; align-items: end; } .tl-r3 > label { margin-bottom: 0; }  /* butoanele aliniate cu „Observații” */
  .tl-r3 > :first-child { grid-column: 2; }
  /* TECHLOG_HIDE_UNUSED: rândul 2 = beneficiar, alimentat de, observații, butoane; câmpurile nefolosite ascunse, afară
     de cele care au deja o valoare (tl-opt-keep, din techlog.js) */
  .tl-r2.tl-r2c { grid-template-columns: 1.6rem minmax(0,1.5fr) minmax(0,1fr) minmax(0,2.6fr) auto; align-items: end; }
  .tl-r2c > label { margin-bottom: 0; }
  .tl-ropt { grid-template-columns: 1.6rem repeat(6, auto); justify-content: start; align-items: end; }
  .tl-ropt::before { content: ""; }
  .tl-ropt label:not(.tl-check) { min-width: 6rem; }
  .tl-leg label, .tl-calc { white-space: nowrap; font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; line-height: 1.5; }
  .tl-leg input, .tl-leg select, .tl-leg textarea { font-size: .88rem; min-height: 1.8rem; padding: .15rem .35rem; text-transform: none; font-weight: 400; color: var(--ink); letter-spacing: 0; }
  .tl-leg label > input:not([type=checkbox]), .tl-leg label > select, .tl-leg label > textarea { display: block; }
  .tl-leg label > select + select, .tl-leg label > input + input { margin-top: .15rem; }
  .tl-pair > input { min-width: 0; }
  .tl-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem; }
  .tl-leg input[name$=departure_name], .tl-leg input[name$=arrival_name] { text-transform: uppercase; }
  .tl-leg textarea { min-height: 1.8rem; height: 1.9rem; resize: vertical; display: block; }
  .tl-no { font-weight: 700; color: var(--muted); padding-top: 1.1rem; text-align: center; }
  .tl-calc { text-align: center; } .tl-calc strong { font-size: 1rem; color: var(--ink); text-transform: none; }
  /* căsuțele (Pre-flight, CG OK, peste miezul nopții): căsuța și textul centrate pe înălțimea câmpurilor de pe rând */
  .tl-check { align-self: end; display: flex; align-items: center; gap: .35rem; min-height: 1.8rem; white-space: nowrap; text-transform: none !important; }
  .tl-check input[type=checkbox] { margin: 0; flex: none; }
  .tl-actions { align-self: end; display: flex; gap: .4rem; }
  /* butoanele formularelor din jurnal: la înălțimea câmpurilor */
  .tl-actions .btn, .tl-pageform .btn { white-space: nowrap; display: inline-flex; align-items: center; }
  .tl-actions .btn { min-height: 1.9rem; padding-top: .3rem; padding-bottom: .3rem; }  /* cât câmpul „Observații” */
  .tl-pageform .btn { min-height: 2.25rem; }
  .tl-err { margin: 0 0 .3rem; font-size: .82rem; }
  .tl-leg [aria-invalid=true] { border-color: var(--red); background: var(--red-bg); }
  .tl-foot { background: var(--surface); border-radius: var(--r); padding: .4rem .6rem; box-shadow: 0 1px 2px var(--shadow); }
  .tl-counters { width: 100%; border-collapse: collapse; font-size: .85rem; }
  .tl-counters th { font-size: .7rem; color: var(--muted); text-align: center; padding: .1rem .3rem; }
  .tl-counters td { text-align: center; padding: .15rem .3rem; border-top: 1px solid var(--rule); }
  .tl-counters tr:last-child td { font-weight: 700; }
  .tl-counters .tl-tot { text-align: right; border-left: 1px solid var(--line); padding-left: .8rem; font-weight: 400; vertical-align: top; }
  .tl-pageform { margin-top: .4rem; } .tl-pageform summary { cursor: pointer; font-size: .85rem; color: var(--link); }
  /* formularul paginii (jos): chenar propriu, ca badge-ul cu atenționări să stea pe marginea lui, ca la zboruri */
  .tl-pageform > form { margin-top: 1rem; padding: .9rem .8rem .6rem; border: 1px solid var(--tl-field-line, var(--line)); border-radius: var(--r); background: var(--tl-block, var(--surface)); }
  .tl-pageform > form .tl-live { left: .6rem; }
  /* formularul paginii: datele pe un rând, contoarele ca tabel (flightlog/_techlog_pageform.html) */
  .tl-pf-head { display: grid; grid-template-columns: repeat(5, minmax(0, 11rem)); gap: .5rem .8rem; }
  .tl-pf-head label, .tl-pf-rest label { margin: 0; }
  .tl-pf-head input, .tl-pf-head select, .tl-pf-rest input, .tl-pf-rest textarea { display: block; margin-top: .2rem; }
  .tl-pf-manual { display: block; margin: .8rem 0 .5rem; font-weight: 600; }
  .tl-pf-manual .muted { font-weight: 400; font-size: .8rem; }
  .tl-pf-manual input { margin-right: .4rem; }
  .tl-pf-counters { border-collapse: collapse; width: 100%; max-width: 62rem; }
  .tl-pf-counters th { font-size: .75rem; font-weight: 600; color: var(--tl-label, var(--ink2)); text-align: left; padding: .2rem .4rem; vertical-align: bottom; }
  .tl-pf-counters tbody th { font-size: .85rem; white-space: nowrap; padding-right: .8rem; vertical-align: middle; }
  .tl-pf-counters td { padding: .2rem .4rem; width: 15%; vertical-align: middle; }
  .tl-pf-counters td input { width: 100%; }
  /* fără ciclurile Ng/Nf: doar orele și aterizările, lângă numele rândului, nu întinse pe toată lățimea */
  .tl-pf-counters.tl-pf-short { width: auto; }
  .tl-pf-short td { width: 11rem; }
  .tl-pf-short tbody th { min-width: 6rem; }
  .tl-pf-counters th, .tl-pf-counters td { border-bottom: 1px solid color-mix(in srgb, var(--tl-field-line, var(--line)) 55%, transparent); }
  .tl-pf-counters thead th { border-bottom-color: var(--tl-field-line, var(--line)); }
  .tl-pf-counters tbody tr:last-child > * { border-bottom: 0; }
  .tl-pf-counters td:empty::after { content: "—"; color: var(--muted); padding-left: .5rem; }
  .tl-pf-rest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem .8rem; margin-top: .6rem; }
  .tl-pf-rest .wide { grid-column: 1 / -1; }
  .tl-pf-rest:not(:has(label:not(.tl-opt), .tl-opt-keep)) { display: none; }
  .tl-pageform .btn { margin-top: .7rem; }
}
/* Foaia FTL pe ecran mare (Full HD și peste): folosește lățimea și mărește câmpurile, fără înghesuială. */
@media (min-width: 1500px) {
  .tl-head { font-size: 1.1rem; padding: .6rem 1rem; } .tl-head .muted { font-size: .8rem; }
  .tl-leg { padding: .6rem .9rem .5rem; margin-bottom: .6rem; }
  .tl-new-title { margin: -.6rem -.9rem .5rem; font-size: .95rem; }
  .tl-row { gap: .45rem .8rem; margin-bottom: .45rem; }
  .tl-check { min-height: 2.3rem; }
  .tl-r1 { grid-template-columns: 2rem 5.5rem 5.5rem minmax(11rem,1fr) minmax(14rem,1.4fr) minmax(16rem,1.4fr) 7rem 7rem 6rem 4.5rem; }
  .tl-r2 { grid-template-columns: 2rem minmax(0,3fr) minmax(0,2fr) 5.5rem 7rem 7.5rem auto auto auto; }
  .tl-r2.tl-r2c { grid-template-columns: 2rem minmax(0,1.5fr) minmax(0,1fr) minmax(0,2.6fr) auto; }
  .tl-ropt { grid-template-columns: 2rem repeat(6, auto); }
  .tl-r3 { grid-template-columns: 2rem minmax(0,1fr) auto; }
  .tl-leg label, .tl-calc { font-size: .78rem; }
  .tl-leg input, .tl-leg select, .tl-leg textarea { font-size: 1rem; min-height: 2.3rem; padding: .3rem .5rem; }
  .tl-leg textarea { height: 2.4rem; }
  .tl-leg label > select + select, .tl-leg label > input + input { margin-top: .3rem; }
  .tl-pair { gap: .4rem; }
  .tl-no { font-size: 1.15rem; padding-top: 1.4rem; }
  .tl-calc strong { font-size: 1.25rem; } .tl-calc { line-height: 1.7; }
  .tl-actions .btn, .tl-pageform .btn { min-height: 2.4rem; }
  .tl-foot { padding: .6rem .9rem; } .tl-counters { font-size: 1rem; } .tl-counters th { font-size: .8rem; padding: .2rem .5rem; }
  .tl-counters td { padding: .3rem .5rem; } .tl-counters .tl-tot { font-size: 1.05rem; }
}

/* Foaia FTL: contrast mai bun între bloc și câmpuri, evidențiere la hover și la focus (luminos și întunecat). */
@media (min-width: 1000px) {
  .tl-leg { background: var(--tl-block); border-color: var(--tl-field-line); }
  .tl-leg label, .tl-calc { color: var(--tl-label); }
  .tl-leg input:not([type=checkbox]), .tl-leg select, .tl-leg textarea { background: var(--tl-field); border: 1px solid var(--tl-field-line); transition: background-color .12s, border-color .12s, box-shadow .12s; }
  .tl-leg input:not([type=checkbox]):hover, .tl-leg select:hover, .tl-leg textarea:hover { background: var(--tl-hover); border-color: var(--tl-hover-line); }
  .tl-leg input:not([type=checkbox]):focus, .tl-leg select:focus, .tl-leg textarea:focus { outline: none; background: var(--tl-hover); border-color: var(--tl-hover-line); box-shadow: 0 0 0 3px var(--tl-focus); }
  .tl-leg input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); cursor: pointer; }
  .tl-leg fieldset:disabled input, .tl-leg fieldset:disabled select, .tl-leg fieldset:disabled textarea { background: var(--tl-readonly); }
  .tl-leg input::placeholder { color: var(--muted); opacity: 1; }
  .tl-leg:focus-within { border-color: var(--tl-hover-line); }
}
/* Butoane: evidențiere la hover și la focus (tastatură), în toată zona. */
.btn { transition: filter .12s, box-shadow .12s, transform .05s; }
.btn:hover { filter: brightness(1.15); box-shadow: 0 2px 6px var(--shadow); outline: 2px solid var(--tl-hover-line); outline-offset: 2px; }
:root[data-theme="dark"] .btn:hover { filter: brightness(1.2); }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn:focus-visible { outline: 2px solid var(--tl-hover-line); outline-offset: 2px; box-shadow: 0 0 0 5px var(--tl-focus); }
/* Luminos: câmpurile foii FTL ușor „adâncite”, ca să iasă din blocul bej. */
@media (min-width: 1000px) {
  :root:not([data-theme="dark"]) .tl-leg input:not([type=checkbox]), :root:not([data-theme="dark"]) .tl-leg select, :root:not([data-theme="dark"]) .tl-leg textarea { box-shadow: inset 0 1px 2px rgba(0,0,0,.12); }
  :root:not([data-theme="dark"]) .tl-leg input:not([type=checkbox]):focus, :root:not([data-theme="dark"]) .tl-leg select:focus, :root:not([data-theme="dark"]) .tl-leg textarea:focus { box-shadow: 0 0 0 3px var(--tl-focus); }
}
@media (min-width: 1000px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tl-leg input:not([type=checkbox]), :root:not([data-theme="light"]) .tl-leg select, :root:not([data-theme="light"]) .tl-leg textarea { box-shadow: none; }
}
.msg.warning { background: var(--yellow-bg); color: var(--yellow); border-left: 4px solid var(--yellow-line); }
.msg.error { background: var(--red-bg); color: var(--red-ink); border-left: 4px solid var(--red); }
/* Validarea pe loc a zborurilor (techlog.js): câmp greșit în roșu, atenționare în galben, mesajele sub antetul blocului. */
.tl-bad { border-color: var(--red) !important; background: var(--red-bg) !important; }
.tl-warn { border-color: var(--yellow-line) !important; background: var(--yellow-bg) !important; }
/* Mesajele nu intră în fluxul paginii (nu mută câmpurile): eticheta stă pe marginea de sus a formularului, deasupra
   numărului zborului (acolo nu sunt etichete de câmpuri), iar lista
   se deschide deasupra lui, peste zborul anterior (techlog.js, makeLive / showLive). */
.tl-has-live { position: relative; }
.tl-live { position: absolute; top: -.7rem; left: .2rem; z-index: 20; margin: 0; font-size: .85rem; }
.tl-live[hidden] { display: none; }
.tl-live-badge { font: inherit; font-size: .75rem; font-weight: 700; line-height: 1.2; padding: .1rem .4rem; white-space: nowrap; border-radius: 999px; cursor: pointer;
  background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-line); box-shadow: 0 1px 3px var(--shadow); min-height: 0; width: auto; }
.tl-live.has-errors .tl-live-badge { background: var(--red-bg); color: var(--red-ink, var(--red)); border-color: var(--red); }
.tl-live-list { display: none; position: absolute; left: 0; bottom: calc(100% + .35rem); width: max-content; max-width: min(42rem, 90vw);
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--yellow-line); border-radius: var(--r);
  box-shadow: 0 6px 18px var(--shadow); padding: .45rem .7rem; line-height: 1.4; max-height: 45vh; overflow: auto; }
.tl-live.below .tl-live-list { bottom: auto; }  /* `top` îl pune techlog.js: sub formular */
.tl-live.has-errors .tl-live-list { border-left-color: var(--red); }
.tl-live-list > div + div { margin-top: .2rem; }
.tl-live:hover .tl-live-list, .tl-live.open .tl-live-list, .tl-live.flash .tl-live-list,
.tl-has-live:focus-within .tl-live.has-errors .tl-live-list { display: block; }
.tl-live .e { color: var(--red); } .tl-live .w { color: var(--yellow); }
/* pe telefon formularul e lung: lista stă jos pe ecran, nu deasupra formularului (care poate fi în afara ecranului) */
@media (max-width: 999px) {
  .tl-live { left: .5rem; }
  .tl-live-list { position: fixed; left: .5rem; right: .5rem; bottom: .5rem; width: auto; max-width: none; max-height: 40vh; overflow: auto; }
  .tl-live.below .tl-live-list { top: auto !important; bottom: .5rem; }
}
.tl-leg input:disabled { opacity: .55; }

/* Modificări nesalvate (unsaved.js): butonul de salvare inactiv fără modificări, formularul „în lucru” cu contur,
   popupul aplicației (în locul dialogurilor browserului). */
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; box-shadow: none; outline: none; transform: none; }
form.tl-dirty { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r); }
dialog.tl-dialog { margin: 12vh auto auto; border: 0; border-radius: var(--r); padding: 1.1rem 1.2rem 1rem; max-width: min(30rem, 92vw); background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(0,0,0,.35); }
dialog.tl-dialog::backdrop { background: rgba(15, 20, 25, .55); }
/* în modul întunecat popupul are contur, altfel se pierde în fundalul întunecat */
:root[data-theme="dark"] dialog.tl-dialog { border: 1px solid rgba(255, 255, 255, .28); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) dialog.tl-dialog { border: 1px solid rgba(255, 255, 255, .28); } }
.tl-dialog-title { font-size: 1.1rem; margin: 0 0 .5rem; }
.tl-dialog-content { margin: 0 0 1rem; color: var(--ink2); line-height: 1.45; }
.tl-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.tl-dialog-reason { display: block; margin: 0 0 1rem; font-weight: 600; }
.tl-dialog-reason textarea { display: block; width: 100%; box-sizing: border-box; margin-top: .3rem; font: inherit; font-weight: 400; padding: .45rem .55rem; border: 1px solid var(--line, #c8ccd2); border-radius: 6px; background: var(--surface); color: var(--ink); resize: vertical; }
.tl-dialog-ok:disabled { opacity: .45; cursor: not-allowed; }
.tl-dialog-danger .tl-dialog-ok { background: var(--red); }
dialog.tl-dialog-ok .tl-dialog-ok { background: var(--ok); }

/* Filtrele paginilor de listă (jurnal, verificări, rapoarte): un card cu filtrele și butoanele pe un rând, la înălțimea
   câmpurilor, iar dedesubt blocuri separate (perioada an / lună / zi, coloanele). Filtrele se aplică la schimbare,
   fără buton (data-auto). Pe telefon câmpurile ocupă rândul, iar butoanele sunt mai mici. */
.head-actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.head-actions form { margin: 0; }
.head-actions .btn, .filters-actions .btn { min-height: 2.25rem; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.filters { padding: .8rem 1rem; display: grid; gap: .8rem; margin-bottom: .6rem; }
.filters-row { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: flex-end; }
.filters-row label { margin: 0; }
.filters-row label > select, .filters-row label > input { display: block; margin-top: .2rem; width: auto; max-width: 100%; }
.filters-row .grow { flex: 1 1 18rem; } .filters-row .grow > select, .filters-row .grow > input { width: 100%; }
.filters-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-left: auto; }
.filters-block { border-top: 1px solid var(--rule); padding-top: .7rem; }
.filters-title { font-size: .8rem; font-weight: 600; color: var(--ink2); margin: 0 0 .45rem; }
.filters-title a { font-weight: 400; margin-left: .5rem; }
.period { display: grid; grid-template-columns: 3.2rem 1fr; gap: .4rem .6rem; align-items: center; }
.period > span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.period .months { margin: 0; gap: .35rem; }
.period .tag { font-size: .85rem; padding: .3rem .75rem; min-width: 2.4rem; text-align: center; }
.period .tag.grey:hover { filter: brightness(.95); outline: 1px solid var(--field-line); }
@media (max-width: 600px) {
  .head-actions .btn { min-height: 0; padding: .3rem .6rem; font-size: .85rem; }
  .filters { padding: .6rem .7rem; }
  .filters-row > label, .filters-row > label > select, .filters-row > label > input { width: 100%; }
  .filters-row > label.half { width: calc(50% - .4rem); }
  .filters-actions { margin-left: 0; width: 100%; } .filters-actions .btn { flex: 1; }
  .period { grid-template-columns: 1fr; } .period > span { display: none; }
  .period .tag { padding: .2rem .5rem; font-size: .8rem; min-width: 2rem; }
}

/* Bara „Salvează tot” (unsaved.js): jos pe ecran, doar când sunt modificări în mai multe formulare ale paginii */
.tl-savebar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 1rem;
  max-width: calc(100vw - 2rem); padding: .55rem .6rem .55rem 1rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--accent); border-left: 5px solid var(--accent); border-radius: var(--r); box-shadow: 0 6px 22px var(--shadow); }
.tl-savebar[hidden] { display: none; }
.tl-savebar-text { font-size: .9rem; }
.tl-savebar .btn { min-height: 2.25rem; white-space: nowrap; flex: none; }
body.tl-has-savebar main { padding-bottom: 5rem; }  /* bara nu acoperă ultimul formular */
@media (max-width: 600px) { .tl-savebar { left: .5rem; right: .5rem; transform: none; bottom: .5rem; gap: .6rem; } .tl-savebar-text { font-size: .82rem; } }

/* Câmpurile jurnalului care nu se folosesc (TECHLOG_HIDE_UNUSED): ascunse, cu excepția celor care au deja o valoare */
.tl-compact .tl-opt:not(.tl-opt-keep) { display: none !important; }
.tl-compact .tl-ropt:not(:has(.tl-opt-keep)) { display: none; }

/* sub erorile unui formular din jurnal: reîncărcarea după un conflict, bifa „E alt zbor” (_techlog_conflict.html) */
.tl-err .btn, .alert .btn[data-keep-drafts] { margin-top: .4rem; }
.tl-dup { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; font-weight: 600; text-transform: none !important; letter-spacing: 0 !important; font-size: .85rem !important; color: inherit !important; }
.tl-dup input { width: auto; margin: 0; }

/* Autentificarea în doi pași (core/twofactor.py) */
.twofactor ol { padding-left: 1.2rem; margin: .4rem 0; }
.twofactor li { margin: .2rem 0; }
.twofactor label.check { display: flex; align-items: center; gap: .45rem; margin: .5rem 0; font-size: .9rem; }
.otp-qr { display: flex; justify-content: center; margin: .6rem 0; }
.otp-qr svg { width: 220px; height: 220px; background: #fff; border-radius: 6px; }
.otp-secret { word-break: break-all; }
.otp-input { font-size: 1.4rem; letter-spacing: .25em; text-align: center; }
.otp-codes { columns: 2; list-style: none; padding: 0; margin: .6rem 0; font-size: 1.1rem; }
.otp-codes li { padding: .2rem 0; }
.muted.small { font-size: .78rem; margin-top: .6rem; }

/* „De la / La” în jurnal: autocomplete din lista de terenuri (techlog.js placeCombo) */
.tl-combo { position: relative; display: block; min-width: 0; }
.tl-combo > input { display: block; width: 100%; }
.tl-combo-list { position: absolute; z-index: 30; top: calc(100% + 2px); left: 0; min-width: 100%; width: max-content; max-width: min(30rem, 90vw);
  max-height: 18rem; overflow-y: auto; margin: 0; padding: .2rem 0; list-style: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--field-line); border-radius: 6px; box-shadow: 0 6px 18px var(--shadow); text-transform: none; letter-spacing: 0; }
.tl-combo-list li { display: flex; gap: .6rem; justify-content: space-between; align-items: baseline; padding: .3rem .6rem; cursor: pointer;
  font-size: .88rem; font-weight: 400; color: var(--ink); white-space: nowrap; }
.tl-combo-list li.on, .tl-combo-list li:hover { background: var(--bg); }
.tl-combo-list .tl-combo-tag { font-size: .72rem; color: var(--muted); }
.tl-combo-list .tl-combo-tag.warn { color: var(--yellow); }
.tl-combo-list .tl-combo-none { cursor: default; color: var(--muted); white-space: normal; }

/* Documente aeronavă (dosarul de bord, OM-A Anexa 3) */
.ob-card .row + .row { margin-top: .15rem; }
.ob-hint { margin: -.2rem 0 .3rem; }
.ob-list { padding: 0 .7rem; }
.ob-item { padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.ob-item:last-child { border-bottom: 0; }
.ob-label { font-weight: 600; font-size: .92rem; }
.ob-missing .ob-label { color: var(--muted); }
.ob-mark { display: inline-block; width: 1.2em; font-weight: 700; }
.ob-mark.ok { color: var(--ok); } .ob-mark.red { color: var(--red); }
.ob-meta { padding-left: 1.2em; }
.ob-doc { padding: .3rem 0 .1rem 1.2em; font-size: .88rem; overflow-wrap: anywhere; }
.ob-doc a { align-items: flex-start; text-decoration: none; }
.ob-doc a::before { margin-top: .15em; }
.ob-head { align-items: flex-start; flex-wrap: nowrap; }
.ob-side { display: flex; align-items: center; gap: .4rem; flex: none; margin-left: auto; }
.ob-side .btn { white-space: nowrap; }
.btn.ob-btn-quiet { background: transparent; color: var(--ok); box-shadow: inset 0 0 0 1px var(--ok); }
@media (max-width: 480px) { .ob-side { flex-direction: column; align-items: flex-end; gap: .25rem; } }
/* documentul la zi, care se poate deschide: verde (maroul linkurilor sugera că ar fi ceva în neregulă) */
.ob-item:not(.ob-missing) .ob-doc a { color: var(--ok); }
.ob-item:not(.ob-missing) .ob-doc a:hover { color: var(--ok-ink); }
/* documentul expirat se poate deschide în continuare, cu maro (culoarea linkurilor) */
.ob-missing .ob-doc a { color: var(--link); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }  /* contrast AA pe ambele teme */

/* secțiuni care se deschid / se închid (dosarul de bord, „Documentele mele”), 18.11.2026 */
details.ob-section { margin: .2rem 0 .5rem; }
details.ob-section > summary { display: flex; align-items: center; gap: .5rem; list-style: none; padding: .45rem 0; min-height: 2.75rem; }
details.ob-section > summary::-webkit-details-marker { display: none; }
/* chevron desenat din două margini (nu un caracter de text): același contur, centrat pe titlu, pe orice font */
details.ob-section > summary::before { content: ""; flex: none; width: .5rem; height: .5rem; margin: 0 .3rem 0 .2rem;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); border-radius: 0 0 1px 0;
  transform: translateX(-1px) rotate(-45deg); transition: transform .15s ease; }
details.ob-section[open] > summary::before { transform: translateY(-2px) rotate(45deg); }
details.ob-section > summary:hover::before { border-color: var(--ink); }
details.ob-section > summary h2 { margin: 0; }
details.ob-section > summary .ob-count { margin-left: auto; }
details.ob-section > summary:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: var(--r); }

/* formularele de zbor ale pilotului (/pilot/formulare/), 18.11.2026: ordinea căsuțelor ca pe formularul de hârtie */
.pf-card { margin-bottom: .7rem; }
.pf-card h2 { margin: .1rem 0; }
.pf-source { margin: 0 0 .4rem; font-size: .85rem; }
.pf-start { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem; margin: .3rem 0; }
.pf-previews { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; align-items: center; font-size: .9rem; padding-top: .3rem; border-top: 1px solid var(--rule); }
.pf-latest { display: inline-flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.pf-notes { background: var(--red-bg); color: var(--red); padding: .35rem .6rem; border-radius: var(--r); font-size: .88rem; }
.pf-actions { display: inline-flex; gap: .4rem; align-items: center; margin-left: auto; }
.pf-form h2 { margin-top: 1.1rem; border-bottom: 1px solid var(--rule); padding-bottom: .2rem; }
.pf-sub { font-size: .8rem; font-weight: 400; }
.pf-label { font-weight: 600; font-size: .88rem; margin: .7rem 0 .25rem; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .45rem .6rem; margin: .4rem 0; }
.pf-grid.pf-narrow { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.pf-grid .wide { grid-column: span 2; }
@media (max-width: 480px) { .pf-grid .wide { grid-column: 1 / -1; } }
.pf-field { display: flex; flex-direction: column; gap: .15rem; font-size: .8rem; color: var(--muted); min-width: 0; }
.pf-field input, .pf-field select, .pf-field textarea, .pf-cell { font: inherit; font-size: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 6px; padding: .4rem .45rem; min-height: 2.5rem; width: 100%; box-sizing: border-box; }
.pf-field textarea { min-height: 4.5rem; resize: vertical; }
.pf-field input:disabled { color: var(--muted); background: transparent; }
.pf-field input:focus, .pf-field textarea:focus, .pf-cell:focus { outline: 2px solid var(--link); outline-offset: 0; border-color: var(--link); }
.pf-aircraft { min-width: 12rem; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.2rem; }
@media (max-width: 560px) { .pf-cols { grid-template-columns: 1fr; } }
.pf-list { display: flex; flex-direction: column; gap: .4rem; }
.pf-list .pf-field { flex-direction: row; align-items: center; justify-content: space-between; gap: .6rem; }
.pf-list .pf-field span { flex: 1; } .pf-list .pf-field input { width: 7rem; flex: none; }
.pf-checks { display: flex; gap: 1rem; align-items: center; }
.pf-check { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; min-height: 2.5rem; }
.pf-check input, .pf-yesno input { width: 1.25rem; height: 1.25rem; }
.pf-yesno { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; }
.pf-yesno legend { font-size: .9rem; padding: 0; margin-bottom: .2rem; width: 100%; }
.pf-yesno label { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.2rem; }
.pf-rows { display: flex; flex-direction: column; gap: .35rem; margin: .4rem 0; }
.pf-row { display: grid; grid-template-columns: 1fr minmax(8rem, 14rem); gap: .6rem; align-items: center; font-size: .9rem; padding: .2rem 0; border-bottom: 1px solid var(--rule); }
@media (max-width: 480px) { .pf-row { grid-template-columns: 1fr; gap: .2rem; } }
.pf-pair { display: flex; gap: .5rem; } .pf-pair .pf-field { flex: 1; }
.pf-scroll { overflow-x: auto; margin: .3rem 0; -webkit-overflow-scrolling: touch; }
.pf-table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.pf-table th, .pf-table td { border: 1px solid var(--line); padding: .15rem; text-align: left; vertical-align: middle; }
.pf-table th { background: var(--grey-bg); font-weight: 600; white-space: nowrap; padding: .25rem .35rem; }
.pf-table .pf-cell { min-width: 5.5rem; border-color: transparent; border-radius: 0; min-height: 2.3rem; }
.pf-table.pf-dense .pf-cell { min-width: 4.5rem; }
.pf-table .pf-cell.wide { min-width: 12rem; }
.pf-table .pf-group { background: var(--grey-bg); text-transform: uppercase; font-size: .75rem; letter-spacing: .03em; }
.pf-table .pf-doc { min-width: 14rem; padding: .25rem .35rem; }
.pf-save { position: sticky; bottom: 0; padding: .6rem 0; background: var(--bg); border-top: 1px solid var(--rule); margin-top: 1rem; display: flex; justify-content: flex-end; }
.pf-signature { margin-top: 1rem; }
.pf-signature canvas { display: block; width: 100%; max-width: 32rem; height: 9rem; background: #fff; border: 1px dashed var(--field-line);
  border-radius: var(--r); touch-action: none; cursor: crosshair; }
.pf-signature .pf-sig-tools { display: flex; align-items: center; gap: .6rem; margin-top: .35rem; font-size: .82rem; }
.pf-signature:not(.has-sig) [data-signature-clear] { visibility: hidden; }
