/* iG-POS pages. Builds on app.css and admin.css and adds only the page's own pieces. */

.igpos-narrow { max-width: 560px; }
.igpos-public { display: flex; flex-direction: column; gap: var(--a-s-4); }
.igpos-list { margin: 0; padding-left: var(--a-s-5); }
.igpos-list li + li { margin-top: var(--a-s-1); }
.igpos-actions { display: flex; flex-wrap: wrap; gap: var(--a-s-3); align-items: center; }
.hint + .igpos-actions { margin-top: var(--a-s-3); }
.igpos-name { margin: 0; overflow-wrap: anywhere; }
.igpos-height { max-width: 12ch; }
.igpos-check { display: flex; align-items: center; gap: var(--a-s-2); min-height: 24px; }
.igpos-check input { width: 24px; height: 24px; margin: 0; flex: none; }
.igpos-advanced { margin-bottom: var(--a-s-4); }
.igpos-advanced > .field { margin: var(--a-s-2) 0 0; }
.igpos-submit { display: flex; flex-direction: column; align-items: flex-end; gap: var(--a-s-2); }
.igpos-submit .hint { align-self: stretch; }
.igpos-more, .igpos-refresh { margin: var(--a-s-3) 0 0; }
.igpos-more { padding: 0 var(--a-s-5) var(--a-s-4); }
.igpos-table-tail { padding: var(--a-s-3) var(--a-s-5) var(--a-s-4); }
.igpos-table-tail.igpos-table-only { margin: 0; padding-top: 0; }
.igpos-counts { grid-template-columns: minmax(0, 1fr) auto; }
.igpos-runs-head { margin: 0; font-size: var(--a-fs-14); }
/* Who contributed, inside the Reference stations card under its head. */
.igpos-contribution { padding: 0 var(--a-s-5) var(--a-s-3); font-size: var(--a-fs-13); color: var(--a-text-2); }
.igpos-contribution p { margin: 0; }
.igpos-contribution p + p { margin-top: 2px; }

/* The result's standing, above the coordinates: the verdict, then one line per flag. */
.igpos-standing .banner-text > * { margin: 0; }
.igpos-standing .banner-text > * + * { margin-top: var(--a-s-2); }
.igpos-flags { padding-left: var(--a-s-5); }
.igpos-flags li + li { margin-top: var(--a-s-1); }
.igpos-problems { margin: var(--a-s-2) 0 var(--a-s-3); }
/* A height's caveat reads as a warning beside the number, not as one more grey line. */
.sub.igpos-caveat { color: var(--a-text-2); background: var(--a-warn-tint); border-left: 3px solid var(--a-warn); padding: 1px var(--a-s-1); margin-top: 2px; }

/* Links in cards and tables keep a 24 px target (WCAG 2.5.8). */
.igpos-more a, .igpos-refresh a, .card-meta a, .admin-back a, .pub-link, .side-footer a,
.kv dd a, .table td > a, td a.mono, section > p > a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

/* The frames: same height, fixed order. The top border repeats what the eyebrow and badge say. */
.igpos-meaning { margin: 0; font-size: var(--a-fs-14); font-weight: 500; }
.igpos-values { grid-template-columns: 110px minmax(0, 1fr); }
/* The values a surveyor reads first: a quiet band, half the accent tint over the panel, and the
   number in a heavier weight. The weight carries the emphasis; the band only groups label and
   value, so it stays readable in every theme. */
.igpos-values .igpos-key { background: color-mix(in srgb, var(--a-accent-tint) 50%, transparent); }
.igpos-values dt.igpos-key { padding-left: var(--a-s-2); border-radius: var(--a-r-1) 0 0 var(--a-r-1); color: var(--a-text); font-weight: 500; }
.igpos-values dd.igpos-key { padding-right: var(--a-s-2); border-radius: 0 var(--a-r-1) var(--a-r-1) 0; }
.igpos-values dd.igpos-key .igpos-variant > span:first-child { font-weight: 600; }
/* A panel's foot: the extra values on the left, Copy all beside the last of them. */
.igpos-frame-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--a-s-3); margin-top: auto; }
.igpos-frame-foot > .igpos-more-values { flex: 1; min-width: 0; }
.igpos-frame-foot > .btn { flex: none; }
[data-copy]:not([data-ready]) { display: none; }

.table .sub { white-space: normal; }

/* Published filters: the verdict leads each row, then the filter and what it checks, then what is
   required beside what this run measured. A failed row carries a red edge as well as its badge. */
/* `.table` raises these over the table's own 44 px, middle-aligned cells. */
@media (min-width: 768px) {
  .table.igpos-filters tbody td { height: auto; padding-block: var(--a-s-3); vertical-align: top; }
}
.igpos-filters .col-status { width: 104px; }
.igpos-filters th:nth-child(2) { width: 30%; }
.igpos-filters th:nth-child(3) { width: 20%; }
.igpos-filters td:not(.col-status) > span:only-child { display: flex; flex-direction: column; gap: 2px; }
.igpos-filter-name { font-weight: 500; }
.igpos-filters tr[data-pass="false"] td:first-child { box-shadow: inset 3px 0 0 var(--a-bad); }
.igpos-filters .igpos-filter-why { color: var(--a-text); }

/* Error estimates: the coordinate names a row like the first column of any table. */
.igpos-errors tbody th { padding: 0 var(--a-s-4); text-align: left; font-weight: 500; border-bottom: 1px solid var(--a-border); }
.igpos-errors tbody tr:last-child th { border-bottom: 0; }

/* Reference stations: one line of figures per station; its explanation runs the full width of a
   line under it, so a long sentence never makes the row tall. */
@media (min-width: 768px) {
  .table.igpos-baselines tbody tr:has(+ .igpos-baseline-note) td { height: auto; padding-top: var(--a-s-2); border-bottom: 0; }
  .table.igpos-baselines tbody .igpos-baseline-note td { height: auto; padding: 2px var(--a-s-4) var(--a-s-2); }
}
.igpos-baseline-note td { font-size: var(--a-fs-12); color: var(--a-text-2); }
.igpos-baseline-note td > span { display: flex; flex-wrap: wrap; gap: 2px var(--a-s-4); }
.igpos-baselines .col-status { width: 96px; }

@media (max-width: 1199px) and (min-width: 768px) {
  .igpos-baselines { min-width: 900px; }
}


@media (max-width: 767px) {
  /* The stacked rows: nothing scrolls sideways, and a long reason wraps inside its card. */
  .table-scroll { overflow: visible; }
  .table td > span:only-child { min-width: 0; overflow-wrap: anywhere; }
  .table td.col-status > span:only-child:not(.badge) { display: flex; flex-direction: column; align-items: flex-start; gap: var(--a-s-1); }
  .igpos-more { padding-inline: 0; }
  /* A stacked table's card is transparent, so the words around its rows get a box of their own. */
  .card-table > .igpos-table-tail, .card-table > .igpos-contribution {
    margin-top: var(--a-s-3); padding: var(--a-s-3) var(--a-s-4);
    background: var(--a-panel); border: 1px solid var(--a-border); border-radius: var(--a-r-2);
  }
  .card-table > .igpos-contribution { margin: 0 0 var(--a-s-3); }
  /* A filter names itself; its sentence reads left to right under its value. */
  .igpos-filters td.igpos-filter { justify-content: flex-start; text-align: left; }
  .igpos-filters td.igpos-filter::before { display: none; }
  .igpos-filters .igpos-filter-name { font-size: var(--a-fs-14); }
  .igpos-filters td.igpos-figure:has(.igpos-filter-why) { flex-direction: column; align-items: flex-start; gap: var(--a-s-1); text-align: left; }
  .igpos-filters td.igpos-figure:has(.igpos-filter-why) > span { align-items: flex-start; }
  .igpos-filters tr[data-pass="false"] td:first-child { box-shadow: none; }
  .igpos-filters tr[data-pass="false"] { border-left: 3px solid var(--a-bad); }
  .igpos-errors tbody th { display: block; padding: 6px 0; border-bottom: 0; font-weight: 600; }
  /* The scrolling wrapper hides the table from the stacked-card rule, so repeat it here. */
  .card-table:has(> .table-scroll > .igpos-baselines) { background: transparent; border: 0; overflow: visible; }
  /* A station is a compact card: station and verdict on top, the figures two to a line, its
     explanation as the card's last line. */
  .igpos-baselines tr[data-baseline] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--a-s-4); }
  .igpos-baselines tr[data-baseline] td { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; min-height: 0; padding: 4px 0; border-top: 0; text-align: left; }
  .igpos-baselines tr[data-baseline] td::before { font-size: var(--a-fs-12); }
  .igpos-baselines tr[data-baseline] td:first-child { grid-column: 1; grid-row: 1; font-size: var(--a-fs-16); font-weight: 600; }
  .igpos-baselines tr[data-baseline] td:first-child::before { display: none; }
  .igpos-baselines tr[data-baseline] td.col-status { grid-column: 2; grid-row: 1; align-items: flex-end; justify-content: center; }
  .igpos-baselines tr[data-baseline]:has(+ .igpos-baseline-note) { border-bottom: 0; border-radius: var(--a-r-2) var(--a-r-2) 0 0; padding-bottom: 0; }
  .igpos-baselines tr.igpos-baseline-note { margin-top: calc(-1 * var(--a-s-3)); padding-top: 0; border-top: 0; border-radius: 0 0 var(--a-r-2) var(--a-r-2); }
  .igpos-baselines tr.igpos-baseline-note td { padding: var(--a-s-1) 0 var(--a-s-2); border-top: 1px solid color-mix(in srgb, var(--a-border) 55%, transparent); text-align: left; justify-content: flex-start; }
}

.igpos-hash { overflow-wrap: anywhere; }
.igpos-grid-zone { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--a-s-2); align-items: end; }
.igpos-grid-zone label { grid-column: 1 / -1; }
@media (max-width: 767px) {
  .igpos-baselines td[data-empty="true"] { display: none; }
  #errors-head { overflow-wrap: anywhere; }
}

/* The coordinates: NATRF2022 and SPCS2022 beside NAD83(2011) and SPCS83, ITRF2020 under them.
   The top border repeats what the eyebrow and badge say. */
.igpos-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a-s-4); }
.igpos-panel { display: flex; flex-direction: column; gap: var(--a-s-3); border-top-width: 4px; border-top-style: solid; min-width: 0; }
.igpos-panel[data-frame="nad83"] { border-top-color: var(--a-ok); }
.igpos-panel[data-frame="itrf"] { border-top-color: var(--a-info); grid-column: 1 / -1; }
.igpos-panel[data-frame="natrf"] { border-top-color: var(--a-neutral); }
.igpos-panel .card-head { margin: 0; }
@media (max-width: 991px) {
  .igpos-panels { grid-template-columns: minmax(0, 1fr); }
}
/* ITRF2020 spans the page under the two US frames: the same values in the same order, two to a
   line, so it reads like them without a third tall column. */
@media (min-width: 992px) {
  .igpos-panel[data-frame="itrf"] .igpos-values { grid-template-columns: repeat(2, 110px minmax(0, 1fr)); column-gap: var(--a-s-5); }
  .igpos-panel[data-frame="itrf"] .igpos-values dt:nth-last-of-type(2):nth-of-type(odd),
  .igpos-panel[data-frame="itrf"] .igpos-values dt:nth-last-of-type(2):nth-of-type(odd) + dd { border-bottom: 0; }
}
/* A switched-off variant stays out of sight whatever display its class sets. */
.igpos-panel [hidden] { display: none !important; }
.igpos-value { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.igpos-variant { display: flex; align-items: center; gap: var(--a-s-2); width: 100%; min-width: 0; }
.igpos-variant > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.igpos-value > .sub { margin-top: 2px; }
.igpos-plane { display: flex; flex-direction: column; gap: var(--a-s-2); border-top: 1px solid var(--a-border); padding-top: var(--a-s-3); }
.igpos-plane h3 { margin: 0; font-size: var(--a-fs-14); }
.igpos-zone { font-weight: 400; color: var(--a-text-2); overflow-wrap: anywhere; }
.igpos-plane .hint { margin: 0; }
.igpos-more-values { display: flex; flex-direction: column; gap: var(--a-s-1); }
.igpos-more-values summary, .igpos-details > summary { display: flex; align-items: center; min-height: 24px; cursor: pointer; font-size: var(--a-fs-13); }
.igpos-more-values summary::before, .igpos-details > summary::before { content: "+"; width: 1.2em; color: var(--a-text-3); }
.igpos-more-values details[open] > summary::before, .igpos-details[open] > summary::before { content: "-"; }
.igpos-more-values p { margin: var(--a-s-1) 0 0; font-size: var(--a-fs-12); overflow-wrap: anywhere; }
.igpos-details h3 { font-size: var(--a-fs-14); margin: var(--a-s-3) 0 var(--a-s-1); }
.igpos-grid-note .banner-text { margin: 0; }
.igpos-grid-zone select { min-height: 44px; width: 100%; max-width: 100%; color: var(--a-text); background: var(--a-panel); border: 1px solid var(--a-border-strong); border-radius: 4px; padding: 8px; font: inherit; }
.igpos-grid-zone select:focus-visible { outline: 3px solid var(--a-focus, currentColor); outline-offset: 3px; }

/* The unit switch: a row of 24 px or larger choices, shown once igpos.js can act on it. */
.igpos-unit-switch { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-s-1); margin: 0; padding: 0; border: 0; }
.igpos-unit-switch:not([data-ready]) { display: none; }
.igpos-unit-switch legend { float: left; margin-right: var(--a-s-2); font-size: var(--a-fs-12); color: var(--a-text-2); }
.igpos-unit-switch label { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; padding: 0 var(--a-s-2); border: 1px solid var(--a-border-strong); border-radius: 999px; font-size: var(--a-fs-13); cursor: pointer; }
.igpos-unit-switch label:has(input:checked) { background: var(--a-selected); border-color: var(--a-accent); font-weight: 600; }
.igpos-unit-switch input { margin: 0; }
.igpos-unit-switch label:has(input:focus-visible) { outline: 2px solid var(--a-focus); outline-offset: 2px; }

/* One value's copy control: an icon beside the value; copy.js writes Copied or Select and copy
   beside the icon, so the outcome is visible as well as announced. */
.igpos-copy { display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex: none; min-width: 24px; min-height: 24px; margin-left: auto; padding: 0 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--a-text-3); font: inherit; font-size: var(--a-fs-12); cursor: pointer; }
.igpos-copy:hover { color: var(--a-text); border-color: var(--a-border); }
.igpos-copy:focus-visible { outline: 2px solid var(--a-focus); outline-offset: 1px; }
.igpos-copy[data-copied] { color: var(--a-ok); }
.igpos-copy [data-copy-label]:empty { display: none; }
.igpos-more-values p .igpos-copy { margin-left: var(--a-s-2); vertical-align: middle; }
[data-print]:not([data-ready]) { display: none; }

/* UI02: the file control is as tall as the antenna select below it, its button and file name
   centred in it. A native file input lays its text on the top edge when given a fixed height. */
.field input[type="file"] { height: auto; min-height: calc(var(--a-ctl-h) + 8px); padding: 6px 8px; line-height: 28px; }
.field input[type="file"]::file-selector-button { margin: 0 var(--a-s-3) 0 0; padding: 0 12px; height: 28px; vertical-align: middle; font: inherit; font-size: var(--a-fs-13); line-height: 26px; color: var(--a-text); background: var(--a-panel); border: 1px solid var(--a-border-strong); border-radius: var(--a-r-1); cursor: pointer; }
@media (pointer: coarse) {
  .field input[type="file"] { min-height: 48px; padding-block: 9px; }
}

/* Print, and Save as PDF from the print dialog: the result as a document. The answer and its
   standing first, every value in the chosen units; controls, navigation and switched-off
   variants left out; igpos.js opens the details areas for the print and closes them after. */
@media print {
  .side, .topbar, .tabbar, nav, .admin-back, .igpos-unit-switch, .igpos-copy, .igpos-grid-zone,
  .igpos-frame-foot > .btn, .igpos-actions, .igpos-run-actions, .igpos-downloads, [data-print],
  form, dialog { display: none !important; }
  .igpos-run-body { grid-template-columns: minmax(0, 1fr) !important; }
  .igpos-panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.app { display: block; }
  .content { margin: 0; padding: 0; max-width: none; }
  .igpos-panel, .card { break-inside: avoid; box-shadow: none; }
  .igpos-values .igpos-key { background: #eef1f5; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; color: #000; }
}

/* The run's card: what was uploaded on the left, the downloads of a finished report on the right
   where they are the first thing to grab. One column on a narrow screen, info first. */
.igpos-run-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a-s-4) var(--a-s-6); }
.igpos-run-info { display: flex; flex-direction: column; gap: var(--a-s-2); min-width: 0; }
.igpos-run-info > .sub { margin: 0; }
.igpos-run-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--a-s-2); margin-top: auto; padding-top: var(--a-s-2); }
.igpos-downloads { display: flex; flex-direction: column; gap: var(--a-s-3); min-width: 0; padding-top: var(--a-s-4); border-top: 1px solid var(--a-border); }
.igpos-downloads h3 { margin: 0; font-size: var(--a-fs-14); }
.igpos-downloads .hint { margin: 0; }
.igpos-download-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--a-s-2); }
@media (max-width: 479px) { .igpos-download-list { grid-template-columns: minmax(0, 1fr); } }
.igpos-download-list .btn { justify-content: flex-start; }
.igpos-email { display: flex; flex-wrap: wrap; align-items: center; gap: var(--a-s-2) var(--a-s-3); }
.igpos-email-status { margin: 0; font-size: var(--a-fs-13); color: var(--a-text-2); overflow-wrap: anywhere; }
.igpos-email-status[data-tone] { padding: 2px var(--a-s-2); border-radius: var(--a-r-1); color: var(--a-text); }
.igpos-email-status[data-tone="ok"] { background: var(--a-ok-tint); }
.igpos-email-status[data-tone="bad"] { background: var(--a-bad-tint); }
.igpos-email-status[data-tone="neutral"] { background: var(--a-neutral-tint); }
@media (min-width: 992px) {
  .igpos-run-body:has(> .igpos-downloads) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .igpos-downloads { padding: 0 0 0 var(--a-s-5); border-top: 0; border-left: 1px solid var(--a-border); }
}

/* Deleting a run: the log row's quiet control, the dialog, and the no-script confirm page. */
.igpos-col-actions { width: 1%; white-space: nowrap; text-align: right; }
/* When and Session keep to one line where the table has the room, so a row stays one line tall;
   narrower, they wrap rather than push the table wider than its card. */
@media (min-width: 1200px) {
  .igpos-nowrap { white-space: nowrap; }
}
/* Quiet until pointed at: a column of red links would shout over the results. */
.row-link a.igpos-row-delete, .igpos-row-delete { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--a-s-1); color: var(--a-text-2); font-size: var(--a-fs-13); font-weight: 400; }
.row-link a.igpos-row-delete:hover, .row-link a.igpos-row-delete:focus-visible { color: var(--a-bad-ink); text-decoration: underline; }
.row-link a.igpos-row-delete::after { content: none; }
.igpos-confirm { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--a-s-2); }
/* The app's dialog, its padding moved onto the form so a click on the dialog itself is a click
   outside the question. */
.igpos-dialog { padding: 0; }
.igpos-dialog form { padding: var(--a-s-5); }
.igpos-dialog h2 { margin: 0 0 var(--a-s-2); font-size: var(--a-fs-16); }
.igpos-dialog p { margin: 0; color: var(--a-text-2); overflow-wrap: anywhere; }
@media (max-width: 767px) {
  .table tr td.igpos-col-actions, .table tr.row-link td.igpos-col-actions { justify-content: flex-end; width: auto; }
  .row-link td.igpos-col-actions a { font-size: var(--a-fs-13); font-weight: 400; }
  .table td.igpos-col-actions:empty { display: none; }
}

/* The antenna search: an input over a list, built by igpos.js from the select it replaces. */
.igpos-combo { position: relative; }
.field .igpos-combo-input { width: 100%; padding-right: 40px; }
.igpos-combo-input::placeholder { font-family: var(--a-font); color: var(--a-text-3); }
.igpos-combo-toggle { position: absolute; top: 50%; right: 4px; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--a-text-2); background: transparent; border: 0; border-radius: var(--a-r-1); transform: translateY(-50%); cursor: pointer; }
.igpos-combo-toggle:hover { background: var(--a-selected); }
.igpos-combo-list { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; right: 0; max-height: min(320px, 50vh); margin: 0; padding: var(--a-s-1) 0; overflow-y: auto; background: var(--a-raised); border: 1px solid var(--a-border-strong); border-radius: var(--a-r-1); box-shadow: var(--a-shadow-2); }
.igpos-combo-group-name { padding: var(--a-s-2) var(--a-s-3) 2px; font-size: var(--a-fs-12); font-weight: 600; color: var(--a-text-3); }
.igpos-combo-option { padding: 6px var(--a-s-3); min-height: 32px; font-family: var(--a-font-mono); font-size: var(--a-fs-13); cursor: pointer; overflow-wrap: anywhere; }
.igpos-combo-option[data-pinned] { font-family: var(--a-font); }
.igpos-combo-option:hover { background: var(--a-selected); }
.igpos-combo-option[aria-selected="true"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--a-accent); }
.igpos-combo-option[data-active] { background: var(--a-selected); outline: 2px solid var(--a-focus); outline-offset: -2px; }
.igpos-combo-empty { padding: var(--a-s-2) var(--a-s-3); font-size: var(--a-fs-13); color: var(--a-text-2); }

/* PRIDE PPP-AR. A backup's frame cards are a result's own; the tag beside each frame's status
   says whose position it is, quietly, because the banner over the page already said it. */
.igpos-frame-tags { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--a-s-1) var(--a-s-2); }
.igpos-source-tag { font-weight: 400; }
.igpos-how > summary { display: flex; align-items: center; min-height: 24px; cursor: pointer; font-size: var(--a-fs-13); }
.igpos-how > summary::before { content: "+"; width: 1.2em; color: var(--a-text-3); }
.igpos-how[open] > summary::before { content: "-"; }
.igpos-how > .kv, .igpos-how > .igpos-list { margin-top: var(--a-s-2); }
.igpos-how li { overflow-wrap: anywhere; font-size: var(--a-fs-12); }
/* The check: its state, then the difference beside PRIDE's own coordinates. */
/* A backup's solution quality is the same rows in a card of its own. */
.igpos-secondary, .igpos-quality { display: flex; flex-direction: column; gap: var(--a-s-3); }
.igpos-secondary > p, .igpos-secondary h3 { margin: 0; }
.igpos-secondary h3 { font-size: var(--a-fs-14); margin-bottom: var(--a-s-1); }
.igpos-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--a-s-4); }
.igpos-secondary dd { overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .igpos-secondary-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
