.ai-home-hero {
  padding-top: var(--space-8);
  padding-bottom: var(--space-8);
}

.ai-home-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  gap: var(--space-5);
  align-items: stretch;
}

.ai-home-hero__copy {
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.ai-home-hero__copy h1 {
  margin: 0;
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: none;
}

.ai-home-hero__tagline {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-md);
  line-height: 1.65;
  max-width: 42ch;
}

.ai-home-hero__points {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ai-home-hero__points li {
  position: relative;
  padding-left: 1.15rem;
  color: var(--muted-strong);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.ai-home-hero__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.35);
}

.ai-home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.ai-home-hero__actions .btn--large {
  min-height: 46px;
  padding-inline: 1.15rem;
  font-size: var(--text-sm);
}

.ai-chat {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 420px;
  max-height: 520px;
  padding: var(--space-4);
  overflow: hidden;
}

.ai-chat__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat__title {
  display: grid;
  gap: 0.2rem;
}

.ai-chat__title strong {
  font-size: var(--text-md);
}

.ai-chat__title span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.ai-chat__model-wrap {
  display: grid;
  gap: 0.35rem;
  min-width: min(100%, 220px);
}

.ai-chat__model-wrap label {
  font-size: var(--text-xs);
  color: var(--muted-strong);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ai-chat__model {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: var(--text-sm);
}

.ai-chat__model:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.45);
}

.ai-chat__messages {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow-y: auto;
  padding: var(--space-4) 0;
  min-height: 220px;
}

.ai-chat__message {
  max-width: 92%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.ai-chat__message--assistant {
  align-self: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.ai-chat__message--user {
  align-self: flex-end;
  border: 1px solid rgba(45, 212, 191, 0.18);
  background: rgba(45, 212, 191, 0.1);
}

.ai-chat__message--system {
  align-self: center;
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-xs);
  text-align: center;
}

.ai-chat__typing {
  align-self: flex-start;
  color: var(--muted);
  font-size: var(--text-xs);
  padding-left: 0.25rem;
}

.ai-chat__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-chat__input {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.ai-chat__input:focus {
  outline: none;
  border-color: rgba(45, 212, 191, 0.45);
}

.ai-chat__send {
  align-self: end;
  min-width: 96px;
}

.ai-chat__foot {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.45;
}

.ai-chat__foot a {
  color: var(--accent);
}

.ai-chat.is-busy .ai-chat__send,
.ai-chat.is-busy .ai-chat__input,
.ai-chat.is-busy .ai-chat__model {
  opacity: 0.72;
  pointer-events: none;
}

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

  .ai-chat {
    min-height: 380px;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .ai-home-hero__copy,
  .ai-chat {
    padding: var(--space-5);
  }

  .ai-chat__composer {
    grid-template-columns: 1fr;
  }

  .ai-chat__send {
    width: 100%;
  }
}

.header-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.header-aside {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-left: var(--space-4);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.header-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.header-user__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.65);
  flex-shrink: 0;
}

.header-user__text {
  display: grid;
  gap: 0.1rem;
  line-height: 1.15;
  min-width: 0;
}

.header-user__text strong {
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.header-user__text small {
  color: var(--muted);
  font-size: var(--text-xs);
}

.header-logout {
  white-space: nowrap;
}

.portal-panel__meta {
  margin: 0;
  color: var(--muted-strong);
  font-size: var(--text-sm);
}

.portal-panel__meta--hint {
  color: var(--muted);
}

.split-showcase--solo {
  grid-template-columns: 1fr;
}

.cabinet-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(45, 212, 191, 0.18);
  background: rgba(45, 212, 191, 0.05);
}

.cabinet-strip__user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.cabinet-strip__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.55);
  flex-shrink: 0;
}

.cabinet-strip__info {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cabinet-strip__info strong {
  font-size: var(--text-sm);
}

.cabinet-strip__info span {
  color: var(--muted);
  font-size: var(--text-xs);
}

.cabinet-strip__info a {
  color: var(--accent);
}

.cabinet-strip__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.cabinet-guest {
  padding: var(--space-5);
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

.cabinet-guest h3 {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.15;
}

.cabinet-guest p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.cabinet-guest__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.prizrak-games-link--compact {
  padding: 0.45rem 0.85rem;
}

.prizrak-games-link--compact .prizrak-games-link__text strong {
  font-size: var(--text-xs);
}

@media (max-width: 1180px) {
  .header-bar__right {
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
  }

  .header-aside {
    width: 100%;
    border-left: 0;
    padding-left: 0;
    padding-top: var(--space-2);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-wrap: wrap;
  }
}

@media (max-width: 760px) {
  .header-user__text strong {
    max-width: 90px;
  }

  .prizrak-games-link {
    max-width: none;
    flex: 1;
  }
}
