@layer reset, base, layout, components, responsive;
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p { margin: 0; }
  button, textarea, input { font: inherit; color: inherit; }
  button, a, textarea { -webkit-tap-highlight-color: transparent; }
  button { cursor: pointer; }
  button { border: 0; background: none; }
  a { color: inherit; text-decoration: none; }
  img, video { max-width: 100%; display: block; }
  button:disabled { cursor: default; }
  [hidden] { display: none !important; }
}
@layer base {
  :root { --ink: #202123; --muted: #70716f; --subtle: #f7f7f5; --line: #e8e8e5; --accent: #2854ef; --accent-soft: #edf1ff; --sidebar: 224px; --content: 752px; --viewport-height: 100dvh; --viewport-top: 0px; --radius: 20px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: #fff; font-synthesis: none; -webkit-font-smoothing: antialiased; }
  html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
  body { font-size: 16px; line-height: 1.5; }
  :focus, :focus-visible { outline: none; }
  button:disabled { opacity: .42; }
  ::selection { background: #dbe4ff; }
  .icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .icon.small { width: 16px; height: 16px; }
  .svg-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
  .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .skip-link { position: fixed; top: -80px; left: 20px; z-index: 20; background: var(--ink); color: #fff; border-radius: 8px; padding: 12px 16px; }
  .skip-link:focus { top: 16px; }
}
@layer layout {
  .app { position: fixed; top: var(--viewport-top); left: 0; width: 100%; height: var(--viewport-height); display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); overflow: hidden; }
  .sidebar { display: flex; flex-direction: column; padding: 24px 14px 14px; background: var(--subtle); border-right: 1px solid #eeeee9; min-height: 0; }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; font-size: 21px; font-weight: 650; letter-spacing: -.8px; height: 36px; }
  .nav-main { display: grid; gap: 4px; margin-top: 36px; }
  .nav-item { display: flex; width: 100%; align-items: center; gap: 12px; min-height: 46px; padding: 10px 12px; border-radius: 11px; text-align: left; font-size: 14px; }
  .nav-item.is-active { background: #eaeae7; font-weight: 600; }
  .sidebar-bottom { margin-top: auto; padding-top: 24px; }
  .sidebar-note { display: flex; gap: 10px; padding: 16px 12px 28px; color: #848580; font-size: 12px; line-height: 1.65; }
  .sidebar-note .icon { width: 19px; margin-top: 2px; }
  .guest { display: flex; align-items: center; width: 100%; gap: 10px; text-align: left; padding: 12px 8px; border-top: 1px solid var(--line); }
  .guest-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #dddeda; background: #fff; border-radius: 50%; }
  .guest-avatar .icon { width: 17px; height: 17px; }
  .guest strong, .guest small { display: block; }
  .guest strong { font-size: 12px; font-weight: 550; }
  .guest small { font-size: 10px; color: var(--muted); margin-top: 2px; }
  .guest > .icon { width: 13px; margin-left: auto; color: var(--muted); }
  .legal-links { display: flex; gap: 6px; padding: 10px 6px 0; font-size: 10px; color: #73746f; }
  .legal-links a:hover { text-decoration: underline; }
  .main { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
  .topbar { display: flex; align-items: center; justify-content: space-between; min-height: 76px; padding: max(16px, env(safe-area-inset-top)) 28px 16px; gap: 12px; }
  .topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .desktop-title { color: var(--muted); font-size: 13px; }
  .topbar .mobile-menu, .topbar .mobile-brand { display: none; }
  .preview-label { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: #777975; padding: 10px 4px; }
  .status-dot { width: 5px; height: 5px; background: #8c9eb1; border-radius: 50%; }
  .login-button { background: var(--ink); color: #fff; font-size: 13px; font-weight: 550; border-radius: 24px; min-height: 38px; padding: 8px 21px; }
  .conversation-area { min-height: 0; position: relative; }
  .scroller { height: 100%; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable both-edges; padding: 0 24px; display: flex; flex-direction: column; scroll-padding-bottom: 24px; -webkit-overflow-scrolling: touch; }
  .welcome { width: 100%; max-width: var(--content); margin: auto; text-align: center; padding: 36px 0 56px; flex-shrink: 0; }
  .welcome-mark { width: 52px; height: 52px; border: 1px solid #e7ecfb; border-radius: 17px; display: grid; place-items: center; margin: 0 auto 28px; color: var(--accent); background: #f8faff; transform: rotate(-5deg); }
  .welcome-mark .icon { width: 29px; height: 29px; stroke-width: 1.35; transform: rotate(5deg); }
  .welcome h1 { font-size: clamp(30px, 3.3vw, 40px); letter-spacing: -1.6px; font-weight: 550; line-height: 1.16; }
  .welcome-description { margin: 18px auto 0; max-width: 410px; color: var(--muted); font-size: 16px; line-height: 1.65; white-space: pre-line; }
  .suggestions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
  .suggestion { display: flex; align-items: center; gap: 8px; padding: 11px 15px; min-height: 44px; border: 1px solid var(--line); border-radius: 24px; font-size: 13px; background: #fff; }
  .suggestion .icon { width: 18px; height: 18px; color: #747670; }
  .inspiration-link .icon { width: 15px; height: 15px; }
  .thread { width: 100%; max-width: var(--content); margin: 0 auto; padding: 28px 0 38px; }
  .scroll-anchor { height: 1px; flex-shrink: 0; }
  .composer-area { padding: 10px 24px max(17px, env(safe-area-inset-bottom)); background: #fff; }
  .composer-wrap { max-width: var(--content); margin: 0 auto; }
  .composer { border: 1px solid #dedfda; border-radius: 25px; padding: 17px 13px 10px; box-shadow: 0 3px 12px #20212305; transition: border-color .15s; background: #fff; }
  .composer:focus-within { border-color: #a9b0bf; box-shadow: 0 3px 12px #20212308; }
  .composer textarea { width: 100%; resize: none; background: none; border: 0; outline: 0; min-height: 28px; max-height: 168px; line-height: 1.55; padding: 0 7px; font-size: 16px; display: block; overflow-y: auto; overscroll-behavior: contain; }
  .composer textarea::placeholder { color: #8d8e89; }
  .composer-toolbar { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
  .composer-tools, .send-group { display: flex; align-items: center; gap: 6px; }
  .mode-button { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 8px; min-height: 40px; border-radius: 10px; color: #60625d; }
  .mode-button > .icon:first-child { width: 17px; height: 17px; }
  .icon-button { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 50%; flex-shrink: 0; }
  .send-button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; transition: background .15s; }
  .send-button:disabled { opacity: 1; background: #ecece9; color: #9a9c96; }
  .send-button.is-working { background: var(--ink); }
  .composer-note { text-align: center; font-size: 11px; line-height: 1.5; color: #71736d; margin: 11px 0 0; }
  .char-count { font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
}
@layer components {
  .primary-suggestion { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
  .primary-suggestion .icon { color: var(--accent); }
  .welcome-upload { margin: 28px auto 0; }
  .composer-tools { min-width: 0; }
  .mode-button { min-width: 0; }
  #mode-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
  .send-group { flex-shrink: 0; }
  .image-cost { font-size: 11px; white-space: nowrap; color: var(--muted); padding: 8px; min-height: 40px; border-radius: 8px; font-variant-numeric: tabular-nums; }
  .image-input-hint { margin: 0 2px 10px; padding: 12px 15px; background: #f5f6f2; border-radius: 15px; font-size: 12px; }
  .image-input-hint > div { display: flex; gap: 16px; margin-top: 3px; }
  .image-input-hint button { min-height: 36px; padding: 0; color: var(--accent); font-weight: 550; }
  .image-input-hint button + button { color: var(--muted); font-weight: 400; }
  .image-request-summary { color: var(--muted); font-size: 11px; max-width: 90%; text-align: right; margin-top: 8px; }
  .composer-add { position: relative; flex-shrink: 0; }
  .add-menu { position: fixed; inset: auto; margin: 0; z-index: 100; width: 264px; max-width: calc(100vw - 24px); padding: 6px; border: 1px solid #e7e7e5; border-radius: 22px; background: #f6f6f5; color: var(--ink); box-shadow: 0 12px 40px #0000001c, 0 2px 8px #0000000a; overflow: auto; overscroll-behavior: contain; }
  .add-menu::backdrop { background: transparent; }
  .add-menu[popover]:not(:popover-open) { display: none; }
  .add-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 16px; text-align: left; font-size: 14px; }
  .add-menu strong, .add-menu small { display: block; }
  .add-menu strong { font-size: 13px; font-weight: 500; }
  .add-menu small { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .add-menu-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; background: #e8e8e5; }
  .add-menu .icon { width: 20px; height: 20px; color: #4e504d; }
  .add-menu button:focus-visible { box-shadow: inset 0 0 0 2px #3686e9; }
  .image-settings-dialog { width: 470px; }
  .image-settings-dialog .dialog-top h2 { font-size: 18px; letter-spacing: -.4px; }
  .image-settings-dialog .dialog-content { padding: 24px; }
  .image-settings-dialog .dialog-top { margin-bottom: 20px; }
  .model-selector { display: flex; align-items: center; gap: 12px; padding: 15px; background: var(--subtle); border-radius: 15px; width: 100%; text-align: left; }
  .model-selector > .icon { margin-left: auto; width: 16px; height: 16px; color: var(--muted); }
  .model-selector small, .model-selector strong { display: block; }
  .model-selector small { font-size: 11px; color: var(--muted); }
  .model-selector strong { font-size: 15px; font-weight: 550; margin-top: 3px; }
  .model-emblem { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: white; color: var(--accent); }
  .image-setting-group { border: 0; padding: 0; margin: 22px 0 0; min-width: 0; }
  .image-setting-group legend { font-size: 12px; font-weight: 550; padding: 0; margin-bottom: 10px; }
  .quality-choices { display: flex; gap: 8px; }
  .setting-choice { border: 1px solid var(--line); border-radius: 11px; min-height: 44px; padding: 9px 12px; font-size: 12px; flex: 1; }
  .setting-choice[aria-pressed="true"] { background: #f1f3ed; border-color: #7f8971; color: #30372a; }
  .setting-hint { font-size: 11px; color: var(--muted); line-height: 1.6; margin-top: 8px; }
  .format-choices { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .format-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 70px; padding: 9px 4px; font-size: 11px; }
  .format-shape { display: grid; place-items: center; border: 1px solid #838879; border-radius: 3px; flex-shrink: 0; }
  .format-shape.is-auto { border: 0; }
  .image-settings-footer { display: flex; align-items: center; gap: 18px; justify-content: space-between; padding-top: 20px; margin-top: 18px; border-top: 1px solid var(--line); }
  .image-quote strong, .image-quote span { display: block; }
  .image-quote strong { font-size: 16px; font-weight: 550; }
  .image-quote span { font-size: 11px; color: var(--muted); margin-top: 3px; }
  .image-settings-footer .primary-button { width: auto; min-width: 118px; margin: 0; }
  .image-settings-dialog .dialog-note { margin-bottom: 0; font-size: 10px; }
  .model-back { display: flex; align-items: center; gap: 8px; font-size: 12px; margin: -6px 0 12px -5px; padding: 7px 5px; color: var(--muted); }
  .model-back .icon { transform: rotate(180deg); }
  .image-model-list { display: flex; flex-direction: column; gap: 4px; }
  .image-model-row { display: flex; align-items: center; width: 100%; gap: 10px; padding: 13px 10px; border-radius: 12px; text-align: left; }
  .image-model-row > span:first-child { min-width: 0; }
  .image-model-row strong, .image-model-row small { display: block; }
  .image-model-row strong { font-size: 13px; font-weight: 550; }
  .image-model-row small { font-size: 10px; color: var(--muted); margin-top: 3px; }
  .model-price { margin-left: auto; white-space: nowrap; font-size: 11px; color: var(--muted); }
  .image-model-row[aria-pressed="true"] { background: #f1f3ed; }
  @media (hover: hover) {
    .add-menu button:hover, .image-model-row:hover:not(:disabled), .model-selector:hover, .image-cost:hover { background: #eff0eb; }
  }
  .message { margin-bottom: 30px; overflow-wrap: anywhere; }
  .message:last-child { margin-bottom: 0; }
  .message-user { display: flex; flex-direction: column; align-items: flex-end; margin: 2px 0 32px; }
  .user-bubble { max-width: 85%; padding: 13px 19px; border-radius: 22px 22px 5px 22px; background: #f1f2ef; white-space: pre-wrap; font-size: 15px; line-height: 1.6; }
  .assistant-heading { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
  .assistant-heading img { width: 24px; height: 24px; }
  .example-tag { font-weight: 400; font-size: 10px; color: var(--muted); padding-left: 3px; }
  .message-body { font-size: 15px; line-height: 1.8; }
  .message-body p + p { margin-top: 16px; }
  .message-body h3 { font-size: 17px; font-weight: 600; margin: 23px 0 10px; line-height: 1.45; }
  .message-body h3:first-child { margin-top: 0; }
  .message-body ul, .message-body ol { padding-left: 23px; margin: 12px 0 0; }
  .message-body li { padding-left: 3px; margin: 6px 0; }
  .message-body blockquote { border-left: 2px solid #c7d1f5; padding: 0 0 0 16px; margin: 18px 0; color: #5d6258; }
  .message-actions { display: flex; gap: 4px; margin-top: 12px; align-items: center; }
  .message-actions .icon-button { width: 34px; height: 34px; color: #7b7d78; }
  .message-actions .icon { width: 17px; height: 17px; }
  .text-action { display: inline-flex; align-items: center; gap: 7px; padding: 10px 12px; font-size: 12px; color: var(--accent); border-radius: 9px; }
  .text-action .icon { width: 16px; height: 16px; }
  .photo-actions { gap: 10px; flex-wrap: wrap; }
  .edit-photo-button { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 15px; border-radius: 999px; background: #ffffffe6; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--ink); font-size: 13px; font-weight: 600; line-height: 1.4; box-shadow: 0 1px 5px #00000012; }
  .edit-photo-button .icon { width: 18px; height: 18px; }
  .photo-actions .text-action { min-height: 44px; color: var(--muted); }
  .photo-overlay-button { position: absolute; right: 10px; bottom: 10px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: #ffffffe6; color: var(--ink); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 1px 5px #00000012; }
  .photo-overlay-button .icon { width: 20px; height: 20px; }
  @media (hover: hover) { .edit-photo-button:hover, .photo-overlay-button:hover { background: #fff; } }
  .media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; border-radius: 18px; overflow: hidden; max-width: 510px; margin-top: 18px; }
  .media-grid.count-1 { grid-template-columns: 1fr; max-width: 344px; }
  .media-grid.count-3 > :first-child { grid-row: span 2; }
  .media-frame { position: relative; min-width: 0; aspect-ratio: 1; }
  .media-grid.count-1 .media-frame { aspect-ratio: auto; }
  .media-thumb { display: block; width: 100%; height: 100%; padding: 0; position: relative; min-width: 0; overflow: hidden; background: #f0ede7; }
  .media-grid.count-1 .media-thumb { height: auto; }
  .media-grid.count-3 > :first-child { aspect-ratio: auto; }
  .media-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .media-grid.count-1 .media-thumb img { height: auto; }
  .media-grid:not(.count-1) .edit-photo-button span { display: none; }
  .media-thumb::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px #00000005; pointer-events: none; }
  .media-caption { margin-top: 9px; color: var(--muted); font-size: 11px; }
  .video-result { max-width: 352px; margin-top: 16px; }
  .video-result video { border-radius: 18px; width: 100%; max-height: 430px; aspect-ratio: 3 / 4; background: #e8e6e2; object-fit: cover; }
  .download-link { font-size: 12px; display: inline-flex; gap: 8px; align-items: center; min-height: 40px; color: #656761; }
  .download-link .icon { width: 16px; height: 16px; }
  .file-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; margin-top: 18px; max-width: 390px; }
  .file-card > .icon:first-child { width: 29px; height: 29px; color: var(--accent); }
  .file-card strong, .file-card small { display: block; }
  .file-card strong { font-size: 13px; font-weight: 550; }
  .file-card small { font-size: 11px; color: var(--muted); margin-top: 2px; }
  .file-card > .icon:last-child { width: 17px; margin-left: auto; }
  .attachment-list { display: flex; gap: 9px; padding: 7px 8px 14px; margin-top: -7px; overflow-x: auto; overscroll-behavior-x: contain; }
  .attachment { width: 62px; height: 62px; position: relative; flex-shrink: 0; }
  .attachment img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; border: 1px solid var(--line); }
  .attachment button { position: absolute; right: -7px; top: -7px; width: 28px; height: 28px; display: grid; place-items: center; background: #fff; border: 1px solid #d3d5ce; border-radius: 50%; }
  .attachment .icon { width: 14px; height: 14px; }
  .user-photos { display: flex; gap: 5px; margin-bottom: 8px; max-width: 280px; flex-wrap: wrap; justify-content: flex-end; }
  .user-photo-thumb { display: block; padding: 0; border-radius: 14px; cursor: zoom-in; }
  .user-photos img { max-width: 120px; height: 130px; border-radius: 14px; object-fit: cover; }
  .waiting { display: flex; gap: 12px; align-items: center; color: #71766b; padding: 6px 0; font-size: 14px; }
  .waiting-dots { display: flex; gap: 4px; }
  .waiting-dots i { width: 5px; height: 5px; border-radius: 50%; background: #969e8d; animation: pulse 1.3s infinite; }
  .waiting-dots i:nth-child(2) { animation-delay: .15s; }
  .waiting-dots i:nth-child(3) { animation-delay: .3s; }
  .waiting-note { font-size: 11px; color: var(--muted); margin-top: 10px; }
  .image-generation { position: relative; width: 100%; max-width: 344px; aspect-ratio: 1; overflow: hidden; border-radius: 18px; margin-top: 12px; background-color: #f5f8fc; background-image: radial-gradient(circle, #2d6dcc30 .8px, transparent 1px); background-size: 10px 10px; background-position: center; }
  .image-generation.is-drawing { background-image: none; }
  .image-generation canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
  .share-photo-dialog { width: min(560px, calc(100vw - 24px)); }
  .share-photo-preview { display: block; width: auto; height: auto; max-width: 100%; max-height: min(44dvh, 380px); margin: 24px auto; border-radius: 16px; object-fit: contain; }
  .share-answer-preview { position:relative;display:flex;flex-direction:column;justify-content:space-between;min-height:230px;margin:24px 0;padding:26px;border-radius:20px;overflow:hidden;background:linear-gradient(145deg,#20232a 0%,#161920 68%,#2449c8 145%);color:#fff; }
  .share-answer-preview::after { content:"";position:absolute;width:220px;height:220px;right:-105px;bottom:-125px;border-radius:50%;background:#4775ff55; }
  .share-answer-preview p { position:relative;z-index:1;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:6;overflow:hidden;font-size:18px;line-height:1.55; }
  .share-answer-preview strong { position:relative;z-index:1;align-self:flex-end;margin-top:24px;font-size:18px; }
  .share-photo-actions { display: flex; justify-content: center; gap: clamp(6px,2vw,18px); }
  .share-action { display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; flex: 1; max-width: 120px; color: var(--ink); font-size: 13px; text-align: center; }
  .share-action:disabled { opacity: .52; }
  .share-action-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #fff; }
  .share-action-icon .icon { width: 23px; height: 23px; }
  .share-social .share-action-icon { background:transparent; }
  .share-network-logo { display:block;width:56px;height:56px;object-fit:contain; }
  .share-photo-note { margin-top: 24px; color: var(--muted); font-size: 13px; text-align: center; }
  .share-link { display: block; width: 100%; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; background: var(--subtle); }
  .error-card { border: 1px solid #f0dcd1; border-radius: 14px; background: #fffaf7; padding: 18px; margin-top: 12px; max-width: 480px; }
  .error-card h3 { font-size: 14px; margin: 0 0 7px; }
  .error-card p { color: #826b5f; font-size: 13px; line-height: 1.6; }
  .error-card button { margin: 10px 0 0 -10px; }
  .response-error { margin-top: 12px; }
  .response-error > p { color: #956017; margin: 0 0 8px; line-height: 1.6; }
  .response-error-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
  .response-error-actions .text-action { margin: 0; padding: 8px 0; min-height: 44px; font-size: 14px; }
  .response-error-actions .response-retry { color: var(--text, #202123); gap: 7px; }
  .response-error-actions .response-edit { color: var(--muted, #737671); }
  .response-retry:disabled { opacity: .45; cursor: default; }
  @keyframes retry-spin { to { transform: rotate(360deg); } }
  @media (prefers-reduced-motion: no-preference) { .response-retry[aria-busy="true"] .icon { animation: retry-spin 1s linear infinite; } }
  .promo-banner { display: flex; align-items: center; gap: 2px; margin: 0 0 8px; padding: 0 4px 0 0; min-height: 38px; border-radius: 999px; background: #e6efff; color: #245ac2; animation: arrive .3s ease-out; }
  .promo-link { display: flex; flex: 1 1 auto; align-items: center; gap: 8px; min-width: 0; min-height: 38px; padding: 0 6px 0 14px; border-radius: 999px; color: inherit; text-decoration: none; font-size: 13px; font-weight: 500; line-height: 1.3; }
  .promo-emoji { flex-shrink: 0; font-size: 15px; line-height: 1; }
  .promo-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .promo-cta { display: inline-flex; align-items: center; gap: 1px; flex-shrink: 0; font-weight: 600; }
  .promo-cta .icon { width: 14px; height: 14px; stroke-width: 2.2; }
  .promo-close { width: 32px; height: 32px; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 50%; color: #4d71c4; }
  .promo-close .icon { width: 16px; height: 16px; stroke-width: 2; }
  .promo-banner.is-leaving { pointer-events: none; }
  @media (hover: hover) { .promo-banner:has(.promo-link:hover) { background: #d9e7ff; } .promo-close:hover { background: #cbdeff; color: #245ac2; } }
  @media (prefers-reduced-motion: reduce) { .promo-banner { animation: none; } }
  .login-nudge { display: flex; align-items: center; gap: 10px; margin: 12px 0 2px; padding: 10px 12px; border-radius: 14px; background: #fff7e6; border: 1px solid #f4e2b8; color: #6b5418; font-size: 13px; line-height: 1.4; animation: arrive .3s ease-out; }
  .login-nudge > .icon { width: 20px; height: 20px; flex-shrink: 0; color: #b7791f; }
  .login-nudge-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .login-nudge-text strong { color: var(--ink); font-weight: 650; }
  .login-nudge-button { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; min-height: 36px; padding: 0 12px 0 16px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; }
  .login-nudge-button .icon { width: 14px; height: 14px; stroke-width: 2.2; }
  .success-dialog .dialog-content { position: relative; overflow: hidden; text-align: center; padding-top: 22px; }
  .success-dialog .dialog-top { justify-content: flex-end; min-height: 0; margin-bottom: 0; }
  .success-hero { display: flex; flex-direction: column; align-items: center; padding: 6px 0 4px; }
  .success-check { width: 96px; height: 96px; animation: success-pop .55s cubic-bezier(.2,.9,.2,1.2) both; }
  .success-disc { fill: #e4f5e9; }
  .success-ring { fill: none; stroke: #1d7a3a; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 252; stroke-dashoffset: 252; transform: rotate(-90deg); transform-origin: 48px 48px; animation: success-draw .6s .15s ease-out forwards; }
  .success-mark { fill: none; stroke: #1d7a3a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: success-draw .4s .6s ease-out forwards; }
  .success-title { margin: 18px 0 0; font-size: 24px; font-weight: 650; letter-spacing: -.3px; }
  .success-subtitle { margin: 8px auto 0; max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.5; }
  .success-offer { margin: 22px 0 0; padding: 18px 18px 16px; border-radius: 18px; background: linear-gradient(180deg, #f3f7ff 0%, #eaf1ff 100%); border: 1px solid #dde7ff; text-align: left; }
  .success-offer-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
  .success-offer-head .icon { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
  .success-benefits { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
  .success-benefits li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; color: #3c3f3a; }
  .success-benefits .icon { width: 16px; height: 16px; margin-top: 2px; color: #1d7a3a; stroke-width: 2.4; flex-shrink: 0; }
  .success-offer .primary-button { margin-top: 16px; min-height: 48px; font-size: 15px; font-weight: 600; }
  .success-dialog .plain-button { margin-top: 10px; }
  .success-dialog .dialog-note { margin-top: 10px; }
  .confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
  .confetti i { position: absolute; top: -12px; left: var(--x); width: var(--s); height: calc(var(--s) * 0.6); background: var(--c); border-radius: 2px; opacity: 0; animation: confetti-fall var(--t) var(--d) cubic-bezier(.25,.6,.4,1) forwards; }
  .confetti i.is-round { border-radius: 50%; height: var(--s); }
  @keyframes success-pop { from { transform: scale(.5); opacity: 0; } 60% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
  @keyframes success-draw { to { stroke-dashoffset: 0; } }
  @keyframes confetti-fall { 0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 1; } 80% { opacity: 1; } 100% { transform: translate3d(calc((var(--s) - 9px) * 6), 380px, 0) rotate(var(--r)); opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { .success-check, .success-ring, .success-mark { animation: none; stroke-dashoffset: 0; } }
  .payment-save-note { margin: 10px 0 16px; padding: 10px 12px; border-radius: 12px; background: #fff7e6; border: 1px solid #f4e2b8; color: #6b5418; font-size: 13px; line-height: 1.45; }
  .payment-save-dialog .primary-button { margin-top: 2px; }
  @media (hover: hover) { .login-nudge-button:hover { background: #3e413b; } }
  @media (max-width: 480px) { .login-nudge { flex-wrap: wrap; } .login-nudge-button { margin-left: 30px; } }
  @media (prefers-reduced-motion: reduce) { .login-nudge { animation: none; } }
  .composer-error { font-size: 12px; color: #a04b30; padding: 0 9px 10px; }
  .composer-error.has-upgrade { color: #60625d; font-size: 13px; line-height: 1.5; padding-bottom: 14px; }
  .composer-upgrade { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 10px; padding: 10px 18px; border-radius: 24px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 550; }
  .composer-upgrade[aria-disabled="true"] { opacity: .6; cursor: wait; }
  .composer-upgrade:focus-visible { box-shadow: 0 0 0 3px #1681fa45; }
  .jump-button { display: flex; align-items: center; gap: 6px; position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line); background: #fff; box-shadow: 0 3px 12px #0000000a; border-radius: 24px; padding: 9px 14px; font-size: 12px; z-index: 2; }
  .jump-button .icon { width: 16px; height: 16px; }
  .offline-bar { position: absolute; top: 0; left: 0; right: 0; background: #fff7e6; color: #796129; text-align: center; padding: 9px 16px; font-size: 12px; z-index: 3; }
  .drop-zone { position: absolute; inset: 12px 24px; z-index: 4; background: #f5f8fffa; border: 2px dashed #a9bafb; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; pointer-events: none; color: var(--accent); }
  .drop-zone .icon { width: 42px; height: 42px; margin-bottom: 8px; }
  .drop-zone span { font-size: 13px; }
  .toast { position: fixed; z-index: 100; left: 50%; bottom: max(32px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(420px, calc(100% - 32px)); width: max-content; background: #282b26; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px; box-shadow: 0 4px 20px #0002; }
  dialog { color: var(--ink); background: #fff; border: 1px solid #eeefea; border-radius: 24px; box-shadow: 0 24px 90px #0002; padding: 0; max-width: min(500px, calc(100vw - 32px)); max-height: calc(var(--viewport-height) - 40px); overflow: auto; overscroll-behavior: contain; margin: auto; }
  dialog::backdrop { background: #171b2459; animation: backdrop-in .22s ease-out; }
  dialog.is-closing::backdrop { animation: backdrop-out .18s ease-in forwards; }
  @keyframes backdrop-in { from { opacity: 0; } }
  @keyframes backdrop-out { to { opacity: 0; } }
  @media (prefers-reduced-motion: reduce) { dialog::backdrop, dialog.is-closing::backdrop { animation: none; } }
  dialog[open] { }
  .dialog-content { padding: 28px; }
  .dialog-top { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
  .dialog-top h2 { font-size: 22px; line-height: 1.3; font-weight: 550; letter-spacing: -.5px; }
  .dialog-top .icon-button { margin: -8px -9px -8px 0; color: #71756c; }
  .dialog-description { color: var(--muted); font-size: 14px; line-height: 1.7; }
  .dialog-description + .dialog-description { margin-top: 14px; }
  .dialog-emblem { display: grid; place-items: center; width: 56px; height: 56px; background: var(--accent-soft); border-radius: 17px; color: var(--accent); margin: 4px 0 24px; }
  .dialog-emblem .icon { width: 27px; height: 27px; }
  .benefit-list { display: grid; gap: 15px; margin: 24px 0; }
  .benefit { display: flex; align-items: center; gap: 12px; font-size: 13px; }
  .benefit .icon { width: 18px; height: 18px; color: #6e8171; }
  .primary-button { display: flex; gap: 8px; justify-content: center; align-items: center; width: 100%; min-height: 46px; border-radius: 13px; padding: 11px 18px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; margin-top: 24px; }
  .primary-button:disabled { background: #f0f1ed; color: #85877f; opacity: 1; }
  .dialog-note { margin-top: 13px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }
  .plain-button { display: block; margin: 12px auto 0; padding: 8px; min-height: 40px; font-size: 13px; color: #62665c; }
  .option-list { display: grid; gap: 5px; margin: 15px 0; }
  .option { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 62px; padding: 12px; border-radius: 12px; text-align: left; }
  .option > .icon { width: 21px; color: #757c6c; }
  .option strong, .option small { display: block; }
  .option strong { font-size: 14px; font-weight: 500; }
  .option small { font-size: 12px; color: var(--muted); margin-top: 3px; }
  .option.is-selected { background: #f2f4f0; }
  .option > .icon:last-child { margin-left: auto; }
  .example-card div { padding: 13px 14px 16px; }
  .plan-options { display: grid; gap: 10px; margin: 24px 0; }
  .plan-option { position: relative; border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px 18px 45px; display: block; cursor: pointer; }
  .plan-option:has(input:checked) { border-color: var(--accent); background: #f8faff; }
  .plan-option input { position: absolute; top: 21px; left: 17px; accent-color: var(--accent); width: 16px; height: 16px; }
  .plan-option strong { display: block; font-size: 14px; font-weight: 550; }
  .plan-option small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
  .mobile-drawer { position: fixed; top: 0; bottom: 0; left: 0; right: auto; margin: 0; width: min(380px, calc(100vw - 24px)); max-height: var(--viewport-height); height: var(--viewport-height); border-radius: 0 18px 18px 0; }
  .mobile-drawer .dialog-content { display: flex; flex-direction: column; height: 100%; padding: max(20px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom)); }
  .mobile-drawer .dialog-top { min-height: 42px; margin-bottom: 20px; align-items: center; }
  .mobile-drawer .dialog-top h2 { display: flex; align-items: center; gap: 10px; min-width: 36px; font-size: 20px; font-weight: 650; }
  .mobile-drawer-logo { display: block; width: 30px; height: 30px; object-fit: contain; }
  .mobile-menu-list { display: grid; gap: 2px; }
  .mobile-drawer .option { min-height: 54px; padding: 10px 8px; gap: 16px; border-radius: 10px; }
  .mobile-drawer .option > .icon { width: 25px; height: 25px; color: var(--ink); }
  .mobile-drawer .option strong { font-size: 16px; font-weight: 450; }
  .mobile-drawer-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 8px; }
  .mobile-drawer .mobile-account { min-height: 58px; }
  .mobile-drawer .legal-links { margin-top: 8px; padding: 0 8px; font-size: 11px; }
  .review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
  .review-grid button { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: left; font-size: 12px; min-height: 44px; }
  .viewer { width: 100vw; max-width: 100vw; height: var(--viewport-height); max-height: var(--viewport-height); border: 0; border-radius: 0; background: #141515; color: #fff; overflow: hidden; }
  .viewer::backdrop { background: #141515; }
  .viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .viewer-toolbar { display: flex; justify-content: space-between; align-items: center; padding: max(12px, env(safe-area-inset-top)) 20px 12px; font-size: 13px; }
  .viewer-controls { display: flex; align-items: center; gap: 8px; }
  .viewer .icon-button { color: #fff; background: #ffffff0d; }
  .viewer-stage { overflow: hidden; position: relative; touch-action: none; user-select: none; min-width: 0; min-height: 0; }
  /* The photo must fit the stage without contributing its intrinsic size to the grid. */
  .viewer-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; cursor: zoom-in; transform-origin: center; will-change: transform; -webkit-user-drag: none; }
  .viewer-image.is-zoomed { cursor: grab; }
  .viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: #15151599; color: #fff; display: grid; place-items: center; border-radius: 50%; z-index: 1; }
  .viewer-arrow.previous { left: 20px; }
  .viewer-arrow.previous .icon { transform: rotate(180deg); }
  .viewer-arrow.next { right: 20px; }
  .viewer-footer { text-align: center; padding: 14px 20px max(18px, env(safe-area-inset-bottom)); color: #b9bdb8; font-size: 12px; }
  .noscript { position: fixed; inset: 0; background: #fff; padding: 80px 24px; z-index: 5; text-align: center; }
  .noscript p { margin: 16px 0; }
  .noscript a { color: var(--accent); text-decoration: underline; }
  @media (hover: hover) { .nav-item:hover, .nav-idea:hover, .icon-button:hover, .mode-button:hover, .option:hover, .review-grid button:hover { background: #eaece680; } .suggestion:hover { background: var(--subtle); border-color: #d8dbd0; } .inspiration-link:hover, .text-action:hover { color: var(--accent); } .login-button:hover, .primary-button:not(:disabled):hover { background: #3e413b; } .example-card:hover { border-color: #b9c2d6; } .media-thumb img { transition: transform .2s; } .media-thumb:hover img { transform: scale(1.02); } }
  @keyframes arrive { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes pulse { 0%, 70%, 100% { opacity: .35; } 35% { opacity: 1; } }
}
@layer responsive {
  @media (max-width: 760px) {
    .image-settings-dialog { max-width: 100%; width: 100%; max-height: calc(var(--viewport-height) - 20px); margin: auto 0 0; border-radius: 24px 24px 0 0; border-bottom: 0; }
    .image-settings-dialog .dialog-content { padding: 20px 20px max(22px, env(safe-area-inset-bottom)); }
    .image-settings-dialog .dialog-top { margin-bottom: 16px; }
    .image-settings-dialog .dialog-top h2 { font-size: 17px; }
    .image-setting-group { margin-top: 19px; }
    .image-cost { padding: 8px 5px; font-size: 10px; }
    .image-model-row { padding: 12px 8px; }
  }
  @media (max-width: 360px) {
    .image-settings-dialog .dialog-content { padding-left: 15px; padding-right: 15px; }
    .format-choices { gap: 4px; }
    .composer-tools { gap: 1px; }
    .mode-button { padding: 7px 5px; gap: 4px; }
    .image-settings-footer { gap: 12px; }
    .image-model-row small { font-size: 9px; }
  }
  @media (min-width: 1600px) { :root { --sidebar: 250px; } .welcome { padding-bottom: 88px; } }
  @media (max-width: 1050px) { :root { --sidebar: 200px; } .sidebar { padding-left: 9px; padding-right: 9px; } .nav-idea { font-size: 11px; } .topbar { padding-left: 22px; padding-right: 22px; } .desktop-title { display: none; } }
  @media (max-width: 760px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: none; }
    .topbar { min-height: 66px; padding: max(12px, env(safe-area-inset-top)) 16px 10px 10px; gap: 6px; }
    .topbar-left, .topbar-right { gap: 8px; }
    .mobile-menu { display: inline-grid; }
    .mobile-brand { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.7px; }
    .preview-label { font-size: 9px; gap: 4px; padding: 10px 4px; }
    .login-button { min-height: 36px; padding: 7px 15px; font-size: 12px; }
    .scroller { padding: 0 18px; scrollbar-gutter: auto; }
    .welcome { padding: 30px 0 38px; }
    .welcome-mark { margin-bottom: 25px; width: 47px; height: 47px; border-radius: 15px; }
    .welcome h1 { font-size: 32px; letter-spacing: -1.25px; max-width: 330px; margin: auto; }
    .welcome-description { font-size: 15px; margin-top: 16px; }
    .suggestions { gap: 8px; margin-top: 29px; }
    .suggestion { padding: 10px 12px; font-size: 12px; gap: 6px; }
    .suggestion .icon { width: 16px; height: 16px; }
    .composer-area { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
    .composer { border-radius: 24px; padding: 15px 10px 9px; }
    .composer textarea { font-size: 16px; padding-left: 7px; padding-right: 7px; }
    .composer textarea::placeholder { font-size: 14px; }
    .composer-toolbar { margin-top: 12px; }
    .composer-note { margin-top: 8px; font-size: 10px; }
    .promo-banner { margin-bottom: 6px; min-height: 36px; }
    .promo-link { min-height: 36px; padding-left: 12px; font-size: 12.5px; }
    .thread { padding: 22px 0 25px; }
    .user-bubble { max-width: 90%; font-size: 15px; padding: 12px 16px; }
    .message-body { font-size: 15px; line-height: 1.75; }
    .media-grid { max-width: 100%; }
    .media-grid.count-1, .image-generation { max-width: 300px; }
    .message { margin-bottom: 26px; }
    dialog { max-width: calc(100vw - 24px); border-radius: 22px; }
    .dialog-content { padding: 23px; }
    .dialog-top h2 { font-size: 21px; }
    .example-card div { padding: 11px; }
    .viewer, .mobile-drawer { max-width: 100vw; border-radius: 0; }
    .viewer-toolbar { padding-left: 12px; padding-right: 12px; }
    .viewer-arrow.previous { left: 10px; }
    .viewer-arrow.next { right: 10px; }
    .viewer-arrow { width: 38px; height: 38px; }
  }
  @media (max-width: 480px) { .promo-cta > span { display: none; } }
  @media (max-width: 374px) { .preview-label .status-dot { display: none; } .topbar-right { gap: 4px; } .preview-label { font-size: 9px; } .mobile-brand { font-size: 17px; } .welcome h1 { font-size: 29px; } .suggestions { gap: 7px; } .suggestion { font-size: 11px; padding: 9px 10px; } }
  @media (max-height: 600px) and (max-width: 760px) { .welcome { padding: 22px 0; } .welcome-mark { display: none; } .welcome h1 { font-size: 27px; } .welcome-description { margin-top: 10px; } .suggestions { margin-top: 19px; } .inspiration-link { margin-top: 8px; } .composer-note { display: none; } }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
}

/* Composer styling follows the reference; settings and image costs stay MaxGPT's. */
@layer responsive {
  .main.is-empty { grid-template-rows: auto minmax(0, 1fr) auto auto minmax(0, 1.3fr); }
  .main.is-empty .topbar { grid-row: 1; }
  .main.is-empty .conversation-area { grid-row: 3; }
  .main.is-empty .composer-area { grid-row: 4; }
  .main.is-empty .scroller { height: auto; overflow: visible; }
  .welcome { padding: 0 0 30px; }
  .welcome h1 { font-size: 32px; font-weight: 400; letter-spacing: -.7px; max-width: none; text-wrap: balance; }
  .welcome-description { margin: 14px auto 0; max-width: 430px; font-size: 15px; line-height: 1.6; text-wrap: balance; }
  .composer-area { min-width: 0; }
  .composer { display: grid; grid-template-columns: 40px auto minmax(0, 1fr) auto; grid-template-areas: "add settings input send"; align-items: center; gap: 0 10px; min-width: 0; min-height: 64px; padding: 10px; border-radius: 32px; border: 1px solid #ededeb; background: #f5f5f4; box-shadow: none; }
  .composer.has-attachments { grid-template-areas: "attachments attachments attachments attachments" "add settings input send"; }
  .composer:focus-within { border-color: #e2e2df; box-shadow: none; }
  .composer-add { grid-area: add; }
  .attach-button.is-mode { background: #e1eeff; color: #087af0; }
  .composer-input { grid-area: input; display: flex; align-items: center; min-width: 0; flex-wrap: wrap; cursor: text; }
  .composer textarea { flex: 1 1 80px; width: 0; padding: 0 2px; font-size: 16px; line-height: 1.65; min-height: 28px; }
  .composer textarea::placeholder { font-size: 16px; color: #858585; }
  .composer.has-text .composer-input { row-gap: 6px; }
  .composer.has-text.has-mode textarea { flex-basis: 100%; width: 100%; }
  .composer-label:not(.sr-only) { flex-basis: 100%; padding: 0 2px; font-size: 13px; line-height: 1.45; font-weight: 550; color: var(--ink); }
  .composer.has-mode .composer-input { row-gap: 4px; }
  .composer.has-mode textarea { flex-basis: 100%; width: 100%; min-width: 0; }
  .composer-settings { grid-area: settings; display: flex; align-items: center; justify-self: start; gap: 8px; min-width: 0; max-width: 100%; }
  .active-mode-control { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 8px; width: 66px; height: 40px; padding: 0 10px; border-radius: 22px; background: #e1eeff; color: #087af0; }
  .active-mode-control .icon { width: 21px; height: 21px; flex-shrink: 0; }
  .active-mode-control .icon.small { width: 14px; height: 14px; }
  .active-mode-control:hover { background: #d3e6ff; }
  .mode-button { display: flex; align-items: center; gap: 8px; width: auto; min-width: 0; max-width: 210px; height: 40px; min-height: 40px; padding: 0 12px; font-size: 14px; color: var(--ink); border-radius: 22px; background: #e9e9e7; }
  .mode-button .icon { width: 14px; height: 14px; flex-shrink: 0; transform: rotate(90deg); }
  .mode-button:hover { background: #e1e1de; color: var(--ink); }
  .image-cost { font-size: 10px; min-height: 18px; padding: 0 24px 0 3px; color: #858585; }
  .image-cost:hover { background: transparent; color: var(--ink); }
  .send-group { grid-area: send; gap: 6px; }
  .send-button { width: 40px; height: 40px; background: #2e6bc7; }
  .send-button .icon { stroke-width: 2.4; }
  .send-button:disabled { background: #e5e5e2; color: #a1a19c; }
  .attachment-list { grid-area: attachments; margin: 0; padding: 7px 6px 12px; }
  .suggestions { margin-top: 22px; gap: 10px; }
  .suggestion { background: #fff; border-color: #e7e7e4; color: #64645f; }
  .suggestion .icon { color: #73766f; }
  .composer-note { margin-top: 12px; }
  .menu-mode-summary { margin: 0 0 4px; padding: 0 0 4px; border-bottom: 1px solid var(--line); }
  .add-menu .menu-mode-summary button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 6px 8px; border-radius: 16px; text-align: left; font-size: 14px; color: var(--ink); background: none; }
  .main.is-empty.is-compact { grid-template-rows: auto minmax(0, 1fr) auto; }
  .main.is-empty.is-compact .conversation-area { grid-row: 2; }
  .main.is-empty.is-compact .composer-area { grid-row: 3; }
  .main.is-empty.is-compact .scroller { height: 100%; overflow-y: auto; }
  .main.is-empty.is-compact .welcome { margin: auto; padding: 12px 0; }
  .main.is-empty.is-compact .add-menu { top: auto; bottom: calc(100% + 14px); }
  .main.is-compact .composer textarea { max-height: 90px; }
  .main.is-compact .composer-note { display: none; }
  @media (max-width: 760px) {
    .welcome { margin: auto; padding: 0 0 26px; }
    .welcome h1 { font-size: 29px; font-weight: 400; letter-spacing: -.6px; max-width: 350px; }
    .welcome-description { max-width: 320px; padding: 0 8px; margin-top: 12px; font-size: 14px; }
    .composer-area { padding: 8px 16px max(12px, env(safe-area-inset-bottom)); }
    .composer { grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "input input input" "add settings send"; min-height: 0; padding: 8px 8px 7px; border-radius: 25px; gap: 6px 8px; }
    .composer.has-attachments { grid-template-areas: "attachments attachments attachments" "input input input" "add settings send"; }
    .composer-input { grid-area: input; padding: 0 7px; min-height: 28px; }
    .composer textarea { line-height: 1.5; }
    .composer-add { grid-area: add; }
    .composer-settings { grid-area: settings; justify-self: start; padding: 0; background: none; gap: 8px; }
    .active-mode-control { height: 36px; }
    .mode-button { width: auto; height: 36px; min-height: 36px; font-size: 13px; gap: 6px; padding: 0 10px; }
    .image-cost { min-height: 12px; font-size: 9px; line-height: 1.2; padding: 0; }
    .send-group { grid-area: send; }
    .attach-button { width: 36px; height: 36px; background: #e9e9e7; }
    .attach-button.is-mode { background: #e1eeff; color: #087af0; }
    .send-button { width: 36px; height: 36px; }
    .attachment-list { grid-area: attachments; gap: 8px; padding: 0 0 6px; }
    .attachment { width: 56px; height: 56px; }
    .attachment img { border-radius: 15px; border-color: #dedfdb; object-position: center top; }
    .attachment button { top: 0; right: 0; width: 28px; height: 28px; border: 0; background: transparent; }
    .attachment button::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0002; }
    .attachment button .icon { position: relative; width: 11px; height: 11px; stroke-width: 2; }
    .composer-note { margin-top: 8px; }
    .suggestions { margin-top: 24px; }
    .suggestion { padding: 10px 13px; font-size: 12px; }
    .main.is-empty .add-menu { top: auto; bottom: calc(100% + 14px); }
  }
  @media (max-height: 600px) {
    .main.is-empty { grid-template-rows: auto minmax(0, 1fr) auto; }
    .main.is-empty .conversation-area { grid-row: 2; }
    .main.is-empty .composer-area { grid-row: 3; }
    .main.is-empty .scroller { height: 100%; overflow-y: auto; }
    .main.is-empty .welcome { margin: auto; padding: 16px 0; }
    .main.is-empty .add-menu { top: auto; bottom: calc(100% + 14px); }
  }
}

/* Live balance, checkout and durable history. */
.balance-button {border:0;border-radius:999px;background:#e6efff;color:#245ac2;padding:10px 18px;font-size:13px;font-weight:600;white-space:nowrap;min-height:38px;cursor:pointer}
.balance-button:hover {background:#d9e7ff}.balance-button:disabled {opacity:.65;cursor:wait}
.load-history {display:block;margin:12px auto 20px;padding:10px 16px;border:1px solid var(--line);border-radius:24px;background:white;font-size:13px;color:var(--muted);cursor:pointer}
.context-divider {font-size:12px;color:var(--muted);text-align:center;padding:22px 0 8px}
.plan-options {border:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:24px 0 16px}
.plan-option {border:1px solid var(--line);border-radius:16px;padding:16px 8px;display:flex;flex-direction:column;align-items:center;gap:8px;cursor:pointer;color:var(--ink)}
.plan-option input {position:absolute;opacity:0;pointer-events:none}.plan-option:has(input:checked) {border-color:#2c6ccb;background:#eef5ff;box-shadow:inset 0 0 0 1px #2c6ccb}.plan-option strong {font-size:17px}.plan-option small {font-size:15px;color:var(--muted)}
.checkout-form {display:flex;flex-direction:column;gap:10px;margin-top:24px}.checkout-label {font-size:14px;font-weight:600}.receipt-email {border:1px solid var(--line);border-radius:12px;background:white;color:var(--ink);padding:13px 14px;font:inherit;font-size:16px;min-width:0}.receipt-email:focus {outline:none;border-color:#8a9fbc}
.checkout-form .primary-button {margin-top:8px;min-height:48px}.checkout-error {color:#a43030;font-size:13px;margin:0}.dialog-note {font-size:12px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}.dialog-description {line-height:1.55;color:var(--muted)}
.purchase-dialog .setting-hint {line-height:1.5}.attachment.is-uploading img {opacity:.5}.upload-spinner {position:absolute;left:calc(50% - 10px);top:calc(50% - 10px);height:20px;width:20px;border:2px solid #ffffff80;border-top-color:#2b6bc9;border-radius:50%;animation:upload-spin 1s linear infinite;pointer-events:none}
@keyframes upload-spin {to {transform:rotate(360deg)}}
.message-body pre {overflow:auto;border-radius:14px;padding:16px;background:#f3f3f3;font-size:13px;max-width:100%}.message-body :not(pre)>code {background:#f2f2f2;border-radius:4px;padding:2px 4px}.message-body a {color:#2b6bc9;text-decoration:underline}.message-actions a {text-decoration:none;display:inline-flex;align-items:center;gap:6px}.message-actions .icon {width:18px;height:18px}
@media(max-width:760px){.balance-button{padding:9px 12px;font-size:12px}.topbar-right{gap:6px}.topbar-left{gap:10px}.purchase-dialog .dialog-content{padding:22px}.plan-option{padding:15px 5px}}

.paywall-photo{margin:0 0 20px;height:154px;overflow:hidden;position:relative;border-radius:18px;background:#f1f1ef}.paywall-photo img{width:100%;height:100%;object-fit:cover;filter:blur(9px);transform:scale(1.12)}.paywall-photo figcaption{position:absolute;inset:auto 0 0;padding:20px 12px 10px;color:white;background:linear-gradient(transparent,#0008);font-size:12px;text-align:center}.plan-option:has(input:disabled){opacity:.4;cursor:default}.support-link,.legal-link{color:#2866b7;text-decoration:underline}.support-link{display:inline-block;font-size:13px;margin-top:8px}
.message-paywall{max-width:100%}.paywall-heading{font-size:16px;margin:0 0 14px;font-weight:550}.locked-photo{position:relative;width:300px;max-width:100%;height:360px;border-radius:22px;overflow:hidden;isolation:isolate;display:grid;place-items:center;background:radial-gradient(ellipse at 20% 15%,#d5c9bd,transparent 70%),radial-gradient(ellipse at 70% 85%,#777c98,transparent 70%),#8f918d;box-shadow:inset 0 0 0 1px #00000008}.locked-photo-source{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:blur(20px) saturate(.85);transform:scale(1.16)}.locked-photo::after{content:'';position:absolute;inset:0;background:#18192320;pointer-events:none}.locked-photo-noise{position:absolute;inset:0;width:100%;height:100%;z-index:1;pointer-events:none}.locked-photo-action{position:relative;z-index:2;display:flex;align-items:center;gap:9px;min-height:48px;padding:13px 18px;border-radius:999px;background:#ffffffe6;color:var(--ink);box-shadow:0 1px 5px #00000012;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}.locked-photo-action strong{font-size:14px;font-weight:600}.locked-photo-action .icon{width:20px;height:20px}@media(hover:hover){.locked-photo:hover .locked-photo-action{background:#fff}}.paywall-caption{font-size:12px;color:var(--muted);margin-top:10px}.message-paywall .assistant-heading{margin-bottom:14px}

.locked-photo-action{max-width:calc(100% - 24px);justify-content:center}.locked-photo-action strong{line-height:1.35;text-align:center}.locked-photo-action .icon{flex-shrink:0}
@media(max-width:360px){.purchase-dialog .dialog-top h2{font-size:18px}}
.purchase-dialog .plan-option{gap:5px;padding:20px 5px 14px}
.purchase-dialog .plan-option strong{font-size:14px;font-weight:600}
.plan-total{font-size:21px;line-height:1.3;font-weight:650;letter-spacing:-.5px}
.purchase-dialog .plan-unit{font-size:10px;margin-top:0;white-space:nowrap}
.plan-value{position:absolute;top:-10px;left:50%;transform:translateX(-50%);padding:2px 7px;border-radius:6px;background:#edf3ee;color:#37633d;font-size:10px;font-weight:600;line-height:1.5;white-space:nowrap}
.purchase-outcome{display:flex;align-items:flex-start;gap:9px;font-size:14px;line-height:1.5;margin:18px 0 8px;font-weight:550}
.purchase-outcome .icon{width:18px;height:18px;margin-top:2px;color:#46764d}
.purchase-trust{text-align:center;font-size:12px;line-height:1.5;color:var(--muted);margin-top:10px}
.purchase-dialog .checkout-form{margin-top:18px}.purchase-dialog .checkout-form .primary-button{font-weight:600}
.billing-dialog {width:500px}
.billing-options {grid-template-columns:1fr;gap:9px;margin:20px 0 14px}
.purchase-dialog .billing-plan {display:grid;grid-template-columns:20px minmax(0,1fr) auto;gap:12px;padding:14px 16px;text-align:left;align-items:center}
.billing-plan input {position:static;opacity:1;pointer-events:auto;width:18px;height:18px;margin:0;accent-color:#2854ef}
.billing-plan-summary {display:grid;gap:2px;min-width:0}
.purchase-dialog .billing-plan-summary strong {font-size:16px;line-height:1.4}
.billing-plan-summary > span {font-size:12px;line-height:1.45}
.billing-plan-summary small {font-size:11px;line-height:1.5;margin:0;color:var(--muted)}
.billing-plan-price {text-align:right;white-space:nowrap}
.purchase-dialog .billing-plan-price strong {font-size:21px;font-weight:650;letter-spacing:-.4px}
.billing-plan-price small {font-size:11px;margin:0}
.billing-dialog .purchase-outcome {font-size:13px;margin:14px 0 6px}
.billing-dialog .dialog-description {font-size:14px}
.billing-renewal {font-size:12px;line-height:1.55;color:#565952;margin:2px 0 0}
.billing-fineprint {font-size:11px;line-height:1.5;color:var(--muted);margin-top:14px}
.billing-terms {margin-top:14px;margin-bottom:0}
.billing-balance {font-size:32px;line-height:1.25;font-weight:650;letter-spacing:-1px;margin-bottom:12px}
.billing-section-title {font-size:16px;margin:22px 0 8px;font-weight:600}
.billing-cancel {color:var(--muted);font-size:13px;min-height:44px;text-align:left}
.billing-recovery {border-top:1px solid var(--line);margin-top:24px;padding-top:2px}
.billing-recovery .plain-button {color:var(--accent);min-height:44px;font-size:13px}
.recovery-link-input {width:100%;min-width:0;border:1px solid var(--line);border-radius:9px;background:var(--subtle);padding:12px;font-size:12px;margin-top:12px}
.recovery-actions {display:flex;gap:18px;flex-wrap:wrap;align-items:center}
@media(max-width:360px){.purchase-dialog .billing-plan{padding:12px 10px;gap:8px}.purchase-dialog .billing-plan-price strong{font-size:18px}.billing-plan-summary > span{font-size:11px}.billing-dialog .dialog-content{padding:20px 16px}}

/* Photo geometry is reserved before the file arrives; history never fades in. */
.user-photos img { width:120px; }

/* Text model / reasoning selector, available only in the ordinary chat. */
.composer .attach-button:not(.is-mode),.text-settings-button,.dictation-mic { background:#e9e9e7; }
.text-settings-button { display:inline-flex; align-items:center; gap:7px; min-height:40px; max-width:190px; padding:7px 12px; border-radius:22px; color:#686966; font-size:13px; white-space:nowrap; }
.text-settings-button > span { overflow:hidden; text-overflow:ellipsis; }
.text-settings-button .icon { width:13px; height:13px; flex-shrink:0; transform:rotate(90deg); }
.text-settings-button[aria-expanded=true] { background:#e7e7e5; color:var(--ink); }
.text-settings-popover { position:fixed; inset:auto; margin:0; padding:12px; box-sizing:border-box; width:320px; border:1px solid #e7e7e5; border-radius:24px; background:#f6f6f5; color:var(--ink); box-shadow:0 12px 40px #0000001c,0 2px 8px #0000000a; z-index:100; overflow:auto; overscroll-behavior:contain; }
.text-settings-popover::backdrop { background:transparent; }
.text-model-switch { display:flex; width:100%; flex-direction:column; align-items:center; gap:3px; padding:2px 8px 9px; border-radius:15px; min-height:62px; }
.text-effort-heading { display:flex; align-items:center; gap:6px; font-size:20px; }
.text-effort-heading strong { font-weight:600; }
.text-effort-heading .icon { width:14px; height:14px; color:#777; }
.text-selected-model { display:flex; align-items:center; gap:7px; color:#787976; font-size:12px; }
.text-plan-badge { display:inline-flex; align-items:center; justify-content:center; border-radius:6px; padding:2px 6px; font-size:10px; line-height:16px; font-weight:600; background:#e9edf4; color:#4c6289; flex-shrink:0; }
.text-plan-badge.pro { background:#e8e3f0; color:#65537d; }
.text-effort-gauge { position:relative; padding:8px 3px; }
.text-effort-range { appearance:none; -webkit-appearance:none; display:block; width:100%; height:28px; margin:0; border-radius:20px; background:linear-gradient(to right,#1681fa 0%,#1681fa var(--effort-fill),#dededb var(--effort-fill),#dededb 100%); cursor:pointer; }
.text-effort-range::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:34px; height:34px; border:2px solid #1681fa; border-radius:50%; background:white; box-shadow:0 1px 4px #00000014; position:relative; z-index:2; }
.text-effort-range::-moz-range-thumb { width:30px; height:30px; border:2px solid #1681fa; border-radius:50%; background:white; box-shadow:0 1px 4px #00000014; }
.text-effort-dots { position:absolute; inset:0 18px; display:flex; align-items:center; justify-content:space-between; pointer-events:none; }
.text-effort-dots i { width:4px; height:4px; border-radius:50%; background:#93989480; }
.text-effort-description { margin:6px 0 0; text-align:center; font-size:12px; line-height:1.45; color:#686966; }
.text-settings-popover.is-model-list { padding:5px; display:flex; flex-direction:column; }
.text-settings-popover[popover]:not(:popover-open) { display:none; }
.text-model-list-header { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; min-height:44px; padding:0 2px; }
.text-model-list-header strong { font-size:14px; font-weight:600; }
.text-model-list-header .icon-button { width:40px; height:40px; }
.text-model-back .icon { transform:rotate(180deg); }
.text-model-list { overflow:auto; min-height:0; overscroll-behavior:contain; padding:0 2px 3px; }
.text-model-family { margin:6px 10px 4px; font-size:10px; font-weight:600; color:#8a8b87; }
.text-model-option { display:flex; align-items:center; width:100%; min-height:55px; gap:7px; padding:8px 9px; border-radius:14px; text-align:left; }
.text-model-option[aria-checked=true] { background:#e9eae7; }
.text-model-option-label { flex:1; min-width:0; }
.text-model-option-label strong { display:block; font-size:13px; font-weight:550; line-height:1.4; }
.text-model-option-label small { display:block; margin-top:2px; font-size:10px; line-height:1.4; color:#858580; }
.text-model-check { flex-shrink:0; width:16px; height:16px; }
.text-settings-popover button:focus-visible { box-shadow:inset 0 0 0 2px #3686e9; }
.text-effort-range:focus-visible { box-shadow:0 0 0 3px #1681fa30; }
@media (hover:hover) { .composer .attach-button:not(.is-mode):hover,.text-settings-button:hover,.dictation-mic:hover { background:#e1e1de; } .text-model-switch:hover,.text-model-option:hover { background:#e9eae7; } }
@media (max-width:760px) { .text-settings-button { max-width:180px; min-height:40px; font-size:13px; padding:7px 9px; } }
@media (max-width:760px) {
  .add-menu button { font-size:15px; }
  .text-settings-popover { padding:10px; border-radius:22px; }
  .text-model-switch { min-height:48px; gap:2px; padding:0 6px 4px; border-radius:12px; }
  .text-effort-heading { font-size:18px; line-height:24px; }
  .text-selected-model { font-size:11px; line-height:16px; }
  .text-effort-gauge { padding:0 2px; }
  .text-effort-range { height:44px; background:transparent; }
  .text-effort-range::-webkit-slider-runnable-track { height:24px; border-radius:20px; background:linear-gradient(to right,#1681fa 0%,#1681fa var(--effort-fill),#dededb var(--effort-fill),#dededb 100%); }
  .text-effort-range::-webkit-slider-thumb { width:30px; height:30px; margin-top:-3px; }
  .text-effort-range::-moz-range-track { height:24px; border-radius:20px; background:linear-gradient(to right,#1681fa 0%,#1681fa var(--effort-fill),#dededb var(--effort-fill),#dededb 100%); }
  .text-effort-range::-moz-range-thumb { width:26px; height:26px; }
  .text-effort-description { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
  .text-settings-popover.is-model-list { padding:6px; }
  .text-model-list-header .icon-button { width:44px; height:44px; }
  .text-model-list-header strong { font-size:14px; }
  .text-model-list { padding:0; }
  .text-model-family { height:1px; margin:5px 10px; overflow:hidden; font-size:0; background:#e3e3e0; }
  .text-model-family:first-child { display:none; }
  .text-model-option { min-height:44px; gap:8px; padding:8px 10px; border-radius:12px; }
  .text-model-option[aria-checked=true] { background:transparent; }
  .text-model-option-label strong { font-size:15px; font-weight:450; line-height:22px; }
  .text-model-option-label small { display:none; }
  .text-model-check { width:18px; height:18px; }
}
/* Streaming changes the growing answer in place; no article enter/exit animation. */
.stream-status { color:#777; animation:stream-breathe 1.8s ease-in-out infinite; }
@keyframes stream-breathe { 50% { opacity:.55; } }
.label-text { display:inline-block; }
@supports (-webkit-background-clip:text) or (background-clip:text) {
  .stream-status { color:transparent; background-image:linear-gradient(90deg,#8f9290 0%,#8f9290 36%,#26272a 50%,#8f9290 64%,#8f9290 100%); background-size:240% 100%; -webkit-background-clip:text; background-clip:text; animation:status-shimmer 2.4s linear infinite; }
}
@keyframes status-shimmer { from { background-position:130% 0; } to { background-position:-130% 0; } }
.response-activity {color:#6f706e;font-size:14px;line-height:1.5;margin:-4px 0 14px;max-width:100%;}
.activity-toggle {display:flex;align-items:center;gap:7px;min-height:36px;width:fit-content;max-width:100%;cursor:pointer;list-style:none;border-radius:6px;}
.activity-toggle::-webkit-details-marker {display:none;}
.activity-toggle,.activity-source {-webkit-tap-highlight-color:transparent;}
.activity-toggle::marker {content:'';}
.activity-toggle:focus-visible,.activity-source:focus-visible {outline:2px solid var(--accent,#2855ed);outline-offset:3px;}
.activity-toggle > .icon:last-child {width:13px;height:13px;flex-shrink:0;transition:transform .15s ease;}
details[open] > .activity-toggle > .icon:last-child {transform:rotate(90deg);}
details.is-closing[open] > .activity-toggle > .icon:last-child {transform:none;}
.response-activity details {box-sizing:border-box;}
.activity-plain {min-height:36px;display:flex;align-items:center;}
.activity-content {padding:2px 0 6px;}
.activity-search-status {display:flex;align-items:center;gap:8px;min-height:36px;}
.activity-search-status > .icon,.activity-sources > summary > .icon:first-child {width:19px;height:19px;color:#2b6bc9;flex-shrink:0;}
.activity-source-links {display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 10px;max-width:100%;}
.activity-source {display:inline-flex;align-items:center;gap:6px;max-width:100%;min-height:32px;padding:5px 10px;background:#f0f1ef;border-radius:100px;color:#5f625d;text-decoration:none;font-size:12px;}
.activity-source > .icon {width:15px;height:15px;flex-shrink:0;color:#2b6bc9;}
.activity-source > span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.reasoning-summary-body {margin:8px 0 0 9px;padding-left:18px;border-left:1px solid var(--line);font-size:13px;line-height:1.65;overflow-wrap:anywhere;}
.response-activity [hidden] {display:none !important;}
@media(hover:hover) {.activity-toggle:hover,.activity-source:hover {color:var(--ink);}.activity-source:hover {background:#e7e8e5;}}
@media(pointer:coarse) {.activity-toggle,.activity-search-status,.activity-plain {min-height:44px;}.activity-source {min-height:36px;padding:7px 11px;}}
@media(prefers-reduced-motion:reduce) {.activity-toggle > .icon:last-child {transition:none;}}
.reasoning-summary-body > * {margin:0 0 8px;}
.reasoning-summary-body > :last-child {margin-bottom:0;}
.reasoning-summary-body :is(h1,h2,h3,h4,h5,h6) {font-size:inherit;font-weight:600;line-height:inherit;}
.reasoning-summary-body ul,.reasoning-summary-body ol {padding-left:20px;}
.reasoning-summary-body pre {white-space:pre-wrap;}
.reasoning-summary-body a {color:#2b6bc9;text-decoration:underline;}
@media(prefers-reduced-motion:reduce) { .stream-status {animation:none;color:#777;background:none;} }
/* Dictation takes over the existing composer, preserving its draft underneath. */
.dictation-mic {width:40px;height:40px;}
.dictation-mic .icon {width:22px;height:22px;}
.composer.is-dictating {position:relative;--dictation-control-size:40px;}
/* Keep the existing form as the layout sizer while dictation replaces its controls. */
.composer.is-dictating > :not(.dictation-panel) {visibility:hidden!important;pointer-events:none;}
.dictation-panel {position:absolute;inset:10px;display:grid;grid-template-columns:var(--dictation-control-size) minmax(0,1fr) 34px auto;grid-template-areas:"cancel display time actions";align-items:center;gap:8px;min-width:0;}
.dictation-display {grid-area:display;display:grid;align-items:center;min-width:0;min-height:0;height:100%;overflow:auto;}
.dictation-wave {grid-area:1 / 1;display:flex;align-items:center;justify-content:space-between;gap:2px;height:100%;min-height:0;overflow:hidden;padding:0 4px;}
.dictation-wave i {display:block;flex:1;min-width:1px;max-width:4px;height:3px;max-height:100%;border-radius:4px;background:#7e807d;}
.dictation-toolbar {display:contents;}
.dictation-actions {grid-area:actions;display:flex;align-items:center;justify-content:flex-end;gap:8px;width:calc(var(--dictation-control-size)*2 + 8px);}
.dictation-toolbar .icon-button {width:var(--dictation-control-size);height:var(--dictation-control-size);flex:none;}
.dictation-cancel {grid-area:cancel;border:1px solid #d5d5d2;}
.dictation-time {grid-area:time;font-size:12px;font-variant-numeric:tabular-nums;color:#777975;}
.dictation-send {background:var(--accent);color:#fff;}
.dictation-actions .dictation-send:hover {background:#2776d4;}
.dictation-actions .icon-button:not(.dictation-send) {background:#e7e7e4;}
.dictation-actions .icon-button:not(.dictation-send) .icon {fill:currentColor;}
.dictation-status:not(.sr-only) {grid-area:1 / 1;max-height:100%;overflow:auto;margin:0;font-size:13px;line-height:1.4;color:#6f716c;padding:0 4px;}
.dictation-retry {width:100%;height:var(--dictation-control-size);min-width:0;padding:0 8px;border-radius:24px;color:#fff;background:var(--ink);font-size:13px;}
.dictation-loader {display:grid;place-items:center;width:var(--dictation-control-size);height:var(--dictation-control-size);border-radius:50%;background:#e7e7e4;}
.dictation-loader::after {content:"";width:18px;height:18px;border:2px solid #b9cbed;border-top-color:#2e6bc7;border-radius:50%;animation:dictation-spin .8s linear infinite;}
@keyframes dictation-spin {to {transform:rotate(360deg)}}
.dictation-panel.has-recovered .dictation-display {display:block;}
.dictation-recovered {display:block;min-height:80px!important;max-height:160px;overflow:auto;width:100%!important;}
.dictation-panel button:focus-visible,.dictation-mic:focus-visible {box-shadow:0 0 0 3px #1681fa45;}
@media(max-width:760px) {
  .dictation-panel {inset:8px 8px 7px;grid-template-columns:var(--dictation-control-size) minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) var(--dictation-control-size);grid-template-areas:"display display display" "cancel time actions";gap:6px 8px;}
}
@media(max-width:360px) {.composer.is-dictating {--dictation-control-size:36px;}}
@media(max-width:360px) {.send-group {gap:3px;}.text-settings-button {max-width:130px;padding-left:5px;padding-right:5px;}.dictation-mic {width:36px;height:36px;}}
@media(prefers-reduced-motion:reduce) {.dictation-loader::after {animation:none;}}

/* Account entry uses the same calm blue as the upgrade button. */
.sidebar-account {width:100%;text-align:left;padding:12px 8px;color:#245ac2;font-weight:550;border-radius:10px}
.sidebar-account:hover {background:#e6efff}
.login-dialog {max-width:440px}
.login-body {display:grid;gap:18px}
.login-body .dialog-description,.login-body .dialog-note {margin:0}
.auth-providers {display:grid;gap:12px}
.auth-provider {display:flex;align-items:center;justify-content:center;gap:12px;min-height:54px;width:100%;padding:12px 18px;border:0;border-radius:16px;background:#f1f1ef;color:var(--ink);text-decoration:none;font-size:16px;font-weight:600;cursor:pointer}
.auth-provider:hover {background:#e8e8e5}
.auth-telegram {background:#e6f3fc;color:#1479b0}
.auth-telegram:hover {background:#d8edfc}
.auth-provider-logo {display:block;width:28px;height:28px;object-fit:contain;flex:none}
.auth-provider.is-linked {opacity:1;color:#626963;background:#f0f2ef;cursor:default;justify-content:flex-start}
.auth-provider small {margin-left:auto;font-size:12px;font-weight:400}
.auth-provider:disabled:not(.is-linked) {opacity:.6;cursor:wait}
@media(max-width:760px){
 .login-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:26px 26px 0 0;border-bottom:0}
 .login-dialog .dialog-content{padding:22px 22px max(22px,env(safe-area-inset-bottom))}
}
.login-status {color:var(--muted);font-size:14px;line-height:1.55;margin:0}
.login-status:empty {display:none}
.account-name {font-size:20px;font-weight:600;margin:0;overflow-wrap:anywhere}
.auth-nudge {display:block;width:100%;border:0;border-radius:999px;background:#e6efff;color:#245ac2;padding:14px 18px;font-weight:600;cursor:pointer;margin-top:12px}
.auth-nudge:hover {background:#d9e7ff}

/* A single offer, compared with the current plan. Payment stays in view. */
.value-paywall{width:460px;overflow:hidden;max-height:min(820px,calc(var(--viewport-height) - 32px))}
.value-paywall .dialog-content{display:flex;flex-direction:column;padding:24px 26px 0;max-height:inherit}
.value-paywall .dialog-top{position:relative;justify-content:center;margin:12px 0 6px;flex-shrink:0}
.value-paywall .dialog-top h2{font-size:25px;font-weight:650;text-align:center;line-height:1.18;max-width:350px;letter-spacing:-.65px}
.value-paywall .dialog-top .icon-button{position:fixed;top:14px;right:16px;margin:0}
.value-paywall{position:fixed}
.value-paywall .dialog-top .icon-button{position:absolute;top:-74px;right:-9px}
.paywall-mark{display:grid;place-items:center;margin:14px auto 0;width:44px;height:44px;color:#5550cf;flex-shrink:0}
.paywall-mark .icon{width:40px;height:40px}
.paywall-description{text-align:center;font-size:13px;line-height:1.5;color:var(--muted);margin:5px auto 18px;max-width:360px;flex-shrink:0}
.paywall-tabs{display:flex;background:#f3f3f2;border-radius:24px;padding:3px;margin-bottom:14px;flex-shrink:0}
.paywall-tab{flex:1;min-height:34px;border-radius:20px;font-size:13px;color:#737371}
.paywall-tab[aria-pressed=true]{background:white;color:var(--ink);box-shadow:0 1px 3px #0000000a;font-weight:600}
.paywall-body{overflow:auto;min-height:80px;overscroll-behavior:contain;padding-bottom:12px}
.paywall-comparison{width:100%;border:1px solid #e7e7e7;border-radius:19px;border-spacing:0;padding:9px 5px;font-size:13px;line-height:1.35}
.paywall-comparison th{font-weight:400;text-align:left}
.paywall-comparison th,.paywall-comparison td{padding:13px 9px}
.paywall-comparison thead th{font-size:12px;color:#8b8b87;padding-bottom:14px}
.paywall-comparison tr>*:not(:first-child){text-align:center;white-space:nowrap;font-size:12px;width:65px}
.paywall-comparison tr>*:nth-child(2){color:#969692}
.paywall-comparison tr>*:last-child{color:#5550cf}
.paywall-comparison .icon{width:17px;height:17px;vertical-align:middle}
.paywall-details{display:block;text-align:center;font-size:11px;color:#767671;margin:14px 0 0;text-underline-offset:3px}
.value-paywall .paywall-footer{margin:0;padding:12px 0 16px;background:white;flex-shrink:0;border-top:1px solid #f0f0ee;display:flex;flex-direction:column;gap:9px}
.value-paywall .paywall-footer .primary-button{width:100%;border-radius:28px;min-height:48px;font-size:14px;background:#202123;padding:12px 16px}
.value-paywall .paywall-footer .primary-button:disabled{opacity:.5}
.value-paywall .billing-renewal,.value-paywall .billing-fineprint{text-align:center;font-size:10px;line-height:1.45;margin:0;color:#868681}
.paywall-upgrade-note{font-size:12px;line-height:1.5;margin:0 0 3px;color:#555852;text-align:center}
@media(max-width:760px){
 .value-paywall{width:100%;max-width:100%;max-height:calc(var(--viewport-height) - 12px);margin:auto 0 0;border-radius:26px 26px 0 0;border-bottom:0}
 .value-paywall .dialog-content{padding:20px 20px 0}
 .value-paywall .paywall-footer{padding-bottom:max(18px,env(safe-area-inset-bottom))}
 .value-paywall .dialog-top h2{font-size:24px}
 .paywall-mark{margin-top:16px}
 .paywall-comparison th,.paywall-comparison td{padding:12px 8px}
}
@media(max-height:650px){.value-paywall .paywall-mark{display:none}.value-paywall .dialog-top{margin-top:15px;padding:0 25px}.value-paywall .dialog-top .icon-button{top:-10px;right:-9px}.value-paywall .dialog-top h2{font-size:20px}.value-paywall .paywall-description{margin-bottom:10px}.value-paywall .billing-fineprint{font-size:9px}}
.value-paywall{height:min(780px,calc(var(--viewport-height) - 32px))}
.value-paywall .dialog-content{height:100%;max-height:100%;box-sizing:border-box}
.value-paywall .paywall-body{flex:1;min-height:0}
@media(max-width:760px){.value-paywall{height:min(800px,calc(var(--viewport-height) - 12px))}}

/* The ready-photo offer is sized by its content, keeping the result in view. */
.photo-unlock-dialog{width:420px;max-height:calc(var(--viewport-height) - 24px)}
.photo-unlock-dialog .dialog-content{padding:26px}
.photo-unlock-dialog .dialog-top{gap:10px;margin-bottom:10px}
.photo-unlock-dialog .dialog-top h2{font-size:25px;font-weight:650;letter-spacing:-.6px;line-height:1.2}
.photo-unlock-dialog .dialog-top .icon-button{min-width:44px;min-height:44px;flex-shrink:0}
.photo-unlock-intro{font-size:14px;line-height:1.55;color:#62645e;margin:0;max-width:340px}
.photo-pack-choices{border:0;padding:0;margin:14px 0 10px;display:grid;gap:6px;min-width:0}
.photo-pack-choice{display:flex;align-items:center;gap:12px;padding:10px 14px;min-height:48px;border:1px solid #dedfd9;border-radius:14px;cursor:pointer}
.photo-pack-choice.selected{border-color:var(--accent);background:#f0f5ff;box-shadow:inset 0 0 0 1px var(--accent)}
.photo-pack-choice:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.photo-pack-choice input{width:18px;height:18px;margin:0;accent-color:var(--accent);flex-shrink:0}
.photo-pack-title{font-size:15px;font-weight:550}
.photo-pack-main{display:flex;align-items:center;gap:10px;min-width:0}
.photo-pack-saving{font-size:11px;font-weight:600;line-height:18px;padding:0 8px;border-radius:999px;background:#e4f5e9;color:#1d7a3a;white-space:nowrap}
@media(max-width:360px){.photo-pack-main{flex-direction:column;align-items:flex-start;gap:3px}.photo-pack-title{white-space:nowrap}}
.photo-pack-price{margin-left:auto;font-size:17px;white-space:nowrap}
.photo-pack-choice.unavailable{opacity:.48;cursor:default}
.photo-pack-usage{font-size:12px;color:#62645e;margin:0;line-height:1.5}
.photo-unlock-dialog .photo-unlock-form{margin-top:16px;display:flex;flex-direction:column;gap:12px}
.photo-unlock-dialog .primary-button{margin:0;min-height:50px;border-radius:26px;font-size:14px;padding:12px;font-weight:600}
.photo-unlock-renewal,.photo-unlock-upgrade{font-size:12px;line-height:1.55;color:#62645e;margin:0}
.photo-unlock-renewal .legal-link{color:inherit;text-underline-offset:2px}
.photo-unlock-compare{display:block;min-height:44px;margin:8px auto -10px;padding:10px 18px;font-size:13px;color:#62645e;text-decoration:underline;text-underline-offset:3px}
.photo-offer-back{margin:0 auto 10px;min-height:44px}
@media(max-width:760px){
 .photo-unlock-dialog{width:100%;max-width:100%;margin:auto 0 0;border-radius:26px 26px 0 0;border-bottom:0}
 .photo-unlock-dialog .dialog-content{padding:22px 22px max(22px,env(safe-area-inset-bottom))}
 .photo-unlock-dialog .dialog-top h2{font-size:24px}
}
@media(max-width:360px){
 .photo-unlock-dialog .dialog-content{padding-left:18px;padding-right:18px}
 .photo-unlock-dialog .dialog-top h2{font-size:22px}
 .photo-unlock-dialog .primary-button{font-size:13px}
}
/* CommonMark answers keep their hierarchy and scroll wide content locally. */
.message-body {min-width:0;max-width:100%;}
.math-expression {max-width:100%;}
.math-expression:not([data-math-rendered]) {position:relative;display:inline-block;min-width:28px;min-height:1.15em;color:transparent;vertical-align:-.12em;}
.math-expression:not([data-math-rendered])::after,.math-pending::after {content:"";position:absolute;width:14px;height:14px;border:2px solid #d6d8d2;border-top-color:#73776f;border-radius:50%;animation:math-spin .7s linear infinite;}
.math-expression:not([data-math-rendered])::after {left:50%;top:50%;margin:-7px 0 0 -7px;}
.math-display:not([data-math-rendered]) {display:block;min-height:52px;}
.math-pending {position:relative;min-height:52px;visibility:hidden;}
.math-pending::after {visibility:visible;left:50%;top:26px;margin:-7px 0 0 -7px;}
@keyframes math-spin {to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.math-expression:not([data-math-rendered])::after,.math-pending::after{animation:none;border-top-color:#73776f}}
.math-display {display:block;overflow-x:auto;overflow-y:hidden;margin:18px 0;padding:8px 2px;scrollbar-width:thin;overscroll-behavior-x:contain;}
.math-display > .katex-display {margin:0;}
.math-display > .katex-display > .katex {display:block;width:max-content;min-width:100%;text-align:center;}
.math-expression .katex {font-size:1.12em;}
.math-expression.math-fallback {font-family:ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere;}
.math-display:focus-visible {outline:2px solid #2b6bc9;outline-offset:3px;border-radius:4px;}
.message-body > * + * {margin-top:16px;}
.message-body :is(h1,h2,h3,h4,h5,h6) {font-weight:600;line-height:1.4;margin:24px 0 10px;letter-spacing:-.015em;}
.message-body h1 {font-size:24px;}.message-body h2 {font-size:21px;}.message-body h3 {font-size:18px;}
.message-body :is(h4,h5,h6) {font-size:16px;}
.message-body > :first-child {margin-top:0;}.message-body > :last-child {margin-bottom:0;}
.message-body :is(ul,ol) :is(ul,ol) {margin-top:6px;}
.message-body li > p + p,.message-body blockquote > p + p {margin-top:10px;}
.message-body code,.reasoning-summary-body code {font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em;}
.message-body pre,.reasoning-summary-body pre {white-space:pre;overflow-wrap:normal;max-width:100%;}
.message-body pre code,.reasoning-summary-body pre code {font-size:inherit;}
.message-body hr,.reasoning-summary-body hr {border:0;border-top:1px solid var(--line);margin:24px 0;}
.markdown-table {max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;margin:16px 0;border:1px solid var(--line);border-radius:10px;}
.markdown-table:focus-visible {outline:2px solid var(--accent);outline-offset:2px;}

/* Product direction: focus must never add a browser outline anywhere. */
*:focus,
*:focus-visible,
*:focus-within {outline:none!important;outline-offset:0!important}
.markdown-table table {width:100%;border-collapse:collapse;font-size:.94em;line-height:1.55;}
.markdown-table :is(th,td) {padding:10px 14px;text-align:left;border-bottom:1px solid var(--line);vertical-align:top;min-width:120px;}
.markdown-table th {font-weight:600;background:#f6f6f4;}
.markdown-table tbody tr:last-child td {border-bottom:0;}
.markdown-table .align-left {text-align:left;}.markdown-table .align-center {text-align:center;}.markdown-table .align-right {text-align:right;}
.task-checkbox {width:15px;height:15px;vertical-align:-2px;margin:0 4px 0 0;accent-color:var(--accent);}
.reasoning-summary-body .markdown-table {font-size:inherit;}

/* Files of any type: user chips, assistant download cards, draft attachments, code runs. */
.user-files,.file-cards{display:flex;flex-wrap:wrap;gap:8px;max-width:100%}
.message-user .user-files{justify-content:flex-end;margin-bottom:8px;max-width:340px}
.file-chip{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:8px 12px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);text-decoration:none;font-size:13px;line-height:1.3}
.file-chip .icon{width:18px;height:18px;flex-shrink:0;color:#2b6bc9}
.file-chip-name{min-width:0;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-chip-meta{color:var(--muted);white-space:nowrap;font-size:12px}
.file-card{display:flex;align-items:center;gap:12px;min-width:min(260px,100%);max-width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);text-decoration:none}
.file-card:hover{background:var(--subtle)}
.file-card-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--accent-soft);color:#2b6bc9;flex-shrink:0}
.file-card-icon .icon{width:20px;height:20px}
.file-card-text{display:flex;flex-direction:column;min-width:0;gap:2px}
.file-card-text strong{font-weight:600;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-card-text small{color:var(--muted);font-size:12px}
.file-card-action{margin-left:auto;color:var(--muted);display:flex;flex-shrink:0}
.file-card-action .icon{width:18px;height:18px}
.message-body + .file-cards,.response-activity + .file-cards{margin-top:14px}
.file-cards + .media-grid{margin-top:12px}
.attachment.attachment-file{width:auto;max-width:220px;height:auto;min-height:44px;display:flex;align-items:center;gap:6px;padding:6px 30px 6px 10px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:12px;line-height:1.3}
.attachment.attachment-file > .icon{width:16px;height:16px;flex-shrink:0;color:#2b6bc9}
.attachment-file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.activity-code > summary > .icon:first-child{width:19px;height:19px;color:#2b6bc9;flex-shrink:0}
.code-runs{display:flex;flex-direction:column;gap:10px;margin:6px 0 10px;max-width:100%}
.code-run{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:#fafaf8;max-width:100%}
.code-run-status{padding:8px 12px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--line)}
.code-run-code,.code-run-output{margin:0;padding:12px;font:12px/1.55 ui-monospace,SFMono-Regular,Consolas,monospace;overflow:auto;max-height:320px;white-space:pre;color:var(--ink)}
.code-run-output{border-top:1px dashed var(--line);background:#fff;white-space:pre-wrap;overflow-wrap:anywhere}
.code-run-files{padding:8px 12px;font-size:12px;color:var(--muted);border-top:1px solid var(--line)}
.dictation-login-hint{display:grid;place-items:center;width:56px;height:56px;margin:4px auto 14px;border-radius:50%;background:var(--accent-soft);color:var(--accent)}
.dictation-login-hint .icon{width:26px;height:26px}
.dictation-login-dialog .dialog-description{text-align:center}
.dictation-login-dialog .plain-button{width:100%;margin-top:8px}

/* Video: inline player, rendering placeholder and the settings dialog extras. */
.video-frame{position:relative;width:100%;max-width:510px;margin-top:18px;border-radius:18px;overflow:hidden;background:#0f1113;aspect-ratio:16/9}
.video-frame.is-portrait{max-width:300px}
.video-frame video{display:block;width:100%;height:100%;object-fit:contain;background:#0f1113}
.message-user .user-videos{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-bottom:8px}
.message-user .user-videos .video-frame{max-width:280px;margin:0}
.video-generation{max-width:510px}
.video-generation.is-portrait{max-width:300px}
.generation-note{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0 0;max-width:510px}
.setting-choice .setting-choice-note{display:block;font-size:10px;color:var(--muted);margin-top:3px;font-weight:400}
.setting-choice[aria-pressed="true"] .setting-choice-note{color:#5d6553}
.video-settings-dialog .quality-choices{flex-wrap:wrap}
.video-settings-dialog .quality-choices .setting-choice{flex:1 1 calc(25% - 6px);min-width:64px}
.text-action.animate-photo .icon{width:18px;height:18px}
@media (max-width: 760px){.video-frame{max-width:100%}.video-frame.is-portrait{max-width:260px}.video-generation{max-width:100%}.video-generation.is-portrait{max-width:260px}}

.stream-fade{display:inline}
.response-activity details.is-animating{will-change:height}

/* Long prompts fold like in ChatGPT: clamp with a fade, a toggle at the bottom. */
.user-bubble.is-collapsible{display:flex;flex-direction:column;gap:6px}
.user-bubble.is-collapsible .user-text{white-space:inherit;overflow-wrap:inherit}
.user-bubble.is-collapsed .user-text{max-height:11.5em;overflow:hidden;-webkit-mask-image:linear-gradient(#000 calc(100% - 2.4em),transparent);mask-image:linear-gradient(#000 calc(100% - 2.4em),transparent)}
.user-expand{display:inline-flex;align-items:center;gap:6px;align-self:flex-start;min-height:32px;padding:4px 0;font-size:14px;color:inherit;opacity:.72}
.user-expand .icon{width:16px;height:16px;transition:transform .2s ease}
.user-expand[aria-expanded="true"] .icon{transform:rotate(180deg)}
@media (hover:hover){.user-expand:hover{opacity:1}}

.send-button.is-stop{background:var(--ink);color:#fff;transition:background .15s}
.send-button.is-stop .icon{fill:#fff;stroke:none;width:26px;height:26px}
.send-button.is-stop:disabled{background:var(--ink);color:#fff;opacity:.6}
@media (hover:hover){.send-button.is-stop:hover{background:#3e413b}}
