:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #2c2824;
  --muted: #6f675f;
  --line: #e6dfd4;
  --card: #fffdfb;
  --accent: #3d6fb8;
  --accent-ink: #2f5c9a;
  --danger: #b42318;
  --shadow: 0 1px 2px rgba(70, 48, 24, 0.05), 0 10px 28px rgba(70, 48, 24, 0.06);
  --shadow-card: 0 1px 2px rgba(70, 48, 24, 0.04), 0 8px 18px rgba(70, 48, 24, 0.06);
  --bar: 64px;
}

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

body {
  margin: 0;
  font: 15px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(255, 255, 255, 0.7), transparent 50%),
    var(--bg);
}

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: #fff;
  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: #5c6570; }
.checks li.is-done .check-hint { color: #8a929c; }
.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: #fff;
}
.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: #e7edf4;
  color: #3d4d63;
  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 #ddd4c8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  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(61, 111, 184, 0.18);
}
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: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 7px 12px;
  font-weight: 650;
}
.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: rgba(255, 252, 248, 0.92);
  border-bottom: 1px solid rgba(228, 220, 208, 0.9);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(8px);
}
.brand {
  font-weight: 750;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.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(61, 111, 184, 0.08); color: var(--accent-ink); }
.spacer { flex: 1; }
.who {
  color: var(--muted);
  font-size: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
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; }
.sidebar {
  width: 272px;
  flex: 0 0 272px;
  background: #243044;
  color: #e7edf5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .18s ease, flex-basis .18s ease;
}
html.sidebar-closed .sidebar {
  width: 0;
  flex-basis: 0;
  visibility: hidden;
}
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 18px 14px 8px;
}
.sidebar-head h2 { margin: 0; color: #fff; font-size: 1rem; letter-spacing: -0.02em; }
.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 { 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: 13px; }

.page, .board-page { min-height: calc(100vh - var(--bar)); }
.page { max-width: 1040px; margin: 0 auto; padding: 28px 24px 40px; }
.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; }
.board-page .page-head { align-items: center; }
.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: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.8);
  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: #e7f6ec; color: #1d5c32; }
.flash.err { background: #fdecea; color: #8a2218; }

.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: var(--card);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.card-form { padding: 28px 26px; }
.card-form h1 { margin-bottom: 6px; }
.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(70, 48, 24, 0.1); }

.board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding: 16px 22px 32px;
}
.column {
  width: 304px;
  flex: 0 0 304px;
  background: rgba(255, 252, 248, 0.72);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px 12px;
  border-radius: 16px 16px 0 0;
}
.col-head h2 { margin: 0; font-size: 15px; letter-spacing: -0.01em; font-weight: 750; }
.count {
  background: rgba(255, 255, 255, 0.92);
  color: #1b1b1b;
  border-radius: 99px;
  min-width: 1.6em;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
}
.cards { overflow: auto; padding: 12px; min-height: 64px; flex: 1; }
.cards:empty::before {
  content: "Keine Tickets";
  display: block;
  color: var(--muted);
  font-size: 13px;
  padding: 12px 4px;
}
.card {
  background: #fff;
  border-radius: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(232, 224, 214, 0.9);
  cursor: pointer;
}
.card:hover { box-shadow: 0 8px 22px rgba(70, 48, 24, 0.1); }
.card.sortable-chosen,
.card.sortable-fallback { cursor: grabbing; }
.card-open {
  display: block;
  padding: 14px 14px 12px;
  color: inherit;
  text-decoration: none;
}
.card h3 { margin: 0 0 8px; font-size: 15.5px; letter-spacing: -0.015em; }
.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; }
.add-ticket input { flex: 1; background: rgba(255, 255, 255, 0.85); }
.add-ticket button { padding: 8px 12px; min-width: 42px; }
.col-admin, .column-new { padding: 8px 12px 12px; }
.column-new {
  gap: 10px;
  background: rgba(255, 253, 251, 0.9);
  border: 1px dashed #d9d0c4;
  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: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  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: #fff;
  color: var(--ink);
  border: 1px solid rgba(70, 48, 24, 0.14);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  font-size: 30px;
  line-height: 1;
  font-weight: 450;
}
.ticket-close:hover {
  color: var(--danger);
  background: #fff;
  border-color: rgba(180, 35, 24, 0.35);
}
.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(61, 111, 184, 0.07); }
.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 #ddd4c8;
  border-radius: 10px;
  background: #fff;
}
.tag-new button { width: 100%; }
.checks li { align-items: center; }
.checks li:hover { background: rgba(61, 111, 184, 0.07); }
.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; }

@media (max-width: 800px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .who { display: none; }
  .page { padding: 18px 14px 28px; }
}
