:root {
  --bg: #f5f8f8;
  --surface: #ffffff;
  --surface-2: #eef3f3;
  --text: #16201f;
  --muted: #5f6f6d;
  --border: #dbe4e3;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #e6f4f2;
  --ok: #15803d;
  --bad: #b91c1c;
  --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(10, 30, 30, .05), 0 8px 24px rgba(10, 30, 30, .06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1514;
    --surface: #17201f;
    --surface-2: #1f2a29;
    --text: #e6eeed;
    --muted: #93a5a2;
    --border: #2a3836;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #163330;
    --ok: #4ade80;
    --bad: #f87171;
    --on-accent: #062b27;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
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;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 19px; }
.brand b { color: var(--accent); }
.topnav { display: flex; gap: 22px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 15px; }
.topnav a:hover { color: var(--text); }

.hero { text-align: center; padding-top: 48px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: -.02em; }
.lead { color: var(--muted); max-width: 640px; margin: 14px auto 0; font-size: 17px; }

.drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 40px 16px; border: 2px dashed var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--accent); cursor: pointer; transition: border-color .15s, background .15s;
}
.drop strong { color: var(--text); font-size: 17px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.options { display: flex; flex-wrap: wrap; gap: 16px 24px; padding: 18px 20px; margin-top: 16px; align-items: flex-end; }
.options label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; min-width: 140px; }
.options output { color: var(--text); font-weight: 700; }
select, input[type=number] {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px;
}
input[type=range] { accent-color: var(--accent); width: 180px; }
input[type=color] { width: 56px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); padding: 2px; }
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }
.btn { border: 1px solid transparent; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; padding: 10px 18px; transition: background .15s; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.file {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
.thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.meta { min-width: 0; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-line { font-size: 13px; color: var(--muted); }
.info-line .down { color: var(--ok); font-weight: 600; }
.info-line .up { color: var(--bad); font-weight: 600; }
.info-line .err { color: var(--bad); }
.file-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.info { margin-top: 64px; }
.info > h2 { font-size: 26px; margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 17px; margin-bottom: 6px; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }
.footer { margin-top: 64px; padding: 28px 0; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; text-align: center; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; transition: .2s; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .topnav a:first-child { display: none; }
  .cards { grid-template-columns: 1fr; }
  .file { grid-template-columns: 48px 1fr; }
  .thumb { width: 48px; height: 48px; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .options label { min-width: calc(50% - 12px); }
  input[type=range] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
