/*
 * Pixelfox Code: Stylesheet im Stil von pixelfox.io.
 * Pixelschrift (Jersey 25) für Marke, Reiter, Rubriken und große Nummern;
 * Systemschrift für Text, Mono in Großbuchstaben für Metazeilen. Eckige
 * Reiter und Buttons, Fuchs-Orange als Akzent, flache Flächen ohne Schatten.
 */

@font-face {
  font-family: 'Jersey 25';
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/jersey-25-latin.woff2') format('woff2');
}

:root {
  color-scheme: light;
  --bg: #fbfbfd;
  --surface: #ffffff;
  --code-bg: #f6f7fa;
  --border: #e6e8ec;
  --border-strong: #cdd2da;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --fox: #f2701d;
  --fox-ink: #0b0d12;          /* Text auf Fuchs-Orange */
  --accent: #c2410c;           /* Orange mit genug Kontrast auf Hell */
  --success: #1a7f37;
  --warning: #9a6700;
  --danger: #cf222e;

  /* Syntax (GitHub-Light-Anmutung) */
  --hl-comment: #6e7781;
  --hl-keyword: #cf222e;
  --hl-string: #0a3069;
  --hl-number: #0550ae;
  --hl-title: #8250df;
  --hl-attr: #953800;
  --hl-tag: #116329;
  --hl-meta: #0550ae;

  --pixel: 'Jersey 25', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: .35rem;
  --maxw: 76rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d12;
    --surface: #14171f;
    --code-bg: #10131a;
    --border: #262b36;
    --border-strong: #39404e;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #5d6a7e;
    --accent: #f2701d;
    --success: #3fb950;
    --warning: #d29922;
    --danger: #f0533f;
    --hl-comment: #8b949e;
    --hl-keyword: #ff7b72;
    --hl-string: #a5d6ff;
    --hl-number: #79c0ff;
    --hl-title: #d2a8ff;
    --hl-attr: #ffa657;
    --hl-tag: #7ee787;
    --hl-meta: #79c0ff;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12;
  --surface: #14171f;
  --code-bg: #10131a;
  --border: #262b36;
  --border-strong: #39404e;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #5d6a7e;
  --accent: #f2701d;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f0533f;
  --hl-comment: #8b949e;
  --hl-keyword: #ff7b72;
  --hl-string: #a5d6ff;
  --hl-number: #79c0ff;
  --hl-title: #d2a8ff;
  --hl-attr: #ffa657;
  --hl-tag: #7ee787;
  --hl-meta: #79c0ff;
}

/* --- Basis ------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; color: var(--text); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.dot { display: inline-block; width: 3px; height: 3px; background: currentColor; opacity: .5; margin: 0 8px; vertical-align: middle; }

.icon { width: 16px; height: 16px; flex: none; }
.icon--lg { width: 28px; height: 28px; }
.logo-mark { width: 26px; height: 26px; flex: none; border-radius: .3rem; image-rendering: pixelated; }

:focus-visible { outline: 2px solid var(--fox); outline-offset: 1px; }

/* --- Leiste ------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.topbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--pixel);
  font-size: 1.35rem;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand b { font-weight: 400; color: var(--fox); }
.topbar__nav { display: flex; align-items: center; gap: .45rem; }

/* Eckige Reiter wie auf der Website. */
.page-tab {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 2rem;
  padding: 0 .8rem;
  border: 1px solid var(--text);
  font-family: var(--pixel);
  font-size: 1.1rem;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.page-tab:hover, .page-tab:focus-visible, .page-tab.is-active {
  border-color: var(--fox);
  background: var(--fox);
  color: var(--fox-ink);
  text-decoration: none;
}
.page-tab .icon { width: 14px; height: 14px; }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 6vh, 3.5rem) clamp(1rem, 4vw, 1.5rem) 3rem;
}

/* --- Fuß --------------------------------------------------------------- */

.foot {
  padding: 2rem 1.5rem 2.5rem;
  text-align: center;
  line-height: 2;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.foot a { color: inherit; }
.foot a:hover { color: var(--text); }
.foot .sep { margin: 0 .55rem; opacity: .6; }

/* --- Rubriken und Kopf --------------------------------------------------- */

.kicker {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 0 0 1rem;
  font: 400 1.5rem/1 var(--pixel);
  letter-spacing: .02em;
  color: var(--fox);
}
.kicker::before { content: ''; width: 2.2rem; height: 1px; background: currentColor; }

.page-head {
  margin: 0 0 1.25rem;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.page-lead {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  font-size: 1.15rem;
  color: var(--text-muted);
}

.section { margin-top: 3rem; }
.section > .kicker { margin-bottom: 1.25rem; }

/* --- Buttons ------------------------------------------------------------ */

/* Haupt-Buttons in der Pixelschrift, eckig; Hover füllt Fuchs-Orange. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  height: 2.4rem;
  padding: 0 1rem;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font: 400 1.15rem/1 var(--pixel);
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:hover, .btn:focus-visible {
  border-color: var(--fox);
  background: var(--fox);
  color: var(--fox-ink);
  text-decoration: none;
}
.btn--sm { height: 2rem; padding: 0 .7rem; font-size: 1.05rem; }
.btn--icon { padding: 0; width: 2.4rem; }
.btn--sm.btn--icon { width: 2rem; }
.btn--primary { border-color: var(--fox); background: var(--fox); color: var(--fox-ink); }
.btn--primary:hover, .btn--primary:focus-visible { border-color: var(--text); background: transparent; color: var(--text); }
.btn--ghost { border-color: transparent; color: var(--text-muted); }
.btn--danger { color: var(--text-muted); }
.btn--danger:hover, .btn--danger:focus-visible { border-color: var(--danger); background: var(--danger); color: #fff; }
.btn--danger-solid { border-color: var(--danger); color: var(--danger); }
.btn--danger-solid:hover, .btn--danger-solid:focus-visible { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.is-done { border-color: var(--success); background: var(--success); color: #fff; }
.btn .icon { width: 15px; height: 15px; }

/* Kleine Nebenaktionen (Icon-Buttons) dezenter. */
.btn--icon { border-color: var(--border-strong); color: var(--text-muted); }
.btn--icon:hover, .btn--icon:focus-visible { border-color: var(--fox); background: transparent; color: var(--fox); }
.btn--ghost.btn--icon { border-color: transparent; }

/* --- Badges und Tags ------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  height: 20px;
  padding: 0 .5rem;
  border: 1px solid var(--border-strong);
  font: 500 .68rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  vertical-align: middle;
}
.badge .icon { width: 11px; height: 11px; }
.badge--warn { border-color: color-mix(in srgb, var(--warning) 55%, transparent); color: var(--warning); }
h1 .badge { margin-left: .6rem; position: relative; top: -.35em; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tag {
  --lang: #8a8a8a;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  height: 22px;
  padding: 0 .55rem;
  border: 1px solid color-mix(in srgb, var(--lang) 55%, transparent);
  background: color-mix(in srgb, var(--lang) 14%, transparent);
  color: color-mix(in srgb, var(--lang) 62%, var(--text));
  font: 500 .72rem/1 var(--mono);
  letter-spacing: .06em;
  white-space: nowrap;
}
.tag i { width: 7px; height: 7px; background: var(--lang); flex: none; }

/* --- Startseite: Karten --------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1rem; }

.card {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  padding: 1.15rem 1.2rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  min-width: 0;
  transition: border-color .2s ease, transform .2s ease;
}
.card:hover { border-color: var(--fox); text-decoration: none; transform: translateY(-2px); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card__head h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s ease;
}
.card:hover .card__head h3 { color: var(--fox); }
.card__desc { color: var(--text-muted); font-size: .92rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__preview {
  margin: .2rem 0 0;
  padding: .6rem .75rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: 12px/1.55 var(--mono);
  overflow: hidden;
  max-height: 128px;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}
.card__preview code { font-size: inherit; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: .35rem; }
.card__foot > .muted { font: 500 .7rem/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; }

.empty { text-align: center; padding: 4rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }

/* 404 wie die Fehlerseite der Website: riesige Pixelzahl. */
.lost {
  margin: 0 0 1.5rem;
  font: 400 clamp(6rem, 22vw, 9rem)/.8 var(--pixel);
  color: var(--fox);
}

/* --- Repo-Ansicht --------------------------------------------------------- */

.back { margin-bottom: 1.1rem; font: 600 .72rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.back a { display: inline-flex; align-items: center; gap: .35rem; color: var(--accent); }
.back .icon { width: 13px; height: 13px; }

.repo__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.repo__head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; }
.repo__desc { margin-top: .5rem; font-size: 1.05rem; color: var(--text-muted); max-width: 46rem; }
.repo__tags { margin-top: .8rem; }
.repo__meta {
  margin-top: .6rem;
  font: 500 .7rem/1.5 var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.repo__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.repo { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1rem; align-items: start; }
.repo--single { grid-template-columns: minmax(0, 1fr); }
.repo__tree {
  position: sticky; top: 4.25rem;
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding: .5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.panel--pad { padding: 1.2rem; }
.panel--pad > h2, .panel__head h2 { font: 400 1.35rem/1 var(--pixel); letter-spacing: .02em; }
.panel--pad > h2 { margin-bottom: 1rem; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .75rem .9rem .75rem 1.2rem; border-bottom: 1px solid var(--border); }
.panel--danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.repo__file { overflow: hidden; }

/* Dateibaum */
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 14px; }
.tree a, .tree summary {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.tree a span, .tree summary span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree a .icon, .tree summary .icon { width: 15px; height: 15px; color: var(--text-dim); }
.tree a:hover, .tree summary:hover { background: color-mix(in srgb, var(--text) 6%, transparent); text-decoration: none; }
.tree a.is-active { background: color-mix(in srgb, var(--fox) 16%, transparent); color: var(--accent); font-weight: 600; box-shadow: inset 2px 0 0 var(--fox); }
.tree a.is-active .icon { color: currentColor; }
.tree summary { list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree .tree__chev { width: 12px !important; height: 12px !important; margin-right: -3px; transition: transform .15s ease; }
.tree details[open] > summary .tree__chev { transform: rotate(90deg); }
.tree > li > a { padding-left: 21px; }
.tree .tree > li > a { padding-left: 21px; }

/* Dateikopf */
.filebar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: .55rem .6rem .55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.filebar__name { min-width: 0; }
.crumbs { font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs__dir { color: var(--text-muted); }
.crumbs__sep { color: var(--text-dim); margin: 0 3px; }
.crumbs__file { font-weight: 700; }
.filebar__meta { font: 500 .66rem/1.4 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }
.filebar__meta .dot { margin: 0 6px; }
.filebar__actions { display: flex; gap: 6px; flex: none; }

/* Code */
.viewer--code { display: flex; background: var(--code-bg); overflow: auto; }
.code__gutter, .code { font: 12.8px/1.6 var(--mono); padding: 14px 0; margin: 0; }
.code__gutter {
  flex: none;
  padding: 14px 12px 14px 16px;
  text-align: right;
  color: var(--text-dim);
  white-space: pre;
  user-select: none;
  border-right: 1px solid var(--border);
  position: sticky;
  left: 0;
  background: var(--code-bg);
}
.code { flex: 1; padding-left: 16px; padding-right: 16px; tab-size: 4; overflow: visible; }
.code code { font: inherit; white-space: pre; display: block; }
.repo .viewer--code { max-height: calc(100vh - 230px); min-height: 160px; }
.repo--single .viewer--code { max-height: none; }
.viewer--image { padding: 24px; display: flex; justify-content: center; background: var(--code-bg); }
.viewer--image img { max-height: 70vh; object-fit: contain; }
.viewer--empty { padding: 3rem 1rem; display: flex; flex-direction: column; align-items: center; gap: .8rem; color: var(--text-muted); }

/* highlight.js über Tokens, passt sich hell/dunkel an */
.hljs-comment, .hljs-quote { color: var(--hl-comment); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-doctag, .hljs-template-tag { color: var(--hl-keyword); }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-template-variable { color: var(--hl-string); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-variable.constant_, .hljs-built_in { color: var(--hl-number); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section { color: var(--hl-title); }
.hljs-attr, .hljs-attribute, .hljs-property, .hljs-params, .hljs-variable, .hljs-selector-class, .hljs-selector-id { color: var(--hl-attr); }
.hljs-name, .hljs-tag, .hljs-selector-pseudo { color: var(--hl-tag); }
.hljs-meta, .hljs-link { color: var(--hl-meta); }
.hljs-deletion { color: var(--danger); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* --- Dialog / Toast / Flash ---------------------------------------------- */

.dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.dialog::backdrop { background: rgba(8, 10, 14, .6); }
.dialog__inner { padding: 1.2rem; display: flex; flex-direction: column; gap: .8rem; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; }
.dialog__head h2 { font: 400 1.5rem/1 var(--pixel); letter-spacing: .02em; }
.dialog__foot { display: flex; justify-content: flex-end; gap: .5rem; }
.embed-opts { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.embed-code {
  width: 100%;
  resize: vertical;
  padding: .6rem .75rem;
  font: 12px/1.5 var(--mono);
  color: var(--text);
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translate(-50%, 20px);
  padding: .5rem .9rem;
  background: var(--text);
  color: var(--bg);
  font: 500 .78rem/1.4 var(--mono);
  letter-spacing: .05em;
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 50;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast[data-type="error"] { background: var(--danger); color: #fff; }

.flash {
  max-width: var(--maxw);
  margin: 1rem auto 0;
  padding: .6rem .9rem;
  font-size: .92rem;
  border: 1px solid;
  border-left-width: 3px;
  width: calc(100% - 2rem);
}
.flash--ok { border-color: color-mix(in srgb, var(--success) 45%, transparent); border-left-color: var(--success); background: color-mix(in srgb, var(--success) 10%, transparent); }
.flash--error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* --- Formulare ------------------------------------------------------------ */

.stack { display: flex; flex-direction: column; gap: .9rem; }
.stack-sm { display: flex; flex-direction: column; gap: .5rem; }
.stack-lg { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.row { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.row.center { justify-content: center; align-items: center; }
.grow { flex: 1; min-width: 180px; }

.field { display: flex; flex-direction: column; gap: .3rem; }
.field > span {
  font: 600 .68rem/1.4 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field--inline { flex-direction: row; align-items: center; gap: .5rem; font-size: .9rem; }
.field--inline input { width: 90px; }
.field--inline > span { letter-spacing: .06em; }
input:not([type="checkbox"]):not([type="file"]), select, textarea {
  width: 100%;
  padding: .5rem .65rem;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font: .95rem/1.4 var(--sans);
}
textarea { resize: vertical; }
textarea.mono, input.mono { font: 13px/1.55 var(--mono); }
select { width: auto; min-width: 140px; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check input { margin-top: .25rem; accent-color: var(--fox); }
.prefix { display: flex; align-items: stretch; border: 1px solid var(--border-strong); background: var(--bg); }
.prefix span { display: flex; align-items: center; padding-left: .65rem; color: var(--text-dim); font-size: 13px; white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.prefix input { border: 0 !important; padding-left: 2px !important; }
.form-error { color: var(--danger); font-size: .92rem; }
.inline { display: inline; }

/* --- Verwaltung ------------------------------------------------------------ */

.admin__head { display: flex; align-items: flex-end; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin__head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; }
.admin__cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }

/* Kennzahlen: große Pixelnummern wie auf der Website. */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat {
  padding: .9rem 1.1rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat b { display: block; font: 400 2.6rem/1 var(--pixel); color: var(--fox); letter-spacing: .02em; }
.stat span { display: block; margin-top: .35rem; font: 600 .66rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }

.filter { max-width: 15rem; }
.filter input { padding: .35rem .6rem; font-size: .88rem; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left;
  padding: .6rem .9rem;
  border-bottom: 1px solid var(--border);
  font: 600 .66rem/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.table td { padding: .55rem .9rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { border-bottom-color: var(--fox); }
.table td.right { white-space: nowrap; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: .7rem;
  padding: 1.6rem 1rem;
  border: 1.5px dashed var(--border-strong);
  color: var(--text-muted);
  text-align: center;
  transition: border-color .2s ease, background .2s ease;
}
.dropzone.is-over { border-color: var(--fox); background: color-mix(in srgb, var(--fox) 10%, transparent); }
.upload-opts { margin-top: 1rem; }
.upload-status { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.progress { height: 6px; background: color-mix(in srgb, var(--text) 8%, transparent); overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--fox); transition: width .2s ease; }

.editor textarea { min-height: 50vh; }

.login { max-width: 380px; margin: 8vh auto 0; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.login__head { display: flex; align-items: center; gap: .6rem; }
.login__head h1 { font: 400 1.9rem/1 var(--pixel); letter-spacing: .02em; }

/* --- Embed ------------------------------------------------------------------ */

body.is-embed { background: var(--code-bg); height: 100vh; overflow: hidden; display: block; min-height: 0; }
.embed { display: flex; flex-direction: column; height: 100vh; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.embed__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: .3rem .6rem; border-bottom: 1px solid var(--border); }
.embed__title { display: flex; align-items: center; gap: .5rem; color: var(--text); font-family: var(--pixel); font-size: 1.05rem; min-width: 0; }
.embed__title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.embed__title .logo-mark { width: 18px; height: 18px; border-radius: .2rem; }
.embed__open { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); flex: none; font: 500 .68rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.embed__open .icon { width: 12px; height: 12px; }
.embed__main { flex: 1; min-height: 0; display: flex; }
.embed__tree { width: 210px; flex: none; overflow: auto; padding: 6px; border-right: 1px solid var(--border); }
.embed__file { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.embed__file .filebar { padding: .35rem .5rem .35rem .8rem; }
.embed__file .viewer { flex: 1; min-height: 0; overflow: auto; }
.embed-missing { padding: 24px; color: var(--text-muted); text-align: center; }

/* --- Schmal ------------------------------------------------------------------ */

@media (max-width: 900px) {
  .repo { grid-template-columns: minmax(0, 1fr); }
  .repo__tree { position: static; max-height: 280px; }
  .admin__cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .main { padding-bottom: 2.5rem; }
  .topbar__inner { height: 3rem; }
  .brand { font-size: 1.2rem; }
  .brand .logo-mark { width: 22px; height: 22px; }
  .page-tab { padding: 0 .5rem; font-size: .98rem; }
  .page-tab span { display: none; }
  .page-tab .icon { width: 15px; height: 15px; }
  .filebar { flex-wrap: wrap; }
  .embed__tree { display: none; }
  .flash { width: calc(100% - 2rem); }
  .stat b { font-size: 2.1rem; }
}
