/*
  boat hub – Design-Tokens und Komponenten

  Typo:    Geist (UI), Geist Mono (Zeiten, Größen, Prüfsummen, Code)
  Farbe:   kühle Zink-Neutrals, ein Akzent (Smaragd) für Links, Fokus, Erwähnungen, "geprüft".
           Die vier Firmenfarben sind Kennung, kein Akzent: nur in Kacheln und Logos.
  Radien:  Bedienelemente 8px (Buttons, Felder, Zeilen, Kacheln)
           Container 12px (Karten, Composer, Tabellen, Dialoge)
           Pills voll rund (Ordner, Zähler, Firmen-Logo)
  Ebenen:  1 Hauptbereich (mobil), 40 Drop, 50 Menü, 60 Lightbox, 70 Toast, 80 Skip-Link
*/

:root {
  --font: 'Geist Variable', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono Variable', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #f7f7f8;
  --bg-side: #efeff1;
  --surface: #fdfdfd;
  --surface-2: #f4f4f5;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --ink-3: #6b6b76;
  --line: rgb(24 24 27 / 0.08);
  --line-2: rgb(24 24 27 / 0.14);
  --hover: rgb(24 24 27 / 0.045);
  --active: rgb(24 24 27 / 0.075);
  --primary: #18181b;
  --primary-ink: #fdfdfd;
  --accent: #0e8a5e;
  --accent-soft: rgb(14 138 94 / 0.11);
  --danger: #c53030;
  --brand-dark: #18181b;
  --logo-plate: #fdfdfd;
  --shadow-sm: 0 1px 2px rgb(24 24 27 / 0.05);
  --shadow: 0 1px 2px rgb(24 24 27 / 0.04), 0 12px 32px -14px rgb(24 24 27 / 0.2);
  --shadow-lg: 0 28px 70px -20px rgb(24 24 27 / 0.35);

  --r-ctl: 8px;
  --r-box: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --side-w: 300px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111113;
    --bg-side: #0c0c0e;
    --surface: #18181b;
    --surface-2: #1f1f23;
    --ink: #ececef;
    --ink-2: #b4b4bd;
    --ink-3: #8b8b95;
    --line: rgb(236 236 239 / 0.08);
    --line-2: rgb(236 236 239 / 0.14);
    --hover: rgb(236 236 239 / 0.05);
    --active: rgb(236 236 239 / 0.09);
    --primary: #ececef;
    --primary-ink: #111113;
    --accent: #3cc792;
    --accent-soft: rgb(60 199 146 / 0.14);
    --danger: #f06a6a;
    --brand-dark: #ececef;
    --logo-plate: #f4f4f5;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -14px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 28px 70px -20px rgb(0 0 0 / 0.75);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #111113;
  --bg-side: #0c0c0e;
  --surface: #18181b;
  --surface-2: #1f1f23;
  --ink: #ececef;
  --ink-2: #b4b4bd;
  --ink-3: #8b8b95;
  --line: rgb(236 236 239 / 0.08);
  --line-2: rgb(236 236 239 / 0.14);
  --hover: rgb(236 236 239 / 0.05);
  --active: rgb(236 236 239 / 0.09);
  --primary: #ececef;
  --primary-ink: #111113;
  --accent: #3cc792;
  --accent-soft: rgb(60 199 146 / 0.14);
  --danger: #f06a6a;
  --brand-dark: #ececef;
  --logo-plate: #f4f4f5;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -14px rgb(0 0 0 / 0.6);
  --shadow-lg: 0 28px 70px -20px rgb(0 0 0 / 0.75);
  color-scheme: dark;
}

/* ---------- Basis ---------- */

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--font);
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}

a {
  color: inherit;
}

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

.ph {
  font-size: 18px;
  line-height: 1;
  flex: none;
}

.mono,
.num {
  font-family: var(--mono);
  font-size: 0.86em;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--ink-3);
}

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 80;
  padding: 8px 12px;
  border-radius: var(--r-ctl);
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 500;
  text-decoration: none;
}
.skip:focus {
  top: calc(12px + var(--safe-top));
}

::selection {
  background: var(--accent-soft);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

/* ---------- Wortmarke ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}
.wordmark img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  flex: none;
}
.wordmark span {
  font-weight: 400;
  color: var(--ink-3);
  margin-left: -4px;
}

/* ---------- Buttons & Felder ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-ctl);
  font-weight: 500;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  text-decoration: none;
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease),
    opacity 0.2s var(--ease);
}
.btn .ph {
  font-size: 16px;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: scale(0.98);
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: transparent;
}
.btn.primary:hover {
  opacity: 0.88;
}
.btn.ghost {
  background: none;
  border-color: transparent;
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--hover);
}
.btn.danger {
  color: var(--danger);
}
.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
}
.btn.sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-ctl);
  color: var(--ink-3);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--ink);
}
.icon-btn:active {
  transform: scale(0.94);
}

.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.field .help {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: -2px;
}
.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--line-2);
  background: var(--surface);
  outline: none;
  transition:
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}
.field textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}
.input::placeholder,
.field input::placeholder,
textarea::placeholder {
  color: var(--ink-3);
}
.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.error-text {
  color: var(--danger);
  font-size: 13px;
}
.error-text:empty {
  display: none;
}

/* ---------- Kacheln (Firma / Projekt) ---------- */

.tile {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--r-ctl);
  background: color-mix(in oklab, var(--c) 15%, var(--surface));
  color: color-mix(in oklab, var(--c) 88%, var(--ink));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--c) 22%, transparent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.tile.net {
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 7px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tile.net i {
  width: 100%;
  height: 100%;
  border-radius: 2px;
}

.co-logo {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--logo-plate);
  box-shadow: inset 0 0 0 1px var(--line-2);
  flex: none;
}
.co-logo img {
  display: block;
  height: 14px;
  width: auto;
}
.co-logo img[src*='naidi'] {
  height: 17px;
}
.co-logo img[src*='freigeist'] {
  height: 12px;
}
.co-logo.net {
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #3f3f46;
}
.co-logo.net .tile.net {
  width: 14px;
  height: 14px;
  padding: 0;
  gap: 1px;
  box-shadow: none;
  background: none;
}

/* ---------- Avatar ---------- */

.avatar {
  --size: 32px;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 30%;
  background: hsl(var(--h) 34% 90%);
  color: hsl(var(--h) 38% 30%);
  font-size: calc(var(--size) * 0.36);
  font-weight: 600;
  letter-spacing: -0.02em;
  user-select: none;
}
:root[data-theme='dark'] .avatar {
  background: hsl(var(--h) 18% 22%);
  color: hsl(var(--h) 45% 80%);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .avatar {
    background: hsl(var(--h) 18% 22%);
    color: hsl(var(--h) 45% 80%);
  }
}
.avatar.sm {
  --size: 28px;
}
.avatar.online::after {
  content: '';
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-side);
}

/* ---------- Login ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  overflow: auto;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 40px 48px;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
}
.login-brand h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(34px, 4.2vw, 56px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.login-brand h1 em {
  font-style: normal;
  color: var(--ink-3);
}
.logo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 440px;
}
.logo-grid div {
  display: grid;
  place-items: center;
  height: 76px;
  border-radius: var(--r-box);
  background: var(--logo-plate);
  box-shadow: inset 0 0 0 1px var(--line);
}
.logo-grid img {
  max-width: 62%;
  max-height: 26px;
}
.logo-grid img[src*='naidi'] {
  max-height: 36px;
}
.login-form {
  display: grid;
  place-items: center;
  padding: 40px 24px calc(40px + var(--safe-bottom));
}
.login-form form {
  width: min(360px, 100%);
  display: grid;
  gap: 16px;
}
.login-form h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.login-form p {
  margin: -10px 0 6px;
  color: var(--ink-3);
}
.login-form .btn {
  height: 40px;
  margin-top: 4px;
}

@media (max-width: 860px) {
  .login {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-brand {
    gap: 24px;
    padding: calc(24px + var(--safe-top)) 20px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .login-brand h1 {
    font-size: 30px;
  }
  .logo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .logo-grid div {
    height: 44px;
    border-radius: var(--r-ctl);
  }
  .logo-grid img {
    max-width: 78%;
    max-height: 16px;
  }
  .logo-grid img[src*='naidi'] {
    max-height: 22px;
  }
  .login-form {
    place-items: start center;
    padding-top: 28px;
  }
}

/* ---------- Shell ---------- */

.shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  height: 100dvh;
}

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--line);
  padding-top: var(--safe-top);
}
.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 12px 14px 16px;
}

.filters {
  display: flex;
  gap: 2px;
  margin: 0 12px 10px;
  padding: 3px;
  border-radius: var(--r-ctl);
  background: var(--active);
}
.chip {
  flex: 1 1 auto;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.chip:hover {
  color: var(--ink);
}
.chip[aria-pressed='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.side-search {
  position: relative;
  margin: 0 12px 6px;
}
.side-search .ph {
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  font-size: 15px;
  color: var(--ink-3);
  pointer-events: none;
}
.side-search .input {
  height: 34px;
  padding-left: 32px;
  background: var(--surface);
  border-color: var(--line);
}

.side-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 2px 8px 16px;
  overscroll-behavior: contain;
}

.side-section {
  margin-top: 16px;
}
.side-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2px 4px 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
}
.side-section-head .icon-btn {
  width: 26px;
  height: 26px;
}
.side-section-head .icon-btn .ph {
  font-size: 15px;
}
.side-empty {
  padding: 6px 8px;
  font-size: 13px;
  color: var(--ink-3);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: var(--r-ctl);
  text-align: left;
  color: var(--ink-2);
  text-decoration: none;
  transition: background 0.2s var(--ease);
}
.row:hover {
  background: var(--hover);
}
.row[aria-current='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
}
.row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.row-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}
.row-sub {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--ink-3);
}
.row.unread .row-title {
  color: var(--ink);
  font-weight: 600;
}
.badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  display: inline-grid;
  place-items: center;
}

.side-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px calc(10px + var(--safe-bottom)) 14px;
  border-top: 1px solid var(--line);
}
.side-foot .who {
  flex: 1;
  min-width: 0;
  display: grid;
  line-height: 1.3;
}
.side-foot .who b {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-foot .who small {
  color: var(--ink-3);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-foot .who small.off {
  color: var(--danger);
}

/* ---------- Hauptbereich ---------- */

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.main-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: calc(12px + var(--safe-top)) 20px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.main-head .back {
  display: none;
}
.main-title {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.main-title h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.025em;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.main-title h1 span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.main-title small {
  color: var(--ink-3);
  font-size: 12.5px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tabs {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-ctl);
  background: var(--active);
}
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.tabs button .ph {
  font-size: 15px;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button[aria-selected='true'] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Leerzustände */

.empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 24px;
}
.empty-card {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 380px;
}
.empty-card > .ph {
  font-size: 24px;
  color: var(--ink-2);
  padding: 11px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
}
.empty-card h2 {
  margin: 6px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.empty-card p {
  margin: 0;
  color: var(--ink-3);
  text-wrap: pretty;
}
.empty-card .btn {
  margin-top: 6px;
}

/* Skeleton */

.skel {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 8px 12px;
  padding: 12px 0;
}
.skel i {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: var(--active);
}
.skel .sk-av {
  width: 36px;
  height: 36px;
  border-radius: 30%;
  grid-row: span 3;
}
.skel .sk-a {
  width: 22%;
}
.skel .sk-b {
  width: 72%;
}
.skel .sk-c {
  width: 48%;
}
@media (prefers-reduced-motion: no-preference) {
  .skel i {
    background: linear-gradient(90deg, var(--active) 0 40%, var(--hover) 50%, var(--active) 60% 100%) 0 0 / 300% 100%;
    animation: shimmer 1.4s linear infinite;
  }
}
@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

/* ---------- Nachrichten ---------- */

.stream {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 8px;
  overscroll-behavior: contain;
}
.stream-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}
.load-more {
  display: flex;
  justify-content: center;
  padding: 6px 0 10px;
}

.day {
  display: flex;
  justify-content: center;
  margin: 22px 0 6px;
  pointer-events: none;
}
.day span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.msg {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 0 12px;
  padding: 2px 10px;
  margin: 0 -10px;
  border-radius: var(--r-ctl);
  transition: background 0.2s var(--ease);
}
.msg.first {
  margin-top: 12px;
  padding-top: 6px;
}
.msg .avatar {
  --size: 36px;
  grid-row: span 2;
}
.msg:not(.first) .gutter {
  font-family: var(--mono);
  font-size: 10.5px;
  color: transparent;
  text-align: right;
  padding-top: 4px;
}
.msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.35;
}
.msg-head b {
  font-weight: 600;
  letter-spacing: -0.015em;
}
.msg-head time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.msg-body {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}
.msg-body p {
  margin: 0;
  white-space: pre-wrap;
  text-wrap: pretty;
  max-width: 72ch;
}
.msg-body .edited {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 4px;
}
.msg-body code {
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--active);
}
.msg-body pre {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow-x: auto;
  white-space: pre;
  max-width: 72ch;
}
.msg-body pre code {
  padding: 0;
  background: none;
  font-size: 12.5px;
  line-height: 1.6;
}
.msg-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 35%, transparent);
  text-underline-offset: 2px;
}
.msg-body a:hover {
  text-decoration-color: currentColor;
}
.mention {
  padding: 1px 4px;
  border-radius: 5px;
  background: var(--active);
  color: var(--ink);
  font-weight: 500;
}
.mention.me {
  background: var(--accent-soft);
  color: var(--accent);
}

.msg-actions {
  position: absolute;
  top: -14px;
  right: 10px;
  display: none;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-ctl);
  background: var(--surface);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--line);
}
.msg-actions .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.msg-actions .ph {
  font-size: 16px;
}
.msg.touched {
  background: var(--hover);
}
.msg.touched .msg-actions {
  display: flex;
}
@media (hover: hover) {
  .msg:hover {
    background: var(--hover);
  }
  .msg:hover .msg-actions {
    display: flex;
  }
  .msg:not(.first):hover .gutter {
    color: var(--ink-3);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .msg.enter {
    animation: rise 0.36s var(--ease) both;
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.edit-box {
  display: grid;
  gap: 8px;
  padding: 2px 0 6px;
}
.edit-box textarea {
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border-radius: var(--r-ctl);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
  resize: vertical;
  outline: none;
}
.edit-box div {
  display: flex;
  gap: 6px;
}

/* Anhänge */

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 2px;
}
.att-media {
  display: block;
  max-width: min(400px, 100%);
  border-radius: var(--r-box);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.att-media img,
.att-media video {
  display: block;
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
}
.att-media img {
  cursor: zoom-in;
}
.att-media video {
  background: #0c0c0e;
}
.att-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  font-size: 12.5px;
}
.att-caption .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-2);
  font-weight: 500;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(380px, 100%);
  padding: 10px 8px 10px 10px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
}
.ext {
  --x: var(--ink-3);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-ctl);
  background: color-mix(in oklab, var(--x) 13%, var(--surface));
  color: color-mix(in oklab, var(--x) 90%, var(--ink));
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
}
.file-card .fc-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.file-card .fc-name {
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.verified {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent);
  font-weight: 500;
}
.verified .ph {
  font-size: 14px;
}

.typing {
  height: 22px;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  font-size: 12px;
  color: var(--ink-3);
}

/* ---------- Composer ---------- */

.composer-wrap {
  padding: 0 24px calc(16px + var(--safe-bottom));
}
.composer {
  max-width: 880px;
  margin: 0 auto;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.2s var(--ease);
}
.composer:focus-within {
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--ink-3);
}
.composer textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  max-height: 40vh;
  padding: 14px 16px 4px;
  border: 0;
  outline: 0;
  resize: none;
  background: none;
  line-height: 1.5;
}
.composer-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px 8px;
}
.composer-bar .hint {
  flex: 1;
  font-size: 12px;
  color: var(--ink-3);
  padding-left: 6px;
}
.composer-bar .hint kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.send {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-ctl);
  background: var(--primary);
  color: var(--primary-ink);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.send:active {
  transform: scale(0.94);
}
.send[disabled] {
  opacity: 0.25;
}

/* Uploads */

.uploads {
  max-width: 880px;
  margin: 0 auto 8px;
  display: grid;
  gap: 6px;
}
.uploads:empty {
  display: none;
}
.up {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 12px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
  overflow: hidden;
  font-size: 13px;
}
.up .ext {
  width: 34px;
  height: 34px;
  font-size: 9px;
}
.up-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.up-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 500;
}
.up-state {
  font-size: 12px;
  color: var(--ink-3);
}
.up-state.ok {
  color: var(--accent);
}
.up-state.err {
  color: var(--danger);
}
.bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(var(--p, 0));
  background: var(--ink);
  transition: transform 0.25s var(--ease);
}
.bar.hashing {
  background: var(--ink-3);
}
.bar.ok {
  background: var(--accent);
}
.bar.err {
  background: var(--danger);
}

/* Drop-Overlay */

.drop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  backdrop-filter: blur(6px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s var(--ease),
    visibility 0.2s;
}
.drop.on {
  opacity: 1;
  visibility: visible;
}
.drop div {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 48px;
  border-radius: var(--r-box);
  border: 1.5px dashed var(--ink-3);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.drop .ph {
  font-size: 30px;
  margin-bottom: 4px;
}
.drop b {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.drop span {
  color: var(--ink-3);
}

/* ---------- Dateien ---------- */

.files {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.files-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.files-toolbar .grow {
  flex: 1;
}
.folders {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.folder {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease);
}
.folder .ph {
  font-size: 15px;
  color: var(--ink-3);
}
.folder:hover {
  background: var(--hover);
}
.folder[aria-pressed='true'] {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: none;
}
.folder[aria-pressed='true'] .ph {
  color: inherit;
}

.table {
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 90px 120px 120px 72px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  font-size: 13px;
  transition: background 0.2s var(--ease);
}
.tr + .tr {
  border-top: 1px solid var(--line);
}
.tr:not(.th):hover {
  background: var(--hover);
}
.tr.th {
  padding-top: 9px;
  padding-bottom: 9px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: var(--surface-2);
}
.tr.sub {
  background: var(--surface-2);
  color: var(--ink-2);
}
.tr.sub .t-name {
  padding-left: 46px;
}
.t-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.t-name .ext {
  width: 34px;
  height: 34px;
  font-size: 9px;
}
.t-name b {
  display: block;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.t-name small {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}
.vbtn {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--line-2);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-2);
  flex: none;
}
button.vbtn:hover {
  background: var(--hover);
}
.t-cell {
  color: var(--ink-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

dialog {
  width: min(540px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-box);
  background: var(--surface);
  color: var(--ink);
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px var(--line);
}
dialog.wide {
  width: min(780px, calc(100vw - 32px));
}
dialog::backdrop {
  background: rgb(12 12 14 / 0.4);
  backdrop-filter: blur(3px);
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] {
    animation: pop 0.28s var(--ease);
  }
  dialog[open]::backdrop {
    animation: fade 0.28s var(--ease);
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.dlg {
  display: grid;
  gap: 18px;
  padding: 24px;
}
.dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dlg h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.dlg p {
  margin: -8px 0 0;
  color: var(--ink-3);
}
.dlg-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.pick-list {
  max-height: 264px;
  overflow-y: auto;
  border-radius: var(--r-box);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.pick {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.pick + .pick {
  border-top: 1px solid var(--line);
}
.pick:hover {
  background: var(--hover);
}
.pick input[type='checkbox'] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--ink);
}
.pick .pick-main {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.pick small {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
}
.pick select {
  height: 30px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.option-box {
  border-radius: var(--r-box);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tiles .tile {
  width: auto;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  font-size: 10.5px;
  border-radius: 6px;
}

.menu {
  position: fixed;
  z-index: 50;
  min-width: 220px;
  padding: 5px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-lg),
    inset 0 0 0 1px var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .menu {
    animation: pop 0.2s var(--ease);
  }
}
.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  text-align: left;
  transition: background 0.15s var(--ease);
}
.menu button .ph {
  color: var(--ink-3);
}
.menu button:hover {
  background: var(--hover);
}
.menu hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

.user-table .tr {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 100px;
  cursor: pointer;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(12 12 14 / 0.9);
  cursor: zoom-out;
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox {
    animation: fade 0.24s var(--ease);
  }
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 104px);
  border-radius: var(--r-ctl);
}
.lightbox .lb-bar {
  position: absolute;
  top: calc(14px + var(--safe-top));
  right: 14px;
  display: flex;
  gap: 8px;
}
.lightbox .btn {
  background: rgb(253 253 253 / 0.1);
  border-color: rgb(253 253 253 / 0.16);
  color: #fdfdfd;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 70;
  translate: -50% 0;
  padding: 10px 16px;
  border-radius: var(--r-ctl);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}
@media (prefers-reduced-motion: no-preference) {
  .toast {
    animation: rise 0.3s var(--ease);
  }
}

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

@media (max-width: 820px) {
  :root {
    --side-w: 100vw;
  }
  .shell {
    grid-template-columns: 1fr;
  }
  .side,
  .main {
    grid-area: 1 / 1;
  }
  .main {
    position: relative;
    z-index: 1;
    transform: translateX(100%);
    transition: transform 0.34s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .show-main .main {
    transform: none;
  }
  .main-head {
    padding-left: 8px;
    padding-right: 10px;
  }
  .main-head .back {
    display: inline-grid;
  }
  .main-head .co-logo {
    display: none;
  }
  .main-head {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .main-head .tabs {
    order: 3;
    width: 100%;
  }
  .tabs button {
    flex: 1;
    justify-content: center;
    padding: 0 6px;
  }
  .tabs button span {
    display: none;
  }
  .row {
    min-height: 50px;
  }
  .composer-wrap,
  .stream-inner,
  .typing {
    padding-left: 12px;
    padding-right: 12px;
  }
  .composer-bar .hint {
    visibility: hidden;
  }
  .composer textarea,
  .input,
  .field input,
  .field select,
  .field textarea {
    font-size: 16px;
  }
  .tr {
    grid-template-columns: minmax(0, 1fr) 72px 72px;
  }
  .tr > :nth-child(2),
  .tr > :nth-child(4),
  .tr > :nth-child(5) {
    display: none;
  }
  .files {
    padding: 14px 12px;
  }
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .user-table .tr {
    grid-template-columns: minmax(0, 1fr) 90px;
  }
  .dlg {
    padding: 20px;
  }
}

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

/* ---------- Timer ---------- */

.timer-slot:empty {
  display: none;
}
.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 2px 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.timer-go {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
.timer-go .ph {
  font-size: 15px;
}
.timer-chip .icon-btn {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: inherit;
}

/* ---------- Aufgaben ---------- */

.board-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 24px;
}
.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
  max-width: 1320px;
  margin: 0 auto;
}
.col {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: var(--r-box);
  background: var(--active);
  min-height: 120px;
  transition: box-shadow 0.2s var(--ease);
}
.col.over {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 2px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.quick-add .input {
  height: 34px;
  background: var(--surface);
  border-color: var(--line);
}
.task {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-ctl);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition:
    box-shadow 0.2s var(--ease),
    transform 0.2s var(--ease);
}
.task:hover {
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--line-2);
}
.task:active {
  transform: scale(0.99);
}
.task.done .task-title {
  color: var(--ink-3);
  text-decoration: line-through;
  text-decoration-color: var(--line-2);
}
.task.running {
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1.5px var(--accent);
}
.task-title {
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--ink-3);
}
.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.meta-item .ph {
  font-size: 14px;
}
.meta-item.overdue {
  color: var(--danger);
  font-weight: 500;
}
.avatar.xs {
  --size: 22px;
}

/* ---------- Zeit ---------- */

.time-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 32px;
  padding: 16px 18px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
}
.time-summary > div {
  display: grid;
  gap: 2px;
}
.time-summary span {
  font-size: 12.5px;
}
.time-summary b {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.time-summary .btn {
  margin-left: auto;
}
.time-form {
  display: grid;
  grid-template-columns: 150px 100px minmax(0, 200px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.time-form .error-text {
  grid-column: 1 / -1;
}
.tr.day-row {
  grid-template-columns: 1fr auto;
}
.tr.time-row {
  grid-template-columns: minmax(0, 1fr) 150px 80px 40px;
}
.tr.log-row {
  grid-template-columns: minmax(0, 1fr) 110px 130px;
}
.tr.share-row {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
}
.tr.share-row .t-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Tresor ---------- */

.vault-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.vault-item {
  display: grid;
  gap: 4px;
  padding: 12px 12px 8px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow-sm),
    inset 0 0 0 1px var(--line);
}
.vault-item header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.vault-item header b {
  display: block;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vault-item .tile .ph {
  font-size: 15px;
}
.vault-url {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12.5px;
  color: var(--ink-3);
  text-decoration: none;
}
.vault-url:hover {
  color: var(--accent);
}
.vault-url .ph {
  font-size: 12px;
}
.vault-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 0 0 2px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.vault-row > .muted {
  width: 68px;
  flex: none;
  font-size: 12.5px;
}
.vault-row .icon-btn {
  width: 28px;
  height: 28px;
}
.vault-row .mono,
.secret {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.vault-notes {
  padding: 8px 10px;
  border-radius: var(--r-ctl);
  background: var(--surface-2);
  font-size: 13px;
  white-space: pre-wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}

/* ---------- Dialog-Ergänzungen ---------- */

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.dlg-foot.split {
  justify-content: space-between;
  flex-wrap: wrap;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.link-box {
  display: flex;
  gap: 8px;
}
.link-box .input,
.link-box input {
  flex: 1;
  min-width: 0;
}
.dlg-sub {
  margin: 8px 0 -6px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hook-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.hook-form .wide,
.hook-form .error-text {
  grid-column: 1 / -1;
}
.hook-form > .btn {
  justify-self: start;
}

/* ---------- Öffentliche Seiten (Download- und Upload-Links) ---------- */

.public {
  min-height: 100dvh;
  overflow: auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
}
.public-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}
.public-main {
  display: grid;
  align-content: center;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 0;
  gap: 20px;
}
.public-main h1 {
  margin: 0;
  font-size: clamp(26px, 5vw, 36px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.public-main > p {
  margin: -8px 0 0;
  color: var(--ink-3);
  max-width: 55ch;
}
.public-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--r-box);
  background: var(--surface);
  box-shadow:
    var(--shadow),
    inset 0 0 0 1px var(--line);
}
.public-file {
  display: flex;
  align-items: center;
  gap: 14px;
}
.public-file b {
  display: block;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.public-drop {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 20px;
  border-radius: var(--r-box);
  border: 1.5px dashed var(--line-2);
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.public-drop:hover,
.public-drop.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.public-drop .ph {
  font-size: 28px;
  color: var(--ink-3);
}
.public-drop b {
  font-weight: 600;
}
.public-drop span {
  color: var(--ink-3);
  font-size: 13px;
}
.public-foot {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  font-size: 12px;
  color: var(--ink-3);
}

@media (max-width: 820px) {
  .board-wrap {
    padding: 12px;
  }
  .board {
    grid-template-columns: repeat(4, 82vw);
    scroll-snap-type: x mandatory;
  }
  .col {
    scroll-snap-align: start;
  }
  .time-form,
  .hook-form,
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .time-form .grow,
  .time-form .btn {
    grid-column: 1 / -1;
  }
  .tr.time-row {
    grid-template-columns: minmax(0, 1fr) 70px 40px;
  }
  .tr.time-row > :nth-child(2) {
    display: none;
  }
  .tr.time-row > :nth-child(3) {
    display: block;
  }
  .tr.time-row > :nth-child(4) {
    display: inline-grid;
  }
  .tr.share-row > * {
    display: flex !important;
  }
  .tr.log-row > :nth-child(2),
  .tr.log-row > :nth-child(3) {
    display: block;
  }
  .time-summary .btn {
    margin-left: 0;
    width: 100%;
  }
  .vault-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- Desktop-App (Electron) ---------- */

/* macOS: Fensterknöpfe liegen über der Sidebar, Kopfzeilen dienen zum Verschieben */
.desktop-darwin .side-head {
  padding-top: 44px;
}
.desktop-darwin .login-brand {
  padding-top: 56px;
}
.desktop-darwin .side-head,
.desktop-darwin .main-head,
.desktop-darwin .login-brand {
  -webkit-app-region: drag;
}
.desktop-darwin .side-head :is(button, a, input),
.desktop-darwin .main-head :is(button, a, input, select, .tabs),
.desktop-darwin .login-brand :is(a, button) {
  -webkit-app-region: no-drag;
}
