/* skalse-web browser-check. Colours: the owner's Everforest v2 "night" palette (values copied, not linked).
   Font: Onest, self-hosted subset (Ukrainian + Latin), licence in assets/fonts/OFL.txt. No external requests.
   Layout: one reading column. Every screen ends with its action row: the primary button first, quiet actions after it.
   Colour carries meaning only: green = the primary action and progress, aqua = done, red = error, yellow = attention. */
@font-face { font-family: "Onest"; src: url("fonts/onest.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0a0e0c;
  --surface: #121815;
  --raised: #19201c;
  --select: #212c26;
  --line: #2c3430;         /* separators only */
  --border: #424c47;       /* decorative outlines */
  --control: #6f7b74;      /* control borders: 4.3:1 on bg */
  --subtext: #909c92;      /* secondary text: 6.9:1 on bg */
  --fg-dim: #b4b6a7;
  --fg: #dbd8c9;
  --fg-hi: #e9e6db;
  --green: #abc682;        /* primary; dark text on it 10.3:1 */
  --green-br: #c2da9e;
  --green-soft: #67774e;
  --green-bg: #1f2c1c;
  --aqua: #8cc69c;         /* done */
  --yellow: #d9bc7f;       /* attention */
  --red: #e88384;          /* errors */

  --focus: var(--green-br);
  --r: 10px;
  --col: 620px;
  --gutter: 20px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, "DejaVu Sans Mono", monospace;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overflow-x: clip;
}
@media (min-width: 768px) { body { font-size: 18px; } }
main { flex: 1 0 auto; width: 100%; max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(24px, 6vh, 64px) var(--gutter) 88px; }
h1, h2, h3 { color: var(--fg-hi); text-wrap: balance; }
h1 { font-size: clamp(30px, 2.2vw + 22px, 44px); line-height: 1.12; font-weight: 650; letter-spacing: -.022em; margin: 0 0 14px; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 620; letter-spacing: -.01em; margin: 0 0 8px; }
h3 { font-size: 1em; line-height: 1.4; font-weight: 620; margin: 18px 0 2px; }
p { margin: 12px 0; }
a { color: var(--fg-hi); text-decoration-color: var(--control); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--fg-hi); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: #2c3931; color: var(--fg-hi); }
.hidden { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lead { font-size: 1.13em; line-height: 1.55; color: var(--fg); margin: 0 0 8px; max-width: 34em; }
.muted { color: var(--subtext); font-size: 15px; }
.small { font-size: 14px; }
.error { color: var(--red); }
.okmsg { color: var(--aqua); }
code, pre { font: 14px/1.5 var(--mono); }
code { color: var(--fg-hi); }

/* ---------------------------------------------------------------- header + footer: the brand, kept small */
.top-in, .foot-in { max-width: calc(var(--col) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 12px; }
.top-in { min-height: 72px; padding-top: 8px; }
.logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.mark { display: block; flex: none; width: 30px; height: 30px; }
.word { color: var(--fg-hi); font-weight: 600; font-size: 16px; white-space: nowrap; }
.word span { color: var(--subtext); font-weight: 400; }
.top-in .lang { margin-left: auto; }
footer.foot { flex: none; color: var(--subtext); font-size: 14px; }
.foot-in { padding-bottom: 32px; gap: 10px; }
.foot p { margin: 0; }

/* ---------------------------------------------------------------- controls */
button, .btn {
  appearance: none; -webkit-appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 28px; border: 1px solid var(--green); border-radius: var(--r);
  background: var(--green); color: var(--bg); font: inherit; font-size: 17px; font-weight: 640; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color .15s, border-color .15s, color .15s;
}
button:hover, .btn:hover { background: var(--green-br); border-color: var(--green-br); color: var(--bg); }
button:active, .btn:active { transform: translateY(1px); }
/* quiet button: tools inside a step (copy, open, paste) and second choices */
button.secondary, .btn.secondary { background: transparent; color: var(--fg-hi); border-color: var(--control); font-weight: 560; min-height: 46px; padding: 10px 18px; font-size: 16px; }
button.secondary:hover, .btn.secondary:hover { background: var(--raised); border-color: var(--fg-dim); color: var(--fg-hi); }
/* text action: back, "cannot send?", alternatives */
button.link {
  background: none; border: 0; min-height: 44px; padding: 8px 0; color: var(--fg); font-weight: 450; font-size: 16px; text-align: left;
  text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 4px; text-decoration-thickness: 1px;
}
button.link:hover { background: none; color: var(--fg-hi); text-decoration-color: var(--fg-hi); }
button:disabled, button:disabled:hover { opacity: .4; cursor: default; transform: none; background: var(--green); border-color: var(--green); color: var(--bg); }
button.secondary:disabled, button.secondary:disabled:hover { background: transparent; border-color: var(--control); color: var(--fg-hi); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.lang { min-height: 44px; padding: 8px 4px; font-size: 15px; font-weight: 450; background: none; border: 0; color: var(--fg); text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 4px; }
.lang:hover { background: none; color: var(--fg-hi); text-decoration-color: var(--fg-hi); }

/* the action row: same place on every screen, at the end of the content; primary first, quiet actions after it */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 28px; }
.actions .aside { color: var(--subtext); font-size: 15px; }
@media (max-width: 560px) {
  .actions > button:not(.secondary):not(.link):not(.hidden), .actions > .btn:not(.secondary) { flex: 1 1 100%; }
  #intro .actions { gap: 10px; }
}

input[type=text], input[type=email], textarea, select {
  width: 100%; font: inherit; color: var(--fg-hi); background: var(--surface);
  border: 1px solid var(--control); border-radius: var(--r); padding: 12px 14px; min-height: 52px;
}
input::placeholder, textarea::placeholder { color: var(--subtext); opacity: 1; }
input[type=text]:hover, input[type=email]:hover, textarea:hover { border-color: var(--fg-dim); }
input[aria-invalid=true] { border-color: var(--red); }
input:disabled { opacity: .6; }
textarea { line-height: 1.45; }
textarea.paste { min-height: 10em; font: 13px/1.45 var(--mono); }
textarea.gpus { min-height: 6.5em; }
textarea.shorttext { font: 13px/1.5 var(--mono); color: var(--fg-dim); resize: vertical; margin-top: 8px; }
#typeInput { font-size: 20px; }

fieldset { border: none; margin: 0 0 18px; padding: 0; min-width: 0; }
legend, label.field { font-weight: 600; color: var(--fg-hi); display: block; margin-bottom: 8px; padding: 0; }
.field-row { margin: 0 0 18px; }
.field-row label { font-weight: 600; color: var(--fg-hi); display: block; margin-bottom: 8px; font-size: 16px; }
.field-row .muted { margin: 8px 0 0; }
.choices { display: flex; flex-wrap: wrap; gap: 10px; }
.choices label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; height: 52px; box-sizing: border-box; padding: 10px 18px;
  border: 1px solid var(--control); border-radius: var(--r); color: var(--fg); cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.choices label:hover { border-color: var(--fg-dim); background: var(--raised); }
.choices input { margin: 0; width: 18px; height: 18px; accent-color: var(--green); }
.choices label:has(input:checked) { border-color: var(--green); background: var(--green-bg); color: var(--fg-hi); box-shadow: inset 0 0 0 1px var(--green); }
.choices label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (max-width: 480px) { .choices label { flex: 1 1 calc(50% - 5px); } }
.sub-block { border-left: 2px solid var(--line); padding-left: 14px; margin: 4px 0 18px; }

/* ---------------------------------------------------------------- shared pieces */
pre.cmd {
  background: var(--surface); color: var(--fg-dim); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; margin: 8px 0; white-space: pre-wrap; word-break: break-all; user-select: all;
}
pre.cmd.long { max-height: 9.5em; overflow: auto; font-size: 12.5px; }
ol.how, ol.plan { padding-left: 1.4em; margin: 12px 0; }
ol.how li, ol.plan li { margin: 6px 0; padding-left: 4px; }
ol.how li::marker, ol.plan li::marker { color: var(--subtext); font-variant-numeric: tabular-nums; }
.status { margin: 10px 0 0; font-size: 15px; }
.status.ok { color: var(--aqua); }
.status.bad { color: var(--red); }
.status ul { margin: 4px 0 0; padding-left: 20px; }
.prefill { font-size: 15px; color: var(--subtext); margin: -4px 0 14px; }
.big { font-size: 36px; font-weight: 650; line-height: 1.1; color: var(--fg-hi); }
/* messages: a coloured rule says what kind, the text stays readable */
.alert, #wizErr, #cErr, #msg.error, #msg.okmsg, .field-row .error { padding: 2px 0 2px 14px; border-left: 3px solid currentColor; }
.alert { color: var(--fg-hi); border-left-color: var(--red); margin: 0 0 8px; }
.alert strong { color: var(--red); font-weight: 620; }
.alert-attention {
  color: var(--fg-hi); border-left: 3px solid #d9bc7f; background: rgba(217, 188, 127, 0.08);
  padding: 12px 16px; border-radius: 0 var(--r) var(--r) 0; margin: 20px 0; line-height: 1.45; font-size: 15px;
}
.alert-attention strong { color: #d9bc7f; font-weight: 650; display: block; margin-bottom: 4px; }
#wizErr { margin-top: 18px; }

.progress { height: 4px; background: var(--select); border-radius: 2px; overflow: hidden; }
.progress > div { height: 100%; width: 0; border-radius: 2px; background: var(--green); transition: width .35s ease-out; }
.progress.indet > div { width: 35%; animation: indet 1.3s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }

/* disclosures: details stay one tap away instead of filling the screen */
.mores { margin: 40px 0 0; border-bottom: 1px solid var(--line); }
details.more { border-top: 1px solid var(--line); }
details.more > summary {
  list-style: none; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 0;
  cursor: pointer; color: var(--fg-hi); font-weight: 520;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 2px 0 3px;
  border-right: 2px solid var(--subtext); border-bottom: 2px solid var(--subtext); transform: rotate(-45deg); transition: transform .15s;
}
details.more[open] > summary::before { transform: rotate(45deg) translate(-2px, -2px); }
details.more > summary:hover { color: #fff; }
.more-body { padding: 0 0 22px 25px; }
.more-body > :first-child { margin-top: 0; }
.more-body > :last-child { margin-bottom: 0; }
.more-body p { color: var(--fg); }

/* ---------------------------------------------------------------- stage tracker: five quiet segments */
.track-wrap { margin: 0 0 44px; }
.track { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.track li { flex: 1 1 0; min-width: 0; position: relative; padding-top: 14px; font-size: 14px; line-height: 1.3; color: var(--subtext); }
.track li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 2px; background: var(--line); }
.track li.done { color: var(--fg-dim); }
.track li.done::before { background: var(--green-soft); }
.track li.now { color: var(--fg-hi); font-weight: 600; }
.track li.now::before { background: var(--green); }
.track .lbl { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cheer { margin: 14px 0 0; color: var(--subtext); font-size: 15px; }
@media (max-width: 600px) {
  .track li:not(.now) .lbl { display: none; }
  .track { min-height: 32px; }
  .track .now .lbl { overflow: visible; }
  .track li:last-child .lbl { position: absolute; right: 0; text-align: right; }
}
/* the report is sent: the last stage is done too */
#done[data-mode=sent] .track li.now::before { background: var(--green-soft); }
#done[data-mode=sent] .track li.now { color: var(--fg-dim); font-weight: 400; }

/* ---------------------------------------------------------------- index */
#intro { padding-top: clamp(0px, 4vh, 40px); }
#intro h1 { font-size: clamp(36px, 3vw + 24px, 56px); letter-spacing: -.028em; margin-bottom: 18px; }
#intro .lead { font-size: clamp(19px, .5vw + 17px, 22px); color: var(--fg); }
#intro .actions { margin-top: 32px; }
#startBtn { min-height: 56px; padding: 14px 40px; font-size: 18px; }
#intro .tip { margin-top: 20px; }
.wizhead { margin: 0 0 6px; color: var(--subtext); font-size: 15px; font-variant-numeric: tabular-nums; }
.wizhead .progress { display: none; }
#wizTitle { outline: none; font-size: clamp(26px, 1.4vw + 20px, 34px); margin-bottom: 20px; }
#wizBody { min-height: 280px; }
.wiz-actions { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 28px; }
.wiz-actions #wizNext { margin-left: auto; }
@media (max-width: 560px) {
  .wiz-actions { flex-direction: column-reverse; gap: 12px; }
  .wiz-actions button { width: 100%; }
}

/* ---------------------------------------------------------------- task + tab */
.stage { margin-top: 28px; }
.stage > p:first-child { color: var(--fg-hi); }
.arena {
  position: relative; height: 56vh; min-height: 300px; overflow: hidden; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.count { margin-top: 10px; font-variant-numeric: tabular-nums; }
.target {
  position: absolute; width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; cursor: pointer;
  background: var(--green); border: 0; box-shadow: none;
}
.target:hover { background: var(--green-br); }
.scrollbox {
  height: 48vh; min-height: 260px; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.scrollbox p { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--subtext); }
.scrollbox p.okmsg { color: var(--aqua); border-bottom: 0; }
.phrase {
  font-size: clamp(22px, 1vw + 18px, 28px); font-weight: 600; line-height: 1.3; letter-spacing: -.01em; margin: 6px 0 18px; color: var(--fg-hi);
  user-select: none; -webkit-user-select: none;
}
.waiting { color: var(--yellow); font-weight: 600; }
#msg:empty { margin: 0; }
#msg.okmsg { color: var(--aqua); }

/* ---------------------------------------------------------------- result */
/* #done[data-mode]: file = download is the main path (no send block); send = the form is the main path and the download
   waits behind "Cannot send?"; failed = download first, retry below; sent = one confirmation */
.thanks { margin-bottom: 28px; }
#sendOk .lead { margin-bottom: 18px; }
.rid { color: var(--subtext); font-size: 15px; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.rid code { color: var(--fg-dim); font-size: 14px; letter-spacing: .02em; user-select: all; }
.rid .link { font-size: 15px; min-height: 0; padding: 0; }
#sendForm input[type=email] { max-width: 420px; display: block; }
#sendBox .small { max-width: 36em; }
#sendBusy { margin-top: 24px; max-width: 420px; }
#sendBusy p { margin: 0 0 10px; color: var(--fg-dim); }
.other { margin: 20px 0 0; }
#done:not([data-mode=send]) .other { display: none; }
.files { margin-top: 8px; }
.files > :first-child { margin-top: 0; }
.files .muted { margin-top: 14px; }
#copyMsg { font-size: 15px; }
#done[data-mode=send] .files { display: none; margin-top: 4px; padding: 16px 0 0 18px; border-left: 1px solid var(--line); }
#done[data-mode=send].open .files { display: block; }
#done[data-mode=send] .files h2 { font-size: 18px; }
#done[data-mode=send] #dl { background: transparent; color: var(--fg-hi); border-color: var(--control); font-weight: 560; min-height: 46px; padding: 10px 18px; font-size: 16px; }
#done[data-mode=send] #dl:hover { background: var(--raised); border-color: var(--fg-dim); }
#done[data-mode=failed] .thanks .lead { display: none; }
#done[data-mode=failed] .thanks { margin-bottom: 20px; }
#done[data-mode=failed] .files { margin-top: 28px; }
#done[data-mode=failed] #sendBox { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
#done[data-mode=failed] #sendBox .small { display: none; }
#done[data-mode=failed] #sendBox .actions { margin-top: 16px; }
#done[data-mode=sent] .thanks, #done[data-mode=sent] #sendBox, #done[data-mode=sent] .other, #done[data-mode=sent] .files, #done[data-mode=sent] #sendMsg { display: none; }
#done:not([data-mode=sent]) #sendOk { display: none; }
#sendDoneText { outline: none; }
#done .mores { margin-top: 48px; }
table.sum { border-collapse: collapse; width: 100%; font-size: 15px; }
table.sum th, table.sum td { border-top: 1px solid var(--line); padding: 8px 0; vertical-align: top; text-align: left; word-break: break-word; }
table.sum tr:first-child th, table.sum tr:first-child td { border-top: 0; padding-top: 0; }
table.sum th { color: var(--subtext); font-weight: 400; width: 40%; padding-right: 12px; }
.again { margin: 20px 0 0; font-size: 16px; }
#none .actions { margin-top: 24px; }
#busy .progress { margin-top: 18px; max-width: 420px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .progress.indet > div { width: 100%; opacity: .5; }
  button:active, .btn:active { transform: none; }
}
