.portal-shell {
  position: relative;
}

.portal-shell::before {
  content: "";
  position: fixed;
  inset: 72px auto auto 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 18%, rgba(23,75,118,.18), transparent 34%),
    radial-gradient(circle at 88% 28%, rgba(223,133,31,.16), transparent 30%);
  opacity: .8;
  z-index: -1;
}

.auth-panel > div:first-child {
  position: relative;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255,255,255,.42), rgba(255,255,255,.12));
  backdrop-filter: blur(10px);
}

.auth-panel > div:first-child h1 {
  max-width: 760px;
  color: #111315;
  text-wrap: balance;
}

.auth-panel > div:first-child h1 strong,
.auth-panel > div:first-child small {
  color: var(--orange);
}

.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::before,
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--blue), var(--orange));
}

.auth-card,
.panel {
  position: relative;
}

.workspace-head {
  padding: 22px;
  border: 1px solid rgba(255,255,255,.48);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 20%, rgba(23,75,118,.2), transparent 30%),
    radial-gradient(circle at 92% 80%, rgba(223,133,31,.18), transparent 32%),
    rgba(255,255,255,.78);
  box-shadow: 0 24px 60px rgba(27,53,72,.12);
  backdrop-filter: blur(12px);
}

.workspace-head h1 {
  color: var(--ink);
}

#logoutButton,
#refreshHistory,
.team-invite-form button,
.inline-form button,
.connection-form button {
  color: #fff0d9;
  background: linear-gradient(110deg, var(--blue), #102d45 58%, var(--orange));
  box-shadow: 0 12px 26px rgba(23,75,118,.18);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

#logoutButton:hover,
#refreshHistory:hover,
.team-invite-form button:hover,
.inline-form button:hover,
.connection-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(23,75,118,.24);
  filter: saturate(1.06);
}

.portal-grid .panel {
  min-height: 185px;
  overflow: hidden;
}

.portal-grid .panel:nth-child(1) {
  border-color: rgba(38,160,103,.22);
  background:
    radial-gradient(circle at 8% 10%, rgba(38,160,103,.16), transparent 30%),
    rgba(255,255,255,.94);
}

.portal-grid .panel:nth-child(2) {
  border-color: rgba(223,133,31,.24);
  background:
    radial-gradient(circle at 8% 10%, rgba(223,133,31,.16), transparent 30%),
    rgba(255,255,255,.94);
}

.portal-grid .panel:nth-child(3) {
  border-color: rgba(28,111,189,.24);
  background:
    radial-gradient(circle at 8% 10%, rgba(28,111,189,.16), transparent 30%),
    rgba(255,255,255,.94);
}

.portal-grid .panel > strong {
  color: var(--blue);
}

.chat-panel {
  overflow: hidden;
}

.chat-messages {
  border: 1px solid rgba(23,75,118,.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65);
}

.chat-message {
  box-shadow: 0 10px 22px rgba(17,19,21,.08);
}

.history-item {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.history-item:hover {
  transform: translateY(-2px);
  border-color: rgba(223,133,31,.26);
  box-shadow: 0 14px 30px rgba(27,53,72,.1);
}

.status.success {
  font-weight: 900;
}

.status.error {
  font-weight: 900;
}

html[data-theme="dark"] .auth-panel > div:first-child {
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(145deg, rgba(18,24,32,.9), rgba(12,17,23,.78));
}

html[data-theme="dark"] .auth-panel > div:first-child h1,
html[data-theme="dark"] .workspace-head h1 {
  color: #eef3f6;
}

html[data-theme="dark"] .workspace-head {
  border-color: rgba(255,255,255,.1);
  background:
    radial-gradient(circle at 8% 20%, rgba(28,111,189,.2), transparent 30%),
    radial-gradient(circle at 92% 80%, rgba(223,133,31,.16), transparent 32%),
    rgba(12,17,23,.86);
}

html[data-theme="dark"] .portal-grid .panel:nth-child(1),
html[data-theme="dark"] .portal-grid .panel:nth-child(2),
html[data-theme="dark"] .portal-grid .panel:nth-child(3) {
  background: linear-gradient(145deg, rgba(18,24,32,.96), rgba(12,17,23,.94));
}

html[data-theme="dark"] .portal-grid .panel > strong {
  color: #ffdca8;
}

html[data-theme="dark"] .chat-messages {
  border-color: rgba(255,255,255,.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

@media (max-width: 850px) {
  .auth-panel > div:first-child,
  .workspace-head {
    padding: 20px;
  }
}
