:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f0ede7;
  --text: #1c1b19;
  --muted: #6b675f;
  --line: #ddd8cf;
  --accent: #b4441f;
  --accent-text: #ffffff;
  --ok: #2f7a4a;
  --warn-bg: #fff4e5;
  --warn-line: #e9b56a;
  --err: #b3261e;
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --surface-2: #252522;
    --text: #ece9e3;
    --muted: #a19c92;
    --line: #34332f;
    --accent: #e0683f;
    --accent-text: #170d08;
    --ok: #6cc28c;
    --warn-bg: #2b2215;
    --warn-line: #8a6630;
    --err: #ff8a80;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

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

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

header.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}
header.brand img { width: 28px; height: 28px; }
header.brand h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
header.brand span { color: var(--muted); font-size: 14px; margin-left: auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }

textarea, input, select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
textarea { min-height: 160px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 520px) { .row, .row.three { grid-template-columns: 1fr; } }

details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
summary { cursor: pointer; font-weight: 600; }
details > .field { margin-top: 14px; }

.check { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; }
.check input { width: auto; }

button {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
}
button.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.wide { width: 100%; margin-top: 20px; }

.linkbox { display: flex; gap: 8px; margin-top: 8px; }
.linkbox input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  padding: 20px;
}
.warn h2 { margin: 0 0 8px; font-size: 19px; }
.warn ul { margin: 10px 0 0; padding-left: 20px; }

.big { font-size: 40px; font-weight: 700; line-height: 1; }

.cover {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 180px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  width: 100%;
  padding: 20px;
}
.cover strong { display: block; color: var(--text); font-size: 18px; margin-bottom: 4px; }

.message {
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 17px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 16px;
  margin: 0;
}

.status { font-size: 14px; margin-top: 12px; }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

.drop {
  display: block;
  text-align: center;
  padding: 18px 12px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 400;
  cursor: pointer;
}
.drop strong { color: var(--text); }
.drop.over { border-color: var(--accent); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.filelist { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
}
/* Umbrechen statt abschneiden: Die Dateiendung muss immer sichtbar bleiben. */
.filelist .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.filelist li { flex-wrap: wrap; }
.filelist .risk { flex-basis: 100%; margin: 0; color: var(--err); font-size: 13px; font-weight: 600; }

.sender-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  border-left: 3px solid var(--warn-line);
  background: var(--warn-bg);
  border-radius: 6px;
}
.sender-note strong { color: var(--text); }
.filelist .size { color: var(--muted); white-space: nowrap; }
.filelist button { padding: 6px 10px; font-size: 13px; }
.filelist a.button {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  white-space: nowrap;
}

.previews { display: grid; gap: 10px; margin-top: 12px; }
.previews img { max-width: 100%; border-radius: 10px; display: block; }

.mt { margin-top: 12px; }
.hidden { display: none !important; }

footer { color: var(--muted); font-size: 13px; margin-top: 24px; }
footer a { color: inherit; }
