/* ============================================================================
   Eis und Eis — Design Language v1 (Nocturne)
   Single global stylesheet. Load order inside this file:
     1. tokens.css  — semantic layer + base element styles
     2. components.css — buttons, tags, forms, cards, avatars, presence, dialogs
     3. chat.css    — the three-column chat shell
     4. legacy re-skin — maps the existing .razor class names onto the tokens
   Per-component .razor.css should hold ONLY layout unique to that component —
   no colours, no font stacks, no spacing literals.
   ========================================================================== */

/* ── 1. TOKENS ─────────────────────────────────────────────────────────────
   Dark, near-neutral blue-grey ground. ONE accent, used as a line and a glow,
   never as a flood. Light mode is deliberately NOT solved (see design-language
   §11) — both :root and [data-theme="dark"] carry the same dark ramp. */
:root,
[data-theme="dark"],
[data-theme="light"] {

  /* Ground and surfaces — three levels. The chat column is the LIGHTEST. */
  --bg:               #161826;
  --surface:          #232532;
  --sidebar-bg:       #1b1d2b;
  --surface-sunken:   #12131d;

  --border:           rgb(233 233 237 / 0.16);
  --border-strong:    rgb(233 233 237 / 0.45);

  --text:             #e9e9ed;
  --text-secondary:   rgb(233 233 237 / 0.78);
  --text-muted:       rgb(233 233 237 / 0.55);
  --text-faint:       rgb(233 233 237 / 0.45);

  /* ONE accent — a line, a mark, a text colour, a soft glow. Never a fill. */
  --accent:           #9184d9;
  --accent-soft:      #d2cefd;
  --accent-deep:      #2b2741;
  --accent-mid:       #423a6a;
  --accent-tint:      rgb(145 132 217 / 0.12);
  --accent-tint-hi:   rgb(145 132 217 / 0.22);
  --accent-line:      rgb(145 132 217 / 0.45);

  /* Neutral ramp */
  --neutral-100:      #f4f4f5;
  --neutral-200:      #e6e6e9;
  --neutral-800:      #3a3c45;
  --neutral-900:      #292b31;

  /* Messages */
  --own-msg:          var(--accent-tint);
  --own-msg-line:     var(--accent-line);
  --other-msg:        var(--surface);
  --other-msg-line:   var(--border);

  /* The only two colours outside the ramp — safety feedback only. */
  --danger:           #a4657f;
  --danger-text:      #cf9aab;
  --danger-bg:        #3a2430;
  --verified:         #6f9d8c;
  --verified-text:    #cfe6dd;
  --verified-bg:      #22302c;

  /* Type — Inter, headings never past weight 500. */
  --font-sans:        "Inter", system-ui, -apple-system, sans-serif;
  --font-mono:        ui-monospace, "SF Mono", "Cascadia Code", monospace;
  --font-weight-h:    500;

  --text-2xs:         10px;
  --text-xs:          11px;
  --text-sm:          12.5px;
  --text-base:        13.5px;
  --text-msg:         15px;
  --text-lg:          17px;
  --text-xl:          20px;
  --text-2xl:         25px;
  --text-3xl:         32px;
  --text-display:     42px;

  --leading-tight:    1.12;
  --leading-body:     1.55;
  --measure-msg:      52ch;
  --measure-text:     62ch;

  /* Spacing — density 0.70×, dense on purpose. */
  --space-1:          2.8px;
  --space-2:          5.6px;
  --space-3:          8.4px;
  --space-4:          11.2px;
  --space-6:          16.8px;
  --space-8:          22.4px;
  --space-12:         33.6px;

  --radius-sm:        4px;
  --radius-md:        8px;
  --radius-lg:        14px;
  --radius-full:      9999px;

  /* Elevation — an edge plus ambient darkness, never heavy shadows. */
  --shadow-sm:        0 0 0 1px #3f424d;
  --shadow-md:        0 0 0 1px #595d6c, 0 6px 18px rgb(0 0 0 / 0.55);
  --shadow-lg:        0 0 0 1px #9397ab, 0 16px 40px rgb(0 0 0 / 0.65);
  --glow-accent:      0 0 0 1px rgb(145 132 217 / 0.5),
                      0 0 28px -10px rgb(145 132 217 / 0.45);

  /* Layout */
  --rail-left:        260px;
  --rail-right:       232px;
  --rail-private:     300px;
  --touch-min:        44px;

  /* Motion — at most ONE animated element per screen. */
  --dur-fast:         150ms;
  --dur-normal:       250ms;
  --dur-rise:         400ms;
  --dur-pulse:        1800ms;
  --dur-glow:         3400ms;
  --ease:             cubic-bezier(0.4, 0, 0.2, 1);

  /* Back-compat aliases so older component CSS keeps resolving. */
  --primary:          var(--accent);
  --primary-dark:     var(--accent-deep);
  --accent-light:     var(--accent-tint);
  --swiss-red:        var(--accent);
  --swiss-red-dark:   var(--accent-deep);
  --swiss-red-light:  var(--accent-tint);
  --warm-white:       var(--bg);
  --warm-gray-50:     var(--sidebar-bg);
  --warm-gray-100:    var(--surface);
  --warm-gray-200:    var(--border);
  --warm-gray-300:    var(--neutral-800);
  --warm-gray-500:    var(--text-muted);
  --warm-gray-700:    var(--text-secondary);
  --warm-gray-900:    var(--text);
  --transition-fast:  var(--dur-fast) var(--ease);
  --transition-normal:var(--dur-normal) var(--ease);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-h);
  line-height: var(--leading-tight);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}
h1 { font-size: var(--text-display); letter-spacing: -0.025em; }
h2 { font-size: var(--text-3xl);     letter-spacing: -0.02em;  }
h3 { font-size: var(--text-2xl);     }
h4 { font-size: var(--text-xl);      }
h5 { font-size: 16px;                }
h6 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

p { margin: 0 0 var(--space-3); text-wrap: pretty; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { color: var(--accent-soft); text-decoration: underline; }
img { display: block; max-width: 100%; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-tint-hi); }

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

/* ── 2. COMPONENTS ─────────────────────────────────────────────────────────
   Buttons, tags, forms, cards, avatars, presence, badges, rules, dialogs. */

/* Buttons — primary is an ACCENT OUTLINE, never a fill. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-sans); font-weight: var(--font-weight-h);
  font-size: 14px; line-height: 1.2; color: var(--text);
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary   { color: var(--accent); border-color: var(--accent); }
.btn-primary:hover  { background: var(--accent-tint); }
.btn-primary:active { background: var(--accent-tint-hi); }

.btn-secondary { border-color: var(--border); }
.btn-secondary:hover  { background: rgb(233 233 237 / 0.07); }
.btn-secondary:active { background: rgb(233 233 237 / 0.14); }

.btn-ghost { color: var(--accent); padding-inline: var(--space-1); }
.btn-ghost:hover  { background: rgb(145 132 217 / 0.10); }
.btn-ghost:active { background: rgb(145 132 217 / 0.18); }

/* Destructive: danger appears as a LINE and TEXT only. */
.btn-danger { color: var(--danger-text); border-color: rgb(164 101 127 / 0.5); }
.btn-danger:hover { background: rgb(164 101 127 / 0.12); }

.btn-icon  { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; }
.btn-touch { min-width: var(--touch-min); min-height: var(--touch-min); }

/* Tags / chips */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); letter-spacing: 0.02em;
  padding: 3px 10px; border-radius: 6px;
}
.tag-neutral { background: var(--neutral-800); color: var(--neutral-100); }
.tag-accent  { background: var(--accent-mid);  color: #f5f4ff; }
.tag-outline { border: 1px solid var(--accent); color: var(--accent); }
.tag-select { cursor: pointer; padding: 6px 12px; font-size: var(--text-sm); }
.tag-select[aria-pressed="true"] { border: 1px solid var(--accent); color: var(--accent); background: transparent; }

/* Forms */
.field { display: block; margin-bottom: var(--space-4); }
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px; color: var(--text-secondary);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px;
  font: inherit; font-size: 14px; color: var(--text);
  caret-color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.input:hover { border-color: var(--border-strong); }
.input:focus-visible { border-color: var(--accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }

/* Forms breathe: 44px fields, 16px text. 16px is mandatory on mobile. */
.input-lg { min-height: 44px; height: 44px; font-size: 16px; padding: 11px 12px; }

.hint  { font-size: var(--text-xs); color: var(--text-faint); margin-top: 5px; }
.error { font-size: var(--text-xs); color: var(--danger-text); margin-top: 5px; }

.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--border);
}
.radio .dot-box { border-radius: var(--radius-sm); }
.radio:hover .dot { border-color: var(--accent); }
.radio input:checked + .dot {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 4px var(--bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--accent); outline-offset: 2px; }

.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.seg-opt + .seg-opt { border-left: 1px solid var(--border); }
.seg-opt:has(input:checked) { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.seg-opt:not(:has(input:checked)):hover { background: rgb(233 233 237 / 0.07); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Toggle */
.switch {
  width: 40px; height: 22px; border-radius: var(--radius-full); flex: none;
  background: rgb(233 233 237 / 0.08); box-shadow: inset 0 0 0 1px var(--border);
  display: inline-flex; align-items: center; padding: 0 3px; cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.switch > span { width: 16px; height: 16px; border-radius: 50%; background: var(--text-faint);
  transition: transform var(--dur-fast) var(--ease); }
.switch[aria-checked="true"] { background: var(--accent-tint-hi); box-shadow: inset 0 0 0 1px rgb(145 132 217 / 0.55); }
.switch[aria-checked="true"] > span { background: var(--accent); transform: translateX(18px); }

/* Cards */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-6); border-radius: var(--radius-md); background: var(--surface);
}
.card-kicker { font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.card-title  { font-family: var(--font-sans); font-weight: var(--font-weight-h); font-size: var(--text-lg); line-height: 1.2; }
.card-body   { margin: 0; font-size: var(--text-sm); color: var(--text-secondary); }
.card-meta   { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.card-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

.label-group {
  font-size: var(--text-2xs); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
}

/* Avatars — monogram, never an empty photo placeholder. */
.avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-weight: var(--font-weight-h);
  font-size: 11px; letter-spacing: 0.02em; text-transform: uppercase;
  background: var(--neutral-800); color: var(--neutral-200);
  box-shadow: 0 0 0 1px var(--border);
}
.avatar-member {
  background: var(--accent-deep); color: #e7e5fe;
  box-shadow: 0 0 0 1px rgb(145 132 217 / 0.4);
}
.avatar-sm { width: 24px; height: 24px; font-size: 10px; }
.avatar-md { width: 42px; height: 42px; font-size: 14px; }
.avatar-lg { width: 62px; height: 62px; font-size: 20px; }
.avatar-xl { width: 78px; height: 78px; font-size: 26px; }

/* Presence — SHAPE, not colour. */
.presence { width: 8px; height: 8px; flex: none; border-radius: 50%; }
.presence-online  { background: var(--accent); }
.presence-recent  { border: 1.5px solid var(--accent); }
.presence-offline { height: 1.5px; border-radius: 0; background: var(--text-faint); }
.presence-typing  { background: var(--accent); animation: eis-pulse var(--dur-pulse) ease-in-out infinite; }

/* Unread — a number when it matters, a dot when it does not. */
.badge-count {
  font-size: var(--text-2xs); min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent-mid); color: #f5f4ff;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* Verified — the one place --verified appears. */
.badge-verified {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: var(--text-2xs); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: var(--radius-sm);
  background: var(--verified-bg); color: var(--verified-text);
  box-shadow: inset 0 0 0 1px var(--verified);
}

/* Rules — fade to transparent over 48px at each end. */
.rule {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: linear-gradient(to right,
    transparent, var(--border) 48px,
    var(--border) calc(100% - 48px), transparent);
}
.rule-bottom { background: linear-gradient(to right, transparent, var(--border) 48px, var(--border) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px; }
.rule-top    { background: linear-gradient(to right, transparent, var(--border) 48px, var(--border) calc(100% - 48px), transparent) no-repeat top / 100% 1px; }

/* Dialog */
.dialog-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgb(18 19 29 / 0.72);
  display: flex; align-items: center; justify-content: center; padding: var(--space-8);
}
.dialog {
  width: 100%; max-width: 440px; padding: var(--space-8);
  border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: var(--space-6);
  animation: eis-rise var(--dur-rise) var(--ease);
}
.dialog-title   { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.dialog-body    { margin: 0; font-size: 13px; line-height: var(--leading-body); color: var(--text-secondary); }
.dialog-actions { display: flex; align-items: center; gap: var(--space-3); }

/* System / toast / banner */
.system-note {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-md);
  background: var(--surface); font-size: var(--text-sm); color: var(--text-secondary);
}
.toast {
  position: fixed; bottom: var(--space-8); left: 50%; transform: translateX(-50%);
  z-index: 120; padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md); background: var(--surface);
  box-shadow: var(--shadow-md); font-size: var(--text-base);
  animation: eis-rise var(--dur-rise) var(--ease);
}

/* Locked photo — hatched, NEVER blurred. */
.photo-locked {
  border-radius: var(--radius-md);
  background: repeating-linear-gradient(135deg,
    var(--neutral-900) 0 7px, var(--neutral-800) 7px 14px);
  box-shadow: inset 0 0 0 1px var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
}

/* Progress */
.meter { height: 3px; border-radius: 2px; background: var(--neutral-800); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); }
.meter-lg { height: 6px; border-radius: 3px; }
.meter-against > span { background: rgb(233 233 237 / 0.35); }

/* Motion — three keyframes, no fourth. */
@keyframes eis-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}
@keyframes eis-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgb(145 132 217 / 0.45), 0 0 22px -6px rgb(145 132 217 / 0.40); }
  50%      { box-shadow: 0 0 0 1px rgb(145 132 217 / 0.70), 0 0 34px -4px rgb(145 132 217 / 0.65); }
}
@keyframes eis-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.is-fresh { animation: eis-glow var(--dur-glow) ease-in-out infinite; }
.is-new   { animation: eis-rise var(--dur-rise) var(--ease); }

/* ── 3. CHAT SHELL ─────────────────────────────────────────────────────────
   Three columns. Both flanks one step DARKER than the ground; the middle is
   the lightest area on screen. */
.chat-layout {
  display: grid;
  grid-template-columns: var(--rail-left) minmax(0, 1fr) var(--rail-right);
  height: 100dvh;
  background: var(--bg);
}
.sidebar,
.member-rail {
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  min-height: 0;
}
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

/* Brand — the mark is the "1" of eins und eins. */
.sidebar-header { padding: var(--space-6) var(--space-4) var(--space-4); position: relative; }
.logo {
  display: flex; align-items: center; gap: 9px;
  margin: 0; font-size: 16px; font-weight: var(--font-weight-h);
}
.logo-mark {
  width: 18px; height: 18px; flex: none; border-radius: var(--radius-sm);
  background: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgb(145 132 217 / 0.45);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--accent);
}
.tagline { margin: 3px 0 0 27px; font-size: var(--text-xs); color: var(--text-muted); }

/* Identity block */
.user-info, .anon-info {
  margin: 0 var(--space-4) var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgb(233 233 237 / 0.05);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.user-name  { font-size: 13px; font-weight: var(--font-weight-h); }
.user-role  { font-size: var(--text-2xs); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.user-role-anon { color: var(--text-muted); }

/* Guest upsell — informative, not nagging. */
.guest-note {
  margin: 0 var(--space-4) var(--space-4); padding: var(--space-4);
  border-radius: var(--radius-md); background: var(--accent-deep);
  display: flex; flex-direction: column; gap: var(--space-3);
  font-size: 12px; line-height: var(--leading-body); color: #e7e5fe;
}

/* Nav links — Phosphor icons, no emoji. */
.nav-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); margin: 0 var(--space-3);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
}
.nav-link:hover { background: rgb(233 233 237 / 0.07); color: var(--text); text-decoration: none; }
.nav-link > i   { font-size: 16px; }
.nav-link > .badge-count, .nav-link > .badge-dot { margin-left: auto; }

/* Room list */
.room-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--space-3) var(--space-4); }
.room-list h3,
.room-group-label {
  padding: var(--space-4) var(--space-3) var(--space-2);
  margin: 0; font-size: var(--text-2xs); font-weight: 400;
  letter-spacing: 0.11em; text-transform: uppercase; color: var(--text-faint);
}
.room-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 9px 10px; border-radius: var(--radius-sm);
  cursor: pointer; min-height: 36px;
  transition: background var(--dur-fast) var(--ease);
}
.room-item:hover { background: rgb(233 233 237 / 0.07); }
.room-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.room-item.active {
  background: var(--accent-tint);
  box-shadow: inset 2px 0 0 var(--accent);
}
.room-name  { font-size: 13.5px; margin-right: auto; color: var(--text-secondary); }
.room-item.active .room-name { color: var(--text); font-weight: var(--font-weight-h); }
.room-count { font-size: var(--text-xs); color: var(--text-faint); }
.room-item.active .room-count { color: var(--accent); }
.room-lang  { font-size: var(--text-2xs); color: var(--text-faint); }
.unread-badge {
  font-size: var(--text-2xs); min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full); background: var(--accent-mid); color: #f5f4ff;
  margin-left: auto;
}

/* Quote of the day */
.quote-of-day {
  margin: var(--space-4) var(--space-4) var(--space-6);
  padding-top: var(--space-4);
  background: linear-gradient(to right, var(--border), transparent) no-repeat top / 100% 1px;
  font-size: 12px; line-height: var(--leading-body); color: var(--text-muted);
}
.quote-author { display: block; margin-top: 3px; font-size: var(--text-xs); color: var(--text-faint); }

/* Room header */
.chat-header {
  padding: var(--space-4) var(--space-8);
  display: flex; align-items: center; gap: var(--space-6);
  background: linear-gradient(to right, transparent, var(--border) 48px, var(--border) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.chat-header h2 { margin: 0; font-size: 19px; letter-spacing: -0.015em; }
.chat-header-meta { font-size: 11.5px; color: var(--text-muted); }
.chat-header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }

/* Message stream */
.message-list {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: var(--space-6) var(--space-8);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.day-divider { display: flex; align-items: center; gap: var(--space-4); }
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 1px; }
.day-divider::before { background: linear-gradient(to right, transparent, var(--border)); }
.day-divider::after  { background: linear-gradient(to left,  transparent, var(--border)); }
.day-divider > span  { font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--text-muted); }

.msg { display: flex; gap: 11px; align-items: flex-start; }
.msg-own { flex-direction: row-reverse; }
.msg-head {
  display: flex; align-items: baseline; gap: var(--space-3); margin-bottom: var(--space-1);
}
.msg-own .msg-head { justify-content: flex-end; }
.msg-author { font-size: 13px; font-weight: var(--font-weight-h); }
.msg-time   { font-size: var(--text-xs); color: var(--text-muted); }

/* The bubble. Own = accent line + tint; other = surface + hairline.
   The flattened TOP CORNER points at the sender. */
.msg-bubble {
  padding: 9px 12px; border-radius: var(--radius-md);
  font-size: var(--text-msg); line-height: var(--leading-body);
  max-width: var(--measure-msg);
  background: var(--other-msg); border: 1px solid var(--other-msg-line);
  border-top-left-radius: var(--radius-sm);
  overflow-wrap: break-word;
}
.msg-own .msg-bubble {
  background: var(--own-msg); border-color: var(--own-msg-line);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-sm);
}
.msg-grouped .msg-head { display: none; }
.msg-grouped .avatar { visibility: hidden; }

/* Shared link — the platform never downloads or inspects the target. */
.msg-link {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: 9px; padding: 8px 10px;
  border-radius: var(--radius-sm); background: var(--bg);
  box-shadow: inset 0 0 0 1px var(--border);
}
.msg-link-host { font-size: 12.5px; font-weight: var(--font-weight-h); }
.msg-link-note { font-size: var(--text-xs); color: var(--text-muted); }

.typing {
  display: flex; align-items: center; gap: var(--space-3);
  padding-left: 41px; font-size: 12px; color: var(--text-muted);
}

/* Match banner — the ONE animated element in the room. */
.match-notification {
  margin-top: auto;
  display: flex; align-items: center; gap: var(--space-4);
  padding: 11px var(--space-6); border-radius: var(--radius-md);
  background: var(--surface);
  animation: eis-glow var(--dur-glow) ease-in-out infinite,
             eis-rise var(--dur-rise) var(--ease);
}
.match-notification-title { font-size: 13.5px; font-weight: var(--font-weight-h); }
.match-notification-why   { font-size: 11.5px; color: var(--text-muted); }

/* Composer */
.composer { padding: var(--space-4) var(--space-8) var(--space-6); }
.composer-row { display: flex; align-items: flex-end; gap: 9px; }
.composer textarea.input {
  min-height: 46px; height: 46px; max-height: 130px;
  resize: none; padding: 13px 12px; font-size: var(--text-msg);
}
.composer-meta {
  display: flex; align-items: center; gap: var(--space-6);
  margin-top: var(--space-3); font-size: var(--text-xs); color: var(--text-faint);
}
.composer-count { margin-left: auto; }

/* Member rail */
.member-rail-header {
  padding: 15px var(--space-4) var(--space-3);
  display: flex; align-items: center;
  font-size: var(--text-2xs); letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--text-faint);
}
.member-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--space-3); }
.member-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm); min-height: 36px;
}
.member-item:hover { background: rgb(233 233 237 / 0.06); }
.member-name { font-size: 12.5px; margin-right: auto; color: var(--text-secondary); }
.member-anon { color: var(--text-muted); }
.member-anon-tag { font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }

/* Safety tools live permanently in the rail. */
.safety-tools {
  margin: var(--space-3) var(--space-4) var(--space-6);
  padding: var(--space-4); border-radius: var(--radius-md);
  background: var(--surface);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.safety-tool { display: flex; align-items: center; gap: var(--space-3); font-size: 12.5px; cursor: pointer; }
.safety-tool > i { font-size: 14px; color: var(--text-muted); }
.safety-tool-report > i { color: var(--danger); }

/* Empty state */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-3);
  padding: var(--space-12); text-align: center;
}
.empty-state > i { font-size: 34px; color: var(--text-faint); margin-bottom: var(--space-2); }
.empty-state h2  { margin: 0; font-size: var(--text-2xl); }
.empty-state p   { margin: 0; max-width: 46ch; font-size: var(--text-base); color: var(--text-secondary); }

/* Connection status (SignalR) */
.connection-bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-8);
  background: var(--surface); font-size: var(--text-sm); color: var(--text-secondary);
  box-shadow: inset 0 -1px 0 var(--border);
}
.connection-bar .presence-typing { margin-right: var(--space-1); }

/* Mobile — three columns become three levels. */
@media (max-width: 1023px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar, .member-rail { display: none; }
  .chat-layout[data-mobile-view="rooms"]   .sidebar     { display: flex; }
  .chat-layout[data-mobile-view="rooms"]   .chat-main   { display: none; }
  .chat-layout[data-mobile-view="members"] .member-rail { display: flex; }
  .chat-layout[data-mobile-view="members"] .chat-main   { display: none; }

  .chat-header, .message-list, .composer { padding-inline: var(--space-4); }
  .msg-bubble { max-width: 100%; }
  .composer textarea.input, .input { font-size: 16px; }
  .btn-icon { width: var(--touch-min); height: var(--touch-min); }
}

.tabbar {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  padding: var(--space-2) var(--space-2) var(--space-6);
  background: linear-gradient(to right, transparent, var(--border) 24px, var(--border) calc(100% - 24px), transparent) no-repeat top / 100% 1px;
}
@media (max-width: 1023px) { .tabbar { display: grid; } }
.tabbar-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-1);
  padding: var(--space-3) 0; min-height: var(--touch-min);
  font-size: 10.5px; color: var(--text-muted); text-decoration: none;
}
.tabbar-item > i { font-size: 21px; }
.tabbar-item[aria-current="page"] { color: var(--accent); }
.tabbar-item > .badge-dot { position: absolute; top: 6px; right: 22px; }

/* ── 4. LEGACY RE-SKIN ─────────────────────────────────────────────────────
   Maps the existing .razor class names (message, msg-input, members-panel,
   modal, account-page, legal-page, friends, admin, cookie-banner …) onto the
   tokens above so every page inherits the Nocturne look without renaming. */

/* Theme toggle */
.theme-toggle {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease);
}
.theme-toggle:hover { background: rgb(233 233 237 / 0.07); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Brand mark fallback (the "1" of eins und eins). */
.swiss-cross {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; flex: none; border-radius: var(--radius-sm);
  background: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgb(145 132 217 / 0.45);
  font-size: 11px; color: var(--accent); font-weight: var(--font-weight-h);
}
.swiss-cross::before, .swiss-cross::after { content: none; }

/* Generic link-style button */
.btn-link {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: var(--text-sm); padding: 0; font-weight: 500;
  font-family: var(--font-sans);
}
.btn-link:hover { color: var(--accent); }
.btn-link.danger { color: var(--danger-text); }

/* Small button */
.btn-sm { padding: 0.35rem 0.7rem; font-size: var(--text-xs); }

/* ── Messages (legacy .message / .msg-input) ────────────────────────────── */
.chat-body { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.message-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.message {
  max-width: 62%;
  background: var(--other-msg);
  border: 1px solid var(--other-msg-line);
  border-radius: var(--radius-md);
  border-top-left-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  align-self: flex-start;
}
.message.own {
  align-self: flex-end;
  background: var(--own-msg);
  border-color: var(--own-msg-line);
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-sm);
}
.message .content {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: var(--text-msg);
  line-height: var(--leading-body);
}
.msg-meta { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.2rem; }
.sender { font-weight: var(--font-weight-h); font-size: var(--text-sm); }
.timestamp { font-size: var(--text-xs); color: var(--text-muted); margin-left: auto; }
.message.own .timestamp { color: var(--text-muted); }

.anon-badge {
  font-size: var(--text-xs);
  background: var(--neutral-800);
  color: var(--neutral-200);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.edited-badge { font-size: var(--text-xs); color: var(--text-muted); font-style: italic; }

.edit-row { display: flex; gap: 0.4rem; align-items: center; margin-top: 0.25rem; }
.edit-row .edit-input { flex: 1; }

/* Message input */
.message-input {
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  display: flex;
  gap: 0.5rem;
  align-items: center;
  box-shadow: inset 0 1px 0 var(--border);
}
.msg-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-msg);
  font-family: var(--font-sans);
  outline: none;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
}
.msg-input:focus { border-color: var(--accent); }
.msg-input::placeholder { color: var(--text-muted); }

/* Members panel (legacy) */
.members-panel {
  width: 220px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--dur-fast) var(--ease);
}
.members-panel:not(.open) { width: 48px; }
.members-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 0.75rem; cursor: pointer;
  font-weight: var(--font-weight-h); font-size: var(--text-sm);
  user-select: none; color: var(--text-secondary);
}
.members-panel:not(.open) .members-header { flex-direction: column; gap: 0.25rem; padding: 0.75rem 0.5rem; }
.members-toggle { font-size: var(--text-sm); opacity: 0.7; }
.members-list { flex: 1; overflow-y: auto; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.member-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.5rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); cursor: pointer;
}
.member-item:hover { background: rgb(233 233 237 / 0.06); }
.member-item.anon .member-name { font-style: italic; color: var(--text-muted); }
.member-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-deep); color: #e7e5fe;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: var(--font-weight-h);
  flex-shrink: 0; box-shadow: 0 0 0 1px rgb(145 132 217 / 0.4);
}
.member-item.anon .member-avatar { background: var(--neutral-800); color: var(--neutral-200); box-shadow: 0 0 0 1px var(--border); }
.member-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-item.active { background: var(--accent-tint); }

/* Whisper */
.message.whisper {
  max-width: 62%;
  background: var(--sidebar-bg);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  border-top-left-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
  align-self: flex-start;
}
.message.whisper .content { font-style: italic; color: var(--text-muted); }
.whisper-icon { font-size: var(--text-sm); }
.whisper-bar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1.25rem; background: var(--sidebar-bg);
}
.whisper-bar-label { font-size: var(--text-sm); font-weight: var(--font-weight-h); white-space: nowrap; }
.whisper-bar .whisper-input { flex: 1; }
.whisper-bar .whisper-close {
  background: none; border: none; cursor: pointer;
  font-size: var(--text-sm); color: var(--text-muted);
  padding: 0.2rem 0.4rem; border-radius: var(--radius-sm);
}
.whisper-bar .whisper-close:hover { background: rgb(233 233 237 / 0.07); color: var(--text); }

/* Link cards */
.link-card {
  display: flex; align-items: center; gap: 0.5rem;
  margin-top: 0.5rem; padding: 0.6rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); max-width: 340px;
}
.link-icon { font-size: 1.2rem; flex-shrink: 0; }
.link-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.link-domain {
  font-weight: var(--font-weight-h); font-size: var(--text-sm);
  color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.link-path { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-report-btn {
  background: none; border: none; cursor: pointer;
  font-size: var(--text-sm); padding: 0.2rem 0.4rem;
  border-radius: 4px; opacity: 0.6; flex-shrink: 0;
}
.link-report-btn:hover { opacity: 1; background: rgb(233 233 237 / 0.07); }
.link-report-url {
  font-family: var(--font-mono); font-size: var(--text-xs);
  background: var(--surface); padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm); word-break: break-all; margin: 0.5rem 0;
}

/* Modal (legacy) → dialog look */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgb(18 19 29 / 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: eis-rise var(--dur-rise) var(--ease);
}
.modal h3 { margin: 0 0 0.75rem; font-size: var(--text-lg); font-weight: var(--font-weight-h); }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.25rem; }

/* Private chat */
.private-chat-layout { display: flex; height: 100vh; overflow: hidden; }
.chat-list-sidebar {
  width: 300px; min-width: 300px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.private-chat-rail {
  width: 260px; min-width: 260px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--border);
  padding: 1.25rem;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 1rem;
}
.rail-hint { font-size: 13px; color: var(--text-3); line-height: 1.5; margin: 8px 0 0; }
.rail-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.private-chat-rail .card { padding: 1rem; }
.private-chat-rail .card i { font-size: 20px; color: var(--accent); }
.chat-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; justify-content: space-between;
  padding: 0.85rem 1.25rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--dur-fast) var(--ease);
}
.chat-item:hover { background: rgb(233 233 237 / 0.05); }
.chat-item.active { background: var(--accent-tint); }
.chat-name { font-weight: var(--font-weight-h); }
.chat-time { font-size: var(--text-xs); color: var(--text-muted); }
.empty-hint { padding: 1.25rem; color: var(--text-muted); font-size: var(--text-sm); }
.private-chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Sub-page layout (consistent across Friends, Account, Profile, etc.) */
.subpage { max-width: 640px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }
.subpage--wide { max-width: none; }
.subpage-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.subpage-header h1 { font-size: var(--text-2xl); font-weight: var(--font-weight-h); margin: 0; letter-spacing: -0.02em; flex: 1; }
.subpage-back {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: var(--text-sm); font-weight: 500;
  color: var(--text-muted); text-decoration: none;
  padding: 0.4rem 0.75rem; border-radius: var(--radius-md);
  transition: background 0.15s, color 0.15s;
}
.subpage-back:hover { background: rgb(233 233 237 / 0.07); color: var(--text); }
.subpage-back i { font-size: 16px; }

/* Account page (legacy alias) */
.account-page { max-width: 640px; margin: 2.5rem auto; padding: 0 1.25rem; }
.account-page h1 { font-size: var(--text-2xl); font-weight: var(--font-weight-h); margin: 0 0 1.5rem; letter-spacing: -0.02em; }
.account-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.account-section h2 { margin: 0 0 1rem; font-size: var(--text-lg); font-weight: var(--font-weight-h); }
.profile-stats { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; }
.stat-item { font-weight: var(--font-weight-h); }
.form-row { display: flex; gap: 0.75rem; margin-top: 0.85rem; }
.form-row .msg-input { flex: 1; }
.profile-info p { margin: 0.5rem 0; }
.success { color: var(--verified-text); }
.success-box {
  margin-top: 1rem; padding: 1.25rem;
  background: var(--verified-bg);
  border: 1px solid var(--verified);
  border-radius: var(--radius-md); text-align: center;
}
.success-box .btn-primary { margin-top: 1rem; }
.error-box {
  margin-top: 1rem; padding: 1.25rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md); text-align: center;
}
.error-box .btn-primary { margin-top: 1rem; }
.confirm-box { margin-top: 1rem; padding: 1rem; background: var(--accent-tint); border-radius: var(--radius-md); }

/* Legal pages */
.legal-page { max-width: 720px; margin: 2.5rem auto; padding: 0 1.75rem; line-height: 1.7; }
.legal-page h1 { color: var(--text); font-size: var(--text-2xl); font-weight: var(--font-weight-h); margin-bottom: 0.5rem; }
.legal-page .meta { color: var(--text-muted); font-size: var(--text-sm); }
.legal-page h2 { margin-top: 1.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; font-size: var(--text-lg); font-weight: var(--font-weight-h); }
.legal-page ul { padding-left: 1.5rem; }
.legal-page li { margin: 0.4rem 0; }

/* Friends */
.friend-list { display: flex; flex-direction: column; gap: 0.5rem; }
.friend-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.friend-info { display: flex; flex-direction: column; }
.friend-name { font-weight: var(--font-weight-h); color: var(--text); }
.friend-username { font-size: var(--text-sm); color: var(--text-muted); }
.friend-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Toast + match notification (legacy positions) */
.toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text);
  padding: 0.85rem 1.5rem; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  z-index: 2000; box-shadow: var(--shadow-lg);
  cursor: pointer; max-width: 90%; text-align: center;
  animation: eis-rise var(--dur-rise) var(--ease);
}
.match-notification {
  position: fixed; top: 4rem; left: 50%; transform: translateX(-50%);
  background: var(--surface); color: var(--text);
  padding: 0.85rem 1.5rem; border-radius: var(--radius-md);
  font-size: var(--text-sm); font-weight: 500;
  z-index: 1999; box-shadow: var(--glow-accent);
  cursor: pointer; display: flex; align-items: center; gap: 1rem;
  animation: eis-glow var(--dur-glow) ease-in-out infinite;
}

/* Report / context menu buttons on messages */
.report-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 1rem; padding: 0.15rem 0.35rem;
  border-radius: 6px; opacity: 0.55; line-height: 1;
  color: var(--text-muted);
}
.report-btn:hover { opacity: 1; background: rgb(233 233 237 / 0.07); }

.menu-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.5rem; }
.menu-actions button {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease);
}
.menu-actions button:hover { background: rgb(233 233 237 / 0.07); }

/* Community vote panel */
.vote-panel { border-top: 1px solid var(--border); background: var(--surface); max-height: 260px; overflow-y: auto; }
.vote-panel-header {
  padding: 0.75rem 1.25rem; cursor: pointer;
  font-weight: var(--font-weight-h); font-size: var(--text-sm);
  display: flex; justify-content: space-between; align-items: center;
  user-select: none;
}
.vote-panel-header:hover { background: rgb(233 233 237 / 0.05); }
.vote-panel-body { padding: 0 1.25rem 0.85rem; }
.vote-item { padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.vote-item:last-child { border-bottom: none; }
.vote-item-meta { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: 0.4rem; }
.vote-actions { display: flex; gap: 0.5rem; }
.btn-vote {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--dur-fast) var(--ease);
}
.btn-vote:hover { background: rgb(233 233 237 / 0.07); }
.btn-vote.active { color: var(--accent); border-color: var(--accent); background: var(--accent-tint); }

/* Account restriction lists */
.restriction-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
.restriction-item:last-child { border-bottom: none; }
.restriction-name { font-weight: 500; }
.restriction-scope { font-size: var(--text-xs); color: var(--text-muted); margin-left: 0.5rem; }

/* Admin panel */
.admin-main { max-width: 1100px; margin: 0 auto; padding: 1.75rem; }
.admin-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.admin-header h1 { margin: 0; font-size: var(--text-2xl); font-weight: var(--font-weight-h); }
.admin-badge {
  background: var(--accent-mid); color: #f5f4ff;
  font-size: var(--text-xs); padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full); font-weight: 600;
}
.admin-tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; flex-wrap: wrap; }
.admin-tab {
  background: transparent; border: none;
  padding: 0.65rem 1.1rem; cursor: pointer;
  font-size: var(--text-sm); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.admin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.admin-section h2 { margin: 0 0 1rem; font-size: var(--text-lg); font-weight: var(--font-weight-h); }
.admin-search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.admin-search input {
  flex: 1; padding: 0.6rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: var(--bg); color: var(--text);
}
.admin-hint { color: var(--text-muted); font-size: var(--text-sm); padding: 0.5rem 0; }
.admin-username { display: block; font-size: var(--text-xs); color: var(--text-muted); }
.admin-keyword-add { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.admin-keyword-add input {
  flex: 1; padding: 0.6rem 0.9rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: var(--bg); color: var(--text);
}
.admin-warning {
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  color: var(--text);
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.admin-table th, .admin-table td { text-align: left; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); }
.admin-table th { font-weight: 600; color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; }
.admin-table tr:hover td { background: rgb(233 233 237 / 0.04); }

/* Status badges — mono ramp + danger line, never green/red fills. */
.status-banned { color: var(--danger-text); font-weight: 600; }
.status-shadow { color: var(--accent-soft); font-weight: 600; }
.status-ok { color: var(--verified-text); font-weight: 600; }
.status-lifted { color: var(--verified-text); font-weight: 600; }
.status-expired { color: var(--text-muted); font-weight: 600; }

/* 1+1 Matching */
.find-partner-btn { margin-left: auto; white-space: nowrap; }
.match-item, .connection-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.6rem;
  gap: 0.75rem;
  flex-wrap: wrap;
  background: var(--surface);
}
.match-info, .connection-info { display: flex; flex-direction: column; gap: 0.3rem; }
.match-name, .connection-name { font-weight: var(--font-weight-h); font-size: var(--text-base); }
.match-source, .connection-source { font-size: var(--text-sm); color: var(--text-muted); }
.match-score { font-size: var(--text-sm); color: var(--accent); font-weight: 600; }
.match-time, .connection-time { font-size: var(--text-xs); color: var(--text-muted); }
.match-actions, .connection-actions { display: flex; gap: 0.5rem; align-items: center; }
.interest-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.85rem; }
.interest-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--accent-tint);
  color: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
}
.tag-remove { background: none; border: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0; }
.tag-remove:hover { color: var(--danger-text); }
.toggle-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }

/* Room rules */
.room-rules {
  margin-top: 0.6rem;
  padding: 0.6rem 0.9rem;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  line-height: 1.5;
}
.rules-icon { flex-shrink: 0; }

/* Message formatting */
.content code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent-soft);
}
.content strong { font-weight: var(--font-weight-h); }
.content em { font-style: italic; }

/* Room greeting */
.room-greeting {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-style: italic;
  margin-top: var(--space-1);
  animation: eis-rise 0.6s var(--ease);
}

/* Holiday banner — quiet, no gradient flood. */
.holiday-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  animation: eis-rise 0.4s var(--ease);
}
.holiday-banner .holiday-icon { font-size: 1.2rem; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  animation: eis-rise 0.3s var(--ease);
}
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: eis-pulse var(--dur-pulse) ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Cozy loading */
.cozy-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: var(--space-8); gap: var(--space-3);
}
.cozy-loading .loading-dots { display: flex; gap: 6px; }
.cozy-loading .loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); opacity: 0.4;
  animation: eis-pulse 1.4s ease-in-out infinite;
}
.cozy-loading .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.cozy-loading .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
.cozy-loading .loading-text { font-size: var(--text-sm); color: var(--text-muted); }

/* Empty state icon (legacy) */
.empty-state .empty-icon { font-size: 2.5rem; opacity: 0.7; }

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface-sunken);
  color: var(--text);
  padding: 1.1rem 1.75rem;
  z-index: 1000;
  box-shadow: inset 0 1px 0 var(--border), 0 -2px 12px rgb(0 0 0 / 0.4);
}
.cookie-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cookie-content p { margin: 0; font-size: var(--text-sm); flex: 1; min-width: 250px; line-height: 1.5; }
.cookie-content a { color: var(--accent); }
.cookie-actions { flex-shrink: 0; }

/* Blazor error boundary — quiet, on-brand. */
.blazor-error-boundary {
  background: var(--surface-sunken);
  padding: 1rem 1rem 1rem 3.7rem;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border);
}
.blazor-error-boundary::after { content: "Ein Fehler ist aufgetreten."; }

/* Validation (Blazor) */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--verified); }
.invalid { outline: 1px solid var(--danger); }
.validation-message { color: var(--danger-text); }

/* Blazor reconnect modal */
#components-reconnect-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center;
  background: rgb(18 19 29 / 0.85);
  border: none; padding: 0;
}
#components-reconnect-modal[open] { display: flex; }
.components-reconnect-container {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  box-shadow: var(--shadow-lg);
  text-align: center;
  max-width: 380px;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-4);
}
.components-reconnect-container p {
  margin: 0; font-size: var(--text-base); color: var(--text-secondary);
}
.components-reconnect-container button {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit; font-weight: var(--font-weight-h);
  cursor: pointer;
}
.components-reconnect-container button:hover { background: var(--accent-tint); }
.components-rejoining-animation {
  display: flex; gap: 6px; justify-content: center;
}
.components-rejoining-animation div {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: eis-pulse var(--dur-pulse) ease-in-out infinite;
}
.components-rejoining-animation div:nth-child(2) { animation-delay: 0.2s; }

/* ── Profile page (Screen 08/09) ──────────────────────────────────────────── */
.profile-page {
    max-width: 720px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 2rem;
}
.profile-avatar {
    width: 78px; height: 78px;
    border-radius: 50%;
    background: var(--accent-tint);
    border: 2px solid var(--accent-line);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    color: var(--accent);
    flex-shrink: 0;
}
.profile-header-info { flex: 1; }
.profile-header-info h1, .profile-name { font-size: var(--text-xl); font-weight: var(--font-weight-h); margin: 0; letter-spacing: -0.02em; }
.profile-meta {
    display: flex; gap: 16px;
    font-size: 13px; color: var(--text-3);
    margin: 6px 0 0;
}
.profile-meta i { margin-right: 4px; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    background: var(--accent-tint);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}
.profile-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.seg {
    display: flex;
    gap: 4px;
    background: var(--surface-sunken);
    border-radius: var(--radius-md);
    padding: 3px;
    flex-wrap: wrap;
}
.seg-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
    background: var(--accent);
    color: #fff;
}
.meter {
    height: 4px;
    background: var(--surface-sunken);
    border-radius: 2px;
    margin-bottom: 10px;
    overflow: hidden;
}
.meter-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width var(--dur-fast) var(--ease);
}

/* ── Suggestions layout (Screen 07) ───────────────────────────────────────── */
.suggestions-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}
.suggestions-layout > .subpage-header { grid-column: 1 / -1; margin-bottom: 0; }
.suggestions-main h1 { font-size: var(--text-2xl); font-weight: var(--font-weight-h); margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.suggestion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.suggestion-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.suggestion-name { font-weight: var(--font-weight-h); font-size: 16px; }
.suggestion-source { font-size: 13px; color: var(--text-3); }
.suggestion-why {
    background: var(--accent-tint);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 12px;
}
.suggestion-why-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    display: block;
    margin-bottom: 4px;
}
.suggestion-why p { font-size: 13px; color: var(--text-2); margin: 0; line-height: 1.5; }
.suggestion-footer { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.suggestion-time { font-size: 12px; color: var(--text-3); }
.suggestion-score {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-tint);
    padding: 2px 10px;
    border-radius: 999px;
}
.suggestion-actions { display: flex; gap: 8px; }
.suggestions-rail { display: flex; flex-direction: column; gap: 1rem; }
.suggestions-rail .card { padding: 1.25rem; }
.suggestions-rail .card h3 { font-size: 14px; font-weight: var(--font-weight-h); margin: 0 0 10px; }
.suggestions-rail .card i { font-size: 18px; color: var(--accent); }
@media (max-width: 900px) {
    .suggestions-layout { grid-template-columns: 1fr; }
}

/* ── Register two-step (Screen 02) ────────────────────────────────────────── */
.register-step {
    max-width: 480px;
    margin: 0 auto;
    padding: 40px 0;
}

.register-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.register-step-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-3);
    white-space: nowrap;
}

.register-body {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2);
    margin: 12px 0 24px;
}

.register-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.register-footnote {
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-3);
    line-height: 1.5;
}

.register-footnote i {
    font-size: 18px;
    color: var(--accent);
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Landing page (Screen 01) ───────────────────────────────────────────── */
.landing {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  max-width: 1200px; margin: 0 auto;
  padding: var(--space-8) var(--space-12);
}
.landing-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  padding-bottom: var(--space-6);
}
.landing-brand { display: flex; align-items: center; gap: var(--space-3); }
.landing-brand-name { font-weight: var(--font-weight-h); font-size: var(--text-lg); }
.landing-nav { display: flex; gap: var(--space-6); }
.landing-nav a {
  font-size: var(--text-sm); color: var(--text-muted);
  text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.landing-nav a:hover { color: var(--text); }
.landing-actions { display: flex; gap: var(--space-3); }

.landing-hero {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: var(--space-12);
  padding: var(--space-12) 0;
  align-items: center;
}
.landing-eyebrow {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--accent);
  letter-spacing: 0.02em; margin: 0 0 var(--space-4);
}
.landing-h1 {
  font-size: 48px; font-weight: var(--font-weight-h);
  line-height: var(--leading-tight);
  max-width: 17ch; margin: 0 0 var(--space-6);
}
.landing-lead {
  font-size: var(--text-lg); color: var(--text-secondary);
  line-height: var(--leading-body); margin: 0 0 var(--space-4);
}
.landing-sub {
  font-size: var(--text-sm); color: var(--text-muted);
  margin: 0 0 var(--space-8);
}
.landing-cta { display: flex; gap: var(--space-3); margin-bottom: var(--space-4); }
.landing-note { font-size: var(--text-xs); color: var(--text-faint); margin: 0; }

.landing-hero-visual { display: flex; flex-direction: column; gap: var(--space-6); }
.landing-excerpt {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  display: flex; flex-direction: column; gap: var(--space-4);
}
.landing-msg { display: flex; gap: var(--space-3); align-items: flex-start; }
.landing-msg-author { font-size: var(--text-xs); color: var(--accent); font-weight: 500; }
.landing-msg p { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-secondary); }
.landing-typing {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs); color: var(--text-faint);
  padding-left: 40px;
}
.landing-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }

.landing-stats {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--text-muted);
  padding: var(--space-4) 0;
}
.landing-stats-dot { color: var(--text-faint); }

.landing-footer {
  margin-top: auto;
  padding-top: var(--space-6);
  font-size: var(--text-xs); color: var(--text-faint);
}
.landing-footer nav { display: flex; gap: var(--space-4); margin-top: var(--space-2); }
.landing-footer a { color: var(--text-muted); text-decoration: none; }
.landing-footer a:hover { color: var(--text); }

@media (max-width: 1023px) {
  .landing { padding: var(--space-6) var(--space-6); }
  .landing-hero { grid-template-columns: 1fr; gap: var(--space-8); }
  .landing-h1 { font-size: 36px; }
  .landing-header { flex-wrap: wrap; }
  .landing-nav { display: none; }
}
