/* knowtice content
   Stil: Apple-Dark (Obsidian-Bühne, Carbon-Panels, 28px-Radien, keine Schatten),
   Akzent aus dem Logo statt Apple-Blau. */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;

  --obsidian: #000000;
  --graphite: #0e0e0e;
  --carbon: #1d1d1f;
  --steel: #333336;
  --keyline: #282828;
  --slate: #6e6e73;
  --ash: #86868b;
  --porcelain: #f5f5f7;
  --white: #ffffff;

  --brand: #5f39f0;          /* Logo-Violett */
  --brand-hover: #6d4bf5;
  --brand-link: #a594ff;     /* Links auf dunklen Flächen */
  --brand-soft: rgba(95, 57, 240, 0.22);
  --danger: #ff453a;
  --live: #30d158;
  --warn: #ff9f0a;

  --fill-soft: rgba(255, 255, 255, 0.04);
  --fill-hover: rgba(255, 255, 255, 0.07);
  --capsule: rgba(66, 66, 69, 0.72);

  --font: -apple-system, BlinkMacSystemFont, "Inter Variable", "Segoe UI", Roboto, system-ui, sans-serif;

  --r-panel: 28px;
  --r-tile: 18px;
  --r-nav: 20px;
  --r-link: 10px;
  --r-pill: 999px;

  --col-w: 300px;
  --topbar-h: 56px;
  --gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--porcelain);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.43;
  letter-spacing: -0.224px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; color: var(--porcelain); background: var(--fill-hover); padding: 1px 6px; border-radius: 6px; }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 18px;
  border: 0;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn-primary { background: var(--brand); color: var(--white); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-outline { background: transparent; color: var(--porcelain); box-shadow: inset 0 0 0 1px var(--slate); }
.btn-outline:hover { background: var(--fill-soft); }
.btn-quiet { background: var(--capsule); color: rgba(255, 255, 255, .85); }
.btn-quiet:hover { background: rgba(80, 80, 84, .8); }
.btn-text { background: none; color: var(--ash); padding-inline: 10px; }
.btn-text:hover { color: var(--porcelain); background: var(--fill-soft); }
.btn-danger-text { background: none; color: var(--danger); padding-inline: 10px; }
.btn-danger-text:hover { background: rgba(255, 69, 58, .1); }
.btn-small { min-height: 30px; padding: 5px 14px; font-size: 13px; }
.btn-block { width: 100%; min-height: 44px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ash);
}
.icon-btn:hover { background: var(--fill-hover); color: var(--porcelain); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

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

.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 500; color: var(--ash); padding-left: 18px; }
.field-hint { font-size: 12px; color: var(--ash); padding-left: 18px; }
.input, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  background: var(--fill-soft);
  border: 1px solid var(--slate);
  border-radius: var(--r-pill);
  color: var(--porcelain);
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease;
}
.input::placeholder { color: var(--slate); }
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; }
.select option { background: var(--carbon); }
.check { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--porcelain); cursor: pointer; padding-left: 4px; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }

.form-error { margin: 0; color: var(--danger); font-size: 13px; padding-left: 18px; }
.form-section { margin: 12px 0 0; font-size: 19px; font-weight: 600; letter-spacing: .2px; }

.notice {
  text-align: left;
  background: var(--carbon);
  border-radius: var(--r-nav);
  padding: 14px 18px;
  color: var(--porcelain);
  font-size: 14px;
}
.notice p { margin: 0 0 6px; }
.notice p:last-child { margin-bottom: 0; }
.notice-error { box-shadow: inset 0 0 0 1px rgba(255, 69, 58, .5); }
.code { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--obsidian); padding: 12px; border-radius: 12px; margin: 8px 0 0; }

/* ------------------------------------------------------------------ Anmeldung / Einrichtung */

.page-auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px var(--gutter);
  background: linear-gradient(#1d1d1f, #000000 420px);
}
.auth { width: 100%; max-width: 380px; display: grid; gap: 16px; text-align: center; }
.auth-wide { max-width: 440px; }
.auth-logo { justify-self: center; width: 72px; height: 72px; margin-bottom: 4px; }
.auth-title { margin: 0; font-size: 32px; line-height: 1.13; font-weight: 600; letter-spacing: .128px; }
.auth-sub { margin: -8px 0 8px; color: var(--ash); font-size: 15px; }
.auth-form { display: grid; gap: 14px; text-align: left; margin-top: 8px; }
.auth-form .btn-block { margin-top: 6px; }

/* ------------------------------------------------------------------ Topbar */

.page-app { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  margin: 12px var(--gutter) 0;
  padding: 0 10px 0 14px;
  background: var(--graphite);
  border-radius: var(--r-nav);
  box-shadow: 0 0 0 1px var(--keyline);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 28px; height: 28px; flex-shrink: 0; }
.brand-name { font-size: 19px; font-weight: 600; letter-spacing: .228px; white-space: nowrap; }

.topbar-search {
  position: relative;
  flex: 0 1 280px;
  margin-left: auto;
}
.topbar-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--ash); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.topbar-search input {
  width: 100%;
  height: 34px;
  padding: 0 14px 0 34px;
  background: var(--fill-soft);
  border: 1px solid var(--steel);
  border-radius: var(--r-pill);
  font-size: 14px;
  outline: none;
}
.topbar-search input::placeholder { color: var(--ash); }
.topbar-search input:focus { border-color: var(--brand); }
.topbar-search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.4); }

.topbar-right { display: flex; align-items: center; gap: 12px; }

.online { display: flex; align-items: center; }
.online .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--graphite); }
.online .avatar:first-child { margin-left: 0; }

.avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--steel);
  color: var(--porcelain);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
  user-select: none;
}
.avatar.is-me { background: var(--brand); color: var(--white); }

.avatar-btn { border: 0; padding: 0; background: none; border-radius: 50%; }
.avatar-btn .avatar { width: 32px; height: 32px; font-size: 12px; }
.avatar-btn:hover .avatar { box-shadow: 0 0 0 3px var(--steel); }

.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ash); }
.sync i { width: 7px; height: 7px; border-radius: 50%; background: var(--slate); }
.sync[data-state="live"] i { background: var(--live); }
.sync[data-state="saving"] i { background: var(--brand-link); }
.sync[data-state="offline"] i { background: var(--warn); }
.sync[data-state="offline"] .sync-label { color: var(--warn); }

/* ------------------------------------------------------------------ Menü */

.menu {
  position: fixed;
  z-index: 60;
  min-width: 240px;
  padding: 8px;
  background: rgba(29, 29, 31, .96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: var(--r-nav);
  box-shadow: 0 0 0 1px var(--steel), 0 24px 48px rgba(0, 0, 0, .5);
  animation: pop .14s ease-out;
}
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--steel); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 15px; font-weight: 600; }
.menu-head span { color: var(--ash); font-size: 13px; }
.menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: var(--r-link);
  background: none;
  text-align: left;
  font-size: 14px;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--fill-hover); outline: none; }
.menu-item.is-danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--steel); margin: 6px 4px; }

@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ Board */

.board {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px var(--gutter) 20px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: var(--steel) transparent;
}
.board-loading, .board-empty { margin: 80px auto; color: var(--ash); font-size: 15px; text-align: center; }
.board-empty { display: grid; gap: 14px; justify-items: center; }
.board-empty strong { color: var(--porcelain); font-size: 21px; font-weight: 600; }

.list {
  flex: 0 0 var(--col-w);
  width: var(--col-w);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--carbon);
  border-radius: var(--r-panel);
}
.list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px 8px 20px;
  cursor: grab;
  touch-action: pan-y;
}
.list-head:active { cursor: grabbing; }
.list-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-count { color: var(--ash); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.list-title-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  margin-left: -10px;
  padding: 0 10px;
  font-size: 17px;
  font-weight: 600;
  background: var(--fill-soft);
  border: 1px solid var(--brand);
  border-radius: var(--r-link);
  outline: none;
}

.cards {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 12px;
  padding: 4px 10px 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--steel) transparent;
}

.card {
  position: relative;
  padding: 13px 16px 14px;
  background: var(--obsidian);
  border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 1px var(--keyline);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: box-shadow .12s ease;
}
.card:hover { box-shadow: inset 0 0 0 1px var(--slate); }
.card:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand-link); }
.card-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.33;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.card-preview {
  margin-top: 4px;
  color: var(--ash);
  font-size: 13px;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: pre-line;
}
.card.is-hidden { display: none; }
.card.is-fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { 0% { box-shadow: inset 0 0 0 2px var(--brand); } 100% { box-shadow: inset 0 0 0 1px var(--keyline); } }

/* Drag & Drop */
.card-ghost { background: var(--fill-soft) !important; box-shadow: inset 0 0 0 1px var(--steel) !important; }
.card-ghost > * { visibility: hidden; }
.card-drag {
  opacity: 1 !important;
  box-shadow: inset 0 0 0 1px var(--brand), 0 18px 40px rgba(0, 0, 0, .55) !important;
  transform: rotate(1.5deg);
  cursor: grabbing;
}
.list-ghost { opacity: .35; }
.list-drag { box-shadow: 0 0 0 1px var(--brand), 0 24px 48px rgba(0, 0, 0, .6); }
.is-dragging, .is-dragging * { cursor: grabbing !important; }

.add-card {
  margin: 4px 10px 12px;
  padding: 9px 10px;
  border: 0;
  border-radius: 14px;
  background: none;
  color: var(--ash);
  text-align: left;
  font-size: 14px;
}
.add-card:hover { color: var(--porcelain); background: var(--fill-soft); }

.composer { margin: 4px 10px 12px; display: grid; gap: 8px; }
.composer textarea {
  width: 100%;
  min-height: 64px;
  resize: none;
  padding: 12px 16px;
  background: var(--obsidian);
  border: 0;
  border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 1px var(--brand);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.33;
  outline: none;
}
.composer textarea::placeholder { color: var(--slate); font-weight: 400; }
.composer-actions { display: flex; align-items: center; gap: 6px; }

.add-list {
  flex: 0 0 auto;
  align-self: flex-start;
}
.list-composer { flex: 0 0 var(--col-w); background: var(--carbon); border-radius: var(--r-panel); padding: 14px; display: grid; gap: 10px; }

.filter-note { flex: 0 0 auto; align-self: center; color: var(--ash); font-size: 13px; padding: 0 8px; }

/* ------------------------------------------------------------------ Dialoge */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 7vh var(--gutter) 24px;
  background: rgba(0, 0, 0, .62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: var(--carbon);
  border-radius: var(--r-panel);
  box-shadow: 0 0 0 1px var(--steel);
  padding: 24px;
  display: grid;
  gap: 18px;
  animation: rise .2s cubic-bezier(.2, .8, .2, 1);
}
.dialog-wide { max-width: 720px; }
.dialog-small { max-width: 420px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.dialog-head { display: flex; align-items: flex-start; gap: 12px; }
.dialog-title { flex: 1; margin: 0; font-size: 21px; font-weight: 600; line-height: 1.25; letter-spacing: .231px; }
.dialog-text { margin: -8px 0 0; color: var(--ash); font-size: 14px; }
.dialog-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.dialog-actions .spacer { flex: 1; }
.dialog .close { margin: -6px -8px 0 0; }

/* Karten-Editor */
.editor { max-width: 760px; padding: 28px 28px 20px; gap: 14px; }
.editor-top { display: flex; align-items: center; gap: 10px; }
.editor-top .select { width: auto; min-height: 34px; height: 34px; padding: 4px 38px 4px 16px; font-size: 13px; font-weight: 500; background-position: right 14px center; border-color: var(--steel); }
.editor-top .spacer { flex: 1; }
.editor-status { color: var(--ash); font-size: 12px; white-space: nowrap; }
.editor-title {
  width: 100%;
  margin: 0;
  padding: 0;
  resize: none;
  overflow: hidden;
  background: none;
  border: 0;
  outline: none;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.4px;
}
.editor-title::placeholder { color: var(--slate); }
.editor-body {
  width: 100%;
  min-height: 300px;
  max-height: 62vh;
  padding: 16px 18px;
  resize: vertical;
  background: var(--obsidian);
  border: 0;
  border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 1px var(--keyline);
  outline: none;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.2px;
}
.editor-body:focus { box-shadow: inset 0 0 0 1px var(--slate); }
.editor-body::placeholder { color: var(--slate); }
.editor-meta { color: var(--ash); font-size: 12px; }
.editor-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-foot .spacer { flex: 1; }
.kbd { font-size: 12px; color: var(--slate); }

.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px 12px 18px;
  border-radius: var(--r-nav);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(165, 148, 255, .35);
  font-size: 14px;
}
.banner p { flex: 1 1 220px; margin: 0; }
.banner-warn { background: rgba(255, 159, 10, .12); box-shadow: inset 0 0 0 1px rgba(255, 159, 10, .35); }

/* Tabellen-artige Listen in Dialogen */
.rows { display: grid; gap: 2px; max-height: 52vh; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
}
.row:hover { background: var(--fill-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--ash); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--brand-soft); color: var(--brand-link); font-size: 11px; font-weight: 600; vertical-align: 1px; }
.empty-note { color: var(--ash); font-size: 14px; padding: 16px 4px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline-form { display: grid; gap: 12px; padding: 16px; background: var(--obsidian); border-radius: var(--r-nav); box-shadow: inset 0 0 0 1px var(--keyline); }
.inline-form h3 { margin: 0; font-size: 15px; font-weight: 600; }
.secret { display: flex; gap: 8px; align-items: center; }
.secret .input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }

/* ------------------------------------------------------------------ Toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 70;
  display: grid;
  gap: 8px;
  justify-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  width: min(92vw, 480px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  background: rgba(51, 51, 54, .92);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: var(--r-pill);
  font-size: 14px;
  pointer-events: auto;
  animation: rise .2s ease-out;
}
.toast:not(:has(button)) { padding-right: 18px; }
.toast.is-error { background: rgba(110, 30, 26, .95); }
.toast button { border: 0; background: none; color: var(--brand-link); font-weight: 600; padding: 4px 8px; border-radius: var(--r-pill); }
.toast button:hover { background: rgba(255, 255, 255, .08); }

/* ------------------------------------------------------------------ Mobil */

@media (max-width: 720px) {
  :root { --col-w: 84vw; --gutter: 10px; }
  .topbar { gap: 10px; margin-top: 8px; padding-left: 10px; }
  .brand-name { display: none; }
  .topbar-search { flex: 1 1 auto; margin-left: 0; }
  .online, .sync-label { display: none; }
  .board { scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); padding-top: 14px; }
  .list { scroll-snap-align: start; }
  .overlay { padding: 0; place-items: end stretch; }
  .dialog { border-radius: var(--r-panel) var(--r-panel) 0 0; max-width: none; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 94dvh; overflow-y: auto; }
  .editor-title { font-size: 24px; }
  .editor-body { min-height: 40vh; max-height: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .kbd { display: none; }
  /* iOS zoomt bei Eingabefeldern unter 16px */
  .input, .select, .topbar-search input, .composer textarea, .editor-body, .list-title-input { font-size: 16px; }
  .editor-top .select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.btn-primary.is-danger-fill { background: var(--danger); }
.btn-primary.is-danger-fill:hover { background: #ff5b52; }

/* ------------------------------------------------------------------ Markdown */

.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .65em; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.15em 0 .4em; font-weight: 600; line-height: 1.25; color: var(--porcelain); }
.md h1 { font-size: 22px; letter-spacing: -0.4px; }
.md h2 { font-size: 19px; letter-spacing: -0.2px; }
.md h3 { font-size: 16px; }
.md h4, .md h5, .md h6 { font-size: 15px; color: var(--ash); }
.md ul, .md ol { margin: 0 0 .65em; padding-left: 1.35em; }
.md li { margin: .2em 0; }
.md li > p { margin: 0; }
.md li > ul, .md li > ol { margin: .15em 0 0; }
.md ul:has(> li.task) { padding-left: 0; }
.md li.task { list-style: none; position: relative; padding-left: 1.85em; }
.md li.task.done { color: var(--ash); text-decoration: line-through; text-decoration-color: rgba(134, 134, 139, .6); }
.md a { color: var(--brand-link); text-decoration: underline; text-decoration-color: rgba(165, 148, 255, .45); text-underline-offset: 2px; }
.md a:hover { text-decoration-color: currentColor; }
.md strong { font-weight: 600; color: var(--white); }
.md del, .md s { color: var(--ash); }
.md blockquote { margin: 0 0 .65em; padding: 2px 0 2px 14px; border-left: 3px solid var(--steel); color: var(--ash); }
.md hr { border: 0; border-top: 1px solid var(--steel); margin: 1em 0; }
.md code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--fill-hover); color: var(--porcelain); }
.md pre { margin: 0 0 .65em; padding: 12px 14px; border-radius: 12px; background: var(--carbon); overflow-x: auto; }
.md pre code { padding: 0; background: none; font-size: 13px; }
.md table { border-collapse: collapse; margin: 0 0 .65em; font-size: .93em; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--steel); padding: 6px 10px; text-align: left; }
.md th { font-weight: 600; background: var(--fill-soft); }

/* Checkbox im Editor */
.task-check {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  left: 0;
  top: .2em;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1.5px solid var(--slate);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.task-check:hover { border-color: var(--porcelain); }
.task-check:checked,
.task-box.is-checked {
  background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
  border-color: var(--brand);
}
.task-check:focus-visible { outline: 2px solid var(--brand-link); outline-offset: 2px; }

/* Ansicht und Schreibmodus im Editor */
.editor-body-wrap { display: grid; gap: 8px; }
.editor-body-wrap[data-mode="view"] .editor-body,
.editor-body-wrap[data-mode="view"] .editor-hint { display: none; }
.editor-body-wrap[data-mode="edit"] .editor-view { display: none; }
.editor-view {
  min-height: 300px;
  max-height: 62vh;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--obsidian);
  border-radius: var(--r-tile);
  box-shadow: inset 0 0 0 1px var(--keyline);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.2px;
  cursor: text;
}
.editor-view:hover { box-shadow: inset 0 0 0 1px var(--steel); }
.editor-view:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--brand); }
.editor-view-empty { color: var(--slate); }
.editor-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 4px; font-size: 12px; color: var(--ash); }
.editor-hint code { font-size: 11.5px; padding: 1px 7px; border-radius: 6px; background: var(--fill-hover); color: var(--ash); }

/* Kompakte Vorschau auf den Karten */
.card-preview.md-compact {
  display: block;
  -webkit-line-clamp: unset;
  max-height: 7.6em;
  overflow: hidden;
  white-space: normal;
}
.card-preview.is-clipped { -webkit-mask-image: linear-gradient(#000 65%, transparent); mask-image: linear-gradient(#000 65%, transparent); }
.md-compact p, .md-compact ul, .md-compact ol, .md-compact blockquote, .md-compact pre, .md-compact table { margin: 0 0 .3em; }
.md-compact h1, .md-compact h2, .md-compact h3, .md-compact h4, .md-compact h5, .md-compact h6 { margin: .35em 0 .15em; font-size: 13px; letter-spacing: -0.1px; color: var(--porcelain); }
.md-compact ul, .md-compact ol { padding-left: 1.2em; }
.md-compact li { margin: 0; }
.md-compact li.task { padding-left: 1.5em; }
.md-compact li.task .task-box { position: absolute; left: 0; top: .22em; }
.md-compact pre { padding: 6px 8px; border-radius: 8px; }
.md-compact a { position: relative; z-index: 1; }

.task-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--slate);
  border-radius: 4px;
  vertical-align: -1px;
  flex-shrink: 0;
}
.card-foot { display: flex; gap: 8px; margin-top: 10px; }
.task-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 7px;
  border-radius: var(--r-pill);
  background: var(--fill-hover);
  color: var(--ash);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.task-count.is-complete { background: var(--brand-soft); color: var(--brand-link); }

@media (max-width: 720px) {
  .editor-view { min-height: 40vh; max-height: none; font-size: 16px; }
}
