/* ============================================================================
   app/app.css — the Jagter app's screen styles, translated from the ruled design
   corpus (design/intake-*.html + design/quarry-*.html). The tokens and primitives
   come from brand/jagter-theme.css (locked); everything here is layout + the
   screen-local classes the mockups defined. One responsive codebase:
   ≥900px = top nav + two-column layouts, <900px = phone list + tab bar,
   Confirm hidden below 900px by device doctrine.
   ============================================================================ */

html, body { margin: 0; padding: 0; min-height: 100%; }
/* display rules below would otherwise beat the UA's [hidden] — make hidden absolute */
[hidden] { display: none !important; }

/* ---- auth gate ---- */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.gate-card { width: 100%; max-width: 400px; box-sizing: border-box; padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.gate-mark { height: 56px; width: auto; align-self: center; margin-bottom: 6px; }
.gate-card form { display: flex; flex-direction: column; gap: 12px; }
.gate-card .jg-input { min-height: 48px; box-sizing: border-box; font-size: 15px; }
.gate-note { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.55; }
.gate-error { margin: 0; font-size: 12.5px; color: var(--sev-crit); line-height: 1.5; }
.code-box { font-family: var(--mono); font-weight: 500; font-size: 22px; letter-spacing: .35em; text-align: center; }
.enroll-qr { align-self: center; background: #fff; border-radius: var(--r); padding: 10px; line-height: 0; }
.enroll-qr svg, .enroll-qr img { width: 190px; height: 190px; }
#enroll-secret { font-size: 11px; word-break: break-all; color: var(--sand-lt); }

/* ---- shell chrome ---- */
.shell { max-width: 1200px; margin: 0 auto 60px; padding: 0 16px; }
header.top { display: flex; align-items: center; gap: 28px; padding: 16px 0 14px; border-bottom: 1px solid var(--line); }
header.top img { height: 40px; width: auto; }
nav.areas { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav.areas a { text-decoration: none; color: var(--dim); font: 600 12px/1 var(--display); letter-spacing: .12em;
  text-transform: uppercase; padding: 12px 14px; border-radius: var(--r-sm); }
nav.areas a[aria-current] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
nav.areas a:hover { color: var(--sand-lt); }
.signout { background: transparent; border: 1px solid var(--line); color: var(--dim); border-radius: var(--r-sm);
  padding: 8px 12px; font: 600 11px/1 var(--ui); cursor: pointer; }
.signout:hover { color: var(--sand); border-color: var(--sand); }

nav.tabs { display: none; }

@media (max-width: 899px) {
  .shell { padding: 0 12px calc(72px + env(safe-area-inset-bottom)); }
  header.top { gap: 12px; }
  nav.areas, .signout { display: none; }
  nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
    border-top: 1px solid var(--line); background: var(--panel);
    padding-bottom: env(safe-area-inset-bottom); }
  nav.tabs a { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; text-decoration: none; color: var(--dim);
    font: 600 9.5px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
  nav.tabs a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round; }
  nav.tabs a[aria-current] { color: var(--accent); }
}

/* ---- shared screen bits ---- */
main { display: block; padding-top: 20px; }
.stub { padding: 40px 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stub p { margin: 0; font-size: 13px; color: var(--dim); line-height: 1.6; max-width: 52ch; }
.load-note { padding: 24px 4px; font-size: 12.5px; color: var(--dim); }
.err-note { padding: 24px 4px; font-size: 12.5px; color: var(--sev-crit); }
.more { width: 100%; background: transparent; border: 1px dashed var(--line); border-radius: var(--r-sm);
  min-height: 44px; color: var(--sand); font: 600 12px/1 var(--ui); cursor: pointer; margin-top: 14px; }

/* ---- Intake (from design/intake-desktop.html + intake-phone.html) ---- */
.in-grid { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
@media (max-width: 899px) { .in-grid { grid-template-columns: 1fr; } }
.in-left { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 900px) { .in-left { position: sticky; top: 16px; } }

.cap { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cap textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 132px; font-size: 14px; line-height: 1.5; }
select.jg-input { appearance: none; -webkit-appearance: none; width: 100%; box-sizing: border-box; min-height: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--sand) 50%), linear-gradient(135deg, var(--sand) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.cap .jg-input { min-height: 44px; box-sizing: border-box; }
.btn-cap { width: 100%; min-height: 48px; font-size: 13px; }

.feeds { display: flex; align-items: center; gap: 10px; padding: 11px 12px; }
.feeds p { margin: 0; font-size: 11.5px; color: var(--dim); line-height: 1.5; flex: 1; }

.stream { display: flex; flex-direction: column; gap: 12px; }
.stream-hd { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px; }
.stream-hd .n { font-size: 12px; color: var(--dim); }
.card { padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta .src { font-family: var(--mono); font-size: 10.5px; color: var(--sand); background: var(--panel);
  border: 1px solid var(--line); border-radius: 3px; padding: 2px 7px; }
.meta .t { font-size: 11px; color: var(--dim); margin-left: auto; }
.pill-lead { background: transparent; color: var(--dim); border-color: var(--line); }
.card h3 { margin: 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--bone); }
.card .sub { font-size: 12px; color: var(--dim); line-height: 1.5; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--mono); font-size: 11px; color: var(--sand-lt); background: var(--panel);
  border: 1px solid var(--line); border-radius: 3px; padding: 3px 8px; }
.chip b { font-family: var(--ui); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--dim);
  text-transform: uppercase; margin-right: 5px; }
.foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.foot .sub { flex: 1; min-width: 160px; }
.foot .jg-btn { min-height: 40px; }
.jg-btn--quiet { background: transparent; border: 1.5px solid var(--line); color: var(--dim); }

/* ---- Quarry (from design/quarry-desktop.html + quarry-phone.html) ---- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 4px; }
.toolbar .jg-input { min-height: 44px; box-sizing: border-box; flex: 1; min-width: 220px; }
.chips-f { display: flex; gap: 6px; flex-wrap: wrap; }
.chips-f button { white-space: nowrap; min-height: 40px; padding: 0 14px; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font: 600 11.5px/1 var(--ui); cursor: pointer; }
.chips-f button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.tally { font-size: 11.5px; color: var(--dim); margin: 6px 0 0; line-height: 1.5; }

.sec { display: flex; align-items: center; gap: 10px; padding: 16px 2px 8px; }
.sec .n { font-size: 12px; color: var(--dim); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
@media (max-width: 899px) { .grid2 { grid-template-columns: 1fr; } }

.q-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.top2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top2 h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--bone); flex: 1; }
.tag { font-family: var(--display); font-size: 9.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-radius: 3px; padding: 3px 8px; border: 1px solid transparent; }
.tag-warm { color: var(--sand); border-color: var(--sand); background: transparent; }
.tag-camp { color: var(--dim); border-color: var(--line); background: var(--panel); }
.counts { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--sand-lt); display: flex; gap: 10px; flex-wrap: wrap; }
.counts .slug { color: var(--sand); background: var(--panel); border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 7px; font-size: 10.5px; }
.gap-line { margin: 0; font-size: 12px; line-height: 1.55; color: var(--dim); }
.gap-line b { color: var(--bone); font-weight: 600; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.runs-btn { min-height: 40px; padding: 0 14px; background: transparent; border: 1.5px solid var(--line);
  border-radius: var(--r-sm); color: var(--dim); font: 600 11.5px/1 var(--ui); cursor: pointer; }
