:root {
  color-scheme: dark;
  --bg: #070b13;
  --panel: #111824;
  --panel-soft: #172231;
  --text: #f4f7fb;
  --muted: #aab5c7;
  --line: rgba(175, 190, 215, .18);
  --gold: #f3b73f;
  --cyan: #6ad4d7;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

body.expert-public {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 22% 8%, rgba(106, 212, 215, .12), transparent 26%),
    radial-gradient(circle at 78% 12%, rgba(243, 183, 63, .12), transparent 24%),
    var(--bg);
  color: var(--text);
}

.expert-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: calc(100vh - 56px);
  margin: 28px auto;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
}

.expert-hero,
.expert-auth,
.expert-chat {
  border: 1px solid var(--line);
  background: rgba(17, 24, 36, .86);
  backdrop-filter: blur(18px);
  border-radius: 8px;
}

.expert-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.expert-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.expert-hero h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: .96;
  letter-spacing: 0;
}

.expert-copy {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.expert-status {
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--gold);
  white-space: nowrap;
}

.expert-auth {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 22px;
}

.expert-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.expert-tabs button,
.expert-form button,
.expert-chat-head button,
.expert-composer button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  cursor: pointer;
}

.expert-tabs button.active,
.expert-form button,
.expert-composer button {
  background: var(--gold);
  color: #131313;
  font-weight: 850;
}

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

.expert-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.expert-form input,
.expert-composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 16, .82);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}

.expert-check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.expert-check input {
  width: auto;
  margin-top: 3px;
}

.expert-form-note {
  min-height: 24px;
  color: var(--gold);
}

.expert-chat {
  min-height: 540px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

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

.expert-chat-head strong {
  display: block;
  font-size: 20px;
}

.expert-chat-head span {
  color: var(--muted);
}

.expert-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expert-message {
  width: min(820px, 86%);
}

.expert-message.user {
  align-self: flex-end;
}

.expert-message-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.expert-bubble {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px 16px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(23, 34, 49, .78);
}

.expert-message.user .expert-bubble {
  background: rgba(243, 183, 63, .18);
}

.expert-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.hidden { display: none !important; }

@media (max-width: 720px) {
  .expert-shell {
    width: min(100% - 18px, 1180px);
    margin: 9px auto;
    min-height: calc(100vh - 18px);
  }
  .expert-hero {
    display: grid;
    padding: 20px;
  }
  .expert-status {
    justify-self: start;
  }
  .expert-message {
    width: 100%;
  }
  .expert-composer {
    grid-template-columns: 1fr;
  }
}
