:root {
  --bg: #f4f3ef; --panel: #fff; --ink: #1c1f24; --muted: #6a6f78; --line: #e2e0d9;
  --accent: #1f5f5b; --accent-ink: #fff; --accent-soft: #e3efed;
  --ok: #2f7d4f; --ok-soft: #e1f1e6; --warn: #9a6a12; --warn-soft: #f7ecd4; --bad: #b0352b; --bad-soft: #f8e2df;
  --radius: 8px; color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
.card h2 { margin-top: 0; }
h3 { font-size: .95rem; margin: 1.2rem 0 .4rem; }
code, pre { font: 13px/1.4 ui-monospace, "SF Mono", Consolas, monospace; }
pre { background: #1c1f24; color: #e8e6df; padding: .8rem 1rem; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.5rem; background: var(--ink); color: #d8d6cf; min-height: 56px; flex-wrap: wrap; }
.top a { color: #d8d6cf; text-decoration: none; }
.brand { font-weight: 700; color: #fff !important; display: flex; align-items: center; gap: .5rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #5fc4a0; display: inline-block; box-shadow: 0 0 0 3px rgba(95,196,160,.25); }
.top nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.top nav a { padding: .4rem .7rem; border-radius: 6px; }
.top nav a:hover { background: rgba(255,255,255,.08); }
.top nav a.on { background: rgba(255,255,255,.14); color: #fff; }
.me { margin-left: auto; display: flex; gap: 1rem; align-items: center; font-size: .85rem; }
.me form { margin: 0; }
.me .link { color: #d8d6cf; }

main { max-width: 1180px; margin: 0 auto; padding: 1.5rem; }
.muted, .sub, .hint { color: var(--muted); }
.sub { font-size: .82rem; }
.hint { font-size: .85rem; margin: .2rem 0; }
.crumb { margin: 0; font-size: .85rem; color: var(--muted); }
.empty { color: var(--muted); font-style: italic; }
.nowrap { white-space: nowrap; }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; margin-bottom: 1rem; }
.narrow { max-width: 560px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }
.stack { display: flex; flex-direction: column; gap: .7rem; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.inline label { flex: 0 1 auto; }
.row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.row form { margin: 0; }
.grow { flex: 1; }

label { display: flex; flex-direction: column; gap: .25rem; font-size: .85rem; font-weight: 600; }
label.check { flex-direction: row; align-items: center; font-weight: 400; gap: .4rem; }
input, select { font: inherit; padding: .5rem .6rem; border: 1px solid #cfccc3; border-radius: 6px; background: #fff; color: var(--ink); min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset { border: 1px solid var(--line); border-radius: 6px; padding: .6rem .8rem; display: flex; flex-direction: column; gap: .3rem; max-height: 240px; overflow: auto; }
legend { font-size: .85rem; font-weight: 600; padding: 0 .3rem; }
[hidden] { display: none !important; }

button, .button { font: inherit; font-weight: 600; padding: .5rem .9rem; border-radius: 6px; border: 1px solid #cfccc3; background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--ink); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover, .button.primary:hover { filter: brightness(1.1); }
button.danger { color: var(--bad); border-color: #e6bdb7; }
button.danger:hover { background: var(--bad); color: #fff; }
button.small { padding: .25rem .5rem; font-size: .8rem; }
button:disabled { opacity: .35; cursor: default; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 400; text-decoration: underline; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #faf9f6; }
th, td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
table.compact td { padding: .35rem .8rem; font-size: .85rem; }
tr.warnrow td { background: var(--warn-soft); }
tr.dim td { opacity: .6; }

.pill { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; background: #eceae4; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.off { background: #eceae4; color: var(--muted); }

.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: 1rem; border: 1px solid; }
.flash.ok { background: var(--ok-soft); border-color: #bfdcc9; color: #1e5434; }
.flash.error { background: var(--bad-soft); border-color: #ecc1bb; color: #7d231b; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.stats b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: .85rem; }

.auth { max-width: 400px; margin: 8vh auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 2rem; }
.auth h1 { display: flex; align-items: center; gap: .6rem; }

.keybox { background: var(--accent-soft); border: 1px solid #bcd9d5; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.keybox h2 { margin-top: 0; }
.copyrow { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.copyrow code { background: #fff; padding: .5rem .7rem; border-radius: 6px; border: 1px solid #bcd9d5; word-break: break-all; flex: 1; font-size: 14px; }

details.danger summary { cursor: pointer; color: var(--bad); font-weight: 600; }
details.danger[open] { background: #fffaf9; }
details.danger form { margin-top: .7rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: .5rem 0 1rem; font-size: .9rem; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); }
.kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.kind.group { color: var(--accent); }

.upload { display: flex; gap: 1rem; align-items: end; flex-wrap: wrap; }
.drop { flex: 1 1 320px; border: 2px dashed #cfccc3; border-radius: var(--radius); padding: 1rem; text-align: center; cursor: pointer; font-weight: 400; position: relative; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { font-weight: 600; }
.drop small { color: var(--muted); }
.files td { vertical-align: middle; }
.order form { display: block; margin: 2px 0; }
.thumb { width: 64px; height: 40px; object-fit: cover; border-radius: 4px; float: left; margin-right: .7rem; background: #eceae4; }
.thumb.ph { display: flex; align-items: center; justify-content: center; font-size: .65rem; color: var(--muted); font-weight: 700; }
.small-form input[type=number] { width: 5rem; }
.small-form label { font-weight: 400; font-size: .8rem; }

@media (max-width: 720px) {
  main { padding: 1rem; }
  .top { padding: .5rem 1rem; gap: .5rem; }
  .me { margin-left: 0; width: 100%; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  td { border: 0; padding: .3rem .8rem; }
  tr { border-bottom: 1px solid var(--line); padding: .4rem 0; }
}
.small-form label:first-of-type { flex-direction: row; align-items: center; gap: .3rem; }

.quota { margin: .4rem 0 1rem; max-width: 560px; }
.quota .bar { height: 8px; background: #e6e3dc; border-radius: 99px; overflow: hidden; margin-bottom: .25rem; }
.quota .bar span { display: block; height: 100%; background: var(--accent); }
.quota.high .bar span { background: var(--warn); }
.quota.full .bar span { background: var(--bad); }
td .quota { margin: .5rem 0 0; }
input.num { width: 7.5rem; }

.pill.bad { background: var(--bad-soft); color: var(--bad); text-decoration: none; }
.button.small { padding: .25rem .6rem; font-size: .8rem; }
.cmds { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cmds form { margin: 0; }
dl.cols { grid-template-columns: max-content 1fr; }
pre.result { background: none; color: var(--ink); padding: 0; margin: 0; font-size: 12px; max-height: 8rem; overflow: auto; white-space: pre-wrap; }
.logbox { background: #1c1f24; color: #e8e6df; border-radius: 6px; padding: .6rem .8rem; max-height: 480px; overflow: auto; font: 12px/1.5 ui-monospace, Consolas, monospace; }
.logline { display: grid; grid-template-columns: 8.5rem 4.5rem 4rem 1fr; gap: .6rem; white-space: pre-wrap; word-break: break-word; }
.logline .t, .logline .src { color: #9a978f; }
.logline.warning .lv { color: #f2c46b; }
.logline.error .lv, .logline.error .msg { color: #f0a39b; }
@media (max-width: 720px) { .logline { grid-template-columns: 1fr; gap: 0; margin-bottom: .4rem; } }

fieldset.scope { max-height: none; gap: .6rem; }
.scope-branch { border-top: 1px solid var(--line); padding-top: .5rem; }
.scope-folders { display: flex; flex-direction: column; gap: .2rem; margin: .3rem 0 .2rem 1.6rem; }
.scope-folders.dim { opacity: .45; }

textarea { font: inherit; padding: .5rem .6rem; border: 1px solid #cfccc3; border-radius: 6px; resize: vertical; }
pre.notes { background: #faf9f6; color: var(--ink); border: 1px solid var(--line); font: 13px/1.5 ui-monospace, Consolas, monospace; }
.release.dim { opacity: .6; }
.notes-box summary { cursor: pointer; color: var(--accent); margin: .6rem 0 .3rem; }

/* Marke */
.brand { gap: .55rem; }
.brand .logo-mark { width: 30px; height: 30px; }
.brand .logo-mark rect[fill="#1f5f5b"] { fill: #5fc4a0; }
.brand .logo-mark rect[fill="#e8f3f0"] { fill: #1c1f24; }
.brand .logo-mark rect[fill="#9fd9c5"] { fill: #1f5f5b; }
.brand .logo-mark circle { fill: #ffffff; }
.brand small, .auth-brand small { font-weight: 600; opacity: .7; }
.auth-brand { display: flex; align-items: center; gap: .6rem; font-size: 1.6rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.01em; margin-bottom: .4rem; }
.auth-brand .logo-mark { width: 44px; height: 44px; }
.auth-brand small { color: #5a8f86; }

.bad-text { color: var(--bad); }

.code-input { font: 600 1.15rem/1.2 ui-monospace, Consolas, monospace; letter-spacing: .15em; text-transform: uppercase; width: 10rem; }

/* Fortschrittsbalken beim Hochladen */
.progress { flex-basis: 100%; margin-top: .4rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #faf9f6; }
.progress-head, .progress-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.progress-head span { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }
.progress-bar { height: 12px; border-radius: 99px; background: #e6e3dc; overflow: hidden; margin: .6rem 0 .5rem; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #5fc4a0); transition: width .25s ease; }
.progress.done .progress-bar span { background: repeating-linear-gradient(45deg, #5fc4a0 0 14px, #7fd6b6 14px 28px); background-size: 40px 40px; animation: progress-stripes 1s linear infinite; }
.progress.error { border-color: #ecc1bb; background: var(--bad-soft); }
.progress.error .progress-bar span { background: var(--bad); }
.progress.error b { color: #7d231b; }
.upload.uploading .drop { opacity: .55; pointer-events: none; }
@keyframes progress-stripes { from { background-position: 0 0; } to { background-position: 40px 0; } }
@media (prefers-reduced-motion: reduce) { .progress.done .progress-bar span { animation: none; } }
