/* cdn.svx.gg - Oberflaeche im Stil von Windows 11 (dunkel), passend zur App Shot. */

:root {
  --bg: #202020;
  --surface: #2B2B2B;
  --surface-2: #323232;
  --border: #1C1C1C;
  --border-strong: #3A3A3A;
  --text: #FFFFFF;
  --muted: #C5C5C5;
  --faint: #8A8A8A;
  --accent: #0078D4;
  --accent-hover: #1A86D9;
  --accent-text: #5AB4F5;
  --accent-soft: rgba(0, 120, 212, .22);
  --danger: #C42B1C;
  --danger-hover: #D13A2C;
  --danger-soft: rgba(196, 43, 28, .22);
  --radius: 8px;
  --radius-sm: 4px;
  --stage-max: max(320px, calc(100vh - 220px));
  --font: "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", Consolas, ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(0, 120, 212, .5); }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.main { flex: 1; display: flex; flex-direction: column; }

/* Kopfzeile ------------------------------------------------------------- */

.top-inner { display: flex; align-items: center; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 600; font-size: 15px; letter-spacing: -.005em;
  border-radius: 8px;
}
.brand:hover { text-decoration: none; color: #fff; }
.brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.mark { width: 28px; height: 28px; flex: none; display: block; }

/* Buttons --------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: #2D2D2D; color: var(--text);
  font: 400 14px/1 var(--font);
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { background: #272727; color: var(--muted); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn .icon { width: 16px; height: 16px; flex: none; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:active { background: #006CBE; color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); border-color: var(--danger-hover); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: rgba(255, 255, 255, .06); border-color: transparent; color: var(--text); }
.btn-ghost.is-on { color: var(--text); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }

.btn .i-done { display: none; }
.btn.is-done .i-done { display: block; }
.btn.is-done .i-main { display: none; }
.btn.is-done:not(.btn-primary) { border-color: var(--accent); color: var(--accent-text); }
.btn.is-failed:not(.btn-primary) { border-color: var(--danger); color: var(--danger); }
.btn-primary.is-failed { background: var(--danger); border-color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions-center { justify-content: center; }

/* Kachel mit Typ-Icon ---------------------------------------------------- */

.tile {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent-text);
}
.tile .icon { width: 22px; height: 22px; }
.tile-lg { width: 64px; height: 64px; border-radius: 12px; margin: 0 auto 18px; }
.tile-lg .icon { width: 30px; height: 30px; }
.tile-danger { background: var(--danger-soft); color: #FF99A4; }

/* Ansicht: Kopf --------------------------------------------------------- */

.view { padding-top: 8px; padding-bottom: 40px; }

.file-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px 24px; margin-bottom: 18px;
}
.file-title { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 320px; }
.file-text { min-width: 0; }
.file-name {
  margin: 0; font-family: "Segoe UI Variable Display", var(--font); font-size: 20px; font-weight: 600; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.meta { margin: 3px 0 0; display: flex; flex-wrap: wrap; gap: 0 10px; color: var(--muted); font-size: 13px; }
.meta span + span::before { content: "\00B7"; margin-right: 10px; color: var(--faint); }
.meta-center { justify-content: center; margin-top: 6px; }

/* Ansicht: Buehne -------------------------------------------------------- */

.stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stage-media {
  position: relative;
  display: flex;
  overflow: auto;
  min-height: 220px;
  max-height: var(--stage-max);
  background: repeating-conic-gradient(#1F1F1F 0 25%, #1A1A1A 0 50%) 0 0 / 22px 22px;
}
.stage-media img {
  display: block; flex: none; margin: auto;
  max-width: 100%; max-height: var(--stage-max);
  user-select: none; -webkit-user-select: none;
}
.stage-media.is-zoomable img { cursor: zoom-in; }
.stage-media.is-zoomed img { max-width: none; max-height: none; cursor: zoom-out; }

.stage-video { background: #000; display: flex; justify-content: center; }
.stage-video video { display: block; width: 100%; height: auto; max-height: var(--stage-max); background: #000; }

/* Text mit Zeilennummern. Die Nummern sind ::before und damit nicht Teil
   einer Auswahl oder Kopie. */
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--border);
}
.code-info { color: var(--muted); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-tools { display: flex; gap: 6px; flex: none; }

.code {
  --g: 3ch;
  counter-reset: ln;
  overflow-x: auto;
  padding: 12px 0 14px;
  font: 13.5px/1.6 var(--mono);
  tab-size: 4;
  -moz-tab-size: 4;
}
.code.g1 { --g: 1ch; } .code.g2 { --g: 2ch; } .code.g3 { --g: 3ch; }
.code.g4 { --g: 4ch; } .code.g5 { --g: 5ch; } .code.g6 { --g: 6ch; }

.code .l {
  position: relative;
  min-height: 1.6em;
  padding: 0 20px 0 calc(var(--g) + 36px);
  white-space: pre;
}
.code:not(.wrap) .l { width: max-content; min-width: 100%; }
.code.wrap .l { white-space: pre-wrap; overflow-wrap: anywhere; }
.code .l::before {
  counter-increment: ln;
  content: counter(ln);
  position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(var(--g) + 20px);
  padding-right: 12px;
  border-right: 1px solid var(--border);
  text-align: right;
  color: var(--faint);
  user-select: none; -webkit-user-select: none;
}
.code .l:hover { background: rgba(255, 255, 255, .025); }
.code .l:hover::before { color: var(--muted); }

.code-more {
  padding: 12px 16px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 13px;
}

/* Karten: Audio, Datei, Loeschen ---------------------------------------- */

.center { flex: 1; display: grid; place-items: center; padding-top: 24px; padding-bottom: 72px; }

.card {
  width: 100%; max-width: 560px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 16px 40px -24px rgba(0, 0, 0, .6);
}
.card-title { margin: 0; font-family: "Segoe UI Variable Display", var(--font); font-size: 20px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.card-text { margin: 8px 0 0; color: var(--muted); }
.card-text strong { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.card .actions { margin-top: 24px; }
.card audio { display: block; width: 100%; margin-top: 22px; }

.facts {
  display: grid; grid-template-columns: auto 1fr; gap: 10px 18px;
  margin: 22px 0 0; padding: 16px 18px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: left; font-size: 14px;
}
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.thumb {
  margin: 20px auto 0; max-width: 100%;
  display: flex; justify-content: center;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border);
  background: repeating-conic-gradient(#1F1F1F 0 25%, #1A1A1A 0 50%) 0 0 / 16px 16px;
}
.thumb img { display: block; max-width: 100%; max-height: 220px; }

/* Startseite und Fehler ------------------------------------------------- */

.hero { text-align: center; max-width: 520px; }
.mark-hero { width: 64px; height: 64px; margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(0, 120, 212, .35)); }
.hero-title { margin: 22px 0 8px; font-family: "Segoe UI Variable Display", var(--font); font-size: clamp(28px, 6vw, 40px); font-weight: 600; line-height: 1.15; }
.hero-title-sm { margin-top: 6px; font-size: clamp(24px, 5vw, 30px); }
.hero-text { margin: 0; color: var(--muted); font-size: 16px; }
.hero .actions { margin-top: 28px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 28px 0 0; padding: 7px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted); font-size: 13px;
}
.pill .icon { width: 15px; height: 15px; color: var(--accent-text); }

.status-code {
  font-size: clamp(64px, 14vw, 96px); font-weight: 700; line-height: 1; letter-spacing: -.04em;
  background: linear-gradient(180deg, var(--accent-text), var(--accent) 65%, #0063B1);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* Hilfsfeld fuer das Kopieren ohne Clipboard-API */
.clip { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Schmale Bildschirme --------------------------------------------------- */

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .top-inner { height: 56px; }
  .file-head { gap: 14px; margin-bottom: 14px; }
  .file-title { flex-basis: 100%; }
  .actions { width: 100%; }
  .file-head .actions .btn { flex: 1 1 auto; }
  .stage { border-radius: var(--radius); }
  .card { padding: 26px 20px; }
  .card .actions .btn { flex: 1 1 auto; }
  .code { font-size: 12.5px; }
  .code .l { padding-right: 12px; padding-left: calc(var(--g) + 28px); }
  .code .l::before { width: calc(var(--g) + 16px); padding-right: 8px; }
}

@media (max-width: 420px) {
  .code-tools .btn-ghost span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
