/* ============================================================
   Briefr Dashboard — Prototyp
   Design-System abgeleitet von briefr.de (styles.css)
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-weight: 100 900; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('fonts/jetbrains-mono-regular.woff2') format('woff2');
  font-weight: 400; font-display: swap; font-style: normal;
}
@font-face {
  font-family: 'Playfair Display';
  src: url('fonts/playfair-display-italic-latin.woff2') format('woff2');
  font-weight: 400; font-display: swap; font-style: italic;
}

:root {
  /* Brand */
  --accent: #00ADFF;
  --accent-hover: #0095dd;
  --orange: #FF6B35;
  --violet: #9B7BFF;
  --green: #22c55e;
  --red: #e5484d;

  /* Surfaces — „paper" wie die Website-Unterseiten */
  --bg: #FFFFFF;
  --bg-elevated: #FFFFFF;
  --bg-surface: #F4F6F9;
  --bg-inset: #ECEFF3;

  --dark: #0B1320;
  --dark-elevated: #141C28;
  --dark-border: rgba(255, 255, 255, 0.08);

  /* Text */
  --text: #0B1320;
  --text-2: #5B6676;
  --text-3: #97A0AD;
  --on-dark: #ffffff;
  --on-dark-muted: rgba(255, 255, 255, 0.55);

  --border: #E7E9ED;
  --border-strong: #D7DBE2;

  /* Status */
  --st-plan: #00ADFF;     /* geplant */
  --st-review: #FF6B35;   /* in Prüfung */
  --st-live: #22c55e;     /* online */
  --st-idea: #9B7BFF;     /* Idee */

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --accent-font: 'Playfair Display', Georgia, serif;

  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem; --sp-12: 3rem;

  --r-sm: 0.5rem; --r-md: 0.75rem; --r-lg: 1.25rem; --r-xl: 1.75rem; --r-full: 9999px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --shadow: none;
  --shadow-hover: 0 18px 40px rgba(11,19,32,.08);
  --shadow-lg: 0 30px 70px rgba(11,19,32,.16);

  --rail-w: 248px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

.mono {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.serif { font-family: var(--accent-font); font-style: italic; font-weight: 400; }
/* Playfair-Kursiv-Akzent in Headlines (CI-Muster der Website) */
h1 em, h2 em, h3 em { font-family: var(--accent-font); font-style: italic; font-weight: 400; letter-spacing: 0; color: inherit; }

/* Boot-Loader (verhindert Login-Flash beim Refresh) */
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 500; }
.boot__spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: bootspin .8s linear infinite; }
@keyframes bootspin { to { transform: rotate(360deg); } }

/* ============================================================
   LOGIN
   ============================================================ */
.login {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--dark);
}
.login__brand {
  position: relative;
  padding: var(--sp-12);
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(900px 600px at 110% -10%, rgba(0,173,255,.18), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(155,123,255,.14), transparent 60%),
    var(--dark);
  color: var(--on-dark);
  overflow: hidden;
}
.login__brand-logo { height: 30px; filter: brightness(0) invert(1); }
.login__brand h1 {
  font-size: clamp(2rem, 1.4rem + 2.5vw, 3.4rem);
  line-height: 1.05; font-weight: 600; letter-spacing: -.02em;
  max-width: 14ch;
}
.login__brand h1 .serif { color: var(--accent); }
.login__brand p { color: var(--on-dark-muted); max-width: 38ch; margin-top: var(--sp-4); }
.login__brand-foot { color: var(--on-dark-muted); font-size: .8rem; }
.login__panel {
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-8);
}
.login__card { width: 100%; max-width: 380px; }
.login__card h2 { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.login__card .sub { color: var(--text-2); margin: var(--sp-2) 0 var(--sp-8); }

.field { margin-bottom: var(--sp-5); }
.field label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: var(--sp-2); }
.field input {
  width: 100%; padding: .7rem .85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  transition: border-color var(--ease) .15s, box-shadow var(--ease) .15s;
}
.field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,173,255,.15);
}
.field .hint { font-size: .75rem; color: var(--text-3); margin-top: var(--sp-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  padding: .6rem 1.3rem; border-radius: var(--r-full);
  font-weight: 500; font-size: .88rem;
  transition: transform var(--ease) .12s, background var(--ease) .15s, box-shadow var(--ease) .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--dark); color: #fff; }
.btn--primary:hover { background: var(--dark-elevated); }
.btn--block { width: 100%; }
.btn--ghost { background: var(--bg-surface); color: var(--text); }
.btn--ghost:hover { background: var(--bg-inset); }
.btn--dark { background: var(--dark); color: #fff; }
.btn--dark:hover { background: var(--dark-elevated); }
.btn--sm { padding: .45rem .8rem; font-size: .8rem; }
.btn--danger { background: rgba(229,72,77,.1); color: var(--red); }
.btn--ok { background: rgba(34,197,94,.12); color: #15803d; }

.login__roles { margin-top: var(--sp-6); padding-top: var(--sp-6); border-top: 1px solid var(--border); }
.login__roles .mono { display: block; margin-bottom: var(--sp-3); }
.login__roles-btns { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: none; min-height: 100%; grid-template-columns: var(--rail-w) 1fr; }
.app.is-active { display: grid; }

.rail {
  background: var(--bg);
  color: var(--text);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: var(--sp-6) var(--sp-4);
}
.rail__logo { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-8); }
.rail__logo img { height: 24px; }
.rail__logo .tag {
  font-family: var(--mono); font-size: .6rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
  border: 1px solid var(--border); padding: 2px 6px; border-radius: var(--r-full);
}

.rail__client {
  background: var(--bg-surface); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-6);
}
.rail__client select {
  width: 100%; background: transparent; color: var(--text); border: none;
  font-weight: 600; font-size: .9rem; cursor: pointer;
}
.rail__client select option { color: #000; }
.rail__client .mono { color: var(--text-3); display: block; margin-bottom: 4px; }
.rail__client > div { color: var(--text) !important; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: .65rem .8rem; border-radius: var(--r-md);
  color: var(--text-2); font-weight: 500; font-size: .9rem;
  text-align: left; width: 100%;
  transition: background var(--ease) .12s, color var(--ease) .12s;
}
.nav__item:hover { background: var(--bg-surface); color: var(--text); }
.nav__item.is-active { background: var(--dark); color: #fff; }
.nav__item .ic { width: 18px; height: 18px; flex: none; }
.nav__item .badge {
  margin-left: auto; background: var(--orange); color: #fff;
  font-size: .65rem; font-weight: 700; padding: 1px 7px; border-radius: var(--r-full);
}
.nav__item.is-active .badge { background: rgba(255,255,255,.25); }

.rail__foot { margin-top: auto; padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.rail__user { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); }
.rail__avatar {
  width: 34px; height: 34px; border-radius: var(--r-full); flex: none;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: .8rem;
}
.rail__avatar-logo { height: 20px; width: auto; display: block; }
.rail__user .name { font-size: .85rem; font-weight: 600; }
.rail__user .role { font-size: .7rem; color: var(--text-3); }
.rail__logout { margin-left: auto; color: var(--text-3); }
.rail__logout:hover { color: var(--text); }

/* MAIN */
.main { min-width: 0; padding: var(--sp-8) var(--sp-10); }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-6); margin-bottom: var(--sp-8); }
.topbar h1 { font-size: 1.8rem; font-weight: 600; letter-spacing: -.02em; }
.topbar .eyebrow { margin-bottom: var(--sp-2); }
.topbar p { color: var(--text-2); margin-top: var(--sp-1); }
.topbar__actions { display: flex; gap: var(--sp-3); flex: none; }

.view { display: none; animation: fade .25s var(--ease); }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.admin-only { display: none; }
body[data-role="admin"] .admin-only { display: revert; }
body[data-role="admin"] .client-only { display: none; }

/* ============================================================
   CARDS / GENERIC
   ============================================================ */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card__pad { padding: var(--sp-6); }
.card__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border); }
.card__head h3 { font-size: 1rem; font-weight: 600; }

.grid { display: grid; gap: var(--sp-5); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: var(--sp-10) 0 var(--sp-4); }
.section-title h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }

/* Stat */
.stat { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow); }
.stat .mono { display: block; margin-bottom: var(--sp-3); }
.stat .num { font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat .num small { font-size: 1rem; font-weight: 600; color: var(--text-3); }
.stat .delta { font-size: .8rem; font-weight: 600; margin-top: var(--sp-2); }
.delta.up { color: #15803d; } .delta.down { color: var(--red); }

/* status pill */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 500; padding: 3px 9px; border-radius: var(--r-full);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill--plan { background: rgba(0,173,255,.12); color: #0073b3; }
.pill--plan .dot { background: var(--st-plan); }
.pill--review { background: rgba(255,107,53,.14); color: #c2410c; }
.pill--review .dot { background: var(--st-review); }
.pill--live { background: rgba(34,197,94,.14); color: #15803d; }
.pill--live .dot { background: var(--st-live); animation: livepulse 1.8s infinite; }
.pill--idea { background: rgba(155,123,255,.16); color: #6d4fd6; }
.pill--idea .dot { background: var(--st-idea); }
.pill--reject { background: rgba(229,72,77,.12); color: var(--red); }
.pill--reject .dot { background: var(--red); }
.pill--accept { background: rgba(34,197,94,.14); color: #15803d; }
.pill--accept .dot { background: var(--st-live); }
@keyframes livepulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.5);} 50% { box-shadow: 0 0 0 4px rgba(34,197,94,0);} }

/* ============================================================
   CALENDAR
   ============================================================ */
.cal__bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-5); }
.cal__nav { display: flex; align-items: center; gap: var(--sp-3); }
.cal__nav h3 { font-size: 1.1rem; font-weight: 600; min-width: 11ch; text-align: center; }
.cal__nav button { width: 34px; height: 34px; border-radius: var(--r-md); background: var(--bg-surface); display: grid; place-items: center; font-size: 1rem; }
.cal__nav button:hover { background: var(--bg-inset); }
.cal__legend { display: flex; gap: var(--sp-4); }
.cal__legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--text-2); }
.cal__legend .dot { width: 8px; height: 8px; border-radius: 50%; }

.cal {
  background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
.cal__dow { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--bg-surface); }
.cal__dow span { padding: var(--sp-2); text-align: center; font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal__cell {
  min-height: 116px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: var(--sp-2); display: flex; flex-direction: column; gap: 4px;
}
.cal__cell:nth-child(7n) { border-right: none; }
.cal__cell.is-out { background: var(--bg-surface); }
.cal__cell .daynum { font-size: .8rem; font-weight: 600; color: var(--text-3); }
.cal__cell.is-today .daynum { background: var(--accent); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal__post {
  text-align: left; border-radius: var(--r-sm); padding: 4px 6px; font-size: .72rem; font-weight: 600;
  display: flex; align-items: center; gap: 5px; line-height: 1.25;
  transition: transform var(--ease) .1s;
}
.cal__post:hover { transform: translateX(2px); }
.cal__post .pf { font-size: .8rem; }
.cal__post.s-plan { background: rgba(0,173,255,.12); color: #0073b3; }
.cal__post.s-review { background: rgba(255,107,53,.14); color: #c2410c; }
.cal__post.s-live { background: rgba(34,197,94,.14); color: #15803d; }

/* ============================================================
   BOARD (Ideen & Aufgaben)
   ============================================================ */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(208px, 1fr); gap: var(--sp-3); align-items: start; overflow-x: auto; padding-bottom: var(--sp-3); }
.board__col { background: var(--bg-surface); border-radius: var(--r-lg); padding: var(--sp-3); min-width: 0; }
.board__col-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.board__col-head .t { font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.board__col-head .c { font-family: var(--mono); font-size: .7rem; color: var(--text-3); }
.board__col .head-dot { width: 8px; height: 8px; border-radius: 50%; }
.task {
  position: relative; cursor: pointer;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3); box-shadow: var(--shadow); text-align: left; width: 100%; display: block;
  transition: transform var(--ease) .1s, box-shadow var(--ease) .12s;
}
.task:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: .4; cursor: grabbing; }
.cardlist { display: flex; flex-direction: column; gap: var(--sp-3); }
/* Wartet auf Abstimmung/Rückmeldung — dezenter oranger Schimmer */
.task--wait { background: rgba(255,107,53,.05); border-color: rgba(255,107,53,.35); }
.task--wait:hover { border-color: rgba(255,107,53,.5); }
.meta-date { font-size: .7rem; color: var(--text-3); font-weight: 500; }
.task.just-moved { animation: dropPop .3s var(--ease); }
@keyframes dropPop { 0% { transform: scale(.96); box-shadow: 0 0 0 2px rgba(0,173,255,.3); } 60% { transform: scale(1.01); } 100% { transform: none; } }
.board__col-body { min-height: 48px; display: flex; flex-direction: column; gap: var(--sp-3); transition: background var(--ease) .12s; }
.task__new {
  position: absolute; top: 14px; right: 14px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.board__col.drag-over { background: rgba(0,173,255,.08); outline: 2px dashed rgba(0,173,255,.4); outline-offset: -2px; }
.task .t { font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.task .meta { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.task .who { font-size: .7rem; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.task .who .av { width: 18px; height: 18px; border-radius: 50%; background: var(--violet); color: #fff; display: grid; place-items: center; font-size: .6rem; font-weight: 700; }
.task .stars { color: var(--orange); font-size: .72rem; letter-spacing: 1px; }

/* Filter-Leiste (Bereiche) */
.fbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-5); }
.fchip {
  font-size: .8rem; font-weight: 500; color: var(--text-2);
  padding: .4rem .9rem; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--bg);
  transition: all var(--ease) .12s;
}
.fchip:hover { border-color: var(--border-strong); color: var(--text); }
.fchip.is-active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* Bereich-Tag + Plattform-Chip (neutral) */
.task__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag-area {
  font-family: var(--mono); font-size: .56rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); border: 1px solid var(--border); padding: 2px 7px; border-radius: var(--r-full);
}
.pf-chip {
  font-size: .68rem; font-weight: 600; color: var(--text-2);
  background: var(--bg-surface); padding: 2px 8px; border-radius: var(--r-full);
}
.pill--neutral { background: var(--bg-surface); color: var(--text-2); }

/* Kalender-Layout mit Backlog rechts */
.cal-layout { display: grid; grid-template-columns: 1fr 290px; gap: var(--sp-5); align-items: start; }
.backlog { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.backlog__head { padding: var(--sp-5); border-bottom: 1px solid var(--border); }
.backlog__head .mono { display: block; margin-bottom: 6px; color: var(--text-2); }
.backlog__head p { font-size: .78rem; color: var(--text-3); line-height: 1.4; }
.backlog__list { padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-3); min-height: 80px; }
.btask {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-3); cursor: grab; transition: transform var(--ease) .1s, box-shadow var(--ease) .12s;
}
.btask:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btask.dragging { opacity: .4; cursor: grabbing; }
.btask .t { font-weight: 600; font-size: .82rem; margin-bottom: 6px; }
.cal__cell--drop { background: rgba(0,173,255,.10) !important; box-shadow: inset 0 0 0 2px var(--accent); }
.cal__post[draggable="true"] { cursor: grab; }
.cal__post.dragging { opacity: .4; }
.backlog--drop { box-shadow: inset 0 0 0 2px var(--accent); }
.backlog--drop .backlog__list { background: rgba(0,173,255,.06); }

/* Timeline / Aktivität */
.timeline { display: flex; flex-direction: column; gap: 2px; }
.tl { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; position: relative; }
.tl__dot {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: .7rem; background: var(--bg-surface); color: var(--text-2); border: 1px solid var(--border);
}
.tl--comment .tl__dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.tl__body { flex: 1; min-width: 0; padding-bottom: var(--sp-2); }
.tl__meta { font-size: .78rem; margin-bottom: 2px; }
.tl__tag { font-family: var(--mono); font-size: .54rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); border: 1px solid var(--border); padding: 1px 6px; border-radius: var(--r-full); }
.tl__tag.team { background: var(--dark); color: #fff; border-color: var(--dark); }
.tl__time { color: var(--text-3); font-size: .72rem; margin-left: 4px; }
.tl__text { font-size: .85rem; color: var(--text); }
.tl-more { font-size: .78rem; font-weight: 600; color: var(--accent); margin-bottom: var(--sp-3); }
.tl-more:hover { text-decoration: underline; }
/* Verlauf: scrollbarer Bereich statt endlos lang */
.tl-scroll { max-height: 230px; overflow-y: auto; margin: 0 calc(-1 * var(--sp-2)); padding: 0 var(--sp-2); }
.tl-scroll::-webkit-scrollbar { width: 6px; }
.tl-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }

/* Lightbox (großes Bild) */
.lightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: var(--sp-8); background: rgba(11,19,32,.85); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--ease) .2s; cursor: zoom-out; }
.lightbox.is-open { opacity: 1; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.lightbox__x { position: fixed; top: var(--sp-5); right: var(--sp-5); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; font-size: 1.1rem; }
.lightbox__x:hover { background: rgba(255,255,255,.28); }

/* Eigenschafts-Kacheln im Aufgaben-Drawer */
.meta-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.mtile { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); min-width: 0; }
.mtile__lbl { font-family: var(--mono); font-size: .56rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; white-space: nowrap; }
.mtile__val { font-weight: 600; font-size: .88rem; }
.mtile__input { width: 100%; border: none; background: transparent; font-weight: 600; font-size: .86rem; color: var(--text); cursor: pointer; padding: 0; }
.mtile__input:focus { outline: none; color: var(--accent); }
.mtile--date { position: relative; }
.dp__btn { display: flex; align-items: center; justify-content: space-between; gap: 6px; text-align: left; }
.dp__caret { opacity: .45; font-size: .7rem; }
.dp__pop { position: absolute; top: 100%; left: 0; margin-top: 8px; z-index: 20; width: 256px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: var(--sp-3); }
.dp__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-2); font-size: .9rem; }
.dp__nav { width: 26px; height: 26px; border-radius: var(--r-sm); background: var(--bg-surface); display: grid; place-items: center; }
.dp__nav:hover { background: var(--bg-inset); }
.dp__dow { display: grid; grid-template-columns: repeat(7,1fr); }
.dp__dow span { text-align: center; font-family: var(--mono); font-size: .55rem; color: var(--text-3); padding: 4px 0; }
.dp__grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 1px; }
.dp__day { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); font-size: .78rem; color: var(--text); display: flex; align-items: center; justify-content: center; }
.dp__day:hover { background: var(--bg-surface); }
.dp__day--out { visibility: hidden; }
.dp__day.is-today { color: var(--accent); font-weight: 700; }
.dp__day.is-sel { background: var(--dark); color: #fff; font-weight: 600; }
.dp__dot { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.dp__day.is-sel .dp__dot { background: #fff; }
.dp__foot { display: flex; justify-content: space-between; margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--border); }
.dp__act { font-size: .78rem; color: var(--accent); font-weight: 600; }
.dp__act:hover { text-decoration: underline; }
.pf { display: inline-flex; align-items: center; }
.pf-chip { display: inline-flex; align-items: center; gap: 5px; }

.cal__post { cursor: pointer; }

/* ============================================================
   GANTT
   ============================================================ */
.gantt { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow); overflow-x: auto; }
.gantt__inner { min-width: 760px; }
.gantt__head { display: grid; grid-template-columns: 200px 1fr; margin-bottom: var(--sp-4); }
.gantt__weeks { display: grid; }
.gantt__weeks span { font-family: var(--mono); font-size: .62rem; color: var(--text-3); text-transform: uppercase; padding-left: 4px; border-left: 1px solid var(--border); }
.gantt__row { display: grid; grid-template-columns: 200px 1fr; align-items: center; padding: var(--sp-2) 0; border-radius: var(--r-md); }
.gantt__row--edit { cursor: pointer; transition: background var(--ease) .12s; }
.gantt__row--edit:hover { background: var(--bg-surface); }
.gantt__label { font-size: .85rem; font-weight: 500; padding-right: var(--sp-4); }
.gantt__label small { display: block; font-family: var(--mono); font-size: .62rem; color: var(--text-3); text-transform: uppercase; }
.gantt__track { position: relative; height: 30px; }
.gantt__bar {
  position: absolute; top: 4px; height: 22px; border-radius: var(--r-full);
  display: flex; align-items: center; padding: 0 var(--sp-3); color: #fff; font-size: .7rem; font-weight: 600;
  white-space: nowrap; overflow: hidden;
}
.gantt__grid { position: absolute; inset: 0; display: grid; pointer-events: none; }
.gantt__grid span { border-left: 1px solid var(--border); }

/* ============================================================
   BUDGET
   ============================================================ */
.budget-bar { height: 14px; border-radius: var(--r-full); background: var(--bg-inset); overflow: hidden; display: flex; margin: var(--sp-4) 0 var(--sp-3); }
.budget-bar i { height: 100%; display: block; }
.budget-bar .used { background: var(--accent); }
.budget-bar .bound { background: var(--orange); }
.budget-key { display: flex; gap: var(--sp-6); flex-wrap: wrap; }
.budget-key span { display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; color: var(--text-2); }
.budget-key .dot { width: 10px; height: 10px; border-radius: 3px; }
.ledger { width: 100%; border-collapse: collapse; }
.ledger th { text-align: left; font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); font-weight: 500; }
.ledger td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); font-size: .88rem; }
.ledger tr:last-child td { border-bottom: none; }
.ledger .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ledger .amt.neg { color: var(--text); }

/* ============================================================
   MODAL / DRAWER
   ============================================================ */
.scrim { position: fixed; inset: 0; background: rgba(13,27,42,.5); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity var(--ease) .2s; z-index: 100; }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 92vw;
  background: var(--bg); box-shadow: var(--shadow-lg); z-index: 101;
  transform: translateX(100%); transition: transform var(--ease) .28s; overflow-y: auto;
  pointer-events: none; /* geschlossen → fängt keine Klicks ab (Bugfix) */
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.drawer.is-open { transform: none; pointer-events: auto; }
.drawer::-webkit-scrollbar { width: 8px; }
.drawer::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
.drawer::-webkit-scrollbar-track { background: transparent; }

/* Karten-/Modal-Variante: mittig aufgehen statt von der Seite */
.drawer--modal {
  top: 50%; left: 50%; right: auto; bottom: auto;
  height: auto; max-height: 88vh; width: 560px; max-width: 94vw;
  border-radius: var(--r-xl); overflow: hidden auto;
  transform: translate(-50%, -50%) scale(.96); opacity: 0;
  transition: transform var(--ease) .22s, opacity var(--ease) .22s;
}
.drawer--modal.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.drawer__head { padding: var(--sp-6); border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-4); }
.drawer__head h3 { font-size: 1.2rem; font-weight: 600; }
.drawer__close { width: 32px; height: 32px; border-radius: var(--r-md); background: var(--bg-surface); display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.drawer__body { padding: var(--sp-6); }
.preview {
  aspect-ratio: 4 / 5; border-radius: var(--r-lg); overflow: hidden; position: relative;
  display: grid; place-items: center; color: #fff; text-align: center; padding: var(--sp-6); margin-bottom: var(--sp-5);
}
.preview .pf-badge { position: absolute; top: var(--sp-3); left: var(--sp-3); background: rgba(0,0,0,.35); backdrop-filter: blur(6px); padding: 5px 10px; border-radius: var(--r-full); font-size: .72rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.preview .cap { font-size: 1.05rem; font-weight: 600; line-height: 1.35; align-self: end; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.preview--sm { aspect-ratio: 16 / 10; margin-bottom: 0; }

/* ============================================================
   ITEM-DRAWER (neu)
   ============================================================ */
.di-head { display: flex; align-items: center; justify-content: flex-end; padding: var(--sp-3) var(--sp-3) 0; }
.di-head__edit { margin-right: auto; font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--bg-surface); padding: .4rem .8rem; border-radius: var(--r-full); }
.di-head__edit:hover { background: var(--bg-inset); color: var(--text); }
.drawer__body.di { padding: 0; }
.di__hero { aspect-ratio: 4 / 3; border-radius: 0; margin: 0; }
.di__drop { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: var(--sp-8) var(--sp-4); margin-bottom: var(--sp-5); border: 2px dashed var(--border-strong); border-radius: var(--r-md); background: var(--bg-surface); color: var(--text-2); transition: border-color var(--ease) .15s, background var(--ease) .15s; }
.di__drop:hover { border-color: var(--accent); background: rgba(0,173,255,.05); }
.di__drop-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; font-size: 1.1rem; color: var(--accent); margin-bottom: 4px; }
.di__drop-t { font-weight: 600; font-size: .9rem; color: var(--text); }
.di__drop-s { font-size: .75rem; color: var(--text-3); }
.di__herodate { position: absolute; top: var(--sp-3); right: var(--sp-3); z-index: 2; background: rgba(0,0,0,.35); backdrop-filter: blur(6px); color: #fff; font-size: .72rem; font-weight: 600; padding: 5px 10px; border-radius: var(--r-full); }
.di__hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), transparent 55%); z-index: 0; }
.di__hero .cap { z-index: 1; }
.di__hero .pf-badge { z-index: 2; }
.di__upload { position: absolute; bottom: var(--sp-3); right: var(--sp-3); z-index: 3; background: rgba(255,255,255,.92); color: var(--ink); font-size: .74rem; font-weight: 600; padding: 6px 12px; border-radius: var(--r-full); backdrop-filter: blur(4px); }
.di__upload:hover { background: #fff; }
.di__pad { padding: var(--sp-6); }
.di__tags { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
/* kleiner Kreis-Stift (Bearbeiten) */
.icon-edit { width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--bg-surface); color: var(--text-2); font-size: .85rem; display: grid; place-items: center; transition: all var(--ease) .12s; }
.icon-edit:hover { background: var(--bg-inset); color: var(--text); }
.di__tags .icon-edit { margin-left: auto; }
/* Edit-Icon auf Karten (oben rechts, bei Hover) */
.card-edit { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-surface); color: var(--text-2); font-size: .78rem; display: grid; place-items: center; opacity: 0; transition: opacity var(--ease) .12s, background var(--ease) .12s; }
.task:hover .card-edit { opacity: 1; }
.card-edit:hover { background: var(--bg-inset); color: var(--text); }
.di__title { font-size: 1.4rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.di__desc { color: var(--text-2); margin: var(--sp-4) 0 0; }
.cta-row { margin-top: var(--sp-5); }

/* Eigenschaften-Liste */
.props { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-5); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-5); margin-top: var(--sp-6); }
.prop { display: flex; flex-direction: column; gap: 3px; padding: var(--sp-3) 0; position: relative; min-width: 0; }
.prop--full { grid-column: 1 / -1; border-top: 1px solid var(--border); }
.prop__k { font-family: var(--mono); font-size: .58rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.prop__v { font-size: .9rem; font-weight: 600; min-width: 0; }
.prop__ro { font-weight: 600; }
.prop__edit { font: inherit; font-weight: 600; font-size: .9rem; color: var(--text); background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 5px 8px; cursor: pointer; width: 100%; transition: background var(--ease) .12s, border-color var(--ease) .12s; }
.prop__edit:hover { background: var(--bg-inset); border-color: var(--border-strong); }
.prop__edit--badge { font-weight: 700; border-radius: var(--r-full); padding-left: 12px; }
.prop__edit:focus { outline: none; background: var(--bg-surface); box-shadow: 0 0 0 2px rgba(0,173,255,.2); }
.prop .dp { position: relative; }
.prop .dp__pop { width: 256px; }

/* Kundensicht: visuelle Fakten-Chips statt Formular-Liste */
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: var(--sp-5); }
.fact-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; font-weight: 600; color: var(--text-2); background: var(--bg-surface); border: 1px solid var(--border); padding: 4px 11px; border-radius: var(--r-full); }
.di__meta-line { font-size: .78rem; color: var(--text-3); margin-top: var(--sp-3); }

/* Verlauf + Composer */
.di__section { margin-top: var(--sp-6); }
.di__section > .mono { display: block; margin-bottom: var(--sp-3); }
.setcard { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4) var(--sp-5); }
.composer { display: flex; gap: var(--sp-2); align-items: flex-end; margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--border); }
.composer textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; padding: .6rem .8rem; border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: .88rem; }
.composer textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,173,255,.15); }

/* Impact-Label (ersetzt Sterne) */
.impact { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; }
.impact .dot { width: 8px; height: 8px; border-radius: 50%; }
.impact--hoch { color: #15803d; } .impact--hoch .dot { background: var(--green); }
.impact--mittel { color: #c2410c; } .impact--mittel .dot { background: var(--orange); }
.impact--gering { color: var(--text-3); } .impact--gering .dot { background: var(--text-3); }

/* Feature-Toggles (Kunden-Einstellungen) */
.ftogs { display: flex; flex-direction: column; gap: 2px; }
.ftog { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) var(--sp-3); border-radius: var(--r-md); }
.ftog:hover { background: var(--bg-surface); }
.ftog.is-disabled { opacity: .5; }
.ftog__txt { display: flex; flex-direction: column; }
.ftog__lbl { font-weight: 600; font-size: .9rem; }
.ftog__note { font-size: .75rem; color: var(--text-3); }
.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: var(--r-full); background: var(--bg-inset); position: relative; cursor: pointer; flex: none; transition: background var(--ease) .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform var(--ease) .15s; }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(18px); }
.switch:disabled { cursor: not-allowed; }

/* Onboarding-Banner (Übersicht) */
.onbanner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-5); border-radius: var(--r-lg); background: var(--dark); color: #fff; background-image: radial-gradient(500px 200px at 100% 0%, rgba(0,173,255,.25), transparent 60%); }
.onbanner--info { background: var(--bg-surface); color: var(--text); background-image: none; border: 1px solid var(--border); }
.onbanner__t { font-weight: 600; font-size: 1.05rem; }
.onbanner__s { font-size: .85rem; opacity: .8; margin-top: 2px; }
.onbanner--info .onbanner__s { color: var(--text-3); opacity: 1; }

/* Admin-Notiz / Post-It (gelb) */
.note { position: relative; display: flex; gap: var(--sp-4); align-items: flex-start; background: #FFF8DB; border: 1px solid #F2E3A8; border-radius: var(--r-lg); padding: var(--sp-5) var(--sp-6); margin-bottom: var(--sp-5); box-shadow: 0 6px 18px rgba(180,150,30,.10); }
.note__edit { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.7); }
.note__edit:hover { background: #fff; }
.note-add { width: 100%; text-align: center; border: 1.5px dashed #E3CE7E; background: #FFFCEE; color: #9A7B1A; font-weight: 600; font-size: .85rem; padding: var(--sp-4); border-radius: var(--r-lg); margin-bottom: var(--sp-5); transition: all var(--ease) .12s; }
.note-add:hover { background: #FFF8DB; border-color: #D9BE5E; }
.note__pin { font-size: 1.3rem; line-height: 1; flex: none; }
.note__body { min-width: 0; }
.note__body .mono { display: block; margin-bottom: 5px; color: #9A7B1A; }
.note__text { font-size: .95rem; color: var(--text); font-weight: 500; line-height: 1.45; }
.note__text b { font-weight: 700; }

/* Rich-Text-Editor für die Notiz */
.rtbar { display: flex; gap: 4px; margin-bottom: var(--sp-2); }
.rtbtn { width: 30px; height: 30px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--bg); font-size: .85rem; font-weight: 700; display: grid; place-items: center; }
.rtbtn:hover { background: var(--bg-surface); }
.rtcol { font-weight: 800; }
.rt { min-height: 80px; line-height: 1.45; cursor: text; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--bg-elevated); padding: .65rem .85rem; }
.rt:empty:before { content: attr(data-ph); color: var(--text-3); }
.rt:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,173,255,.15); }
.note__cta { margin-top: var(--sp-4); gap: 7px; box-shadow: 0 6px 16px rgba(11,19,32,.12); }
.note__cta span { transition: transform var(--ease) .15s; }
.note__cta:hover span { transform: translateX(3px); }

/* Quick-Add im Board */
.board__add { width: 100%; border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2); font-weight: 600; font-size: .82rem; padding: var(--sp-3); border-radius: var(--r-md); transition: all var(--ease) .12s; }
.board__add:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,173,255,.05); }

/* Onboarding-Formular */
.ob-f { margin-bottom: var(--sp-5); }
.ob-f label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: var(--sp-3); }
.ob-f textarea.field-input { min-height: 70px; resize: vertical; }
.obchips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.obchip { font-size: .82rem; font-weight: 500; color: var(--text-2); padding: .45rem .9rem; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--bg); transition: all var(--ease) .12s; }
.obchip:hover { border-color: var(--border-strong); }
.obchip.is-on { background: var(--dark); color: #fff; border-color: var(--dark); }
/* Onboarding read-only */
.ob-ro { padding: var(--sp-4) 0; border-bottom: 1px solid var(--border); }
.ob-ro:last-child { border-bottom: none; }
.ob-ro__q { font-size: .8rem; color: var(--text-3); margin-bottom: 4px; }
.ob-ro__a { font-size: .92rem; font-weight: 500; }
.kv { display: flex; justify-content: space-between; padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; }
.drawer__actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-6); }

.comment { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-3); }
.comment .who { font-size: .75rem; font-weight: 600; margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.comment .who .tag { font-family: var(--mono); font-size: .58rem; text-transform: uppercase; background: var(--accent); color: #fff; padding: 1px 6px; border-radius: var(--r-full); }
.comment .who .tag.team { background: var(--dark); }
.comment p { font-size: .85rem; color: var(--text-2); }

input.field-input, textarea.field-input, select.field-input { width: 100%; padding: .65rem .85rem; background: var(--bg-elevated); border: 1px solid var(--border-strong); border-radius: var(--r-md); font: inherit; font-size: .9rem; color: var(--text); }
input.field-input::placeholder, textarea.field-input::placeholder { color: var(--text-3); }
input.field-input:focus, textarea.field-input:focus, select.field-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,173,255,.15); }
textarea.field-input { resize: vertical; min-height: 80px; }

/* Admin client table */
.ctable { width: 100%; border-collapse: collapse; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.ctable th { text-align: left; font-family: var(--mono); font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: var(--sp-4); border-bottom: 1px solid var(--border); font-weight: 500; }
.ctable td { padding: var(--sp-4); border-bottom: 1px solid var(--border); font-size: .9rem; }
.ctable tr:last-child td { border-bottom: none; }
.ctable tr.row:hover { background: var(--bg-surface); cursor: pointer; }
.ctable .cname { display: flex; align-items: center; gap: var(--sp-3); font-weight: 600; }
.ctable .cav { width: 30px; height: 30px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .75rem; }

.toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--dark); color: #fff; padding: .8rem 1.3rem; border-radius: var(--r-full);
  font-size: .85rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 200;
  opacity: 0; pointer-events: none; transition: all var(--ease) .25s; display: flex; align-items: center; gap: var(--sp-2);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.empty { text-align: center; padding: var(--sp-10); color: var(--text-3); }

/* role switch (prototype only) */
.proto-switch {
  position: fixed; bottom: var(--sp-5); right: var(--sp-5); z-index: 90;
  background: var(--dark); color: #fff; border-radius: var(--r-full); padding: 5px;
  display: flex; gap: 4px; box-shadow: var(--shadow-lg); font-size: .78rem;
}
.proto-switch button { color: var(--on-dark-muted); padding: .4rem .9rem; border-radius: var(--r-full); font-weight: 600; }
.proto-switch button.is-active { background: var(--accent); color: #fff; }
.proto-switch .lbl { color: var(--on-dark-muted); font-family: var(--mono); font-size: .58rem; text-transform: uppercase; align-self: center; padding: 0 var(--sp-2) 0 var(--sp-3); letter-spacing: .08em; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: 1fr 1fr; }
  .cal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app.is-active { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .rail__logo { padding: var(--sp-2); }
  .rail__client { margin: 0; flex: 1; min-width: 160px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav__item { width: auto; }
  .rail__foot { margin: 0; padding: 0; }
  .main { padding: var(--sp-6) var(--sp-5); }
  .login { grid-template-columns: 1fr; }
  .login__brand { display: none; }
}
@media (max-width: 680px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .cal__cell { min-height: 80px; }
  .cal__post span.t { display: none; }
  .topbar { flex-direction: column; }
}
