/* Shared input contract: use both classes for every room-style search control. */
body .app-search-field {
  display:flex !important; align-items:center; min-width:0; height:34px !important;
  padding:0 !important; gap:0; border:1px solid rgba(137,160,186,.20) !important;
  border-radius:17px !important;
  background:linear-gradient(180deg,rgba(31,42,54,.98),rgba(26,36,47,.98)) !important;
  box-shadow:0 10px 30px rgba(0,0,0,.18),inset 0 1px rgba(255,255,255,.025) !important;
  transition:border-color 170ms ease,box-shadow 170ms ease,background-color 170ms ease;
}
body .app-search-field:focus-within {
  border-color:rgba(126,163,204,.38) !important;
  box-shadow:0 12px 34px rgba(0,0,0,.24),inset 0 1px rgba(255,255,255,.035) !important;
}
body .app-search-field .app-search-input {
  appearance:none; -webkit-appearance:none; display:block; width:100%; min-width:0;
  height:32px !important; min-height:0 !important; max-width:none; margin:0;
  border:0 !important; border-radius:inherit; outline:0 !important; box-shadow:none !important;
  background:transparent !important; color:var(--text) !important; padding:6px 12px !important;
  font:400 13px var(--font-ui) !important; line-height:18px !important;
}
body .app-search-field .app-search-input::placeholder { color:var(--muted2) !important; opacity:1; }
body .app-search-input::-webkit-search-decoration,
body .app-search-input::-webkit-search-cancel-button { appearance:none; -webkit-appearance:none; }
.settings-search-field { flex:0 1 240px; width:240px; }

/* A calm, compact notebook; the editor retains its plain-text behavior. */
body .modal[data-size="notepad"] .modal-body > .notepad-app {
  grid-template-rows:auto auto minmax(0,1fr) auto !important; gap:12px !important;
}
body .modal[data-size="notepad"]:has(#notepad-editor) .modal-body > .notepad-app > .notepad-filebar {
  display:flex !important; flex-wrap:wrap; align-items:center; gap:12px !important;
  padding:0 0 12px !important; border:0; border-bottom:1px solid var(--stroke2);
  border-radius:0; background:transparent;
}
.notepad-document-name { display:flex; align-items:center; gap:8px; flex:1 1 180px; min-width:0; }
.notepad-document-name > svg { width:20px; height:20px; flex:0 0 20px; color:var(--muted); }
body .notepad-document-name #notepad-filename {
  width:100%; min-width:0; padding:8px 0; border:0; box-shadow:none; background:transparent;
  color:var(--text); font-family:var(--font-ui); font-size:14px; font-weight:600;
}
body .notepad-document-name #notepad-filename:focus { box-shadow:0 1px var(--primary); }
body .notepad-file-actions { flex:0 1 auto; gap:5px; flex-wrap:wrap; }
body .notepad-file-actions .btn { min-height:32px; padding:6px 10px; border-radius:8px; font-size:12px; font-weight:550; }
body .notepad-searchbar { grid-template-columns:minmax(100px,1fr) 34px 34px minmax(100px,auto); gap:6px; }
body .modal[data-size="notepad"] .notepad-searchbar > button {
  display:grid !important; place-items:center; width:34px !important; height:34px !important;
  min-width:34px !important; min-height:34px !important; max-width:34px; max-height:34px;
  padding:0 !important; margin:0; line-height:1; border-radius:9px; background:var(--surface-2);
}
.notepad-searchbar > button svg { display:block; width:18px; height:18px; margin:0; }
body #notepad-search-status { padding-left:6px; font-size:11px; }
body #notepad-editor.notepad-editor {
  border-color:var(--stroke2) !important; border-radius:11px !important; background:#111820 !important;
  padding:18px !important; line-height:1.7 !important; box-shadow:inset 0 2px 10px #0000000f;
}
body #notepad-editor.notepad-editor:focus { border-color:#779bc547 !important; outline:0; }
.notepad-statusbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; padding:0 2px; color:var(--muted2); font-size:11px; }

/* Preserve room icon dimensions; improve rows, selected state and hierarchy. */
#sidebar-nav-surface #rooms-list-card { transform:none !important; }
#sidebar-nav-surface #rooms-list-card > .rooms-head {
  cursor:default !important; display:flex !important; align-items:center; justify-content:flex-start;
  padding:7px 8px !important; gap:8px; min-height:46px !important; margin-bottom:2px;
  background:transparent !important; box-shadow:none !important;
}
#sidebar-nav-surface #rooms-list-card .rooms-head-copy { flex:1 1 auto; min-width:0; padding:0; }
#sidebar-nav-surface #rooms-subtitle { display:none !important; }
#sidebar-nav-surface #rooms-title {
  font-family:var(--font-ui); font-size:12px !important; font-weight:700 !important; line-height:1.3;
  text-transform:none !important; letter-spacing:0 !important; color:var(--text); text-align:left; margin:0;
}
#sidebar-nav-surface .rooms-title::after { display:none !important; }
#sidebar-nav-surface .rooms-head-actions #rooms-mode-toggle[hidden] { display:none !important; }
#sidebar-nav-surface #rooms-list { gap:4px !important; }
#sidebar-nav-surface .room-row {
  padding:9px 8px !important; border-radius:11px !important;
  border:1px solid transparent !important; background:transparent !important;
  transition:background 120ms ease,border-color 120ms ease !important;
}
#sidebar-nav-surface .room-row:hover { background:#91abc90c !important; border-color:#91abc912 !important; transform:none; }
#sidebar-nav-surface .room-row:is(.active,.is-active) {
  background:linear-gradient(110deg,#5c97da22,#5c97da0c) !important;
  border-color:#91bff02b !important; box-shadow:inset 0 1px #c6e3ff05 !important;
}
#sidebar-nav-surface .room-row:is(.active,.is-active)::before {
  content:""; position:absolute; left:-1px; top:14px; bottom:14px; width:3px; border-radius:3px;
  background:#83b8ef;
}
#sidebar-nav-surface .room-row:focus-visible { outline:2px solid #83b8ef; outline-offset:1px; }
#sidebar-nav-surface .room-name { color:#dce6f1; font-size:13px; font-weight:600; line-height:1.4; }
#sidebar-nav-surface .room-preview { margin-top:3px; color:#8a9aac; font-size:11px; line-height:1.4; }
#sidebar-nav-surface .room-preview-author { color:#a5b4c6; font-weight:500; }
#sidebar-nav-surface .room-markers { opacity:.65; margin-left:5px; }
#sidebar-nav-surface .room-row:hover .room-markers { opacity:1; }
#sidebar-nav-surface .room-row .room-avatar { border-color:#a4bad52a; }

/* Sidebar hover changes color only; icons and their buttons stay still. */
#sidebar-nav-surface :is(.side-btn,.sidebar-dock-button,.rooms-mode-toggle,#btn-time-display):is(:hover,:focus-visible,:active) {
  transform:none !important;
}
#sidebar-nav-surface :is(button,[role="button"]) :is(svg,.side-ico,.time-display-rail-icon) {
  transition:color 140ms ease;
}
#sidebar-nav-surface .sidebar-account-actions > .sidebar-admin,
#sidebar-nav-surface .sidebar-account-actions > .sidebar-settings { width:36px !important; height:36px !important; min-height:36px; flex:0 0 36px; border-radius:9px !important; }
#sidebar-nav-surface .sidebar-admin > .side-ico { width:20px !important; height:20px !important; }
#sidebar-nav-surface .sidebar-account-actions svg { width:20px; height:20px; }
#sidebar-nav-surface .sidebar-account-actions > [hidden] { display:none !important; }
.member-status-dot[data-state="offline"],
.members-sidebar .member-status-dot[data-state="offline"],
.profile-status-dot[data-state="offline"] { background:#80848e !important; box-shadow:none !important; }

/* Sticker content only: the existing popover frame and layout remain intact. */
body .chat-popup .sticker-popover-head { align-items:center; }
body .chat-popup .sticker-upload-btn { width:34px; height:34px; flex-basis:34px; border-radius:10px; }
body .chat-popup .sticker-grid { gap:8px; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); }
body .chat-popup .sticker-tile {
  grid-template-rows:96px minmax(30px,auto); padding:7px; gap:8px; border-radius:11px;
  border:1px solid transparent; background:#11182080; color:#bdcbdc;
  transition:background 130ms ease,border-color 130ms ease,transform 130ms ease;
}
body .chat-popup .sticker-tile:hover,
body .chat-popup .sticker-tile:focus-visible { background:#263545; border-color:#81b6ee45; transform:translateY(-1px); color:#eef5fd; }
body .chat-popup .sticker-tile:active { transform:scale(.97); }
body .chat-popup .sticker-tile-media { width:100%; height:96px; border-radius:7px; background:#0c121875; }
body .chat-popup .sticker-tile-name {
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden;
  white-space:normal; overflow-wrap:anywhere; text-overflow:ellipsis; line-height:1.3;
  font-size:11px; font-weight:550; text-align:center; align-self:center;
}
body .chat-popup .sticker-tile.is-unavailable { border-color:#d3a66155; }

body[data-mobile-ui="1"] .app-search-field {
  border:1px solid var(--stroke2) !important; border-radius:25px !important;
  background:var(--surface-2) !important; box-shadow:none !important;
}
body[data-mobile-ui="1"] .app-search-field .app-search-input { font-size:16px !important; padding-inline:8px !important; }
body[data-mobile-ui="1"] #sidebar-nav-surface .room-row { min-height:58px !important; padding:10px 8px !important; }
body[data-mobile-ui="1"] #sidebar-nav-surface .room-row:is(.active,.is-active) { background:#5c97da1c !important; border-color:#91bff02b !important; }
@media(max-width:600px) {
  .settings-search-field { width:auto; flex:1 1 130px; }
  body .modal[data-size="notepad"] .modal-card { height:calc(100dvh - 16px); }
  body .notepad-file-actions { justify-content:flex-start; }
  body .notepad-searchbar { grid-template-columns:minmax(80px,1fr) 34px 34px; }
  body #notepad-search-status { grid-column:1 / -1; padding-left:8px; min-height:15px; }
  .notepad-statusbar { font-size:10px; }
  body .chat-popup .sticker-grid { grid-template-columns:repeat(auto-fill,minmax(88px,1fr)); }
}
@media(prefers-reduced-motion:reduce) {
  #sidebar-nav-surface :is(button,[role="button"]) svg,
  body .app-search-field,body .chat-popup .sticker-tile { transition:none !important; }
}
