:root {
  color-scheme: dark;
  --bg: #101113;
  --bg-soft: #15171a;
  --panel: rgba(23, 25, 28, 0.96);
  --panel-soft: rgba(28, 30, 34, 0.96);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 136, 31, 0.34);
  --text: #f2f4f7;
  --muted: #98a0aa;
  --accent: #ff881f;
  --accent-soft: #ffb15f;
  --green: #4ade80;
  --yellow: #facc15;
  --red: #fb7185;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  --radius: 24px;
  --radius-sm: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(255, 136, 31, 0.05), transparent 22%),
    radial-gradient(circle at 78% 14%, rgba(255, 177, 95, 0.04), transparent 18%),
    linear-gradient(180deg, #141518 0%, var(--bg) 100%);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-soft);
}

button,
input,
textarea,
select {
  font: inherit;
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(16px);
  background: rgba(14, 14, 14, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.topbar-inner {
  width: min(100% - 2rem, 1280px);
  margin: 0 auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
  color: var(--text);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 136, 31, 0.18), rgba(255, 177, 95, 0.10));
  box-shadow: 0 12px 30px rgba(255, 138, 31, 0.16);
  border: 1px solid rgba(255, 136, 31, 0.14);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 0.1rem;
}

.brand-copy strong {
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-link,
.nav-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.72rem 1rem;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  transition: 160ms ease;
}

.nav-link:hover,
.nav-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 136, 31, 0.08);
}

.nav-link-user {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 136, 31, 0.16);
  color: var(--text);
  font-weight: 700;
  user-select: none;
}

.nav-link-user:hover {
  color: #ffffff;
  border-color: rgba(255, 136, 31, 0.34);
  background: rgba(255, 136, 31, 0.10);
}

.nav-user-label {
  display: inline-block;
}

.nav-user-caret {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-soft);
  font-size: 0.88rem;
  line-height: 1;
  transform: translateY(-1px);
  transition: transform 160ms ease, color 160ms ease;
}

.nav-menu[open] .nav-user-caret {
  transform: rotate(180deg) translateY(1px);
  color: #ffd8b4;
}

.nav-link-subtle,
.nav-button-subtle {
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.nav-link-subtle:hover,
.nav-button-subtle:hover {
  color: var(--text);
}

.inline-form {
  margin: 0;
}

.nav-menu {
  position: relative;
}

.nav-menu[open] .nav-link-user {
  border-color: rgba(255, 136, 31, 0.34);
  background: rgba(255, 136, 31, 0.12);
}

.nav-menu summary {
  list-style: none;
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 190px;
  display: grid;
  gap: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(31, 33, 37, 0.98) 0%, rgba(19, 20, 23, 0.99) 100%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.28);
}

.nav-dropdown-link,
.nav-dropdown-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-dropdown-link:hover,
.nav-dropdown-button:hover {
  color: var(--text);
  background: rgba(255, 136, 31, 0.10);
  border-color: rgba(255, 136, 31, 0.12);
}

.nav-dropdown-form {
  margin: 0;
}

.stage {
  width: min(100% - 2rem, 1280px);
  margin: 0 auto;
}

.stage-page {
  padding: 1.6rem 0 3rem;
}

.card,
.auth-card,
.panel,
.hero-card,
.workspace-sidebar,
.room-sidebar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top right, rgba(255, 136, 31, 0.025), transparent 24%),
    linear-gradient(180deg, rgba(31, 33, 37, 0.97) 0%, rgba(19, 20, 23, 0.99) 100%);
  box-shadow: var(--shadow);
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 140px);
}

.auth-card {
  width: min(100%, 580px);
  padding: 2rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.lead,
.muted-copy {
  color: var(--muted);
}

.lead {
  margin: 0;
  max-width: 64ch;
  font-size: 1.03rem;
  line-height: 1.75;
}

.muted-copy {
  margin: 0;
  line-height: 1.7;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.label {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.95rem 1rem;
  outline: none;
  transition: 160ms ease;
}

.input:focus {
  border-color: rgba(255, 138, 31, 0.48);
  box-shadow: 0 0 0 4px rgba(255, 138, 31, 0.10);
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.35rem;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  cursor: pointer;
  transition: 160ms ease;
}

.button-primary {
  color: #161616;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.button-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255, 138, 31, 0.22);
}

.button-ghost {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.button-ghost:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.field-error {
  margin: 0;
  font-size: 0.92rem;
  color: var(--red);
}

.auth-alt {
  margin: 1.2rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.flash-stack {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.flash {
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  padding: 0.95rem 1rem;
  font-size: 0.96rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.03);
}

.flash-success {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.08);
}

.flash-error {
  border-color: rgba(251, 113, 133, 0.28);
  background: rgba(251, 113, 133, 0.08);
}

.workspace-shell,
.room-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.workspace-main,
.room-main {
  display: grid;
  gap: 1rem;
}

.workspace-sidebar,
.room-sidebar,
.hero-card,
.panel {
  padding: 1.2rem;
}

.panel-head {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.room-head {
  margin-bottom: 0;
}

.room-head-main {
  display: grid;
  gap: 0.35rem;
}

.room-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.hero-copy {
  display: grid;
  gap: 0.35rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 1rem;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 0.3rem;
}

.stat-label,
.section-label {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.sidebar-section {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.75rem;
}

.status-list,
.room-list,
.user-list,
.participant-list,
.activity-log {
  display: grid;
  gap: 0.7rem;
}

.status-row,
.user-row,
.participant-row,
.activity-entry {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 1rem;
}

.status-row,
.participant-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.user-meta,
.room-meta {
  display: grid;
  gap: 0.2rem;
}

.user-meta span,
.room-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.room-list,
.workspace-grid,
.room-grid {
  display: grid;
  gap: 1rem;
}

.workspace-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-grid-single-top {
  margin-top: 0;
}

.room-row {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  transition: 160ms ease;
}

.room-row:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.room-avatar {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 900;
  color: #151515;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
}

.empty-card {
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 0.4rem;
}

.status-dot,
.participant-indicator {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.status-ok,
.badge-ok {
  background: rgba(74, 222, 128, 0.14);
  color: #b8ffd1;
}

.status-warn,
.badge-warn {
  background: rgba(250, 204, 21, 0.12);
  color: #fff1a8;
}

.status-info {
  background: rgba(255, 138, 31, 0.14);
  color: #ffd0a5;
}

.status-dot.status-ok,
.participant-indicator {
  background: var(--green);
}

.status-dot.status-warn {
  background: var(--yellow);
}

.status-dot.status-info {
  background: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
}

.badge-muted {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.control-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.code-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

.code-list code,
.code-block {
  display: block;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: #dff8ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.session-list {
  margin-top: 1rem;
}

.session-row {
  align-items: flex-start;
}

.inline-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.5rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 138, 31, 0.14);
  color: #ffd0a5;
  font-size: 0.78rem;
  font-weight: 700;
}

.incoming-call-box {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  width: min(360px, calc(100vw - 2rem));
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(24, 24, 24, 0.96);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  padding: 1rem;
}

.incoming-call-inner {
  display: grid;
  gap: 0.8rem;
}

.incoming-call-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
}

.incoming-call-title {
  display: block;
  font-size: 1rem;
  line-height: 1.4;
}

.incoming-call-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.audio-controls {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

/* Audio Controls Select Styling */
.audio-controls select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(20, 20, 25, 0.9);
  color: #e6e6eb;
  font-size: 0.9rem;
  outline: none;
  transition: border 0.15s ease, box-shadow 0.15s ease;
}

/* Hover */
.audio-controls select:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Focus */
.audio-controls select:focus {
  border-color: rgba(255, 138, 31, 0.6);
  box-shadow: 0 0 0 2px rgba(255, 138, 31, 0.14);
}

/* Option (funktioniert NICHT überall, aber schadet nicht) */
.audio-controls select option {
  background: #121217;
  color: #e6e6eb;
}

.audio-controls select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.workspace-main {
  display: grid;
  gap: 1rem;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.stage-page {
  position: relative;
  padding: 1.6rem 0 3rem;
}

.shell-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("/static/img/logo.webp");
  background-repeat: no-repeat;
  background-position: right 2rem bottom 2rem;
  background-size: min(340px, 32vw);
  opacity: 0.035;
  filter: grayscale(1) brightness(1.15);
  z-index: 0;
}

.stage-page > * {
  position: relative;
  z-index: 1;
}

.chat-log {
  display: grid;
  gap: 0.75rem;
  min-height: 260px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.chat-empty {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 1rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.chat-message {
  display: grid;
  gap: 0.3rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.chat-message-own {
  border-color: rgba(255, 136, 31, 0.22);
  background: rgba(255, 136, 31, 0.08);
}

.chat-message-author {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.chat-message-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  margin-top: 1rem;
}

.stage-page {
  padding-bottom: 12rem;
}

.app-statusbar {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.9rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(15, 17, 22, 0.96) 0%, rgba(10, 12, 16, 0.98) 100%);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}

.app-statusbar-item {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #d2d8e1;
  font-size: 0.95rem;
}

.status-green-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.status-shield {
  position: relative;
  width: 16px;
  height: 18px;
  display: inline-block;
  background: linear-gradient(180deg, #ff9a3d 0%, #ff6a00 100%);
  clip-path: polygon(50% 0%, 100% 18%, 100% 58%, 50% 100%, 0% 58%, 0% 18%);
  box-shadow: 0 0 16px rgba(255, 106, 0, 0.18);
}

.status-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.status-bars span {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb35e 0%, #ff6a00 100%);
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.16);
}

.status-bars span:nth-child(1) {
  height: 8px;
}

.status-bars span:nth-child(2) {
  height: 13px;
}

.status-bars span:nth-child(3) {
  height: 16px;
}

.global-call-dock {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  z-index: 60;
  transform: translateX(-50%);
  width: min(100% - 2rem, 1080px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(16, 18, 24, 0.97) 0%, rgba(9, 11, 15, 0.98) 100%);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.4);
  transition: opacity 180ms ease, transform 180ms ease;
}

.global-call-dock-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(16px);
}

.global-call-dock-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.global-call-dock-signal {
  width: 84px;
  height: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
}

.global-call-dock-signal span {
  display: block;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb35e 0%, #ff6a00 100%);
  box-shadow: 0 0 20px rgba(255, 136, 31, 0.18);
}

.global-call-dock-signal span:nth-child(1) { height: 16px; }
.global-call-dock-signal span:nth-child(2) { height: 28px; }
.global-call-dock-signal span:nth-child(3) { height: 38px; }
.global-call-dock-signal span:nth-child(4) { height: 28px; }
.global-call-dock-signal span:nth-child(5) { height: 16px; }

.global-call-dock-copy {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.global-call-dock-state {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #4ade80;
  font-size: 0.95rem;
}

.global-call-dock-live-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.global-call-dock-room-line {
  display: flex;
  align-items: center;
}

.global-call-dock-room-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.global-call-dock-room-button:hover {
  color: #ffd8b4;
}

.global-call-dock-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #9aa3af;
  font-size: 0.95rem;
}

.global-call-dock-divider {
  opacity: 0.45;
}

.global-call-dock-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.9rem;
}

.dock-action {
  min-width: 104px;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.dock-action:hover {
  transform: translateY(-1px);
}

.dock-action-muted {
  background: linear-gradient(180deg, rgba(255, 136, 31, 0.95) 0%, rgba(255, 102, 0, 0.95) 100%);
  color: #fff;
}

.dock-action-danger {
  background: linear-gradient(180deg, rgba(255, 78, 78, 0.95) 0%, rgba(220, 38, 38, 0.95) 100%);
  color: #fff;
}

@media (max-width: 960px) {
  .global-call-dock {
    width: calc(100% - 1rem);
    left: 0.5rem;
    right: 0.5rem;
    transform: none;
    bottom: 5.1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .global-call-dock-hidden {
    transform: translateY(16px);
  }

  .global-call-dock-actions {
    justify-content: stretch;
  }

  .dock-action {
    flex: 1 1 auto;
  }

  .app-statusbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .workspace-shell,
  .room-shell {
    grid-template-columns: 1fr;
  }

  .workspace-grid,
  .room-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    width: min(100% - 1rem, 1280px);
    min-height: 68px;
  }

  .stage {
    width: min(100% - 1rem, 1280px);
  }

  .nav {
    gap: 0.45rem;
  }

  .nav-link,
  .nav-button,
  .button {
    padding: 0.78rem 0.95rem;
  }

  .hero-card {
    padding: 1.15rem 1.25rem;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .user-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .nav-dropdown {
    right: 0;
    min-width: 170px;
  }

  .room-title-row {
    align-items: flex-start;
  }
}
/* === 2026 UI rework: production layout closer to preview === */
:root {
  --bg: #0d0e11;
  --bg-elevated: #111317;
  --panel: #14171d;
  --panel-soft: #181c23;
  --panel-deep: #101318;
  --line: rgba(255, 255, 255, 0.06);
  --line-soft: rgba(255, 255, 255, 0.035);
  --line-strong: rgba(255, 140, 32, 0.42);
  --text: #f4f6fb;
  --muted: #8e95a3;
  --muted-strong: #b7becb;
  --accent: #ff8a20;
  --accent-soft: #ffb062;
  --accent-faint: rgba(255, 138, 32, 0.12);
  --green: #42d687;
  --red: #ff6b7c;
  --radius: 22px;
  --radius-sm: 16px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
}

html, body {
  background:
    radial-gradient(circle at top left, rgba(255, 138, 32, 0.06), transparent 18%),
    radial-gradient(circle at top right, rgba(255, 138, 32, 0.05), transparent 16%),
    linear-gradient(180deg, #0c0d10 0%, #0e1115 100%);
}

body {
  color: var(--text);
}

.is-authenticated .stage {
  width: min(100% - 24px, 1580px);
}

.is-authenticated .stage-page {
  padding: 12px 0 84px;
}

.card,
.auth-card,
.panel,
.hero-card,
.workspace-sidebar,
.room-sidebar {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 28, 35, 0.98) 0%, rgba(16, 19, 24, 0.98) 100%);
  box-shadow: var(--shadow);
}

.workspace-shell-app {
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 120px);
}

.room-shell-app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  min-height: calc(100vh - 120px);
}

.room-main-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: 100%;
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  min-height: 100%;
}

.sidebar-brand-row,
.panel-head-spread,
.section-title-row,
.subpanel-head-spread {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-large {
  gap: 12px;
}

.brand-copy-large strong {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.icon-button,
.icon-button-static,
.icon-action,
.chat-plus,
.chat-icon-button,
.chat-send-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.icon-button-static {
  cursor: default;
}

.icon-button:hover,
.icon-action:hover,
.chat-plus:hover,
.chat-icon-button:hover,
.chat-send-button:hover {
  border-color: var(--line-strong);
  background: rgba(255, 138, 32, 0.09);
  color: #fff;
}

.icon-action-accent,
.chat-send-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #151515;
  border-color: rgba(255, 176, 98, 0.5);
}

.icon-action-danger,
.footer-nav-danger {
  border-color: rgba(255, 107, 124, 0.22);
  color: #ffd1d7;
}

.icon-action-small {
  width: 34px;
  height: 34px;
  border-radius: 12px;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
}

.profile-chip-large {
  padding: 12px 14px;
}

.profile-chip-copy {
  display: grid;
  gap: 3px;
}

.profile-chip-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.avatar-circle,
.mini-avatar {
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  color: #171717;
  flex: 0 0 auto;
}

.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.mini-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 0.84rem;
}

.avatar-accent,
.avatar-0 { background: linear-gradient(135deg, #ff8a20, #ffb062); }
.avatar-1 { background: linear-gradient(135deg, #ffb347, #ffd089); }
.avatar-2 { background: linear-gradient(135deg, #ffc76a, #ffe09d); }
.avatar-3 { background: linear-gradient(135deg, #f28f3b, #ffbe73); }

.online-dot,
.online-dot-large {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(66, 214, 135, 0.12);
}

.online-dot-large {
  width: 10px;
  height: 10px;
}

.search-shell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  min-height: 48px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.search-input {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
}

.search-input::placeholder,
.search-icon,
.search-shortcut {
  color: var(--muted);
}

.search-shortcut {
  font-size: 0.78rem;
}

.modern-list,
.sidebar-list {
  display: grid;
  gap: 8px;
}

.sidebar-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-link-row:hover {
  color: var(--text);
  border-color: rgba(255, 138, 32, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-link-copy {
  display: grid;
  gap: 2px;
}

.sidebar-link-copy span,
.empty-sidebar-note,
.room-current-card span,
.subpanel-head p,
.security-row .user-meta span,
.activity-entry-detailed span,
.room-crypto-banner span {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-sidebar-note,
.room-current-card,
.sidebar-stat-card {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-stat-card {
  display: grid;
  gap: 4px;
}

.sidebar-footer-nav {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.footer-nav-link,
.footer-nav-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.footer-nav-link:hover,
.footer-nav-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line-strong);
}

.footer-nav-form,
.full-width-form {
  width: 100%;
  margin: 0;
}

.workspace-main-home,
.security-main {
  display: grid;
}

.home-panel,
.security-hero-panel,
.room-chat-panel,
.members-panel {
  padding: 22px;
  min-height: 100%;
}

.home-grid,
.security-grid,
.security-list-grid {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.home-grid,
.security-grid,
.security-list-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.subpanel {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
}

.subpanel-full {
  margin-top: 18px;
}

.subpanel-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.subpanel-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill,
.status-inline-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.success-card {
  width: fit-content;
  margin-bottom: 14px;
}

.participant-list-modern,
.user-list-modern,
.participant-list-members,
.activity-log-modern {
  gap: 10px;
}

.participant-row-check,
.user-row-modern,
.participant-member-row,
.activity-entry-detailed {
  min-height: 58px;
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
}

.participant-row-check {
  justify-content: space-between;
}

.participant-row-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.user-meta-modern {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-meta-modern > div,
.user-meta-stack {
  display: grid;
  gap: 3px;
}

.user-meta-stack span {
  color: var(--muted);
  font-size: 0.92rem;
}

.room-chat-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 16px;
}

.chat-header-main {
  display: grid;
  gap: 4px;
}

.chat-header-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-header-at {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  color: var(--accent-soft);
  font-weight: 800;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-body {
  flex: 1 1 auto;
  min-height: 420px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top center, rgba(255,138,32,0.035), transparent 22%),
    linear-gradient(180deg, rgba(18, 22, 28, 0.98) 0%, rgba(14, 17, 22, 0.98) 100%);
  padding: 18px;
}

.chat-log-modern {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  max-height: 100%;
  overflow: auto;
}

.chat-empty {
  margin: auto;
  color: var(--muted);
  text-align: center;
}

.chat-message {
  max-width: min(78%, 620px);
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  align-self: flex-start;
}

.chat-message.chat-message-self,
.chat-message.self,
.chat-log .chat-row-self .chat-message {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255,138,32,0.95), rgba(255,176,98,0.88));
  color: #181818;
  border-color: rgba(255,176,98,0.4);
}

.chat-message-meta,
.chat-message .message-meta,
.chat-message small {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: var(--muted-strong);
}

.chat-form-modern {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 10px;
  align-items: center;
}

.chat-input-modern {
  min-height: 48px;
  border-radius: 16px;
}

.room-crypto-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 138, 32, 0.14);
  background: rgba(255, 138, 32, 0.06);
}

.crypto-lock {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
}

.room-technical-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.technical-status-row {
  min-height: 46px;
  border-radius: 16px;
  padding: 10px 12px;
}

.audio-controls-modern {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.members-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.members-head,
.slim-head {
  margin-bottom: 0;
}

.participant-list-members {
  display: grid;
}

.participant-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.participant-main-member {
  display: grid;
  gap: 3px;
  flex: 1 1 auto;
}

.participant-main-member span {
  color: var(--muted);
  font-size: 0.9rem;
}

.activity-panel-inline {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.activity-log-modern {
  max-height: 280px;
  overflow: auto;
}

.activity-entry-detailed,
.activity-log-modern .activity-entry {
  display: grid;
  gap: 4px;
}

.security-code-blocks {
  margin-bottom: 16px;
}

.app-statusbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(10, 12, 15, 0.82);
  backdrop-filter: blur(18px);
}

.app-statusbar-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.global-call-dock {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(12, 14, 18, 0.94);
  backdrop-filter: blur(18px);
}

.badge-muted {
  color: var(--muted-strong);
}

.compact-section {
  gap: 10px;
}

.button-wide {
  width: 100%;
}

.security-shell .workspace-main {
  gap: 0;
}

.security-row {
  align-items: center;
}

@media (max-width: 1280px) {
  .room-main-app {
    grid-template-columns: 1fr;
  }

  .members-panel {
    order: 2;
  }

  .room-chat-panel {
    order: 1;
  }
}

@media (max-width: 1100px) {
  .workspace-shell-app,
  .room-shell-app,
  .workspace-shell,
  .room-shell,
  .workspace-grid,
  .home-grid,
  .security-grid,
  .security-list-grid {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .is-authenticated .stage {
    width: min(100% - 14px, 100%);
  }

  .home-panel,
  .security-hero-panel,
  .room-chat-panel,
  .members-panel,
  .app-sidebar {
    padding: 16px;
  }

  .chat-header,
  .panel-head-spread,
  .sidebar-brand-row,
  .subpanel-head-spread {
    align-items: flex-start;
    flex-direction: column;
  }

  .chat-form-modern {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .chat-send-button {
    grid-column: 1 / -1;
    width: 100%;
    height: 44px;
  }

  .audio-controls-modern,
  .room-technical-strip {
    grid-template-columns: 1fr;
  }

  .app-statusbar {
    position: static;
    margin-top: 16px;
    flex-direction: column;
    align-items: flex-start;
  }
}
.chat-message-own {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(255,138,32,0.95), rgba(255,176,98,0.9));
  color: #171717;
  border-color: rgba(255,176,98,0.45);
}

.chat-message-author {
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--muted-strong);
}

.chat-message-own .chat-message-author {
  color: rgba(23,23,23,0.78);
}

.chat-message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.icon-action-neutral {
  border-color: rgba(255, 255, 255, 0.12);
  color: #d8dee8;
}

.icon-glyph {
  width: 18px;
  height: 18px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.icon-glyph-phone {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23151815' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.86 19.86 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.86 19.86 0 0 1 2.08 4.18 2 2 0 0 1 4.06 2h3a2 2 0 0 1 2 1.72c.12.9.33 1.78.62 2.62a2 2 0 0 1-.45 2.11L8 9.91a16 16 0 0 0 6.09 6.09l1.46-1.23a2 2 0 0 1 2.11-.45c.84.29 1.72.5 2.62.62A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

.icon-glyph-check {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.icon-glyph-speaker {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5Z'/%3E%3Cpath d='M15.5 8.5a5 5 0 0 1 0 7'/%3E%3Cpath d='M18 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E");
}

.icon-glyph-speaker-off {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5Z'/%3E%3Cpath d='m22 9-6 6'/%3E%3Cpath d='m16 9 6 6'/%3E%3C/svg%3E");
}

.icon-glyph-exit {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
}

.icon-glyph-voice {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e5e7eb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3Z'/%3E%3Cpath d='M19 10v2a7 7 0 0 1-14 0v-2'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M8 22h8'/%3E%3C/svg%3E");
}


.page-auth-login .stage-page {
  padding-top: 0.75rem;
}

.global-call-dock-visible .room-chat-panel {
  padding-bottom: 8.5rem;
}

.global-call-dock-visible .audio-controls-modern {
  padding-bottom: 1rem;
}

@media (max-width: 760px) {
  .global-call-dock-visible .room-chat-panel {
    padding-bottom: 6.25rem;
  }
}


.chat-message-body a.chat-message-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.chat-message-body a.chat-message-link:hover {
  opacity: 0.88;
}


.brand-copy-banner {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: min(100%, 280px);
  overflow: hidden;
}

.brand-banner-image {
  display: block;
  max-height: 34px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

.brand-banner-image-large {
  max-height: 40px;
  max-width: min(100%, 280px);
}
