:root {
  --bg: #050914;
  --screen: rgba(7, 13, 28, 0.84);
  --panel: rgba(255, 255, 255, 0.055);
  --card: rgba(255, 255, 255, 0.075);
  --card-2: rgba(255, 255, 255, 0.105);
  --card-strong: rgba(255, 255, 255, 0.14);
  --text: #f7f8ff;
  --muted: rgba(247, 248, 255, 0.58);
  --faint: rgba(247, 248, 255, 0.36);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #2f7dff;
  --accent-2: #66d7ff;
  --accent-3: #d7e7ff;
  --danger: #ff6f8d;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.44);
}

/* Activity media stays compact so the feed keeps its information density. */
.event-row.has-media {
  min-height: 58px;
  grid-template-columns: 7px 42px minmax(0, 1fr) auto;
}

.event-media {
  width: 42px;
  height: 42px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.event-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

@media (max-width: 680px) {
  .event-row.has-media {
    grid-template-columns: 7px 38px minmax(0, 1fr) auto;
  }

  .event-media {
    width: 38px;
    height: 38px;
    border-radius: 9px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 8%, rgba(102, 215, 255, 0.22), transparent 30%),
    radial-gradient(circle at 86% 70%, rgba(215, 231, 255, 0.12), transparent 28%),
    linear-gradient(145deg, #061225 0%, #123c70 44%, #060814 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  filter: blur(52px);
  opacity: 0.32;
  pointer-events: none;
  animation: floaty 10s ease-in-out infinite;
}

body::before {
  left: -90px;
  top: 90px;
  background: #66d7ff;
}

body::after {
  right: -95px;
  bottom: 120px;
  background: #d7e7ff;
  animation-delay: -4s;
}

@keyframes floaty {
  50% {
    transform: translate3d(18px, -24px, 0) scale(1.06);
  }
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gate {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  padding: 24px;
}

.loader {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 0 38px rgba(102, 215, 255, 0.36);
  animation: pulse 1.15s infinite ease-in-out;
}

.login-shell {
  min-height: var(--app-height, 100vh);
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 18%, rgba(102, 215, 255, 0.24), transparent 32%),
    radial-gradient(circle at 86% 8%, rgba(215, 231, 255, 0.12), transparent 30%),
    linear-gradient(145deg, #061225, #123c70 58%, #060814);
}

.login-card {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.055)),
    rgba(17, 22, 35, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(26px) saturate(1.25);
}

.login-card h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.telegram-oauth-btn {
  display: inline-grid;
  place-items: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, #229ed9, #65d7ff);
  box-shadow: 0 14px 36px rgba(34, 158, 217, 0.24);
  font-weight: 900;
  text-decoration: none;
}

@keyframes pulse {
  50% {
    transform: scale(1.08) rotate(4deg);
  }
}

.phone-shell {
  position: relative;
  z-index: 1;
  min-height: var(--app-height, 100vh);
  height: var(--app-height, 100vh);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: hidden;
}

.aurora-screen {
  position: relative;
  width: min(100%, 430px);
  height: min(900px, calc(var(--app-height, 100vh) - 36px));
  min-height: 680px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 36px;
  background:
    radial-gradient(circle at 18% 0%, rgba(125, 245, 197, 0.18), transparent 30%),
    radial-gradient(circle at 86% 2%, rgba(155, 140, 255, 0.28), transparent 34%),
    radial-gradient(circle at 96% 82%, rgba(101, 215, 255, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02) 34%, rgba(255, 255, 255, 0.04)),
    var(--screen);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px);
}

.aurora-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0 32%, rgba(255, 255, 255, 0.07) 42%, transparent 54%),
    radial-gradient(circle at 50% -10%, rgba(255, 255, 255, 0.08), transparent 34%);
  opacity: 0.65;
}

.top {
  position: relative;
  z-index: 1;
  min-height: 154px;
  padding: 20px 22px 0;
}

.version {
  float: right;
  border: 1px solid rgba(125, 245, 197, 0.38);
  border-radius: 999px;
  padding: 5px 10px;
  color: #06130f;
  background: linear-gradient(135deg, #7df5c5, #b9ffe4);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(125, 245, 197, 0.22);
}

.top p {
  margin: 58px 0 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.top h1 {
  margin: 0;
  max-width: 82%;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(155, 140, 255, 0.26);
}

.panel {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
  top: 154px;
  bottom: 92px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 52px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(22px);
  scrollbar-width: thin;
}

.aurora-screen.workspace .panel {
  top: 18px;
}

.aurora-screen.visitor .panel {
  bottom: 18px;
}

.panel-title {
  position: sticky;
  top: -16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -16px -16px 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(15, 17, 28, 0.78);
  backdrop-filter: blur(18px);
}

h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.panel-title button,
.row button {
  border: 1px solid var(--line);
  border-radius: 13px;
  min-width: 38px;
  min-height: 38px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border: 1px solid rgba(125, 245, 197, 0.18);
  border-radius: 999px;
  color: rgba(215, 255, 241, 0.72);
  background: rgba(125, 245, 197, 0.08);
  font-size: 12px;
}

p,
small {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.hero-card,
.card,
.metrics article,
.person,
.row {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: 26px;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(155, 140, 255, 0.32), transparent 68%);
}

.hero-card strong,
.hero-card span {
  position: relative;
  z-index: 1;
  display: block;
}

.hero-card strong {
  font-size: 24px;
  line-height: 1.05;
}

.hero-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.card {
  padding: 14px;
  border-radius: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card h2 {
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

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

.metrics article {
  min-height: 96px;
  padding: 14px;
  border-radius: 22px;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.metrics strong {
  display: block;
  margin-top: 7px;
  font-size: 30px;
  line-height: 1;
}

.metrics.mini strong {
  font-size: 32px;
}

.field {
  display: grid;
  gap: 7px;
  margin: 10px 0;
  scroll-margin-bottom: 140px;
}

.field > span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  padding: 12px 13px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-size: 16px;
}

select option {
  color: white;
  background: #111421;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(102, 215, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(102, 215, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

textarea {
  min-height: 124px;
  resize: vertical;
  line-height: 1.45;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  padding: 11px 15px;
  color: white;
  background: linear-gradient(135deg, #2f7dff, #66d7ff);
  box-shadow: 0 14px 36px rgba(47, 125, 255, 0.22);
  font-weight: 900;
  text-decoration: none;
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.16s ease, filter 0.16s ease, box-shadow 0.18s ease;
}

.btn input[type="file"] {
  display: none;
}

.btn:hover {
  filter: brightness(1.07);
}

.btn:active {
  transform: translateY(1px) scale(0.975);
}

.btn.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

.btn.danger {
  color: white;
  background: linear-gradient(135deg, #ff6f8d, #ff9aa8);
  box-shadow: 0 14px 34px rgba(255, 111, 141, 0.2);
}

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

.sending-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid rgba(101, 215, 255, 0.34);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(102, 215, 255, 0.18), rgba(215, 231, 255, 0.1)),
    rgba(255, 255, 255, 0.06);
}

.sending-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 30%, rgba(255, 255, 255, 0.18) 42%, transparent 55%);
  animation: sweep 1.35s ease-in-out infinite;
}

@keyframes sweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.sending-card b,
.sending-card small {
  position: relative;
  z-index: 1;
  display: block;
}

.spinner {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent-2);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.list,
.option-list {
  display: grid;
  gap: 8px;
}

.row,
.person {
  padding: 12px;
  border-radius: 18px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.person {
  display: grid;
  gap: 10px;
}

.person b,
.row b {
  color: rgba(255, 255, 255, 0.94);
}

.chips,
.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.045);
  font-size: 12px;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 5px 10px;
  border-color: var(--line-strong) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  font-size: 12px;
  font-weight: 700;
}

.role-chip.developer {
  color: #f6efff !important;
  background: linear-gradient(135deg, rgba(211, 188, 255, 0.46), rgba(164, 130, 255, 0.32), rgba(238, 198, 255, 0.38)) !important;
  border-color: rgba(211, 188, 255, 0.56) !important;
}

.role-name.developer {
  background: linear-gradient(135deg, #fbf7ff, #b68fff 48%, #f0c8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-chip.admin {
  color: #fff4c8 !important;
  background: linear-gradient(135deg, rgba(255, 230, 126, 0.46), rgba(246, 183, 55, 0.32), rgba(255, 245, 184, 0.38)) !important;
  border-color: rgba(255, 230, 126, 0.56) !important;
}

.role-name.admin {
  background: linear-gradient(135deg, #fff8d6, #f7ca48 48%, #f1a82d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-chip.user {
  color: #e3fff0 !important;
  background: linear-gradient(135deg, rgba(164, 244, 195, 0.44), rgba(74, 214, 135, 0.3), rgba(213, 252, 228, 0.34)) !important;
  border-color: rgba(164, 244, 195, 0.52) !important;
}

.role-name.user {
  background: linear-gradient(135deg, #effff7, #8ff2b8 48%, #4dd982);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-chip.subscriber {
  color: #e2f9ff !important;
  background: linear-gradient(135deg, rgba(156, 226, 255, 0.46), rgba(72, 191, 248, 0.32), rgba(213, 246, 255, 0.38)) !important;
  border-color: rgba(156, 226, 255, 0.56) !important;
}

.role-name.subscriber {
  background: linear-gradient(135deg, #e6faff, #83dcff 48%, #42c5f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-chip.left {
  color: #ffe9ed !important;
  background: linear-gradient(135deg, rgba(255, 183, 195, 0.46), rgba(246, 87, 114, 0.3), rgba(255, 224, 230, 0.36)) !important;
  border-color: rgba(255, 183, 195, 0.56) !important;
}

.role-name.left {
  background: linear-gradient(135deg, #ffe8ed, #ff92a5 48%, #f45675);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.role-chip.bot {
  color: #e8eefb !important;
  background: linear-gradient(135deg, rgba(218, 226, 244, 0.38), rgba(128, 151, 186, 0.26), rgba(241, 246, 255, 0.3)) !important;
  border-color: rgba(218, 226, 244, 0.5) !important;
}

.role-name.bot {
  background: linear-gradient(135deg, #f4f7ff, #b9c9ea 48%, #8199c2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.group-chip {
  color: #dffbef !important;
  border-color: rgba(187, 247, 208, 0.28) !important;
  background: linear-gradient(135deg, rgba(187, 247, 208, 0.18), rgba(134, 239, 172, 0.1)) !important;
}

.delta {
  display: block;
  margin-top: 8px;
  color: #8df4c6;
  font-weight: 800;
}

.result-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(125, 245, 197, 0.28);
  border-radius: 20px;
  background: rgba(125, 245, 197, 0.09);
  animation: pop-in 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.status-pending {
  color: #ffe08a;
  font-weight: 800;
}

.status-approved {
  color: #8df4c6;
  font-weight: 800;
}

.status-denied {
  color: #ff9aaa;
  font-weight: 800;
}

.result-card.warn {
  border-color: rgba(255, 209, 102, 0.3);
  background: rgba(255, 209, 102, 0.09);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

.staff-row {
  width: 100%;
  text-align: left;
}

.person.muted {
  border-color: rgba(255, 100, 115, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 100, 115, 0.12), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
}

.person.request {
  border-color: rgba(125, 245, 197, 0.22);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
  max-width: 100%;
}

.weekday-row button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.16s ease, background 0.16s ease;
}

.weekday-row button.active {
  color: white;
  border-color: rgba(102, 215, 255, 0.42);
  background: linear-gradient(135deg, rgba(47, 125, 255, 0.38), rgba(102, 215, 255, 0.24));
}

.db-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.weekday-row button:active {
  transform: scale(0.94);
}

.inline-actions .btn {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 13px;
}

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

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  color: var(--muted);
}

.check input {
  width: 18px;
  min-height: 18px;
  accent-color: #9b8cff;
}

.dropzone {
  position: relative;
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 18px;
  border: 1px dashed rgba(101, 215, 255, 0.48);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(101, 215, 255, 0.14), transparent 34%),
    rgba(255, 255, 255, 0.055);
}

.dropzone strong::before {
  content: "↑";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 8px;
  border-radius: 10px;
  color: #071018;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.7);
}

.inline-editor {
  display: grid;
  gap: 9px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
}

.inline-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px 104px 112px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
}

.inline-row button {
  border: 0;
  border-radius: 12px;
  min-height: 42px;
  font-size: 18px;
  color: white;
  background: var(--danger);
}

.compact .row {
  padding: 8px;
}

.compact {
  margin-top: 12px;
}

.field input[type="time"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
}

.message-preview {
  display: grid;
  gap: 12px;
}

.preview-text {
  color: rgba(255, 255, 255, 0.84);
  line-height: 1.45;
  white-space: pre-wrap;
}

.preview-media {
  display: grid;
  place-items: center;
  min-height: 120px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
}

.preview-media img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.preview-media.saved,
.preview-media.empty {
  gap: 4px;
  color: rgba(255, 255, 255, 0.72);
}

.preview-media small {
  color: rgba(255, 255, 255, 0.46);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  overflow: auto;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(100%, 390px);
  max-height: min(86vh, 720px);
  overflow: auto;
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 18px;
  background: rgba(17, 20, 33, 0.94);
  box-shadow: var(--shadow);
}

.mobile-nav {
  position: absolute;
  z-index: 4;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 24px;
  background: rgba(18, 20, 32, 0.72);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px);
}

.mobile-nav::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 23px;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.28), transparent 28%, transparent 64%, rgba(255, 255, 255, 0.1)),
    radial-gradient(circle at 18% 0%, rgba(102, 215, 255, 0.18), transparent 42%),
    radial-gradient(circle at 76% 20%, rgba(215, 231, 255, 0.14), transparent 48%);
  opacity: 0.8;
}

.mobile-nav button {
  position: relative;
  z-index: 1;
  min-width: 0;
  border: 0;
  border-radius: 17px;
  padding: 8px 2px 7px;
  color: var(--faint);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mobile-nav button.active {
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.22), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -10px 24px rgba(255, 255, 255, 0.04),
    0 10px 28px rgba(102, 215, 255, 0.16);
}

.mobile-nav button:active {
  transform: translateY(1px);
}

.nav-icon,
.mobile-nav small {
  display: block;
}

.nav-icon {
  width: 20px;
  height: 20px;
  margin: 0 auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.24));
}

.mobile-nav button.active .nav-icon {
  color: #dff9ff;
  filter: drop-shadow(0 0 10px rgba(101, 215, 255, 0.45));
}

.mobile-nav small {
  margin-top: 4px;
  color: currentColor;
  font-size: 9px;
  line-height: 1.05;
}

@media (min-width: 900px) {
  .phone-shell {
    align-items: start;
  }

  .aurora-screen {
    width: min(100%, 920px);
    height: calc(var(--app-height, 100vh) - 36px);
    border-radius: 30px;
  }

  .top {
    min-height: 142px;
  }

  .panel {
    left: 28px;
    right: 28px;
    top: 142px;
  }

  .aurora-screen.workspace .panel {
    top: max(10px, env(safe-area-inset-top));
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .person {
    grid-template-columns: 1fr auto auto;
    align-items: center;
  }
}

@media (max-width: 420px) {
  .phone-shell {
    padding: 0;
  }

  .aurora-screen {
    width: 100%;
    height: var(--app-height, 100vh);
    min-height: var(--app-height, 100vh);
    border: 0;
    border-radius: 0;
  }

  .top {
    min-height: 138px;
    padding: max(16px, env(safe-area-inset-top)) 16px 0;
  }

  .top p {
    margin-top: 48px;
  }

  .top h1 {
    font-size: 30px;
  }

  .panel {
    left: 10px;
    right: 10px;
    top: 138px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    padding: 14px;
    border-radius: 24px;
  }

  .panel-title {
    top: -14px;
    margin: -14px -14px 12px;
    padding: 14px;
  }

  .mobile-nav {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .metrics strong {
    font-size: 26px;
  }

  .searchbar {
    grid-template-columns: 1fr;
  }

  .inline-row {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 690px) {
  .top {
    min-height: 118px;
  }

  .top p {
    margin-top: 34px;
  }

  .top h1 {
    font-size: 27px;
  }

  .panel {
    top: 118px;
  }
}

/* Aurora 1.1 monochrome workspace */
:root {
  --bg: #050607;
  --screen: #090b0e;
  --panel: transparent;
  --card: rgba(255, 255, 255, 0.035);
  --card-2: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.09);
  --text: #f5f6f7;
  --muted: rgba(245, 246, 247, 0.58);
  --faint: rgba(245, 246, 247, 0.36);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #f4f4f2;
  --accent-2: #cfd5de;
  --danger: #ee4b58;
  --warning: #e5a73b;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

html,
body {
  min-height: 100%;
  background: #050607;
}

body {
  overflow: auto;
  background: linear-gradient(145deg, #030405 0%, #0b0e12 48%, #11161d 100%);
}

body::before,
body::after,
.aurora-screen::before {
  display: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: var(--app-height, 100vh);
  padding: 20px 22px 112px;
}

.aurora-screen,
.aurora-screen.workspace,
.aurora-screen.visitor {
  position: relative;
  width: min(1760px, 100%);
  height: auto;
  min-height: calc(var(--app-height, 100vh) - 136px);
  margin: 0 auto;
  overflow: visible;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(16, 19, 23, 0.97), rgba(7, 9, 11, 0.98));
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: none;
}

.app-header {
  min-height: 92px;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  align-items: center;
  gap: 28px;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: grid;
  gap: 4px;
}

.brand strong {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
}

.brand span,
.context-item small,
.workspace-title small {
  color: var(--muted);
}

.header-context {
  display: flex;
  align-items: stretch;
}

.context-item {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 3px 28px;
  border-left: 1px solid var(--line-strong);
}

.context-item .nav-icon {
  width: 23px;
  height: 23px;
  color: #e6e8ec;
}

.context-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.context-item b,
.context-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.version {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(154, 173, 201, 0.24);
  border-radius: 999px;
  color: #9aadc9;
  background: rgba(105, 126, 156, 0.1);
  font: 600 12px/1 Inter, sans-serif;
}

.refresh-button {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 25px;
  transition: transform 160ms ease, background 160ms ease;
}

.refresh-button:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(18deg);
}

.panel,
.aurora-screen.workspace .panel,
.aurora-screen.visitor .panel {
  position: static;
  inset: auto;
  min-height: 0;
  overflow: visible;
  padding: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.workspace-title h1 {
  margin: 2px 0 0;
  font-size: clamp(26px, 3vw, 40px);
}

.home-dashboard {
  display: grid;
  gap: 22px;
}

.welcome h1 {
  margin: 0 0 7px;
  font-size: clamp(30px, 3.1vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
}

.welcome-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 128px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
}

.metric-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #ebedf0;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
}

.metric-icon .nav-icon {
  width: 25px;
  height: 25px;
}

.metric-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.metric-card small,
.metric-card p {
  margin: 0;
  color: var(--muted);
}

.metric-card strong {
  font-size: clamp(28px, 2.7vw, 42px);
  line-height: 1;
}

.metric-card p {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1.15fr;
  gap: 14px;
  align-items: stretch;
}

.card,
.hero-card,
.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
  backdrop-filter: none;
}

.card {
  padding: 0 18px 18px;
}

.card-head {
  min-height: 54px;
  margin: 0 -18px 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.card h2 {
  font-size: 15px;
  letter-spacing: 0;
  text-transform: none;
}

.uptime,
.card-count,
.locked-label {
  color: var(--muted);
  font-size: 11px;
}

.overall-status {
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.overall-status > div {
  display: grid;
  gap: 4px;
}

.overall-status small {
  color: var(--muted);
}

.status-seal {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 25px;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.1);
}

.overall-status.warning .status-seal {
  color: var(--warning);
  border-color: var(--warning);
}

.system-list {
  display: grid;
}

.system-list > div {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  font-size: 12px;
}

.system-list > div:last-child {
  border: 0;
}

.healthy {
  color: #dfe5df;
}

.unhealthy {
  color: var(--danger);
}

.staff-list,
.event-list {
  display: grid;
}

.staff-list button {
  width: 100%;
  min-height: 67px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-align: left;
  background: transparent;
}

.staff-list button:last-child {
  border: 0;
}

.staff-list button div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.staff-list b,
.staff-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list small,
.last-active {
  color: var(--muted);
  font-size: 11px;
}

.event-row {
  min-height: 51px;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}

.event-row:last-child {
  border: 0;
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #aeb5bf;
}

.event-row.warning .event-dot {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(229, 167, 59, 0.45);
}

.event-row.danger .event-dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(238, 75, 88, 0.45);
}

.event-row div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.event-row b,
.event-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-row small,
.event-row time,
.empty-state {
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.events-detailed {
  grid-column: 1 / -1;
}

.user-avatar {
  width: 42px;
  height: 42px;
  display: block;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
  background: #171a1f;
}

.user-avatar.compact {
  width: 24px;
  height: 24px;
}

.presence {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.presence i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #757b84;
}

.presence.online {
  color: #8fd6aa;
}

.presence.online i {
  background: #4bc97b;
  box-shadow: 0 0 10px rgba(75, 201, 123, 0.55);
}

.person-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.person-identity > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.person-identity .presence {
  justify-content: flex-start;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.role-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 13px;
  font-weight: 800;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.3), 0 7px 18px rgba(0, 0, 0, 0.25);
}

.role-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.28), transparent 38%, rgba(255, 255, 255, 0.08) 62%, transparent);
}

.role-mark.compact {
  width: 22px;
  height: 22px;
  font-size: 8px;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25);
}

.role-mark.developer { background: linear-gradient(135deg, #7450cf, #b92d71 58%, #6a214e); }
.role-mark.admin { background: linear-gradient(135deg, #f1daa0, #b18a3e 55%, #715628); color: #201704; }
.role-mark.user { background: linear-gradient(135deg, #72d37b, #278a4e 62%, #176237); }
.role-mark.subscriber { background: linear-gradient(135deg, #52c5ef, #2379d0 58%, #194f9c); }
.role-mark.guest { background: linear-gradient(135deg, #8c929b, #4b5058 65%, #34373d); }
.role-mark.left { background: linear-gradient(135deg, #ed5664, #a20e2c 58%, #650919); }
.role-mark.bot { background: linear-gradient(135deg, #ffd0e0, #e783aa 58%, #b95683); color: #4b1630; }

.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 31px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #e8e9eb !important;
  background: rgba(255, 255, 255, 0.035) !important;
  -webkit-text-fill-color: initial !important;
}

.role-name.developer { background: linear-gradient(90deg, #a88af0, #df639b); }
.role-name.admin { background: linear-gradient(90deg, #f4dfa4, #b89248); }
.role-name.user { background: linear-gradient(90deg, #86de8c, #47a866); }
.role-name.subscriber { background: linear-gradient(90deg, #7bd8f5, #4b95e5); }
.role-name.guest { background: linear-gradient(90deg, #c6c8cc, #8f949b); }
.role-name.left { background: linear-gradient(90deg, #f06a75, #bd2942); }
.role-name.bot { background: linear-gradient(90deg, #ffd0e0, #e98db2); }

.role-name.developer,
.role-name.admin,
.role-name.user,
.role-name.subscriber,
.role-name.guest,
.role-name.left,
.role-name.bot {
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stack {
  width: 100%;
  max-width: none;
  gap: 14px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metrics article {
  min-height: 116px;
  padding: 18px;
}

.btn {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 7px;
  color: #090a0c;
  background: #f1f2f3;
  box-shadow: none;
  transition: transform 130ms ease, opacity 130ms ease, background 130ms ease;
}

.btn:hover {
  background: white;
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.975);
}

.btn.ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.035);
}

.btn.danger {
  color: white;
  border-color: rgba(238, 75, 88, 0.45);
  background: linear-gradient(135deg, #a91b31, #e74a58);
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.055);
}

.dropzone {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
}

.thumb img,
.thumb video,
.preview-media img,
.preview-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.readonly-group {
  min-height: 72px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.readonly-group div {
  display: grid;
  gap: 4px;
}

.readonly-group small,
.card-note {
  color: var(--muted);
}

.locked-label {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.topic-pill {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.topic-pill.primary {
  color: var(--text);
  border-color: var(--line-strong);
}

.notice.warning,
.result-card.warn,
.status-pending {
  color: #f0bd62;
  border-color: rgba(229, 167, 59, 0.4);
  background: rgba(229, 167, 59, 0.08);
}

.login-shell {
  background: linear-gradient(145deg, #030405 0%, #0b0e12 52%, #11161d 100%);
}

.login-card {
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px);
}

.telegram-oauth-btn {
  color: #090a0c;
  border-color: rgba(255, 255, 255, 0.82);
  background: #f2f3f4;
}

.status-denied,
.result-card.danger {
  color: #ff7982;
}

.mobile-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(650px, calc(100vw - 28px));
  height: 72px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 3px;
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(15, 17, 21, 0.88);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(22px) saturate(1.1);
}

.mobile-nav::before {
  display: none;
}

.mobile-nav button {
  min-width: 0;
  height: 56px;
  padding: 6px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.42);
  background: transparent;
  transition: transform 140ms ease, color 140ms ease, background 140ms ease;
}

.mobile-nav button.active {
  color: white;
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.1);
}

.mobile-nav button:active {
  transform: scale(0.93);
}

.mobile-nav .nav-icon {
  width: 21px;
  height: 21px;
}

.mobile-nav small {
  display: block;
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .app-header {
    grid-template-columns: 1fr auto;
  }

  .header-context {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }

  .context-item {
    min-width: 0;
    border-left: 0;
    padding: 0 18px 0 0;
  }

  .context-item + .context-item {
    padding-left: 18px;
    border-left: 1px solid var(--line);
  }

  .dashboard-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .events-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  html,
  body {
    scrollbar-width: none;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: none;
  }

  body {
    background: #080a0d;
  }

  .app-shell {
    padding: 0 0 100px;
  }

  .aurora-screen,
  .aurora-screen.workspace,
  .aurora-screen.visitor {
    width: 100%;
    min-height: var(--app-height, 100vh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .app-header {
    min-height: 74px;
    gap: 12px;
    padding: 14px 16px;
  }

  .brand strong {
    font-size: 23px;
  }

  .brand span {
    font-size: 11px;
  }

  .header-context {
    gap: 0;
    padding-top: 12px;
  }

  .context-item {
    gap: 9px;
  }

  .context-item .nav-icon {
    width: 19px;
    height: 19px;
  }

  .context-item b {
    font-size: 12px;
  }

  .context-item small {
    font-size: 9px;
  }

  .header-actions .version {
    display: none;
  }

  .refresh-button {
    width: 42px;
    height: 42px;
  }

  .panel,
  .aurora-screen.workspace .panel,
  .aurora-screen.visitor .panel {
    padding: 22px 14px;
  }

  .welcome h1 {
    font-size: 28px;
  }

  .dashboard-metrics,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .metric-card {
    min-height: 112px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
  }

  .metric-icon .nav-icon {
    width: 20px;
    height: 20px;
  }

  .metric-card strong {
    font-size: 27px;
  }

  .metric-card small,
  .metric-card p {
    font-size: 9px;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stats-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .events-card {
    grid-column: auto;
  }

  .card {
    padding: 0 14px 14px;
  }

  .card-head {
    margin: 0 -14px 13px;
    padding: 0 14px;
  }

  .staff-list button {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .last-active {
    grid-column: 2;
  }

  .event-row {
    grid-template-columns: 7px minmax(0, 1fr);
    padding: 8px 0;
  }

  .event-row time {
    grid-column: 2;
  }

  .readonly-group {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .readonly-group .metric-icon {
    width: 42px;
    height: 42px;
  }

  .locked-label {
    grid-column: 2;
    justify-self: start;
  }

  .mobile-nav {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    height: 68px;
    padding: 6px 4px;
    border-radius: 14px;
  }

  .mobile-nav button {
    height: 54px;
    padding-inline: 1px;
  }

  .mobile-nav .nav-icon {
    width: 19px;
    height: 19px;
  }

  .mobile-nav small {
    font-size: 8px;
  }
}

@media (max-width: 380px) {
  .panel,
  .aurora-screen.workspace .panel,
  .aurora-screen.visitor .panel {
    padding-inline: 10px;
  }

  .context-item small,
  .mobile-nav small {
    font-size: 7px;
  }

  .metric-card {
    grid-template-columns: 1fr;
  }

  .metric-icon {
    display: none;
  }
}

/* =========================================================
   Aurora — theme "Хвоя"
   Visual-only override. API and application logic untouched.
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #06100c;
  --screen: #08130f;
  --panel: #0b1712;
  --card: rgba(15, 35, 27, 0.72);
  --card-2: rgba(20, 45, 35, 0.78);
  --card-strong: rgba(28, 58, 46, 0.88);
  --text: #f1f6f2;
  --muted: #9eada4;
  --faint: #6f8077;
  --line: rgba(185, 218, 198, 0.11);
  --line-strong: rgba(192, 226, 205, 0.18);
  --accent: #8fc9a7;
  --accent-2: #5b9d77;
  --accent-3: #d4e9dc;
  --accent-soft: rgba(115, 176, 140, 0.12);
  --accent-soft-strong: rgba(115, 176, 140, 0.2);
  --danger: #ef7e83;
  --warning: #d7b56d;
  --success: #79c895;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(1000px 620px at 8% -8%, rgba(58, 122, 88, 0.19), transparent 60%),
    radial-gradient(800px 520px at 92% 8%, rgba(35, 79, 58, 0.14), transparent 64%),
    linear-gradient(160deg, #040a07 0%, #07110d 48%, #050b08 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

body::before,
body::after {
  display: block;
  width: 460px;
  height: 460px;
  opacity: 0.12;
  filter: blur(100px);
  animation: none;
}

body::before {
  left: -180px;
  top: -120px;
  background: #2f7852;
}

body::after {
  right: -200px;
  bottom: -180px;
  background: #224b36;
}

::selection {
  color: #07100c;
  background: #a9d5b9;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(143, 201, 167, 0.72);
  outline-offset: 2px;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: var(--app-height, 100vh);
  padding: clamp(14px, 2vw, 28px) clamp(14px, 2vw, 30px) 116px;
}

.aurora-screen,
.aurora-screen.workspace,
.aurora-screen.visitor {
  position: relative;
  width: min(1720px, 100%);
  height: auto;
  min-height: calc(var(--app-height, 100vh) - 150px);
  margin: 0 auto;
  overflow: clip;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(18, 39, 30, 0.52), rgba(7, 17, 12, 0.9) 34%),
    rgba(7, 16, 12, 0.94);
  box-shadow: var(--shadow), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(18px) saturate(1.05);
}

.aurora-screen::before {
  display: block;
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.018), transparent 22%, transparent 78%, rgba(111, 174, 137, 0.025)),
    radial-gradient(700px 260px at 34% 0%, rgba(98, 160, 123, 0.055), transparent 70%);
}

.app-header,
.panel,
.mobile-nav {
  position: relative;
  z-index: 1;
}

.app-header {
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: clamp(16px, 2.2vw, 32px);
  padding: 17px clamp(18px, 2.3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 14, 10, 0.4);
}

.brand {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.brand strong {
  color: #f4f8f5;
  font-size: clamp(25px, 2vw, 31px);
  font-weight: 760;
  line-height: 1;
  letter-spacing: -0.045em;
}

.brand span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-context {
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.context-item {
  min-width: min(225px, 19vw);
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 24px;
  border-left: 1px solid var(--line);
}

.context-item .nav-icon {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  color: #a6c8b3;
}

.context-item div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.context-item b,
.context-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.context-item b {
  color: #e8efe9;
  font-size: 12px;
  font-weight: 650;
}

.context-item small {
  color: var(--faint);
  font-size: 10px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.version {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  border: 1px solid rgba(143, 201, 167, 0.2);
  border-radius: 999px;
  color: #abc9b6;
  background: rgba(73, 133, 96, 0.1);
  box-shadow: none;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.refresh-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: #dce8df;
  background: rgba(255, 255, 255, 0.028);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  font-size: 22px;
  line-height: 1;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.refresh-button:hover {
  border-color: rgba(143, 201, 167, 0.3);
  background: var(--accent-soft);
  transform: rotate(18deg);
}

.panel,
.aurora-screen.workspace .panel,
.aurora-screen.visitor .panel {
  position: static;
  inset: auto;
  min-height: 0;
  overflow: visible;
  padding: clamp(18px, 2.2vw, 32px);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
}

.workspace-title small {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.workspace-title h1 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 720;
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.home-dashboard,
.stack {
  display: grid;
  gap: 16px;
}

.welcome {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 4px 2px 2px;
}

.welcome h1 {
  margin: 0;
  color: #f3f7f4;
  font-size: clamp(30px, 3.2vw, 47px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.welcome-role {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-metrics,
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.metrics article,
.card,
.hero-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(26, 52, 41, 0.42), rgba(9, 23, 17, 0.44)),
    rgba(8, 20, 15, 0.56);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.metric-card {
  min-width: 0;
  min-height: 124px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding: 18px;
  border-radius: var(--radius-lg);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.metric-card:hover {
  border-color: rgba(143, 201, 167, 0.2);
  background: linear-gradient(145deg, rgba(31, 61, 48, 0.5), rgba(10, 25, 19, 0.52));
  transform: translateY(-1px);
}

.metric-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(143, 201, 167, 0.16);
  border-radius: 14px;
  color: #afd2bb;
  background: rgba(100, 160, 124, 0.08);
}

.metric-icon .nav-icon {
  width: 23px;
  height: 23px;
}

.metric-card div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.metric-card small,
.metric-card p,
.metrics span,
.metrics small {
  margin: 0;
  color: var(--muted);
}

.metric-card small,
.metrics span {
  font-size: 11px;
  font-weight: 550;
}

.metric-card strong,
.metrics strong {
  overflow-wrap: anywhere;
  color: #f4f8f5;
  font-size: clamp(27px, 2.4vw, 39px);
  font-weight: 680;
  line-height: 1.03;
  letter-spacing: -0.045em;
}

.metric-card p {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.96fr 1.16fr;
  gap: 12px;
  align-items: stretch;
}

.card {
  min-width: 0;
  overflow: hidden;
  padding: 0 18px 18px;
  border-radius: var(--radius-lg);
}

.card-head {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -18px 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

.card h2,
.card-head h2 {
  min-width: 0;
  margin: 0;
  color: #edf3ee;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.card-count,
.uptime,
.locked-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
}

.overall-status {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 16px;
  border-bottom: 1px solid var(--line);
}

.status-seal {
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(121, 200, 149, 0.36);
  border-radius: 50%;
  color: var(--success);
  background: rgba(121, 200, 149, 0.07);
  box-shadow: 0 0 28px rgba(78, 145, 100, 0.1);
  font-size: 22px;
}

.overall-status > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.overall-status b {
  color: #e9f1eb;
  font-size: 13px;
}

.overall-status small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.overall-status.warning .status-seal {
  color: var(--warning);
  border-color: rgba(215, 181, 109, 0.38);
  background: rgba(215, 181, 109, 0.07);
}

.system-list,
.staff-list,
.event-list,
.list {
  display: grid;
}

.system-list > div {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(185, 218, 198, 0.075);
  font-size: 11px;
}

.system-list > div:last-child,
.staff-list button:last-child,
.event-row:last-child,
.row:last-child {
  border-bottom: 0;
}

.system-list span {
  color: var(--muted);
}

.healthy {
  color: #91d3a8;
}

.unhealthy {
  color: var(--danger);
}

.staff-list button {
  width: 100%;
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-align: left;
  background: transparent;
}

.staff-list button:hover {
  background: linear-gradient(90deg, transparent, rgba(120, 174, 140, 0.04), transparent);
}

.staff-list button div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.staff-list b,
.staff-list small,
.event-row b,
.event-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-list b,
.event-row b {
  color: #e9f0eb;
  font-size: 12px;
  font-weight: 600;
}

.staff-list small,
.last-active,
.event-row small,
.event-row time,
.empty-state {
  color: var(--muted);
  font-size: 10px;
}

.event-row {
  min-width: 0;
  min-height: 51px;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.event-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7f9a89;
}

.event-row.warning .event-dot {
  background: var(--warning);
  box-shadow: 0 0 12px rgba(215, 181, 109, 0.36);
}

.event-row.danger .event-dot {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(239, 126, 131, 0.36);
}

.event-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.event-row time {
  white-space: nowrap;
}

.empty-state {
  min-height: 140px;
  display: grid;
  place-items: center;
  text-align: center;
}

.events-detailed {
  grid-column: 1 / -1;
}

.metrics article {
  min-width: 0;
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 17px;
  border-radius: var(--radius-lg);
}

.metrics article .delta,
.delta {
  width: max-content;
  max-width: 100%;
  margin-top: 3px;
  padding: 4px 7px;
  border: 1px solid rgba(121, 200, 149, 0.14);
  border-radius: 999px;
  color: #9bd2ad;
  background: rgba(121, 200, 149, 0.06);
  font-size: 9px;
  white-space: normal;
}

.stats-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.row,
.person,
.result-card,
.notice,
.readonly-group,
.sending-card,
.message-preview {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.018);
}

.row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
}

.row > *,
.person > * {
  min-width: 0;
}

.row b,
.person b {
  overflow-wrap: anywhere;
}

.row button,
.panel-title button,
.inline-row button {
  flex: 0 0 auto;
  min-width: 38px;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.025);
}

.person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
}

.person.muted {
  opacity: 0.68;
}

.person.request {
  border-color: rgba(143, 201, 167, 0.19);
}

.person-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.person-identity > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.person-identity .presence {
  justify-content: flex-start;
}

.user-avatar,
.role-mark {
  box-shadow: none;
}

.user-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  object-fit: cover;
  background: #102019;
}

.user-avatar.compact {
  width: 24px;
  height: 24px;
}

.presence {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.presence i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #617168;
}

.presence.online {
  color: #87c99e;
}

.presence.online i {
  background: #65c184;
  box-shadow: 0 0 9px rgba(101, 193, 132, 0.48);
}

.role-mark {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(220, 239, 226, 0.13);
  border-radius: 50%;
  color: white;
  font-size: 12px;
  font-weight: 750;
}

.role-mark::after {
  opacity: 0.42;
}

.role-mark.compact {
  width: 22px;
  height: 22px;
  font-size: 8px;
}

.role-mark.developer { background: linear-gradient(145deg, #365d48, #173226); }
.role-mark.admin { background: linear-gradient(145deg, #6d6a45, #3e412a); }
.role-mark.user { background: linear-gradient(145deg, #407c57, #1d4e32); }
.role-mark.subscriber { background: linear-gradient(145deg, #3c7064, #1b443c); }
.role-mark.guest { background: linear-gradient(145deg, #59665e, #303a34); }
.role-mark.left { background: linear-gradient(145deg, #82484d, #4c2428); }
.role-mark.bot { background: linear-gradient(145deg, #6a5663, #3d3038); }

.role-name.developer,
.role-name.admin,
.role-name.user,
.role-name.subscriber,
.role-name.guest,
.role-name.left,
.role-name.bot {
  color: #e7efe9;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.role-name.developer { color: #a8d0b6; }
.role-name.admin { color: #d4c891; }
.role-name.user { color: #9ed5ae; }
.role-name.subscriber { color: #94cbbd; }
.role-name.guest { color: #bcc7bf; }
.role-name.left { color: #e19699; }
.role-name.bot { color: #c8adb9; }

.role-chip {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dfe8e2 !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.chips {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chips span {
  max-width: 100%;
}

.btn,
.telegram-oauth-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid rgba(163, 211, 180, 0.34);
  border-radius: 12px;
  color: #07110c;
  background: linear-gradient(180deg, #a9d5b9, #8fc9a7);
  box-shadow: 0 8px 22px rgba(40, 94, 62, 0.14), inset 0 1px rgba(255, 255, 255, 0.35);
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  transition: transform 140ms ease, filter 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover,
.telegram-oauth-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn:active,
.telegram-oauth-btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.35);
}

.btn.ghost {
  color: #e6eee8;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.026);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
}

.btn.ghost:hover {
  border-color: rgba(143, 201, 167, 0.25);
  background: var(--accent-soft);
}

.btn.danger {
  color: #ffecee;
  border-color: rgba(239, 126, 131, 0.3);
  background: rgba(123, 46, 51, 0.66);
  box-shadow: none;
}

.inline-actions,
.db-actions,
.searchbar,
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.inline-actions .btn,
.db-actions .btn,
.pager .btn {
  min-width: 0;
}

.db-actions .btn {
  flex: 1 1 150px;
}

.btn input[type="file"] {
  display: none;
}

.field {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.field > span,
.inline-title {
  color: #bac9bf;
  font-size: 11px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: #eef4f0;
  background: rgba(3, 12, 8, 0.48);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.015);
  outline: none;
}

textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.5;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #65776c;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(143, 201, 167, 0.48);
  box-shadow: 0 0 0 3px rgba(143, 201, 167, 0.07);
}

.searchbar > * {
  flex: 1 1 210px;
}

.option-list,
.weekday-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
}

.check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: #77b98e;
}

.weekday-row button {
  min-width: 42px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
}

.weekday-row button.active {
  color: #eaf3ed;
  border-color: rgba(143, 201, 167, 0.27);
  background: var(--accent-soft);
}

.dropzone {
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 16px;
  border: 1px dashed rgba(143, 201, 167, 0.25);
  border-radius: var(--radius-md);
  color: var(--muted);
  background: rgba(91, 157, 119, 0.035);
  text-align: center;
}

.dropzone:hover {
  border-color: rgba(143, 201, 167, 0.42);
  background: rgba(91, 157, 119, 0.06);
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 9px;
}

.thumb {
  position: relative;
  min-width: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #08110d;
}

.thumb img,
.thumb video,
.preview-media img,
.preview-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.thumb button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: white;
  background: rgba(3, 9, 6, 0.78);
}

.inline-editor,
.inline-row {
  display: grid;
  gap: 9px;
}

.inline-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
  align-items: center;
}

.readonly-group {
  min-height: 76px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
}

.readonly-group div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.readonly-group small,
.card-note {
  color: var(--muted);
}

.locked-label {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.topic-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.topic-pill {
  max-width: 100%;
  overflow: hidden;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.018);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-pill.primary {
  color: #dcebe1;
  border-color: rgba(143, 201, 167, 0.22);
  background: rgba(91, 157, 119, 0.07);
}

.message-preview {
  overflow: hidden;
  padding: 12px;
}

.preview-text {
  overflow-wrap: anywhere;
  color: #dce6df;
  line-height: 1.48;
  white-space: pre-wrap;
}

.preview-media {
  min-height: 130px;
  max-height: 340px;
  overflow: hidden;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #06100b;
}

.preview-media.empty,
.preview-media.saved {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.result-card,
.notice,
.sending-card {
  padding: 12px;
}

.notice.warning,
.result-card.warn,
.status-pending {
  color: #ddbf7c;
  border-color: rgba(215, 181, 109, 0.26);
  background: rgba(215, 181, 109, 0.065);
}

.result-card.danger,
.status-denied {
  color: #ee999d;
  border-color: rgba(239, 126, 131, 0.24);
  background: rgba(239, 126, 131, 0.055);
}

.status-approved {
  color: #91cfaa;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border-radius: var(--radius-lg);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto -80px -90px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(75, 137, 97, 0.08);
  filter: blur(22px);
  pointer-events: none;
}

.hero-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.12;
}

.hero-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 18px;
  background: rgba(1, 6, 3, 0.74);
  backdrop-filter: blur(12px);
}

.modal-card {
  width: min(600px, 100%);
  max-height: min(840px, calc(100vh - 36px));
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #0b1812;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
}

.modal-card h2 {
  margin: 0 0 14px;
}

.login-shell {
  min-height: var(--app-height, 100vh);
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(700px 500px at 20% 0%, rgba(63, 128, 91, 0.2), transparent 66%),
    linear-gradient(155deg, #040a07, #08140e 48%, #040a07);
}

.login-card {
  width: min(100%, 430px);
  display: grid;
  gap: 17px;
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(21, 44, 34, 0.7), rgba(7, 19, 13, 0.86));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(18px);
}

.login-card .version {
  width: max-content;
}

.login-card h1 {
  margin: 4px 0 0;
  color: #f1f6f2;
  font-size: clamp(28px, 7vw, 36px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.telegram-oauth-btn {
  width: 100%;
}

.mobile-nav {
  position: fixed;
  z-index: 50;
  left: 50%;
  right: auto;
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(700px, calc(100vw - 28px));
  height: 72px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 7px;
  transform: translateX(-50%);
  border: 1px solid rgba(191, 224, 203, 0.16);
  border-radius: 20px;
  background: rgba(7, 19, 13, 0.9);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.48), inset 0 1px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(22px) saturate(1.08);
}

.mobile-nav button {
  min-width: 0;
  height: 56px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 5px 3px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #718279;
  background: transparent;
  transition: transform 140ms ease, color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.mobile-nav button:hover {
  color: #a9b9b0;
}

.mobile-nav button.active {
  color: #dcebe1;
  border-color: rgba(143, 201, 167, 0.17);
  background: rgba(91, 157, 119, 0.1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.02);
}

.mobile-nav button:active {
  transform: scale(0.95);
}

.mobile-nav .nav-icon {
  width: 20px;
  height: 20px;
}

.mobile-nav small {
  width: 100%;
  overflow: hidden;
  color: inherit;
  font-size: 9px;
  font-weight: 550;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .header-context {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 13px;
    border-top: 1px solid var(--line);
  }

  .context-item {
    min-width: 0;
    max-width: none;
    padding: 0 16px 0 0;
    border-left: 0;
  }

  .context-item + .context-item {
    padding-left: 16px;
    border-left: 1px solid var(--line);
  }

  .dashboard-metrics,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .events-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  body::before,
  body::after {
    display: none;
  }

  .app-shell {
    padding: 0 0 calc(92px + env(safe-area-inset-bottom));
  }

  .aurora-screen,
  .aurora-screen.workspace,
  .aurora-screen.visitor {
    width: 100%;
    min-height: var(--app-height, 100vh);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: linear-gradient(180deg, #07120d 0%, #050d09 100%);
  }

  .aurora-screen::before {
    background: radial-gradient(420px 180px at 25% 0%, rgba(89, 153, 115, 0.08), transparent 70%);
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 70px;
    gap: 10px;
    padding: max(13px, env(safe-area-inset-top)) 14px 12px;
    border-bottom-color: rgba(185, 218, 198, 0.09);
    background: rgba(6, 16, 11, 0.84);
    backdrop-filter: blur(18px) saturate(1.05);
  }

  .brand strong {
    font-size: 24px;
  }

  .brand span {
    max-width: 220px;
    font-size: 10px;
  }

  .header-context {
    gap: 0;
    padding-top: 10px;
  }

  .context-item {
    gap: 8px;
    padding-right: 10px;
  }

  .context-item + .context-item {
    padding-left: 10px;
  }

  .context-item .nav-icon {
    width: 17px;
    height: 17px;
  }

  .context-item b {
    font-size: 10px;
  }

  .context-item small {
    font-size: 8px;
  }

  .header-actions .version {
    display: none;
  }

  .refresh-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .panel,
  .aurora-screen.workspace .panel,
  .aurora-screen.visitor .panel {
    padding: 20px 13px;
  }

  .workspace-title {
    margin-bottom: 16px;
  }

  .workspace-title h1 {
    font-size: 29px;
  }

  .welcome {
    display: grid;
    gap: 8px;
  }

  .welcome h1 {
    font-size: clamp(27px, 8vw, 34px);
  }

  .dashboard-metrics,
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .metric-card {
    min-height: 110px;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 9px;
    padding: 12px;
    border-radius: 15px;
  }

  .metric-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .metric-icon .nav-icon {
    width: 18px;
    height: 18px;
  }

  .metric-card strong,
  .metrics strong {
    font-size: clamp(24px, 7.4vw, 31px);
  }

  .metric-card small,
  .metric-card p,
  .metrics span,
  .metrics small {
    font-size: 9px;
  }

  .dashboard-grid,
  .stats-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .events-card {
    grid-column: auto;
  }

  .card {
    padding: 0 13px 13px;
    border-radius: 16px;
  }

  .card-head {
    min-height: 51px;
    margin: 0 -13px 13px;
    padding: 0 13px;
  }

  .row,
  .person {
    align-items: flex-start;
  }

  .person {
    grid-template-columns: minmax(0, 1fr);
  }

  .person > .inline-actions,
  .person > .btn,
  .person > button {
    width: 100%;
  }

  .staff-list button {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .staff-list button > .presence,
  .last-active {
    grid-column: 2;
    justify-content: flex-start;
  }

  .event-row {
    grid-template-columns: 7px minmax(0, 1fr);
    padding: 8px 0;
  }

  .event-row time {
    grid-column: 2;
  }

  .searchbar {
    align-items: stretch;
  }

  .searchbar > * {
    flex-basis: 100%;
  }

  .inline-row {
    grid-template-columns: 1fr;
  }

  .inline-row button {
    width: 100%;
  }

  .readonly-group {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .readonly-group .metric-icon {
    width: 42px;
    height: 42px;
  }

  .locked-label {
    grid-column: 2;
    justify-self: start;
  }

  .modal {
    place-items: end center;
    padding: 0;
  }

  .modal-card {
    width: 100%;
    max-height: min(88vh, 850px);
    padding: 18px 14px max(18px, env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }

  .mobile-nav {
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    height: 68px;
    gap: 2px;
    padding: 5px;
    border-radius: 18px;
  }

  .mobile-nav button {
    height: 56px;
    gap: 2px;
    padding-inline: 1px;
    border-radius: 12px;
  }

  .mobile-nav .nav-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-nav small {
    font-size: 7.5px;
  }

  .login-shell {
    padding: 14px;
  }

  .login-card {
    padding: 24px 20px;
    border-radius: 21px;
  }
}

@media (max-width: 430px) {
  .panel,
  .aurora-screen.workspace .panel,
  .aurora-screen.visitor .panel {
    padding-inline: 10px;
  }

  .brand span {
    max-width: 190px;
  }

  .dashboard-metrics,
  .metrics {
    gap: 7px;
  }

  .metric-card {
    min-height: 108px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .metric-card strong,
  .metrics strong {
    font-size: 24px;
  }

  .metrics article {
    min-height: 104px;
    padding: 12px;
  }

  .card {
    padding-inline: 12px;
  }

  .card-head {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  .presence {
    white-space: normal;
  }
}

@media (max-width: 360px) {
  .brand span,
  .context-item .nav-icon {
    display: none;
  }

  .app-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .context-item b {
    font-size: 9px;
  }

  .context-item small {
    font-size: 7px;
  }

  .metric-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-icon {
    display: none;
  }

  .mobile-nav small {
    font-size: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Incremental UI fixes after review ===== */
.brand {
  gap: 0;
}

.brand span {
  display: none;
}

.app-shell {
  padding-bottom: 154px;
}

.panel,
.aurora-screen.workspace .panel,
.aurora-screen.visitor .panel {
  padding-bottom: 142px;
}

.home-dashboard {
  gap: 18px;
}

.welcome {
  justify-content: flex-start;
  padding-right: 0;
}

.welcome h1 {
  max-width: 100%;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.card-actions .btn,
.card > .btn {
  max-width: 100%;
}

.stats-columns .card .btn,
.stats-columns .card .card-actions {
  margin-top: 14px;
}

@media (min-width: 1024px) {
  .dashboard-grid > .card {
    min-height: 368px;
  }
}

.person {
  grid-template-columns: minmax(0, 1fr) minmax(290px, auto);
  align-items: start;
  gap: 14px;
}

.person-side {
  min-width: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 10px;
}

.chips {
  justify-content: flex-end;
}

.role-chip,
.group-state,
.bot-state {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #dfe8e2;
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
}

.role-chip.developer {
  border-color: rgba(134, 194, 158, 0.3);
  background: rgba(93, 146, 114, 0.14);
  color: #cfe5d7 !important;
}

.role-chip.admin {
  border-color: rgba(213, 192, 123, 0.26);
  background: rgba(124, 104, 37, 0.18);
  color: #eadca8 !important;
}

.role-chip.user,
.role-chip.subscriber,
.role-chip.guest,
.role-chip.left,
.role-chip.bot {
  color: #dfe8e2 !important;
}

.group-state.in-group {
  border-color: rgba(134, 194, 158, 0.24);
  color: #cfe3d7;
  background: rgba(67, 114, 84, 0.16);
}

.group-state.out-group {
  border-color: rgba(204, 147, 150, 0.22);
  color: #e2bec1;
  background: rgba(102, 49, 53, 0.14);
}

.bot-state {
  color: #cfd7d2;
  background: rgba(91, 96, 92, 0.16);
}

.person .inline-actions {
  justify-content: flex-end;
}

.person .inline-actions .btn {
  min-width: 118px;
}

.group-chip {
  color: inherit;
}

select,
select option,
select optgroup {
  color-scheme: dark;
  background-color: #0c1712;
  color: #eaf1ec;
}

@media (max-width: 980px) {
  .person {
    grid-template-columns: minmax(0, 1fr);
  }

  .person-side {
    justify-items: start;
  }

  .chips,
  .person .inline-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .panel,
  .aurora-screen.workspace .panel,
  .aurora-screen.visitor .panel {
    padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .card-actions .btn,
  .person .inline-actions .btn,
  .inline-actions .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .chips {
    gap: 8px;
  }
}

/* Unified dropdown */
.custom-dropdown {
  width: 100%;
  min-width: 0;
}

.dropdown-trigger {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(5, 15, 10, 0.7);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.dropdown-trigger > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-dropdown.open .dropdown-trigger,
.dropdown-trigger:hover {
  border-color: rgba(143, 201, 167, 0.36);
  background: rgba(12, 29, 21, 0.92);
}

.dropdown-trigger:focus-visible {
  outline: 2px solid rgba(143, 201, 167, 0.62);
  outline-offset: 2px;
}

.dropdown-chevron {
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.custom-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: fixed;
  z-index: 1000;
  display: grid;
  gap: 3px;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(177, 218, 193, 0.2);
  border-radius: 14px;
  background: rgba(7, 20, 14, 0.98);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.52), inset 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px) saturate(1.08);
}

.dropdown-option {
  width: 100%;
  min-height: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  color: #dce8df;
  background: transparent;
  text-align: left;
}

.dropdown-option:hover,
.dropdown-option:focus-visible {
  outline: 0;
  color: #f3f8f4;
  background: rgba(117, 178, 141, 0.11);
}

.dropdown-option.selected {
  color: #d6ebde;
  background: rgba(117, 178, 141, 0.16);
}

.dropdown-option:disabled,
.custom-dropdown.disabled {
  opacity: 0.5;
}

.dropdown-check {
  color: var(--success);
  font-size: 13px;
}

.searchbar > .custom-dropdown {
  flex: 1 1 230px;
}

.inline-row > .custom-dropdown {
  min-width: 0;
}

@media (min-width: 1181px) and (min-height: 720px) {
  .aurora-screen:not(.workspace) .panel {
    min-height: calc(var(--app-height, 100vh) - 122px);
  }

  .home-dashboard {
    min-height: calc(var(--app-height, 100vh) - 312px);
    grid-template-rows: auto auto minmax(390px, 1fr);
  }

  .dashboard-grid {
    min-height: clamp(390px, 47vh, 590px);
  }

  .dashboard-grid > .card {
    height: 100%;
    min-height: 0;
  }

  .system-list {
    min-height: 248px;
    grid-template-rows: repeat(7, minmax(38px, 1fr));
  }

  .staff-list,
  .event-list {
    align-content: start;
  }
}

@media (max-width: 760px) {
  .dropdown-trigger {
    min-height: 46px;
  }

  .dropdown-option {
    min-height: 44px;
  }
}
