    /* Keep the selected design's quiet surfaces, system typography and emerald accent. */
    :root {
      --paper: #fcfbf9;
      --sidebar: #f0efeb;
      --ink: #141b20;
      --muted: #777d84;
      --line: #dedfdd;
      --green: #005b46;
      --green-hover: #004a39;
      --green-soft: #e8f2ec;
      --sidebar-width: clamp(248px, 20.85vw, 320px);
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
      color: var(--ink);
      background: var(--paper);
      font-synthesis: none;
    }
    * { box-sizing: border-box; }
    body { margin: 0; }
    button, input, textarea, select { font: inherit; }
    button, select { cursor: pointer; }
    button { color: inherit; }
    button:disabled { cursor: default; }
    button, input, textarea, select { -webkit-tap-highlight-color: transparent; }
    button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
      outline: 2px solid var(--green);
      outline-offset: 4px;
    }
    [hidden] { display: none !important; }
    h1, h2, h3 { text-wrap: balance; }
    p { text-wrap: pretty; }
    .icon { width: 22px; height: 22px; flex: 0 0 auto; }
    .icon-small { width: 19px; height: 19px; }
    .skip-link { position: fixed; left: 16px; top: -80px; z-index: 50; padding: 12px; background: white; }
    .skip-link:focus { top: 16px; }
    .app { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100dvh; min-height: 420px; }

    /* Brand marks reuse actual pixels from the user's selected visual, rather than redrawing the logo. */
    .brand-symbol, .welcome-symbol, .assistant-symbol {
      display: block;
      flex: 0 0 auto;
      width: 44px;
      height: 44px;
      background-image: url('./assets/reference.png');
      background-repeat: no-repeat;
      background-size: 1487px 1058px;
    }
    .brand-symbol { background-position: -29px -23px; }
    .welcome-symbol, .assistant-symbol { width: 40px; height: 40px; background-position: -864px -263px; }
    .sidebar { display: flex; flex-direction: column; min-height: 0; padding: 22px 20px 24px; background: var(--sidebar); }
    .brand { display: flex; align-items: center; gap: 7px; height: 44px; padding-left: 8px; margin-bottom: 27px; }
    .brand-name { font-size: 30px; font-weight: 680; line-height: 1; }
    .new-chat { display: flex; justify-content: center; align-items: center; gap: 9px; width: 100%; height: 52px; border: 0; border-radius: 10px; background: var(--green); color: #fff; font-size: 18px; font-weight: 550; }
    .new-chat:hover, .send-button:hover { background: var(--green-hover); }
    .new-chat .icon, .send-button .icon { filter: brightness(0) invert(1); }
    .search-field { display: flex; align-items: center; gap: 12px; height: 52px; border: 1px solid #d9dad7; border-radius: 11px; padding: 0 15px; margin-top: 18px; }
    .search-field .icon { opacity: .65; }
    .search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 16px; }
    .search-field:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
    .search-field input:focus-visible { outline: 0; }
    input::placeholder, textarea::placeholder { color: #969aa0; opacity: 1; }
    .history { min-height: 0; overflow-y: auto; border-top: 1px solid #deded9; margin-top: 28px; padding-top: 20px; flex: 1; }
    .history-group { margin-bottom: 31px; }
    .history-heading { margin: 0 4px 11px; font-size: 14px; font-weight: 400; color: var(--muted); }
    .history-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 10px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: 16px; }
    .history-item:hover { background: #e7e7e1; }
    .history-item[aria-current="true"] { background: #e1e9e3; }
    .history-item span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .no-results { margin: 8px 10px; color: var(--muted); font-size: 14px; }
    .account { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
    .account-button { display: flex; align-items: center; gap: 16px; padding: 0; border: 0; background: none; font-size: 16px; }
    .avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green); color: white; font-size: 18px; }
    .icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 9px; background: transparent; }
    .icon-button:hover { background: #e6e7e1; }

    /* The welcome screen keeps the reference's open center and large, calm composer. */
    .main { display: grid; grid-template-rows: 80px minmax(0, 1fr); min-width: 0; min-height: 0; }
    .topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 32px; }
    .topbar-left { display: flex; align-items: center; gap: 12px; }
    .model-select { min-width: 188px; height: 49px; padding: 0 42px 0 15px; appearance: none; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--paper) url('./assets/icons/chevron-down.svg') right 15px center / 18px no-repeat; font-size: 17px; }
    .preview-label { margin-top: 10px; padding: 3px 0; border: 0; background: none; color: #757980; font-size: 14px; }
    .preview-label:hover { color: var(--green); }
    .nav-toggle { display: none; }
    .workspace { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 0; overflow: auto; padding: 24px clamp(40px, 7vw, 104px) 40px; }
    .welcome { width: 100%; max-width: 1000px; display: flex; flex-direction: column; align-items: center; flex: 0 0 auto; text-align: center; }
    .welcome-symbol { margin-bottom: 32px; }
    h1 { margin: 0; font-size: 56px; font-weight: 680; line-height: 1.25; }
    .welcome-description { margin: 18px 0 0; color: #777c83; font-size: 22px; line-height: 1.5; }
    .quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; width: 86%; margin-top: 62px; }
    .quick-action { display: flex; align-items: center; justify-content: center; gap: 15px; min-height: 42px; padding: 5px 14px; border: 0; background: none; font-size: 17px; white-space: nowrap; }
    .quick-action + .quick-action { border-left: 1px solid var(--line); }
    .quick-action .icon { width: 29px; height: 29px; opacity: .82; }
    .quick-action:hover { color: var(--green); }
    .composer-wrap { width: 100%; max-width: 1000px; margin-top: 56px; flex: 0 0 auto; }
    .composer { padding: 24px 18px 18px; border: 1px solid #d9ddde; border-radius: 14px; background: #fff; box-shadow: 0 4px 6px -1px rgb(0 0 0 / .025), 0 2px 4px -2px rgb(0 0 0 / .025); }
    .composer:focus-within { border-color: #8caf9d; }
    .composer textarea { display: block; width: 100%; height: 96px; max-height: 192px; resize: none; padding: 0 5px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 20px; line-height: 1.5; }
    .composer textarea:focus-visible { outline: 0; }
    .composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
    .attachment-actions { display: flex; align-items: center; gap: 20px; min-width: 0; }
    .attach-button { display: flex; align-items: center; gap: 11px; min-height: 50px; padding: 0 15px; border: 0; border-radius: 11px; background: #f5f5f3; font-size: 16px; }
    .attach-button:hover { background: #ecefea; }
    .attachment-help { padding-left: 20px; border-left: 1px solid var(--line); color: #858a91; font-size: 16px; white-space: nowrap; }
    .send-button { display: grid; place-items: center; width: 58px; height: 58px; flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--green); }
    .send-button .icon { width: 28px; height: 28px; }
    .keyboard-hint { margin: 21px 0 0; text-align: center; color: #81868d; font-size: 15px; line-height: 1.5; }
    .form-error { margin: 10px 5px 0; color: #a13a2a; font-size: 14px; }

    /* File chips and example conversations stay entirely in the current browser session. */
    .attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
    .attachment-chip { display: flex; align-items: center; gap: 9px; max-width: 280px; padding: 8px 9px 8px 12px; border: 1px solid #e0e5df; border-radius: 9px; background: #f6f8f4; font-size: 13px; }
    .attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .attachment-chip .icon-button { width: 24px; height: 24px; flex: 0 0 auto; }
    .message-list { width: 100%; max-width: 880px; min-height: 0; overflow-y: auto; flex: 1; padding: 24px 12px 28px; }
    .message { margin: 0 0 30px; }
    .message-user { display: flex; flex-direction: column; align-items: flex-end; }
    .message-user .message-text { max-width: 85%; padding: 14px 19px; border-radius: 15px 15px 4px 15px; background: var(--green-soft); font-size: 16px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
    .message-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 10px; max-width: 90%; }
    .message-assistant { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; }
    .assistant-content { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
    .assistant-content p { margin: 0 0 16px; white-space: pre-wrap; }
    .assistant-content p:last-child { margin-bottom: 0; }
    .example-label { display: inline-block; margin-bottom: 9px; color: var(--muted); font-size: 12px; }
    .workspace.is-chat { justify-content: flex-end; overflow: hidden; padding-top: 0; }
    .workspace.is-chat .composer-wrap { max-width: 880px; margin-top: 12px; }
    .workspace.is-chat textarea { height: 60px; font-size: 17px; }
    .workspace.is-chat .composer { padding-top: 18px; }
    .workspace.is-chat .keyboard-hint { margin-top: 12px; font-size: 12px; }

    /* Native dialogs provide keyboard and focus behavior for preview information. */
    dialog { width: min(440px, calc(100vw - 40px)); padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); }
    dialog::backdrop { background: rgb(20 30 25 / .25); }
    dialog h2 { margin: 0 0 14px; font-size: 23px; }
    dialog p { margin: 0 0 12px; color: #626a6a; font-size: 15px; line-height: 1.8; }
    .dialog-button { width: 100%; min-height: 44px; margin-top: 12px; border: 0; border-radius: 9px; color: white; background: var(--green); }
    .scrim { display: none; }

    /* Retain the same hierarchy on smaller screens; the conversation list becomes a drawer. */
    @media (max-width: 1100px) {
      :root { --sidebar-width: 248px; }
      .brand-name { font-size: 27px; }
      .workspace { padding-left: 40px; padding-right: 40px; }
      h1 { font-size: 43px; }
      .welcome-description { font-size: 18px; }
      .quick-actions { width: 100%; }
      .quick-action { font-size: 14px; gap: 10px; padding-inline: 10px; }
      .quick-action .icon { width: 25px; height: 25px; }
      .attachment-help { font-size: 14px; }
    }
    @media (max-width: 760px) {
      .app { grid-template-columns: minmax(0, 1fr); }
      .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 280px; visibility: hidden; }
      .sidebar[data-open="true"] { visibility: visible; }
      .scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 20; padding: 0; border: 0; background: rgb(20 30 25 / .25); }
      .nav-toggle { display: grid; }
      .main { grid-template-rows: 72px minmax(0, 1fr); }
      .topbar { padding: 14px 18px; align-items: center; gap: 8px; }
      .topbar-left { gap: 6px; }
      .model-select { min-width: 150px; height: 42px; font-size: 15px; padding-left: 12px; }
      .preview-label { margin: 0; font-size: 12px; white-space: nowrap; }
      .workspace { padding: 24px 20px max(28px, env(safe-area-inset-bottom)); }
      .welcome-symbol { margin-bottom: 25px; }
      h1 { font-size: 30px; font-weight: 650; }
      .welcome-description { max-width: 310px; margin-top: 14px; font-size: 16px; }
      .quick-actions { margin-top: 34px; }
      .quick-action { flex-direction: column; gap: 10px; font-size: 12px; padding: 4px; white-space: normal; }
      .quick-action .icon { width: 25px; height: 25px; }
      .composer-wrap { margin-top: 34px; }
      .composer { padding: 18px 12px 12px; border-radius: 13px; }
      .composer textarea { height: 82px; font-size: 16px; }
      .composer-actions { gap: 8px; margin-top: 12px; }
      .attach-button { gap: 8px; min-height: 42px; padding-inline: 11px; font-size: 14px; }
      .attachment-actions { gap: 10px; }
      .attachment-help { padding-left: 10px; font-size: 12px; }
      .send-button { width: 44px; height: 44px; }
      .send-button .icon { width: 23px; height: 23px; }
      .keyboard-hint { margin-top: 16px; font-size: 11px; }
      .workspace.is-chat { padding-inline: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
      .message-list { padding-inline: 0; }
      .message-assistant { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
      .assistant-symbol { width: 32px; height: 32px; background-size: 1189.6px 846.4px; background-position: -691.2px -210.4px; }
      .assistant-content, .message-user .message-text { font-size: 15px; }
      .message-user .message-text { max-width: 93%; }
    }
    @media (max-height: 800px) and (min-width: 761px) {
      .workspace { padding-top: 16px; padding-bottom: 24px; }
      .welcome-symbol { margin-bottom: 22px; }
      h1 { font-size: 43px; }
      .welcome-description { font-size: 18px; margin-top: 12px; }
      .quick-actions { margin-top: 36px; }
      .composer-wrap { margin-top: 36px; }
      .composer textarea { height: 72px; }
      .keyboard-hint { margin-top: 16px; }
    }

/* Account entry follows the same paper and emerald palette as the selected chat design. */
.auth-screen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.auth-card { width: min(100%, 380px); }
.auth-card .brand { padding: 0; margin-bottom: 42px; }
.auth-card h1 { font-size: 30px; margin-bottom: 12px; }
.auth-card p { color: var(--muted); line-height: 1.7; }
.auth-card label { display: block; margin-top: 22px; font-size: 14px; }
.auth-card input { display: block; width: 100%; height: 48px; padding: 10px 12px; margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.auth-card button { height: 48px; margin-top: 28px; }
.app[inert] { visibility: hidden; }
.icp { display: block; margin: 22px 0 0; color: var(--muted); font-size: 11px; text-align: center; text-decoration: none; }
.message-photo { width: auto; height: auto; max-width: 240px; max-height: 180px; border-radius: 10px; }
.answer-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-state { margin-top: 8px; color: #9a4c32; font-size: 13px; }
button:disabled, select:disabled { opacity: .55; }
