* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --app-height: 100vh;
  --bg: #d8d8db;
  --surface: #f3f3f3;
  --text: #121218;
  --text-dim: #6f7078;
  --chip: #000;
  --red: #ef2019;
  --red-dark: #cc120d;
  --line: #d2d4d9;
  --sheet: #d7cfdf;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", monospace;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

html,
body {
  height: 100%;
}

body {
  min-height: var(--app-height);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #ececec 0%, var(--bg) 65%);
  color: var(--text);
}

.hidden {
  display: none !important;
}

.room-main {
  min-height: var(--app-height);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 10px calc(14px + env(safe-area-inset-bottom));
}

.center-panel {
  width: min(428px, 100%);
  min-height: calc(var(--app-height) - 28px);
  background: var(--surface);
  border: 1px solid #cfd2d8;
  box-shadow: 0 10px 28px rgba(10, 12, 20, 0.16);
  padding: 14px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.call-header {
  padding: 4px 2px 0;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
}

.header-icon-btn {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  justify-self: center;
}

.header-icon-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.dot-grid {
  font-size: 12px;
  letter-spacing: 1px;
  transform: translateY(-1px);
}

.call-timer {
  justify-self: center;
  font-size: 12px;
  color: #3f4048;
  font-family: var(--mono);
}

#callDuration.hidden {
  display: inline !important;
  opacity: 0.35;
}

.call-number {
  text-align: center;
  font-size: clamp(34px, 10vw, 52px);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.featured-tile {
  min-height: 210px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
}

.tile-avatar {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 2px solid #111;
  background: #f8f8f8;
  color: #1a1b20;
  font-size: 38px;
  font-weight: 700;
  text-transform: lowercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-name {
  font-size: 30px;
  color: #1a1b20;
  text-align: center;
}

.tile-name.is-me {
  color: #1a1b20;
}

.featured-tile .tile-name {
  font-size: 27px;
}

.featured-tile.speaking .tile-avatar {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.46);
}

.featured-tile .tile-icons {
  position: absolute;
  right: 14px;
  top: 10px;
  color: var(--red);
}

.expand-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.22);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.participants-empty {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 8px 18px;
}

.participants-empty h2 {
  font-size: 40px;
  font-weight: 700;
}

.participants-empty p {
  max-width: 290px;
  color: var(--text-dim);
  font-size: 19px;
  line-height: 1.35;
}

.carousel {
  min-height: 118px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 2px 4px;
}

.carousel.hidden {
  display: none;
}

.participant-tile {
  flex: 0 0 72px;
  width: 72px;
  height: 98px;
  border-radius: 12px;
  border: 1px solid #cfd3d9;
  background: #efeff0;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  position: relative;
}

.participant-tile .tile-avatar {
  width: 44px;
  height: 44px;
  border-width: 1.5px;
  font-size: 18px;
}

.participant-tile .tile-name {
  width: 100%;
  font-size: 9px;
  line-height: 1.1;
  text-align: center;
  color: #1b1c21;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.participant-tile .tile-icons {
  position: absolute;
  top: 37px;
  left: 50%;
  transform: translateX(-50%);
}

.participant-tile.speaking {
  background: #101114;
  border-color: #101114;
}

.participant-tile.speaking .tile-name {
  color: #fff;
}

.participant-tile.speaking .tile-avatar {
  background: #fff;
}

.participant-tile.muted-peer:not(.speaking) {
  background: #111217;
  border-color: #111217;
}

.participant-tile.muted-peer:not(.speaking) .tile-name {
  color: #fff;
}

.participant-tile.muted-peer:not(.speaking) .tile-avatar {
  background: #fff;
}

.icon-mic-off {
  color: var(--red);
}

.participant-tile.has-video,
.featured-tile.has-video {
  overflow: hidden;
}

.tile-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.tile-video.no-mirror {
  transform: none;
}

.participant-tile.has-video .tile-avatar,
.featured-tile.has-video .tile-avatar {
  display: none;
}

.participant-tile.has-video .tile-name,
.featured-tile.has-video .tile-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.58);
  color: #fff;
  padding: 4px 5px;
  border-radius: 0 0 12px 12px;
}

.participant-tile.has-video .tile-icons,
.featured-tile.has-video .tile-icons {
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  transform: none;
  background: rgba(0, 0, 0, 0.56);
  border-radius: 999px;
  padding: 2px 5px;
  color: #fff;
}

.bottom-controls {
  margin-top: auto;
  margin-bottom: env(safe-area-inset-bottom);
  width: min(398px, 100%);
  min-height: 71px;
  padding: 12px 12px 12px 22px;
  border-radius: 36px;
  background: #f00;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}

.btn-hangup {
  width: 35px;
  height: 35px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-hangup:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-main-toggle {
  width: 100%;
  min-height: 59px;
  border: none;
  padding: 12px 80px;
  background: #fff;
  color: #000;
  font-family: "Jost", "Segoe UI", Arial, sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: 114%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 36px;
  box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.btn-main-toggle .btn-main-label {
  font-size: 20px;
}

.btn-main-toggle .btn-main-icon {
  width: 17px;
  height: 17px;
  font-size: 17px;
  transform: none;
}

.btn-main-toggle.active {
  color: #000;
}

.btn-main-toggle.muted {
  color: var(--red);
}

.btn-main-toggle:disabled {
  opacity: 0.45;
  cursor: default;
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 620;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 calc(12px + env(safe-area-inset-bottom));
}

.sheet-panel {
  width: min(428px, calc(100% - 12px));
  background:
    radial-gradient(circle at 16% 88%, rgba(232, 188, 224, 0.32), transparent 43%),
    var(--sheet);
  border-radius: 22px;
  padding: 14px 10px 10px;
  box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.26);
}

.sheet-panel h3 {
  text-align: center;
  font-size: 34px;
  font-weight: 700;
}

.sheet-panel p {
  text-align: center;
  color: #494d57;
  font-size: 17px;
  margin-top: 4px;
  margin-bottom: 10px;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.sheet-item {
  min-height: 42px;
  border-radius: 999px;
  border: 2px solid #111;
  background: #f5f5f6;
  color: #111;
  font-size: 18px;
  font-weight: 500;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  padding: 0 14px 0 10px;
  cursor: pointer;
}

.sheet-item-icon {
  font-size: 18px;
  text-align: center;
}

.sheet-item.active {
  background: #fff;
  font-weight: 700;
}

.sheet-cancel {
  margin-top: 10px;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  border: 2px solid #111;
  background: #f2f2f2;
  color: var(--red);
  font-size: 18px;
  cursor: pointer;
}

.settings-overlay,
.dialer-overlay,
.incoming-overlay,
.connecting-splash,
.pre-splash {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: rgba(0, 0, 0, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}

.settings-modal,
.dialer-modal,
.incoming-modal,
.connecting-modal,
.pre-splash-modal {
  width: min(428px, 100%);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.34);
}

.settings-modal,
.dialer-modal,
.incoming-modal,
.connecting-modal {
  padding: 14px;
}

.pre-splash-modal {
  padding: 18px 14px;
  text-align: center;
}

.pre-splash-brand {
  text-decoration: none;
  color: #111;
  font-weight: 700;
}

.pre-splash-room {
  margin-top: 8px;
  font-size: 38px;
}

.pre-splash-hint {
  color: var(--text-dim);
  margin-top: 8px;
}

.pre-splash-btn {
  margin-top: 12px;
  min-height: 42px;
  width: 100%;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.connecting-title {
  font-size: 30px;
  margin-bottom: 8px;
}

.connecting-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.connecting-step {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 8px;
  align-items: center;
  color: #5e6270;
  font-size: 15px;
}

.step-icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid #c9cdda;
}

.connecting-step.done {
  color: #1f9f45;
}

.connecting-step.done .step-icon {
  border-color: #1f9f45;
  background: #1f9f45;
}

.connecting-step.error {
  color: var(--red);
}

.connecting-step.error .step-icon {
  border-color: var(--red);
  background: var(--red);
}

.connecting-error {
  margin-top: 10px;
  border: 1px solid rgba(239, 32, 25, 0.3);
  background: rgba(239, 32, 25, 0.08);
  color: var(--red);
  border-radius: 10px;
  font-size: 14px;
  padding: 8px;
}

.connecting-cancel {
  margin-top: 10px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #444a56;
  padding: 0 14px;
  cursor: pointer;
}

.dialer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dialer-caption {
  color: #666d7a;
  font-size: 12px;
}

.dialer-header h3 {
  font-size: 22px;
}

.dialer-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.sip-status {
  min-height: 20px;
  font-size: 14px;
  color: #5f6572;
}

.sip-status.error {
  color: var(--red);
}

.sip-status.registered {
  color: #1f9f45;
}

.dialer-display {
  margin-top: 6px;
  margin-bottom: 10px;
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f6f6f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.dialer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dialer-key {
  min-height: 54px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dialer-key span {
  font-size: 10px;
  color: #6a6f7d;
}

.dialer-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1.4fr 1.4fr;
  gap: 8px;
}

.dialer-action {
  min-height: 40px;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.dialer-action-neutral {
  background: #eceff2;
}

.dialer-action-call {
  color: #fff;
  background: linear-gradient(180deg, #21b047, #178136);
}

.dialer-action-hangup {
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
}

.incoming-modal {
  text-align: center;
}

.incoming-icon {
  font-size: 34px;
}

.incoming-caller {
  margin-top: 8px;
  font-size: 18px;
}

.incoming-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.call-btn {
  min-height: 40px;
  border: none;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.call-green {
  background: linear-gradient(180deg, #21b047, #178136);
}

.call-red {
  background: linear-gradient(180deg, var(--red), var(--red-dark));
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.settings-title {
  font-weight: 700;
}

.settings-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-label {
  font-size: 13px;
  color: #555c69;
}

.settings-select,
.settings-input {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 10px;
}

.settings-divider {
  height: 1px;
  background: #ebedf0;
  margin: 5px 0;
}

.settings-btn {
  min-height: 38px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.settings-hint {
  font-size: 12px;
  color: #666d79;
}

.settings-hint.error {
  color: var(--red);
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: #000;
}

.fs-name {
  position: absolute;
  left: 14px;
  bottom: 14px;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  padding: 5px 8px;
}

.fs-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fs-icons {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  gap: 5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 5px 8px;
}

.fs-controls {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 6px;
  display: flex;
  gap: 8px;
}

.fs-ctrl-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.fs-ctrl-btn.active {
  color: #72ea95;
}

.fs-ctrl-btn.muted {
  color: #ff8a84;
}

.fullscreen-overlay.idle .fs-name,
.fullscreen-overlay.idle .fs-btn,
.fullscreen-overlay.idle .fs-icons,
.fullscreen-overlay.idle .fs-controls {
  opacity: 0;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(18px);
  background: #111;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  z-index: 800;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.log-panel {
  width: min(428px, 100%);
  margin-top: 8px;
  border: 1px solid #c6c9ce;
  background: #eceef1;
  border-radius: 10px;
}

.log-panel summary {
  font-size: 12px;
  color: #4f5562;
  padding: 6px 8px;
  cursor: pointer;
}

#log {
  border-top: 1px solid #d2d5da;
  max-height: 130px;
  overflow-y: auto;
  padding: 8px;
  font-size: 11px;
  color: #2b2f3a;
  font-family: var(--mono);
}

.bottombar {
  text-align: center;
  color: #6e727e;
  font-size: 12px;
  padding: 6px 0 8px;
}

.legacy-side,
.participants-grid,
.topbar {
  display: none !important;
}

/* ---------- lobby ---------- */

.lobby-main {
  min-height: var(--app-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 10px;
}

.lobby-card {
  width: min(428px, 100%);
  border: 1px solid #cfd2d8;
  border-radius: 16px;
  background: #f4f5f7;
  box-shadow: 0 10px 28px rgba(10, 12, 20, 0.16);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-title {
  font-size: 30px;
  font-weight: 700;
}

.lobby-hint {
  color: #5f6573;
  font-size: 14px;
}

.lobby-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.lobby-input {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 14px;
}

.lobby-btn,
.lobby-btn-secondary {
  min-height: 38px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}

.lobby-btn {
  padding: 0 16px;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
}

.lobby-btn-secondary {
  border: 1px solid #c9cdd4;
  background: #fff;
  color: #2d3442;
}

.lobby-max-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lobby-max-label {
  color: #5f6472;
  font-size: 13px;
}

.lobby-max-input-group {
  display: flex;
  gap: 6px;
}

.lobby-max-select,
.lobby-max-custom {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 8px;
}

body.room-page:not(.connected) .room-main,
body.room-page:not(.connected) .bottombar {
  display: none;
}

@media (max-width: 560px) {
  .room-main {
    padding: 8px 4px;
  }

  .center-panel {
    min-height: calc(var(--app-height) - 16px);
  }

  .call-number {
    font-size: clamp(24px, 11vw, 52px);
  }

  .featured-tile {
    min-height: 175px;
  }

  .featured-tile .tile-avatar {
    width: 94px;
    height: 94px;
    font-size: 30px;
  }

  .featured-tile .tile-name {
    font-size: 20px;
  }

  .participants-empty h2 {
    font-size: 32px;
  }

  .participants-empty p {
    font-size: 15px;
  }

  .sheet-overlay {
    padding-bottom: 4px;
  }
}

/* ---------- chat + smart modes (new style) ---------- */

.legacy-side {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  border-radius: 16px;
  border: 1px solid #cfd2d8;
  background: linear-gradient(180deg, #fbfbfc 0%, #f1f2f4 100%);
  padding: 10px;
  margin-top: 4px;
  min-height: 280px;
}

.smart-header {
  display: grid;
  gap: 8px;
}

.chat-panel-status {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #ecedf0;
  color: #30343d;
}

.legacy-side[data-chat-variant="group"] .chat-panel-status {
  background: rgba(239, 32, 25, 0.14);
  color: #7d160f;
}

.legacy-side[data-chat-variant="group"] {
  border-color: #efc3bf;
  background: linear-gradient(180deg, #fff8f8 0%, #f8f0ef 100%);
}

.legacy-side[data-chat-variant="p2p"] .chat-panel-status {
  background: rgba(51, 91, 236, 0.13);
  color: #2442a4;
}

.legacy-side[data-chat-variant="p2p"] {
  border-color: #cfd6ef;
  background: linear-gradient(180deg, #fbfcff 0%, #f2f4fa 100%);
}

.smart-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.smart-mode-btn {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid #d5d7de;
  background: #fff;
  color: #3d4351;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.smart-mode-btn.active {
  border-color: transparent;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff;
}

.smart-insights {
  border-radius: 12px;
  border: 1px solid #d6d8e0;
  background: #ffffff;
  min-height: 72px;
  max-height: 136px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.smart-empty {
  color: #646b79;
  font-size: 12px;
}

.smart-item {
  border: 1px solid #eceef3;
  border-radius: 10px;
  padding: 6px 8px;
  background: #f8f9fb;
}

.smart-item-title {
  font-size: 12px;
  font-weight: 700;
  color: #1d2230;
}

.smart-item-meta {
  margin-top: 2px;
  color: #626978;
  font-size: 11px;
}

.smart-item-actions {
  margin-top: 5px;
  display: flex;
  gap: 5px;
}

.smart-action-btn {
  min-height: 24px;
  border: 1px solid #d0d4de;
  border-radius: 999px;
  background: #fff;
  color: #3b4251;
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
}

.side-tab {
  min-height: 30px;
  border: 1px solid #d5d8e0;
  border-radius: 999px;
  background: #fff;
  color: #3f4655;
  font-size: 12px;
  cursor: pointer;
}

.side-tab.active {
  border-color: transparent;
  background: #1d2027;
  color: #fff;
}

.side-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.chat-messages {
  border: 1px solid #d8dbe3;
  border-radius: 12px;
  background: #fff;
  min-height: 130px;
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.chat-msg {
  border: 1px solid #eceef3;
  background: #f8f9fb;
  border-radius: 10px;
  padding: 6px 8px;
  display: grid;
  gap: 3px;
}

.msg-ts {
  color: #6e7380;
  font-size: 10px;
  font-family: var(--mono);
}

.msg-name {
  font-size: 11px;
  font-weight: 700;
  color: #3b4251;
}

.msg-name.is-me {
  color: #a21f15;
}

.msg-text {
  font-size: 12px;
  color: #151922;
}

.msg-file img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #dde0e9;
}

.msg-file a {
  color: #2a4db8;
  text-decoration: none;
  font-size: 12px;
}

.chat-input-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 6px;
}

.attach-btn {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid #d5d9e1;
  background: #fff;
  color: #2f3644;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.chat-input {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid #d5d9e1;
  background: #fff;
  padding: 0 10px;
  font-size: 13px;
}

.chat-send-btn {
  min-width: 88px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--red), var(--red-dark));
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.members-count {
  font-size: 12px;
  color: #444d5d;
  font-weight: 600;
}

.max-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.max-ctrl-label {
  color: #646b79;
  font-size: 11px;
}

.max-ctrl-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.max-ctrl-select,
.max-ctrl-custom {
  min-height: 28px;
  border: 1px solid #d5d9e1;
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  padding: 0 7px;
}

.members-list {
  border: 1px solid #d8dbe3;
  border-radius: 12px;
  background: #fff;
  min-height: 120px;
  max-height: 178px;
  overflow: auto;
  padding: 6px;
  display: grid;
  gap: 6px;
}

.member-row {
  border: 1px solid #ecedf2;
  border-radius: 10px;
  background: #f8f9fb;
  min-height: 38px;
  padding: 5px 7px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

.member-name {
  font-size: 12px;
  color: #262b36;
}

.member-name.is-me {
  font-weight: 700;
}

.member-icons {
  display: inline-flex;
  gap: 4px;
}

.member-icon {
  color: #2f3646;
  display: inline-flex;
  align-items: center;
}

.member-icon.off {
  color: var(--red);
}

.app-quick-row {
  display: none;
}

.app-quick-btn {
  min-height: 36px;
  border-radius: 999px;
  border: 1.5px solid #1d1d22;
  background: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  cursor: pointer;
}

.btn-main-toggle[data-mode="invite"] {
  color: #272a31;
  font-size: 18px;
  font-weight: 600;
}

.legacy-side.hidden {
  display: none !important;
}

@media (max-width: 560px) {
  .legacy-side {
    display: none !important;
  }
}
