:root {
  --bg: #f6f5f2; --card: #ffffff; --text: #1d1d1b; --muted: #6b6a66;
  --line: #dedcd6; --accent: #2f6f5e; --accent-text: #fff; --err: #b3261e; --ok: #2f6f5e;
  --warn-bg: #fff4d6; --warn-text: #6a4b00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615; --card: #20201e; --text: #ecebe7; --muted: #9b9a95;
    --line: #34332f; --accent: #5fb39b; --accent-text: #0f1a17; --err: #f08b84; --ok: #7fcab4;
    --warn-bg: #3a3118; --warn-text: #f3d98a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
           max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
main { max-width: 520px; margin: 0 auto; }
h1 { font-size: 1.6rem; margin: 8px 0 4px; letter-spacing: -0.01em; }
.sub { margin: 0 0 20px; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }

label { display: block; font-size: .9rem; font-weight: 600; margin: 0 0 6px; }
.opt { font-weight: 400; color: var(--muted); }
input[type=text], input[type=password] {
  width: 100%; min-height: 48px; padding: 10px 12px; color: var(--text);
  font: inherit; font-size: 17px; /* >=16px stops iOS zooming on focus */
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 16px;
}
input:focus-visible, button:focus-visible, .pick:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

button, .pick { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.primary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 12px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 650; background: var(--accent); color: var(--accent-text); cursor: pointer;
}
.primary:disabled { opacity: .55; cursor: default; }
.primary:active { filter: brightness(.92); }
.plus { font-size: 1.6rem; line-height: 1; font-weight: 400; }
.secondary {
  width: 100%; min-height: 48px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.link { background: none; border: 0; padding: 8px 4px; margin: -8px -4px; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }

input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.who { margin: 0 0 14px; color: var(--muted); }
.who b { color: var(--text); }

.drop {
  display: none; margin-top: 10px; padding: 22px 12px; text-align: center; color: var(--muted);
  border: 2px dashed var(--line); border-radius: 12px; transition: border-color .15s, background .15s;
}
@media (hover: hover) and (pointer: fine) { .drop { display: block; } }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }

.msg { margin: 12px 0 0; font-size: .95rem; color: var(--err); min-height: 1.4em; }
.summary { margin-top: 16px; }
.sumline { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sumline span { color: var(--muted); font-variant-numeric: tabular-nums; }
progress { display: block; width: 100%; height: 8px; margin: 10px 0 0; accent-color: var(--accent); }
.status { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.banner { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--warn-text); font-size: .92rem; }

ul { list-style: none; padding: 0; margin: 16px 0 0; }
li { padding: 10px 2px; border-top: 1px solid var(--line); font-size: .95rem; }
li:first-child { border-top: 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fsize { color: var(--muted); font-size: .85rem; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.st { color: var(--muted); flex-shrink: 0; min-width: 4.5em; text-align: right; font-variant-numeric: tabular-nums; }
.st.err { min-width: 0; max-width: 55%; white-space: normal; }
.st.ok { color: var(--ok); } .st.err { color: var(--err); }
li progress { height: 4px; margin-top: 6px; }
