:root {
  --brand: #48bd9b;
  --brand-dark: #2f9a7b;
  --text: #1c1c1c;
  --muted: #5f6672;
  --bg: #f6f8fc;
  --card: #ffffff;
  --border: #e5e7eb;
  --field: #f3f4f6;
  --error-bg: #fdecec;
  --error: #b42318;
  --ok-bg: #e9f7f2;
  --radius: 10px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

header { padding: 32px 16px 8px; text-align: center; }
header img { width: 180px; height: auto; }

main { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 16px; }

footer { text-align: center; padding: 24px 16px; font-size: 14px; color: var(--muted); }
footer a { color: inherit; }

h1 { font-size: 1.6rem; line-height: 1.25; margin: 8px 0 4px; text-align: center; }
.lead { text-align: center; color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
}

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabs button {
  appearance: none;
  border: 0;
  background: none;
  padding: 10px 14px;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--brand); font-weight: 600; }

label { display: block; font-weight: 600; margin: 16px 0 6px; }
label:first-child { margin-top: 0; }
.hint { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

textarea, input[type=text], input[type=url], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--field);
  border: 1px dashed #b9c3d3;
  border-radius: 8px;
  padding: 12px;
}
textarea { min-height: 260px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-style: solid; }
input[type=file] { width: 100%; font: inherit; padding: 12px; background: var(--field); border: 1px dashed #b9c3d3; border-radius: 8px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.choice { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.choice label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }

button.primary, a.primary {
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
button.primary:hover, a.primary:hover { background: var(--brand-dark); }
button.primary:disabled { opacity: .6; cursor: progress; }

button.secondary, a.secondary {
  font: inherit;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button.secondary:hover, a.secondary:hover { border-color: var(--brand); }
button.danger { color: var(--error); }

.copy { display: flex; gap: 8px; }
.copy input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }

.result { margin-top: 4px; }
.result h2 { font-size: 1.1rem; margin: 0 0 8px; }
.result + .result { margin-top: 20px; }

.box { border-radius: 8px; padding: 12px 14px; margin-top: 16px; }
.error { background: var(--error-bg); color: var(--error); }
.ok { background: var(--ok-bg); }

progress { width: 100%; height: 10px; margin-top: 16px; accent-color: var(--brand); }

.fineprint { font-size: 14px; color: var(--muted); text-align: center; margin-top: 16px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.countdown { font-size: 1.2rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
a.block { display: block; text-align: center; margin-top: 12px; }
.result > input[type=text] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.uploads { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.uploads li { border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.uploads strong { display: block; margin-bottom: 8px; overflow-wrap: anywhere; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
