:root {
  --bg: #f3f1ec;
  --card: #ffffff;
  --text: #1c2321;
  --muted: #66706c;
  --line: #dcd8cf;
  --accent: #1f6f5c;
  --accent-text: #ffffff;
  --accent-soft: #e4f0ec;
  --danger: #b3372c;
  --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --card: #1b211f;
    --text: #e9ece9;
    --muted: #99a39f;
    --line: #2f3835;
    --accent: #4fb89c;
    --accent-text: #0c1513;
    --accent-soft: #1f302b;
    --danger: #ef8377;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: inherit;
  text-decoration: none;
}
.brand svg { width: 30px; height: 30px; }
.brand rect { fill: var(--accent); }
.brand path { fill: none; stroke: var(--accent-text); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tag {
  font-size: 0.8rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: 999px;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4vh 16px 32px;
}
.card {
  width: 100%;
  max-width: 540px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.06);
}
h1 { margin: 0 0 6px; font-size: 1.5rem; letter-spacing: -0.02em; text-wrap: balance; }
.lede { margin: 0 0 20px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.error { color: var(--danger); margin: 12px 0; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 34px 16px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.drop span { color: var(--muted); font-size: 0.9rem; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.files { list-style: none; margin: 16px 0 0; padding: 0; }
.files li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.files .size { color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.files progress, .files .status { grid-column: 1 / -1; }
.files .status { font-size: 0.8rem; color: var(--muted); }
#picked-total { margin: 8px 0 0; }

.row { display: flex; gap: 12px; margin-top: 18px; }
.row .field { flex: 1; margin: 0; }
.field { display: block; margin: 14px 0; }
.field > span:first-child { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }

input, select, button, .button {
  font: inherit;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  background: var(--card);
}
input, select { width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, .button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button, .button { cursor: pointer; text-decoration: none; display: inline-block; white-space: nowrap; }
button:hover:not(:disabled), .button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.danger { color: var(--danger); }
button.link { border: 0; padding: 4px 6px; color: var(--muted); background: none; }
#send-btn, #rx-all, #rx-locked button { width: 100%; margin-top: 18px; padding: 12px; }

.copy { display: flex; gap: 8px; }
.actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 18px; }
.split { display: flex; justify-content: space-between; margin: 6px 0 14px; font-variant-numeric: tabular-nums; }

details { margin: 6px 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; font-size: 0.95rem; }

progress {
  width: 100%;
  height: 8px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  accent-color: var(--accent);
}
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--accent); transition: width 0.2s; }
progress::-moz-progress-bar { background: var(--accent); }

footer { padding: 16px 24px 24px; text-align: center; font-size: 0.8rem; color: var(--muted); }

@media (max-width: 480px) {
  .card { padding: 20px; }
  .row, .actions { flex-direction: column; }
  .tag { display: none; }
}
