/* Schulentwicklungsboards – Stylesheet (keine externen Schriften oder Ressourcen) */

:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --list-bg: #e7ebf0;
  --text: #1d2733;
  --muted: #5b6878;
  --border: #d5dbe3;
  --primary: #2f6f9f;
  --primary-text: #ffffff;
  --danger: #b03a2e;
  --success: #2e7d4f;
  --warn: #9a6200;
  --focus: #1d6fd6;
  --shadow: 0 1px 2px rgba(20, 30, 45, .12), 0 1px 1px rgba(20, 30, 45, .06);
  --shadow-lg: 0 10px 30px rgba(20, 30, 45, .25);
  --radius: 8px;
  --board-color: var(--primary);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14181d;
    --surface: #1f252c;
    --surface-2: #272e37;
    --list-bg: #1a1f25;
    --text: #e4e9ef;
    --muted: #9aa7b5;
    --border: #36404b;
    --primary: #4b93c9;
    --danger: #e0645a;
    --success: #4caf78;
    --warn: #e0a640;
    --focus: #6aa8ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14181d;
  --surface: #1f252c;
  --surface-2: #272e37;
  --list-bg: #1a1f25;
  --text: #e4e9ef;
  --muted: #9aa7b5;
  --border: #36404b;
  --primary: #4b93c9;
  --danger: #e0645a;
  --success: #4caf78;
  --warn: #e0a640;
  --focus: #6aa8ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); }
body.no-scroll { overflow: hidden; }
a { color: var(--primary); }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .75em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .5em; }
.form-error { color: var(--danger); min-height: 1em; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5em 1em; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .55rem 1rem;
  background: var(--board-color); color: #fff; position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .15);
}
.brand { display: flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 700; }
.brand svg { fill: #fff; }
#nav { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
#nav a { color: #fff; text-decoration: none; padding: .35rem .65rem; border-radius: 6px; display: flex; gap: .35rem; align-items: center; }
#nav a:hover, #nav a.active { background: rgba(255, 255, 255, .18); }
#nav .btn-ghost { color: #fff; }
#nav .btn-ghost:hover { background: rgba(255, 255, 255, .18); }

main { padding: 1.25rem; max-width: 1200px; margin: 0 auto; }
main:has(.board-page) { max-width: none; padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* ---- Buttons & Formulare ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  padding: .45rem .85rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-primary:hover:not(:disabled) { background: var(--primary); filter: brightness(1.1); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn-sm { padding: .3rem .6rem; font-size: .88rem; }
.btn-block { width: 100%; }
.icon-btn { border: 0; background: transparent; color: inherit; padding: .3rem; border-radius: 6px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); }
.link-btn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-size: .85rem; }

input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=date], input:not([type]), textarea, select {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: .45rem .6rem; width: 100%; max-width: 100%;
}
textarea { resize: vertical; }
input[readonly] { background: var(--surface-2); }
.field { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .9rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field.small > span { font-weight: 500; font-size: .8rem; color: var(--muted); }
.field.small { margin-bottom: .5rem; }
.check { display: flex; gap: .5rem; align-items: center; margin: .5rem 0 1rem; }
.actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.actions.left { justify-content: flex-start; }
.inline-form { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; align-items: center; }
.inline-form input { flex: 1 1 200px; width: auto; }
.inline-form select { width: auto; }

/* ---- Badges / Avatare ---- */
.badge { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .45rem; border-radius: 999px; font-size: .78rem; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge-overdue, .due-overdue { background: color-mix(in srgb, var(--danger) 16%, var(--surface)); color: var(--danger); }
.due-soon { background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.due-done { background: color-mix(in srgb, var(--success) 18%, var(--surface)); color: var(--success); }
.due-ok { background: var(--surface-2); color: var(--muted); }
.task-list .due { padding: .1rem .5rem; border-radius: 999px; font-size: .8rem; }
.badge-plain { display: inline-flex; align-items: center; gap: .15rem; font-size: .8rem; color: var(--muted); }
.badge-plain.all-done { color: var(--success); }
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; }
.avatar-xs { width: 22px; height: 22px; font-size: .62rem; }
.avatar-sm { width: 28px; height: 28px; font-size: .72rem; }
.avatar-md { width: 36px; height: 36px; font-size: .85rem; }
.avatar.more { background: var(--muted); }
.count { color: var(--muted); font-size: .85rem; font-weight: 500; margin-left: .35rem; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; flex: 1; }
.progress-bar { height: 100%; background: var(--board-color, var(--primary)); transition: width .2s; }
.progress-bar.full { background: var(--success); }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Anmeldung ---- */
.auth-page { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; min-height: 70vh; }
.auth-intro h2 { font-size: 1.6rem; }
.auth-intro ul { padding-left: 1.2rem; color: var(--muted); }
.auth-intro li { margin-bottom: .5rem; }
.auth-box { background: var(--surface); padding: 1.75rem; border-radius: 12px; box-shadow: var(--shadow); }
.auth-switch { text-align: center; margin-top: 1rem; }

/* ---- Board-Übersicht ---- */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.board-tile {
  display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: var(--surface); border-radius: 10px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--text); border-top: 5px solid var(--board-color); min-height: 140px;
}
.board-tile:hover { box-shadow: var(--shadow-lg); }
.board-tile-head { display: flex; justify-content: space-between; gap: .5rem; }
.board-tile h3 { font-size: 1.05rem; margin: 0; }
.board-tile-desc { color: var(--muted); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-tile .progress { flex: none; margin-top: auto; }
.board-tile-stats { display: flex; gap: .6rem; align-items: center; font-size: .85rem; flex-wrap: wrap; }
.tile-folder { color: var(--muted); }
.archived-boards { margin-top: 2rem; }
.archived-boards summary { cursor: pointer; color: var(--muted); margin-bottom: 1rem; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); background: var(--surface); border-radius: 10px; }

.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .6rem; }
.template-card {
  text-align: left; display: flex; flex-direction: column; gap: .25rem; padding: .7rem .8rem; border-radius: 8px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit;
  border-left: 6px solid var(--board-color);
}
.template-card span { font-size: .82rem; color: var(--muted); }
.template-card.selected { border-color: var(--board-color); background: color-mix(in srgb, var(--board-color) 9%, var(--surface)); }
.template-preview { margin-top: .5rem; font-size: .85rem; }

/* ---- Meine Aufgaben ---- */
.task-group { margin-bottom: 1.5rem; }
.task-group.overdue h2 { color: var(--danger); }
.task-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.task-list a {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: .6rem; align-items: center;
  padding: .6rem .8rem; background: var(--surface); border-radius: 8px; text-decoration: none; color: var(--text);
  box-shadow: var(--shadow); border-left: 4px solid var(--board-color);
}
.task-list .icon { grid-row: span 2; color: var(--muted); }
.task-title { font-weight: 600; }
.task-meta { grid-column: 2; color: var(--muted); font-size: .82rem; }
.task-list .due { grid-row: 1 / span 2; grid-column: 3; }

/* ---- Konto ---- */
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.panel { background: var(--surface); border-radius: 10px; padding: 1.25rem; box-shadow: var(--shadow); }
.panel-nc { grid-row: span 2; }
.nc-status { margin-top: 1rem; }

/* ---- Board ---- */
.board-page { display: flex; flex-direction: column; height: calc(100vh - 48px); background: color-mix(in srgb, var(--board-color) 12%, var(--bg)); }
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem 1rem .25rem; }
.board-head-left, .board-head-right { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.board-title { margin: 0; font-size: 1.35rem; padding: .1rem .3rem; border-radius: 6px; }
.editable { cursor: pointer; }
.editable:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.board-desc { width: 100%; color: var(--muted); margin: 0 .3rem; font-size: .9rem; }
.member-stack { display: flex; border: 0; background: none; cursor: pointer; padding: 0 .25rem; }
.member-stack .avatar { margin-left: -6px; border: 2px solid var(--surface); }
.filter-bar { display: flex; gap: .5rem; align-items: center; padding: .35rem 1rem .6rem; flex-wrap: wrap; color: var(--muted); }
.filter-bar input[type=search] { width: 220px; padding: .3rem .55rem; }
.filter-bar select { width: auto; padding: .3rem .5rem; }
.chip-toggle { display: inline-flex; gap: .3rem; align-items: center; font-size: .88rem; color: var(--text); }
.label-chip {
  border: 1px solid var(--label-color); background: transparent; color: var(--text); border-radius: 999px;
  padding: .12rem .6rem; font-size: .8rem; cursor: pointer; font: inherit; font-size: .8rem;
}
.label-chip.on { background: var(--label-color); color: #fff; }

.lists { display: flex; align-items: flex-start; gap: .75rem; padding: 0 1rem 1rem; overflow-x: auto; flex: 1; }
.list {
  flex: 0 0 290px; max-height: 100%; display: flex; flex-direction: column; background: var(--list-bg);
  border-radius: 10px; padding: .5rem; box-shadow: var(--shadow);
}
.list.dragging { opacity: .4; }
.list-head { display: flex; align-items: center; gap: .25rem; padding: .2rem .25rem .45rem; cursor: grab; }
.list-title { font-size: .98rem; margin: 0; flex: 1; padding: .15rem .3rem; border-radius: 5px; cursor: pointer; overflow-wrap: anywhere; }
.list-title:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.list-cards { display: flex; flex-direction: column; gap: .45rem; overflow-y: auto; min-height: 12px; padding: 2px; }
.list-add { background: color-mix(in srgb, var(--list-bg) 70%, transparent); box-shadow: none; }
.list-placeholder { flex: 0 0 290px; align-self: stretch; border: 2px dashed var(--border); border-radius: 10px; }
.card-placeholder { height: 44px; border: 2px dashed color-mix(in srgb, var(--board-color) 60%, var(--border)); border-radius: 8px; flex: none; }

.card-tile {
  display: block; background: var(--surface); border-radius: 8px; padding: .5rem .6rem; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); cursor: pointer; border: 1px solid transparent;
}
.card-tile:hover { border-color: color-mix(in srgb, var(--board-color) 55%, transparent); }
.card-tile.dragging { opacity: .35; }
.card-tile.completed .card-title { color: var(--muted); }
.card-labels { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .3rem; }
.card-label { background: var(--label-color); color: #fff; border-radius: 4px; font-size: .7rem; padding: .05rem .4rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-label.big { font-size: .8rem; padding: .15rem .55rem; }
.card-title { overflow-wrap: anywhere; }
.done-mark { color: var(--success); margin-right: .25rem; }
.card-badges { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-top: .35rem; }
.card-badges:empty { display: none; }
.card-members { display: flex; gap: 2px; margin-left: auto; }

.list-composer textarea, .list-add input { margin-bottom: .4rem; }
.composer-open {
  display: flex; align-items: center; gap: .35rem; width: 100%; border: 0; background: transparent; color: var(--muted);
  padding: .45rem .4rem; border-radius: 6px; cursor: pointer; font: inherit; text-align: left; margin-top: .25rem;
}
.composer-open:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.composer-actions { display: flex; gap: .4rem; align-items: center; margin-top: .4rem; }

/* ---- Modale Dialoge ---- */
.overlay { position: fixed; inset: 0; background: rgba(10, 16, 24, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 50; overflow-y: auto; }
.modal:focus { outline: none; }
.modal { background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; display: flex; flex-direction: column; max-height: 92vh; }
.modal-wide { max-width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem .5rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-title { margin: 0; font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.modal-body { padding: 1rem 1.25rem 1.25rem; overflow-y: auto; }
.popup-menu {
  position: absolute; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-lg); padding: .3rem; min-width: 220px; display: flex; flex-direction: column;
}
.popup-menu button { display: flex; gap: .5rem; align-items: center; text-align: left; border: 0; background: none; color: var(--text); padding: .45rem .6rem; border-radius: 5px; cursor: pointer; font: inherit; }
.popup-menu button:hover:not(:disabled), .popup-menu button:focus-visible { background: var(--surface-2); }
.popup-menu button:disabled { opacity: .45; cursor: default; }
.popup-menu button.danger { color: var(--danger); }
.popup-menu hr { border: 0; border-top: 1px solid var(--border); margin: .25rem 0; width: 100%; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: .5rem .8rem; cursor: pointer; color: var(--muted); font: inherit; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 600; }

/* ---- Karten-Detail ---- */
.card-detail { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 1.5rem; }
.card-side { min-width: 0; }
.card-detail-title { font-size: 1.3rem; margin: 0 0 .15rem; padding: .1rem .25rem; margin-left: -.25rem; border-radius: 6px; overflow-wrap: anywhere; }
.card-section { margin-top: 1.5rem; }
.card-section h4 { display: flex; align-items: center; gap: .4rem; font-size: 1rem; }
.card-section.drop-target { outline: 2px dashed var(--primary); outline-offset: 6px; border-radius: 6px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1rem; }
.meta-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-bottom: .25rem; }
.meta-value { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.person { display: inline-flex; gap: .3rem; align-items: center; margin-right: .4rem; }
.description { white-space: pre-wrap; background: var(--surface-2); border-radius: 8px; padding: .65rem .8rem; overflow-wrap: anywhere; }
.description.empty { color: var(--muted); cursor: pointer; }
.description-input { min-height: 160px; }
.inline-input { width: 100%; font: inherit; }
.checklist-block { margin-bottom: 1.25rem; }
.checklist-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.checklist-head h4 { margin: 0; flex: 1; border-radius: 5px; padding: .1rem .2rem; }
.checklist-head label { display: inline-flex; gap: .25rem; align-items: center; }
.progress-row { display: flex; gap: .5rem; align-items: center; margin: .45rem 0; }
.progress-row .small { width: 3em; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: flex-start; gap: .5rem; padding: .3rem .2rem; border-radius: 6px; }
.checklist li:hover { background: var(--surface-2); }
.checklist li input[type=checkbox] { margin-top: .2rem; width: 17px; height: 17px; flex: none; }
.checklist li.done .item-text { text-decoration: line-through; color: var(--muted); }
.checklist.hide-done li.done { display: none; }
.item-text { flex: 1; overflow-wrap: anywhere; border-radius: 4px; }
.item-meta { display: flex; gap: .3rem; align-items: center; }
.add-item { padding-left: 1.7rem; margin-top: .3rem; }
.attachments { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-direction: column; gap: .4rem; }
.attachments li { display: flex; align-items: center; gap: .3rem; }
.attachment { flex: 1; display: flex; gap: .6rem; align-items: center; padding: .5rem .65rem; background: var(--surface-2); border-radius: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.attachment:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface-2)); }
.att-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.att-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-body .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
.comment-form { display: flex; gap: .5rem; align-items: flex-start; }
.comment-form textarea { flex: 1; }
.comment-form > .btn { align-self: flex-end; }
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-direction: column; gap: .75rem; }
.tl-activity { font-size: .85rem; color: var(--muted); padding-left: 2.25rem; }
.tl-activity strong { color: var(--text); font-weight: 600; }
.tl-comment { display: flex; gap: .5rem; }
.comment { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: .5rem; align-items: baseline; }
.comment-body { background: var(--surface-2); padding: .5rem .7rem; border-radius: 8px; margin-top: .2rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: .75rem; margin-top: .2rem; }
.card-side { display: flex; flex-direction: column; gap: .9rem; }
.side-section h5 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 .35rem; }
.side-section select { margin-bottom: .35rem; }
.side-section .btn + .btn { margin-top: .35rem; }
.toggle-list { display: flex; flex-direction: column; gap: .2rem; }
.toggle { display: flex; align-items: center; gap: .35rem; border: 1px solid transparent; background: var(--surface-2); color: var(--text); padding: .3rem .5rem; border-radius: 6px; cursor: pointer; font: inherit; font-size: .88rem; text-align: left; }
.toggle.on { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); font-weight: 600; }
.label-toggle .swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--label-color); flex: none; }
.label-toggle.on { border-color: var(--label-color); background: color-mix(in srgb, var(--label-color) 18%, var(--surface)); }
.pick-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .25rem; }
.pick-list button { width: 100%; display: flex; gap: .5rem; align-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: .45rem .6rem; border-radius: 6px; cursor: pointer; font: inherit; }
.pick-list button.selected { border-color: var(--primary); }

/* ---- Dateiauswahl ---- */
.picker-toolbar { display: flex; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem; margin-bottom: .5rem; font-size: .9rem; }
.crumb { border: 0; background: none; color: var(--primary); cursor: pointer; padding: .2rem .3rem; border-radius: 4px; font: inherit; display: inline-flex; gap: .2rem; align-items: center; }
.crumb:hover { background: var(--surface-2); }
.crumb-sep { color: var(--muted); }
.file-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.file-list li + li { border-top: 1px solid var(--border); }
.file-list .muted, .file-list .form-error { padding: .75rem; }
.file-row { display: flex; width: 100%; gap: .6rem; align-items: center; border: 0; background: var(--surface); color: var(--text); padding: .55rem .75rem; cursor: pointer; font: inherit; text-align: left; }
.file-row:hover:not(:disabled) { background: var(--surface-2); }
.file-row:disabled { opacity: .5; cursor: default; }
.file-row.selected { background: color-mix(in srgb, var(--primary) 16%, var(--surface)); }
.file-name { flex: 1; overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: .82rem; white-space: nowrap; }

/* ---- Einstellungen ---- */
.member-list, .label-list, .plain-list, .activity { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.member-list li { display: flex; align-items: center; gap: .75rem; }
.member-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.member-info .small { overflow: hidden; text-overflow: ellipsis; }
.member-list select { width: auto; }
.label-list li { display: flex; gap: .5rem; align-items: center; position: relative; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.row-actions { display: flex; gap: .35rem; align-items: center; }
.activity li { padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.swatches { display: flex; gap: .35rem; flex-wrap: wrap; }
.swatches.popup { position: absolute; top: 100%; left: 0; z-index: 5; background: var(--surface); padding: .4rem; border-radius: 8px; box-shadow: var(--shadow-lg); width: 190px; }
.swatch-btn { width: 30px; height: 30px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; flex: none; }
.swatch-btn.on { border-color: var(--text); box-shadow: inset 0 0 0 2px var(--surface); }
.folder-card { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; background: var(--surface-2); border-radius: 8px; color: var(--primary); }
.folder-card strong { color: var(--text); overflow-wrap: anywhere; }

/* ---- Toasts ---- */
#toasts { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 80; width: min(92vw, 460px); }
.toast { background: #24303d; color: #fff; padding: .65rem 1rem; border-radius: 8px; box-shadow: var(--shadow-lg); transition: opacity .4s; }
.toast-error { background: #9d2f25; }
.toast-success { background: #2a7048; }
.toast.hide { opacity: 0; }

/* ---- Mobil ---- */
@media (max-width: 760px) {
  main { padding: .9rem; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-intro { order: 2; }
  .card-detail { grid-template-columns: minmax(0, 1fr); }
  .card-side { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; border-top: 1px solid var(--border); padding-top: 1rem; }
  .card-side > .btn { grid-column: span 2; }
  #nav a span, .hide-sm, #brand-name { display: none; }
  .topbar { padding: .55rem .75rem; }
  #nav .btn-ghost { padding: .35rem .5rem; }
  .list { flex-basis: 85vw; }
  .filter-bar input[type=search] { width: 100%; }
  .overlay { padding: 0; }
  .modal { max-height: 100vh; min-height: 100vh; border-radius: 0; }
  .file-meta.hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---- Einladungen ---- */
.invite-page { display: flex; justify-content: center; padding-top: 6vh; }
.invite-box { width: 100%; max-width: 440px; }
.invite-box h1 { margin-bottom: .25rem; }
.pending-invites h3 { margin-top: 1.5rem; font-size: 1rem; }

/* ---- Verwaltung ---- */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kv-list { margin: 0; display: flex; flex-direction: column; gap: .45rem; }
.kv { display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 600; padding: .4rem .5rem; border-bottom: 1px solid var(--border); }
.user-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.user-table .num { font-variant-numeric: tabular-nums; }
.user-table .right { text-align: right; }
.user-cell { display: flex; gap: .6rem; align-items: center; }
.admin-badge { margin-left: .4rem; background: color-mix(in srgb, var(--primary) 15%, var(--surface)); color: var(--primary); }
.action-list { display: flex; flex-direction: column; gap: .5rem; }
.forgot-link { text-align: right; margin: -.5rem 0 .75rem; font-size: .88rem; }
code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Markdown ---- */
.description.md, .comment-body.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md .md-p { margin: 0 0 .6em; }
.md .md-h { margin: .9em 0 .35em; line-height: 1.3; }
.md .md-h1 { font-size: 1.2rem; }
.md .md-h2 { font-size: 1.07rem; }
.md .md-h3 { font-size: .98rem; }
.md .md-list { margin: 0 0 .6em; padding-left: 1.4rem; }
.md .md-list .md-list { margin: .15em 0 .15em; }
.md li { margin: .12em 0; }
.md .md-task { list-style: none; margin-left: -1.2rem; }
.md .md-task input { margin: 0 .3rem 0 0; vertical-align: -2px; }
.md .md-quote { margin: 0 0 .6em; padding: .1em .8em; border-left: 3px solid var(--border); color: var(--muted); }
.md .md-pre { margin: 0 0 .6em; padding: .6em .75em; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow-x: auto; }
.md .md-pre code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .85rem; white-space: pre; }
.md-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .86em; background: color-mix(in srgb, var(--text) 8%, transparent); padding: .05em .3em; border-radius: 4px; }
.md .md-hr { border: 0; border-top: 1px solid var(--border); margin: .8em 0; }
.card-title del, .item-text del { color: var(--muted); }
.md-preview { min-height: 160px; }

.md-toolbar-wrap { margin-bottom: .35rem; }
.md-toolbar { display: flex; flex-wrap: wrap; gap: .2rem; }
.md-btn {
  min-width: 2rem; height: 2rem; padding: 0 .45rem; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); border-radius: 6px; cursor: pointer; font: inherit; font-size: .88rem; display: inline-flex; align-items: center; justify-content: center;
}
.md-btn:hover { background: var(--surface-2); }
.md-help-btn { margin-left: auto; color: var(--muted); }
.md-help { margin-top: .4rem; background: var(--surface-2); border-radius: 8px; padding: .4rem .6rem; font-size: .85rem; overflow-x: auto; }
.md-help table { border-collapse: collapse; }
.md-help td { padding: .15rem .6rem .15rem 0; vertical-align: top; }
.comment-input { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.comment-input textarea { width: 100%; }

/* ---- Einladungslinks / Gäste ---- */
.share-title { border-left: 5px solid var(--board-color); padding-left: .6rem; }
.hint.center { text-align: center; }
.guest-note { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); border-radius: 8px; padding: .65rem .9rem; margin-bottom: 1rem; }
.guest-badge { margin-left: .4rem; background: color-mix(in srgb, var(--warn) 18%, var(--surface)); color: var(--warn); }
.share-create { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .75rem 0 1rem; }
.share-create select { width: auto; }
.share-create input { flex: 1 1 200px; width: auto; }
.share-list { display: flex; flex-direction: column; gap: .75rem; }
.share-item { border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem; }
.share-item.expired { opacity: .6; }
.share-item-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.share-item .inline-form { margin-top: .5rem; }
.share-item input { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .82rem; }

/* ---- QR-Code ---- */
.qr-view { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.qr-box { background: #ffffff; border-radius: 12px; padding: .5rem; }
.qr-svg { display: block; width: 100%; height: auto; max-height: 70vh; }
.qr-board { font-size: 1.6rem; font-weight: 700; margin: 0 0 .75rem; overflow-wrap: anywhere; }
.qr-steps { font-size: 1.15rem; padding-left: 1.4rem; margin: 0 0 1rem; display: flex; flex-direction: column; gap: .35rem; }
.qr-link { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; margin: 0; }
.qr-actions { justify-content: flex-start; }
.qr-modal:fullscreen { max-width: none; max-height: none; width: 100vw; height: 100vh; border-radius: 0; justify-content: center; }
.qr-modal:fullscreen .modal-body { display: flex; flex-direction: column; justify-content: center; padding: 3vh 5vw; }
.qr-modal:fullscreen .qr-svg { max-height: 82vh; }
.qr-modal:fullscreen .qr-board { font-size: 3rem; }
.qr-modal:fullscreen .qr-steps { font-size: 2rem; }
.qr-modal:fullscreen .qr-actions, .qr-modal:fullscreen .modal-head { display: none; }
@media (max-width: 760px) { .qr-view { grid-template-columns: minmax(0, 1fr); } }

/* ---- Vorlagenkarten & Uhrzeiten ---- */
.card-tile.card-template { border: 1px dashed color-mix(in srgb, var(--board-color) 70%, var(--border)); background: color-mix(in srgb, var(--board-color) 6%, var(--surface)); }
.template-badge { display: inline-flex; align-items: center; gap: .2rem; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .2rem; }
.template-banner { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; justify-content: space-between; padding: .6rem .8rem; margin-bottom: .75rem; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface-2); }
.composer-row { display: flex; gap: .25rem; align-items: center; }
.composer-row .composer-open { flex: 1; }
.composer-template { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .85rem; padding: .45rem .5rem; border-radius: 6px; cursor: pointer; white-space: nowrap; margin-top: .25rem; display: inline-flex; gap: .25rem; align-items: center; }
.composer-template:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.date-time { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(5.6rem, 1fr); gap: .3rem; }
.date-time input { min-width: 0; padding-left: .4rem; padding-right: .3rem; }
