/* My Pet Air Travel vendor portal: what this site needs that the operator console's stylesheet does not have.
   style.css is a byte-identical copy of the console's and is loaded first; this file only adds to it, using its variables.
   Outside a media query nothing here may re-style a rule style.css already has (a test checks the selectors). Inside the one
   narrow-screen query below it may adapt console rules for a phone; it never changes the desktop. */

/* The answer form shows and hides whole fields, boxes and panels with the hidden attribute. */
[hidden] { display: none !important; }

/* A way past the shell for keyboard users, and no ring on a heading that script moves focus to after a page change. */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 20; padding: 8px 14px; background: #fff; color: var(--ink); border-radius: 6px; font-weight: 600; }
.skip-link:focus { top: 8px; }
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus, #app:focus { outline: none; }

/* The service-status note in the top bar is a chip that may wrap, so a long message stays on a narrow screen. */
.chip-wrap { white-space: normal; }
ul.chip-row { list-style: none; padding: 0; }

/* The terms: a readable line length. */
.terms-text { max-width: 75ch; }

/* The note box on the answer form: a text area that looks like the console's other controls. */
.field textarea { width: 100%; min-width: 0; min-height: 96px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; font: inherit; color: inherit; line-height: 1.45; resize: vertical; }
.field textarea:focus { border-color: var(--focus); }
.has-error textarea { border-color: var(--danger); background: #fff8f7; }

/* The answer options: radio buttons with a line of help under each label. (Plain check boxes use the console's .check.) */
.choices { display: flex; flex-direction: column; gap: 4px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.choice:hover { background: var(--sunk); }
.choice input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); }
.choice-text { display: flex; flex-direction: column; }
.choice-label { font-weight: 600; }

/* ---- a phone: the rail becomes a compact top bar, tables become stacked cards, controls get easy to hit ---- */
@media (max-width: 760px) {
  #shell { grid-template-rows: auto minmax(0, 1fr); }
  #rail { justify-content: space-between; padding: 10px 12px 0; gap: 4px 12px; }
  body:has(#local-dev-bar) #rail { height: auto; padding-bottom: 0; }
  .brand { order: 1; }
  #who { order: 2; min-width: 0; padding: 0; gap: 8px; }
  .who-role { overflow-wrap: anywhere; }
  #who .btn { min-height: 36px; padding: 0 8px; }
  #navigation { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px; }
  .nav-link { flex: none; white-space: nowrap; min-height: 44px; padding: 0 12px; border-left: 0; border-bottom: 3px solid transparent; border-radius: 6px 6px 0 0; }
  .nav-link[aria-current="page"] { border-bottom-color: #f0b44c; }
  #simulated-banner { border-radius: 14px; }

  .page-header { flex-wrap: wrap; align-items: flex-start; }
  .page-actions { flex-wrap: wrap; }
  .btn, .btn-small { min-height: 44px; }
  .field input, .field select { min-height: 44px; font-size: 16px; }
  .field textarea { font-size: 16px; }
  .form-actions .btn { flex: 1 1 auto; }
  .check input, .choice input { width: 20px; height: 20px; }

  .table-wrap { overflow: visible; border: 0; background: none; }
  .card > .table-wrap { margin: 0; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table tbody { display: flex; flex-direction: column; gap: 12px; }
  .table tbody tr { border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 12px; background: var(--panel); }
  .table td { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .table td::before { content: attr(data-label); flex: 0 0 104px; font-size: 12px; font-weight: 600; color: var(--muted); }
  .table td.num { text-align: left; }
  .table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
  .table tbody tr td:last-child { border-bottom: 0; }
  .row-actions { flex-direction: row; flex-wrap: wrap; }
}
