: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.55rem;
  color: var(--text);
  min-width: 0;
}


.brand-banner-link {
  max-width: min(100%, 620px);
}

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

.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;
  justify-items: center;
  align-content: center;
  gap: 1.25rem;
  min-height: calc(100vh - 140px);
}

.auth-brand-shell {
  width: min(100%, 580px);
  display: flex;
  justify-content: center;
}

.auth-brand-banner-link {
  display: flex;
  width: 100%;
  justify-content: center;
}

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

.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,
.status-green-dot {
  position: relative;
  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::after,
.online-dot-large::after,
.status-green-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: rgba(76, 217, 100, 0.22);
  animation: dockPulse 1.8s ease-out infinite;
}

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

.presence-online {
  background: var(--green);
}

.presence-online::after {
  background: rgba(76, 217, 100, 0.22);
}

.presence-busy {
  background: #ffb84d;
  box-shadow: 0 0 0 4px rgba(255, 184, 77, 0.14);
}

.presence-busy::after {
  background: rgba(255, 184, 77, 0.24);
}

.presence-dnd {
  background: #ff6b6b;
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.14);
}

.presence-dnd::after {
  background: rgba(255, 107, 107, 0.22);
}

.presence-invisible {
  background: #8a8f99;
  box-shadow: 0 0 0 4px rgba(138, 143, 153, 0.14);
}

.presence-invisible::after {
  background: rgba(138, 143, 153, 0.18);
}

.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-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable both-edges;
}

.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;
}



.sidebar-link-form {
  margin: 0;
}

.sidebar-link-row-button {
  width: 100%;
  text-align: left;
  cursor: pointer;
  appearance: none;
  font: inherit;
}

.inline-action-form {
  margin: 0;
}

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

.brand-banner-image-large {
  width: 100%;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.sidebar-brand-row > .brand-banner-link {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
}

.sidebar-brand-row > .brand-banner-link .brand-banner-image,
.sidebar-brand-row > .brand-banner-link .brand-banner-image-large {
  width: 100%;
  max-width: none;
}

.room-trust-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 12, 16, 0.92);
}

.room-trust-panel-head span {
  display: block;
  margin-top: 0.25rem;
  color: #9ca3af;
  font-size: 0.9rem;
}

.room-trust-self,
.room-trust-list {
  display: grid;
  gap: 0.7rem;
}

.trust-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(17, 20, 26, 0.95);
}

.trust-card-copy {
  display: grid;
  gap: 0.2rem;
}

.trust-card-label {
  color: #9ca3af;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trust-card strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  word-break: break-word;
}

.trust-card-meta,
.trust-card-warning {
  color: #c6ccd6;
  font-size: 0.88rem;
}

.trust-card-state {
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.trust-card-state-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.trust-card-state-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.trust-card-changed {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.14) inset;
}

.trust-card-empty {
  color: #9ca3af;
  justify-content: center;
}

.trust-card-button {
  white-space: nowrap;
}


.device-list-grid {
  display: grid;
  gap: 14px;
}

.device-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,255,255,0.025);
}

.device-card-revoked {
  opacity: 0.82;
}

.device-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.device-card-meta {
  margin-top: 8px;
}

.device-card-facts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-fact {
  display: grid;
  gap: 6px;
}

.device-fact-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.device-fact code {
  overflow-wrap: anywhere;
}

.security-activity-list {
  display: grid;
  gap: 12px;
}

@media (max-width: 900px) {
  .device-card-facts {
    grid-template-columns: 1fr;
  }
}


/* Security page cleanup v27 */
.security-main-clean {
  display: grid;
  gap: 18px;
}

.security-grid-clean {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.security-card-clean {
  display: grid;
  gap: 16px;
  padding: 20px;
  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);
}

.security-card-wide {
  grid-column: 1 / -1;
}

.security-form-clean,
.security-card-list,
.stack-sm {
  display: grid;
  gap: 12px;
}

.security-form-clean label {
  display: grid;
  gap: 6px;
}

.security-form-clean input {
  width: 100%;
}

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

.status-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.04);
}

.status-ok {
  background: rgba(70, 160, 110, 0.18);
}

.security-collapse {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
}

.security-collapse summary {
  cursor: pointer;
  font-weight: 700;
}

.device-card-clean,
.activity-card-clean {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
}

.device-card-clean.compact {
  padding: 14px;
}

.device-card-clean.revoked {
  opacity: 0.78;
}

.device-card-head-clean,
.activity-card-clean {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-card-head-clean h3,
.activity-card-clean h3 {
  margin: 0;
}

.device-grid-clean {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.device-grid-clean dt {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.device-grid-clean dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

.activity-side-clean {
  display: grid;
  justify-items: end;
  gap: 8px;
}

@media (max-width: 1100px) {
  .security-grid-clean {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .device-card-head-clean,
  .activity-card-clean {
    flex-direction: column;
    align-items: stretch;
  }

  .device-grid-clean {
    grid-template-columns: 1fr;
  }

  .activity-side-clean {
    justify-items: start;
  }
}


/* Fix 28 room trust and security polish */
.crypto-badge-icon {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  border: 2px solid rgba(255,255,255,0.88);
  border-radius: 999px;
  position: relative;
  flex: 0 0 auto;
}
.crypto-badge-icon::after {
  content: "";
  position: absolute;
  inset: 0.18rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
}

.room-trust-collapse {
  margin-top: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.room-trust-collapse-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1rem;
}
.room-trust-collapse-summary::-webkit-details-marker {
  display: none;
}
.room-trust-collapse-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.room-trust-collapse-copy {
  font-weight: 600;
  color: var(--text);
}
.room-trust-collapse .room-trust-panel {
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-radius: 0;
  background: transparent;
}

.page-main-security-settings .workspace-main,
.page-main-security-settings .workspace-main .card,
.page-main-security-settings .page-shell,
.page-main-security-settings .security-page {
  background: transparent;
}


/* Fix 29 security + room trust UI */
.crypto-shield-icon {
  width: 0.95rem;
  height: 1.05rem;
  display: inline-block;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.88);
  clip-path: polygon(50% 0%, 92% 16%, 92% 54%, 50% 100%, 8% 54%, 8% 16%);
}

.room-trust-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.room-trust-status-pill {
  flex: 0 0 auto;
}

.room-trust-collapse-summary {
  display: grid;
  gap: 0.35rem;
}

.room-trust-collapse-copy {
  font-weight: 600;
  color: var(--text);
}

.trust-card {
  display: grid;
  gap: 0.35rem;
}

.trust-card strong {
  word-break: break-word;
}

.trust-card-meta {
  color: var(--muted);
  word-break: break-word;
}


/* Fix 30 room trust polish */
.crypto-shield-icon {
  width: 0.95rem;
  height: 1.05rem;
  display: inline-block;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.92);
  clip-path: polygon(50% 0%, 92% 16%, 92% 54%, 50% 100%, 8% 54%, 8% 16%);
}

.room-trust-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
}

.trust-pill-ok {
  background: rgba(54, 156, 86, 0.22);
  color: #dff6e6;
}

.trust-pill-warning {
  background: rgba(190, 140, 30, 0.22);
  color: #fff1c7;
}

.trust-pill-muted {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
}

.room-trust-collapse-summary {
  display: grid;
  gap: 0.35rem;
}

.room-trust-panel {
  margin-top: 0;
}

.trust-card {
  display: grid;
  gap: 0.35rem;
}

.trust-card strong {
  word-break: break-word;
}

.trust-card-meta {
  color: var(--muted);
  word-break: break-word;
}


/* Fix 32 trust panel + auth banners */
.auth-brand-shell-bottom {
  margin-top: 14px;
}

.auth-brand-banner-image-secondary {
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 0 auto;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.08);
}

.trust-pill-ok {
  background: rgba(54, 156, 86, 0.22);
  color: #dff6e6;
}

.trust-pill-warning {
  background: rgba(190, 140, 30, 0.22);
  color: #fff1c7;
}

.trust-pill-muted {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.82);
}


.app-statusbar-item-version {
  flex: 1 1 auto;
  justify-content: center;
}

.status-version-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.1);
  color: #ff9a3d;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.status-version-link:hover,
.status-version-link:focus-visible {
  background: rgba(255, 106, 0, 0.18);
  color: #ffb36b;
  transform: translateY(-1px);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.14);
  outline: none;
}

.patchnotes-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.patchnotes-modal:target {
  opacity: 1;
  pointer-events: auto;
}

.patchnotes-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.patchnotes-panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  width: min(920px, calc(100vw - 2rem));
  max-height: min(82vh, 900px);
  overflow: auto;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(17, 19, 24, 0.98) 0%, rgba(10, 12, 16, 0.99) 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  padding: 1.6rem 1.6rem 1.4rem;
  color: #e9edf2;
  transition: transform 180ms ease;
}

.patchnotes-modal:target .patchnotes-panel {
  transform: translate(-50%, -50%) scale(1);
}

.patchnotes-panel::-webkit-scrollbar {
  width: 12px;
}

.patchnotes-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.patchnotes-panel::-webkit-scrollbar-track {
  background: transparent;
}

.patchnotes-header {
  padding-right: 3rem;
  margin-bottom: 1rem;
}

.patchnotes-kicker {
  margin: 0 0 0.4rem;
  color: #ff9a3d;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.patchnotes-header h2 {
  margin: 0;
  font-size: 2rem;
}

.patchnotes-list {
  display: grid;
  gap: 1rem;
}

.patchnotes-entry {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.1rem;
}

.patchnotes-entry h3 {
  margin: 0 0 0.3rem;
  color: #fff;
  font-size: 1.05rem;
}

.patchnotes-entry-date {
  margin: 0 0 0.65rem;
  color: #9eaaba;
  font-size: 0.86rem;
}

.patchnotes-entry ul {
  margin: 0;
  padding-left: 1.15rem;
  color: #cfd7e2;
}

.patchnotes-entry li + li {
  margin-top: 0.45rem;
}

.patchnotes-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
}

.patchnotes-close:hover,
.patchnotes-close:focus-visible {
  background: rgba(255, 106, 0, 0.18);
  outline: none;
}

@media (max-width: 720px) {
  .status-version-link {
    padding: 0.28rem 0.6rem;
    font-size: 0.84rem;
  }

  .patchnotes-panel {
    width: min(100vw - 1rem, 920px);
    max-height: 86vh;
    border-radius: 26px;
    padding: 1.25rem 1rem 1rem;
  }

  .patchnotes-header h2 {
    font-size: 1.5rem;
  }
}


.global-call-dock-live-dot {
  position: relative;
}

.global-call-dock-live-dot-pulse::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: rgba(76, 217, 100, 0.28);
  animation: dockPulse 1.8s ease-out infinite;
}

@keyframes dockPulse {
  0% {
    transform: scale(0.72);
    opacity: 0.95;
  }
  70% {
    transform: scale(1.32);
    opacity: 0;
  }
  100% {
    transform: scale(1.32);
    opacity: 0;
  }
}

.room-members-sidebar-section {
  gap: 12px;
}

.participant-list-sidebar-members {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.participant-member-row-sidebar {
  grid-template-columns: auto 1fr auto;
}

.participant-list-presence {
  display: grid;
  gap: 10px;
}

.participant-presence-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border-radius: 16px;
  border: 1px solid rgba(76, 217, 100, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.participant-indicator-live {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #4cd964;
  box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.4);
  animation: participantPulse 1.8s ease-out infinite;
}

@keyframes participantPulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0.42); }
  70% { box-shadow: 0 0 0 10px rgba(76, 217, 100, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 217, 100, 0); }
}

.members-panel-group {
  align-content: start;
}

.members-panel-group .activity-panel-inline {
  margin-top: 18px;
}


.profile-chip-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.profile-chip-link:hover {
  border-color: rgba(255, 138, 32, 0.35);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-1px);
}

.avatar-circle-image {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.08);
}

.mini-avatar-image {
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
}

.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 1.25rem;
}

.profile-avatar-card,
.profile-fields-card,
.profile-preview-card {
  display: grid;
  gap: 0.9rem;
}

.profile-avatar-card {
  align-content: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

.profile-avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.08);
}

.profile-avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  font-weight: 800;
  color: #171717;
  background: linear-gradient(135deg, #ff8a20, #ffb062);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.textarea-like {
  min-height: 110px;
  resize: vertical;
}

.profile-preview-card {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
}

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


.admin-card-surface {
  width: min(100%, 980px);
}

.admin-top-actions {
  margin-bottom: 1rem;
}

.admin-user-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.admin-user-card {
  padding: 1rem;
  border-radius: 20px;
}

.admin-user-meta {
  margin-top: 0.35rem;
}

.nav-button-danger {
  color: #ffb1a4;
  border-color: rgba(255, 90, 90, 0.28);
  background: rgba(255, 90, 90, 0.08);
}

.nav-button-danger:hover {
  border-color: rgba(255, 110, 110, 0.4);
  background: rgba(255, 110, 110, 0.12);
}

.global-call-dock {
  left: 50%;
  right: auto;
  bottom: 1.1rem;
  transform: translateX(-50%);
  width: min(calc(100vw - 1.25rem), 760px);
  padding: 0.75rem 0.9rem;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  background: rgba(10, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

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

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

.global-call-dock-state-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  background: rgba(54, 209, 122, 0.1);
  color: #c9ffdb;
  font-size: 0.88rem;
  line-height: 1;
}

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

.global-call-dock-room-button {
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  color: #f6f7fb;
  background: transparent;
  border: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.global-call-dock-meta {
  gap: 0.45rem;
  font-size: 0.84rem;
  color: #9ca5bc;
}

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

.dock-action {
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.dock-action-icon {
  font-size: 0.8rem;
  line-height: 1;
}

@media (max-width: 780px) {
  .global-call-dock {
    width: min(calc(100vw - 0.8rem), 96vw);
    padding: 0.7rem;
    gap: 0.7rem;
    border-radius: 22px;
  }

  .global-call-dock-main {
    gap: 0.7rem;
  }

  .global-call-dock-state-badge {
    display: none;
  }

  .global-call-dock-actions {
    gap: 0.45rem;
  }

  .dock-action {
    padding: 0.62rem 0.8rem;
  }
}


.field-hint {
  margin: 0.45rem 0 0;
  color: rgba(220, 224, 235, 0.68);
  font-size: 0.88rem;
  line-height: 1.45;
}

.field-error {
  margin: 0.45rem 0 0;
  color: #ff9a9a;
  font-size: 0.9rem;
  line-height: 1.4;
}
