:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --ink: #f4f7fb;
  --muted: #909bb0;
  --line: #2a3342;
  --card: #1a202b;
  --accent: #4398D1;
  --accent-ink: #9fd0ee;
  --danger: #e07a6a;
  --ok: #3ecf8e;
  --orange: #F49733;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.24), 0 8px 18px rgba(0, 0, 0, 0.18);
  --bar: 64px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 Sora, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.scene-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--bg);
  overflow: hidden;
}
.scene-bg .scene-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: center / cover no-repeat;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}
.scene-bg .scene-layer.show { opacity: 1; }
.scene-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(10, 13, 18, .48);
  pointer-events: none;
}
#yt-music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.scene-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.bg-reload {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(18, 24, 34, .88);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
}
.bg-reload svg { display: block; }
.bg-reload:hover { border-color: var(--accent); color: var(--accent-ink); filter: none; }
.bg-reload:disabled { opacity: .4; cursor: default; }
.lara-link {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: rgba(18, 24, 34, .88);
  color: var(--muted);
  border-radius: 10px;
  text-decoration: none;
  box-shadow: none;
}
.lara-link svg { display: block; }
.lara-link:hover { border-color: var(--accent); color: var(--accent-ink); }
.topbar, .shell { position: relative; z-index: 1; }

a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.25; font-weight: 680; }
h1 { font-size: 1.85rem; margin: 0; letter-spacing: -0.03em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: 0.98rem; }

button, input, textarea, select { font: inherit; }
button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset;
}
button:hover { filter: brightness(1.05); }
button.danger { background: var(--danger); }
button.icon-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border-radius: 8px;
  flex: 0 0 32px;
}
button.icon-act svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button.icon-act:hover {
  background: rgba(61, 111, 184, 0.12);
  color: var(--accent-ink);
  filter: none;
}
button.icon-act.is-delete:hover {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}
button.icon-act:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.linkish {
  background: transparent;
  color: var(--accent-ink);
  box-shadow: none;
  padding: 4px 8px;
  font-weight: 600;
}
button.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: auto;
  min-height: 40px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  text-align: left;
  padding: 7px;
  font-weight: 500;
  border-radius: 10px;
}
button.check .box {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  margin-top: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #121822;
  position: relative;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
button.check:hover .box { border-color: var(--accent-ink); }
button.check:active .box { transform: scale(0.92); }
button.check.on .box {
  background: var(--accent);
  border-color: var(--accent);
}
button.check.on .box::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
  animation: check-draw .18s ease;
}
.checks .check-label {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  padding: 8px 4px;
  cursor: text;
  border-radius: 8px;
}
.checks .check-hint { color: var(--muted); font-weight: 500; margin-left: 0.35em; }
.checks li.is-done .check-label { color: #9aa6b8; }
.checks li.is-done .check-hint { color: #7f8b9c; }
.check-edit {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  color: var(--ink);
  padding: 4px 8px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #121822;
}
.check-group { margin-bottom: 8px; }
.check-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 4px 4px 8px;
  font-weight: 750;
}
.check-head .chev {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  margin: 0 4px 3px 2px;
  transition: transform .15s ease;
}
.check-group.is-closed .chev { transform: rotate(-45deg); margin-top: 2px; }
.check-group.is-closed .checks { display: none; }
.check-name { font-size: 1.05rem; letter-spacing: -0.02em; }
.check-pill {
  margin-left: auto;
  background: rgba(255, 255, 255, .08);
  color: var(--ink);
  border-radius: 99px;
  min-width: 2.4em;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
}
.check-x {
  opacity: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
}
.checks li:hover .check-x,
.checks li:focus-within .check-x { opacity: 1; }
.check-x:hover { color: var(--danger); background: rgba(180, 35, 24, 0.08); }
@keyframes check-draw {
  from { transform: rotate(45deg) scale(0.5); opacity: 0; }
  to { transform: rotate(45deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  button.check .box,
  button.check.on .box::after { transition: none; animation: none; }
}

input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #121822;
  color: var(--ink);
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(67, 152, 209, 0.28);
}
label { display: block; font-weight: 650; font-size: 0.92rem; }
label input, label textarea, label select { margin-top: 6px; font-weight: 400; }
label.check { font-weight: 500; display: flex; gap: 8px; align-items: center; }
label.check input { width: auto; }

button.icon-btn {
  background: rgba(18, 24, 34, .88);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 7px 12px;
  font-weight: 650;
}
button.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); filter: none; }
.project-add {
  position: relative;
  flex: 0 0 auto;
}
button.project-add-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #e7edf5;
  box-shadow: none;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
button.project-add-btn:hover,
.project-add.is-open button.project-add-btn {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.project-add-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  width: min(240px, calc(100vw - 48px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 23, 31, .96);
  box-shadow: var(--shadow);
}
.project-add-form {
  display: grid;
  gap: 8px;
  margin: 0;
}
.project-add-form label {
  margin: 0;
  font-size: 13px;
}
.project-add-form input[type="text"] {
  width: 100%;
  margin: 0;
  background: #121822;
}
.project-add-form .form-actions {
  margin: 4px 0 0;
}
.project-add-form .ghost-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.project-add-form .ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--bar);
  padding: 10px 20px;
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.brand {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
  padding: 6px 10px;
  border-radius: 999px;
}
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.spacer { flex: 1; }
.who-menu {
  position: relative;
  flex: 0 0 auto;
}
button.who {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  background: rgba(18, 23, 31, .9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  box-shadow: none;
  cursor: pointer;
}
button.who:hover,
.who-menu.is-open button.who {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.who-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 23, 31, .96);
  box-shadow: var(--shadow);
}
.who-pop a,
.who-logout-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: normal;
  text-align: left;
  white-space: nowrap;
}
.who-pop a:hover,
.who-logout-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-ink);
}
.who-logout {
  margin: 0;
}
.who-logout-btn {
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.auth-links {
  margin: 14px 0 0;
  font-size: 14px;
}
.auth-links a {
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
}
.auth-links a:hover { text-decoration: underline; }
.ping-status {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ping-status:empty { display: none; }
.ping-status.is-ok .ping-ok { color: var(--ok); }
.ping-status.is-fail .ping-label { color: var(--danger); }
form.inline { display: inline; margin: 0; }

.shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--bar)); }
.shell > main {
  flex: 1;
  min-width: 0;
  transition: opacity .2s ease;
}
/* Hover/click in topbar or project menu: work area peeks wallpaper at ~80% transparent. */
html.chrome-peek .shell > main { opacity: 0.2; }
.sidebar {
  position: relative;
  width: 272px;
  flex: 0 0 272px;
  background: rgba(18, 24, 34, .72);
  color: #e7edf5;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-right: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(10px);
  transition: width .18s ease, flex-basis .18s ease;
  z-index: 3;
  font-size: 14px;
}
.sidebar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  width: 272px;
}
html.sidebar-closed .sidebar {
  width: 16px;
  flex-basis: 16px;
  border-right-color: rgba(255, 255, 255, .2);
}
html.sidebar-closed .sidebar-body {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sidebar-rail-tab {
  display: none;
  position: absolute;
  top: 72px;
  left: 0;
  width: 34px;
  height: 52px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: rgba(18, 24, 34, .92);
  color: #e7edf5;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  z-index: 4;
}
.sidebar-rail-tab svg { display: block; }
html.sidebar-closed .sidebar-rail-tab { display: grid; }
.sidebar-rail-tab:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 14px 8px;
}
.sidebar-head-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sidebar-head h2 { margin: 0; color: #fff; font-size: 15px; letter-spacing: -0.02em; }
.project-divider-add {
  margin: 0;
  flex: 0 0 auto;
}
.project-divider-add .project-add-btn svg { display: block; }
.project-divider-row {
  min-height: 28px;
  gap: 2px;
}
.project-divider-row:hover { background: transparent; }
.project-divider {
  flex: 1;
  min-width: 0;
  height: 1px;
  margin: 0 6px 0 2px;
  background: rgba(255, 255, 255, 0.22);
}
.project-divider-del {
  margin: 0;
  flex: 0 0 auto;
  opacity: 0;
  transition: opacity .12s ease;
}
.project-divider-row:hover .project-divider-del,
.project-divider-row:focus-within .project-divider-del { opacity: 1; }
.project-divider-del-btn {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b7c3d4;
  box-shadow: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.project-divider-del-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  filter: none;
}
.sidebar-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: transparent;
  color: #e7edf5;
  box-shadow: none;
  cursor: pointer;
}
.sidebar-icon-btn svg { display: block; }
.sidebar-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.sidebar .icon-btn {
  color: #e7edf5;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.16);
}
.sidebar input[type="search"] {
  margin: 4px 14px 12px;
  width: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
.sidebar input::placeholder { color: #b7c3d4; }
#project-list { flex: 1; min-height: 0; overflow: auto; padding: 0 0 16px; }
.project-row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 2px 8px;
  border-radius: 10px;
}
.project-row:hover { background: rgba(255, 255, 255, 0.08); }
.project-grip {
  flex: 0 0 28px;
  width: 28px;
  height: 32px;
  padding: 0;
  background: transparent;
  color: #9aabc2;
  box-shadow: none;
  border-radius: 8px;
  cursor: grab;
}
.project-grip svg { display: block; margin: 0 auto; }
.project-grip:hover { background: rgba(255, 255, 255, 0.12); color: #fff; filter: none; }
.project-grip:active { cursor: grabbing; }
#project-list a {
  display: block;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 10px 8px 2px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
#project-list a:hover { background: transparent; }
#project-list a.is-current { background: var(--accent); color: #fff; }
.sidebar-empty { margin: 8px 16px; color: #b7c3d4; font-size: 12px; }

.page, .board-page, .boards-home { min-height: calc(100vh - var(--bar)); }
.page { max-width: 1040px; margin: 0 auto; padding: 28px 24px 40px; }
/* boards.php: Hauptfläche leer, Wallpaper/Theme scheinen durch */
.boards-home {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
}
.boards-home > .flash {
  margin: 16px 22px;
  max-width: 520px;
}
.sidebar-create {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.sidebar-create input[type="text"] {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
.sidebar-create input::placeholder { color: #b7c3d4; }
.sidebar-create button {
  width: 100%;
}
.auth { max-width: 440px; margin: 10vh auto; padding: 8px; }
.page-head { display: flex; align-items: baseline; gap: 14px; padding: 20px 22px 4px; }
.page .page-head, .auth .page-head { padding: 0 0 8px; }
.topbar-board {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
.topbar-board .title-row {
  flex: 0 1 auto;
  min-width: 0;
}
.topbar-board .title-row h1 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(280px, 28vw);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.topbar-board .board-search {
  position: relative;
  margin-left: auto;
  flex: 0 1 280px;
  min-width: 140px;
}
.topbar-board .board-search input {
  width: 100%;
  background: #121822;
  padding-top: 7px;
  padding-bottom: 7px;
}
.board-search { position: relative; margin-left: auto; flex: 0 1 320px; }
.board-search input { width: 100%; background: #121822; }
.board-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: min(420px, 80vw);
  max-height: 360px;
  overflow: auto;
  background: #121822;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}
.board-results a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
}
.board-results a:hover { background: rgba(67, 152, 209, 0.14); }
.board-results strong { display: block; font-weight: 650; }
.board-results .hit-where,
.board-results .muted { display: block; margin: 2px 0 0; font-size: 13px; font-weight: 650; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-row h1 { min-width: 0; }
.manage { position: relative; flex: 0 0 auto; }
.manage-toggle {
  background: transparent;
  color: var(--accent-ink);
  box-shadow: none;
  padding: 6px 8px;
  font-weight: 700;
}
.manage-toggle .caret {
  display: inline-block;
  margin-right: 2px;
  transition: transform .15s ease;
}
.manage-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.manage-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 48px));
  max-height: min(70vh, 560px);
  overflow: auto;
  background: rgba(18, 24, 34, .96);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 16px 12px;
}
.manage-pop fieldset { border: 0; margin: 0; padding: 0; }
.manage-pop legend, .manage-section h2 {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 750;
  margin: 0 0 8px;
}
.manage-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.manage-line { display: flex; gap: 4px; align-items: center; }
.manage-row { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; flex: 1; min-width: 0; }
.manage-row input[type="text"] { flex: 1; min-width: 0; }
.manage-row input[type="color"] { flex: 0 0 42px; width: 42px; height: 36px; padding: 3px; }
.manage-row button:not(.icon-act) { flex: 0 0 auto; padding: 8px 10px; }
.manage-delete { margin: 8px 0 0; }
.manage-pop input[type="color"] { width: 52px; height: 38px; padding: 4px; }
.manage-board-delete { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
#save-state { font-size: 13px; }

.flash { border-radius: 12px; padding: 12px 14px; margin: 16px 22px; }
.page .flash, .auth .flash { margin: 0 0 16px; }
.flash.ok { background: rgba(62, 207, 142, .14); color: #b7f0d4; }
.flash.err { background: rgba(224, 122, 106, .14); color: #f0c2ba; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; margin: 16px 0; }
.stack.tight { margin: 8px 0; }
.card-form, .panel, .block, .board-list li {
  background: rgba(26, 32, 43, .88);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
}
.card-form { padding: 28px 26px; }
.card-form h1 { margin-bottom: 6px; }
.form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 6px;
}
.form-head h1 { margin: 0; }
.form-head .ticket-close { margin: -4px -4px 0 0; }
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
a.button.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  box-shadow: none;
}
a.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
}
.inline-create {
  display: flex;
  gap: 12px;
  align-items: end;
  margin: 8px 0 18px;
  background: var(--card);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.inline-create .grow { flex: 1; }

.board-list { list-style: none; padding: 0; display: grid; gap: 14px; }
.board-link { display: flex; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.board-link strong { font-size: 1.12rem; letter-spacing: -0.02em; }
.board-list li:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); }

.board-page {
  min-width: 0;
  max-width: 100%;
}
.board-frame {
  position: relative;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.board-nav {
  position: fixed;
  top: 50%;
  z-index: 8;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: rgba(18, 24, 34, .92);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  cursor: pointer;
  transform: translateY(-50%);
}
.board-nav svg { display: block; }
.board-nav:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 16px 22px 32px;
  /* Instant scroll: CSS scroll-behavior:smooth can hang scrollLeft in some Chromium embeds. */
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}
.column {
  /* Typical card: padding + title + short preview + margin-bottom (~125px observed). */
  --card-slot: 128px;
  /* col-head + borders; create form opens on demand via header + */
  --col-chrome: 56px;
  width: 304px;
  flex: 0 0 304px;
  background: rgba(255, 255, 255, .05);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  /* Prefer viewport fill, but never shorter than 12 typical tickets (no early scrollbar). */
  --col-height: max(
    calc(100vh - var(--bar) - 88px),
    calc(12 * var(--card-slot) + var(--col-chrome))
  );
  height: var(--col-height);
  min-height: var(--col-height);
  max-height: var(--col-height);
  border: 1px solid rgba(255, 255, 255, .26);
  box-shadow: none;
  overflow: hidden;
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px 12px;
  border-radius: 22px 22px 0 0;
  flex: 0 0 auto;
  position: relative;
  isolation: isolate;
  /* Stored hex stays in --col-bg. Paint a less saturated, slightly translucent matte. */
  background-color: color-mix(in srgb, var(--col-bg, #607d8b) 68%, #6d7582);
  background-color: hsl(from var(--col-bg, #607d8b) h calc(s * 0.58) l / 0.88);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(12, 16, 22, 0.16));
}
.col-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
  font-weight: 750;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.col-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  border-radius: 999px;
  min-width: 1.55em;
  height: 1.55em;
  padding: 0 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.col-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  box-shadow: none;
  cursor: pointer;
}
.col-add svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.col-add:hover {
  background: rgba(255, 255, 255, 0.38);
  filter: none;
}
.col-add:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.col-add[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.5);
}
.cards {
  /* min-height:0 so flex child can scroll; column height already reserves 12 slots */
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
}
.cards:empty::before {
  content: "Keine Tickets";
  display: block;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
}
.card {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 10px;
  box-shadow: none;
  border: 1px solid var(--line);
  border-top: 3px solid #3a4558;
  cursor: pointer;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
/* No transform on hover: it creates a containing block for position:fixed
   menus and misplaces .card-menu-pop until the mouse moves off the card. */
.card:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.card.sortable-chosen,
.card.sortable-fallback { cursor: grabbing; }
.card-menu {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
}
.card-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  opacity: 0.55;
  cursor: pointer;
}
.card:hover .card-menu-btn,
.card-menu-btn:focus-visible,
.card-menu.is-open .card-menu-btn,
.card-menu-btn[aria-expanded="true"] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  filter: none;
}
.card-menu-btn svg { display: block; }
.card-menu-pop {
  position: fixed;
  z-index: 80;
  min-width: 188px;
  margin: 0;
  padding: 4px;
  background: #121822;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  /* Visibility is click-driven via [hidden] / .is-open — never :hover. */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.card-menu-pop[hidden] {
  display: none !important;
}
.card-menu-pop button {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: 8px;
}
.card-menu-pop button:hover,
.card-menu-pop button:focus-visible {
  background: rgba(67, 152, 209, 0.14);
  color: var(--accent-ink);
  filter: none;
}
.card-open {
  display: block;
  padding: 14px 14px 12px;
  color: inherit;
  text-decoration: none;
}
.card h3 {
  margin: 0 0 8px;
  padding-right: 36px;
  font-size: calc(1em - 1px);
  font-weight: normal;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card .preview {
  padding-right: 36px;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card:hover h3 { color: var(--accent-ink); }
.preview { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.meta { margin: 10px 0 0; color: var(--muted); font-size: 12px; display: flex; gap: 10px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.tag {
  display: inline-block;
  border-radius: 99px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 650;
}
.ghost { opacity: 0.45; }
.add-ticket { display: flex; gap: 8px; padding: 0 12px 12px; flex: 0 0 auto; }
.add-ticket input { flex: 1; background: #121822; }
.add-ticket button { padding: 8px 12px; min-width: 42px; }
.column > .add-ticket {
  flex-wrap: wrap;
  padding: 10px 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.column > .add-ticket[hidden] { display: none !important; }
.column > .add-ticket input { flex: 1 1 100%; background: #121822; }
.column > .add-ticket button { min-width: 0; }
.column > .add-ticket .ghost-btn {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  border: 1px solid var(--line);
}
.column > .add-ticket .ghost-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  filter: none;
}
.col-admin, .column-new { padding: 8px 12px 12px; }
.column-new {
  gap: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(255, 255, 255, .26);
  box-shadow: none;
}
.column-new h2 { margin: 4px 0 0; }
.col-admin summary, .panel summary { cursor: pointer; font-weight: 650; color: var(--muted); }
.board-page .panel { padding: 12px 16px; box-shadow: none; }

.ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.ticket-layout > div > form.stack {
  background: rgba(26, 32, 43, .88);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 16px;
  padding: 18px 20px 16px;
  box-shadow: var(--shadow);
  margin-top: 0;
}
.block h2 {
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.checks button.linkish,
.tag-list button.linkish,
.thread button.linkish,
.template-list button.linkish {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  padding: 2px 6px;
}
.checks button.linkish:hover,
.tag-list button.linkish:hover,
.thread button.linkish:hover,
.template-list button.linkish:hover { color: var(--accent-ink); }
.side .block + .block { margin-top: 14px; }
.ticket-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}
.ticket-top .crumbs { margin: 8px 0 0; min-width: 0; }
.crumbs { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.crumbs a { font-weight: 650; text-decoration: none; }
.ticket-close {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -6px -4px 0 0;
  border-radius: 12px;
  background: #121822;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  font-size: 30px;
  line-height: 1;
  font-weight: 450;
}
.ticket-close:hover {
  color: var(--danger);
  background: #121822;
  border-color: rgba(224, 122, 106, 0.55);
}
.prose { white-space: pre-wrap; margin: 6px 0; }
.checks, .thread, .tag-list { list-style: none; padding: 0; margin: 0; }
.checks .js-check-toggle { flex: 0 0 auto; }
.checks li,
.template-list li {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 2px 0;
  padding: 0;
  border-radius: 10px;
}
.tag-assigned {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.tag-assigned h2 { margin-bottom: 8px; }
.tag-assigned .muted { margin: 0; }
.tag-list li {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 32px;
  margin: 1px 0;
  padding: 2px 4px;
  border-radius: 10px;
}
.tag-list li:hover { background: rgba(67, 152, 209, 0.1); }
.tag-list .tag {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.tag-list li:hover .tag-actions,
.tag-list li:focus-within .tag-actions {
  max-width: 60px;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
}
.tag-actions form { display: flex; align-items: center; margin: 0; }
.tag-list button.icon-act { width: 28px; height: 28px; flex: 0 0 28px; }
.tag-new {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.tag-new-row { display: flex; align-items: end; gap: 8px; }
.tag-new-row .grow { flex: 1; min-width: 0; }
.tag-new .tag-color { flex: 0 0 auto; }
.tag-new .tag-color input[type="color"] {
  display: block;
  width: 42px;
  height: 38px;
  margin-top: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #121822;
}
.tag-new button { width: 100%; }
.checks li { align-items: center; gap: 6px; }
.checks li:hover { background: rgba(67, 152, 209, 0.1); }
.check-grip {
  flex: 0 0 28px;
  width: 28px;
  height: 32px;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #9aa3ad;
  box-shadow: none;
  border: 0;
  border-radius: 8px;
  cursor: grab;
  opacity: 0;
}
.checks li:hover .check-grip,
.checks li:focus-within .check-grip,
.checks li.sortable-chosen .check-grip { opacity: 1; }
.check-grip svg { display: block; margin: 0 auto; }
.check-grip:hover { background: rgba(67, 152, 209, 0.16); color: var(--ink); }
.check-grip:active { cursor: grabbing; }
@media (pointer: coarse) {
  .check-grip { opacity: 0.7; }
}
.template-list { list-style: none; padding: 0; margin: 10px 0 0; }
.templates { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.templates h3 { margin: 0 0 8px; }
.thread li { border-top: 1px solid var(--line); padding: 12px 0; }
.thread li:first-child { border-top: 0; }
.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.grid th, .grid td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

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

.attach-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.attach-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.attach-list li:first-child { border-top: 0; }
.attach-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.attach-name {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.attach-size { color: var(--muted); font-size: 12px; }
.attach-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.attach-actions .ghost-btn,
.attach-preview-bar .ghost-btn {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
.attach-actions .ghost-btn:hover,
.attach-preview-bar .ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent-ink);
  filter: none;
}
.attach-upload { margin-top: 8px; }
.attach-preview-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #121822;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.attach-preview-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}
.attach-preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.attach-preview-body {
  height: min(70vh, 720px);
  background: #0a0d12;
}
.attach-preview-body img,
.attach-preview-body iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0d12;
}
.attach-preview-body img {
  object-fit: contain;
}

@media (max-width: 800px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .who { display: none; }
  .topbar-board {
    order: 5;
    flex: 1 1 100%;
    margin-top: 4px;
  }
  .topbar-board .title-row h1 { max-width: none; }
  .page { padding: 18px 14px 28px; }
}
