/* Dymtlost Chat Pro — tek parça, clean-room arayüz
   v2/v3 katmanları yerine yalnızca bu ana tema yüklenir. */

:root {
  --v2-navy: #242738;
  --v2-navy-2: #303448;
  --v2-blue: #4166b4;
  --v2-blue-soft: #e9eefb;
  --v2-red: #e63f48;
  --v2-cyan: #55a9bc;
  --v2-gold: #f2bd2f;
  --v2-paper: #fff;
  --v2-bg: #eef0f4;
  --v2-line: #d8dbe3;
  --v2-text: #262934;
  --v2-muted: #888d99;
  --v2-shadow: 0 14px 36px rgba(29, 35, 56, .12);
  --v2-radius: 14px;
  --v2-header: 64px;
  --v2-switch: 54px;
  --v2-tabs: 46px;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--v2-text);
  background: var(--v2-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

/* Connecting */
#connecting-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  background: rgba(20, 23, 35, .76);
  backdrop-filter: blur(8px);
}
#connecting-overlay .spinner {
  width: 52px;
  height: 52px;
  border: 4px solid rgba(255, 255, 255, .24);
  border-top-color: #fff;
  border-radius: 50%;
  animation: v2-spin .8s linear infinite;
}
@keyframes v2-spin { to { transform: rotate(360deg); } }

/* Login */
#login-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  background:
    radial-gradient(circle at 12% 14%, rgba(65, 102, 180, .32), transparent 30%),
    radial-gradient(circle at 88% 86%, rgba(85, 169, 188, .18), transparent 28%),
    linear-gradient(145deg, #181b29, #272c42 58%, #1e2233);
}
#login-screen .login-card {
  width: min(980px, 96vw);
  min-height: 590px;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(6, 9, 20, .42);
}
.login-showcase {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 42px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(36, 39, 56, .82), rgba(18, 20, 31, .98)),
    radial-gradient(circle at 10% 10%, rgba(76, 117, 210, .65), transparent 45%);
}
.login-showcase-brand { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.login-logo { width: 145px; max-height: 54px; object-fit: contain; filter: brightness(0) invert(1); }
.network-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  color: #dce8ff;
  background: rgba(255, 255, 255, .06);
  font-size: 11px;
  font-weight: 800;
}
.network-badge span { width: 7px; height: 7px; border-radius: 50%; background: #34d88c; }
.login-showcase-copy .eyebrow { margin: 0 0 12px; color: #83cbe0; font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.login-showcase-copy h1 { margin: 0; font-size: clamp(34px, 4vw, 51px); line-height: 1.08; letter-spacing: -.045em; }
.login-showcase-copy h1 span { color: #89a9ef; }
.login-showcase-copy > p:last-child { margin: 20px 0 0; color: #bac1d2; font-size: 14px; line-height: 1.7; }
.login-feature-list { display: grid; gap: 11px; }
.login-feature-list span { display: flex; align-items: center; gap: 10px; color: #d6dae5; font-size: 13px; }
.login-feature-list i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #8eacef; background: rgba(255,255,255,.07); }
.login-form-panel { display: flex; flex-direction: column; justify-content: center; padding: 42px 48px; }
.login-kicker { color: var(--v2-blue); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.login-form-heading h2 { margin: 8px 0; color: #222533; font-size: 31px; letter-spacing: -.03em; }
.login-form-heading p { margin: 0; color: #777d8c; font-size: 14px; }
.login-mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 27px 0 23px; }
.login-mode-btn {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dfe2e9;
  border-radius: 12px;
  color: #555b69;
  background: #f8f9fb;
  text-align: left;
}
.login-mode-btn > i { font-size: 20px; }
.login-mode-btn span { min-width: 0; display: grid; }
.login-mode-btn strong { color: #303442; font-size: 13px; }
.login-mode-btn small { color: #8a909d; font-size: 10px; }
.login-mode-btn.active { border-color: var(--v2-blue); color: var(--v2-blue); background: var(--v2-blue-soft); box-shadow: 0 0 0 3px rgba(65,102,180,.08); }
.login-fields { display: grid; gap: 17px; }
.pro-field { display: grid; gap: 7px; }
.pro-field.is-hidden { display: none; }
.pro-field label { color: #424754; font-size: 12px; font-weight: 800; }
.pro-input-wrap { position: relative; }
.pro-input-wrap > i { position: absolute; left: 14px; top: 50%; z-index: 1; transform: translateY(-50%); color: #878d9b; }
.pro-input-wrap input { width: 100%; height: 50px; padding: 0 46px 0 42px; border: 1px solid #d8dce5; border-radius: 11px; color: #242735; background: #fff; outline: 0; }
.pro-input-wrap input:focus { border-color: var(--v2-blue); box-shadow: 0 0 0 4px rgba(65,102,180,.1); }
.pro-field small { color: #8d929e; font-size: 10px; }
.password-toggle { position: absolute; top: 50%; right: 7px; width: 36px; height: 36px; border: 0; border-radius: 8px; color: #777d8a; background: transparent; transform: translateY(-50%); }
.login-feedback { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 9px; color: #b42a36; background: #fff0f1; font-size: 12px; }
.login-feedback.show { display: block; }
.login-options { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; color: #6e7482; font-size: 11px; }
.secure-note { color: #388960; }
.btn-login { width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 11px; color: #fff; background: var(--v2-navy); font-weight: 800; box-shadow: 0 12px 24px rgba(36,39,56,.2); }
.btn-login:hover { background: #303448; }
.login-legal { margin: 15px 0 0; color: #999eaa; font-size: 9px; text-align: center; }

/* Main application */
#main {
  width: 100%;
  height: 100dvh;
  min-height: 0;
  display: none;
  overflow: hidden;
  background: var(--v2-bg);
}
.topbar {
  width: 100%;
  height: var(--v2-header);
  flex: 0 0 var(--v2-header);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #fff;
  background: var(--v2-navy);
  box-shadow: 0 3px 14px rgba(24, 27, 43, .18);
}
.topbar-menu-btn, .theme-toggle-pro {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #d8dbe5;
  background: rgba(255,255,255,.06);
  font-size: 18px;
}
.topbar-menu-btn:hover, .theme-toggle-pro:hover { color: #fff; background: rgba(255,255,255,.12); }
.topbar-brand { min-width: 170px; display: flex; align-items: center; gap: 9px; }
.app-logo { width: 84px; height: 38px; object-fit: contain; filter: brightness(0) invert(1); }
.topbar-brand-copy { display: grid; }
.topbar-brand-copy strong { color: #fff; font-size: 12px; }
.topbar-brand-copy span { color: #aeb4c4; font-size: 9px; }
.topbar-brand-copy span i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #35d88e; }
#topic-header { display: none !important; }
.topbar-actions { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
#greeting-message { display: none; }
.radio-info-panel { min-width: 220px; max-width: 420px; height: 44px; display: flex; align-items: center; gap: 9px; padding: 6px 11px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: #191c2a; overflow: hidden; }
.radio-live-dot { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; color: #ff67db; background: rgba(214,0,185,.14); font-size: 8px; font-weight: 900; }
.radio-track { min-width: 0; display: grid; }
.radio-track strong, .radio-track span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radio-track strong { color: #fff; font-size: 10px; }
.radio-track span { color: #aeb3c2; font-size: 8px; }
.radio-toggle-btn { height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; color: #fff; background: #32364a; }
.radio-toggle-btn .radio-toggle-icon { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--v2-navy); background: #fff; font-size: 9px; }
.radio-toggle-btn .label { font-size: 10px; font-weight: 800; }
.v2-people-button {
  position: relative;
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  color: #fff;
  background: rgba(255,255,255,.07);
}
.v2-people-button:hover { background: rgba(255,255,255,.13); }
.v2-people-button i { font-size: 18px; }
.v2-people-button span { font-size: 10px; font-weight: 800; }
.v2-people-button b { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; border-radius: 999px; color: var(--v2-navy); background: #fff; font-size: 9px; }

/* Three primary buttons */
#main > .mobile-top-switcher {
  width: 100%;
  height: var(--v2-switch);
  flex: 0 0 var(--v2-switch);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid var(--v2-line);
  background: #f4f4f6;
}
.mobile-top-switcher .mts-btn { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 0; border-right: 1px solid var(--v2-line); color: #363a46; background: #f7f7f9; font-size: 14px; font-weight: 750; }
.mobile-top-switcher .mts-btn i { font-size: 20px; }
.mobile-top-switcher .mts-btn-current { color: #fff; background: var(--v2-navy); }
.mobile-top-switcher .mts-btn.is-open { color: #fff; background: var(--v2-navy-2); }

.app-grid {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 300px);
  grid-template-rows: var(--v2-tabs) minmax(0, 1fr);
  grid-template-areas: "tabs tabs" "chat users";
  gap: 0;
  overflow: hidden;
  background: #fff;
}
.app-grid.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "tabs" "chat";
}
.chat-card { grid-area: chat; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--v2-line); background: #fff; }
#channel-sidebar { grid-area: tabs; min-width: 0; min-height: 0; overflow: hidden; border-bottom: 1px solid var(--v2-line); background: #f3f3f5; }
#channel-sidebar #tabs { width: 100%; height: 100%; display: flex; align-items: stretch; gap: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
#tabs button { width: auto; min-width: max-content; height: 100%; display: inline-flex; align-items: center; gap: 4px; padding: 0 12px; border: 0; border-right: 1px solid var(--v2-line); color: #4a4e59; background: #fff; font-size: 13px; font-weight: 650; }
#tabs button:hover { background: #f2f4f8; }
#tabs button.active { color: #fff; background: var(--v2-navy); }
#tabs button.new-message:not(.active) { color: var(--v2-blue); background: var(--v2-blue-soft); }
#tabs .close-tab-button { color: currentColor !important; opacity: .6; }
#private-user-info { display: none; min-height: 52px; align-items: center; border-bottom: 1px solid var(--v2-line); background: #f9fafc; }
#private-user-info[style*="flex"] { display: flex !important; }
#private-user-info { padding: 8px 10px !important; }
#private-user-info .pm-head {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas: "avatar identity" "actions actions";
  align-items: center;
  gap: 5px 9px;
}
#private-user-info .pm-avatar { grid-area: avatar; }
#private-user-info .pm-avatar img,
#private-user-info .pm-avatar .ini { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--v2-blue), #6f8ed2); font-weight: 900; object-fit: cover; }
#private-user-info .pm-head > div:nth-child(2) { grid-area: identity; min-width: 0; }
#private-user-info .pm-actions { grid-area: actions; min-width: 0; display: flex; align-items: center; gap: 5px; overflow-x: auto; scrollbar-width: none; }
#private-user-info .pm-actions::-webkit-scrollbar { display: none; }
#private-user-info .pm-actions .btn { min-width: max-content; padding: 4px 8px; font-size: 10px; border-radius: 7px; }
#messages { min-height: 0; flex: 1 1 auto; padding: 11px 12px 20px; overflow-y: auto; color: var(--v2-text); background: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
#messages > div { margin-bottom: 4px; }
.msg-time { color: var(--v2-muted); font-size: .82em; }
.system-bubble { display: inline-block; padding: 7px 10px; border-radius: 10px; background: #f1f3f7; }
.irc-line { color: #a7193d; font-weight: 600; }
.irc-action { color: #76529d; font-style: italic; }
.irc-notice { display: inline; padding: 2px 5px; border-left: 3px solid #db00bd; color: #fff; background: #090909; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.svc { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 4px; font-weight: 800; }
.svc-nickserv { color: #1684b6; background: #e4f6ff; }
.svc-chanserv { color: #7654af; background: #efe9ff; }
.svc-operserv { color: #bf3144; background: #ffeaed; }
.svc-botserv { color: #287c68; background: #e6f7f2; }
.pm-bubbles .pm-row { display: flex; margin: 8px 0; }
.pm-bubbles .pm-row.me { justify-content: flex-end; }
.pm-bubbles .pm-bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; background: #f0f2f7; }
.pm-bubbles .pm-row.me .pm-bubble { color: #fff; background: var(--v2-blue); }

/* People */
#userlist-sidebar { grid-area: users; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #fafafa; }
.userlist-head { flex: 0 0 auto; border-bottom: 1px solid var(--v2-line); background: #fff; }
.v2-people-title { height: 39px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: #4b4f5b; }
.v2-people-title i { font-size: 19px; }
.v2-people-title strong { font-size: 12px; }
.v2-people-title span { margin-left: auto; padding: 2px 7px; border-radius: 999px; color: #fff; background: #9ca1ae; font-size: 10px; font-weight: 900; }
.v2-drawer-close { display: none; width: 28px; height: 28px; margin-left: 2px; border: 0; border-radius: 7px; color: #5d6270; background: #eff1f5; }
#user-search { width: 100%; height: 43px; padding: 0 10px 0 38px; border: 0; border-top: 1px solid #eceef2; color: #444854; background: #fff; outline: 0; }
.v2-search-wrap { position: relative; }
.v2-search-wrap::before { content: "\f002"; position: absolute; z-index: 1; left: 13px; top: 50%; color: #777d89; font-family: "Font Awesome 6 Free"; font-weight: 900; transform: translateY(-50%); pointer-events: none; }
#userlist { min-height: 0; flex: 1 1 auto; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
#userlist .ul-item { min-height: 46px; display: flex; align-items: center; gap: 9px; margin: 0; padding: 6px 10px; border-bottom: 1px solid #e5e7eb; background: #fff; }
#userlist .ul-item:hover { background: #f2f4f8; }
.ul-badge { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--v2-gold); }
.ul-badge.founder { background: #b51732; }
.ul-badge.admin { background: var(--v2-red); }
.ul-badge.op, .ul-badge.halfop { background: var(--v2-cyan); }
.ul-badge.voice { background: var(--v2-gold); }
.ul-name { min-width: 0; overflow: hidden; color: #a9871d; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ul-badge.founder + .ul-name, .ul-badge.admin + .ul-name { color: #b7213c; }
.ul-badge.op + .ul-name, .ul-badge.halfop + .ul-name { color: #4d9daf; }

/* Composer */
.chat-toolbar { min-height: 42px; flex: 0 0 42px; display: flex; align-items: center; gap: 4px; padding: 4px 8px; overflow-x: auto; border-top: 1px solid var(--v2-line); background: #f1f2f4; }
.icon-btn { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; color: #565b67; background: transparent; }
.icon-btn:hover { background: #e1e4e9; }
.chat-toolbar .sep, .chat-toolbar .alt-link { display: none; }
#toggle-userlist-mobile { display: none; }
#toggle-userlist-mobile.hidden { display: none !important; }
.inputbar { min-height: 61px; flex: 0 0 61px; display: flex; align-items: center; gap: 7px; padding: 7px 8px; border-top: 1px solid var(--v2-line); background: #f8f8f9; }
#input { min-width: 0; height: 46px; flex: 1 1 auto; padding: 0 13px; border: 2px solid var(--v2-navy); border-radius: 6px; color: #2c2f3a; background: #fff; outline: 0; }
#input:focus { border-color: var(--v2-blue); box-shadow: 0 0 0 3px rgba(65,102,180,.1); }
#send-button { min-width: 112px; height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 6px; color: #fff; background: var(--v2-navy); font-weight: 900; }
#send-button::after { content: "GÖNDER"; font-size: 12px; }
#send-button:hover { background: var(--v2-navy-2); }

/* Mobile tab popover */
#mobile-list-panel { position: fixed; z-index: 1200; top: calc(var(--v2-header) + var(--v2-switch) + 4px); left: 8px; right: 8px; display: none; max-height: 48dvh; padding: 8px; overflow-y: auto; border: 1px solid var(--v2-line); border-radius: 12px; background: #fff; box-shadow: var(--v2-shadow); }
#mobile-list-panel.open { display: block; }
.v2-mobile-list { display: grid; gap: 5px; }
.v2-mobile-item { width: 100%; min-height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 0; border-radius: 8px; color: #444955; background: #f4f5f8; text-align: left; }
.v2-mobile-item.active { color: #fff; background: var(--v2-navy); }
.v2-mobile-empty { padding: 18px; color: #888e9a; text-align: center; }
.v2-drawer-backdrop { position: fixed; inset: 0; z-index: 1090; display: none; background: rgba(20,23,35,.38); backdrop-filter: blur(2px); }

/* Utilities/overlays used by the existing engine */
#popup-notice { position: fixed; z-index: 1500; left: 50%; bottom: 80px; display: none; max-width: min(90vw, 420px); padding: 10px 14px; border-radius: 10px; color: #fff; background: var(--v2-navy); transform: translateX(-50%); box-shadow: var(--v2-shadow); }
#disconnect-overlay { position: fixed; inset: 0; z-index: 2000; display: none; place-items: center; padding: 20px; background: rgba(24,27,42,.75); backdrop-filter: blur(8px); }
#disconnect-overlay .disconnect-card { max-width: 420px; padding: 24px; border-radius: 16px; background: #fff; text-align: center; box-shadow: var(--v2-shadow); }
#user-context-menu { position: fixed; z-index: 1800; display: none; min-width: 190px; padding: 7px; border: 1px solid var(--v2-line); border-radius: 10px; background: #fff; box-shadow: var(--v2-shadow); }
#user-context-menu .uam-header { padding: 7px 9px; color: #777d89; font-size: 11px; font-weight: 800; }
#user-context-menu .uam-item { width: 100%; min-height: 36px; display: block; padding: 0 9px; border: 0; border-radius: 7px; color: #343844; background: transparent; text-align: left; }
#user-context-menu .uam-item:hover { background: #f0f2f6; }
#fx-overlay { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; pointer-events: none; }
#fx-overlay.fx-hidden { display: none; }
#fx-video { max-width: 100%; max-height: 100%; }

/* Dark preference keeps the dense reference style but darkens surfaces. */
body.dark { --v2-paper: #171a24; --v2-bg: #11131b; --v2-line: #303442; --v2-text: #e6e8ee; --v2-muted: #9197a7; }
body.dark .app-grid, body.dark .chat-card, body.dark #messages, body.dark #userlist-sidebar, body.dark #channel-sidebar { color: var(--v2-text); background: #171a24; }
body.dark #tabs button, body.dark #userlist .ul-item, body.dark .userlist-head, body.dark #user-search { color: #e2e5ec; background-color: #1c1f2b; }
body.dark #messages { background: #171a24; }
body.dark .chat-toolbar, body.dark .inputbar { background: #1d202b; }
body.dark #main > .mobile-top-switcher { border-color: #303442; background: #1b1e29; }
body.dark .mobile-top-switcher .mts-btn { color: #dfe3eb; border-color: #303442; background: #202430; }
body.dark .mobile-top-switcher .mts-btn-current,
body.dark .mobile-top-switcher .mts-btn.is-open { color: #fff; background: #34394d; }
body.dark #channel-sidebar { border-color: #303442; }
body.dark #tabs button.active { color: #fff; background: #34394d; }
body.dark #tabs button.new-message:not(.active) { color: #a8c0f7; background: #252d40; }
body.dark #messages .system-bubble { color: #edf0f6; background: #252936; }
body.dark #messages .irc-line { color: #ff7897; }
body.dark .chat-toolbar .icon-btn,
body.dark .inputbar .icon-btn { color: #c8cdd9; }
body.dark .chat-toolbar .icon-btn:hover,
body.dark .inputbar .icon-btn:hover { background: #2b303e; }
body.dark #mobile-list-panel { color: #edf0f6; border-color: #3a3f50; background: #1c1f2b; }
body.dark .v2-mobile-item { color: #e4e7ee; background: #252936; }
body.dark .v2-mobile-item.active { color: #fff; background: #3b435a; }
body.dark #private-user-info { color: #edf0f6; border-color: #303442; background: #1c1f2b; }
body.dark #private-user-info .text-muted { color: #a6adbd !important; }
body.dark #private-user-info .btn-light { color: #e8ebf2; border-color: #424759; background: #2a2e3d; }
body.dark #input { color: #f1f3f7; border-color: #535a70; background: #12151d; }
body.dark #input::placeholder { color: #9299a9; }
body.dark .modal-content {
  color: #edf0f6;
  border: 1px solid #3a3f50;
  background: #1c1f2b;
  box-shadow: 0 24px 70px rgba(0,0,0,.48);
}
body.dark .modal-header,
body.dark .modal-footer { border-color: #343949; }
body.dark .modal-title,
body.dark .modal-body,
body.dark .modal-body label,
body.dark .modal-body .form-label,
body.dark .modal-body p,
body.dark .modal-body h1,
body.dark .modal-body h2,
body.dark .modal-body h3,
body.dark .modal-body h4,
body.dark .modal-body h5,
body.dark .modal-body h6 { color: #edf0f6 !important; }
body.dark .modal-body .text-muted { color: #a6adbd !important; }
body.dark .modal-content .form-control,
body.dark .modal-content .form-select {
  color: #f2f4f8;
  border-color: #444a5d;
  background: #12151d;
}
body.dark .modal-content .form-control::placeholder { color: #858c9c; }
body.dark .modal-content .list-group-item { color: #e9ecf3; border-color: #343949; background: #212532; }
body.dark .modal-content .list-group-item:hover { background: #292e3d; }
body.dark .modal-content .btn-close { filter: invert(1) grayscale(1); opacity: .8; }
body.dark .modal-content code { color: #ff69dc; }
body.dark #user-context-menu { color: #edf0f6; border-color: #3b4051; background: #1c1f2b; }
body.dark #user-context-menu .uam-item { color: #e7eaf1; }
body.dark #user-context-menu .uam-item:hover { background: #292e3d; }

@media (max-width: 900px) {
  .topbar-brand-copy, .radio-info-panel { display: none; }
  .topbar-brand { min-width: 78px; margin-right: auto; }
  .app-grid { grid-template-columns: minmax(0, 1fr) 230px; }
}

@media (max-width: 700px) {
  :root { --v2-header: 58px; --v2-switch: 52px; --v2-tabs: 42px; }
  #login-screen { padding: 0; }
  #login-screen .login-card { width: 100%; min-height: 100dvh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-showcase { display: none; }
  .login-form-panel { padding: 28px 22px; }
  .login-mode-switch { margin-top: 22px; }
  .topbar { padding: 0 7px; gap: 6px; }
  .topbar-brand { display: none; }
  .topbar-menu-btn, .theme-toggle-pro { width: 42px; height: 42px; flex-basis: 42px; border-radius: 8px; }
  .topbar-actions { flex: 1; }
  .radio-toggle-btn { margin-right: auto; }
  .v2-people-button { width: 42px; padding: 0; justify-content: center; }
  .v2-people-button span { display: none; }
  .v2-people-button b { position: absolute; margin: -26px 0 0 25px; color: #fff; background: var(--v2-red); }
  .mobile-top-switcher .mts-btn { gap: 5px; padding: 0 6px; font-size: 12px; }
  .mobile-top-switcher .mts-btn i { font-size: 18px; }
  .app-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tabs" "chat"; }
  .chat-card { border-right: 0; }
  #userlist-sidebar {
    position: fixed;
    z-index: 1100;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(84vw, 330px);
    display: flex;
    box-shadow: -18px 0 42px rgba(17,20,31,.2);
    transform: translateX(105%);
    transition: transform .22s ease;
  }
  body.userlist-open #userlist-sidebar { transform: translateX(0); }
  body.userlist-open .v2-drawer-backdrop { display: block; }
  .v2-drawer-close { display: grid; place-items: center; }
  #toggle-userlist, #toggle-userlist-mobile { display: inline-grid; }
  #messages { padding: 9px 8px 16px; font-size: 14px; }
  #private-user-info { max-height: 98px; min-height: 0; }
  .chat-toolbar { min-height: 40px; flex-basis: 40px; padding: 3px 5px; }
  .chat-toolbar [data-wide] { display: none; }
  .inputbar { min-height: 58px; flex-basis: 58px; gap: 4px; padding: 6px; }
  .inputbar .icon-btn { min-width: 34px; width: 34px; }
  #input { height: 44px; padding: 0 9px; font-size: 13px; }
  #send-button { min-width: 48px; width: 48px; height: 44px; }
  #send-button::after { display: none; }
}

@media (max-width: 390px) {
  .login-mode-btn { padding: 9px; }
  .login-mode-btn small { display: none; }
  .mobile-top-switcher .mts-btn span { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #clear-messages-btn { display: none; }
}

/* ========================================================================
   Dymtlost Pro — tek ve nihai arayüz katmanı
   ======================================================================== */
:root {
  --v2-navy: #151a24;
  --v2-navy-2: #202736;
  --v2-blue: #18b997;
  --v2-blue-soft: #e7f8f4;
  --v2-red: #ef5261;
  --v2-cyan: #36a9c2;
  --v2-gold: #eebc44;
  --v2-bg: #eef2f5;
  --v2-line: #dfe5e9;
  --v2-text: #202832;
  --v2-muted: #8a949e;
  --v2-shadow: 0 18px 55px rgba(21,31,45,.12);
  --v2-header: 68px;
  --v2-switch: 52px;
  --v2-tabs: 48px;
}

body { background: #eef2f5; }
#main { background: #eef2f5; }

.topbar {
  position: relative;
  gap: 9px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.065);
  background: #151a24;
  box-shadow: 0 8px 28px rgba(12,18,28,.18);
}
.topbar::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg,transparent 5%,#18b997 35%,#36a9c2 65%,transparent 95%);
  opacity: .82;
}
.topbar-menu-btn,.theme-toggle-pro,#pwa-install-button,.v2-people-button {
  width: 44px;
  height: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 13px;
  color: #e8edf4;
  background: #202633;
}
.topbar-menu-btn:hover,.theme-toggle-pro:hover,.v2-people-button:hover {
  color: #fff;
  border-color: rgba(24,185,151,.45);
  background: #283140;
}
.topbar-brand { min-width: 190px; }
.app-logo { width: 88px; filter: brightness(0) invert(1); }
.topbar-brand-copy strong { font-size: 13px; letter-spacing: -.02em; }
.topbar-brand-copy span { color: #8d9aaa; }
.topbar-brand-copy span i { background: #21d7a9; box-shadow: 0 0 0 4px rgba(33,215,169,.1); }
.topbar-actions { gap: 8px; }
.radio-info-panel {
  border-color: rgba(255,255,255,.08);
  border-radius: 13px;
  background: #0f141d;
}
.radio-live-dot { color: #5be7c9; background: rgba(24,185,151,.12); }
.radio-toggle-btn {
  border-color: rgba(255,255,255,.09);
  border-radius: 13px;
  background: #242b39;
}
.radio-toggle-btn .radio-toggle-icon { color: #101721; background: #2ad2ad; }
.v2-people-button { position: relative; display: inline-grid; }
.v2-people-button span { display: none; }
.v2-people-button b {
  position: absolute;
  top: -6px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #151a24;
  border-radius: 999px;
  color: #fff;
  background: #ef5261;
  font-size: 9px;
}
#pwa-install-button { display: none; }
#pwa-install-button.is-ready { display: grid; }
#pwa-install-button span { display: none; }

#main > .mobile-top-switcher {
  padding: 7px 10px;
  gap: 7px;
  border-bottom: 1px solid #dfe5e9;
  background: #fff;
}
.mobile-top-switcher .mts-btn {
  border: 0;
  border-radius: 12px;
  color: #66717d;
  background: #f2f5f7;
  font-size: 13px;
  transition: background .18s ease,color .18s ease,transform .18s ease;
}
.mobile-top-switcher .mts-btn:hover { transform: translateY(-1px); }
.mobile-top-switcher .mts-btn-current,
.mobile-top-switcher .mts-btn.is-open {
  color: #fff;
  background: #1b2430;
  box-shadow: 0 7px 18px rgba(22,30,42,.16);
}
.mobile-top-switcher .mts-btn-current::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #25d8b0;
  box-shadow: 0 0 0 4px rgba(37,216,176,.13);
}

.app-grid {
  grid-template-columns: minmax(0,1fr) minmax(250px,300px);
  background: #fff;
}
.chat-card { border-color: #e0e5e9; }
#channel-sidebar { padding: 5px 8px; border-color: #e0e5e9; background: #f7f9fa; }
#channel-sidebar #tabs { gap: 5px; }
#tabs button {
  min-height: 37px;
  height: 37px;
  margin: 0;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #69737e;
  background: transparent;
  font-size: 12px;
  font-weight: 760;
}
#tabs button:hover { color: #25313c; background: #edf1f3; }
#tabs button.active {
  color: #0d735e;
  border-color: #b9eadf;
  background: #e5f8f3;
  box-shadow: none;
}
#tabs button.active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #18b997; }
#tabs button.new-message:not(.active) { color: #217b9b; background: #eaf7fa; }

#messages {
  padding: 18px 20px 28px;
  color: #29333d;
  background: #fff;
  font-family: Inter,system-ui,sans-serif;
  font-size: 14px;
  line-height: 1.58;
}
#messages > div { margin-bottom: 7px; }
.msg-time { margin-right: 6px; color: #a0a8b1; font-size: 10px; font-variant-numeric: tabular-nums; }
.status-service-line,.status-system-line {
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  align-items:start;
  column-gap:7px;
}
.status-service-line .msg-time,.status-system-line .msg-time { margin:3px 0 0; }
.system-bubble {
  display:inline-flex;
  align-items: center;
  justify-self:start;
  padding:4px 8px;
  border: 1px solid #e4e9ec;
  border-radius:7px;
  color: #53606c;
  background: #f7f9fa;
}
.system-bubble.system-success { color: #11745f; border-color: #c4eadf; background: #ebf9f5; }
.status-welcome-card {
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 0 16px;
  padding: 17px 18px;
  border: 1px solid #ccebe4;
  border-radius: 16px;
  background: linear-gradient(135deg,#f2fcf9,#f8fbfc);
  box-shadow: 0 10px 30px rgba(25,68,60,.07);
}
.status-welcome-icon { width: 46px; height: 46px; display: grid; flex: 0 0 46px; place-items: center; border-radius: 14px; color: #fff; background: #18a989; box-shadow: 0 9px 22px rgba(24,169,137,.24); }
.status-welcome-card > span:last-child { min-width: 0; display: grid; gap: 2px; }
.status-welcome-card small { color: #159276; font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.status-welcome-card strong { color: #1b2d32; font-size: 14px; }
.status-welcome-card em { color: #718087; font-size: 11px; font-style: normal; }
.irc-line { color: #277d91; font-weight: 750; }
.irc-action { color: #7e5aa0; }
.irc-notice {
  min-width:0;
  display:block;
  padding:2px 0;
  border:0;
  border-radius:0;
  color: #46535f;
  background:transparent;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.svc { max-width:none; display:inline-block; margin-right:2px; padding:1px 6px; border:0; border-radius:6px; line-height:1.45; vertical-align:baseline; white-space:nowrap; word-break:keep-all; }
.svc-nickserv { color: #167999; background: #e5f6fb; }
.svc-chanserv { color: #6554a7; background: #eeebfb; }
.svc-operserv { color: #a9364a; background: #fce9ed; }

#userlist-sidebar { border-left: 1px solid #e0e5e9; background: #f8fafb; }
.userlist-head { padding: 9px; border-color: #e0e5e9; background: #fff; }
.v2-people-title { height: 38px; padding: 0 5px; }
.v2-people-title strong { color: #29343e; font-size: 12px; }
.v2-people-title span { background: #1b2430; }
.v2-search-wrap { overflow: hidden; border: 1px solid #e0e6e9; border-radius: 11px; }
#user-search { height: 40px; border: 0; background: #f7f9fa; }
#userlist { padding: 7px; }
#userlist .ul-item {
  min-height: 54px;
  margin: 3px 0;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
}
#userlist .ul-item:hover { border-color: #dbe8e5; background: #eef8f5; }
#userlist .ul-item {
  -webkit-touch-callout: none;
  touch-action: pan-y;
  user-select: none;
}
.ul-actions {
  width: 30px;
  min-width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #87929c;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.ul-actions:hover,.ul-actions:focus-visible {
  color: #087d68;
  background: #dff3ee;
  outline: none;
}

.chat-toolbar {
  min-height: 44px;
  flex-basis: 44px;
  padding: 5px 12px;
  border-color: #e0e5e9;
  background: #f7f9fa;
}
.icon-btn { border-radius: 10px; color: #64707b; }
.icon-btn:hover { color: #137d67; background: #e5f5f1; }
.inputbar {
  min-height: 68px;
  flex-basis: 68px;
  gap: 8px;
  padding: 9px 12px;
  border-color: #e0e5e9;
  background: #fff;
}
#input {
  height: 48px;
  padding: 0 16px;
  border: 1px solid #d5dde2;
  border-radius: 14px;
  color: #26313a;
  background: #f8fafb;
}
#input:focus { border-color: #18b997; box-shadow: 0 0 0 4px rgba(24,185,151,.1); }
#send-button {
  min-width: 52px;
  width: 52px;
  height: 48px;
  border-radius: 14px;
  background: #18a989;
  box-shadow: 0 9px 22px rgba(24,169,137,.24);
}
#send-button::after { display: none; }
#send-button:hover { background: #128b71; }

#disconnect-overlay { background: rgba(12,18,26,.7); backdrop-filter: blur(10px); }
#disconnect-overlay .disconnect-card {
  width: min(420px,calc(100vw - 32px));
  padding: 28px;
  border: 1px solid #e1e7ea;
  border-radius: 20px;
  color: #28333c;
  background: #fff;
  box-shadow: 0 26px 80px rgba(0,0,0,.3);
}
.disconnect-title { margin: 0 0 8px; color: #24303a; font-size: 22px; font-weight: 850; }
.disconnect-text { margin: 0 0 20px; color: #6c7883; }
.disconnect-btn { min-height: 46px; border: 0; border-radius: 12px; background: #18a989; }

/* Kullanıcı / IRC yetki paneli */
#user-context-menu {
  position: fixed;
  z-index: 2500;
  display: none;
  width: min(390px,calc(100vw - 22px));
  max-height: min(760px,calc(100dvh - 22px));
  padding: 12px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 20px;
  color: #edf3f6;
  background: #151b25;
  box-shadow: 0 28px 80px rgba(5,10,18,.42);
}
.uam-profile { display: flex; align-items: center; gap: 11px; padding: 4px 3px 13px; border-bottom: 1px solid rgba(255,255,255,.08); }
.uam-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #242d3b; }
.uam-avatar .authority-hat { width: 40px; height: 40px; }
.uam-profile-copy { min-width: 0; display: grid; flex: 1; }
.uam-profile-copy strong { overflow: hidden; color: #fff; text-overflow: ellipsis; white-space: nowrap; }
.uam-profile-copy small { color: #82909f; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.uam-close { width: 34px; height: 34px; border: 0; border-radius: 10px; color: #aab4be; background: #222a37; }
.uam-quick-grid,.uam-moderation-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 7px; margin-top: 10px; }
#user-context-menu .uam-item,.uam-danger,.uam-revoke {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 11px;
  color: #dce5eb;
  background: #202835;
  font-size: 11px;
  font-weight: 750;
}
.uam-channel-tools,.uam-moderation { padding-top: 14px; }
.uam-section-title { display: flex; justify-content: space-between; margin-bottom: 8px; color: #83909e; font-size: 9px; font-weight: 850; letter-spacing: .1em; }
.uam-role-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; }
.uam-role-btn { min-width: 0; min-height: 84px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; padding: 5px 2px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; color: #eaf0f4; background: #202835; }
.uam-role-btn:disabled { opacity: .28; cursor: not-allowed; }
.uam-role-btn .authority-hat { width: 34px; height: 34px; }
.uam-role-btn b { overflow: hidden; max-width: 100%; font-size: 9px; text-overflow: ellipsis; }
.uam-role-btn small { color: #778391; font-size: 8px; }
.uam-revoke { width: 100%; margin-top: 7px; color: #ffd39c; }
.uam-persistent { display: flex; align-items: center; gap: 9px; margin-top: 7px; padding: 9px; border: 1px solid rgba(24,185,151,.2); border-radius: 11px; background: rgba(24,185,151,.07); }
.uam-persistent > span { display: grid; flex: 1; }
.uam-persistent b { font-size: 10px; }
.uam-persistent small { color: #829c97; font-size: 8px; }
.uam-danger { color: #ffb1bc; background: rgba(239,82,97,.1); }
.uam-moderation-grid { grid-template-columns: repeat(4,1fr); }
.uam-status { margin-top: 10px; padding: 8px; border-radius: 9px; color: #85929f; background: #0f141c; font-size: 9px; text-align: center; }
.uam-status[data-tone="error"] { color: #ff9ead; }
.uam-status[data-tone="pending"] { color: #f2c978; }
.is-hidden { display: none !important; }

/* Tutarlı karanlık tema */
body.dark { --v2-bg:#0f141c; --v2-line:#29313c; --v2-text:#e7edf2; --v2-muted:#8793a0; background:#0f141c; }
body.dark #main,body.dark .app-grid { background:#0f141c; }
body.dark #main > .mobile-top-switcher { border-color:#29313c; background:#171d27; }
body.dark .mobile-top-switcher .mts-btn { color:#aeb8c2; background:#202733; }
body.dark .mobile-top-switcher .mts-btn-current,
body.dark .mobile-top-switcher .mts-btn.is-open { color:#fff; background:#26313e; }
body.dark .chat-card,body.dark #messages { color:#e4eaf0; border-color:#29313c; background:#121821; }
body.dark #channel-sidebar { border-color:#29313c; background:#171d26; }
body.dark #tabs button { color:#9ca8b3; background:transparent; }
body.dark #tabs button:hover { color:#e5ecf1; background:#222a35; }
body.dark #tabs button.active { color:#56dfc0; border-color:#275b51; background:#17332d; }
body.dark .system-bubble { color:#c7d0d8; border-color:#2d3742; background:#1b222c; }
body.dark .system-bubble.system-success { color:#69dfc5; border-color:#275a50; background:#17312c; }
body.dark .status-welcome-card { border-color:#275047; background:#17241f; box-shadow:none; }
body.dark .status-welcome-card strong { color:#edf4f2; }
body.dark .status-welcome-card em { color:#91a09d; }
body.dark .irc-notice { color:#cbd5dc; border:0; background:transparent; }
body.dark #userlist-sidebar { border-color:#29313c; background:#151b24; }
body.dark .userlist-head { border-color:#29313c; background:#171e27; }
body.dark .v2-people-title strong { color:#e5ecf1; }
body.dark .v2-search-wrap { border-color:#303a45; }
body.dark #user-search { color:#e4eaf0; background:#10161e; }
body.dark #userlist .ul-item { background:transparent; }
body.dark #userlist .ul-item:hover { border-color:#285148; background:#172a26; }
body.dark .ul-actions { color:#8996a2; }
body.dark .ul-actions:hover,body.dark .ul-actions:focus-visible { color:#62dec3; background:#223b36; }
body.dark .chat-toolbar { border-color:#29313c; background:#171e27; }
body.dark .inputbar { border-color:#29313c; background:#121821; }
body.dark #input { color:#edf2f5; border-color:#333e4a; background:#0e141c; }
body.dark #input::placeholder { color:#74818e; }
body.dark #disconnect-overlay .disconnect-card { color:#edf2f5; border-color:#303a45; background:#171e27; }
body.dark .disconnect-title { color:#f3f6f8; }
body.dark .disconnect-text { color:#a0abb5; }

@media (max-width:900px) {
  .topbar-brand,.radio-info-panel { display:none; }
  .radio-toggle-btn { margin-right:auto; }
}

@media (max-width:700px) {
  :root { --v2-header:58px; --v2-switch:48px; --v2-tabs:76px; }
  .topbar { gap:7px; padding:0 7px; }
  .topbar-menu-btn,.theme-toggle-pro,#pwa-install-button { width:40px; height:40px; min-width:40px; border-radius:12px; }
  .v2-people-button { width:40px; height:40px; min-width:40px; display:inline-flex !important; border-radius:12px; }
  .radio-toggle-btn { height:40px; padding:0 11px; border-radius:12px; }
  .radio-toggle-btn .label { font-size:10px; }
  #main > .mobile-top-switcher { padding:5px 6px; gap:4px; }
  .mobile-top-switcher .mts-btn { min-width:0; gap:4px; padding:0 5px; border-radius:9px; font-size:11px; }
  .mobile-top-switcher .mts-btn i { font-size:15px; }
  .mobile-top-switcher .mts-btn-current::after { display:none; }
  .app-grid {
    grid-template-columns:minmax(0,1fr);
    grid-template-rows:var(--v2-tabs) minmax(0,1fr);
    grid-template-areas:"tabs" "chat";
  }
  .app-grid.sidebar-collapsed { grid-template-columns:minmax(0,1fr); grid-template-areas:"tabs" "chat"; }
  .app-grid.sidebar-collapsed #userlist-sidebar { display:none !important; }
  #channel-sidebar { padding:4px 5px; }
  #channel-sidebar #tabs { flex-wrap:wrap; align-content:flex-start; gap:3px; overflow-x:hidden; overflow-y:auto; }
  #tabs button { min-height:31px; height:31px; max-width:145px; padding:0 8px; border:1px solid #e2e7ea; border-radius:8px; font-size:9.5px; }
  #tabs button.active { box-shadow:none; }
  #tabs button .close-tab-button { margin-left:5px !important; }
  #messages { padding:9px 7px 16px; font-size:12px; line-height:1.42; }
  #messages > div { margin-bottom:3px; }
  .status-service-line,.status-system-line { column-gap:5px; }
  .status-service-line .msg-time,.status-system-line .msg-time { margin-top:2px; font-size:8.5px; }
  .irc-notice { padding:1px 0; line-height:1.42; }
  .svc { padding:1px 5px; border-radius:5px; }
  .status-welcome-card { align-items:flex-start; padding:10px; border-radius:12px; }
  .status-welcome-icon { width:34px; height:34px; flex-basis:34px; border-radius:10px; }
  .status-welcome-card strong { font-size:11px; }
  .status-welcome-card em { font-size:9px; }
  .chat-toolbar { min-height:38px; flex-basis:38px; gap:3px; padding:3px 5px; }
  .chat-toolbar .icon-btn { width:31px; height:31px; font-size:11px; }
  #zoom-out,#zoom-in { display:none; }
  .inputbar { min-height:58px; flex-basis:58px; gap:4px; padding:5px; }
  #clear-messages-btn,#sticker-btn { width:30px; min-width:30px; height:42px; }
  #input { min-width:0; height:44px; padding:0 9px; border-radius:11px; font-size:11px; }
  #send-button { width:43px; min-width:43px; height:44px; border-radius:11px; }
  #userlist-sidebar {
    position:fixed;
    z-index:2200;
    top:0;
    right:0;
    bottom:0;
    width:min(86vw,340px);
    min-width:0;
    display:flex;
    transform:translateX(106%);
    border-left:1px solid #dce2e6;
    background:#f8fafb;
    box-shadow:-20px 0 60px rgba(8,14,24,.28);
    transition:transform .22s ease;
  }
  body.userlist-open #userlist-sidebar { display:flex !important; transform:translateX(0); }
  .userlist-head { padding:4px; }
  .v2-people-title { height:27px; padding:0 2px; }
  .v2-people-title strong { gap:3px; font-size:9px; }
  .v2-people-title strong i { font-size:11px; }
  .v2-people-title span { min-width:22px; height:20px; padding:0 5px; font-size:8px; }
  .v2-drawer-close { display:grid; place-items:center; }
  .v2-search-wrap { border-radius:8px; }
  .v2-search-wrap::before { left:7px; font-size:9px; }
  #user-search { height:30px; padding:0 5px 0 22px; font-size:8.5px; }
  #userlist { padding:3px; }
  #userlist .ul-item { min-height:40px; gap:4px; margin:1px 0; padding:3px; border-radius:8px; }
  #userlist .ul-badge { width:29px; min-width:29px; height:29px; }
  #userlist .authority-hat { width:27px; height:27px; }
  #userlist .ul-name { min-width:0; font-size:9px; }
  #userlist .ul-name-main { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #userlist .ul-role { overflow:hidden; font-size:6.5px; letter-spacing:0; text-overflow:ellipsis; white-space:nowrap; }
  .ul-actions { width:22px; min-width:22px; height:30px; border-radius:7px; font-size:10px; }
  body.userlist-open .v2-drawer-backdrop { display:block !important; z-index:2150; background:rgba(5,10,18,.58); backdrop-filter:blur(3px); }
  body.uam-open::after { content:""; position:fixed; inset:0; z-index:2400; background:rgba(5,9,15,.58); backdrop-filter:blur(2px); }
  #user-context-menu { right:8px !important; bottom:calc(8px + env(safe-area-inset-bottom)); left:8px !important; top:auto !important; width:auto; max-height:82dvh; }
  .uam-role-grid { grid-template-columns:repeat(3,1fr); }
}

@media (max-width:390px) {
  .mobile-top-switcher .mts-btn { font-size:10px; }
  #userlist .ul-badge { width:25px; min-width:25px; height:25px; }
  #userlist .authority-hat { width:24px; height:24px; }
  #userlist .ul-name { font-size:8px; }
  .ul-actions { width:19px; min-width:19px; }
}
