.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-page.auth-split {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 486px);
  gap: 72px;
}

.auth-hero {
  min-height: 650px;
  display: grid;
  align-content: center;
  gap: 120px;
}

.auth-hero-brand {
  position: fixed;
  top: 28px;
  left: 34px;
}

.auth-hero-copy {
  max-width: 620px;
}

.auth-hero-copy h1 {
  margin: 24px 0 20px;
  font-size: clamp(54px, 6vw, 84px);
  line-height: .98;
  max-width: 700px;
}

.auth-hero-copy p {
  max-width: 560px;
  color: var(--soft);
  font-size: 19px;
  line-height: 1.75;
}

.auth-badge {
  border-color: rgba(245,159,74,0.32);
  background: rgba(245,159,74,0.08);
  box-shadow: 0 0 32px rgba(245,159,74,0.08);
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.auth-proof span {
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,0.035);
  font-size: 13px;
  font-weight: 700;
}

.auth-card {
  width: min(486px, 100%);
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(245,159,74,0.12), transparent 36%),
    rgba(17, 24, 36, 0.92);
  box-shadow: 0 24px 80px rgba(0,0,0,0.46);
  backdrop-filter: blur(22px) saturate(150%);
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-card h1 {
  font-size: 44px;
  margin-bottom: 10px;
}

.auth-card p {
  color: var(--soft);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 26px 0 16px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  background: rgba(4, 8, 14, 0.78);
}

.auth-tab,
.link-btn {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 11px;
  cursor: pointer;
  font-weight: 800;
}

.auth-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0f14;
  border-color: transparent;
}

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

.oauth-btn {
  min-height: 44px;
  background: rgba(255,255,255,0.035);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text);
  border-color: rgba(255,255,255,0.12);
}

.oauth-btn:hover {
  border-color: rgba(245,159,74,0.45);
  background: rgba(245,159,74,0.08);
}

.oauth-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.google-icon {
  font-weight: 900;
  font-family: Arial, sans-serif;
  color: #f59f4a;
}

.github-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 18px 0;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form[hidden] {
  display: none !important;
}

.auth-alert {
  min-height: 22px;
  margin: 0 0 10px;
  color: var(--accent);
}

.code-input {
  text-align: center;
  font: 700 28px var(--mono);
  letter-spacing: .25em;
}

.verify-copy {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.verify-copy span {
  color: var(--muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.auth-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

label small {
  color: var(--muted);
  font-weight: 700;
  opacity: .72;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.dashboard-locked .workspace {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(4, 7, 11, 0.86);
  backdrop-filter: blur(18px);
}

.auth-gate-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.auth-gate strong {
  font-size: 18px;
}

.auth-gate span {
  color: var(--muted);
}

body:not(.dashboard-locked) .auth-gate {
  display: none;
}

.workspace-side {
  min-width: 0;
  padding: 28px 24px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 26%),
    rgba(5, 8, 13, 0.88);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-x: hidden;
}

.workspace-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.workspace-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.workspace-logo i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(245,159,74,.8);
}

.workspace-label {
  margin: 12px 0 -4px;
  color: var(--muted);
  font: 900 11px var(--mono);
  text-transform: uppercase;
  letter-spacing: .16em;
}

.workspace-label.main {
  margin-top: 20px;
}

.new-message-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #05080d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0,0,0,.28);
}

.new-message-btn span {
  font-size: 20px;
  line-height: 1;
}

.workspace-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: 2px;
}

.workspace-tab {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.035);
  color: var(--muted);
  padding: 10px 11px;
  text-align: center;
  cursor: pointer;
  font-weight: 900;
  font-size: 13px;
}

.workspace-tab.active {
  color: #0a0f14;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.conversation-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 6px -24px 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.conversation-tabs button {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 12px;
}

.conversation-tabs button.active {
  color: var(--accent);
  background: rgba(245,159,74,.12);
}

.conversation-tabs b {
  display: inline-grid;
  min-width: 18px;
  min-height: 18px;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: inherit;
  font: 900 11px var(--mono);
}

.conversation-list {
  min-width: 0;
  flex: 1;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
}

.conversation-item {
  min-width: 0;
  width: 100%;
  position: relative;
  padding: 14px 42px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  cursor: pointer;
  text-align: left;
}

.conversation-item.active,
.conversation-item:hover {
  border-color: var(--line-strong);
  background: rgba(245,159,74,0.08);
}

.conversation-item strong,
.conversation-item span {
  display: block;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-item span {
  color: var(--muted);
  font-size: 13px;
}

.conversation-item b {
  position: absolute;
  top: 9px;
  right: 9px;
  min-width: 21px;
  min-height: 21px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #0a0f14;
  font: 800 12px var(--mono);
}

.conversation-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
}

.conversation-empty strong {
  color: var(--soft);
  font-size: 18px;
}

.workspace-user {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding-top: 12px;
}

.workspace-user span {
  color: var(--muted);
  font-size: 13px;
}

.user-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.055);
}

.user-avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #ffe0a6);
  color: #070b10;
  font-weight: 900;
}

.user-chip div:last-child {
  min-width: 0;
}

.user-chip strong,
.user-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-actions {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pill-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
}

.workspace-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  height: 100vh;
  overflow: hidden;
}

.workspace-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.workspace-header h1 {
  margin: 10px 0 0;
  font-size: 36px;
}

.announcement-stack {
  display: grid;
  gap: 10px;
  padding: 14px 18px 0;
}

.announcement {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid rgba(245,159,74,0.25);
  border-radius: 8px;
  background: rgba(245,159,74,0.08);
}

.announcement strong {
  color: var(--text);
}

.announcement span {
  color: var(--soft);
}

.announcement.important {
  border-color: rgba(255,111,91,0.32);
  background: rgba(255,111,91,0.09);
}

.announcement.success {
  border-color: rgba(92,214,153,0.3);
  background: rgba(92,214,153,0.08);
}

.dashboard-view {
  display: none;
  min-height: 0;
}

.dashboard-view.active {
  display: block;
  min-height: 0;
  overflow: auto;
}

.dashboard-home {
  width: min(1180px, calc(100% - 36px));
  margin: 22px auto;
  display: grid;
  gap: 16px;
}

.home-hero {
  min-height: 190px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 20%, rgba(245,159,74,0.14), transparent 34%),
    linear-gradient(135deg, rgba(245,159,74,0.12), rgba(255,255,255,0.025) 42%, rgba(0,207,216,0.045)),
    rgba(255,255,255,0.03);
}

.home-hero h2 {
  margin: 12px 0 10px;
  font-size: clamp(34px, 4vw, 56px);
}

.home-hero p {
  max-width: 640px;
  color: var(--soft);
  line-height: 1.65;
}

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

.user-card,
.profile-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
}

.user-card {
  min-height: 132px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.04), transparent),
    rgba(255,255,255,0.03);
}

.user-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.user-card strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.user-card p,
.profile-panel p {
  color: var(--soft);
  line-height: 1.6;
}

.profile-panel {
  width: min(940px, calc(100% - 36px));
  margin: 22px auto;
  padding: 24px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.profile-panel .btn {
  justify-self: start;
  min-width: 240px;
}

.section-title {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.section-title h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
}

.home-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
}

.panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-title-row h2 {
  margin: 0;
  font-size: 20px;
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-item {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7,11,16,0.52);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.recent-item:hover {
  border-color: var(--line-strong);
}

.recent-item span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recent-item small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item b,
.recent-item em {
  flex: 0 0 auto;
  font-style: normal;
  color: var(--accent);
  font-weight: 800;
}

.chat-view.active {
  display: grid;
  overflow: hidden;
}

.chat-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 18px;
}

.chat-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.chat-toolbar[hidden] {
  display: none;
}

.btn.danger {
  color: #ffb0a6;
  border-color: rgba(255,111,91,0.28);
  background: rgba(255,111,91,0.08);
}

.download-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 14px;
  border-top: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7,11,16,0.36);
}

.download-row:first-of-type {
  border-top: 0;
}

.download-row div {
  display: grid;
  gap: 5px;
}

.download-row span {
  color: var(--muted);
}

.message-list {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.message {
  max-width: min(720px, 82%);
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--soft);
}

.message.user {
  align-self: flex-end;
  border-color: rgba(245,159,74,0.38);
  background: rgba(245,159,74,0.1);
}

.message.admin {
  align-self: flex-start;
}

.message small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font: 12px var(--mono);
}

.message-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(7, 11, 16, 0.45);
  color: var(--text);
}

.message-attachment img {
  display: block;
  max-width: min(100%, 420px);
  max-height: 280px;
  border-radius: 8px;
  object-fit: contain;
}

.message-attachment.media {
  display: block;
}

.message-attachment video,
.message-attachment audio {
  display: block;
  width: min(100%, 520px);
  max-height: 320px;
  border-radius: 8px;
}

.attachment-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.attachment-meta strong,
.attachment-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta span {
  color: var(--muted);
  font-size: 12px;
}

.message-form {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  background: rgba(5,8,13,0.62);
}

.file-preview {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--soft);
}

.attach-btn {
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.empty {
  color: var(--muted);
  text-align: center;
  margin: auto;
}

.new-dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
}

.new-dialog::backdrop {
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(8px);
}

.new-dialog form {
  display: grid;
  gap: 14px;
}

.dialog-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
}

@media (max-width: 820px) {
  .auth-page.auth-split {
    width: min(100% - 24px, 486px);
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .auth-hero {
    min-height: auto;
    gap: 22px;
    padding-top: 20px;
  }
  .auth-hero-brand {
    position: static;
  }
  .auth-hero-copy {
    display: none;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .workspace-side {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .workspace-main {
    height: auto;
    min-height: 70vh;
  }
  .user-grid {
    grid-template-columns: 1fr;
  }
  .download-row {
    align-items: start;
    flex-direction: column;
  }
  .message-form {
    grid-template-columns: 1fr;
  }
}
