:root {
  --ink: #14202b;
  --muted: #53606d;
  --line: #d3dae1;
  --page: #edf0f3;
  --card: #fff;
  --go: #0b6b4d;
  --go-press: #08543c;
  --stop: #b3261e;
  color-scheme: light;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.8 Vazirmatn, 'Segoe UI', Tahoma, sans-serif;
}

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.page.narrow { padding-top: 18vh; text-align: center; }

h1 { margin: 0 0 6px; font-size: 1.6rem; line-height: 1.4; font-weight: 800; outline: none; }
h2 { margin: 18px 0 8px; font-size: 1.1rem; font-weight: 800; }

.hint { margin: 0 0 14px; color: var(--muted); font-size: 0.94rem; }

.top { margin-bottom: 22px; }
.kicker { margin: 0 0 8px; font-size: 0.9rem; font-weight: 700; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar div { height: 100%; background: var(--go); transition: width 200ms ease; }

form, section { min-width: 0; }

.field { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; font-weight: 600; font-size: 0.94rem; }
.field.inline { flex-direction: row; align-items: center; gap: 12px; }

input:not([type='radio'], [type='file'], [type='color']) {
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #8795a3;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  font: inherit;
  font-weight: 400;
}

::placeholder { color: #6b7885; opacity: 1; }

input[type='file'] { min-height: 44px; padding: 8px 0; font: inherit; }
input[type='color'] { width: 56px; height: 44px; padding: 2px; border: 1px solid #8795a3; border-radius: 8px; background: #fff; }

:focus-visible { outline: 3px solid var(--go); outline-offset: 2px; }

fieldset { margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }

.choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 8px;
  align-items: center;
  min-height: 84px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.choice:has(input:checked) { border-color: var(--go); }
.choice span { grid-column: 2; color: var(--muted); font-size: 0.84rem; line-height: 1.5; }

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

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px 4px 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  cursor: pointer;
  font-size: 0.9rem;
}

.swatch:has(input:checked) { border-color: var(--go); }
.swatch input { position: absolute; opacity: 0; }
.swatch:has(input:focus-visible) { outline: 3px solid var(--go); outline-offset: 2px; }
.swatch i { width: 22px; height: 22px; border-radius: 50%; }

.logo-preview { display: block; max-width: 220px; max-height: 80px; margin-top: 10px; padding: 10px; border-radius: 8px; object-fit: contain; }

.records { width: 100%; margin-bottom: 14px; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
.records th, .records td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: right; }
.records th { color: var(--muted); font-size: 0.84rem; }
.records tbody tr:last-child td { border-bottom: 0; }

button {
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: default; }
.primary { background: var(--go); color: #fff; }
.primary:hover:not(:disabled) { background: var(--go-press); }
.quiet { border-color: #8795a3; background: transparent; color: var(--ink); }

#retry { margin-top: 14px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

.error { margin: 6px 0 0; color: var(--stop); font-size: 0.9rem; font-weight: 600; }
.status { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: #fbeee2; font-size: 0.94rem; }
.status[data-ok='1'] { background: #dff3ea; }
.status:empty { display: none; }

.review { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 12px 0 16px; padding: 14px; border-radius: 8px; background: var(--card); }
.review dt { color: var(--muted); }
.review dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

.stages { margin: 16px 0; padding: 0; list-style: none; counter-reset: stage; }
.stages li { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--muted); }
.stages li::before { content: ''; flex: none; width: 14px; height: 14px; border: 2px solid #8795a3; border-radius: 50%; }
.stages li[data-state='done'] { color: var(--ink); }
.stages li[data-state='done']::before { border-color: var(--go); background: var(--go); }
.stages li[data-state='now'] { color: var(--ink); font-weight: 800; }
.stages li[data-state='now']::before { border-color: var(--go); }
.stages li[data-state='failed'] { color: var(--stop); font-weight: 800; }
.stages li[data-state='failed']::before { border-color: var(--stop); background: var(--stop); }

.links { margin: 14px 0; padding: 0; list-style: none; }
.links a { display: flex; align-items: center; min-height: 48px; color: var(--go); font-weight: 700; }

.card { margin-top: 12px; padding: 14px; border-radius: 10px; background: var(--card); }
.card.notice { border: 2px solid var(--go); }
.card button { margin-top: 10px; }

.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }

.invites { margin: 0; padding: 0; list-style: none; }

.badge { padding: 2px 10px; border-radius: 999px; background: #e3e8ed; font-size: 0.84rem; font-weight: 700; }
.badge.done { background: #dff3ea; color: #08543c; }
.badge.failed { background: #fbe4e2; color: var(--stop); }
.badge.running, .badge.queued { background: #fbeee2; color: #7a4a00; }

details { margin-top: 6px; }
summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
pre { max-height: 240px; overflow: auto; padding: 10px; border-radius: 8px; background: #10171e; color: #dfe6ec; font-size: 0.8rem; line-height: 1.5; white-space: pre-wrap; text-align: left; }

@media (max-width: 480px) {
  h1 { font-size: 1.35rem; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .actions button { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
