:root {
    --bg: #070A12;
    --card: rgba(255,255,255,.075);
    --card-strong: rgba(255,255,255,.12);
    --border: rgba(255,255,255,.14);
    --text: #F5F1E8;
    --muted: rgba(245,241,232,.7);
    --accent: #D6B36A;
    --user: #D6B36A;
    --assistant: rgba(255,255,255,.1);
  }
  
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
      radial-gradient(circle at 15% 10%, rgba(214,179,106,.18), transparent 28%),
      radial-gradient(circle at 85% 15%, rgba(92,134,255,.14), transparent 32%),
      var(--bg);
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
  
  .chat-shell {
    width: min(1120px, calc(100% - 32px));
    height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 20px;
    padding: 28px 0;
  }
  
  .chat-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
  }
  
  .back-link {
    display: inline-block;
    color: var(--accent);
    font-size: .9rem;
    margin-bottom: 16px;
  }
  
  h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 7vw, 5.2rem);
    line-height: .95;
    letter-spacing: -.055em;
    font-weight: 500;
  }
  
  .chat-header p {
    max-width: 720px;
    color: var(--muted);
    line-height: 1.7;
    margin: 18px 0 0;
  }
  
  .header-actions {
    display: flex;
    gap: 12px;
    white-space: nowrap;
  }
  
  .header-actions a {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--muted);
  }
  
  .chat-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: 1fr auto;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.045));
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0,0,0,.45);
  }
  
  .messages {
    overflow-y: auto;
    padding: 28px;
  }
  
  .message {
    display: flex;
    margin-bottom: 16px;
  }
  
  .message.user {
    justify-content: flex-end;
  }
  
  .bubble {
    max-width: min(720px, 88%);
    padding: 16px 18px;
    border-radius: 20px;
    line-height: 1.65;
    color: var(--text);
    border: 1px solid var(--border);
  }
  
  .message.assistant .bubble {
    background: var(--assistant);
  }
  
  .message.user .bubble {
    background: var(--user);
    color: #171103;
    border-color: transparent;
  }
  
  .chat-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 18px;
    border-top: 1px solid var(--border);
    background: rgba(0,0,0,.22);
  }
  
  input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: var(--text);
    padding: 15px 18px;
    font-size: 1rem;
    outline: none;
  }
  
  input::placeholder {
    color: rgba(245,241,232,.45);
  }
  
  button {
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #171103;
    padding: 0 22px;
    font-weight: 800;
    cursor: pointer;
  }
  
  button:disabled {
    opacity: .55;
    cursor: not-allowed;
  }
  
  @media (max-width: 760px) {
    .chat-shell {
      height: 100svh;
      width: min(100% - 20px, 1120px);
      padding: 16px 0;
    }
  
    .chat-header {
      flex-direction: column;
    }
  
    .header-actions {
      width: 100%;
    }
  
    .header-actions a {
      flex: 1;
      text-align: center;
    }
  
    .messages {
      padding: 18px;
    }
  
    .chat-input-row {
      grid-template-columns: 1fr;
    }
  
    button {
      min-height: 48px;
    }
  }