/* Tonaut — the TestFlight report page (testing/index.html) only, on top of main.css: the same dark palette, the
   same one red (#D8261C), the same header, hero and footer as every other page, and the same content width.

   Built for a phone first: every control is at least 44 px tall, every field's text is 16 px (iOS zooms into any
   smaller field it focuses), and the fields share a row only when there is room. */

.tst { padding-bottom: clamp(20px, 3vw, 40px); }
/* The content width of every other page: the header's and footer's measure. */
.tst-wrap { max-width: var(--measure); margin: 0 auto; padding-inline: var(--gutter); }

.tst-sec { padding-top: clamp(56px, 6vw, 88px); }
.tst-sec[hidden], .tst-report[hidden] { display: none; }
.tst-sec h2 {
  margin: 0 0 clamp(14px, 1.6vw, 20px);
  font-variation-settings: 'wdth' 125; font-weight: 600; font-size: clamp(28px, 3.6vw, 52px);
  line-height: .98; letter-spacing: .035em; text-transform: uppercase; text-wrap: balance;
}
.tst-count { margin-left: auto; font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--ink-3); }
.tst-hint { margin: 10px 0 0; font-size: 14px; line-height: 1.55; color: var(--ink-3); text-wrap: pretty; }
.tst-hint--sec { margin: 0 0 24px; font-size: clamp(15px, 1.1vw, 16.5px); }
.tst-hint a, .tst-note a { color: var(--ink); border-bottom: 1px solid var(--red); }
.tst-note {
  margin: 0 0 18px; padding: 16px 20px; border-radius: 18px; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--rule); font-size: 15px; line-height: 1.55; color: var(--ink-2);
}
.tst noscript .tst-note { margin-top: 32px; }

/* ---------- fields ---------- */

.tst-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 22px 24px; }

.fld { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.fld__label, .fld legend {
  padding: 0; font-weight: 600; font-variation-settings: 'wdth' 118;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase; line-height: 1.3; color: var(--ink);
}
.fld legend { margin-bottom: 8px; }
.fld__opt { color: var(--ink-3); font-weight: 500; letter-spacing: .08em; text-transform: none; font-size: 12px; margin-left: 6px; }
.fld__hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.fld__err { margin: 0; font-size: 13px; line-height: 1.45; color: var(--red); font-weight: 600; }
.fld__err:empty { display: none; }

.inp {
  width: 100%; min-height: 50px; padding: 12px 16px;
  border: 0; border-radius: 14px; background: var(--surface); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
  font: inherit; font-size: 16px; line-height: 1.35;
  -webkit-appearance: none; appearance: none; transition: box-shadow .2s;
}
.inp::placeholder { color: var(--ink-4); }
.inp:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.inp:focus, .inp:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--red); }
.inp[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--red); }
.inp--num, .inp--code { font-family: var(--mono); font-weight: 500; font-size: 16px; }
.inp--code { letter-spacing: .08em; text-transform: uppercase; }
textarea.inp { min-height: 110px; resize: vertical; }
textarea.inp--long { min-height: 150px; }
select.inp {
  padding-right: 44px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
select.inp:invalid { color: var(--ink-4); }
select.inp option { background: var(--surface); color: var(--ink); }

/* Choices: real radio buttons, each the whole size of its pill, so a tap anywhere on it (or VoiceOver's touch)
   lands on the input itself. Selected reads as the home page's selected tab: light fill, dark type. */
.chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chips--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 40em) {
  .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chips--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chips--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 50%; }
}
@media (min-width: 72em) { .chips:not(.chips--2):not(.chips--3):not(.chips--4) { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.chip { position: relative; display: flex; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  flex: 1; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 48px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--rule);
  font-size: 14px; line-height: 1.2; color: var(--ink-2); text-wrap: balance;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.chip:hover input:not(:checked) + span { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.chip input:checked + span { background: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--bg); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 2px; }
.fld[data-invalid] .chip span { box-shadow: inset 0 0 0 1px var(--red); }

/* ---------- buttons: pills, as on the rest of the site ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px; border: 0;
  font-family: var(--sans); font-weight: 600; font-variation-settings: 'wdth' 118;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; line-height: 1.2;
  cursor: pointer; -webkit-tap-highlight-color: transparent; text-decoration: none;
  transition: background-color .2s, box-shadow .2s, color .2s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
/* Continue, Done and Start the next report: the light pill. (testing.js still names it btn--dark.) */
.btn--dark, .btn--light { background: var(--ink); color: var(--bg); }
.btn--dark:hover:not(:disabled), .btn--light:hover:not(:disabled) { background: #fff; }
.btn--line { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); }
.btn--line:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn--quiet { background: none; color: var(--ink-3); padding: 0 8px; letter-spacing: .1em; }
.btn--quiet:hover { color: var(--red); }
.btn--send { width: 100%; min-height: 56px; background: var(--red); color: #fff; font-size: 13px; }
.btn--send:hover:not(:disabled) { box-shadow: 0 0 0 4px rgba(var(--red-rgb), .28); }
.btn--add {
  width: 100%; min-height: 60px; margin-top: 14px; border-radius: 28px;
  background: transparent; border: 1px dashed var(--line-2); color: var(--ink);
}
.btn--add:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface); }
.btn__plus { font-family: var(--mono); font-size: 18px; line-height: 1; font-weight: 500; color: var(--red); }
@media (min-width: 40em) { .btn--send { width: auto; min-width: 280px; } }

/* ---------- an issue card ---------- */

.issues { display: flex; flex-direction: column; gap: 14px; }
.issue {
  background: var(--surface); border-radius: 28px; box-shadow: inset 0 0 0 1px var(--rule);
  scroll-margin-top: 76px; transition: box-shadow .2s;
}
.issue[data-bad] { box-shadow: inset 0 0 0 1px var(--red); }
.issue__head { margin: 0; font: inherit; }
.issue__toggle {
  all: unset; box-sizing: border-box; width: 100%; min-height: 64px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) 24px; align-items: center; gap: 16px;
  padding: 14px 22px 14px 24px; cursor: pointer; border-radius: 28px;
  -webkit-tap-highlight-color: transparent;
}
.issue__toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.issue__no { font-family: var(--mono); font-weight: 600; font-size: 20px; line-height: 1; color: var(--red); }
.issue__sum { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.issue__kind { font-weight: 600; font-variation-settings: 'wdth' 118; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.issue__kind b { color: var(--red); font-weight: 600; }
.issue__title { font-size: 16px; line-height: 1.3; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.issue__title:empty::before { content: "New issue"; color: var(--ink-3); font-weight: 500; }
.issue__chev { justify-self: end; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--out); }
.issue[data-open] .issue__chev { transform: translateY(2px) rotate(-135deg); }
/* Columns with a gap rather than margins, so a hidden group or an empty message leaves no hole. */
.issue__body { display: flex; flex-direction: column; gap: 24px; padding: 22px 24px 24px; border-top: 1px solid var(--rule); }
.issue__body[hidden] { display: none; }
.issue__group { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; border-top: 1px dashed var(--rule); }
.issue__group[hidden] { display: none; }
.issue__group > .fld__hint { margin-bottom: -8px; }
.issue__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.issue__foot .btn--dark { min-width: 130px; }
.issue__msg { margin: 0; font-size: 13px; line-height: 1.45; color: var(--red); font-weight: 600; }
.issue__msg:empty { display: none; }

/* ---------- attachments ---------- */

.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files:empty { display: none; }
.file {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) 44px; align-items: center; gap: 12px;
  padding: 6px 4px 6px 6px; background: var(--bg); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--rule);
}
.file__thumb {
  width: 52px; height: 52px; border-radius: 11px; overflow: hidden; background: #000;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-family: var(--mono); font-size: 9px; font-weight: 600;
}
.file__thumb img { width: 100%; height: 100%; object-fit: cover; }
.file__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file__name { font-size: 14px; line-height: 1.3; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file__meta { font-size: 12px; line-height: 1.35; color: var(--ink-3); }
.file[data-state="failed"] .file__meta, .file[data-state="lost"] .file__meta,
.file[data-state="blocked"] .file__meta, .file[data-state="toolarge"] .file__meta { color: var(--red); font-weight: 600; }
.file__bar { height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; margin-top: 3px; }
.file__bar i { display: block; height: 100%; width: 0; background: var(--red); transition: width .2s linear; }
.file__x {
  all: unset; box-sizing: border-box; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; cursor: pointer; color: var(--ink-3);
}
.file__x:hover { color: var(--red); }
.file__x:focus-visible { outline: 2px solid var(--red); }
.file__x svg { width: 14px; height: 14px; }
.file__retry {
  all: unset; box-sizing: border-box; align-self: flex-start; display: inline-flex; align-items: center;
  min-height: 44px; min-width: 44px; padding: 0 12px; margin: -6px 0 -6px -12px;
  cursor: pointer; color: var(--ink); font-size: 13px; font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
}
.file__retry:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.files + .btn { margin-top: 10px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- send, sent, gate ---------- */

.tst-send { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding-top: 6px; }
@media (min-width: 40em) { .tst-send { align-items: flex-start; } }
.tst-sum { margin: 0; font-size: clamp(16px, 1.15vw, 17.5px); line-height: 1.55; color: var(--ink-2); }
.tst-sum b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.tst-status { margin: 0; min-height: 1.5em; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.tst-status[data-state="error"] { color: var(--red); font-weight: 600; }
.tst-status[data-state="sending"] { color: var(--ink-3); }
.tst-saved { margin: 0; font-size: 12px; color: var(--ink-3); font-family: var(--mono); font-weight: 500; }
.tst-saved:empty { display: none; }
.tst-trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
/* Read by VoiceOver, not shown. */
.tst-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.tst-done, .tst-gate {
  background: var(--surface); border-radius: 28px; box-shadow: inset 0 0 0 1px var(--rule);
  padding: clamp(24px, 3.4vw, 44px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
}
.tst-gate h2 { margin: 0; font-size: clamp(24px, 2.6vw, 36px); }
.tst-gate .tst-hint { margin: 0; font-size: 15px; }
.tst-gate .fld { width: 100%; max-width: 380px; margin-top: 4px; }
.tst-done__label {
  margin: 0; display: flex; align-items: center; gap: 10px; color: var(--red);
  font-variation-settings: 'wdth' 118; font-weight: 600; font-size: 11px; letter-spacing: .24em; text-transform: uppercase;
}
.tst-done__label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); flex: none; }
.tst-done__title {
  margin: 0; font-variation-settings: 'wdth' 125; font-weight: 600; font-size: clamp(28px, 3.6vw, 52px);
  line-height: .98; letter-spacing: .035em; text-transform: uppercase; outline: none;
}
.tst-done__line { margin: 0 0 6px; font-size: clamp(16px, 1.15vw, 17.5px); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }

@media (max-width: 47.99em) {
  .issue__body { padding: 20px 16px 18px; }
  .issue__toggle { padding: 12px 16px 12px 18px; gap: 12px; }
  .tst-gate .btn, .tst-done .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .issue__chev, .chip span, .file__bar i, .inp, .btn { transition: none; }
}
