:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f8;
  --text: #0f172a;
  --muted: #5b6478;
  --border: #d9deea;
  --accent: #2563eb;
  --accent-2: #7c3aed;
  --accent-text: #ffffff;
  --ok: #15803d;
  --err: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #131a2e;
    --surface-2: #1b2440;
    --text: #e8ecf6;
    --muted: #9aa5c0;
    --border: #2a3558;
    --accent: #5b8cff;
    --accent-2: #a78bfa;
    --accent-text: #0b1020;
    --ok: #4ade80;
    --err: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-text); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }
.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 2rem); margin-inline: auto; }

header.site { background: var(--surface); border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 0; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
nav.main { display: flex; gap: .25rem; flex-wrap: wrap; }
nav.main a { color: var(--muted); text-decoration: none; padding: .4rem .75rem; border-radius: 8px; font-weight: 500; }
nav.main a:hover, nav.main a[aria-current="page"] { background: var(--surface-2); color: var(--text); }

main { flex: 1; padding-bottom: 3rem; }
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 .6rem; letter-spacing: -.02em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.1rem; }
.badges { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; padding: 0; list-style: none; }
.badges li { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: .2rem .8rem; font-size: .85rem; color: var(--muted); }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
  text-align: center; padding: 2.25rem 1rem; cursor: pointer;
  background: var(--surface); border: 2px dashed var(--border); border-radius: var(--radius);
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--surface-2); }
.drop svg { width: 44px; height: 44px; color: var(--accent); }
.drop strong { font-size: 1.1rem; }
.drop span { color: var(--muted); font-size: .92rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; margin-top: 1.25rem; }
.panel h2 { font-size: 1.1rem; margin: 0 0 .9rem; }
.grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .lbl { font-weight: 600; font-size: .9rem; margin-bottom: .4rem; padding: 0; display: block; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: .25rem; flex: 1; min-width: 90px; }
.field small, .note { color: var(--muted); font-size: .85rem; }
input[type="number"], select {
  width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: .5rem .6rem; min-height: 40px;
}
input[type="color"] { width: 48px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
input:disabled, select:disabled { opacity: .55; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg); margin-bottom: .6rem; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.seg span { display: block; padding: .45rem .9rem; font-weight: 500; font-size: .92rem; }
.seg input:checked + span { background: var(--accent); color: var(--accent-text); }
.seg input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-size: .92rem; cursor: pointer; min-height: 40px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.presets { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 40px; padding: .45rem 1rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-text); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { min-height: 34px; padding: .25rem .7rem; font-size: .88rem; }
.btn.chip { min-height: 32px; padding: .2rem .7rem; font-size: .85rem; font-weight: 500; border-radius: 999px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.bar .row { gap: .5rem; }
.summary { color: var(--muted); font-size: .95rem; }
.list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .75rem; }
.card { display: grid; grid-template-columns: 96px 1fr auto; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; box-shadow: var(--shadow); }
.thumb { width: 96px; height: 96px; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.thumb img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; }
.info { min-width: 0; }
.fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { color: var(--muted); font-size: .9rem; margin-top: .15rem; }
.meta b { color: var(--text); font-weight: 600; }
.saved { color: var(--ok); font-weight: 600; }
.grew { color: var(--err); font-weight: 600; }
.err { color: var(--err); }
.actions { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; margin-right: .4rem; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } * { transition: none !important; } }

.faq h2, .content h2 { margin-top: 2.25rem; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .1rem 1rem; margin-bottom: .6rem; }
summary { cursor: pointer; font-weight: 600; padding: .7rem 0; }
details p { margin: 0 0 .9rem; color: var(--muted); }
.content { padding-top: 1.5rem; }
.content h1 { font-size: 2rem; letter-spacing: -.02em; margin-bottom: .4rem; }
.content .lead { color: var(--muted); font-size: 1.1rem; }
.notfound { text-align: center; padding: 4rem 0; }
.notfound .big { font-size: 5rem; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

footer.site { border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1.25rem 0; }
footer.site nav { display: flex; gap: 1rem; }

@media (max-width: 560px) {
  .card { grid-template-columns: 72px 1fr; }
  .thumb { width: 72px; height: 72px; }
  .actions { grid-column: 1 / -1; justify-content: stretch; }
  .actions .btn { flex: 1; }
}
