:root {
  --bg: #0c1a20;
  --bg-2: #081218;
  --panel: #f7f4ee;
  --panel-2: #efebe3;
  --ink: #142028;
  --muted: #5a656c;
  --line: #e2dbcf;
  --teal: #1a7a72;
  --teal-2: #14645e;
  --brass: #c4a05a;
  --ok: #2d7a52;
  --err: #b42318;
  --cream: #fffcf7;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 88% -8%, #1e4a52 0%, transparent 58%),
    radial-gradient(700px 280px at 0% 100%, #163038 0%, transparent 50%),
    var(--bg);
}

.frame {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: #e8eeeb;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #2bb3a6 0 44%, transparent 44%),
    linear-gradient(225deg, var(--brass) 0 30%, #123038 30%);
}

.brand-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 700;
}

.brand-name {
  margin: 3px 0 0;
  font-size: 1.02rem;
  font-weight: 650;
}

.brand-note {
  margin: 0;
  color: #93a8a4;
  font-size: 0.86rem;
}

.tools {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 22px;
}

.tool {
  display: flex;
  align-items: center;
  gap: 12px;
  appearance: none;
  border: 1px solid #243c44;
  background: #10242c;
  color: #9bb0ab;
  font: inherit;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.tool:hover {
  border-color: #3a5c64;
  color: #d7e4e0;
}

.tool.is-on {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--panel);
}

.tool-kicker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  background: #1b353c;
  color: #c5d6d2;
  font-size: 0.78rem;
  font-weight: 700;
}

.tool.is-on .tool-kicker {
  background: var(--teal);
  color: #f4fffc;
}

.tool-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tool-copy strong {
  font-size: 0.98rem;
}

.tool-copy small {
  color: inherit;
  opacity: 0.72;
  font-size: 0.82rem;
}

.tool.is-on .tool-copy small {
  color: var(--muted);
  opacity: 1;
}

#tool-fix[hidden],
#tool-pdf[hidden],
.ads[hidden] {
  display: none;
}

.hero h1 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.15;
  color: #f3f0ea;
  margin: 0 0 10px;
  max-width: 18ch;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.hero p {
  margin: 0 0 22px;
  max-width: 48ch;
  color: #b7c6c2;
  line-height: 1.55;
  font-size: 1.02rem;
}

.panel {
  background: var(--panel);
  border: 1px solid #ebe4d8;
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: -10px -10px 18px;
  padding: 6px;
  background: var(--panel-2);
  border-radius: 12px;
}

.mode {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.mode.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(20, 32, 40, 0.06);
}

.drops {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 12px;
}

.drops[hidden] {
  display: none;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 168px;
  padding: 18px;
  background: var(--cream);
  border: 1.5px dashed #d3cbbd;
  border-radius: 14px;
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

.drop:hover,
.drop.is-over {
  border-color: var(--teal);
  background: #fff;
}

.drop.is-over {
  transform: scale(1.01);
}

.drop.has-file {
  border-style: solid;
  border-color: var(--teal);
  background: #f3fbf9;
}

.drop.is-bad {
  border-color: var(--err);
  background: #fff6f4;
}

.drop-wide {
  width: 100%;
  min-height: 210px;
  align-items: center;
  text-align: center;
}

.drop-wide strong,
.drop-wide small,
.drop-wide em {
  text-align: center;
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.drop-step {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  background: #e7f4f2;
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.drop strong {
  font-size: 1.06rem;
}

.drop small {
  color: var(--muted);
  line-height: 1.4;
}

.drop em {
  margin-top: auto;
  padding-top: 14px;
  font-style: normal;
  font-weight: 650;
  color: var(--teal-2);
  word-break: break-all;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.chips li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 7px 8px 7px 12px;
  font-size: 0.86rem;
  border-radius: 999px;
}

.chips .meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.chips button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0 4px;
}

.chips button:hover {
  color: var(--err);
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.btn,
button#run,
button#confirm,
button#pdf-run {
  appearance: none;
  border: 0;
  background: var(--teal);
  color: #f7fffc;
  padding: 12px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
}

.btn:hover:not(:disabled),
button#run:hover:not(:disabled),
button#confirm:hover:not(:disabled),
button#pdf-run:hover:not(:disabled) {
  background: var(--teal-2);
}

.btn:disabled,
button#run:disabled,
button#confirm:disabled,
button#pdf-run:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn.is-busy,
button.is-busy {
  opacity: 0.72;
  pointer-events: none;
}

.btn-ok,
.download {
  display: inline-block;
  background: var(--ok);
  color: #f4fff8;
  text-decoration: none;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 12px;
}

.btn-ok:hover,
.download:hover {
  filter: brightness(1.05);
}

.btn:focus-visible,
.drop:focus-within,
.tool:focus-visible,
.mode:focus-visible,
.download:focus-visible,
.ghost:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

.status {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.status.is-err {
  color: var(--err);
}

.results {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid #ebe4d8;
  padding: 20px 22px;
  border-radius: var(--radius);
}

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.results h2 {
  font-size: 1.28rem;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.results ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.results li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--muted);
}

.results li:last-child {
  border-bottom: 0;
}

.results li strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.ok strong {
  color: var(--ok);
}

.err strong {
  color: var(--err);
}

.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 0.82rem;
  color: #8ba39d;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border: 1px solid #243c44;
  background: #10242c;
  border-radius: 999px;
}

.step span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #1b353c;
  color: #b9cdc7;
  font-weight: 700;
  font-size: 0.72rem;
}

.step.is-on {
  color: #f4f0ea;
  border-color: var(--teal);
}

.step.is-on span {
  background: var(--teal);
  color: #f7fffc;
}

.step.is-done span {
  background: var(--ok);
  color: #eafff2;
}

.review-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.review h2 {
  font-size: 1.28rem;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.review-lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.93rem;
}

.review-bulk {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

button.ghost {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 10px;
}

button.ghost:hover {
  border-color: var(--teal);
  color: var(--teal-2);
}

.file + .file {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.file h3 {
  font-size: 1rem;
  margin: 0 0 10px;
  word-break: break-all;
}

.notes {
  margin-bottom: 16px;
  font-size: 0.86rem;
  color: var(--muted);
}

.notes summary {
  cursor: pointer;
  padding: 6px 0;
}

.notes ul {
  margin: 6px 0 0;
  padding-left: 20px;
  line-height: 1.5;
}

.group {
  margin-top: 18px;
}

.group h4 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.group h4 span {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 1px 7px;
  font-size: 0.76rem;
  color: var(--muted);
  border-radius: 999px;
}

.group-hint {
  margin: 0 0 10px;
  font-size: 0.84rem;
  color: var(--muted);
  max-width: 70ch;
  line-height: 1.45;
}

.fixes {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: 12px;
  overflow: hidden;
}

.fix {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.fix:last-child {
  border-bottom: 0;
}

.fix:hover {
  background: #fff;
}

.fix input {
  margin-top: 3px;
  accent-color: var(--teal);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.fix label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  flex: 1;
}

.swap {
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 0.9rem;
}

.swap s {
  color: var(--err);
  text-decoration-thickness: 1px;
}

.swap b {
  color: var(--ok);
}

.swap s::after {
  content: " \2192 ";
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
}

.tag {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 999px;
}

.tag-alta {
  border-color: #b9d6c5;
  color: var(--ok);
}

.tag-media {
  border-color: #e0cda0;
  color: #8a6a2a;
}

.ctx {
  flex-basis: 100%;
  margin: 2px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
}

.clean {
  margin: 0;
  padding: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  border-radius: 12px;
}

.err-line {
  margin: 0;
  color: var(--err);
  font-size: 0.9rem;
}

#restart,
#pdf-restart {
  margin-top: 14px;
}

.join {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-basis: 100%;
  font-size: 0.88rem;
  line-height: 1.45;
}

.join-line {
  padding-left: 10px;
  border-left: 2px solid var(--line);
  color: var(--ink);
}

.join-line i {
  font-style: normal;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--err);
  margin-left: 8px;
}

@media (max-width: 720px) {
  .top {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero h1 {
    max-width: none;
  }

  .drops,
  .actions,
  .results-head,
  .tools {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .drop {
    min-height: 140px;
  }

  .steps {
    font-size: 0.75rem;
  }

  .step {
    padding: 5px 10px 5px 6px;
  }

  .review-head {
    flex-direction: column;
  }

  .ads-arrow {
    display: none;
  }
}

.ads {
  margin-top: 36px;
}

.ads-label {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8aa09c;
}

.ads-frame {
  position: relative;
}

.ads-viewport {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid #243c44;
  background: #10242c;
}

.ads-track {
  display: flex;
  transition: transform 0.55s ease;
}

.ads-slide {
  flex: 0 0 100%;
  min-height: 168px;
  display: flex;
  align-items: stretch;
  text-decoration: none;
  color: inherit;
}

.ads-slide[aria-hidden="true"] {
  pointer-events: none;
}

.ads-art {
  flex: 1;
  min-height: 168px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px 24px 20px;
  gap: 6px;
}

.ads-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.72);
}

.ads-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  max-width: 28ch;
  line-height: 1.2;
}

.ads-cta {
  margin: 8px 0 0;
  font-size: 0.86rem;
  font-weight: 650;
  color: #fff;
  opacity: 0.9;
}

.ads-arrow {
  appearance: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(12, 26, 32, 0.72);
  color: #f4f0ea;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.ads-prev {
  left: 10px;
}

.ads-next {
  right: 10px;
}

.ads-arrow:hover {
  background: rgba(12, 26, 32, 0.92);
}

.ads-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.ads-dot {
  appearance: none;
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #3a555c;
  cursor: pointer;
}

.ads-dot.is-on {
  background: var(--brass);
  width: 22px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: reduce) {
  .ads-track {
    transition: none;
  }
}
