/* toolisro shared styles. Layout: a slim site bar, then one centered work column per page. */
:root {
  --bg: #f3f2f0;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --muted: #6b6762;
  --line: #dedad4;
  --accent: #d2491c;      /* safelight amber-red */
  --accent-ink: #ffffff;
  --accent-soft: #fbe7dd;
  --good: #1f7a4d;
  --warn: #9a5b00;
  --bad: #b3261e;
  --tray: #ebe8e3;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141211; --surface: #1d1a18; --ink: #efe9e3; --muted: #a39b93; --line: #34302c;
    --accent: #ff6a3a; --accent-ink: #1a0d07; --accent-soft: #3a1f15;
    --good: #5fcf94; --warn: #f0b552; --bad: #ff8a80; --tray: #191715;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141211; --surface: #1d1a18; --ink: #efe9e3; --muted: #a39b93; --line: #34302c;
  --accent: #ff6a3a; --accent-ink: #1a0d07; --accent-soft: #3a1f15;
  --good: #5fcf94; --warn: #f0b552; --bad: #ff8a80; --tray: #191715;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 0 56px;
}
.wrap { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
header { display: flex; flex-direction: column; gap: 6px; }
h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(30px, 6vw, 44px);
  line-height: 1.05; letter-spacing: -0.02em; margin: 0; text-wrap: balance;
}
h1 .dot { color: var(--accent); }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.formats { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }

.tray {
  position: relative; border: 2px dashed var(--line); border-radius: 14px; background: var(--tray);
  padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  transition: border-color .15s, background .15s; cursor: pointer;
}
.tray:hover, .tray:focus-within { border-color: var(--accent); }
.tray.over { border-color: var(--accent); background: var(--accent-soft); }
.tray strong { font-family: var(--display); font-weight: 600; font-size: 20px; }
.tray small { color: var(--muted); }
.tray input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tray:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  font: 500 14px/1 var(--body); border-radius: 8px; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tray .btn { position: relative; z-index: 1; pointer-events: none; }

.controls {
  display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.quality { display: flex; align-items: center; gap: 12px; flex: 1 1 280px; min-width: 0; }
.quality label { font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.quality input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); }
.qval { font-family: var(--mono); font-variant-numeric: tabular-nums; min-width: 3ch; text-align: right; font-weight: 500; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.notice { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--warn); color: var(--warn); font-size: 14px; }

.summary {
  display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.summary b { color: var(--ink); font-weight: 500; }
.summary .save { color: var(--good); }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.item {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.thumb {
  width: 72px; height: 72px; border-radius: 8px; object-fit: cover; display: block;
  background-color: var(--tray);
  background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%),
                    linear-gradient(45deg, var(--line) 25%, transparent 25%, transparent 75%, var(--line) 75%);
  background-size: 12px 12px; background-position: 0 0, 6px 6px;
}
.meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag {
  display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 2px;
}
.stats { font-family: var(--mono); font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.stats .arrow { color: var(--accent); }
.pill { font-family: var(--mono); font-size: 12px; font-weight: 500; }
.pill.good { color: var(--good); }
.pill.bigger { color: var(--warn); }
.pill.err { color: var(--bad); font-family: var(--body); }
.item-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { padding: 9px 10px; }
.empty { color: var(--muted); text-align: center; padding: 8px; }
footer { color: var(--muted); font-size: 13px; max-width: 70ch; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-size: 14px; z-index: 20;
}
@media (max-width: 520px) {
  .item { grid-template-columns: 56px minmax(0, 1fr); }
  .thumb { width: 56px; height: 56px; }
  .item-actions { grid-column: 2 / -1; }
}
@media (prefers-reduced-motion: reduce) { .tray { transition: none; } }

/* ---------- site chrome (shared by every page) ---------- */
.site-bar { max-width: 880px; margin: 0 auto; padding-block: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.site-nav { display: flex; gap: 16px; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.site-foot { max-width: 880px; margin: 40px auto 0; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- home page ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card h2 { font-family: var(--display); font-weight: 600; font-size: 19px; margin: 0; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }
.tool-card .go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.tool-icon { font-family: var(--mono); font-size: 12px; color: var(--accent); letter-spacing: .06em; }
.promise { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.promise div { display: flex; flex-direction: column; gap: 2px; }
.promise b { font-weight: 600; }
.promise span { color: var(--muted); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .tool-card { transition: none; } }

/* ---------- touch screens: give every control a comfortable tap area (about 44px) ---------- */
.site-nav a { padding-block: 8px; }
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .icon-btn { min-width: 44px; justify-content: center; }
  .site-nav a { padding-block: 12px; }
  .brand { padding-block: 6px; }
  .quality input[type=range] { height: 32px; }
}
.site-foot a { color: var(--ink); text-underline-offset: 2px; }
.site-foot a:hover { color: var(--accent); }

/* ---------- article text under a tool (how-to, FAQ) ---------- */
.content { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; padding-top: 20px; border-top: 1px solid var(--line); max-width: 70ch; }
.content h2 { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 12px 0 0; }
.content p, .content ol { margin: 0; }
.content ol { padding-left: 1.3em; display: flex; flex-direction: column; gap: 6px; }
.content details { border-bottom: 1px solid var(--line); padding-block: 10px; }
.content summary { cursor: pointer; font-weight: 600; }
.content details p { margin-top: 8px; color: var(--muted); }
