:root {
  --bg: #f6f7f9;
  --card: #fff;
  --text: #1f2328;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --danger: #dc2626;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111418; --card: #1a1e24; --text: #e6e8eb; --muted: #9aa1ab; --border: #2c323a; --accent: #4f8cff; }
}

* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; word-break: break-all; }
a:hover { text-decoration: underline; }

header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 24px; background: var(--card); border-bottom: 1px solid var(--border); }
header h1 { margin: 0; font-size: 20px; }
.session { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }

main { max-width: 960px; margin: 0 auto; padding: 16px 24px 48px; }
main.narrow { max-width: 640px; }
main.login { max-width: 360px; margin-top: 15vh; }
main.login form { display: flex; gap: 8px; }
main.login input { flex: 1; }

section { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 20px; margin-top: 16px; }
section h2 { margin: 0 0 12px; font-size: 17px; }

input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); min-width: 0; }
textarea { width: 100%; resize: vertical; display: block; margin-bottom: 8px; }
button, .btn { padding: 7px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; white-space: nowrap; display: inline-block; }
button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button:disabled { opacity: .5; cursor: default; }
.btn:hover { text-decoration: none; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; margin-top: 12px; }
.row > input { flex: 1 1 160px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--danger); }

.list { list-style: none; margin: 12px 0 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.list li.column { flex-direction: column; align-items: stretch; }

pre, .snippet { margin: 0; padding: 10px; background: var(--bg); border-radius: 6px; white-space: pre-wrap; word-break: break-word; font: 13px/1.45 ui-monospace, Consolas, monospace; }
.snippet { max-height: 160px; overflow: auto; }

.drop-zone { display: block; padding: 24px; text-align: center; border: 2px dashed var(--border); border-radius: 8px; color: var(--muted); cursor: pointer; }
.drop-zone.over { border-color: var(--accent); color: var(--accent); }
#uploads { margin-top: 8px; }
progress { width: 200px; }

dialog { border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); width: min(520px, 92vw); }
dialog::backdrop { background: rgb(0 0 0 / .4); }
dialog h3 { margin-top: 0; }
dialog label { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
#share-result { margin-top: 8px; }
