/* ============================================================
   sample-submittal.css — the Submittal Samples flow (#293, #323)

   Page-local chrome for the guided sample-capture flow, rendered into #ssRoot by
   frontend/js/sample-submittal.js. Lived inline in sample-submittal.html until
   that page was merged into the Upload Tool as its "Samples" tab (#323 point 4);
   moved here so the Upload Tool can load it without inlining ~130 lines.

   Phone-first on purpose (#293: this tool is used standing next to a delivery):
   the single-column stack IS the base layout and the desktop grid is the
   enhancement. Tap targets and 16px inputs come from the shared MOBILE
   FOUNDATION block in styles.css.
   ============================================================ */

.ss-page { flex: 1; overflow: auto; padding: 16px 14px 72px; background: var(--bg); }
.ss-wrap { max-width: 900px; margin: 0 auto; }
.ss-gate { max-width: 560px; margin: 56px auto; text-align: center; color: var(--muted); font-size: 14px; }
.ss-gate h2 { color: var(--heading); font-size: 18px; margin-bottom: 8px; }

.ss-tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line-dk); margin-bottom: 16px; }
.ss-tab { flex: 1; font-size: var(--fs-base); font-weight: 600; padding: 11px 8px; border: none; background: none;
          color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1.5px; }
.ss-tab.on { color: var(--accent); border-bottom-color: var(--accent); }

/* A step card, so the flow reads as the steps the request describes. */
.ss-step { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
           padding: 15px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.ss-step.done { border-color: var(--ok-line); }
.ss-step.locked { opacity: .55; }
.ss-step h3 { font-size: 13.5px; font-weight: 700; color: var(--heading); margin: 0 0 4px;
              display: flex; align-items: center; gap: 8px; }
.ss-n { display: inline-flex; align-items: center; justify-content: center; width: 21px; height: 21px;
        border-radius: 50%; background: var(--tint); color: var(--muted); font-size: var(--fs-sm); flex: none; }
.ss-step.done .ss-n { background: var(--ok-fill); color: var(--ok-ink); }
.ss-hint { font-size: var(--fs-md); color: var(--muted); margin: 0 0 12px; }

.ss-form { display: grid; grid-template-columns: 1fr; gap: 11px; }
@media (min-width: 620px) { .ss-form { grid-template-columns: 1fr 1fr; } .ss-field.wide { grid-column: 1 / -1; } }
.ss-field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.ss-field input, .ss-field select, .ss-field textarea {
  font-size: 16px; font-weight: 400; padding: 10px 11px; border-radius: 8px;
  border: 1px solid var(--line-dk); background: var(--surface-2); color: var(--ink); width: 100%; }

/* Type-to-search combobox (shared behaviour in js/combobox.js). Sizing tracks
   the fields above — 16px input to stop iOS zoom, 44px-ish tap target. The
   dropdown is absolutely positioned, so .ss-combo is the positioning context;
   .ss-field is overflow-visible by default, so the list is free to overhang. */
.ss-combo { position: relative; }
.ss-combo-input { font-size: 16px; font-weight: 400; padding: 10px 11px; border-radius: 8px;
  border: 1px solid var(--line-dk); background: var(--surface-2); color: var(--ink); width: 100%; }
.ss-combo-input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ss-combo-dd { display: none; position: absolute; top: calc(100% + 3px); left: 0; right: 0; z-index: 30;
  background: var(--surface); border: 1px solid var(--line-dk); border-radius: 8px; max-height: 244px;
  overflow-y: auto; box-shadow: var(--shadow-lg); }
.ss-combo-item { padding: 11px; font-size: 14px; cursor: pointer; color: var(--ink);
  border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ss-combo-item:last-child { border-bottom: none; }
.ss-combo-item.active, .ss-combo-item:hover { background: var(--accent-solid); color: #fff; }
.ss-combo-empty { padding: 11px; font-size: var(--fs-base); color: var(--muted); font-style: italic; }

/* #323 point 3 — the "New number" / "From existing draft" source toggle. */
.ss-segmented { display: inline-flex; border: 1px solid var(--line-dk); border-radius: 9px;
  overflow: hidden; margin-bottom: 12px; }
.ss-seg { font-size: 12.5px; font-weight: 600; padding: 9px 14px; min-height: 40px; border: none;
  background: var(--surface-2); color: var(--muted); cursor: pointer; }
.ss-seg + .ss-seg { border-left: 1px solid var(--line-dk); }
.ss-seg.on { background: var(--accent-solid); color: #fff; }

.ss-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.ss-btn { font-size: 14px; font-weight: 600; padding: 11px 16px; border-radius: 9px; min-height: 44px;
  border: 1px solid var(--line-dk); background: var(--surface); color: var(--ink); cursor: pointer; }
.ss-btn:disabled { opacity: .5; cursor: default; }
/* --accent behind white text is 4.17:1 light / 2.74:1 dark; --accent-solid is
   the deeper copper that carries #fff at AA (#F14). */
.ss-btn-primary { background: var(--accent-solid); border-color: var(--accent-solid); color: #fff; }
.ss-btn-primary:hover { background: var(--accent-solid-hover); border-color: var(--accent-solid-hover); }
.ss-btn-wide { flex: 1 1 180px; }
.ss-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.ss-link:hover { text-decoration: underline; }

.ss-num { font-size: 26px; font-weight: 700; color: var(--heading); letter-spacing: .01em; }
.ss-meta { font-size: var(--fs-md); color: var(--muted); margin-top: 2px; }
.ss-meta a { color: var(--accent); font-weight: 600; text-decoration: none; }
.ss-meta a:hover { text-decoration: underline; }

/* Photo grid mirrors the 2x2 the packaged PDF produces, so what you see on
   the phone is the page order you get. */
.ss-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.ss-photo { position: relative; aspect-ratio: 1 / 1; border-radius: 9px; overflow: hidden;
            border: 1px solid var(--line-dk); background: var(--surface-2); }
.ss-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ss-photo .rm { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; font-size: var(--fs-lg); cursor: pointer; line-height: 30px; }
.ss-photo .ix { position: absolute; bottom: 4px; left: 5px; font-size: var(--fs-xs); color: #fff;
  background: rgba(0,0,0,.6); border-radius: var(--radius-sm); padding: 1px 6px; }
.ss-file { display: none; }

table.ss-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ss-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 9px;
  border-bottom: 1.5px solid var(--line-dk); white-space: nowrap; }
.ss-table td { padding: 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ss-empty { color: var(--muted); font-size: 12.5px; padding: 18px 4px; }

.badge { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 11px; border: 1px solid var(--line-dk); }
/* Status colours come from the --ok/--info/--warn/--danger tokens (#F13), so
   these flip with the theme instead of staying pale-on-pale in dark mode. */
.badge.printed, .badge.online, .badge.uploaded { background: var(--ok-fill); border-color: var(--ok-line); color: var(--ok-ink); }
.badge.sent, .badge.queued { background: var(--info-fill); border-color: var(--info-line); color: var(--info-ink); }
.badge.pending, .badge.offline, .badge.unpaired { background: var(--warn-fill); border-color: var(--warn-line); color: var(--warn-ink); }
.badge.failed, .badge.revoked, .badge.cancelled { background: var(--danger-fill); border-color: var(--danger-line); color: var(--danger-ink); }

.ss-note { background: var(--info-fill); border: 1px solid var(--info-line); color: var(--info-ink);
           border-radius: 9px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.ss-note a { color: inherit; font-weight: 700; }
.ss-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 27px; font-weight: 700;
           letter-spacing: .18em; color: var(--accent); margin: 12px 0; }
.ss-modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex;
            align-items: center; justify-content: center; z-index: 90; padding: 18px; }
.ss-modal-card { background: var(--surface); border-radius: 13px; padding: 20px; max-width: 420px;
                 width: 100%; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.3); }
.ss-modal-card h3 { margin: 0 0 6px; font-size: var(--fs-lg); color: var(--heading); }
.ss-bar { height: 5px; border-radius: 3px; background: var(--tint); overflow: hidden; margin-top: 10px; }
.ss-bar i { display: block; height: 100%; background: var(--accent-solid); width: 0; transition: width .2s; }
.hidden { display: none !important; }
/* #a11y: the toast is a live region, and a live region inside display:none is
   not in the accessibility tree at all. styles.css clips it instead of hiding
   it; restated here to get past the !important above (upload.html). */
.toast.hidden { display: block !important; opacity: 0; pointer-events: none; clip-path: inset(50%); }

/* #323 point 2 — the live camera capture dialog. The viewfinder fills the card;
   controls sit under it. Sized so it works one-handed on a phone. */
.ss-cam-card { max-width: 560px; }
.ss-cam-stage { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh;
  background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.ss-cam-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ss-cam-count { margin-top: 10px; }
.ss-cam-actions { justify-content: center; }

@media (max-width: 640px) {
  /* A 5-6 column roster row cannot fit sideways on a phone, and letting
     .table-scroll squeeze it renders one word per line. This is the shared
     STACKED-CARD treatment (see frontend-core.md's mobile foundation): each
     row becomes a card and each cell prints its own label from the data-th
     the JS emits. The first cell carries no data-th and reads as the title —
     so a cell added without one shows up unlabelled here. */
  table.ss-table, .ss-table tbody, .ss-table tr, .ss-table td { display: block; width: 100%; }
  .ss-table thead { display: none; }
  .ss-table tr { border: 1px solid var(--line); border-radius: 9px;
    margin-bottom: 10px; background: var(--surface-2); padding: 6px 0; }
  .ss-table tbody tr:last-child { margin-bottom: 0; }
  .ss-table td { border-bottom: none; padding: 4px 12px; }
  /* The un-labelled first cell is the card's title. */
  .ss-table td:first-child { font-size: 14px; padding-top: 6px; }
  .ss-table td[data-th] { display: flex; align-items: baseline; gap: 10px; }
  .ss-table td[data-th]::before { content: attr(data-th); flex: 0 0 84px;
    font-size: var(--fs-2xs); font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; color: var(--muted); }
  /* An empty data-th is the actions cell: its buttons need the full width,
     not an 84px label gutter. */
  .ss-table td[data-th=""] { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
  .ss-table td[data-th=""]::before { content: none; }
  .ss-table .ss-btn { min-height: 40px; }
}
