:root{
  --bg:#f2f4f6;
  --card:#ffffff;
  --card2:#f8fafc;
  --text:#0f172a;
  --muted:#64748b;

  --sidebar:#1f2b33;
  --sidebar2:#23323b;
  --sidebarText:#e5eef5;
  --sidebarMuted:#9fb3c3;

  --primary:#2b7cff;
  --danger:#ef4444;
  --success:#22c55e;
  --warning:#f59e0b;

  --border:#e2e8f0;
  --shadow: 0 8px 20px rgba(15,23,42,.08);

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", Arial, sans-serif;
}

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

a{ color:inherit; text-decoration:none; }

.hidden{ display:none !important; }

.layout{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:240px;
  background:var(--sidebar);
  color:var(--sidebarText);
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(255,255,255,.06);
  position:sticky;
  z-index:10;
  top:0;
  height:100vh;
  /* NOTE: scrolling is handled by .sidebar-scroll so the edge toggle can stick out without being clipped */
  overflow:visible;
  align-self:flex-start;
  transition: width .18s ease;
  will-change: width;
}

/* scrollable content inside sidebar (logo/menu/footer) */
.sidebar-scroll{
  height:100%;
  display:flex;
  flex-direction:column;
  overflow-y:auto;
  overflow-x:hidden;
}
.logo{
  padding:18px 36px 14px 18px;
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid rgba(255,255,255,.06);
  background:linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  text-decoration:none;
  color:inherit;
  user-select:none;
}

.logo-text{
  flex:1;
  min-width:0;
}
.logo-badge{
  width:34px;height:34px;border-radius:10px;
  background:rgba(43,124,255,.18);
  display:flex;align-items:center;justify-content:center;
  font-weight:800;
}
.logo-title{
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.logo-sub{ font-size:12px; color:var(--sidebarMuted); margin-top:2px; }

/* Docker Desktop–like toggle: circle on the sidebar edge */
.sidebar-edge-toggle{
  position:absolute;
  top:34px;
  transform:translateY(-50%);
  right:-15px;
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(25,35,43,.96);
  color:var(--sidebarText);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  line-height:1;
  z-index:20;
  box-shadow: 0 10px 24px rgba(2,6,23,.20);
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease, transform .15s ease, border-color .15s ease, background .15s ease;
}
.sidebar:hover .sidebar-edge-toggle,
.sidebar:focus-within .sidebar-edge-toggle,
.sidebar-edge-toggle:hover,
.sidebar-edge-toggle:focus{
  opacity:1;
  pointer-events:auto;
}
.sidebar-edge-toggle:hover{
  border-color:rgba(255,255,255,.22);
  background:rgba(25,35,43,1);
}
.sidebar-edge-toggle:active{ transform:translateY(-50%) scale(0.97); }

.sidebar-edge-toggle svg{
  width:18px;
  height:18px;
  display:block;
}


@media (hover: none){
  .sidebar-edge-toggle{ opacity:1; pointer-events:auto; }
}

.sidebar.collapsed{
  width:72px;
}

.sidebar.collapsed .logo{
  padding-left:12px;
  padding-right:12px;
  align-items:center;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .logo-title,
.sidebar.collapsed .logo-sub{
  display:none;
}

/* keep the edge-toggle stable in collapsed mode */
.sidebar.collapsed .sidebar-edge-toggle{ right:-15px; }

.sidebar.collapsed .menu a{
  justify-content:center;
}

.sidebar.collapsed .menu a span{
  display:none;
}

.sidebar.collapsed .nav-ind{
  display:none;
}

.sidebar.collapsed .sidebar-footer{
  display:none;
}

.menu{
  padding:10px 10px 14px 10px;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.menu a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  color:var(--sidebarText);
  transition: background .15s ease;
}
.menu a:hover{ background:rgba(255,255,255,.06); }
.menu a.active{
  background:rgba(43,124,255,.22);
  border:1px solid rgba(43,124,255,.25);
}
.menu .icon{
  width:18px;height:18px;opacity:.92;
}
.sidebar-footer{
  margin-top:auto;
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.06);
  color:var(--sidebarMuted);
  font-size:12px;
}
.sidebar-footer .userline{
  display:flex;justify-content:space-between;align-items:center;
  gap:10px;
  margin-top:8px;
}

.sidebar-footer .user-link{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--sidebarText);
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  max-width: 140px;
  overflow:hidden;
}
.sidebar-footer .user-link:hover{ text-decoration:underline; }
.sidebar-footer .user-name{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.user-avatar,
.user-avatar-fallback{
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  flex:0 0 auto;
}
.user-avatar{ object-fit:cover; display:block; }
.user-avatar-fallback{
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:12px;
  color:var(--sidebarText);
}

.logout-btn{
  background:transparent;
  border:1px solid rgba(255,255,255,.12);
  color:#fff;
  padding:6px 10px;
  border-radius:10px;
  cursor:pointer;
  font-weight:800;
  transition: background .15s ease, border-color .15s ease;
}
.logout-btn:hover{ background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.18); }

.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}
.topbar{
  height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 18px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.7);
  backdrop-filter: blur(6px);
  position:sticky;
  z-index:10;
  top:0;
  z-index:5;
}
.topbar h1{
  font-size:16px;
  margin:0;
  font-weight:800;
}
.topbar .right{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}

.content{
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.card .card-header{
  padding:14px 16px;
  background:var(--card2);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.card .card-header .title{
  font-weight:800;
}
.card .card-body{ padding:16px; }

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.stat{
  flex:1;
  min-width:180px;
  background:var(--card2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px 12px;
}
.stat .k{ color:var(--muted); font-size:12px; }
.stat .v{ font-size:18px; font-weight:800; margin-top:4px; }

.badge{
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--border);
}
.badge.online{ background:rgba(34,197,94,.12); border-color:rgba(34,197,94,.25); color:#166534; }
.badge.offline{ background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.25); color:#7f1d1d; }
.badge.starting{ background:rgba(245,158,11,.12); border-color:rgba(245,158,11,.25); color:#7c2d12; }

.btn{
  border:1px solid transparent;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  background:var(--primary);
  color:white;
}
.btn:hover{ filter:brightness(0.98); }
.btn.secondary{
  background:transparent;
  border-color:var(--border);
  color:var(--text);
}
.btn.secondary:hover{ background:rgba(15,23,42,.04); }
.btn.danger{ background:var(--danger); }
.btn.success{ background:var(--success); }
.btn.small{ padding:7px 10px; font-size:13px; border-radius:10px; }

.input, select, textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
  outline:none;
  background:white;
}
textarea{ font-family: var(--mono); min-height: 180px; }
label{ font-size:12px; color:var(--muted); display:block; margin-bottom:6px; font-weight:700; }

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
@media (max-width: 980px){
  .sidebar{ width:210px; }
  .form-grid{ grid-template-columns: 1fr; }
}

.console{
  background:#0b1220;
  color:#d8e2f0;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:12px;
  font-family:var(--mono);
  font-size:13px;
  line-height:1.35;
  /* ~2/3 высоты страницы (как просили) */
  height:66vh;
  overflow:auto;
  white-space:pre-wrap;
}
.console .line{ opacity:.95; }
.console .system{ color:#93c5fd; }
.console .stderr{ color:#fca5a5; }
.console .command{ color:#a7f3d0; }

.consolebar{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.consolebar input{
  flex:1;
  font-family:var(--mono);
}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th, .table td{
  border-bottom:1px solid var(--border);
  padding:10px 8px;
  font-size:14px;
}
.table th{ text-align:left; color:var(--muted); font-size:12px; }
.table tr:hover td{ background:rgba(15,23,42,.03); }

.pathbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.breadcrumb{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
}
.breadcrumb a{ color:var(--primary); }
.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:50;
}
.modal{
  width:min(920px, 92vw);
  height: 66vh;       /* по умолчанию ~2/3 высоты экрана (редактор файла) */
  max-height: 88vh;
  min-height: 360px;
  overflow:hidden;
  background:white;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
  resize: both; /* чтобы можно было менять ширину/высоту окна */
}
.modal .card-header{ position:sticky; top:0; z-index:1; }

.modal .card-header{
  padding:16px 18px;
  gap:12px;
}

/* In modals (e.g. file editor) keep the title readable and prevent it from wrapping over buttons */
.modal .card-header .title{
  font-size:14px;
  font-weight:900;
  margin-right:18px;
  max-width:58%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.modal .card-header .actions{ flex-shrink:0; }

/* Image preview modal: keep title and buttons on separate rows */
.modal.modal-img .card-header{
  flex-direction:column;
  align-items:stretch;
}
.modal.modal-img .card-header .title{
  max-width:100%;
  margin-right:0;
}
.modal.modal-img .card-header .actions{
  width:100%;
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

.modal .card-body{
  flex:1;
  min-height:0;
  display:flex;
}

.modal textarea.input{
  flex:1;
  min-height:0;
  resize:none; /* вместо этого ресайзим само окно */
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  line-height:1.35;
}

/* Image preview inside a resizable modal */
.modal .img-preview-wrap{
  flex:1;
  min-height:0;
  width:100%;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:10px;
}
.modal .img-preview-wrap img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  border-radius:12px;
}

.toast{
  position:fixed;
  right:16px;
  bottom:16px;
  padding:12px 14px;
  border-radius:14px;
  background:rgba(15,23,42,.92);
  color:white;
  font-size:13px;
  max-width:min(420px, 92vw);
  z-index:100;
  box-shadow: var(--shadow);
}
.toast.ok{ background:rgba(34,197,94,.92); }
.toast.err{ background:rgba(239,68,68,.92); }
.toast.warn{ background:rgba(245,158,11,.92); }

.progress{
  height: 10px;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-sm{
  height:6px;
  width:180px;
}

.job{
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.65);
  display:flex;
  flex-direction:column;
  gap:4px;
}

.progress-bar{
  height: 100%;
  width: 0%;
  background: var(--primary);
  transition: width 150ms ease;
}

.auth{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.auth-card{
  width:min(520px, 92vw);
  background:white;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
}
.auth-card .head{
  padding:16px;
  background:var(--card2);
  border-bottom:1px solid var(--border);
}
.auth-card .body{ padding:16px; }
.auth-card h2{ margin:0; font-size:16px; font-weight:900; }
.auth-card p{ margin:8px 0 0 0; color:var(--muted); font-size:13px; }

/* ----------------------------
   Улучшения UI (Сервер/Консоль)
   ---------------------------- */

.status-banner{
  width:100%;
  border-radius:14px;
  padding:14px 16px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0; /* небольшой отступ сверху/снизу, чтобы баннер не сливался с карточками */
}

.status-banner .label{
  font-size:12px;
  font-weight:800;
  opacity:.85;
}

.status-banner .state{
  font-size:20px;
  font-weight:1000;
  line-height:1.05;
  margin-top:2px;
}

.status-banner .sub{
  font-size:12px;
  opacity:.75;
  margin-top:6px;
}

.status-banner.online{
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.25);
  color: rgb(20,83,45);
}

.status-banner.offline{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: rgb(127,29,29);
}

.status-banner.busy{
  background: rgba(100,116,139,.12);
  border-color: rgba(100,116,139,.22);
  color: rgb(15,23,42);
}

.status-banner.error{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.25);
  color: rgb(127,29,29);
}

.info-grid{
  display:grid;
  grid-template-columns: 2fr 1fr;
  gap:12px;
}

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

.info-card{
  background:var(--card2);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
}

.info-card .k{ font-size:12px; color:var(--muted); font-weight:800; }
.info-card .v{ font-size:14px; font-weight:900; }
.info-card .row{ display:flex; gap:10px; align-items:center; margin-top:8px; }

/* Same layout helper, used in the Server tab for IP + Copy button */
.info-row{ display:flex; gap:14px; align-items:center; margin-top:8px; flex-wrap:wrap; }
.info-card code{
  background: rgba(15,23,42,.05);
  border:1px solid rgba(15,23,42,.08);
  border-radius:10px;
  padding:6px 8px;
  font-size:12px;
  word-break: break-all;
}

/* Индикатор возле пункта меню "Сервер" */
.nav-ind{
  margin-left:auto;
  height:20px;
  min-width:20px;
  padding:0 8px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  font-weight:900;
  border:1px solid rgba(255,255,255,.18);
}

.nav-ind.online{
  background: rgba(34,197,94,.22);
  color: rgba(236,253,245,1);
}

.nav-ind.offline{
  width:20px;
  min-width:20px;
  padding:0;
  background: rgba(239,68,68,.22);
  border-color: rgba(239,68,68,.35);
}

.nav-ind.offline::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:2px;
  border:2px solid rgba(255,255,255,.85);
  box-sizing:border-box;
  transform: translateX(-1px);
}

.nav-ind.busy{
  width:20px;
  min-width:20px;
  padding:0;
  background: rgba(148,163,184,.22);
}

.nav-ind.busy::before{
  content:"";
  width:12px;
  height:12px;
  border-radius:50%;
  border:2px solid rgba(255,255,255,.65);
  border-top-color: transparent;
  box-sizing:border-box;
  animation: navspin 1s linear infinite;
}

@keyframes navspin{ to{ transform: rotate(360deg); } }

/* ----------------------------
   Toggle switches (true/false)
   ---------------------------- */

.field-label{
  margin-bottom:6px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.field-label .ru{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
}
.field-label .en{
  font-size:11px;
  color:rgba(100,116,139,.95);
  font-family:var(--mono);
}
.field-hint{
  font-size:12px;
  color:var(--muted);
  margin-top:6px;
  line-height:1.35;
}

.toggle{
  display:inline-flex;
  align-items:center;
  gap:10px;
  cursor:pointer;
  user-select:none;
}
.toggle input{
  position:absolute;
  opacity:0;
  width:0;
  height:0;
}
.toggle-track{
  width:44px;
  height:24px;
  border-radius:999px;
  background: rgba(15,23,42,.08);
  border:1px solid var(--border);
  position:relative;
  transition: background .15s ease, border-color .15s ease;
}
.toggle-thumb{
  position:absolute;
  top:2px;
  left:2px;
  width:20px;
  height:20px;
  border-radius:999px;
  background:white;
  border:1px solid rgba(15,23,42,.12);
  transition: left .15s ease, border-color .15s ease;
}
.toggle input:checked + .toggle-track{
  background: rgba(43,124,255,.22);
  border-color: rgba(43,124,255,.35);
}
.toggle input:checked + .toggle-track .toggle-thumb{
  left:22px;
  border-color: rgba(43,124,255,.55);
}
.toggle-text{
  font-size:13px;
  color:var(--text);
  font-weight:800;
}

.btn:disabled{
  opacity:.65;
  cursor:not-allowed;
}

.details{
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  background: rgba(15,23,42,.02);
}
.details > summary{
  cursor:pointer;
  font-weight:900;
  user-select:none;
}
.details > summary::-webkit-details-marker{ display:none; }
.details .details-body{ margin-top:10px; }

/* --- Sidebar footer user block --- */
.userline{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.user-link{ display:inline-flex; align-items:center; gap:10px; padding:6px 10px; border-radius:12px; color:inherit; text-decoration:none; }
.user-link:hover{ background: rgba(255,255,255,.06); }
.user-link:focus{ outline:2px solid rgba(43,124,255,.55); outline-offset:2px; }
.user-name{ font-weight:700; }

/* Extra-small button */
.btn.xs{ padding:6px 10px; font-size:12px; border-radius:10px; }

/* --- Collapsible cards (Players lists) --- */
.collapsible-head{ cursor:pointer; user-select:none; }
.collapsible-head:focus{ outline:2px solid rgba(43,124,255,.55); outline-offset:2px; border-radius:14px; }
.collapsible-chev{ color:var(--muted); font-size:28px; line-height:1; }
.collapsible.collapsed .collapsible-body{ display:none; }
.collapsible.collapsed .card-header{ border-bottom:none; }

.list-add-row{ display:flex; gap:10px; align-items:center; }
.list-add-row .input{ flex:1; }
.list-items{ display:flex; flex-direction:column; gap:10px; }
.list-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:14px; background:var(--card2); }
.mono{ font-family:var(--mono); font-size:13px; }

/* --- MOTD editor --- */
.motd-tools{ display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:8px 0; }
.motd-color{ width:auto; min-width:160px; max-width:220px; }
.motd-preview{ margin-top:8px; padding:12px; border:1px solid var(--border); border-radius:14px; background:#0b1220; color:#fff; font-family:var(--mono); font-size:13px; line-height:1.4; overflow:auto; }

/* --- Gamerules --- */
.gamerules-grid{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.gamerule-item{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border:1px solid var(--border); border-radius:14px; background:var(--card2); }
.gamerule-key{ font-family:var(--mono); font-size:13px; word-break:break-word; }
.gamerule-ctrl{ display:flex; justify-content:flex-end; }
.gamerule-ctrl .input{ max-width:220px; }
.gamerule-ctrl input[type=number].input{ max-width:160px; }

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

/* --- User page (avatar + password strength) --- */
.avatar-wrap{ width:96px; height:96px; border-radius:18px; overflow:hidden; border:1px solid var(--border); background:var(--card2); display:flex; align-items:center; justify-content:center; }
.avatar-img{ width:100%; height:100%; object-fit:cover; display:block; }
.avatar-fallback{ font-size:34px; font-weight:900; color:var(--text); }
.avatar-actions{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; }

.pw-strength{ display:flex; flex-direction:column; gap:8px; }
.pw-strength-bar{ height:10px; border-radius:999px; background:rgba(15,23,42,.08); overflow:hidden; border:1px solid rgba(15,23,42,.10); }
.pw-strength-fill{ height:100%; width:0%; background:var(--primary); transition:width .15s ease; }
.pw-strength-fill.weak{ background:var(--danger); }
.pw-strength-fill.mid{ background:var(--warning); }
.pw-strength-fill.strong{ background:var(--success); }
.pw-strength-meta{ display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:12px; color:var(--muted); }
.pw-strength-warn{ color:var(--warning); font-weight:800; }

.pw-strength-hints{ display:flex; flex-direction:column; gap:4px; margin-top:4px; }
.pw-ok{ color:var(--success); font-weight:800; }
.pw-bad{ color:var(--muted); }

/* --- Access: invites list --- */
.invite-controls{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:10px; }
.invite-controls .field-label{ margin:0; }
.invite-list{ display:flex; flex-direction:column; gap:0; }
.invite-row{
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  padding:10px 12px;
  margin:0 0 10px 0;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card2);
  overflow:hidden;
  max-height:220px;
  transition: opacity .2s ease, transform .2s ease, max-height .25s ease, margin .25s ease, padding .25s ease, border-width .25s ease;
}
.invite-row:last-child{ margin-bottom:0; }
.invite-row.removing{ opacity:0; transform:translateX(6px) scale(.98); max-height:0; margin:0; padding-top:0; padding-bottom:0; border-width:0; }
.invite-row.adding{ animation:inviteIn .28s ease both; }
@keyframes inviteIn{
  0%{ opacity:0; transform:translateY(6px) scale(.98); max-height:0; padding-top:0; padding-bottom:0; margin:0; }
  65%{ opacity:1; transform:translateY(0) scale(1.03); max-height:220px; padding-top:10px; padding-bottom:10px; margin:0 0 10px 0; }
  100%{ opacity:1; transform:translateY(0) scale(1); max-height:220px; padding-top:10px; padding-bottom:10px; margin:0 0 10px 0; }
}
.invite-main{ display:flex; flex-direction:column; gap:4px; min-width:0; }
.invite-url{ font-family:var(--mono); font-size:13px; word-break:break-all; }
.invite-meta{ font-size:12px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap; }
.invite-actions{ display:flex; gap:8px; flex-wrap:wrap; flex-shrink:0; }

.mini-avatar{
  width:22px;
  height:22px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:12px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(15,23,42,.05);
  position:relative;
  overflow:hidden;
}

.mini-avatar-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.mini-avatar-fallback{ position:relative; z-index:1; }
.mini-avatar.has-img .mini-avatar-fallback{ opacity:0; }

/* --- User sessions --- */
.session-list{ display:flex; flex-direction:column; gap:0; }
.session-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  margin:0 0 10px 0;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--card2);
  overflow:hidden;
  max-height:320px;
  transition: opacity .2s ease, transform .2s ease, max-height .25s ease, margin .25s ease, padding .25s ease, border-width .25s ease;
}
.session-row:last-child{ margin-bottom:0; }
.session-row.removing{ opacity:0; transform:translateX(6px) scale(.98); max-height:0; margin:0; padding-top:0; padding-bottom:0; border-width:0; }
.session-row.adding{ animation:sessionIn .28s ease both; }
@keyframes sessionIn{
  0%{ opacity:0; transform:translateY(6px) scale(.98); max-height:0; padding-top:0; padding-bottom:0; margin:0; }
  65%{ opacity:1; transform:translateY(0) scale(1.03); max-height:320px; padding-top:12px; padding-bottom:12px; margin:0 0 10px 0; }
  100%{ opacity:1; transform:translateY(0) scale(1); max-height:320px; padding-top:12px; padding-bottom:12px; margin:0 0 10px 0; }
}
.session-left{ display:flex; gap:12px; align-items:flex-start; min-width:0; }
.session-ico{ width:36px; height:36px; border-radius:12px; background:rgba(15,23,42,.05); border:1px solid rgba(15,23,42,.10); display:flex; align-items:center; justify-content:center; color:var(--muted); flex:0 0 auto; }
.session-title{ font-weight:900; }
.session-sub{ font-size:12px; color:var(--muted); display:flex; gap:10px; flex-wrap:wrap; margin-top:4px; }
.session-actions{ display:flex; gap:8px; flex-wrap:wrap; flex-shrink:0; }
.session-current{ font-size:12px; font-weight:900; color:var(--success); }

/* --- Image preview modal tweaks --- */
.modal.modal-img .card-header{ flex-direction:column; align-items:stretch; }
.modal.modal-img .card-header .title{ max-width:100%; margin-right:0; }
.modal.modal-img .card-header .actions{ width:100%; display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
