/* ============================================================
   Friederikus – app.css
   Dark, modern "tool" aesthetic. Accents driven by two vars:
   --accent (primary) and --accent-2 (secondary), injected inline.
   ============================================================ */

:root {
  --accent: #22d3ee;
  --accent-2: #ec4899;

  --bg: #0a0e13;
  --bg-grad-1: color-mix(in srgb, var(--accent) 9%, transparent);
  --bg-grad-2: color-mix(in srgb, var(--accent-2) 8%, transparent);
  --surface: #111922;
  --surface-2: #16212c;
  --surface-3: #1b2733;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #e7eef5;
  --muted: #95a4b3;
  --muted-2: #647585;

  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow: color-mix(in srgb, var(--accent) 45%, transparent);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-xs: 8px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.75);
  --shadow-sm: 0 8px 24px -14px rgba(0, 0, 0, 0.7);
  --sidebar-w: 348px;
  --gap: 16px;

  --font: 'Roboto', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: 'Roboto Condensed', 'Roboto', -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 12% -8%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, var(--bg-grad-2), transparent 55%);
}
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
a { color: inherit; text-decoration: none; }
input, textarea, button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- Custom scrollbars (replace native everywhere) ---------- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 30%, var(--surface-3)) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--accent) 26%, var(--surface-3));
  border-radius: 999px; border: 3px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 48%, var(--surface-3));
  background-clip: padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }

.hidden { display: none !important; }
.inline { display: inline; }
.muted { color: var(--muted-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; color: var(--muted); }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.mt { margin-top: 14px; }
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- App shell ---------- */
.app { display: block; }
.shell {
  margin-left: calc(var(--sidebar-w) + var(--gap) * 2);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Sidebar (floating) ---------- */
.sidebar {
  position: fixed;
  top: var(--gap); left: var(--gap); bottom: var(--gap);
  width: var(--sidebar-w);
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.sidebar__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 6px 18px;
}
.sidebar__brand {
  display: flex; align-items: center; gap: 11px;
}
.sidebar__close {
  display: none; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 16px;
}
.sidebar__close:hover { background: var(--surface-3); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--grad);
  color: #fff; font-size: 17px;
  box-shadow: 0 8px 20px -8px var(--glow);
}
.brand-mark--lg { width: 52px; height: 52px; font-size: 24px; border-radius: 15px; }
.brand-text { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.sidebar__nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 550;
  transition: background 0.15s, color 0.15s;
}
.nav-item i { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}
.nav-item.is-active i { color: var(--accent); }
.nav-item--foot { margin-top: auto; }
.sidebar-scrim {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 39; backdrop-filter: blur(2px);
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 26px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__title { font-size: 19px; font-weight: 650; }
.topbar__spacer { flex: 1; }
.topbar .topbar__burger { display: none; } /* hidden on desktop */

/* ---------- User menu ---------- */
.usermenu { position: relative; }
.usermenu__toggle {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px 6px 6px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-weight: 550; font-size: 14px;
  transition: border-color .15s;
}
.usermenu__toggle:hover { border-color: var(--border-strong); }
.usermenu__toggle .fa-chevron-down { font-size: 11px; color: var(--muted-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 13px;
}
.usermenu__panel {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 240px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.usermenu.is-open .usermenu__panel { opacity: 1; transform: none; pointer-events: auto; }
.usermenu__head { padding: 8px 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.usermenu__name-lg { font-weight: 650; }
.usermenu__role { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.usermenu__role i { color: var(--accent); }
.usermenu__item-form { margin: 0; }
.usermenu__item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border-radius: var(--radius-xs);
  background: none; border: none; color: var(--text); font-size: 14px; text-align: left;
}
.usermenu__item i { width: 16px; text-align: center; color: var(--muted); }
.usermenu__item:hover { background: var(--surface-3); }
.usermenu__item--danger:hover { background: color-mix(in srgb, #ef4444 20%, transparent); }
.usermenu__item--danger:hover i { color: #ef4444; }

/* ---------- Content ---------- */
.content { padding: 26px; flex: 1; }
.page { width: 100%; }
.page--narrow { max-width: none; }
.page--music { padding-bottom: 110px; }

/* ---------- Hero (dashboard) ---------- */
.hero { margin-bottom: 22px; }
.hero__eyebrow { color: var(--muted); margin: 0 0 4px; font-weight: 550; }
.hero__title { font-size: 28px; }

/* ---------- Stat grid ---------- */
.stat-grid {
  display: grid; gap: 14px; margin-bottom: 24px;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
}
.stat-card {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s;
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.stat-card__icon {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 14px;
  display: grid; place-items: center; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.stat-card__num { font-size: 30px; font-weight: 720; letter-spacing: -0.02em; line-height: 1; }
.stat-card__label { color: var(--muted); font-size: 13.5px; margin-top: 5px; }

/* ---------- Panels ---------- */
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel {
  padding: 18px 20px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel__head h3 { font-size: 15.5px; display: flex; align-items: center; gap: 9px; }
.panel__head h3 i { color: var(--accent); }
.link-more { color: var(--muted); font-size: 13px; font-weight: 550; }
.link-more:hover { color: var(--accent); }
.link-more i { font-size: 11px; }
.badge {
  font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}

/* ---------- Feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.feed__item { display: flex; gap: 12px; padding: 9px 4px; align-items: flex-start; }
.feed__dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); flex: none; }
.feed__dot--2 { background: var(--accent-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-2) 18%, transparent); }
.feed__title { font-weight: 550; }
.feed__meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.empty-hint { color: var(--muted); font-size: 14px; }
.empty-hint a { color: var(--accent); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar__hint { color: var(--muted); margin: 0; }
.toolbar > .btn:last-child, .toolbar > form + .btn { margin-left: auto; }
.toolbar__hint + .btn { margin-left: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 17px; border-radius: var(--radius-sm);
  border: none; font-weight: 600; font-size: 14px;
  transition: transform .12s, filter .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
/* Solid gradient, no transparent border -> no coloured edge fringing. */
.btn--primary { background-image: var(--grad); color: #fff; box-shadow: 0 10px 24px -12px var(--glow); }
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--block { width: 100%; justify-content: center; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-xs);
  display: inline-grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted);
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn--danger:hover { background: color-mix(in srgb, #ef4444 16%, transparent); color: #f87171; }

.row-actions { display: inline-flex; gap: 4px; }

/* ---------- Segmented control ---------- */
.segmented {
  display: inline-flex; padding: 4px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.segmented__item {
  padding: 6px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 550; color: var(--muted);
  transition: background .15s, color .15s;
}
.segmented__item:hover { color: var(--text); }
.segmented__item.is-active { background: var(--grad); color: #fff; }

/* ---------- Search ---------- */
.search { position: relative; display: block; min-width: 240px; }
.search > i, .search > svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 14px; width: 15px; pointer-events: none;
}
.search input {
  width: 100%; padding: 10px 16px 10px 42px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.search input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------- Table card (naked floating tables) ---------- */
.table-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 6px 22px 12px; overflow: hidden;
}
.table-card__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 16px 2px 10px;
}
.table-card__head h3 { font-size: 16px; }
.counter { color: var(--muted-2); font-size: 13px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; font-weight: 600; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted-2); padding: 8px 12px; border: none;
}
.data-table tbody td { padding: 14px 12px; border: none; vertical-align: middle; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.data-table tbody tr + tr td { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--border) 65%, transparent); }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.row--done .cell-title { text-decoration: line-through; color: var(--muted); }
.term-ch { font-weight: 650; color: var(--accent); }
.example { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 3px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 550;
  background: var(--surface-3); color: var(--muted);
}
.chip--soft { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.chip--accent { background: color-mix(in srgb, var(--accent-2) 15%, transparent); color: var(--accent-2); }

/* ---------- Check circle (bucket) ---------- */
.check {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: transparent; color: transparent;
  display: grid; place-items: center; font-size: 12px; transition: all .15s;
}
.check:hover { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent); }
.check--done { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- Bucket cards ---------- */
.bucket-card {
  position: relative; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .16s, border-color .16s;
}
.bucket-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.bucket-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bucket-card__title { font-size: 17px; line-height: 1.35; }
.bucket-card.is-done .bucket-card__title { text-decoration: line-through; color: var(--muted); }
.bucket-card__desc { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.bucket-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.bucket-card__foot .muted-xs { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Cards grid (gags) ---------- */
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr)); }
.fun-card {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .18s, border-color .18s;
}
.fun-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.fun-card__icon {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 12px;
  display: grid; place-items: center; font-size: 17px;
  background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2);
}
.fun-card__title { font-size: 17px; }
.fun-card__text { color: var(--muted); font-size: 14px; margin: 8px 0 0; flex: 1; }
.fun-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.muted-xs { color: var(--muted-2); font-size: 12px; }

/* ---------- Lexikon (alphabetical sections + cards) ---------- */
.lex-section { margin-bottom: 30px; }
.lex-letter { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.lex-letter__badge {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-weight: 750; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.lex-letter__rule { flex: 1; height: 1px; background: var(--border); border: none; margin: 0; }
.lex-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(480px, 100%), 1fr)); }
.lex-card {
  position: relative; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s;
}
.lex-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.lex-card__ch { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1px; font-size: 17px; font-weight: 700; color: var(--accent); padding-right: 60px; }
.lex-card__de { color: var(--muted); font-size: 14px; margin-top: 3px; }
.lex-card__ex { margin-top: 11px; font-style: italic; color: #cdd8e3; font-size: 14px; }
.lex-card__actions { position: absolute; top: 12px; right: 12px; opacity: 0; transition: opacity .15s; }
.lex-card:hover .lex-card__actions { opacity: 1; }
@media (max-width: 760px) { .lex-card__actions { opacity: 1; } }

/* ---------- Timeline (diary) ---------- */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.diary-card {
  display: flex; gap: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.diary-card__spine { width: 4px; flex: none; background: var(--grad); }
.diary-card__body { padding: 18px 20px; flex: 1; min-width: 0; }
.diary-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.diary-card__title { font-size: 17px; }
.diary-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.diary-card__meta i { color: var(--muted-2); margin-right: 3px; }
.diary-card__text { margin-top: 12px; color: #cdd8e3; font-size: 14.5px; }
.diary-card__media { position: relative; margin-bottom: 14px; border-radius: 14px; overflow: hidden; cursor: pointer; }
.diary-card__media img { display: block; width: 100%; max-height: 380px; object-fit: cover; transition: transform .3s; }
.diary-card__media:hover img { transform: scale(1.02); }
.media-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }

/* ---------- Image uploader ---------- */
.uploader { display: flex; flex-direction: column; gap: 12px; }
.uploader__drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; text-align: center; border-radius: var(--radius-sm); border: 1.5px dashed var(--border-strong); background: var(--surface-2); color: var(--muted); transition: border-color .15s, background .15s; cursor: pointer; }
.uploader__drop i { font-size: 24px; color: var(--accent); }
.uploader__drop strong { color: var(--text); }
.uploader__drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
body.is-file-drag .uploader__drop { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
body.is-file-drag::after { content: ""; position: fixed; inset: 0; z-index: 70; pointer-events: none; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 60%, transparent); }
.uploader__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.uploader__grid:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); cursor: grab; background: var(--surface-2); }
.thumb.dragging { opacity: .4; }
.thumb.is-main { box-shadow: 0 0 0 2px var(--accent); border-color: transparent; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb__badge { position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 700; color: #fff; background: var(--grad); }
.thumb__actions { position: absolute; right: 5px; top: 5px; display: flex; gap: 4px; }
.thumb__btn { width: 24px; height: 24px; border-radius: 6px; border: none; display: grid; place-items: center; font-size: 11px; color: #fff; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(3px); }
.thumb__btn:hover { background: rgba(0, 0, 0, 0.78); }
.thumb__btn--del:hover { background: #ef4444; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 40px; background: rgba(4, 8, 12, 0.9); backdrop-filter: blur(6px); animation: fade .18s ease; }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 92vw; max-height: 86vh; border-radius: 12px; box-shadow: var(--shadow); }
.lightbox__close { position: absolute; top: 20px; right: 24px; width: 44px; height: 44px; border-radius: 12px; border: none; background: var(--surface-2); color: var(--text); font-size: 18px; }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text); font-size: 18px; display: grid; place-items: center; }
.lightbox__nav--prev { left: 20px; } .lightbox__nav--next { right: 20px; }
.lightbox__close:hover, .lightbox__nav:hover { background: var(--surface-3); }

/* ---------- Fields / forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field__hint { font-size: 12px; color: var(--muted-2); margin-top: 5px; }
.field input[type=text], .field input[type=password], .field input[type=search],
.field input[type=date], .field input[type=email], .field input[type=number],
.field input[type=url], .field input[type=tel], .field textarea, .field input:not([type]) {
  width: 100%; padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.field-row .field { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; }
.stack > :last-child { margin-bottom: 0; }
input[type=date] { color-scheme: dark; }

.mail-test { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.mail-test .field-row { align-items: end; }
.mail-test__action { align-items: flex-end; }

/* ---------- Custom dropdown ---------- */
.dd { position: relative; }
.dd-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-align: left;
  transition: border-color .15s;
}
.dd-toggle:hover { border-color: var(--border-strong); }
.dd.is-open .dd-toggle { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.dd-caret { font-size: 11px; color: var(--muted-2); transition: transform .18s; }
.dd.is-open .dd-caret { transform: rotate(180deg); }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  margin: 0; padding: 6px; list-style: none; max-height: 260px; overflow-y: auto;
  background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: none; /* removed from layout when closed so it can't create modal overflow */
}
.dd.is-open .dd-menu { display: block; animation: ddIn .15s ease; }
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dd-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px; border-radius: var(--radius-xs); font-size: 14px; cursor: pointer;
}
.dd-option:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dd-check { opacity: 0; color: var(--accent); font-size: 12px; }
.dd-option.is-selected { color: var(--accent); }
.dd-option.is-selected .dd-check { opacity: 1; }

/* ---------- Switch ---------- */
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 14px; }
.switch input { display: none; }
.switch__track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background .18s; flex: none;
}
.switch__thumb {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .18s;
}
.switch input:checked + .switch__track { background: var(--grad); border-color: transparent; }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); }

/* ---------- Color field ---------- */
.color-field { display: flex; align-items: center; gap: 10px; }
.color-field input[type=color] {
  width: 46px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); cursor: pointer;
}
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 4px; }
.color-field input[type=color]::-webkit-color-swatch { border: none; border-radius: 7px; }
.color-field input[type=text] { flex: 1; font-family: ui-monospace, monospace; }

/* ---------- File drop ---------- */
.filedrop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 26px; border-radius: var(--radius-sm); text-align: center;
  border: 1.5px dashed var(--border-strong); background: var(--surface-2); color: var(--muted);
  transition: border-color .15s, background .15s;
}
.filedrop i { font-size: 26px; color: var(--accent); }
.filedrop.is-drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.filedrop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.filedrop.has-file { color: var(--text); border-style: solid; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 8, 12, 0.66); backdrop-filter: blur(4px); animation: fade .18s ease; }
.modal__card {
  position: relative; width: min(720px, 100%); max-height: 92vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  animation: pop .2s cubic-bezier(.2,.9,.3,1.2);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 40%, var(--surface-3)) transparent;
}
.modal__card--sm { width: min(440px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; display: flex; align-items: center; gap: 9px; }
.modal__head h3 i { color: var(--accent); }
.modal__body { padding: 20px; }
.modal__lead { margin: 0 0 16px; color: var(--text); }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal__foot-left { margin-right: auto; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-state i { font-size: 34px; color: var(--muted-2); margin-bottom: 14px; }
.empty-state p { max-width: 380px; margin: 0 auto 18px; }

/* ---------- Flash ---------- */
.flash-stack { position: fixed; top: 74px; right: 26px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.flash {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px;
  border-radius: var(--radius-sm); background: var(--surface-3); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); font-size: 14px; animation: slidein .25s ease;
}
.flash i { font-size: 16px; }
.flash--success i { color: #34d399; }
.flash--error i { color: #f87171; }
.flash span { flex: 1; }
.flash-close { background: none; border: none; color: var(--muted-2); }
.flash-close:hover { color: var(--text); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---------- Tracklist + player (music) ---------- */
.tracklist { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.track { display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: var(--radius-sm); transition: background .12s; }
.track:hover { background: var(--surface-2); }
.track.is-playing { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.track__play {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 14px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  transition: background .15s, transform .12s;
}
.track:hover .track__play, .track.is-playing .track__play { background: var(--grad); border-color: transparent; color: #fff; }
.track__play:active { transform: scale(.94); }
.track__num { color: var(--muted-2); font-size: 13px; width: 22px; font-variant-numeric: tabular-nums; }
.track.is-playing .track__num { display: none; }
.track__meta { flex: 1; min-width: 0; }
.track__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.is-playing .track__title { color: var(--accent); }
.track__sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track__actions { opacity: 0; transition: opacity .15s; }
.track:hover .track__actions { opacity: 1; }

.player {
  position: fixed; left: calc(var(--sidebar-w) + var(--gap) * 2); right: 0; bottom: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px; padding: 12px 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-strong);
}
.player[hidden] { display: none; }
.player__play {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 16px;
  background: var(--grad); color: #fff; border: none; box-shadow: 0 8px 20px -10px var(--glow);
}
.player__info { min-width: 150px; max-width: 220px; }
.player__title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__artist { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__seek { flex: 1; display: flex; align-items: center; gap: 12px; }
.player__time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; width: 38px; text-align: center; }
.player__range { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; background: var(--surface-3); cursor: pointer; }
.player__range::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.player__range::-moz-range-thumb { width: 15px; height: 15px; border: none; border-radius: 50%; background: var(--accent); }

/* ---------- Auth ---------- */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-wrap { width: 100%; max-width: 400px; }
.auth-card {
  padding: 30px; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow); backdrop-filter: blur(12px);
}
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.auth-brand__name { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.auth-brand__sub { color: var(--muted); font-size: 13px; }
.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form .btn { margin-top: 8px; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 13px; margin-top: 20px; }
.input-icon { position: relative; display: block; }
.input-icon > i:first-child,
.input-icon > svg:first-child {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 15px; width: 16px; pointer-events: none; z-index: 1;
}
.input-icon input { width: 100%; padding: 13px 44px 13px 44px !important; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.input-icon input:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.input-reveal { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--muted); width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; }
.input-reveal:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --sidebar-w: 0px; --gap: 0px; }
  .shell { margin-left: 0; }
  .sidebar {
    top: 0; left: 0; bottom: 0; width: 100%;
    border: none; border-radius: 0; box-shadow: none;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    transform: translateX(-100%); transition: transform .24s ease;
  }
  .app.nav-open .sidebar { transform: none; }
  .app:not(.nav-open) .sidebar-scrim { display: none; }
  .sidebar__close { display: grid; }
  .topbar .topbar__burger { display: inline-grid; }
  .content { padding: 18px 16px; }
  .player { left: 0; }
  .usermenu__name { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .flash-stack { left: 16px; right: 16px; max-width: none; }

  /* Naked tables -> stacked cards on mobile */
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tbody tr { padding: 14px 4px; }
  .data-table tbody tr + tr td { box-shadow: none; }
  .data-table tbody tr { box-shadow: inset 0 1px 0 var(--border); }
  .data-table td { padding: 5px 4px; display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
  .data-table td::before { content: attr(data-label); color: var(--muted-2); font-size: 12px; font-weight: 600; flex: none; }
  .data-table td.ta-right { justify-content: flex-end; }
  .data-table td.ta-right::before { display: none; }
  .track__actions { opacity: 1; }
}

/* ============================================================
   Movies – Watchlist, Filmabend-Finder, Journal
   ============================================================ */

/* ---------- Sub-Navigation ---------- */
.subnav {
  display: flex; gap: 5px; margin-bottom: 20px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); overflow-x: auto;
}
.subnav__item {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px;
  border-radius: var(--radius-xs); color: var(--muted);
  font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .14s, color .14s;
}
.subnav__item i { font-size: 14px; }
.subnav__item:hover { background: var(--surface-2); color: var(--text); }
.subnav__item.is-active { background: var(--grad); color: #fff; }
.subnav__count {
  font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface-3) 80%, transparent);
}
.subnav__item.is-active .subnav__count { background: rgba(255, 255, 255, 0.22); }

/* ---------- Watchlist-Karten ---------- */
.movie-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(228px, 100%), 1fr)); }
.movie-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s;
}
.movie-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.movie-card__poster { position: relative; aspect-ratio: 2 / 3; background: var(--surface-2); }
.movie-card__poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.movie-card__ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-size: 28px; color: var(--muted-2);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3));
}
.movie-card__flag {
  position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--grad);
  box-shadow: 0 8px 20px -10px var(--glow);
}
.movie-card__score {
  position: absolute; right: 10px; top: 10px; padding: 4px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, 0.58); backdrop-filter: blur(4px);
}
.movie-card__score i { color: #fbbf24; }
.movie-card__body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 15px 11px; }
.movie-card__title { font-size: 15.5px; line-height: 1.3; }
.movie-card__meta { color: var(--muted); font-size: 12.5px; }
.movie-card__tags { display: flex; flex-wrap: wrap; gap: 5px; }
.movie-card__tags .chip { font-size: 11px; padding: 3px 8px; }
.movie-card__note { color: #cdd8e3; font-size: 13px; margin: 0; }
.movie-card__foot {
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.movie-card__foot .muted-xs { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movie-card__foot .row-actions { flex: none; }
.toolbar__actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.page-foot { margin-top: 26px; font-size: 13.5px; }
.page-foot a { color: var(--accent); }
.page-foot i { color: var(--muted-2); margin-right: 6px; }
.icon-btn--ok:hover { background: color-mix(in srgb, #34d399 18%, transparent); color: #34d399; }

/* ---------- Film-Suche (TMDB) ---------- */
.ms { position: relative; }
.ms__field { margin-bottom: 6px; }
.ms__inputwrap { position: relative; display: block; }
.ms__icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }
/* Doppelte Klasse, damit die generische .field-input-Regel nicht gewinnt. */
.ms .ms__inputwrap input {
  width: 100%; padding: 12px 42px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.ms .ms__inputwrap input:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.ms__spin { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); color: var(--accent); font-size: 13px; }
.ms__spin[hidden] { display: none; }
.ms__results {
  list-style: none; margin: 0 0 12px; padding: 6px; max-height: 330px; overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.ms__results[hidden] { display: none; }
.ms__result { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-xs); cursor: pointer; }
.ms__result:hover { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.ms__thumb { width: 42px; height: 63px; flex: none; object-fit: cover; border-radius: 7px; background: var(--surface-3); }
.ms__thumb--ph { display: grid; place-items: center; color: var(--muted-2); }
.ms__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ms__title { font-weight: 600; }
.ms__title em { font-style: normal; font-weight: 500; color: var(--muted-2); }
.ms__sub { color: var(--muted); font-size: 12.5px; }
.ms__empty { padding: 15px; text-align: center; color: var(--muted); font-size: 13.5px; }
.ms__picked {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
.ms__picked[hidden] { display: none; }
.ms__picked-poster img { width: 64px; border-radius: 8px; display: block; }
.ms__picked-poster .movie-card__ph { width: 64px; height: 96px; border-radius: 8px; font-size: 20px; }
.ms__picked-body { flex: 1; min-width: 0; }
.ms__picked-title { font-weight: 650; font-size: 15px; }
.ms__picked-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.ms__picked-text {
  color: var(--muted); font-size: 13px; margin: 9px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ms__manual[hidden] { display: none; }
.linkish {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 0 16px;
  background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600;
}
.linkish:hover { text-decoration: underline; }
.linkish[hidden] { display: none; }
.note-box {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px;
  border-radius: var(--radius-sm); font-size: 13.5px; color: var(--muted);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.note-box i { color: var(--accent); margin-top: 3px; }
.note-box a { color: var(--accent); font-weight: 600; text-decoration: underline; }

/* ---------- Tag-Auswahl ---------- */
.tagpick { display: flex; flex-direction: column; gap: 13px; }
.tagpick__group { display: flex; flex-direction: column; gap: 7px; }
.tagpick__legend {
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted-2);
}
.tagpick__chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tagchip { position: relative; }
.tagchip input { position: absolute; opacity: 0; pointer-events: none; }
.tagchip > span {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; font-weight: 550; cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.tagchip > span i { font-size: 11.5px; }
.tagchip:hover > span { border-color: var(--border-strong); color: var(--text); }
.tagchip input:checked + span,
.tagchip--btn.is-on > span {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}
.tagchip input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
/* Im Finder sind es Buttons statt Checkboxen. */
.tagchip--btn { background: none; border: none; padding: 0; }
.tagpick--finder { margin-top: 20px; gap: 15px; }
.tagpick--finder .tagchip > span { padding: 8px 14px; font-size: 13px; }
.chip--more { background: var(--surface-3); color: var(--muted-2); font-size: 11px; padding: 3px 8px; }

/* ---------- Sterne ---------- */
.star { --star-size: 27px; position: relative; display: inline-block; width: var(--star-size); height: var(--star-size); }
/* Das FontAwesome-Kit ersetzt <i> durch <svg> – beide Formen abdecken. */
.star__base, .star__fill > i, .star__fill > svg {
  display: block; width: var(--star-size); line-height: var(--star-size);
  text-align: center; font-size: calc(var(--star-size) * 0.82);
}
.star__base { position: absolute; left: 0; top: 0; color: var(--surface-3); }
.star__fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; overflow: hidden; color: #fbbf24; transition: width .09s linear; }
.star__hit { position: absolute; top: 0; bottom: 0; width: 50%; z-index: 2; background: none; border: none; padding: 0; }
.star__hit--half { left: 0; }
.star__hit--full { right: 0; }
.stars { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stars__row { display: inline-flex; gap: 3px; }
.stars__value { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.stars__clear { background: none; border: none; color: var(--muted-2); font-size: 12px; text-decoration: underline; }
.stars__clear[hidden] { display: none; }
.stars-ro { display: inline-flex; align-items: center; gap: 2px; }
.star--ro { --star-size: 17px; }
.stars-ro__num { margin-left: 8px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.stars-ro--none { color: var(--muted-2); font-size: 12.5px; font-style: italic; }

/* ---------- Journal ---------- */
.log-list { display: flex; flex-direction: column; gap: 14px; }
.log-card {
  display: flex; gap: 16px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: border-color .18s;
}
.log-card:hover { border-color: var(--border-strong); }
.log-card__poster { width: 80px; flex: none; }
.log-card__poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 10px; display: block; }
.log-card__poster .movie-card__ph { aspect-ratio: 2 / 3; border-radius: 10px; font-size: 20px; }
.log-card__body { flex: 1; min-width: 0; }
.log-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.log-card__title { font-size: 16.5px; }
.log-card__year { color: var(--muted-2); font-weight: 500; }
.log-card__meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; color: var(--muted); font-size: 12.5px; }
.log-card__meta i { color: var(--muted-2); margin-right: 4px; }
.log-card__rating { margin-top: 12px; }
.log-card__text { color: #cdd8e3; font-size: 14px; margin: 11px 0 0; }
.log-card__foot { margin-top: 11px; }

/* ---------- Geschmacksprofil ---------- */
.taste { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.taste__row { display: grid; grid-template-columns: 150px 1fr 62px 36px; align-items: center; gap: 12px; }
.taste__label { font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 8px; }
.taste__label i { color: var(--accent); font-size: 12px; width: 14px; text-align: center; }
.taste__bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.taste__fill { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.taste__val { text-align: right; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.taste__count { text-align: right; }
.stat-grid--compact { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
.stat-card--static:hover { transform: none; }

/* ---------- Filmabend-Finder ---------- */
.finder__wizard, .finder__results, .finder__duel, .finder__winner { margin-bottom: 8px; }
.finder__wizard[hidden], .finder__results[hidden], .finder__duel[hidden], .finder__winner[hidden] { display: none; }
.finder__wizard, .finder__duel {
  padding: 30px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.finder__progress { display: flex; justify-content: center; gap: 7px; margin-bottom: 26px; }
.finder__dot { width: 36px; height: 4px; border-radius: 999px; background: var(--surface-3); transition: background .25s; }
.finder__dot.is-active { background: var(--grad); }
.finder__step { display: none; }
.finder__step.is-active { display: block; animation: fade .22s ease; }
.finder__eyebrow {
  margin: 0 0 7px; text-align: center; color: var(--muted-2);
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.finder__eyebrow i { color: var(--accent); }
.finder__q { font-size: 23px; text-align: center; }
.finder__sub { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.pick-grid { display: grid; gap: 12px; margin-top: 24px; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); }
.pick-grid--moods { grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); }
.pick {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 14px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
}
.pick i { font-size: 21px; color: var(--muted); transition: color .14s; }
.pick span { color: var(--text); font-weight: 650; font-size: 14.5px; }
.pick em { font-style: normal; font-size: 12px; color: var(--muted-2); }
.pick:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.pick.is-on {
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.pick.is-on i { color: var(--accent); }
.pick--sm { flex-direction: row; justify-content: center; gap: 10px; padding: 13px 14px; }
.pick--sm i { font-size: 15px; }
.pick--sm span { font-size: 13.5px; }
.finder__nav { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.finder__navspacer { flex: 1; }
.finder__nav .btn[hidden] { display: none; }

.finder__resulthead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.finder__resulthead .finder__eyebrow, .finder__resulthead .finder__q { text-align: left; }
.finder__resultactions { display: flex; gap: 10px; flex-wrap: wrap; }
.finder__resultactions .btn[hidden] { display: none; }

.shortlist { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(258px, 100%), 1fr)); }
.sl-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.sl-card.is-top { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 20px 48px -28px var(--glow); }
.sl-card__poster { position: relative; aspect-ratio: 2 / 3; background: var(--surface-2); }
.sl-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sl-card__crown {
  position: absolute; left: 10px; top: 10px; padding: 5px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--grad);
  box-shadow: 0 8px 22px -10px var(--glow);
}
.sl-card__body { flex: 1; display: flex; flex-direction: column; gap: 9px; padding: 16px; }
.sl-card__match { color: var(--muted); font-size: 12px; }
.sl-card__matchnum { color: var(--accent); font-weight: 750; font-size: 17px; }
.sl-card__title { font-size: 17px; line-height: 1.3; }
.sl-card__meta { color: var(--muted); font-size: 12.5px; }
.sl-card__note { margin: 0; color: #cdd8e3; font-size: 13px; font-style: italic; }
.sl-card__body .btn { margin-top: auto; }
.why { display: flex; flex-direction: column; gap: 5px; }
.why__chip { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.why__chip i { width: 14px; text-align: center; font-size: 11.5px; color: var(--accent); }

.duel { display: flex; align-items: stretch; justify-content: center; gap: 16px; margin-top: 24px; }
.duel__card {
  position: relative; flex: 1 1 0; max-width: 300px; display: flex; flex-direction: column;
  padding: 0; text-align: left; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.duel__card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 22px 48px -26px var(--glow);
}
.duel__card.is-won { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 26%, transparent); }
.duel__img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; display: block; }
.duel__card .movie-card__ph { aspect-ratio: 2 / 3; }
.duel__body { display: block; padding: 14px; }
.duel__title { display: block; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; font-size: 15px; }
.duel__meta { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.duel__pickme {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); opacity: 0;
  padding: 9px 16px; border-radius: 999px; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 13px; pointer-events: none; transition: opacity .18s, transform .18s;
}
.duel__card:hover .duel__pickme { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.duel__vs {
  display: grid; place-items: center; flex: none;
  font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 2px;
  color: var(--muted-2); font-weight: 700; font-size: 14px;
}

.winner {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.2);
}
.winner::before {
  content: ""; position: absolute; inset: 0; opacity: .22;
  background-image: var(--shot); background-size: cover; background-position: center;
}
.winner::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--surface) 24%, color-mix(in srgb, var(--surface) 62%, transparent) 78%);
}
.winner__inner { position: relative; z-index: 1; display: flex; gap: 26px; padding: 26px; }
.winner__poster { width: 178px; flex: none; }
.winner__img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 14px; display: block; box-shadow: var(--shadow); }
.winner__poster .movie-card__ph { aspect-ratio: 2 / 3; border-radius: 14px; }
.winner__body { flex: 1; min-width: 0; }
.winner__body .finder__eyebrow { text-align: left; }
.winner__body .why { flex-direction: row; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 4px; }
.winner__title { font-size: 27px; margin: 2px 0 7px; }
.winner__meta { color: var(--muted); font-size: 13.5px; margin-bottom: 14px; }
.winner__text { color: #cdd8e3; font-size: 14px; margin: 14px 0 0; }
.winner__note { color: var(--muted); font-size: 13.5px; font-style: italic; margin: 10px 0 0; }
.winner__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ============================================================
   Einstellungen – Tabs
   ============================================================ */
/* Poster-Platzhalter in den verschiedenen Kontexten (2 Klassen = höhere Spezifität) */
.sl-card__img.movie-card__ph,
.duel__img.movie-card__ph,
.winner__img.movie-card__ph {
  display: grid; place-items: center; height: auto; aspect-ratio: 2 / 3;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-3));
  color: var(--muted-2); font-size: 30px;
}
.winner__img.movie-card__ph { border-radius: 14px; }
.log-card__poster .movie-card__ph,
.ms__picked-poster .movie-card__ph { display: grid; place-items: center; }

.tabs__nav {
  display: flex; gap: 5px; margin-bottom: 20px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); overflow-x: auto;
}
.tabs__tab {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px;
  background: none; border: none; border-radius: var(--radius-xs);
  color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .14s, color .14s;
}
.tabs__tab i { font-size: 14px; }
.tabs__tab:hover { background: var(--surface-2); color: var(--text); }
.tabs__tab.is-active { background: var(--grad); color: #fff; }
.tabs__panel { display: none; }
.tabs__panel.is-active { display: block; animation: fade .2s ease; }
.panel__lead { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.panel__lead a { color: var(--accent); }
/* Modellwahl im KI-Tab */
.modelpick { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.modelpick__row {
  padding: 15px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.modelpick__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.modelpick__label { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; font-size: 14px; }
.modelpick__head .chip { font-size: 11px; padding: 3px 9px; font-family: ui-monospace, monospace; }
.modelpick__desc { color: var(--muted); font-size: 12.5px; margin: 0 0 12px; }
.mail-test__action .btn[disabled] { opacity: .5; cursor: not-allowed; }

.deflist { margin: 0; }
.deflist > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 2px; }
.deflist > div + div { border-top: 1px solid var(--border); }
.deflist dt { color: var(--muted); font-size: 13.5px; }
.deflist dd { margin: 0; font-weight: 550; }

/* ---------- Kleinteile ---------- */
.field-row--3 { grid-template-columns: repeat(3, 1fr); }
.field__label-soft { color: var(--muted-2); font-weight: 400; }
.modal__card--lg { width: min(760px, 100%); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .winner__inner { gap: 20px; padding: 20px; }
  .winner__poster { width: 140px; }
  .winner__title { font-size: 23px; }
}
@media (max-width: 760px) {
  .movie-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(148px, 100%), 1fr)); }
  .movie-card__body { padding: 11px 12px 9px; gap: 6px; }
  .movie-card__title { font-size: 14.5px; }
  .movie-card__note { display: none; }
  .movie-card__tags .chip:nth-child(n+3) { display: none; }

  .log-card { gap: 12px; padding: 13px; }
  .log-card__poster { width: 64px; }
  .log-card__title { font-size: 15px; }

  .taste__row { grid-template-columns: 92px 1fr 54px; }
  .taste__count { display: none; }

  .finder__wizard, .finder__duel { padding: 20px 16px; }
  .finder__q { font-size: 19px; }
  .pick { padding: 15px 12px; }
  .pick-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .finder__nav { flex-wrap: wrap; }
  .duel { flex-direction: column; align-items: center; }
  .duel__card { max-width: 100%; width: 100%; flex-direction: row; }
  .duel__img, .duel__card .movie-card__ph { width: 96px; aspect-ratio: 2 / 3; flex: none; }
  .duel__pickme { left: auto; right: 16px; top: 50%; }
  .winner__inner { flex-direction: column; }
  .winner__poster { width: 130px; }
  .winner__body .why { flex-direction: column; gap: 5px; }

  .field-row--3 { grid-template-columns: 1fr; }
  .modelpick { grid-template-columns: 1fr; }
  .subnav__item, .tabs__tab { padding: 9px 13px; font-size: 13.5px; }
  .toolbar__actions { width: 100%; margin-left: 0; flex-wrap: nowrap; }
  .toolbar__actions .btn { flex: 1; justify-content: center; padding-inline: 12px; }
  /* Auf schmalen Karten passen Name und Aktionen nicht nebeneinander. */
  .movie-card__foot { flex-wrap: wrap; row-gap: 4px; }
  .movie-card__foot .muted-xs { flex: 1 1 100%; }
  .movie-card__foot .row-actions { margin-left: auto; }
}
