/* Exact Size Reducer: Photo PDF — shared styles.

   The idea behind the look: this product is about measurement. Someone is
   standing in front of a portal that says "between 20 and 50 KB, 200 x 230
   pixels" and needs certainty. So the page borrows from a specification
   sheet — hairlines, dimension marks, and real numerals set in a monospace
   face so that figures line up and can be compared at a glance. Colour is
   kept for the tools themselves; everything around them stays quiet. */

:root {
  --paper:      #e9ecec;
  --card:       #ffffff;
  --ink:        #121e29;
  --ink-soft:   #5c6b76;
  --rule:       #ccd4d6;
  --rule-soft:  #e0e5e6;
  --signal:     #0a6b43;
  --signal-dim: #e2eee8;
  --warn:       #8a5a00;
  --warn-soft:  #fdf3e2;
  --bad:        #9e2f27;
  --bad-soft:   #fbeae8;

  /* kept so older markup that still names them does not fall back to black */
  --line:       #ccd4d6;
  --accent:     #0a6b43;
  --accent-dim: #e2eee8;

  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:#0e1519; --card:#161f25; --ink:#e5ecee; --ink-soft:#93a4ae;
    --rule:#2b3840; --rule-soft:#222d34;
    --signal:#49c68c; --signal-dim:#152a22;
    --warn:#e0b267; --warn-soft:#2a2213; --bad:#e58b82; --bad-soft:#2b1a18;
    --line:#2b3840; --accent:#49c68c; --accent-dim:#152a22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper:#0e1519; --card:#161f25; --ink:#e5ecee; --ink-soft:#93a4ae;
  --rule:#2b3840; --rule-soft:#222d34; --signal:#49c68c; --signal-dim:#152a22;
  --warn:#e0b267; --warn-soft:#2a2213; --bad:#e58b82; --bad-soft:#2b1a18;
  --line:#2b3840; --accent:#49c68c; --accent-dim:#152a22;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
.wrap {
  max-width: 740px; margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
  padding-block: 30px 64px;
}
.wrap.wide { max-width: 1060px; }

/* ---------- header ---------- */
header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.back {
  align-self: flex-start;
  font-size: 15px; font-weight: 600; color: var(--signal);
  text-decoration: none; border-bottom: 1px solid transparent; padding-bottom: 1px;
}
.back:hover { border-bottom-color: currentColor; }

/* Not a badge shouting a slogan — a stated fact, marked the way a spec
   sheet marks one: a tick, a hairline, and nothing else. */
.promise {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--signal); font-size: 14.5px; font-weight: 600;
  border-bottom: 1px solid var(--signal); padding-bottom: 3px;
}
.promise::before {
  content: ""; width: 13px; height: 7px; flex: none;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg) translate(1px, -2px);
}

h1 {
  font-weight: 800;
  font-size: clamp(32px, 6.6vw, 50px);
  line-height: 1.03;
  letter-spacing: -0.025em;
  margin: 4px 0 0;
  text-wrap: balance;
}
h1 .sub {
  display: block; margin-top: 6px;
  font-size: 0.4em; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink-soft);
}
.lede { color: var(--ink-soft); margin: 0; max-width: 58ch; font-size: 17px; }

/* ---------- the promise, set out in full ---------- */
.privacy {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 18px 20px;
  margin-top: 8px;
}
.privacy h2 {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  margin: 0 0 12px; color: var(--ink);
}
.privacy ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.privacy li {
  display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start;
  font-size: 15px; line-height: 1.5; min-width: 0; color: var(--ink-soft);
}
.privacy li svg { width: 14px; height: 14px; margin-top: 4px; color: var(--signal); }
.privacy b { color: var(--ink); font-weight: 600; }
.privacy .proof {
  margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--rule-soft);
  font-size: 14.5px; color: var(--ink-soft);
}
.privacy .proof b { color: var(--ink); }
.privacy.one { font-size: 15.5px; color: var(--ink-soft); }
.privacy.one b { color: var(--ink); }

/* ---------- the working card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 24px 24px 26px;
}
.step {
  font-size: 15.5px; font-weight: 700; letter-spacing: -0.005em;
  color: var(--ink); margin: 28px 0 10px;
  padding-top: 14px; border-top: 1px solid var(--rule-soft);
}
.step:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.step em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.hint { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 11px; }

/* ---------- picking files ---------- */
.drop {
  border: 1px dashed var(--rule); border-radius: 2px;
  padding: 30px 18px; text-align: center; cursor: pointer;
  background: color-mix(in srgb, var(--paper) 45%, transparent);
  transition: border-color .12s, background .12s;
}
.drop:hover, .drop.over {
  border-color: var(--signal); border-style: solid;
  background: var(--signal-dim);
}
.drop b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.drop span { font-size: 14.5px; color: var(--ink-soft); }
input[type=file] { display: none; }

.picked {
  display: flex; align-items: center; gap: 13px; margin-top: 13px;
  padding: 11px 12px; border: 1px solid var(--rule); border-radius: 2px;
}
.picked img, .thumb {
  width: 52px; height: 52px; object-fit: cover; flex: none;
  border: 1px solid var(--rule); border-radius: 1px; background: var(--paper);
}
.picked .meta { flex: 1 1 auto; min-width: 0; }
.picked .meta b {
  display: block; font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.picked .meta span { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.linky {
  background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--signal); border-bottom: 1px solid currentColor;
}

/* ---------- fields ---------- */
.row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
input[type=text], input[type=number], select {
  font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-radius: 2px;
  padding: 11px 12px; min-width: 0;
}
input[type=number] { font-family: var(--mono); width: 116px; }
input:focus, select:focus { outline: 2px solid var(--signal); outline-offset: -1px; }
.grow { flex: 1 1 140px; }
.chip {
  font-family: var(--mono); font-size: 13.5px; font-weight: 500;
  background: transparent; color: var(--ink-soft);
  border: 1px solid var(--rule); border-radius: 2px;
  padding: 9px 13px; cursor: pointer; text-decoration: none;
  transition: border-color .1s, color .1s;
}
.chip:hover { border-color: var(--signal); color: var(--signal); }
.chip.on {
  background: var(--signal); border-color: var(--signal); color: #fff;
}

.go {
  width: 100%; margin-top: 24px;
  font-family: var(--sans); font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--signal); color: #fff;
  border: none; border-radius: 2px; padding: 16px; cursor: pointer;
}
.go:disabled { opacity: .4; cursor: not-allowed; }
.go:not(:disabled):hover { filter: brightness(1.12); }

/* ---------- the result, read as a measurement ---------- */
.result {
  margin-top: 22px; padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--signal);
  border-radius: 2px;
}
.result.warn { border-top-color: var(--warn); background: var(--warn-soft); }
.result.bad  { border-top-color: var(--bad);  background: var(--bad-soft); }
.result .big {
  font-family: var(--mono); font-size: 30px; font-weight: 500;
  line-height: 1.1; letter-spacing: -0.02em;
}
.result .sub {
  font-family: var(--mono); font-size: 13.5px; color: var(--ink-soft); margin-top: 5px;
}
.result .say { margin-top: 11px; font-size: 15.5px; }
.save {
  display: block; width: 100%; margin-top: 17px; text-align: center;
  font-family: var(--sans); font-size: 16px; font-weight: 700;
  letter-spacing: -0.01em;
  background: var(--ink); color: var(--card);
  border: none; border-radius: 2px; padding: 15px; cursor: pointer;
  text-decoration: none;
}
.save:hover { filter: brightness(1.25); }

/* ---------- page / photo lists ---------- */
.list { margin-top: 13px; border-top: 1px solid var(--rule-soft); }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--rule-soft);
}
.item .meta { flex: 1 1 auto; min-width: 0; }
.item .meta b {
  display: block; font-size: 14.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item .meta span { font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.item .acts { display: flex; gap: 4px; flex: none; }
.ibtn {
  background: transparent; border: 1px solid var(--rule); border-radius: 2px;
  width: 33px; height: 33px; cursor: pointer; color: var(--ink-soft);
  display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.ibtn:hover { border-color: var(--signal); color: var(--signal); }
.ibtn:disabled { opacity: .3; cursor: not-allowed; }
.ibtn.wide { width: auto; padding: 0 11px; font-size: 13px; font-weight: 600; }

.note { font-size: 14.5px; color: var(--ink-soft); margin: 13px 0 0; }
.note.warn { color: var(--warn); }
.bar {
  height: 3px; background: var(--rule-soft); overflow: hidden; margin-top: 18px;
}
.bar > i { display: block; height: 100%; background: var(--signal); width: 0; transition: width .18s; }

.how {
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--rule-soft);
  font-size: 14.5px; color: var(--ink-soft); line-height: 1.6;
}
.how b { color: var(--ink); font-weight: 700; }

footer { margin-top: 34px; font-size: 14.5px; color: var(--ink-soft); }
footer b { color: var(--ink); font-weight: 600; }
footer a { color: var(--signal); }

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