:root {
  color-scheme: dark;
  --bg: #080814;
  --bg-soft: #111128;
  --surface: rgba(18, 18, 42, 0.68);
  --surface-strong: rgba(23, 23, 54, 0.86);
  --text: #f4f2ff;
  --muted: #b9b4d8;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ff2fd2;
  --accent-2: #33f4ff;
  --accent-3: #8d55ff;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --max: 1180px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ff;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.74);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --text: #161326;
  --muted: #625d78;
  --line: rgba(28, 18, 58, 0.13);
  --shadow: 0 26px 80px rgba(83, 57, 135, 0.16);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

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

.site-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 47, 210, 0.16), transparent 28rem),
    radial-gradient(circle at 84% 20%, rgba(51, 244, 255, 0.16), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
}

.blob {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(40px);
  opacity: .36;
}

.blob-a {
  left: -10rem;
  top: 12rem;
  background: var(--accent);
}

.blob-b {
  right: -12rem;
  bottom: 4rem;
  background: var(--accent-2);
}

.grid {
  position: absolute;
  inset: 0;
  opacity: .18;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 0%, black, transparent 70%);
}

.header {
  position: sticky;
  top: 18px;
  z-index: 10;
  width: min(var(--max), calc(100% - 36px));
  margin: 18px auto 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -.03em;
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 13px rgba(255, 47, 210, 0.45));
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.nav a,
.theme-toggle {
  padding: 10px 14px;
  border-radius: 999px;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}

.nav a:hover,
.theme-toggle:hover {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  transform: translateY(-1px);
}

.theme-toggle {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 14px;
}

.theme-icon { color: var(--accent-2); }

.section-shell {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  min-height: calc(100vh - 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr);
  align-items: center;
  gap: 56px;
  padding: 84px 0 72px;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin-bottom: 24px;
  font-size: clamp(52px, 8vw, 104px);
  line-height: .9;
  letter-spacing: -.08em;
}

h1 span,
h2 span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .95;
  letter-spacing: -.06em;
}

h3 {
  font-size: 21px;
  margin-bottom: 10px;
  letter-spacing: -.03em;
}

.hero-text,
.split-section p,
.discord-copy p,
.cta p,
.info-card p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 18px;
}

.hero-text { max-width: 660px; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 34px 0 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 55%, var(--accent-2));
  color: white;
  box-shadow: 0 18px 42px rgba(255, 47, 210, .24), 0 0 22px rgba(51, 244, 255, .16);
}

.btn-secondary {
  background: rgba(255, 255, 255, .06);
  border-color: var(--line);
  color: var(--text);
}

.disabled {
  opacity: .62;
  cursor: not-allowed;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 700px;
}

.hero-stats div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.logo-card {
  position: relative;
  min-height: 560px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 44px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 47, 210, .18), transparent 16rem),
    radial-gradient(circle at 70% 64%, rgba(51, 244, 255, .12), transparent 13rem),
    var(--surface);
  backdrop-filter: blur(18px);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.logo-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.16), transparent 34%, rgba(255,255,255,.05));
  pointer-events: none;
}

.logo-orbit {
  position: absolute;
  width: min(72%, 380px);
  aspect-ratio: 1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 44px rgba(255, 47, 210, .18), 0 0 52px rgba(51, 244, 255, .12);
  animation: pulse 4s ease-in-out infinite;
}

.hero-logo {
  position: relative;
  width: min(78%, 440px);
  height: auto;
  filter:
    drop-shadow(0 0 18px rgba(255, 47, 210, .6))
    drop-shadow(0 0 26px rgba(51, 244, 255, .42));
  animation: float 5s ease-in-out infinite;
}

.split-section {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 38px;
  padding: 84px 0;
  border-top: 1px solid var(--line);
}

.cards-section { padding: 54px 0 92px; }

.section-head {
  max-width: 760px;
  margin-bottom: 34px;
}

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

.info-card,
.discord-panel,
.cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.info-card {
  padding: 28px;
}

.card-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 47, 210, .18), rgba(51, 244, 255, .18));
  color: var(--accent-2);
  font-weight: 900;
}

.discord-panel {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 32px;
  align-items: center;
  padding: 34px;
  margin-bottom: 96px;
  overflow: hidden;
}

.discord-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.discord-widget {
  position: relative;
  padding: 20px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04)),
    rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  overflow: hidden;
  isolation: isolate;
}

.discord-widget-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  right: -54px;
  top: -58px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(88, 101, 242, .55), transparent 68%);
  filter: blur(4px);
  z-index: -1;
}

.discord-widget-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.discord-widget-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(255, 47, 210, .42));
}

.discord-widget-head strong,
.discord-widget-head span {
  display: block;
}

.discord-widget-head span {
  color: var(--muted);
  font-size: 14px;
  margin-top: 3px;
}

.live-pill {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text) !important;
  background: rgba(51, 244, 255, .12);
  border: 1px solid rgba(51, 244, 255, .24);
  white-space: nowrap;
}

.invite-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
  border-radius: 20px;
  background: linear-gradient(90deg, rgba(255, 47, 210, .16), rgba(51, 244, 255, .10));
  border: 1px solid var(--line);
}

.invite-box span {
  color: var(--muted);
  font-size: 14px;
}

.invite-box strong {
  letter-spacing: .02em;
}

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

.channel-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  border: 1px solid transparent;
}

.channel-row span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent-2);
  background: rgba(255, 255, 255, .06);
  font-weight: 900;
}

.channel-row strong { color: var(--text); }
.channel-row small { color: var(--muted); }

.channel-row.active {
  border-color: rgba(255, 47, 210, .25);
  background: rgba(255, 47, 210, .10);
}

.discord-widget-button {
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #5865f2;
  color: white;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(88, 101, 242, .24);
  transition: transform .2s ease, box-shadow .2s ease;
}

.discord-widget-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(88, 101, 242, .32);
}

.cta {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 24px;
  margin-bottom: 58px;
}

.cta p { max-width: 560px; }

.footer {
  width: min(var(--max), calc(100% - 36px));
  margin: 0 auto;
  padding: 0 0 34px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.footer a { color: var(--text); }


.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

[hidden] { display: none !important; }

.internal-page .header {
  margin-bottom: 0;
}

.intern-main {
  min-height: calc(100vh - 168px);
  display: grid;
  place-items: center;
  padding: 78px 0 58px;
}

.login-shell {
  position: relative;
  width: min(520px, calc(100% - 36px));
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .035)),
    var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255,255,255,.18), transparent 38%, rgba(51,244,255,.08));
  pointer-events: none;
  z-index: -1;
}

.login-glow {
  position: absolute;
  width: 240px;
  height: 240px;
  left: 50%;
  top: -90px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 47, 210, .35), rgba(51, 244, 255, .18), transparent 70%);
  filter: blur(10px);
  z-index: -2;
}

.login-logo-wrap {
  width: 132px;
  height: 132px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 47, 210, .20), transparent 72%),
    rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 28px rgba(255, 47, 210, .10), 0 0 34px rgba(51, 244, 255, .12);
}

.login-logo {
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter:
    drop-shadow(0 0 16px rgba(255, 47, 210, .58))
    drop-shadow(0 0 18px rgba(51, 244, 255, .38));
  animation: logoWiggle 3.4s ease-in-out infinite;
}

.login-shell h1,
.team-hero h1 {
  margin-bottom: 16px;
  font-size: clamp(42px, 7vw, 74px);
  letter-spacing: -.07em;
}

.login-intro {
  max-width: 420px;
  margin: 0 auto 28px;
  color: var(--muted);
  line-height: 1.72;
}

.login-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

.login-form label {
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
}

.password-row input {
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0 14px;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.password-row input::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.password-row input[aria-invalid="true"] {
  color: #ff8bdc;
}

.password-row button {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 55%, var(--accent-2));
  color: white;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(255, 47, 210, .20);
  transition: transform .2s ease, box-shadow .2s ease;
}

.password-row button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 42px rgba(255, 47, 210, .26);
}

.login-feedback {
  min-height: 24px;
  margin: 4px 0 0;
  color: #ff83d7;
  font-weight: 800;
  text-align: center;
}

.login-shake {
  animation: loginShake .42s ease both;
}

.team-area {
  padding: 16px 0 48px;
}

.team-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 24px;
  padding: 34px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.team-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.75;
  font-size: 18px;
}

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

@keyframes logoWiggle {
  0%, 100% { transform: translateX(-5px) rotate(-1.2deg); }
  50% { transform: translateX(5px) rotate(1.2deg); }
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-10px) rotate(-.8deg); }
  30% { transform: translateX(9px) rotate(.8deg); }
  45% { transform: translateX(-7px) rotate(-.5deg); }
  60% { transform: translateX(6px) rotate(.5deg); }
  75% { transform: translateX(-3px); }
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal .7s ease forwards;
  animation-delay: var(--delay, 0s);
}

@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(.96); opacity: .72; }
  50% { transform: scale(1.05); opacity: 1; }
}

@media (max-width: 900px) {
  .header { border-radius: 28px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; justify-content: center; flex-wrap: wrap; }
  .hero,
  .split-section,
  .discord-panel { grid-template-columns: 1fr; }
  .hero { min-height: auto; padding-top: 58px; }
  .logo-card { min-height: 420px; }
  .cards-grid { grid-template-columns: 1fr; }
  .discord-panel { padding: 24px; }
  .discord-widget { width: 100%; }
  .team-hero,
  .team-grid { grid-template-columns: 1fr; }
  .team-hero { padding: 24px; }
}

@media (max-width: 620px) {
  .header { top: 10px; width: calc(100% - 20px); margin-top: 10px; }
  .section-shell { width: calc(100% - 28px); }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .nav a { padding: 8px 10px; font-size: 13px; }
  .theme-toggle span:last-child { display: none; }
  .logo-card { min-height: 330px; border-radius: 32px; }
  .footer { flex-direction: column; }
  .footer-links { gap: 12px; }
  .intern-main { padding-top: 46px; }
  .login-shell { width: calc(100% - 28px); padding: 26px; border-radius: 28px; }
  .password-row { grid-template-columns: 1fr; }
  .password-row input { min-height: 46px; text-align: center; }
  .password-row button { width: 100%; }
}

/* Internbereich: Voice + Chat Dashboard */
.internal-page .intern-main {
  min-height: calc(100vh - 168px);
  display: block;
  padding: 78px 0 58px;
}

.internal-page .login-shell { margin: 0 auto; }

.internal-page .team-area { padding: 16px 0 56px; }

.intern-hero-upgraded {
  position: relative;
  overflow: hidden;
}

.intern-hero-upgraded::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -90px;
  top: -110px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(88, 101, 242, .34), transparent 66%);
  pointer-events: none;
}

.team-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.team-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(51, 244, 255, .24);
  background: rgba(51, 244, 255, .10);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.team-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 14px rgba(51, 244, 255, .72);
}

.intern-dashboard-grid-upgraded {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
}

.discord-voice-card,
.team-chat-card {
  position: relative;
  min-height: 100%;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)),
    var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}

.discord-voice-card::before,
.team-chat-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), transparent 42%, rgba(88, 101, 242, .08));
  pointer-events: none;
  z-index: -1;
}

.panel-head,
.chat-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 12px;
}

.panel-head h2,
.chat-card-top h2 {
  margin-bottom: 0;
  font-size: clamp(34px, 4.4vw, 52px);
}

.panel-copy {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 22px;
}

.voice-live-pill,
.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.voice-live-pill::before,
.connection-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: .8;
}

.voice-live-pill.is-live,
.connection-pill.is-connected {
  background: rgba(35, 165, 90, .14);
  border-color: rgba(35, 165, 90, .34);
  color: #57f287;
  box-shadow: 0 0 22px rgba(87, 242, 135, .12);
}

.discord-voice-shell {
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(0, 1fr);
  gap: 12px;
  min-height: 540px;
  padding: 12px;
  border: 1px solid rgba(88, 101, 242, .20);
  border-radius: 28px;
  background:
    radial-gradient(circle at 0% 0%, rgba(88, 101, 242, .20), transparent 18rem),
    rgba(13, 14, 31, .54);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .035);
}

html[data-theme="light"] .discord-voice-shell {
  background:
    radial-gradient(circle at 0% 0%, rgba(88, 101, 242, .14), transparent 18rem),
    rgba(255, 255, 255, .50);
}

.voice-server-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 22px;
  background: rgba(19, 20, 32, .74);
  border: 1px solid rgba(255, 255, 255, .06);
}

html[data-theme="light"] .voice-server-list {
  background: rgba(243, 245, 255, .82);
}

.voice-category-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
}

.voice-category-row small {
  min-width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(88, 101, 242, .16);
  color: #9aa5ff;
  letter-spacing: 0;
}

.discord-room {
  width: 100%;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.discord-room:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
}

.discord-room.is-active {
  background: linear-gradient(90deg, rgba(88, 101, 242, .28), rgba(88, 101, 242, .10));
  border-color: rgba(88, 101, 242, .34);
  color: var(--text);
}

.room-caret {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-size: 11px;
}

.room-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  font-size: 14px;
}

.room-text strong,
.room-text small {
  display: block;
}

.room-text strong {
  color: inherit;
  font-size: 14px;
}

.room-text small {
  margin-top: 2px;
  color: color-mix(in srgb, var(--muted) 86%, transparent);
  font-size: 12px;
}

.discord-room em {
  min-width: 29px;
  min-height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  font-style: normal;
  font-weight: 950;
  font-size: 12px;
}

.voice-call-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 0%, rgba(51, 244, 255, .13), transparent 15rem),
    rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .075);
}

.voice-call-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.call-room-badge {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .80), rgba(51, 244, 255, .22));
  box-shadow: 0 16px 38px rgba(88, 101, 242, .22);
}

.voice-call-head strong,
.voice-call-head span {
  display: block;
}

.voice-call-head strong {
  font-size: 20px;
  letter-spacing: -.02em;
}

.voice-call-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.voice-members {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
  min-height: 238px;
  padding: 16px 0;
}

.voice-member {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 10px;
  min-width: 0;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .055);
  border: 1px solid rgba(255, 255, 255, .075);
  overflow: hidden;
}

.voice-member::after {
  content: "";
  position: absolute;
  inset: auto 12px 9px auto;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #57f287;
  box-shadow: 0 0 12px rgba(87, 242, 135, .62);
}

.voice-member > .voice-member-avatar {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .52), rgba(255, 47, 210, .18));
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 24px rgba(88, 101, 242, .13);
}

.voice-member .voice-member-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.voice-member small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.voice-member.is-you {
  border-color: rgba(87, 242, 135, .28);
  background: rgba(87, 242, 135, .08);
}

.voice-member.is-you > .voice-member-avatar,
.self-avatar {
  background: linear-gradient(135deg, #5865f2, #8d55ff 58%, #33f4ff);
  color: white;
  box-shadow: 0 0 24px rgba(88, 101, 242, .34);
}

.voice-member.is-speaking,
.self-avatar.is-speaking,
.voice-self-panel.is-speaking {
  border-color: rgba(87, 242, 135, .42);
  box-shadow: 0 0 0 3px rgba(87, 242, 135, .08), 0 0 30px rgba(87, 242, 135, .12);
}

.voice-empty-state {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, .13);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.voice-empty-state strong {
  color: var(--text);
  font-size: 18px;
}

.voice-self-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .085);
}

html[data-theme="light"] .voice-self-panel {
  background: rgba(255, 255, 255, .54);
}

.self-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-weight: 950;
  border: 1px solid transparent;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.self-copy strong,
.self-copy span {
  display: block;
}

.self-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.mic-meter {
  display: flex;
  align-items: end;
  gap: 4px;
  height: 24px;
  margin-top: 9px;
}

.mic-meter i {
  width: 7px;
  min-height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  transform-origin: bottom;
  transform: scaleY(.18);
  transition: background .08s ease, transform .08s ease;
}

.mic-meter i.is-active {
  background: linear-gradient(180deg, #57f287, #33f4ff);
  box-shadow: 0 0 12px rgba(87, 242, 135, .35);
}

.discord-controls {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.voice-control {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .2s ease, background .2s ease, opacity .2s ease, box-shadow .2s ease;
}

.voice-control:hover:not(:disabled) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .09);
}

.voice-control.primary {
  background: linear-gradient(135deg, #5865f2, #8d55ff 62%, #33f4ff);
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 36px rgba(88, 101, 242, .24);
}

.voice-control.ghost {
  color: var(--muted);
}

.voice-control.is-muted,
.voice-control.is-deafened {
  background: rgba(237, 66, 69, .14);
  border-color: rgba(237, 66, 69, .28);
  color: #ffb4b6;
}

.voice-control.is-pinging {
  animation: pingButton .7s ease;
}

.voice-control:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.voice-feedback {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.team-chat-card {
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.team-chat-card.is-ai-mode {
  border-color: rgba(26, 115, 232, .58);
  box-shadow: 0 28px 88px rgba(26, 115, 232, .18), var(--shadow);
}

.chat-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(26, 115, 232, .22);
  border-radius: 999px;
  background: rgba(26, 115, 232, .08);
}

.chat-mode-switch button {
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.chat-mode-switch button.is-active {
  background: linear-gradient(135deg, #1a73e8, #4d8dff);
  color: white;
  box-shadow: 0 12px 30px rgba(26, 115, 232, .24);
}

.team-chat-shell {
  border: 1px solid rgba(26, 115, 232, .34);
  border-radius: 28px;
  background:
    radial-gradient(circle at 12% 0%, rgba(26, 115, 232, .20), transparent 14rem),
    radial-gradient(circle at 84% 8%, rgba(51, 244, 255, .14), transparent 13rem),
    rgba(255, 255, 255, .055);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}

.gemini-chat-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.gemini-chat-head img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(51, 244, 255, .28));
}

.gemini-chat-head strong,
.gemini-chat-head span {
  display: block;
}

.gemini-chat-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.chat-online-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #59f7c8;
  box-shadow: 0 0 18px rgba(89, 247, 200, .7);
}

.chat-messages {
  height: 389px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  scrollbar-width: thin;
}

.chat-message {
  max-width: 88%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chat-message.is-me {
  align-self: flex-end;
  border-color: rgba(26, 115, 232, .34);
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, rgba(26, 115, 232, .86), rgba(77, 141, 255, .72));
  color: white;
}

.chat-message.is-ai {
  border-color: rgba(51, 244, 255, .26);
  background:
    radial-gradient(circle at 0% 0%, rgba(51, 244, 255, .16), transparent 8rem),
    rgba(255, 255, 255, .07);
}

.chat-message.is-typing span {
  animation: typingPulse 1s ease-in-out infinite;
}

.chat-message small {
  display: block;
  margin-bottom: 4px;
  opacity: .72;
  font-weight: 800;
}

.gemini-composer {
  position: relative;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .035);
}

.composer-input-shell {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background:
    linear-gradient(var(--surface-strong), var(--surface-strong)) padding-box,
    linear-gradient(110deg, rgba(255, 255, 255, .12), rgba(26, 115, 232, .40), rgba(51, 244, 255, .20), rgba(255, 255, 255, .12)) border-box;
  overflow: visible;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.composer-input-shell.is-ai-mode,
.composer-input-shell.is-focused {
  border-color: transparent;
  box-shadow: 0 0 0 4px rgba(26, 115, 232, .13), 0 0 42px rgba(26, 115, 232, .18);
}

.composer-input-shell.is-ai-mode .composer-aura,
.composer-input-shell.is-focused .composer-aura {
  opacity: 1;
}

.composer-aura {
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from var(--spin, 0deg), rgba(26, 115, 232, .0), rgba(26, 115, 232, .75), rgba(51, 244, 255, .62), rgba(255, 47, 210, .42), rgba(26, 115, 232, .0));
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  animation: composerSpin 4.8s linear infinite;
  transition: opacity .25s ease;
}

.composer-effect {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0 0 28px 28px;
  opacity: .0;
  transition: opacity .25s ease;
}

.team-chat-card.is-ai-mode .composer-effect,
.gemini-composer:focus-within .composer-effect {
  opacity: 1;
}

.composer-effect span {
  position: absolute;
  color: #8ab4ff;
  font-weight: 950;
  text-shadow: 0 0 16px rgba(26, 115, 232, .64);
  animation: plusFloat 3.5s ease-in-out infinite;
}

.composer-effect span:nth-child(1) { left: 7%; bottom: 22px; animation-delay: 0s; }
.composer-effect span:nth-child(2) { left: 22%; bottom: 60px; animation-delay: .35s; }
.composer-effect span:nth-child(3) { left: 44%; bottom: 30px; animation-delay: .7s; }
.composer-effect span:nth-child(4) { right: 27%; bottom: 64px; animation-delay: 1.05s; }
.composer-effect span:nth-child(5) { right: 14%; bottom: 26px; animation-delay: 1.4s; }
.composer-effect span:nth-child(6) { right: 8%; bottom: 68px; animation-delay: 1.75s; }

.composer-plus,
.composer-send {
  position: relative;
  z-index: 2;
  border: 0;
  color: white;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.composer-plus {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(26, 115, 232, .82);
  font-size: 25px;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(26, 115, 232, .18);
}

.composer-plus.is-open {
  background: linear-gradient(135deg, #1a73e8, #4d8dff);
  box-shadow: 0 12px 30px rgba(26, 115, 232, .28);
  transform: rotate(45deg);
}

.composer-input-shell input {
  position: relative;
  z-index: 2;
  min-width: 0;
  border: 0;
  outline: 0;
  border-radius: 999px;
  padding: 0 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.composer-input-shell input::placeholder {
  color: color-mix(in srgb, var(--muted) 74%, transparent);
}

.composer-send {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1a73e8, #4d8dff);
  box-shadow: 0 12px 30px rgba(26, 115, 232, .20);
  font-size: 20px;
}

.composer-send:hover,
.composer-plus:hover {
  transform: translateY(-1px);
}

.composer-plus.is-open:hover {
  transform: rotate(45deg) translateY(-1px);
}

.plus-menu {
  position: absolute;
  left: 7px;
  bottom: 66px;
  z-index: 5;
  min-width: 176px;
  padding: 8px;
  border: 1px solid rgba(26, 115, 232, .32);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

.plus-menu button {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.plus-menu button:hover {
  background: rgba(26, 115, 232, .14);
}

.intern-info-grid {
  margin-top: 0;
}

@keyframes composerSpin {
  to { --spin: 360deg; }
}

@keyframes plusFloat {
  0%, 100% { transform: translateY(12px) scale(.86); opacity: 0; }
  25% { opacity: .92; }
  55% { transform: translateY(-16px) scale(1.08); opacity: .72; }
  80% { opacity: .0; }
}

@keyframes typingPulse {
  0%, 100% { opacity: .45; }
  50% { opacity: 1; }
}

@keyframes pingButton {
  0% { box-shadow: 0 0 0 0 rgba(88, 101, 242, .38); }
  100% { box-shadow: 0 0 0 18px rgba(88, 101, 242, 0); }
}

@media (max-width: 1080px) {
  .intern-dashboard-grid-upgraded {
    grid-template-columns: 1fr;
  }

  .discord-voice-shell {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .internal-page .intern-main {
    padding-top: 58px;
  }

  .team-hero,
  .panel-head,
  .chat-card-top,
  .team-actions,
  .voice-call-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .team-actions {
    align-items: stretch;
  }

  .discord-voice-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .voice-server-list {
    max-height: none;
  }

  .voice-members {
    grid-template-columns: 1fr;
    min-height: 160px;
  }

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

  .discord-voice-card,
  .team-chat-card {
    padding: 22px;
  }

  .chat-mode-switch {
    width: 100%;
  }

  .chat-mode-switch button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .discord-controls {
    grid-template-columns: 1fr;
  }

  .voice-self-panel,
  .gemini-chat-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .composer-input-shell {
    grid-template-columns: auto 1fr auto;
    min-height: 54px;
  }

  .composer-plus,
  .composer-send {
    width: 40px;
    height: 40px;
  }

  .chat-messages {
    height: 330px;
  }
}

/* PHP Account-System & professionellere Intern-Zentrale */
.login-account-row {
  grid-template-columns: 1fr;
}

.login-account-row input {
  min-height: 46px;
}

.team-actions form {
  margin: 0;
}

.admin-flash {
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .07);
  color: var(--text);
  font-weight: 800;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .18);
}

.admin-flash-success {
  border-color: rgba(51, 244, 255, .32);
  color: var(--accent-2);
}

.admin-flash-error {
  border-color: rgba(255, 47, 210, .36);
  color: #ff8bdc;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.ops-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .035)), var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .16);
}

.ops-card span,
.ops-card small {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.ops-card strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-size: clamp(25px, 3vw, 36px);
  letter-spacing: -.04em;
}

.account-manager-card {
  position: relative;
  padding: 28px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)), var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-manager-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), transparent 42%, rgba(51, 244, 255, .07));
  pointer-events: none;
}

.account-manager-card > * {
  position: relative;
}

.owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(51, 244, 255, .26);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(51, 244, 255, .075);
  font-weight: 950;
}

.owner-badge::before {
  content: "●";
  font-size: 10px;
  filter: drop-shadow(0 0 8px rgba(51, 244, 255, .9));
}

.account-manager-layout {
  display: grid;
  grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-form,
.accounts-table-wrap {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0, 0, 0, .16);
}

.admin-form h3,
.accounts-table-wrap h3 {
  margin: 0 0 14px;
  font-size: 20px;
}

.admin-form label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 850;
  font-size: 13px;
}

.admin-form input,
.inline-password-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  padding: 0 13px;
  background: rgba(255, 255, 255, .065);
  color: var(--text);
  font: inherit;
}

.admin-form input:focus,
.inline-password-form input:focus {
  border-color: rgba(51, 244, 255, .42);
  box-shadow: 0 0 0 4px rgba(51, 244, 255, .09);
}

.admin-form button,
.inline-password-form button,
.danger-btn {
  min-height: 42px;
  border: 0;
  border-radius: 14px;
  padding: 0 14px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 55%, var(--accent-2));
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(88, 101, 242, .18);
}

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

.account-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(230px, .9fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, .045);
}

.account-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, rgba(88, 101, 242, .95), rgba(51, 244, 255, .65));
  font-weight: 950;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, .15);
}

.account-main strong,
.account-main small {
  display: block;
}

.account-main small {
  margin-top: 2px;
  color: var(--muted);
  font-weight: 800;
}

.inline-password-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 0;
}

.danger-btn {
  background: rgba(255, 63, 143, .16);
  color: #ff8bdc;
  border: 1px solid rgba(255, 63, 143, .24);
  box-shadow: none;
}

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

@media (max-width: 1060px) {
  .ops-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-manager-layout { grid-template-columns: 1fr; }
  .account-row { grid-template-columns: 1fr; }
  .inline-password-form { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .ops-grid { grid-template-columns: 1fr; }
  .account-manager-card { padding: 20px; }
}

/* Account-Login: Benutzername + Passwort, mit sichtbarem Fehlversuch-Wackeln */
.account-login-form {
  gap: 16px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.account-input-shell {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .045);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.account-input-shell:focus-within {
  border-color: rgba(51, 244, 255, .42);
  box-shadow: 0 0 0 4px rgba(51, 244, 255, .08), 0 0 28px rgba(88, 101, 242, .12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .045)),
    rgba(88, 101, 242, .08);
}

.account-input-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
}

.account-input-shell input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.account-input-shell input::placeholder {
  color: color-mix(in srgb, var(--muted) 72%, transparent);
  font-weight: 650;
}

.account-input-shell input[aria-invalid="true"] {
  color: #ff8bdc;
}

.login-submit {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 54%, var(--accent-2));
  color: white;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(255, 47, 210, .22), 0 0 34px rgba(51, 244, 255, .10);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-submit:hover {
  transform: translateY(-1px);
  filter: saturate(1.08);
  box-shadow: 0 22px 52px rgba(255, 47, 210, .28), 0 0 42px rgba(51, 244, 255, .16);
}

.login-shell.login-error-state {
  animation: loginRevealShake .72s cubic-bezier(.36,.07,.19,.97) both;
}

.login-shell.login-error-state .account-input-shell {
  border-color: rgba(255, 131, 215, .46);
  box-shadow: 0 0 0 4px rgba(255, 47, 210, .08), 0 0 28px rgba(255, 47, 210, .12);
}

@keyframes loginRevealShake {
  0% { opacity: 0; transform: translateY(16px); }
  20% { opacity: 1; transform: translateY(0); }
  32% { opacity: 1; transform: translateX(-12px) rotate(-.8deg); }
  44% { opacity: 1; transform: translateX(10px) rotate(.8deg); }
  56% { opacity: 1; transform: translateX(-8px) rotate(-.55deg); }
  68% { opacity: 1; transform: translateX(6px) rotate(.45deg); }
  82% { opacity: 1; transform: translateX(-3px); }
  100% { opacity: 1; transform: translateX(0); }
}

@media (max-width: 560px) {
  .account-input-shell { min-height: 54px; }
  .login-submit { min-height: 52px; }
}


/* Profile, Avatar, verifizierter Hauptaccount & Discord-Style Popouts */
.verified-badge {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #5865f2, #33f4ff);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  vertical-align: middle;
  box-shadow: 0 0 18px rgba(88, 101, 242, .34);
}

.verified-badge-js {
  flex: 0 0 auto;
}

.profile-settings-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .42fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 0 0, rgba(88, 101, 242, .18), transparent 16rem),
    linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)),
    var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-settings-preview {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.profile-preview-avatar,
.profile-popout-avatar,
.chat-avatar-button,
.voice-member-avatar,
.self-avatar,
.account-avatar {
  overflow: hidden;
}

.profile-preview-avatar,
.profile-popout-avatar,
.chat-avatar-button {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, #5865f2, #8d55ff 60%, #33f4ff);
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(88, 101, 242, .24);
}

.profile-preview-avatar {
  width: 86px;
  height: 86px;
  border-radius: 28px;
  font-size: 25px;
}

.profile-preview-avatar img,
.profile-popout-avatar img,
.chat-avatar-button img,
.voice-member-avatar img,
.self-avatar img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-settings-preview h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 8px;
  font-size: clamp(28px, 3vw, 42px);
}

.profile-settings-preview p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.profile-settings-form {
  display: grid;
  gap: 11px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0, 0, 0, .15);
}

.profile-settings-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.profile-settings-form textarea,
.profile-settings-form input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .065);
  color: var(--text);
  font: inherit;
  outline: 0;
}

.profile-settings-form textarea {
  min-height: 92px;
  resize: vertical;
  padding: 12px 13px;
}

.profile-settings-form input[type="file"] {
  padding: 11px;
}

.profile-settings-form textarea:focus,
.profile-settings-form input[type="file"]:focus {
  border-color: rgba(51, 244, 255, .42);
  box-shadow: 0 0 0 4px rgba(51, 244, 255, .09);
}

.profile-delete-avatar {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 9px !important;
}

.profile-delete-avatar input {
  width: auto;
}

.profile-settings-form button {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 55%, var(--accent-2));
  color: white;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(88, 101, 242, .20);
}

.account-avatar img {
  border-radius: inherit;
}

.account-main strong {
  display: flex;
  align-items: center;
  min-width: 0;
}

.profile-modal[hidden] {
  display: none;
}

.profile-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(10px);
}

.discord-profile-popout {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 28px;
  background: #11131e;
  color: #fff;
  box-shadow: 0 34px 110px rgba(0, 0, 0, .48);
  overflow: hidden;
  animation: profilePop .22s ease both;
}

html[data-theme="light"] .discord-profile-popout {
  background: #ffffff;
  color: #161823;
}

.profile-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  color: white;
  font-size: 22px;
  cursor: pointer;
}

.profile-banner {
  height: 116px;
  background:
    radial-gradient(circle at 18% 0%, rgba(51, 244, 255, .55), transparent 13rem),
    linear-gradient(135deg, #5865f2, #8d55ff 52%, #ff2fd2);
}

.profile-popout-body {
  position: relative;
  padding: 0 20px 20px;
}

.profile-popout-avatar {
  width: 104px;
  height: 104px;
  margin-top: -52px;
  border: 7px solid #11131e;
  border-radius: 34px;
  font-size: 28px;
}

html[data-theme="light"] .profile-popout-avatar {
  border-color: #fff;
}

.profile-popout-body h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0 2px;
  font-size: 30px;
  letter-spacing: -.04em;
}

.profile-role {
  margin: 0 0 14px;
  color: #b8bbca;
  font-weight: 850;
}

html[data-theme="light"] .profile-role {
  color: #5f6372;
}

.profile-about-box {
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 20px;
  background: rgba(255, 255, 255, .055);
}

html[data-theme="light"] .profile-about-box {
  border-color: rgba(20, 25, 40, .10);
  background: rgba(20, 25, 40, .04);
}

.profile-about-box strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #dbdeff;
}

html[data-theme="light"] .profile-about-box strong {
  color: #5865f2;
}

.profile-about-box p {
  margin: 0;
  color: #e5e7f2;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

html[data-theme="light"] .profile-about-box p {
  color: #202436;
}

body.profile-modal-open {
  overflow: hidden;
}

/* Chat mit klickbaren Discord-Profilen */
.chat-message {
  max-width: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.chat-message.is-me {
  align-self: stretch;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

.chat-message.is-me .chat-avatar-button {
  order: 2;
}

.chat-message.is-me .chat-bubble-content {
  justify-self: end;
  border-color: rgba(26, 115, 232, .34);
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(135deg, rgba(26, 115, 232, .86), rgba(77, 141, 255, .72));
  color: white;
}

.chat-message.is-me {
  grid-template-columns: minmax(0, 1fr) 42px;
}

.chat-avatar-button {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  align-self: end;
  font-size: 12px;
}

.chat-avatar-button span,
.profile-preview-avatar span,
.profile-popout-avatar span,
.voice-member-avatar span,
.self-avatar span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.chat-bubble-content {
  max-width: min(620px, 100%);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px 18px 18px 6px;
  background: rgba(255, 255, 255, .07);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.chat-message.is-ai .chat-bubble-content {
  border-color: rgba(51, 244, 255, .26);
  background:
    radial-gradient(circle at 0% 0%, rgba(51, 244, 255, .16), transparent 8rem),
    rgba(255, 255, 255, .07);
}

.chat-message.is-typing .chat-text {
  animation: typingPulse 1s ease-in-out infinite;
}

.chat-meta {
  display: flex !important;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 4px;
  opacity: .84;
  font-weight: 800;
}

.chat-author-button {
  display: inline-flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.chat-author-button:hover {
  text-decoration: underline;
}

.chat-text {
  display: block;
}

.voice-member {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, .075);
  text-align: left;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.voice-member:hover {
  transform: translateY(-1px);
  border-color: rgba(88, 101, 242, .30);
}

.voice-member > .voice-member-avatar {
  grid-row: 1 / 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .52), rgba(255, 47, 210, .18));
  color: var(--text);
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 0 24px rgba(88, 101, 242, .13);
}

.voice-member .voice-member-name {
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.voice-member .verified-badge {
  width: 16px;
  height: 16px;
  font-size: 10px;
  margin-left: 6px;
}

.self-avatar.has-profile-image,
.self-avatar:has(img) {
  background: transparent;
}

@keyframes profilePop {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 560px) {
  .profile-settings-preview { grid-template-columns: 1fr; }
  .profile-preview-avatar { width: 74px; height: 74px; border-radius: 24px; }
  .chat-message,
  .chat-message.is-me { grid-template-columns: 36px minmax(0, 1fr); }
  .chat-message.is-me .chat-avatar-button { order: 0; }
  .chat-message.is-me .chat-bubble-content { justify-self: stretch; }
  .chat-avatar-button { width: 36px; height: 36px; border-radius: 13px; }
}

/* Internbereich Update: eigene Navigation, Status, Account-Manager-Seite, Cropping & Voice-Fixes */
.internal-header {
  gap: 12px;
}

.internal-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.connected-status,
.team-only-pill,
.nav-icon-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .055);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.connected-status {
  position: relative;
  overflow: hidden;
  color: #57f287;
  border-color: rgba(87, 242, 135, .26);
  background: rgba(87, 242, 135, .09);
}

.connected-status::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #57f287, transparent);
  animation: connectedBar 1.55s ease-in-out infinite;
}

.connected-status i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #57f287;
  box-shadow: 0 0 16px rgba(87, 242, 135, .8);
}

.nav-icon-btn {
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.nav-icon-btn:hover,
.nav-icon-btn.is-active {
  transform: translateY(-1px);
  border-color: rgba(88, 101, 242, .36);
  background: rgba(88, 101, 242, .14);
  box-shadow: 0 10px 26px rgba(88, 101, 242, .13);
}

.nav-logout-form {
  margin: 0;
}

.nav-logout-btn {
  border-color: rgba(255, 95, 120, .18);
}

.nav-logout-btn:hover {
  border-color: rgba(255, 95, 120, .38);
  background: rgba(237, 66, 69, .13);
}

.nav-icon-btn svg,
.team-only-pill svg,
.account-input-icon svg,
.avatar-select-icon svg,
.room-icon svg,
.call-room-badge svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: 0 0 auto;
}

.team-only-pill svg {
  color: var(--accent-2);
}

@keyframes connectedBar {
  0%, 100% { transform: translateX(-45%); opacity: .38; }
  50% { transform: translateX(45%); opacity: 1; }
}

.team-hero-avatar {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(135deg, #5865f2, #8d55ff 60%, #33f4ff);
  color: #fff;
  font-size: 18px;
  font-weight: 950;
  overflow: hidden;
  box-shadow: 0 20px 52px rgba(88, 101, 242, .24);
}

.team-hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-settings-card-upgraded {
  grid-template-columns: minmax(0, 1fr) minmax(330px, .48fr);
}

.profile-preview-avatar-button {
  padding: 0;
  border: 0;
  border-radius: 28px;
  background: transparent;
  cursor: pointer;
}

.profile-preview-avatar-button:focus-visible,
.avatar-select-btn:focus-visible,
.avatar-crop-actions button:focus-visible {
  outline: 3px solid rgba(51, 244, 255, .45);
  outline-offset: 3px;
}

.profile-settings-form-upgraded {
  background: rgba(13, 14, 31, .42);
}

.avatar-upload-panel {
  display: grid;
  gap: 10px;
}

.avatar-select-btn {
  width: 100%;
  min-height: 74px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border: 1px dashed rgba(51, 244, 255, .36);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0 0, rgba(51, 244, 255, .13), transparent 10rem),
    rgba(255, 255, 255, .055);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.avatar-select-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(51, 244, 255, .58);
  background:
    radial-gradient(circle at 0 0, rgba(51, 244, 255, .18), transparent 10rem),
    rgba(88, 101, 242, .09);
}

.avatar-select-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(88, 101, 242, .88), rgba(51, 244, 255, .24));
  color: white;
  box-shadow: 0 12px 28px rgba(88, 101, 242, .20);
}

.avatar-select-btn strong,
.avatar-select-btn small {
  display: block;
}

.avatar-select-btn small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.clean-check {
  display: flex !important;
  align-items: center;
  gap: 9px !important;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
}

.avatar-crop-modal[hidden] { display: none; }

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 22px;
}

.avatar-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .66);
  backdrop-filter: blur(12px);
}

.avatar-crop-dialog {
  position: relative;
  width: min(530px, 100%);
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 30px;
  background:
    radial-gradient(circle at 15% 0, rgba(88, 101, 242, .24), transparent 16rem),
    #11131e;
  color: #fff;
  box-shadow: 0 34px 120px rgba(0, 0, 0, .52);
  animation: profilePop .22s ease both;
}

html[data-theme="light"] .avatar-crop-dialog {
  background: #fff;
  color: #161823;
}

.avatar-crop-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.avatar-crop-head h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
}

.avatar-crop-head button {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: inherit;
  font-size: 24px;
  cursor: pointer;
}

.avatar-crop-dialog > p {
  color: #c8cad8;
  line-height: 1.6;
}

html[data-theme="light"] .avatar-crop-dialog > p { color: #5f6372; }

.avatar-crop-stage {
  position: relative;
  width: min(390px, 100%);
  aspect-ratio: 1;
  margin: 14px auto;
  border-radius: 26px;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%),
    linear-gradient(45deg, rgba(255,255,255,.05) 25%, transparent 25%, transparent 75%, rgba(255,255,255,.05) 75%),
    rgba(0,0,0,.28);
  background-position: 0 0, 14px 14px;
  background-size: 28px 28px;
  touch-action: none;
  cursor: grab;
}

.avatar-crop-stage:active { cursor: grabbing; }

.avatar-crop-stage img {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  user-select: none;
  pointer-events: none;
  transform-origin: center;
}

.avatar-crop-frame {
  position: absolute;
  left: 11%;
  top: 11%;
  width: 78%;
  height: 78%;
  border-radius: 30px;
  border: 3px solid rgba(255, 255, 255, .92);
  box-shadow:
    0 0 0 999px rgba(0, 0, 0, .48),
    0 0 28px rgba(51, 244, 255, .28),
    inset 0 0 0 1px rgba(51, 244, 255, .32);
}

.avatar-zoom-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 850;
}

.avatar-zoom-label input { width: 100%; }

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.avatar-crop-actions .btn {
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3) 55%, var(--accent-2));
  color: white;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}

.avatar-crop-actions .btn-secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}

body.avatar-crop-open { overflow: hidden; }

/* Voice Raum-Buttons: Text bleibt sauber im Button */
.discord-room {
  grid-template-columns: 30px minmax(0, 1fr) 30px !important;
  min-width: 0;
  overflow: hidden;
}

.discord-room .room-caret { display: none; }

.room-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: #b9c2ff;
}

.room-text {
  min-width: 0;
  overflow: hidden;
}

.room-text strong,
.room-text small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discord-room em {
  min-width: 26px;
  min-height: 24px;
}

.call-room-badge {
  color: #fff;
}

.discord-controls {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.voice-control {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.voice-control.is-loading {
  cursor: wait;
  opacity: .78;
  animation: pingButton 1s ease infinite;
}

.account-hero .account-count-badge {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid rgba(88, 101, 242, .28);
  border-radius: 999px;
  background: rgba(88, 101, 242, .12);
  color: #b9c2ff;
  font-weight: 950;
}

.account-manager-page-card {
  margin-bottom: 18px;
}

.accounts-list-upgraded .account-row-upgraded {
  grid-template-columns: minmax(220px, 1fr) minmax(230px, .9fr) auto;
}

.account-bio-preview {
  display: block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .internal-header {
    border-radius: 28px;
    flex-wrap: wrap;
  }
  .internal-nav {
    order: 3;
    width: 100%;
    flex: 1 0 100%;
  }
  .profile-settings-card-upgraded {
    grid-template-columns: 1fr;
  }
  .accounts-list-upgraded .account-row-upgraded {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .internal-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .nav-icon-btn span,
  .connected-status span,
  .team-only-pill span {
    display: none;
  }
  .connected-status,
  .team-only-pill,
  .nav-icon-btn {
    min-width: 42px;
    padding: 0 12px;
  }
  .connected-status::after {
    left: 10px;
    right: 10px;
  }
  .avatar-crop-dialog {
    padding: 18px;
    border-radius: 24px;
  }
  .avatar-crop-actions {
    flex-direction: column;
  }
  .avatar-crop-actions .btn {
    width: 100%;
  }
}

/* Premium Intern-Design: hochwertiger Chat, KI-Stern & vergrößerbarer Modus */
.internal-page .site-bg {
  background:
    radial-gradient(circle at 12% 4%, rgba(88, 101, 242, .20), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(26, 115, 232, .16), transparent 32rem),
    radial-gradient(circle at 55% 94%, rgba(51, 244, 255, .10), transparent 26rem),
    linear-gradient(135deg, #070713, #101024 48%, #09091a);
}

html[data-theme="light"] .internal-page .site-bg {
  background:
    radial-gradient(circle at 12% 4%, rgba(88, 101, 242, .14), transparent 34rem),
    radial-gradient(circle at 88% 12%, rgba(26, 115, 232, .10), transparent 32rem),
    linear-gradient(135deg, #f6f8ff, #ffffff 48%, #f4f2ff);
}

.intern-hero-upgraded,
.profile-settings-card-upgraded,
.ops-card,
.discord-voice-card,
.team-chat-card {
  border-color: rgba(255, 255, 255, .105);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .026)),
    rgba(12, 13, 28, .68);
  box-shadow: 0 28px 95px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .055);
}

html[data-theme="light"] .intern-hero-upgraded,
html[data-theme="light"] .profile-settings-card-upgraded,
html[data-theme="light"] .ops-card,
html[data-theme="light"] .discord-voice-card,
html[data-theme="light"] .team-chat-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .68)),
    rgba(255, 255, 255, .86);
  box-shadow: 0 28px 80px rgba(79, 70, 120, .12), inset 0 1px 0 rgba(255, 255, 255, .8);
}

.team-chat-card.premium-chat-card {
  padding: 26px;
  transition: grid-column .28s ease, border-color .28s ease, box-shadow .28s ease, transform .28s ease;
}

.team-chat-card.premium-chat-card::after {
  content: "";
  position: absolute;
  inset: auto 18px 18px 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138, 180, 255, .35), transparent);
  pointer-events: none;
}

.team-chat-card.is-ai-mode {
  border-color: rgba(138, 180, 255, .50);
  box-shadow: 0 28px 95px rgba(26, 115, 232, .18), 0 0 0 1px rgba(138, 180, 255, .10) inset;
}

.team-chat-card.is-expanded {
  grid-column: 1 / -1;
}

.premium-chat-top {
  align-items: center;
}

.chat-title-block h2 {
  font-size: clamp(30px, 3.7vw, 46px);
  letter-spacing: -.065em;
}

.chat-panel-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.premium-mode-switch {
  border-color: rgba(138, 180, 255, .18);
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.premium-mode-switch button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: color-mix(in srgb, var(--muted) 86%, white);
}

.premium-mode-switch button.is-active {
  background: linear-gradient(135deg, rgba(26, 115, 232, .98), rgba(86, 133, 255, .92));
  box-shadow: 0 12px 32px rgba(26, 115, 232, .28), inset 0 1px 0 rgba(255, 255, 255, .26);
}

.mode-spark,
.ai-chat-star,
.ai-star-symbol,
.chat-expand-btn svg,
.composer-send svg,
.clean-card-icon svg {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.mode-spark svg,
.ai-chat-star svg,
.ai-star-symbol svg,
.chat-expand-btn svg,
.composer-send svg,
.clean-card-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.chat-expand-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(138, 180, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .045);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.chat-expand-btn:hover,
.chat-expand-btn.is-active {
  transform: translateY(-1px);
  border-color: rgba(138, 180, 255, .42);
  background: rgba(26, 115, 232, .12);
  box-shadow: 0 14px 34px rgba(26, 115, 232, .16);
}

.premium-gemini-chat {
  position: relative;
  border-radius: 30px;
  border-color: rgba(138, 180, 255, .22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .050), rgba(255, 255, 255, .020)),
    rgba(8, 9, 20, .78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 24px 70px rgba(0, 0, 0, .18);
  isolation: isolate;
}

html[data-theme="light"] .premium-gemini-chat {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(248, 250, 255, .84)),
    rgba(255, 255, 255, .85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 24px 70px rgba(75, 86, 140, .10);
}

.premium-gemini-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 16%, rgba(138, 180, 255, .16), transparent 18rem),
    radial-gradient(circle at 86% 76%, rgba(51, 244, 255, .08), transparent 18rem);
  opacity: .78;
}

.premium-chat-head {
  position: relative;
  z-index: 2;
  grid-template-columns: auto 1fr auto;
  padding: 16px 16px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .050), transparent);
}

.chat-head-avatar {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: linear-gradient(145deg, rgba(88, 101, 242, .20), rgba(12, 13, 30, .58));
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.chat-head-avatar .chat-server-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(51, 244, 255, .24));
}

.ai-chat-star {
  display: none;
  width: 24px;
  height: 24px;
  color: #8ab4ff;
  filter: drop-shadow(0 0 18px rgba(138, 180, 255, .64));
}

.team-chat-card.is-ai-mode .chat-server-logo {
  display: none;
}

.team-chat-card.is-ai-mode .ai-chat-star {
  display: grid;
}

.chat-online-dot {
  position: relative;
  width: 13px;
  height: 13px;
  background: #57f287;
  box-shadow: 0 0 0 4px rgba(87, 242, 135, .08), 0 0 18px rgba(87, 242, 135, .52);
}

.chat-online-dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1px solid rgba(87, 242, 135, .20);
  animation: premiumPulse 2.2s ease-in-out infinite;
}

.chat-messages {
  position: relative;
  z-index: 2;
  height: 430px;
  padding: 18px 16px 20px;
  gap: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .012), transparent 20%, transparent 82%, rgba(26, 115, 232, .025));
}

.team-chat-card.is-expanded .chat-messages {
  height: min(68vh, 720px);
}

.team-chat-card.is-expanded .premium-gemini-chat {
  min-height: min(82vh, 860px);
}

.chat-bubble-content {
  border-color: rgba(255, 255, 255, .085);
  background: rgba(255, 255, 255, .052);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

html[data-theme="light"] .chat-bubble-content {
  border-color: rgba(17, 24, 39, .085);
  background: rgba(255, 255, 255, .82);
}

.chat-message.is-me .chat-bubble-content {
  background: linear-gradient(135deg, rgba(26, 115, 232, .96), rgba(85, 137, 255, .86));
  box-shadow: 0 14px 34px rgba(26, 115, 232, .16), inset 0 1px 0 rgba(255, 255, 255, .18);
}

.chat-message.is-ai .chat-bubble-content {
  border-color: rgba(138, 180, 255, .26);
  background:
    linear-gradient(180deg, rgba(138, 180, 255, .105), rgba(255, 255, 255, .045)),
    rgba(255, 255, 255, .045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 16px 44px rgba(26, 115, 232, .08);
}

html[data-theme="light"] .chat-message.is-ai .chat-bubble-content {
  background:
    linear-gradient(180deg, rgba(232, 240, 254, .95), rgba(255, 255, 255, .88)),
    white;
}

.chat-ai-avatar {
  color: #8ab4ff;
  background:
    radial-gradient(circle at 34% 20%, rgba(255, 255, 255, .25), transparent 1.7rem),
    linear-gradient(145deg, rgba(26, 115, 232, .96), rgba(64, 88, 255, .72));
  border: 1px solid rgba(138, 180, 255, .34);
  box-shadow: 0 16px 36px rgba(26, 115, 232, .20), 0 0 0 4px rgba(138, 180, 255, .06);
}

.ai-star-symbol {
  width: 21px;
  height: 21px;
  color: white;
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, .40));
}

.chat-author-button.is-ai-author {
  gap: 6px;
  color: #b9ccff;
  cursor: default;
  text-decoration: none !important;
}

.chat-author-button.is-ai-author .ai-star-symbol {
  width: 15px;
  height: 15px;
  color: #8ab4ff;
}

.gemini-composer {
  position: relative;
  z-index: 3;
  padding: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .012), rgba(255, 255, 255, .052));
}

.premium-composer-shell {
  min-height: 62px;
  padding: 8px;
  border-radius: 26px;
  background:
    linear-gradient(rgba(14, 15, 32, .94), rgba(14, 15, 32, .94)) padding-box,
    linear-gradient(115deg, rgba(255, 255, 255, .12), rgba(138, 180, 255, .32), rgba(51, 244, 255, .16), rgba(255, 255, 255, .10)) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .060);
}

html[data-theme="light"] .premium-composer-shell {
  background:
    linear-gradient(rgba(255, 255, 255, .96), rgba(255, 255, 255, .96)) padding-box,
    linear-gradient(115deg, rgba(17, 24, 39, .08), rgba(138, 180, 255, .42), rgba(51, 244, 255, .22), rgba(17, 24, 39, .08)) border-box;
}

.premium-composer-shell.is-ai-mode,
.premium-composer-shell.is-focused {
  box-shadow: 0 0 0 4px rgba(138, 180, 255, .10), 0 0 48px rgba(26, 115, 232, .20), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.composer-plus,
.composer-send {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 18px;
}

.composer-plus {
  background: rgba(255, 255, 255, .070);
  color: #dbe5ff;
  border: 1px solid rgba(255, 255, 255, .075);
  box-shadow: none;
}

.composer-plus.is-open,
.composer-plus:hover {
  background: rgba(26, 115, 232, .18);
  border-color: rgba(138, 180, 255, .30);
  color: white;
}

.composer-send {
  background: linear-gradient(145deg, #1a73e8, #5d8dff);
  box-shadow: 0 14px 34px rgba(26, 115, 232, .23), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.composer-send svg {
  width: 20px;
  height: 20px;
}

.composer-input-shell input {
  font-size: 15px;
  padding: 0 10px;
}

.plus-menu {
  bottom: 76px;
  border-color: rgba(138, 180, 255, .25);
  background: rgba(18, 19, 38, .92);
}

html[data-theme="light"] .plus-menu {
  background: rgba(255, 255, 255, .94);
}

.composer-effect {
  display: none;
}

.chat-plus-field {
  position: absolute;
  inset: 68px 0 74px;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity .32s ease;
  mask-image: linear-gradient(180deg, transparent, black 14%, black 78%, transparent);
}

.team-chat-card.is-ai-mode .chat-plus-field,
.team-chat-card:has(.premium-composer-shell.is-focused) .chat-plus-field {
  opacity: 1;
}

.chat-plus-field span {
  position: absolute;
  bottom: -32px;
  color: #8ab4ff;
  font-weight: 950;
  font-size: clamp(16px, 2.1vw, 28px);
  opacity: 0;
  text-shadow: 0 0 16px rgba(138, 180, 255, .55);
  animation: premiumPlusFlow 5.8s ease-in-out infinite;
}

.chat-plus-field span:nth-child(1) { left: 8%; animation-delay: .0s; }
.chat-plus-field span:nth-child(2) { left: 18%; animation-delay: .7s; font-size: 18px; }
.chat-plus-field span:nth-child(3) { left: 31%; animation-delay: 1.4s; }
.chat-plus-field span:nth-child(4) { left: 42%; animation-delay: .35s; font-size: 21px; }
.chat-plus-field span:nth-child(5) { left: 54%; animation-delay: 1.05s; }
.chat-plus-field span:nth-child(6) { left: 64%; animation-delay: 1.75s; font-size: 18px; }
.chat-plus-field span:nth-child(7) { left: 73%; animation-delay: 2.1s; }
.chat-plus-field span:nth-child(8) { left: 84%; animation-delay: .9s; font-size: 20px; }
.chat-plus-field span:nth-child(9) { left: 91%; animation-delay: 2.8s; }
.chat-plus-field span:nth-child(10) { left: 25%; animation-delay: 3.2s; font-size: 16px; }

.clean-card-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(88, 101, 242, .20), rgba(51, 244, 255, .07));
  color: #b9c8ff;
  border: 1px solid rgba(138, 180, 255, .14);
  font-size: 0;
}

.premium-info-grid .info-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .025)),
    rgba(12, 13, 28, .58);
  border-color: rgba(255, 255, 255, .095);
}

html[data-theme="light"] .premium-info-grid .info-card {
  background: rgba(255, 255, 255, .76);
}

@keyframes premiumPlusFlow {
  0% { transform: translateY(0) scale(.75) rotate(0deg); opacity: 0; }
  16% { opacity: .88; }
  56% { opacity: .58; }
  100% { transform: translateY(-390px) scale(1.15) rotate(16deg); opacity: 0; }
}

@keyframes premiumPulse {
  0%, 100% { transform: scale(.72); opacity: .2; }
  50% { transform: scale(1.1); opacity: .55; }
}

@media (max-width: 760px) {
  .chat-panel-actions {
    width: 100%;
    justify-content: stretch;
  }

  .premium-mode-switch {
    flex: 1 1 220px;
  }

  .chat-expand-btn {
    flex: 0 0 auto;
  }

  .premium-chat-head {
    grid-template-columns: auto 1fr auto;
  }

  .team-chat-card.is-expanded .chat-messages {
    height: min(65vh, 610px);
  }
}

@media (max-width: 520px) {
  .team-chat-card.premium-chat-card {
    padding: 18px;
  }

  .chat-expand-btn span {
    display: none;
  }

  .premium-composer-shell {
    border-radius: 22px;
  }

  .composer-plus,
  .composer-send {
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }
}

/* Chat resize stability fix: enlarged chat opens as a polished overlay instead of moving the dashboard grid. */
body.chat-expanded-lock {
  overflow: hidden;
}

.chat-expand-btn {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: max-content !important;
  min-width: 0 !important;
  white-space: nowrap;
  align-self: center;
}

.chat-expand-btn > svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  display: block !important;
  flex: 0 0 18px !important;
  fill: currentColor;
}

.team-chat-card.is-expanded {
  position: fixed !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 1200 !important;
  width: min(1120px, calc(100vw - 42px)) !important;
  height: min(840px, calc(100vh - 42px)) !important;
  max-height: calc(100vh - 42px) !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: column !important;
  grid-column: auto !important;
  margin: 0 !important;
  padding: 24px !important;
  overflow: hidden !important;
  box-shadow:
    0 0 0 9999px rgba(3, 4, 12, .72),
    0 36px 130px rgba(0, 0, 0, .62),
    0 0 0 1px rgba(138, 180, 255, .18) inset !important;
}

html[data-theme="light"] .team-chat-card.is-expanded {
  box-shadow:
    0 0 0 9999px rgba(238, 242, 255, .76),
    0 34px 100px rgba(65, 77, 135, .22),
    0 0 0 1px rgba(26, 115, 232, .14) inset !important;
}

.team-chat-card.is-expanded .premium-chat-top {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.team-chat-card.is-expanded .panel-copy {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.team-chat-card.is-expanded .premium-gemini-chat {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

.team-chat-card.is-expanded .premium-chat-head {
  flex: 0 0 auto;
}

.team-chat-card.is-expanded .chat-messages {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
}

.team-chat-card.is-expanded .gemini-composer {
  flex: 0 0 auto;
}

.team-chat-card.is-expanded .chat-plus-field {
  inset: 74px 0 88px;
}

.team-chat-card.is-expanded .chat-expand-btn {
  background: rgba(237, 66, 69, .12);
  border-color: rgba(237, 66, 69, .28);
}

@media (max-width: 760px) {
  .team-chat-card.is-expanded {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 20px) !important;
    max-height: calc(100vh - 20px) !important;
    padding: 16px !important;
    border-radius: 24px !important;
  }

  .team-chat-card.is-expanded .premium-chat-top {
    align-items: flex-start;
  }

  .team-chat-card.is-expanded .chat-panel-actions {
    justify-content: space-between;
  }
}

/* Final chat overlay + KI effect hardening
   Fixes expanded chat overflow caused by inherited min-height and keeps the AI plus field behind messages. */
.team-chat-card.is-expanded {
  min-height: 0 !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  contain: layout paint !important;
}

.team-chat-card.is-expanded .premium-chat-top,
.team-chat-card.is-expanded .panel-copy,
.team-chat-card.is-expanded .gemini-composer,
.team-chat-card.is-expanded .premium-chat-head {
  min-height: 0 !important;
}

.team-chat-card.is-expanded .premium-gemini-chat {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden !important;
}

.team-chat-card.is-expanded .chat-messages {
  flex: 1 1 0 !important;
  min-height: 180px !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
}

.team-chat-card.is-expanded .chat-card-top h2 {
  font-size: clamp(26px, 3vw, 38px);
}

.premium-gemini-chat {
  overflow: hidden !important;
}

.chat-plus-field {
  z-index: 0 !important;
  opacity: 0 !important;
  filter: blur(.1px);
}

.team-chat-card.is-ai-mode .chat-plus-field,
.team-chat-card:has(.premium-composer-shell.is-focused) .chat-plus-field {
  opacity: .34 !important;
}

.chat-plus-field span {
  opacity: 0;
  color: rgba(138, 180, 255, .58) !important;
  text-shadow: 0 0 18px rgba(138, 180, 255, .42) !important;
}

.chat-messages,
.chat-message,
.chat-bubble-content,
.gemini-composer,
.premium-chat-head {
  position: relative;
}

.chat-messages {
  z-index: 2 !important;
}

.chat-message {
  z-index: 4 !important;
}

.chat-bubble-content {
  z-index: 5 !important;
  background: rgba(21, 23, 42, .92) !important;
  backdrop-filter: blur(8px);
}

.chat-message.is-ai .chat-bubble-content {
  background:
    linear-gradient(180deg, rgba(138, 180, 255, .15), rgba(34, 39, 67, .94)),
    rgba(21, 23, 42, .96) !important;
}

html[data-theme="light"] .chat-bubble-content {
  background: rgba(255, 255, 255, .94) !important;
}

html[data-theme="light"] .chat-message.is-ai .chat-bubble-content {
  background:
    linear-gradient(180deg, rgba(232, 240, 254, .98), rgba(255, 255, 255, .95)),
    #fff !important;
}

.chat-ai-avatar {
  position: relative;
  z-index: 6 !important;
}

@media (max-width: 760px) {
  .team-chat-card.is-expanded {
    min-height: 0 !important;
  }

  .team-chat-card.is-expanded .chat-card-top h2 {
    font-size: 28px;
  }
}

/* KI chat row cleanup: only the bubble should have a visible surface, not the full message row. */
.chat-message.is-ai,
.chat-message.is-ai.is-typing {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Fixed overlay must not be captured by the reveal transform of the Intern section. */
body.chat-expanded-lock .team-area.reveal,
body.chat-expanded-lock .section-shell.reveal {
  transform: none !important;
}

/* WebRTC voice reliability polish */
.voice-control.needs-unlock {
  border-color: rgba(51, 244, 255, .45);
  background: linear-gradient(135deg, rgba(88, 101, 242, .18), rgba(51, 244, 255, .12));
  color: #dffbff;
  box-shadow: 0 0 0 1px rgba(51, 244, 255, .12), 0 12px 30px rgba(51, 244, 255, .12);
  animation: voiceUnlockPulse 1.5s ease-in-out infinite;
}

@keyframes voiceUnlockPulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1px); }
}

/* Voice stability / diagnostics */
.remote-audio-box {
  position: fixed;
  left: -9999px;
  bottom: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.voice-debug-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 18px;
  background: rgba(2, 6, 23, .28);
  color: var(--muted);
}

html[data-theme="light"] .voice-debug-panel {
  background: rgba(255, 255, 255, .58);
}

.voice-debug-title {
  color: var(--text);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.voice-debug-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
  font-size: 12px;
  line-height: 1.45;
}

.voice-debug-entry {
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .045);
  border: 1px solid rgba(255, 255, 255, .06);
}

.voice-debug-entry.is-ok {
  color: #a9f7c8;
  border-color: rgba(87, 242, 135, .18);
  background: rgba(87, 242, 135, .07);
}

.voice-debug-entry.is-warn {
  color: #ffe0a3;
  border-color: rgba(254, 231, 92, .18);
  background: rgba(254, 231, 92, .07);
}

.voice-debug-entry.is-error {
  color: #ffb4b6;
  border-color: rgba(237, 66, 69, .22);
  background: rgba(237, 66, 69, .09);
}

.voice-control.danger-lite:hover:not(:disabled) {
  border-color: rgba(237, 66, 69, .28);
  color: #ffb4b6;
}

.voice-member small[data-tone="ok"] { color: #9df4bd; }
.voice-member small[data-tone="warn"] { color: #ffe0a3; }
.voice-member small[data-tone="error"] { color: #ffb4b6; }

/* Voice Upgrade: sprechende Person, Mic-Status und sauberer Großmodus */
.voice-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.voice-expand-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: auto !important;
  min-width: 0 !important;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .065);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.voice-expand-btn svg {
  display: block;
  width: 15px !important;
  height: 15px !important;
  min-width: 15px;
  flex: 0 0 15px;
  fill: currentColor;
  pointer-events: none;
}

.voice-expand-btn:hover,
.voice-expand-btn.is-active {
  transform: translateY(-1px);
  border-color: rgba(51, 244, 255, .34);
  background: rgba(88, 101, 242, .16);
  box-shadow: 0 16px 34px rgba(51, 244, 255, .10);
}

body.voice-expanded-lock {
  overflow: hidden;
}

body.voice-expanded-lock::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 799;
  background: rgba(5, 6, 16, .78);
  backdrop-filter: blur(18px);
}

.discord-voice-card.is-expanded {
  position: fixed !important;
  inset: 24px;
  z-index: 800;
  display: flex;
  flex-direction: column;
  width: auto !important;
  max-width: 1380px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 30px;
  padding: clamp(18px, 2vw, 30px);
  background:
    radial-gradient(circle at 8% 0%, rgba(88, 101, 242, .24), transparent 30rem),
    radial-gradient(circle at 95% 14%, rgba(51, 244, 255, .18), transparent 30rem),
    linear-gradient(180deg, rgba(20, 22, 44, .98), rgba(8, 9, 23, .98));
  box-shadow: 0 44px 130px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 255, 255, .10) inset;
}

.discord-voice-card.is-expanded .panel-copy {
  max-width: 980px;
  margin-bottom: 18px;
}

.discord-voice-card.is-expanded .discord-voice-shell {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
}

.discord-voice-card.is-expanded .voice-server-list,
.discord-voice-card.is-expanded .voice-call-panel {
  min-height: 0;
}

.discord-voice-card.is-expanded .voice-call-panel {
  overflow: hidden;
}

.discord-voice-card.is-expanded .voice-members {
  min-height: 0;
  overflow: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-right: 4px;
}

.voice-member {
  isolation: isolate;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.voice-member::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  opacity: 0;
  background:
    radial-gradient(circle at 16% 50%, rgba(87, 242, 135, calc(.18 + var(--voice-level, .12) * .32)), transparent 8rem),
    linear-gradient(135deg, rgba(87, 242, 135, .20), rgba(51, 244, 255, .08));
  transition: opacity .18s ease;
}

.voice-member.is-speaking {
  border-color: rgba(87, 242, 135, .62) !important;
  background: rgba(87, 242, 135, .09) !important;
  box-shadow: 0 0 0 3px rgba(87, 242, 135, .10), 0 0 calc(26px + var(--voice-level, .2) * 34px) rgba(87, 242, 135, .22) !important;
}

.voice-member.is-speaking::before {
  opacity: 1;
}

.voice-member.is-speaking > .voice-member-avatar {
  box-shadow: 0 0 0 3px rgba(87, 242, 135, .22), 0 0 calc(22px + var(--voice-level, .2) * 34px) rgba(87, 242, 135, .42) !important;
}

.voice-member.is-muted {
  opacity: .78;
}

.voice-member.is-muted::after {
  background: #ed4245;
  box-shadow: 0 0 12px rgba(237, 66, 69, .45);
}

.voice-member-badges {
  grid-column: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.voice-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .10);
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1;
}

.voice-member-badge.is-on {
  border-color: rgba(87, 242, 135, .22);
  background: rgba(87, 242, 135, .08);
  color: #9df4bd;
}

.voice-member-badge.is-off {
  border-color: rgba(237, 66, 69, .24);
  background: rgba(237, 66, 69, .10);
  color: #ffb4b6;
}

.voice-status-icon,
.voice-status-icon svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: currentColor;
  flex: 0 0 12px;
}

@media (max-width: 980px) {
  .discord-voice-card.is-expanded {
    inset: 12px;
    border-radius: 24px;
  }

  .discord-voice-card.is-expanded .discord-voice-shell {
    grid-template-columns: 1fr;
  }

  .discord-voice-card.is-expanded .voice-members {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .discord-voice-card.is-expanded {
    inset: 8px;
    padding: 14px;
  }

  .voice-panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .discord-voice-card.is-expanded .voice-members {
    grid-template-columns: 1fr;
  }

  .voice-expand-btn span {
    display: none;
  }
}

/* Voice fullscreen + status fix */
body.voice-expanded-lock .team-area.reveal,
body.voice-expanded-lock .section-shell.reveal,
body.voice-expanded-lock .intern-dashboard-grid,
body.voice-expanded-lock .intern-dashboard-grid-upgraded {
  transform: none !important;
}

body.voice-expanded-lock::before {
  position: fixed !important;
  inset: 0 !important;
  z-index: 899 !important;
}

.discord-voice-card.is-expanded {
  position: fixed !important;
  top: clamp(8px, 3vh, 24px) !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  width: min(1380px, calc(100vw - 32px)) !important;
  height: min(900px, calc(100dvh - 32px)) !important;
  max-width: none !important;
  max-height: calc(100dvh - 32px) !important;
  margin: 0 !important;
  z-index: 900 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.discord-voice-card.is-expanded .panel-head {
  flex: 0 0 auto;
  align-items: center;
}

.discord-voice-card.is-expanded .panel-copy {
  flex: 0 0 auto;
  margin-bottom: 14px;
}

.discord-voice-card.is-expanded .discord-voice-shell {
  flex: 1 1 auto;
  min-height: 0 !important;
  height: auto !important;
  overflow: hidden !important;
}

.discord-voice-card.is-expanded .voice-server-list,
.discord-voice-card.is-expanded .voice-call-panel {
  min-height: 0 !important;
  max-height: 100% !important;
}

.discord-voice-card.is-expanded .voice-call-panel {
  display: flex !important;
  flex-direction: column !important;
}

.discord-voice-card.is-expanded .voice-members {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-right: 8px;
}

.discord-voice-card.is-expanded .voice-self-panel,
.discord-voice-card.is-expanded .voice-controls,
.discord-voice-card.is-expanded .voice-feedback,
.discord-voice-card.is-expanded .voice-debug-panel {
  flex: 0 0 auto;
}

.voice-panel-actions .voice-live-pill {
  flex: 0 0 auto;
}

.voice-expand-btn {
  max-width: max-content !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

.voice-expand-btn span {
  display: inline !important;
}

.discord-voice-card.is-expanded .voice-expand-btn,
.discord-voice-card.is-expanded .voice-expand-btn svg {
  transform: none !important;
}

.voice-status-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  min-width: 1.15em;
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
}

.voice-status-icon svg {
  display: none !important;
}

.voice-member-badge.is-off .voice-status-icon {
  font-size: 13px;
}

@media (max-width: 760px) {
  .discord-voice-card.is-expanded {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    top: 8px !important;
    padding: 14px !important;
    border-radius: 22px !important;
  }

  .discord-voice-card.is-expanded .panel-head {
    align-items: flex-start;
  }

  .discord-voice-card.is-expanded .voice-panel-actions {
    width: auto !important;
    justify-content: flex-end !important;
  }

  .discord-voice-card.is-expanded .discord-voice-shell {
    grid-template-columns: 1fr !important;
  }
}
