/* resizeimages.org. One idea carries the look: the drop zone is drawn like a sheet on a cutting
   mat, with crop marks at its corners, because every tool here cuts something down. Everything
   else is quiet: white panels on a pale ground, one cobalt for actions, monospace only for the
   numbers people compare (file sizes, pixels). */
:root {
  --paper: #f5f6f3; --panel: #ffffff; --line: #dde1db; --muted: #5a625c; --ink: #141816;
  --accent: #2546c9; --accent-ink: #ffffff; --ok: #1d7a43; --warn: #a24a12;
  --sans: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.wrap { max-width: 68rem; margin-inline: auto; padding-inline: 1.1rem; }
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* header */
.head { background: var(--panel); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 3.75rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 600; color: var(--ink); text-decoration: none; margin-inline-end: auto; letter-spacing: -.01em; }
.brand svg { width: 26px; height: 26px; }
.nav { display: none; gap: 1.2rem; font-size: .92rem; }
.nav a { color: var(--ink); text-decoration: none; opacity: .8; }
.nav a:hover, .nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }
@media (min-width: 56rem) { .nav { display: flex; } }
.langs { position: relative; font-size: .85rem; }
.langs summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .8rem; color: var(--muted); }
.langs summary::-webkit-details-marker { display: none; }
.langs div { position: absolute; inset-inline-end: 0; top: calc(100% + .4rem); z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .4rem; display: grid; grid-template-columns: repeat(2, minmax(8rem, 1fr)); box-shadow: 0 8px 24px -10px rgb(0 0 0 / .2); }
.langs div a { padding: .35rem .6rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.langs div a:hover { background: var(--paper); }
.strip { border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.strip .wrap { display: flex; gap: 1.1rem; white-space: nowrap; }
.strip a { display: inline-flex; align-items: center; min-height: 2.6rem; font-size: .9rem; color: var(--ink); text-decoration: none; opacity: .85; }
@media (min-width: 56rem) { .strip { display: none; } }

/* page head */
.intro { padding-block: 2.2rem 1.2rem; }
.intro h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; margin: 0; max-width: 22ch; text-wrap: balance; }
.intro p { margin: .8rem 0 0; color: var(--muted); max-width: 44rem; font-size: 1.08rem; }
.private { display: inline-flex; gap: .45rem; align-items: center; margin-top: .9rem; font-size: .85rem; color: var(--ok); }

/* the tool */
.tool { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: clamp(1rem, 3vw, 1.6rem); }
.drop { position: relative; display: grid; place-items: center; gap: .3rem; text-align: center; cursor: pointer;
  min-height: 12.5rem; padding: 1.5rem; border-radius: 10px; background: var(--paper);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px; transition: background-color .15s ease; }
.drop::before, .drop::after { content: ""; position: absolute; width: 22px; height: 22px; border: 2px solid var(--ink); }
.drop::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.drop::after { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }
.drop strong { font-size: 1.15rem; background: var(--panel); padding: .15rem .5rem; border-radius: 6px; }
.drop span { color: var(--muted); font-size: .9rem; background: var(--panel); padding: 0 .4rem; border-radius: 6px; }
.drop.over { background-color: #e7ecff; }
.opts { display: grid; gap: .8rem; margin-top: 1.1rem; }
.row { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: end; }
.row[hidden] { display: none; }
.opt { display: grid; gap: .3rem; font-size: .85rem; color: var(--muted); min-width: 9rem; flex: 1 1 9rem; }
.opt input, .opt select { font: 16px var(--sans); padding: .55rem .65rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.check { display: inline-flex; gap: .45rem; align-items: center; font-size: .9rem; min-height: 2.6rem; }
.range { display: flex; gap: .6rem; align-items: center; }
.range input { flex: 1; padding: 0; border: 0; }
.range output { font-family: var(--mono); min-width: 2ch; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 2.9rem; padding: 0 1.3rem; border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn-small { min-height: 2.4rem; padding: 0 1rem; font-size: .92rem; }
.status { margin: .9rem 0 0; color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.results { display: grid; gap: .7rem; margin-top: .6rem; }
.res { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .7rem; border: 1px solid var(--line); border-radius: 10px; }
.res img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--paper); }
.res-meta { display: grid; gap: .1rem; min-width: 0; }
.res-meta strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { font-family: var(--mono); font-size: .82rem; color: var(--muted); }
.warn { font-size: .82rem; color: var(--warn); }
.stage { margin-top: 1rem; max-height: 70vh; overflow: hidden; border-radius: 10px; background: var(--paper); }
.stage img { max-width: 100%; }

/* other tools */
.tools { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); margin-block: 2rem 0; }
.tools a { display: grid; gap: .25rem; padding: 1rem 1.1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.tools a:hover { border-color: var(--accent); }
.tools strong { font-size: 1rem; }
.tools span { font-size: .88rem; color: var(--muted); }

/* the guide under the tool */
.guide { display: grid; gap: 2rem; padding-block: 2.5rem 3rem; }
@media (min-width: 60rem) { .guide { grid-template-columns: minmax(0, 1fr) 18rem; } }
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.5rem; letter-spacing: -.01em; margin: 2rem 0 .6rem; line-height: 1.2; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 1.4rem 0 .4rem; }
.prose ol, .prose ul { padding-inline-start: 1.3rem; }
.prose li { margin-top: .3rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 1rem 0; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: start; }
.prose th { background: var(--panel); }
.tablewrap { overflow-x: auto; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: .85rem 0; font-weight: 600; }
.faq p { margin: 0 0 1rem; color: var(--muted); }
.side { align-self: start; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem; font-size: .92rem; }
.side h2 { font-size: 1rem; margin: 0 0 .5rem; }
.side ul { margin: 0; padding-inline-start: 1.1rem; }
.side li { margin-top: .35rem; }

.foot { border-top: 1px solid var(--line); background: var(--panel); font-size: .88rem; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; padding-block: 1.6rem; }
.foot a { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* `hidden` must win over the display set on .btn and .row (the ZIP button showed before any result). */
[hidden] { display: none !important; }

.note { margin: 0; font-size: .85rem; color: var(--muted); }
.res img { background-color: #fff; background-image: linear-gradient(45deg,#e6e8e4 25%,transparent 25%,transparent 75%,#e6e8e4 75%), linear-gradient(45deg,#e6e8e4 25%,transparent 25%,transparent 75%,#e6e8e4 75%); background-size: 12px 12px; background-position: 0 0, 6px 6px; object-fit: contain; }
