:root {
  color-scheme: light;
  --background: 48 30% 96%;
  --foreground: 30 8% 10%;
  --card: 45 25% 93%;
  --secondary: 45 22% 90%;
  --muted-foreground: 40 6% 39%;
  --accent: 217 84% 46%;
  --accent-foreground: 0 0% 98%;
  --destructive: 4 70% 47%;
  --ok: 142 55% 32%;
  --warn: 35 85% 40%;
  --border: 45 18% 85%;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --background: 30 8% 8%;
    --foreground: 45 25% 90%;
    --card: 30 7% 11%;
    --secondary: 30 6% 15%;
    --muted-foreground: 40 6% 60%;
    --accent: 217 90% 64%;
    --accent-foreground: 30 8% 8%;
    --destructive: 4 75% 60%;
    --ok: 142 50% 55%;
    --warn: 38 90% 58%;
    --border: 30 6% 20%;
  }
}
*, *::before, *::after { box-sizing: border-box; border-radius: 0 !important; }
html, body { margin: 0; }
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 400 15.5px/1.55 var(--mono);
  -webkit-font-smoothing: antialiased;
}
::selection { background: hsl(var(--accent) / 0.25); }
a { color: hsl(var(--accent)); text-underline-offset: 3px; }
main { max-width: 860px; margin: 0 auto; padding: 40px 20px 64px; }

.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(2.25rem, 7vw, 3.75rem); line-height: 1.04; margin: 0;
}
.brand h1::before { content: "■ "; color: hsl(var(--accent)); font-weight: 400; }
.lede { color: hsl(var(--muted-foreground)); margin: 10px 0 32px; font-size: 15.5px; max-width: 60ch; }
.lede .cursor-blink::after { content: "▋"; color: hsl(var(--accent)); animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

h2.section-heading {
  font-family: var(--display); font-weight: 700; letter-spacing: -0.01em;
  font-size: 1.35rem; margin: 0 0 12px;
}
h2.section-heading::before { content: "■ "; color: hsl(var(--accent)); font-weight: 400; }

.card { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 20px; margin-bottom: 20px; transition: border-color .2s; }

label.lbl { display: block; font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-bottom: 6px; }
.pwrow { display: flex; gap: 8px; flex-wrap: wrap; }
.pwrow input { flex: 1 1 260px; min-width: 0; }
input[type="password"], input[type="text"], textarea {
  font: inherit; font-size: 14.5px; color: inherit; background: hsl(var(--background));
  border: 1px solid hsl(var(--border)); padding: 10px 12px; width: 100%; outline: none;
}
input:focus-visible, textarea:focus-visible, button:focus-visible, .drop:focus-visible { outline: 1px solid hsl(var(--accent)); outline-offset: 1px; border-color: hsl(var(--accent)); }
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
textarea.out { min-height: 160px; font-size: 12.5px; }

button {
  font: inherit; font-size: 13.5px; cursor: pointer; padding: 9px 14px;
  border: 1px solid hsl(var(--border)); background: hsl(var(--secondary)); color: inherit;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
button:hover { border-color: hsl(var(--foreground) / 0.4); }
button.primary { background: hsl(var(--foreground)); color: hsl(var(--background)); border-color: hsl(var(--foreground)); }
button.primary:hover { background: hsl(var(--accent)); border-color: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
button:disabled { opacity: .5; cursor: not-allowed; }
kbd { font: inherit; font-size: 11px; border: 1px solid hsl(var(--border)); padding: 0 4px; color: hsl(var(--muted-foreground)); }

.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 12px 0 6px; }
.meter i { height: 4px; background: hsl(var(--secondary)); transition: background .2s; }
.meter[data-level="0"] i:nth-child(-n+1) { background: hsl(var(--destructive)); }
.meter[data-level="1"] i:nth-child(-n+2) { background: hsl(var(--warn)); }
.meter[data-level="2"] i:nth-child(-n+3) { background: hsl(var(--warn)); }
.meter[data-level="3"] i:nth-child(-n+4) { background: hsl(var(--ok)); }
.meter[data-level="4"] i:nth-child(-n+5) { background: hsl(var(--ok)); }
.meter[data-empty] i { background: hsl(var(--secondary)) !important; }
.meterinfo { font-size: 12.5px; color: hsl(var(--muted-foreground)); min-height: 1.5em; }
.meterinfo b { color: hsl(var(--foreground)); font-weight: 500; }

.tabs { display: flex; gap: 0; margin-bottom: -1px; position: relative; }
.tabs button { border-bottom-color: transparent; background: transparent; color: hsl(var(--muted-foreground)); padding: 10px 18px; }
.tabs button[aria-selected="true"] { background: hsl(var(--card)); color: hsl(var(--foreground)); border-color: hsl(var(--border)); border-bottom-color: hsl(var(--card)); }
.tabs button[aria-selected="true"]::before { content: "▸ "; color: hsl(var(--accent)); }
.tabs .hint { margin-left: auto; align-self: center; font-size: 11px; color: hsl(var(--muted-foreground)); }

.drop {
  border: 1px dashed hsl(var(--border)); padding: 28px 16px; text-align: center; cursor: pointer;
  color: hsl(var(--muted-foreground)); font-size: 13.5px; background: hsl(var(--background));
  transition: border-color .15s, color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: hsl(var(--accent)); color: hsl(var(--foreground)); }
.drop.over { background: hsl(var(--accent) / 0.06); }
.item textarea.out { margin-top: 10px; }
.item audio { width: 100%; display: block; margin-top: 10px; }
.drop b { color: hsl(var(--foreground)); font-weight: 500; }
.or { text-align: center; font-size: 11px; color: hsl(var(--muted-foreground)); margin: 14px 0; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.actions .sp { flex: 1; }
.small { font-size: 12.5px; color: hsl(var(--muted-foreground)); }

.results:empty { display: none; }
.item { border: 1px solid hsl(var(--border)); background: hsl(var(--card)); padding: 14px 16px; margin-bottom: 10px; animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(4px); } }
.item .top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.item .name { font-weight: 500; overflow-wrap: anywhere; }
.item .meta { font-size: 12.5px; color: hsl(var(--muted-foreground)); }
.item .status { margin-left: auto; font-size: 12.5px; }
.item.ok .status { color: hsl(var(--ok)); }
.item.ok .status::before { content: "✓ "; }
.item.err { border-color: hsl(var(--destructive) / 0.6); }
.item.err .status { color: hsl(var(--destructive)); }
.bar { height: 2px; background: hsl(var(--secondary)); margin-top: 10px; }
.bar i { display: block; height: 100%; width: 0; background: hsl(var(--accent)); transition: width .1s linear; }
.item .actions { margin-top: 10px; }
.item a.dl { font-size: 13.5px; }
.item img, .item video { max-width: 100%; max-height: 320px; display: block; margin-top: 10px; border: 1px solid hsl(var(--border)); }

details { font-size: 12.5px; color: hsl(var(--muted-foreground)); margin-top: 28px; }
details summary { cursor: pointer; color: hsl(var(--foreground)); }
details pre { font: inherit; font-size: 12px; white-space: pre-wrap; background: hsl(var(--card)); border: 1px solid hsl(var(--border)); padding: 14px; overflow-x: auto; }
footer { margin-top: 32px; font-size: 12.5px; color: hsl(var(--muted-foreground)); display: flex; gap: 16px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: hsl(var(--foreground)); color: hsl(var(--background)); padding: 8px 14px; font-size: 12.5px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.toast.show { opacity: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 560px) { main { padding: 24px 14px 48px; } .card { padding: 14px; } .tabs .hint { display: none; } }
