:root {
  --bg: #09090b;
  --panel: #141418;
  --panel-soft: #1d1d24;
  --text: #f7f3ea;
  --muted: #a9a39a;
  --line: rgba(255,255,255,.1);
  --accent: #d8b46a;
  --accent-dark: #806235;
  --purple: #7b61ff;
  --radius: 34px;
  --shadow: 0 40px 120px rgba(0,0,0,.55);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(216,180,106,.22), transparent 32rem),
    radial-gradient(circle at 90% 15%, rgba(123,97,255,.18), transparent 34rem),
    linear-gradient(135deg, #08080a 0%, #111116 100%);
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.shell {
  width: min(1180px, 100%);
  min-height: min(760px, calc(100vh - 56px));
  display: grid;
  grid-template-columns: 420px 1fr;
  background: rgba(20,20,24,.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.frits-panel {
  position: relative;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025)),
    #101014;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font-weight: 900;
  letter-spacing: -.02em;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(216,180,106,.9);
}

.portrait-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  margin: 20px 0;
}

.portrait-bg {
  position: absolute;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(216,180,106,.34), transparent 66%);
  filter: blur(8px);
}

.frits-img {
  position: relative;
  z-index: 2;
  max-width: 92%;
  max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 28px 36px rgba(0,0,0,.62));
}

.frits-info {
  position: relative;
  z-index: 3;
}

.label,
.overline {
  margin: 0 0 8px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .13em;
  font-size: 12px;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: 66px;
  line-height: .9;
  letter-spacing: -.08em;
}

.frits-info p:last-child {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.small-card {
  margin-top: 24px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.small-card strong {
  font-size: 15px;
}

.small-card span {
  color: var(--muted);
  line-height: 1.4;
  font-size: 14px;
}

.chat-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background:
    radial-gradient(circle at top right, rgba(123,97,255,.12), transparent 28rem),
    rgba(13,13,16,.8);
}

.chat-top {
  padding: 28px 30px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.chat-top h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  letter-spacing: -.06em;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
  font-weight: 800;
}

.status span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #69e58b;
  box-shadow: 0 0 20px rgba(105,229,139,.9);
}

.messages {
  padding: 30px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.message.user {
  justify-content: flex-end;
}

.avatar.mini {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.avatar.mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.bubble {
  max-width: min(680px, 86%);
  padding: 15px 17px;
  border-radius: 22px;
  line-height: 1.5;
  white-space: pre-wrap;
  font-size: 16px;
}

.bot .bubble {
  background: rgba(255,255,255,.065);
  border: 1px solid var(--line);
  color: var(--text);
  border-bottom-left-radius: 8px;
}

.user .bubble {
  background: linear-gradient(135deg, var(--accent), #b88c43);
  color: #15100a;
  font-weight: 700;
  border-bottom-right-radius: 8px;
}

.chat-form {
  padding: 24px 30px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  border-top: 1px solid var(--line);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.065);
  color: var(--text);
  padding: 17px 18px;
  font-size: 16px;
  outline: none;
}

input::placeholder {
  color: rgba(247,243,234,.48);
}

input:focus {
  border-color: rgba(216,180,106,.82);
  box-shadow: 0 0 0 4px rgba(216,180,106,.12);
}

button {
  border: 0;
  border-radius: 18px;
  padding: 0 24px;
  background: var(--text);
  color: #0c0c0f;
  font-weight: 950;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.note {
  margin: 0;
  padding: 0 30px 26px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .app {
    padding: 14px;
    place-items: start center;
  }

  .shell {
    min-height: auto;
    grid-template-columns: 1fr;
    border-radius: 26px;
  }

  .frits-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 22px;
  }

  .portrait-wrap {
    min-height: 250px;
    margin: 10px 0;
  }

  .portrait-bg {
    width: 230px;
    height: 230px;
  }

  .frits-img {
    max-height: 270px;
  }

  h1 {
    font-size: 52px;
  }

  .small-card {
    display: none;
  }

  .chat-top,
  .messages,
  .chat-form {
    padding-left: 20px;
    padding-right: 20px;
  }

  .messages {
    min-height: 360px;
    max-height: 58vh;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  button {
    min-height: 52px;
  }

  .note {
    padding-left: 20px;
    padding-right: 20px;
  }
}
