:root {
  color-scheme: light;
  --ink: #1d1d1f;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --quiet: #86868b;
  --paper: #f5f5f7;
  --panel: #ffffff;
  --panel-soft: #fbfbfd;
  --control: #f2f2f4;
  --control-hover: #e8e8ed;
  --paper-2: var(--control);
  --line: #e5e5ea;
  --line-strong: #d2d2d7;
  --disabled: #b8b8bd;
  --accent: #d94f45;
  --accent-soft: #fff1ef;
  --danger: #b3261e;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.045);
  --soft-shadow: 0 8px 22px rgba(0, 0, 0, 0.04);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 16px;
  --max: 1180px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--paper);
  font-size: 17px;
  line-height: 1.4705882353;
  font-weight: 400;
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body,
button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  border: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.site-header,
.site-footer,
.hero,
.workspace,
.content-band,
.link-band,
.info-page,
.ad-shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 56px;
  padding: 10px 0 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 9px;
  color: #ffffff;
  background: var(--accent);
  box-shadow: 0 10px 22px rgba(217, 79, 69, 0.17);
  font-size: 0;
  line-height: 1;
}

.brand-icon {
  width: 17px;
  height: 17px;
  display: block;
  stroke-width: 2.3;
}

.site-header nav,
.site-footer nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3333733333;
  font-weight: 400;
}

.site-header nav {
  overflow-x: auto;
  padding: 4px;
  border-radius: 999px;
  background: var(--control);
  scrollbar-width: none;
}

.site-header nav::-webkit-scrollbar {
  display: none;
}

.site-header nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  min-width: 78px;
  padding: 0 14px;
  border-radius: 999px;
}

.site-header nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.055);
}

.hero {
  padding: 42px 0 24px;
}

.hero-copy {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.hero h1,
.info-page h1 {
  max-width: 820px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.0625;
  font-weight: 600;
  letter-spacing: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.hero p:not(.kicker),
.info-page > p {
  max-width: 650px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.4211026316;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
  padding: 0;
  border-radius: 32px;
  background: transparent;
  box-shadow: none;
}

.tool-card,
.side-panel,
.content-band,
.link-band,
.info-page {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--soft-shadow);
}

.tool-card {
  padding: 24px;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 32px;
  border-radius: 28px;
  background: var(--panel-soft);
  outline: 1px solid var(--line);
  transition: background 0.2s ease, outline-color 0.2s ease, transform 0.2s ease;
}

.drop-zone.is-dragging {
  background: var(--accent-soft);
  outline-color: rgba(217, 79, 69, 0.38);
}

.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.drop-zone div {
  pointer-events: none;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.drop-zone span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

.settings-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.68fr);
  gap: 12px;
  margin-top: 16px;
}

.target-control,
.mode-control {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--control);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.mode-control {
  grid-template-columns: auto minmax(0, 1fr);
}

.target-control input,
.mode-control select {
  min-width: 0;
  width: 100%;
  color: var(--ink);
  background: transparent;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  outline: 0;
}

.mode-control select {
  appearance: auto;
  font-size: 16px;
  font-weight: 600;
}

.quick-targets {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.quick-targets > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quick-targets > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-targets button {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-soft);
  outline: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}

.quick-targets button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--ink);
  outline-color: transparent;
}

.status-row {
  min-height: 48px;
  margin: 14px 0;
  padding: 13px 16px;
  border-radius: 18px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 15px;
  line-height: 1.45;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 400;
  box-shadow: none;
}

.primary-button:disabled {
  color: #ffffff;
  background: var(--disabled);
  box-shadow: none;
}

.progress {
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--control);
}

.progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.result-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 26px;
  background: var(--panel-soft);
  outline: 1px solid var(--line);
}

.result-card[hidden],
.progress[hidden] {
  display: none;
}

.result-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.result-head h2,
.side-panel h2,
.content-band h2,
.link-band h2,
.info-page h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.result-head .eyebrow {
  margin-bottom: 6px;
}

#resultBadge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1;
}

#resultBadge.is-over {
  color: var(--danger);
  background: var(--danger-soft);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stats-grid div {
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  background: var(--panel);
}

.stats-grid span {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 1;
}

.stats-grid p,
.result-card > p,
.side-panel p,
.content-band p,
.link-grid span,
.info-page p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.48;
}

.download-button {
  margin-top: 16px;
}

.side-panel {
  padding: 24px;
  position: sticky;
  top: 18px;
}

.side-panel .eyebrow {
  margin-bottom: 8px;
}

.note-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.note-list p {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
}

.mini-icon,
.tool-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.tool-icon {
  width: 22px;
  height: 22px;
}

.drop-zone .tool-icon {
  width: 36px;
  height: 36px;
  color: var(--ink);
}

.ad-shell {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin-top: 32px;
  margin-bottom: 0;
  border-radius: 24px;
  color: var(--quiet);
  background: var(--panel);
  font-size: 12px;
}

.ad-shell::before {
  content: attr(data-ad-label);
}

.ad-shell:has(ins)::before {
  content: "";
}

.content-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
  padding: 30px;
}

.content-band > div {
  min-width: 0;
  padding: 18px;
  border-radius: 18px;
  background: var(--panel-soft);
}

.link-band {
  margin-top: 18px;
  padding: 30px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.link-grid a {
  min-width: 0;
  min-height: 132px;
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-soft);
  outline: 0;
}

.link-grid strong,
.link-grid span {
  display: block;
}

.link-grid strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
}

.info-page {
  max-width: 860px;
  margin-top: 54px;
  padding: clamp(28px, 6vw, 58px);
}

.info-page article {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 44px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 940px) {
  .site-header,
  .site-footer,
  .hero,
  .workspace,
  .content-band,
  .link-band,
  .info-page,
  .ad-shell {
    width: min(100% - 28px, var(--max));
  }

  .site-header {
    align-items: center;
  }

  .site-header nav {
    max-width: 100%;
    overflow-x: auto;
  }

  .hero {
    padding: 34px 0 18px;
  }

  .hero h1,
  .info-page h1 {
    font-size: clamp(42px, 11vw, 58px);
  }

  .hero p:not(.kicker) {
    font-size: 17px;
  }

  .workspace {
    display: block;
    padding: 0;
    border-radius: 0;
  }

  .tool-card,
  .side-panel,
  .content-band,
  .link-band {
    border-radius: 26px;
  }

  .tool-card {
    padding: 14px;
  }

  .drop-zone {
    min-height: 220px;
    padding: 24px;
    border-radius: 22px;
  }

  .settings-strip,
  .content-band {
    grid-template-columns: 1fr;
  }

  .target-control,
  .mode-control {
    min-height: 54px;
  }

  .quick-targets {
    display: grid;
    gap: 8px;
  }

  .side-panel {
    position: static;
    margin-top: 10px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .link-grid a {
    min-height: auto;
  }

  .site-footer {
    display: grid;
  }
}

@media (max-width: 540px) {
  .site-header {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    padding: 18px 0 6px;
  }

  .site-header nav {
    width: 100%;
    justify-content: space-between;
  }

  .site-header nav a {
    min-width: 0;
    flex: 1 0 auto;
    padding-inline: 12px;
  }

  .hero {
    padding-top: 28px;
  }

  .workspace {
    width: calc(100% - 16px);
  }

  .target-control {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .quick-targets > div {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .quick-targets button {
    flex: 0 0 auto;
  }

  .content-band,
  .link-band,
  .side-panel {
    padding: 22px;
  }
}
