:root {
  --ink: #1b1712;
  --ink-soft: #4c443a;
  --muted: #8a7f70;
  --paper: #f4eee3;
  --card: #fffdf8;
  --line: #ddd3c2;
  --accent: #b98a1f;
  --accent-ink: #2a1f07;
  --ok: #2f6b3a;
  --ok-bg: #e6f1e4;
  --warn-bg: #f6ead2;
  --radius: 16px;
  --shadow: 0 1px 0 rgba(27, 23, 18, .04), 0 18px 50px rgba(60, 45, 20, .08);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #fffaf0 0%, rgba(255, 250, 240, 0) 60%),
    var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: min(100% - 40px, 560px);
  margin: 0 auto;
  padding: 56px 0 40px;
}

.shell.wide { width: min(100% - 40px, 900px); }

.masthead { margin-bottom: 28px; }

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.02em; }

h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 9vw, 72px);
  line-height: .95;
  letter-spacing: -.04em;
}

h1.small { font-size: clamp(28px, 5vw, 38px); }

h2 { font-size: 20px; }

h3 { font-size: 17px; }

.lede {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 42ch;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.muted { color: var(--muted); }

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.hint code {
  background: #f1eadc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}

.stack { display: grid; gap: 10px; margin-top: 18px; }

label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffefa;
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 138, 31, .15);
}

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fffaf0;
  border-radius: 10px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: #33291c; border-color: #33291c; }

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  padding: 8px 12px;
  font-size: 14px;
}

button.ghost:hover { background: #efe7d8; color: var(--ink); }

.alert {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8e5df;
  color: #7a2c1c;
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.claw-list { display: grid; gap: 0; }

.claw {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.claw:first-child { border-top: 0; padding-top: 4px; }

.claw-main { min-width: 0; }

.claw-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.claw-title h3 { margin: 0; }

.claw p { margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.badge.ok { background: var(--ok-bg); color: var(--ok); }

.muted-badge { background: #eee7da; color: #746a5a; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 2px;
}

.stat-n { font-size: 28px; font-weight: 650; letter-spacing: -.03em; }

.stat-l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  font-weight: 600;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td { padding: 11px 10px; border-bottom: 1px solid #eee7da; vertical-align: top; }

tr:last-child td { border-bottom: 0; }

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

@media (max-width: 620px) {
  .shell { padding-top: 36px; }
  .card { padding: 20px; }
  .claw { align-items: flex-start; flex-direction: column; }
  .claw .button { width: 100%; }
  .stats { grid-template-columns: 1fr; }
  .foot { flex-direction: column; gap: 4px; }
}

/* Bestandsbrowser */
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

a.button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  padding: 8px 12px;
  font-size: 14px;
}
a.button.ghost:hover { background: #efe7d8; color: var(--ink); }

.drive-tabs { display: flex; gap: 8px; flex-wrap: wrap; }

.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 14px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.crumb { color: var(--ink-soft); text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.crumb-sep { color: var(--muted); }
.crumb-last { color: var(--ink); font-weight: 600; }
.crumb.up { color: var(--accent); font-weight: 600; }

.file-name { color: var(--ink); text-decoration: none; }
.file-name:hover { text-decoration: underline; color: var(--accent); }

.td-actions { text-align: right; white-space: nowrap; }

.notice {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 14px;
}

.upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.upload input[type="file"] { width: auto; flex: 1; min-width: 220px; }
