:root {
  --accent: #d9503a;
  --accent-soft: #fdeeeb;
  --bg: #fbfaf8;
  --card: #ffffff;
  --text: #1c1b1a;
  --muted: #6b6764;
  --line: #e7e3de;
  --radius: 10px;
  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #ff7a5e;
    --accent-soft: #2a1c19;
    --bg: #141312;
    --card: #1d1b1a;
    --text: #f2efec;
    --muted: #a29d98;
    --line: #35312e;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* header */
.site-head {
  padding: 28px 0 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.02rem;
}
.brand .dot {
  width: 13px; height: 13px;
  border-radius: 4px;
  background: var(--accent);
}

h1 {
  font-size: clamp(1.6rem, 5.5vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 30px 0 10px;
  font-weight: 700;
}
h2 {
  font-size: 1.3rem;
  letter-spacing: -.015em;
  margin: 44px 0 10px;
  font-weight: 650;
}
h3 {
  font-size: 1.03rem;
  margin: 26px 0 6px;
  font-weight: 650;
}
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 1.06rem; margin-bottom: 26px; max-width: 60ch; }
a { color: var(--accent); }

/* card + dropzone */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.drop {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 44px 22px;
  text-align: center;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.drop:focus-visible,
.drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}
.drop strong { display: block; font-size: 1.08rem; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: .92rem; }

.btn {
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn.small { padding: 8px 14px; font-size: .88rem; flex: none; }

/* controls */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 18px 0 0;
  align-items: flex-end;
}
.field { flex: 1 1 220px; }
.field label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
select, input[type=range] {
  font: inherit;
  width: 100%;
  accent-color: var(--accent);
}
input[type=range] { height: 44px; }
select {
  min-height: 44px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}
.hint { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }

/* results */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
[hidden] { display: none !important; }
.results { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.item img {
  width: 52px; height: 52px;
  object-fit: cover;
  border-radius: 9px;
  background: var(--accent-soft);
  flex: none;
}
.item .meta { min-width: 0; flex: 1; }
.item .name {
  font-weight: 600;
  font-size: .94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item .sizes { font-size: .86rem; color: var(--muted); }
.saved { color: var(--accent); font-weight: 600; }

/* faq */
.faq h3 { margin-top: 24px; }
.faq p { color: var(--muted); }

/* Ad slots.
   Height is reserved at every breakpoint so the page does not move when an ad
   loads (CLS = 0). If you change the unit size served, change the min-height here
   to match, otherwise the reservation is wrong and CLS comes back.
   The dashed placeholder chrome only applies while the slot is :empty — insert
   the real <ins> tag and it disappears on its own, no CSS change needed. */
.ad-slot {
  margin: 40px 0;
  min-height: 280px; /* mobile: 300x250 rectangle */
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ad-slot:empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}
.ad-slot:empty::before {
  content: "Advertisement";
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
@media (min-width: 700px) {
  .ad-slot { min-height: 100px; } /* desktop: 728x90 leaderboard */
}

/* Wide-screen skyscraper. Fixed position, so it can never push content around;
   hidden entirely below 1240px because there is no room beside the 780px column. */
.ad-slot--side { display: none; }
@media (min-width: 1240px) {
  .ad-slot--side {
    display: flex;
    position: fixed;
    top: 96px;
    left: calc(50% + 410px);
    width: 160px;
    min-height: 600px;
    margin: 0;
  }
}

footer {
  margin-top: 60px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  color: var(--muted);
}
footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
footer nav a { display: inline-flex; align-items: center; min-height: 44px; }

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

@media (max-width: 520px) {
  body { font-size: 16px; }
  .card, .drop { padding: 18px; }
  .item { gap: 11px; }
}
