:root {
  color-scheme: light dark;
  --background: #f4f5f7;
  --surface: #fff;
  --text: #1c2330;
  --muted: #5b6472;
  --line: #d9dee6;
  --accent: #1555c5;
  --soft: #edf2fb;
  --error: #b3261e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: var(--background);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 640px; margin: 0 auto; padding: max(40px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
header { margin-bottom: 28px; }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
select { font: inherit; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; color: var(--accent); }
h1 { font-size: 2.5rem; line-height: 1.15; letter-spacing: -.04em; margin: 10px 0; }
h2 { font-size: 1.15rem; margin: 26px 0 14px; }
p { margin: 8px 0 0; }
header p, .muted, footer { color: var(--muted); }
.panel, .attachment { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
label { display: block; font-weight: 600; margin-bottom: 10px; }
input { font: inherit; max-width: 100%; width: 100%; }
input[type="file"] { padding: 4px 0; font-size: .9rem; }
input::file-selector-button { font: inherit; border: 1px solid var(--line); padding: 12px; border-radius: 8px; color: var(--text); background: var(--background); margin-right: 10px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
button, .download { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; flex: 1; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
progress { display: block; width: 100%; height: 6px; margin-top: 20px; accent-color: var(--accent); }
#status { overflow-wrap: anywhere; }
#status:empty { display: none; }
#status.error { color: var(--error); }
#file-info, .metadata { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
ul { padding: 0; list-style: none; margin: 0; }
.attachment { margin-bottom: 12px; }
.filename { margin: 0; font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.attachment .actions { margin-top: 14px; }
.attachment .share { background: var(--soft); color: var(--accent); border-color: transparent; }
footer { margin-top: 30px; font-size: .875rem; }
#offline { margin: 14px 0; }
details { border-top: 1px solid var(--line); padding-top: 16px; }
summary { cursor: pointer; min-height: 44px; color: var(--text); }
details p { margin-bottom: 12px; }
dialog { width: min(420px, calc(100% - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); }
dialog h2 { margin-top: 0; }
dialog label { margin-top: 18px; }
input[type="password"] { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--background); color: var(--text); }
dialog::backdrop { background: #10182880; }
[hidden] { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root { --background: #13161c; --surface: #1c2028; --text: #f0f2f6; --muted: #b2bac7; --line: #353d4b; --accent: #3175e6; --soft: #172d50; --error: #ffb4ab; }
  .attachment .share, .eyebrow { color: #a8c8ff; }
}
