@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: light;
  --page: #fbfaf6;
  --sidebar: #f4f0e5;
  --surface: #fffefa;
  --surface-raised: #ffffff;
  --surface-soft: #f7f4ec;
  --ink: #27251f;
  --muted: #77736a;
  --faint: #a8a397;
  --line: #e8e3d7;
  --line-strong: #d9d1bf;
  --gold: #f4c744;
  --gold-hover: #e8b82d;
  --gold-ink: #342a0b;
  --user-bubble: #f8e8b3;
  --danger: #b9473b;
  --focus: #a77d08;
  --hover: #ebe6d9;
  --shadow-soft: 0 2px 8px rgba(43, 36, 17, .035), 0 16px 44px rgba(43, 36, 17, .045);
  --shadow-pop: 0 12px 32px rgba(52, 42, 18, .12);
  --round-sm: 10px;
  --round-md: 15px;
  --round-lg: 22px;
  --logo-filter: brightness(0);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --page: #171817;
  --sidebar: #1e1f1d;
  --surface: #242522;
  --surface-raised: #292a27;
  --surface-soft: #2c2d29;
  --ink: #f3f0e7;
  --muted: #aaa79e;
  --faint: #858278;
  --line: #383933;
  --line-strong: #4a4b43;
  --gold: #efc247;
  --gold-hover: #ffda76;
  --gold-ink: #29210d;
  --user-bubble: #40371f;
  --danger: #ff8f7e;
  --focus: #f2c348;
  --hover: #32332e;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, .12), 0 18px 48px rgba(0, 0, 0, .14);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, .3);
  --logo-filter: brightness(0) invert(1);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; min-height: 100%; margin: 0; }
body { background: var(--page); color: var(--ink); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, textarea { font: inherit; }
button { color: inherit; }
button, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 78%, transparent); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .55; transform: none !important; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--gold-ink); }

.app-shell { display: grid; grid-template-columns: 276px minmax(0, 1fr); width: 100%; height: 100dvh; min-height: 440px; overflow: hidden; background: var(--page); }
.conversation-sidebar { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; gap: 20px; padding: 25px 16px 17px; background: var(--sidebar); border-right: 1px solid var(--line); }
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 3px 6px 5px; }
.brand-logo-slot { display: block; flex: 0 0 54px; width: 54px; height: 54px; border: 0; border-radius: 0; background: transparent; object-fit: contain; filter: var(--logo-filter); }
.brand-copy { min-width: 0; }
.brand-name { font-size: 19px; font-weight: 800; line-height: 1.2; letter-spacing: -.045em; }
.brand-tagline { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; letter-spacing: .005em; }
.new-chat-button { position: relative; display: flex; align-items: center; width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid color-mix(in srgb, var(--gold) 78%, #fff 22%); border-radius: 13px; background: var(--gold); color: var(--gold-ink); text-align: left; font-weight: 800; box-shadow: 0 3px 0 rgba(94, 69, 3, .08), 0 8px 20px rgba(160, 118, 2, .08); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.new-chat-button::before { content: '+'; display: inline-grid; place-items: center; width: 23px; height: 23px; margin-right: 8px; border-radius: 7px; background: rgba(255,255,255,.32); font-size: 19px; font-weight: 500; line-height: 1; }
.new-chat-button:hover, .send-button:hover { transform: translateY(-1px); background: var(--gold-hover); box-shadow: 0 5px 0 rgba(94, 69, 3, .07), 0 11px 23px rgba(160, 118, 2, .12); }
.conversation-navigation { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.conversation-list-heading { margin: 3px 9px 10px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.conversation-list { overflow: auto; margin: 0; padding: 0 2px 6px 0; list-style: none; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
.conversation-list-item { margin: 3px 0; }
.conversation-list-row { display: flex; align-items: center; gap: 3px; min-width: 0; padding: 3px; border: 1px solid transparent; border-radius: 12px; transition: background .16s ease, border-color .16s ease; }
.conversation-list-row:hover { background: color-mix(in srgb, var(--surface) 58%, transparent); }
.conversation-select-button { flex: 1; min-width: 0; overflow: hidden; padding: 9px 9px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.conversation-select-button[aria-current='page'] { background: var(--surface); font-weight: 700; box-shadow: 0 1px 3px rgba(30, 27, 20, .06); }
.conversation-remove-button { flex: 0 0 auto; padding: 7px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); opacity: .62; font-size: 10px; transition: color .15s ease, background .15s ease, opacity .15s ease; }
.conversation-remove-button:hover { background: var(--surface); color: var(--danger); opacity: 1; }
.sidebar-controls { padding-top: 13px; border-top: 1px solid var(--line); }
.theme-toggle-button { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-align: left; font-size: 12px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.theme-toggle-button::before { content: '☾'; display: inline-grid; place-items: center; width: 25px; margin-right: 5px; color: var(--muted); font-size: 18px; }
.theme-toggle-button[aria-pressed='true']::before { content: '☀'; }
.theme-toggle-button:hover { transform: translateY(-1px); border-color: var(--line-strong); background: var(--surface-raised); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--page); }
.chat-header { position: relative; z-index: 1; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; min-height: 68px; gap: 15px; padding: 12px clamp(22px, 4.5vw, 58px); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--page) 92%, transparent); }
.chat-heading-group { min-width: 0; }
.chat-title { overflow: hidden; margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.delete-chat-button { flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.delete-chat-button:hover { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); }
.conversation-view { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 30px clamp(20px, 5vw, 64px) 24px; scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; scroll-behavior: smooth; }
.empty-conversation { display: flex; min-height: 100%; flex-direction: column; align-items: center; justify-content: center; padding: 40px 0; text-align: center; }
.empty-conversation-title { max-width: 580px; margin: 0; color: var(--ink); font-size: clamp(29px, 4vw, 43px); font-weight: 800; line-height: 1.12; letter-spacing: -.06em; }
.empty-conversation-title::after { display: block; max-width: 390px; margin: 17px auto 0; color: var(--muted); content: 'Your ideas, questions, and projects start here.'; font-size: 14px; font-weight: 500; line-height: 1.6; letter-spacing: 0; }
.message-list { display: flex; flex-direction: column; gap: 27px; width: 100%; max-width: 820px; margin: 0 auto; }
.chat-message { min-width: 0; max-width: 88%; animation: message-arrive .22s ease-out both; }
.chat-message--user { align-self: flex-end; }
.chat-message--assistant { align-self: flex-start; width: 100%; }
.message-speaker { margin: 0 0 7px 4px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .025em; }
.chat-message--user .message-speaker { margin-right: 8px; text-align: right; }
.message-content { overflow-wrap: anywhere; padding: 15px 19px; border: 1px solid var(--line); border-radius: var(--round-lg); background: var(--surface); color: var(--ink); line-height: 1.75; white-space: pre-wrap; box-shadow: var(--shadow-soft); }
.chat-message--assistant .message-content { border-top-left-radius: 6px; }
.chat-message--user .message-content { border-color: transparent; border-bottom-right-radius: 6px; background: var(--user-bubble); box-shadow: none; }
.message-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0 0 2px; }
.message-actions button { min-height: 30px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 10px; font-weight: 700; transition: color .15s ease, border-color .15s ease, background .15s ease; }
.message-actions button:hover { border-color: var(--line-strong); background: var(--surface-raised); color: var(--ink); }
.loading-indicator { width: fit-content; max-width: 820px; margin: 20px auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 11px; box-shadow: var(--shadow-soft); }
.loading-indicator::before { display: inline-block; width: 7px; height: 7px; margin-right: 9px; border-radius: 50%; background: var(--gold); content: ''; vertical-align: 1px; animation: breathe 1s ease-in-out infinite alternate; }
.message-composer { display: flex; flex: 0 0 auto; flex-direction: column; gap: 7px; width: calc(100% - 44px); max-width: 850px; margin: 0 auto 22px; padding: 13px 14px 11px 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 5px 18px rgba(43, 36, 17, .045), 0 18px 48px rgba(43, 36, 17, .06); transition: border-color .16s ease, box-shadow .16s ease; }
:root[data-theme='dark'] .message-composer { box-shadow: var(--shadow-soft); }
.message-composer:focus-within { border-color: color-mix(in srgb, var(--focus) 52%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 10%, transparent), var(--shadow-soft); }
.visually-grouped-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.message-input { width: 100%; min-height: 52px; max-height: 190px; resize: vertical; padding: 6px 2px; border: 0; outline: 0 !important; background: transparent; color: var(--ink); font-size: 14px; line-height: 1.6; }
.message-input::placeholder { color: var(--faint); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; }
.chat-status { min-width: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.send-button { min-width: 86px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 11px; background: var(--gold); color: var(--gold-ink); font-size: 12px; font-weight: 800; box-shadow: 0 2px 0 rgba(94, 69, 3, .1); transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }
.send-button::after { margin-left: 5px; content: '↗'; font-size: 14px; }

@keyframes message-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes breathe { from { opacity: .35; transform: scale(.85); } to { opacity: 1; transform: scale(1.15); } }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 228px minmax(0, 1fr); }
  .conversation-sidebar { padding: 18px 12px 13px; gap: 16px; }
  .brand-block { gap: 9px; }
  .brand-logo-slot { flex-basis: 47px; width: 47px; height: 47px; }
  .brand-name { font-size: 17px; }
  .brand-tagline { font-size: 9px; }
  .chat-header { min-height: 60px; }
  .conversation-view { padding-top: 24px; }
}
@media (max-width: 560px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); min-height: 0; }
  .conversation-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 10px 12px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-block { padding: 0; }
  .brand-logo-slot { flex-basis: 42px; width: 42px; height: 42px; }
  .brand-tagline { display: none; }
  .brand-name { font-size: 16px; }
  .new-chat-button { width: auto; min-height: 37px; padding: 0 10px; border-radius: 11px; font-size: 11px; white-space: nowrap; }
  .new-chat-button::before { width: 19px; height: 19px; margin-right: 5px; font-size: 16px; }
  .sidebar-controls { padding: 0; border: 0; }
  .theme-toggle-button { width: 39px; min-height: 37px; justify-content: center; padding: 0; font-size: 0; }
  .theme-toggle-button::before { width: auto; margin: 0; font-size: 17px; }
  .conversation-navigation { grid-column: 1 / -1; max-height: 75px; min-height: 0; overflow: hidden; }
  .conversation-list-heading { display: none; }
  .conversation-list { display: flex; gap: 5px; overflow-x: auto; overflow-y: hidden; padding: 2px 0 5px; }
  .conversation-list-item { flex: 0 0 auto; max-width: 235px; margin: 0; }
  .conversation-list-row { min-height: 34px; padding: 2px 4px; border-color: var(--line); border-radius: 10px; background: var(--surface); }
  .conversation-list-row:hover { background: var(--surface-raised); }
  .conversation-select-button { max-width: 170px; padding: 5px 6px; font-size: 10px; }
  .conversation-remove-button { padding: 5px 5px; font-size: 9px; }
  .chat-header { min-height: 51px; padding: 9px 15px; }
  .chat-title { font-size: 13px; }
  .delete-chat-button { padding: 6px 9px; font-size: 10px; }
  .conversation-view { padding: 17px 13px 15px; }
  .empty-conversation { padding: 30px 0; }
  .empty-conversation-title { font-size: clamp(27px, 8vw, 34px); }
  .empty-conversation-title::after { max-width: 280px; margin-top: 12px; font-size: 12px; }
  .message-list { gap: 22px; }
  .chat-message { max-width: 96%; }
  .message-content { padding: 12px 14px; font-size: 13px; }
  .message-composer { width: calc(100% - 20px); margin-bottom: 10px; padding: 10px 11px 9px 13px; border-radius: 16px; }
  .message-input { min-height: 43px; font-size: 13px; }
  .send-button { min-width: 73px; min-height: 34px; }
  .chat-status { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* Feature controls and file attachments */
.history-heading-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:3px 5px 9px}
.history-heading-row .conversation-list-heading{margin:0 4px}
.archive-view-button{padding:4px 6px;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap}
.archive-view-button:hover,.archive-view-button[aria-pressed='true']{background:var(--surface);color:var(--ink)}
.history-search-wrap{display:block;margin:0 2px 9px}
.history-search{width:100%;height:36px;padding:0 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:11px;outline:0;transition:border-color .15s,box-shadow .15s}
.history-search:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 12%,transparent)}
.history-search::placeholder{color:var(--faint)}
.history-empty{margin:12px 8px;color:var(--muted);font-size:11px}
.conversation-list-row{position:relative}
.row-actions-menu{position:relative;flex:0 0 auto}
.row-actions-menu summary,.chat-actions-menu summary{display:flex;align-items:center;justify-content:center;min-width:31px;height:32px;padding:0 7px;border:1px solid transparent;border-radius:8px;color:var(--muted);cursor:pointer;list-style:none;font-size:15px;font-weight:800;user-select:none}
.row-actions-menu summary::-webkit-details-marker,.chat-actions-menu summary::-webkit-details-marker{display:none}
.row-actions-menu summary:hover,.row-actions-menu[open] summary,.chat-actions-menu summary:hover,.chat-actions-menu[open] summary{border-color:var(--line);background:var(--surface);color:var(--ink)}
.row-menu-popover,.chat-menu-popover{position:absolute;z-index:20;top:calc(100% + 5px);right:0;display:flex;flex-direction:column;min-width:170px;padding:5px;border:1px solid var(--line);border-radius:12px;background:var(--surface-raised);box-shadow:var(--shadow-pop)}
.row-menu-popover button,.chat-menu-popover button{width:100%;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:var(--ink);text-align:left;font-size:11px;cursor:pointer}
.row-menu-popover button:hover,.chat-menu-popover button:hover{background:var(--surface-soft)}
.row-menu-popover button[data-action='delete']:hover{color:var(--danger)}
.pin-mark{flex:0 0 auto;color:var(--muted);font-size:9px;font-weight:700}
.sidebar-controls{display:flex;align-items:center;gap:7px}
.settings-button{display:flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:0 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700;cursor:pointer}
.settings-button:hover{background:var(--surface-raised);border-color:var(--line-strong)}
.settings-button>span:first-child{font-size:16px;color:var(--muted)}
.sidebar-controls .theme-toggle-button{flex:1}

@media(min-width:561px){
  .sidebar-controls .theme-toggle-button{justify-content:center;padding-inline:8px;font-size:0;white-space:nowrap}
  .sidebar-controls .theme-toggle-button::before{width:20px;margin-right:5px}
  .sidebar-controls .theme-toggle-button::after{content:'Next: dark';font-size:10px;font-weight:700}
  .sidebar-controls .theme-toggle-button[aria-pressed='true']::after{content:'Next: light'}
}

.header-actions{display:flex;align-items:center;gap:8px}
.chat-actions-menu{position:relative}
.chat-actions-menu summary{gap:6px;min-width:68px;padding:0 10px;border-color:var(--line);background:var(--surface);font-size:11px;font-weight:700}
.chat-menu-popover{min-width:205px;max-height:min(70vh,480px);overflow:auto}
.menu-divider{height:1px;margin:4px 5px;background:var(--line)}
.branch-indicator{display:block;margin-top:2px;color:var(--muted);font-size:10px}
.branch-indicator[hidden]{display:none}
.conversation-view{position:relative}
.app-shell.is-dragover .conversation-view::after{position:absolute;inset:12px;z-index:8;border:2px dashed var(--focus);border-radius:20px;background:color-mix(in srgb,var(--gold) 12%,var(--page));content:'';pointer-events:none}
.drop-overlay{position:absolute;inset:20px;z-index:9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border-radius:18px;color:var(--ink);pointer-events:none}
.drop-overlay-title{font-size:20px;font-weight:800}
.drop-overlay-note{color:var(--muted);font-size:12px}
.composer-input-row{display:flex;align-items:flex-start;gap:10px}
.attachment-file-input{display:none;position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.attachment-button{display:grid;flex:0 0 34px;place-items:center;width:34px;height:34px;margin-top:5px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--muted);font-size:22px;line-height:1;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.attachment-button:hover{border-color:var(--line-strong);background:var(--hover);color:var(--ink)}
.attachment-button:disabled{opacity:.5;cursor:not-allowed}
.message-input{flex:1;min-width:0;min-height:48px;resize:vertical}
.attachment-list{display:flex;flex-wrap:wrap;gap:8px;max-height:142px;overflow:auto;padding:2px 0}
.attachment-list[hidden]{display:none}
.attachment-card{position:relative;display:flex;align-items:center;gap:9px;min-width:0;max-width:100%;padding:7px 10px 7px 7px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);color:var(--ink)}
.attachment-card--warning{border-color:color-mix(in srgb,var(--danger) 40%,var(--line));background:color-mix(in srgb,var(--danger) 5%,var(--surface))}
.attachment-thumbnail{flex:0 0 38px;width:38px;height:38px;border-radius:8px;background:var(--surface);object-fit:cover}
.file-type-icon{display:grid;flex:0 0 38px;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.03em}
.file-type-icon--code{color:#a57716}.file-type-icon--pdf{color:#bd5547}.file-type-icon--data{color:#4c8b66}
.attachment-info{display:flex;flex-direction:column;min-width:0;max-width:220px;gap:1px}
.attachment-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:700}
.attachment-detail{overflow:hidden;color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:9px}
.attachment-remove-button{display:grid;flex:0 0 22px;place-items:center;width:22px;height:22px;margin-left:2px;border:0;border-radius:50%;background:var(--surface);color:var(--muted);font-size:16px;line-height:1;cursor:pointer}
.attachment-remove-button:hover{background:var(--danger);color:white}
.message-attachments{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}
.message-attachments .attachment-card{background:var(--surface-soft)}
.message-attachments .attachment-detail{max-width:210px}
.composer-buttons{display:flex;flex:0 0 auto;align-items:center;gap:8px}
.stop-button{min-height:38px;padding:0 15px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700;cursor:pointer}
.stop-button:hover{border-color:var(--danger);color:var(--danger)}
.stop-button[hidden],.send-button[hidden]{display:none}
.retry-response-button{align-self:flex-start;padding:8px 11px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--muted);font-size:11px;font-weight:700;cursor:pointer}
.retry-response-button:hover{color:var(--ink);background:var(--surface-soft)}
.streaming-message{width:100%;max-width:820px;margin:22px auto 0;animation:message-arrive .2s ease-out}
.streaming-content{min-height:16px;overflow-wrap:anywhere;color:var(--ink);font-size:14px;line-height:1.75;white-space:pre-wrap}

/* Message editing, markdown, and code blocks */
.chat-message--user .message-actions{justify-content:flex-end;opacity:0;transition:opacity .14s}
.chat-message--user:hover .message-actions,.chat-message--user:focus-within .message-actions{opacity:1}
.message-actions button{cursor:pointer}
.message-actions .is-selected{border-color:color-mix(in srgb,var(--gold) 60%,var(--line));background:color-mix(in srgb,var(--gold) 18%,var(--surface));color:var(--ink)}
.message-edit-form{display:flex;flex-direction:column;gap:9px}
.message-edit-input{width:100%;min-height:86px;padding:12px;border:1px solid var(--focus);border-radius:13px;background:var(--surface);color:var(--ink);font:inherit;line-height:1.65;resize:vertical}
.message-edit-actions{display:flex;justify-content:flex-end;gap:8px}
.message-edit-actions button,.dialog-actions button{min-height:36px;padding:0 13px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font-size:11px;font-weight:700;cursor:pointer}
.message-edit-actions .edit-save-button,.dialog-actions .primary-button{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
.markdown-body{white-space:normal;overflow-wrap:anywhere}
.markdown-body>:first-child{margin-top:0}
.markdown-body>:last-child{margin-bottom:0}
.markdown-body p{margin:0 0 .9em}
.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{margin:1.25em 0 .5em;line-height:1.3;letter-spacing:-.025em}
.markdown-body h1{font-size:1.55em}.markdown-body h2{font-size:1.32em}.markdown-body h3{font-size:1.13em}.markdown-body h4{font-size:1em}
.markdown-body ul,.markdown-body ol{padding-left:1.5em;margin:.55em 0 1em}
.markdown-body li+li{margin-top:.28em}
.markdown-body blockquote{margin:1em 0;padding:2px 0 2px 14px;border-left:3px solid var(--gold);color:var(--muted)}
.markdown-body a{color:color-mix(in srgb,var(--focus) 78%,#2259b0);text-decoration:underline;text-underline-offset:2px}
.markdown-body hr{height:1px;margin:1.2em 0;border:0;background:var(--line)}
.markdown-body :not(pre)>code{padding:.15em .4em;border:1px solid var(--line);border-radius:5px;background:var(--surface-soft);font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em}
.markdown-table-scroll{max-width:100%;overflow:auto;margin:.9em 0;border:1px solid var(--line);border-radius:10px}
.markdown-body table{width:100%;border-collapse:collapse;font-size:.9em}
.markdown-body th,.markdown-body td{min-width:80px;padding:8px 11px;border-bottom:1px solid var(--line);text-align:left}
.markdown-body th{background:var(--surface-soft);font-weight:800}
.markdown-body tr:last-child td{border-bottom:0}
.code-block{overflow:hidden;margin:1em 0;border:1px solid var(--line);border-radius:12px;background:#202522;color:#e9eee9}
.code-block-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:34px;padding:4px 9px 4px 12px;border-bottom:1px solid rgba(255,255,255,.1);background:#292e2b}
.code-language-label{color:#c3c9c2;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:9px;font-weight:700;letter-spacing:.08em}
.copy-code-button{padding:5px 8px;border:1px solid rgba(255,255,255,.16);border-radius:6px;background:transparent;color:#d9ded8;font-size:9px;cursor:pointer}
.copy-code-button:hover{background:rgba(255,255,255,.1)}
.code-block pre{overflow:auto;margin:0;padding:13px 15px;background:#202522;color:#e9eee9;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.65;tab-size:2}
.code-block code{font-family:inherit}
.hljs-comment,.hljs-quote{color:#929b92}.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#d99aff}.hljs-string,.hljs-attr{color:#c8df89}.hljs-number,.hljs-built_in{color:#f0b779}.hljs-title,.hljs-function{color:#80c5e8}.hljs-variable,.hljs-params{color:#f0d591}
.streaming-content:empty::before{content:' ';display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--gold);animation:breathe 1s infinite alternate}

/* Preferences and conversation details */
.app-dialog{width:min(480px,calc(100vw - 28px));max-width:none;max-height:min(86vh,760px);padding:0;overflow:auto;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--ink);box-shadow:var(--shadow-pop)}
.app-dialog::backdrop{background:rgba(20,20,17,.45);backdrop-filter:blur(3px)}
.dialog-panel{padding:20px}
.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:15px}
.dialog-header h2{margin:0;font-size:18px;letter-spacing:-.03em}
.dialog-close-button{display:grid;place-items:center;width:31px;height:31px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft);color:var(--muted);font-size:20px;line-height:1;cursor:pointer}
.dialog-content{font-size:13px}
.settings-form,.rename-form{display:flex;flex-direction:column;gap:13px}
.settings-field{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:11px;font-weight:700}
.settings-field input,.settings-field textarea,.settings-field select{width:100%;padding:10px 11px;border:1px solid var(--line);border-radius:9px;background:var(--page);color:var(--ink);font:inherit;font-weight:500;outline:0}
.settings-field textarea{resize:vertical;line-height:1.5}
.settings-field input:focus,.settings-field textarea:focus,.settings-field select:focus,.rename-form input:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 12%,transparent)}
.rename-form input{width:100%;padding:11px;border:1px solid var(--line);border-radius:9px;background:var(--page);color:var(--ink);font:inherit;outline:0}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:5px}
.stats-list{display:grid;gap:0;margin:0}
.stats-list>div{display:flex;justify-content:space-between;gap:16px;padding:9px 0;border-bottom:1px solid var(--line)}
.stats-list>div:last-child{border-bottom:0}
.stats-list dt{color:var(--muted)}.stats-list dd{margin:0;font-weight:700;text-align:right}

@media(max-width:800px){.sidebar-controls{gap:5px}.settings-button{padding:0 8px}.history-search{height:34px}}
@media(max-width:560px){
  .sidebar-controls{justify-content:flex-end;gap:5px}
  .settings-button{flex:0 0 37px;width:37px;min-height:37px;padding:0;font-size:0}
  .settings-button>span:first-child{font-size:16px}
  .sidebar-controls .theme-toggle-button{flex:0 0 39px;width:39px}
  .history-heading-row{margin:0 3px 5px}
  .history-search-wrap{margin-bottom:5px}
  .history-search{height:31px}
  .conversation-navigation{max-height:118px}
  .conversation-list{max-height:72px}
  .header-actions{gap:5px}
  .chat-actions-menu summary{min-width:54px;padding:0 7px}
  .chat-menu-popover{min-width:190px;max-height:60vh}
  .chat-message--user .message-actions{opacity:1}
  .message-actions{gap:4px}
  .message-actions button{padding:5px 7px;font-size:9px}
  .attachment-card{max-width:100%}
  .attachment-info{max-width:min(52vw,210px)}
  .attachment-list{max-height:115px}
  .composer-input-row{gap:7px}
  .attachment-button{flex-basis:31px;width:31px;height:31px}
  .message-input{min-height:42px}
  .app-dialog{width:calc(100vw - 22px);border-radius:15px}
  .dialog-panel{padding:16px}
}


/* Compact response feedback chooser */
.feedback-control{position:relative;display:inline-flex;align-items:center}
.message-actions .feedback-trigger{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:30px;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:var(--surface-soft);color:var(--muted);font-size:10px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background .14s,border-color .14s,color .14s}
.message-actions .feedback-trigger:hover,.message-actions .feedback-trigger[aria-expanded='true']{border-color:var(--line-strong);background:var(--surface-raised);color:var(--ink)}
.feedback-trigger-icon{font-size:12px;line-height:1}
.feedback-popover{position:absolute;left:0;bottom:calc(100% + 8px);z-index:30;display:flex;flex-direction:column;gap:4px;min-width:205px;max-width:calc(100vw - 28px);padding:6px;border:1px solid var(--line);border-radius:13px;background:var(--surface-raised);box-shadow:var(--shadow-pop);animation:feedback-pop .14s ease-out both}
.feedback-popover[hidden]{display:none}
.message-actions .feedback-popover .feedback-option{display:flex;align-items:center;min-height:36px;padding:7px 10px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--ink);text-align:left;font-size:11px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background .12s,border-color .12s,color .12s}
.message-actions .feedback-popover .feedback-option:hover{border-color:var(--line);background:var(--surface-soft)}
.message-actions .feedback-popover .feedback-option.is-selected{border-color:color-mix(in srgb,var(--gold) 65%,var(--line));background:color-mix(in srgb,var(--gold) 22%,var(--surface));color:var(--ink)}
@keyframes feedback-pop{from{opacity:0;transform:translateY(4px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:560px){.feedback-popover{left:0;bottom:calc(100% + 6px);min-width:198px}.message-actions .feedback-trigger{min-height:29px;padding-inline:9px}}



/* Code boxes and generated files */
.code-block{margin:1em 0;border:1px solid var(--line);border-radius:12px;background:#202522;color:#e9eee9;overflow:hidden;box-shadow:0 3px 12px rgba(0,0,0,.08)}
.code-block-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:7px;min-height:42px;padding:6px 9px 6px 12px;border-bottom:1px solid rgba(255,255,255,.1);background:#292e2b}
.code-block-title{display:flex;align-items:center;min-width:90px;gap:9px}
.code-language-label{color:#d6ddd6;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;font-weight:800;letter-spacing:.06em}
.code-filename{max-width:230px;overflow:hidden;color:#aeb8b1;text-overflow:ellipsis;white-space:nowrap;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px}
.code-block-actions{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px}
.code-block-actions button,.code-edit-actions button{min-height:27px;padding:4px 8px;border:1px solid rgba(255,255,255,.15);border-radius:7px;background:transparent;color:#dce2dc;font-size:9px;font-weight:700;white-space:nowrap;cursor:pointer;transition:background .13s,border-color .13s,color .13s}
.code-block-actions button:hover,.code-edit-actions button:hover{border-color:rgba(255,255,255,.32);background:rgba(255,255,255,.09);color:#fff}
.code-block-actions button:disabled{opacity:.6;cursor:wait}
.code-body{display:grid;grid-template-columns:auto minmax(0,1fr);min-width:0;max-height:560px;overflow:hidden}
.code-block.no-line-numbers .code-body{grid-template-columns:minmax(0,1fr)}
.code-line-numbers{display:flex;flex-direction:column;align-items:flex-end;min-width:39px;padding:13px 9px 13px 6px;border-right:1px solid rgba(255,255,255,.09);background:rgba(255,255,255,.025);color:#7e8981;user-select:none}
.code-line-numbers span{height:1.65em;line-height:1.65em;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px}
.code-block.no-line-numbers .code-line-numbers{display:none}
.code-block pre.code-source{min-width:0;max-height:560px;overflow:auto;margin:0;padding:13px 15px;background:#202522;color:#e9eee9;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.65;tab-size:2;white-space:pre}
.code-block code{display:block;font-family:inherit;white-space:pre}
.code-block.is-wrapped pre.code-source,.code-block.is-wrapped code{white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}
.code-editor{display:block;width:100%;min-height:220px;max-height:65vh;resize:vertical;padding:14px;border:0;border-bottom:1px solid rgba(255,255,255,.1);outline:0;background:#171b19;color:#edf2ec;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.65;tab-size:2;white-space:pre;overflow:auto}
.code-edit-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:6px;padding:7px 9px;background:#292e2b}
.code-edit-actions .code-save-button{border-color:#d5b342;background:#e9c34d;color:#2b250f}
.code-edit-actions .code-save-button:hover{background:#f4d36a;color:#2b250f}
.code-edit-actions .code-reset-button{margin-right:auto}
.hljs-comment,.hljs-quote{color:#9aa59c}.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#dda5ff}.hljs-string,.hljs-attr{color:#d0e995}.hljs-number,.hljs-built_in{color:#ffc078}.hljs-title,.hljs-function{color:#91d6f5}.hljs-variable,.hljs-params{color:#f2dd9c}.hljs-type,.hljs-class{color:#83d9c4}
.generated-file-collection{display:flex;flex-direction:column;gap:8px;margin:15px 0 3px;padding:11px;border:1px solid var(--line);border-radius:13px;background:var(--surface-soft)}
.generated-files-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px}
.generated-files-heading strong{color:var(--ink);font-size:11px}
.download-project-zip{padding:6px 9px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font-size:10px;font-weight:800;cursor:pointer}
.download-project-zip:hover{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 15%,var(--surface))}
.generated-file-card{display:flex;align-items:center;gap:10px;min-width:0;padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink)}
.generated-file-icon{display:grid;flex:0 0 37px;place-items:center;width:37px;height:37px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft);color:var(--muted);font:800 9px ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:-.04em}
.file-icon-py,.file-icon-js,.file-icon-ts,.file-icon-html,.file-icon-css{color:#926b0c}.file-icon-json,.file-icon-csv,.file-icon-xlsx{color:#3e8058}.file-icon-svg{color:#536b9d}.file-icon-pdf{color:#b44f40}.file-icon-docx,.file-icon-pptx{color:#42739e}.file-icon-zip{color:#875dad}
.generated-file-info{display:flex;flex:1;flex-direction:column;min-width:0;gap:2px}
.generated-file-name{overflow:hidden;color:var(--ink);text-overflow:ellipsis;white-space:nowrap;font-size:11px}
.generated-file-meta{color:var(--muted);font-size:9px}
.generated-file-size{color:var(--muted)}
.generated-file-actions{display:flex;flex:0 0 auto;gap:5px}
.generated-file-actions button{min-height:30px;padding:5px 9px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--ink);font-size:10px;font-weight:700;cursor:pointer;transition:background .13s,border-color .13s}
.generated-file-actions button:hover{border-color:var(--gold);background:color-mix(in srgb,var(--gold) 14%,var(--surface))}
.generated-file-actions button:disabled{opacity:.6;cursor:wait}
.app-dialog.preview-dialog{width:min(900px,calc(100vw - 28px));height:min(82vh,760px)}
.preview-dialog .dialog-panel{display:flex;flex-direction:column;height:100%;min-height:0}
.preview-dialog .dialog-header{flex:0 0 auto}
.preview-dialog .dialog-content{flex:1;min-height:0;overflow:auto}
.sandbox-preview-frame{display:block;width:100%;height:100%;min-height:420px;border:1px solid var(--line);border-radius:10px;background:#fff}
.file-preview-markdown{min-height:100%;padding:20px;border:1px solid var(--line);border-radius:11px;background:var(--page);color:var(--ink)}
.file-preview-text{min-height:100%;overflow:auto;margin:0;padding:15px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--ink);font:12px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.svg-file-preview{display:block;max-width:100%;max-height:100%;margin:auto;object-fit:contain}
@media(max-width:700px){
  .code-block-toolbar{align-items:flex-start;flex-direction:column}
  .code-block-title{width:100%}
  .code-block-actions{justify-content:flex-start;width:100%}
  .code-block-actions button{min-height:30px;padding-inline:7px;font-size:9px}
  .code-body{max-height:440px}
  .code-block pre.code-source{max-height:440px;padding:11px 10px;font-size:11px}
  .code-line-numbers{min-width:31px;padding-inline:5px}
  .code-line-numbers span{font-size:11px}
  .generated-file-card{flex-wrap:wrap}
  .generated-file-info{flex-basis:calc(100% - 52px)}
  .generated-file-actions{width:100%;padding-left:47px}
  .generated-file-actions button{flex:1}
  .sandbox-preview-frame{min-height:55vh}
}



/* Spacious navigation menus and Quick Jump */
.quick-jump-button{display:flex;align-items:center;gap:9px;width:100%;min-height:42px;margin:8px 0 11px;padding:0 11px;border:1px solid var(--line);border-radius:11px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700;text-align:left;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.quick-jump-button:hover{border-color:var(--line-strong);background:var(--surface-raised)}
.quick-jump-button:active{transform:translateY(1px)}
.quick-jump-icon{display:grid;place-items:center;width:23px;height:23px;border-radius:7px;background:var(--surface-soft);color:var(--muted);font-size:18px;line-height:1}
.quick-jump-button kbd{margin-left:auto;color:var(--muted);font:10px ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}
.chat-actions-menu summary{width:39px;height:38px;border:1px solid var(--line);border-radius:10px;font-size:19px;letter-spacing:1px}
.row-actions-menu summary{min-width:34px;height:34px;border-radius:9px;font-size:17px}
.row-actions-menu summary:focus-visible,.chat-actions-menu summary:focus-visible,.quick-jump-button:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 44%,transparent);outline-offset:2px}
/* The legacy inline popovers stay in markup for compatibility; visible menus are portaled to body. */
.row-menu-popover,.chat-menu-popover{display:none!important}
.floating-action-menu{position:fixed;z-index:1200;display:flex;flex-direction:column;gap:5px;width:318px;max-width:calc(100vw - 20px);max-height:min(78vh,720px);padding:9px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:17px;background:var(--surface-raised);color:var(--ink);box-shadow:0 12px 32px rgba(25,24,19,.16);animation:menu-pop-in .14s ease-out both;scrollbar-color:var(--line-strong) transparent;scrollbar-width:thin}
.floating-action-menu.is-closing{animation:menu-pop-out .12s ease-in both;pointer-events:none}
.floating-menu-section{display:flex;flex-direction:column;gap:3px}
.floating-menu-section-title{padding:8px 11px 4px;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.11em;text-transform:uppercase}
.floating-menu-item{display:flex;align-items:center;gap:12px;width:100%;min-height:43px;padding:8px 11px;border:0;border-radius:10px;background:transparent;color:var(--ink);text-align:left;font-family:inherit;font-size:13px;font-weight:600;line-height:1.3;cursor:pointer;transition:background .12s,color .12s,transform .12s}
.floating-menu-item:hover,.floating-menu-item:focus-visible{outline:0;background:var(--surface-soft);color:var(--ink)}
.floating-menu-item:active{transform:scale(.99)}
.floating-menu-icon{display:grid;flex:0 0 25px;place-items:center;width:25px;height:25px;border-radius:8px;background:var(--surface-soft);color:var(--muted);font-size:14px;font-weight:800;line-height:1}
.floating-menu-item:hover .floating-menu-icon,.floating-menu-item:focus-visible .floating-menu-icon{background:color-mix(in srgb,var(--gold) 21%,var(--surface));color:var(--ink)}
.floating-menu-item-label{flex:1;min-width:0}
.floating-menu-shortcut{color:var(--muted);font:10px ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}
.floating-menu-separator{height:1px;margin:5px 10px;background:var(--line)}
.floating-menu-item.is-danger{color:var(--danger)}
.floating-menu-item.is-danger .floating-menu-icon{background:color-mix(in srgb,var(--danger) 10%,var(--surface));color:var(--danger)}
.floating-menu-item.is-danger:hover,.floating-menu-item.is-danger:focus-visible{background:color-mix(in srgb,var(--danger) 9%,var(--surface));color:var(--danger)}
@keyframes menu-pop-in{from{opacity:0;transform:translateY(-4px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes menu-pop-out{to{opacity:0;transform:translateY(-3px) scale(.985)}}
.app-dialog.quick-jump-dialog{width:min(600px,calc(100vw - 24px));max-height:min(82vh,760px)}
.quick-jump-panel{display:flex;flex-direction:column;gap:11px;min-height:0}
.quick-jump-search-wrap{display:block}
.quick-jump-search{width:100%;height:46px;padding:0 13px;border:1px solid var(--line);border-radius:12px;background:var(--page);color:var(--ink);font:inherit;font-size:14px;outline:0}
.quick-jump-search:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 14%,transparent)}
.quick-jump-hint{display:flex;align-items:center;justify-content:space-between;gap:10px;color:var(--muted);font-size:11px}
.quick-jump-hint kbd{padding:4px 7px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft);font:10px ui-monospace,SFMono-Regular,Consolas,monospace;white-space:nowrap}
.quick-jump-results{display:flex;flex-direction:column;gap:4px;max-height:min(54vh,490px);overflow-y:auto;padding:2px;overscroll-behavior:contain}
.quick-jump-result{display:flex;flex-direction:column;gap:5px;width:100%;padding:11px 12px;border:0;border-radius:11px;background:transparent;color:var(--ink);text-align:left;cursor:pointer;transition:background .12s}
.quick-jump-result:hover,.quick-jump-result.is-active,.quick-jump-result:focus-visible{outline:0;background:var(--surface-soft)}
.quick-jump-result-top{display:flex;align-items:center;gap:8px;min-width:0}
.quick-jump-title{flex:1;min-width:0;overflow:hidden;font-size:13px;font-weight:750;text-overflow:ellipsis;white-space:nowrap}
.quick-jump-badge{flex:0 0 auto;padding:3px 7px;border-radius:999px;background:var(--page);color:var(--muted);font-size:9px;font-weight:700}
.quick-jump-snippet{display:-webkit-box;overflow:hidden;color:var(--muted);font-size:11px;line-height:1.45;-webkit-box-orient:vertical;-webkit-line-clamp:2}
.quick-jump-result mark{border-radius:3px;background:color-mix(in srgb,var(--gold) 38%,transparent);color:var(--ink)}
.quick-jump-empty{padding:24px 12px;color:var(--muted);text-align:center;font-size:12px}
.quick-jump-empty[hidden]{display:none}
.delete-confirm-panel>p{margin:0 0 18px;color:var(--muted);font-size:13px;line-height:1.6;overflow-wrap:anywhere}
.danger-confirm-button{border-color:color-mix(in srgb,var(--danger) 50%,var(--line))!important;background:color-mix(in srgb,var(--danger) 12%,var(--surface))!important;color:var(--danger)!important}
.danger-confirm-button:hover{background:color-mix(in srgb,var(--danger) 20%,var(--surface))!important}
button:focus-visible,summary:focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 45%,transparent);outline-offset:2px}
@media(max-width:560px){
  .quick-jump-button{min-height:39px;margin:5px 0 7px;padding-inline:8px;font-size:11px}
  .quick-jump-button kbd{font-size:8px}
  .floating-action-menu,.floating-action-menu.is-bottom-sheet{left:10px!important;right:10px!important;top:auto!important;bottom:max(10px,env(safe-area-inset-bottom))!important;width:auto;max-width:none;max-height:min(72dvh,620px);padding:13px 12px calc(13px + env(safe-area-inset-bottom));border-radius:20px 20px 16px 16px;animation:menu-sheet-in .17s ease-out both}
  .floating-action-menu .floating-menu-item{min-height:49px;padding:10px 12px;font-size:14px}
  .floating-menu-icon{width:28px;height:28px;flex-basis:28px}
  .quick-jump-results{max-height:56vh}
  .app-dialog.quick-jump-dialog{width:calc(100vw - 18px);max-height:88vh;border-radius:17px}
  .quick-jump-result{padding:13px 10px}
}
@keyframes menu-sheet-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}



/* Response mode selector */
.composer-meta{display:flex;flex:1;align-items:center;gap:12px;min-width:0}
.model-selector-wrap{display:flex;flex:0 1 auto;align-items:center;gap:7px;min-width:0}
.model-selector-caption{flex:0 0 auto;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.04em}
.model-selector{width:auto;max-width:min(340px,40vw);min-width:0;height:36px;padding:0 28px 0 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--ink);font-family:inherit;font-size:11px;font-weight:600;line-height:1.2;cursor:pointer;outline:0;transition:border-color .14s,background .14s}
.model-selector:hover{border-color:var(--line-strong);background:var(--surface-raised)}
.model-selector:focus-visible{border-color:var(--focus);outline:3px solid color-mix(in srgb,var(--focus) 16%,transparent);outline-offset:1px}
.composer-meta .chat-status{flex:1}
.loading-indicator{font-weight:600}
@media(max-width:700px){.model-selector{max-width:min(300px,48vw)}}
@media(max-width:560px){
  .composer-actions{align-items:center;flex-wrap:wrap;gap:8px}
  .composer-meta{flex:1 1 100%;flex-wrap:wrap;justify-content:space-between;gap:7px}
  .model-selector-wrap{flex:1 1 auto;gap:6px}
  .model-selector{flex:1;width:100%;max-width:none;height:35px;font-size:10px}
  .composer-meta .chat-status{flex:1 1 100%;font-size:10px}
  .composer-buttons{margin-left:auto}
}



/* Unified, auto-growing message composer */
.message-composer{gap:8px;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;transition:none}
.message-composer:focus-within{border-color:transparent;box-shadow:none}
:root[data-theme='dark'] .message-composer{box-shadow:none}
.composer-input-shell{display:flex;align-items:flex-end;gap:9px;min-height:66px;padding:10px 11px 10px 12px;border:1px solid var(--line);border-radius:25px;background:var(--surface);box-shadow:0 2px 10px rgba(43,36,17,.045);transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}
:root[data-theme='dark'] .composer-input-shell{box-shadow:0 3px 15px rgba(0,0,0,.16)}
.composer-input-shell:hover{border-color:var(--line-strong)}
.composer-input-shell:focus-within{border-color:color-mix(in srgb,var(--focus) 58%,var(--line));box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 9%,transparent),0 3px 13px rgba(43,36,17,.05)}
:root[data-theme='dark'] .composer-input-shell:focus-within{box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 16%,transparent),0 4px 17px rgba(0,0,0,.2)}
.message-input{display:block;flex:1 1 auto;width:100%;height:44px;min-width:0;min-height:44px;max-height:180px;resize:none;overflow-x:hidden;overflow-y:hidden;padding:10px 3px;border:0;border-radius:0;outline:0!important;background:transparent;color:var(--ink);font-size:14px;line-height:1.5;scrollbar-width:thin}
.message-input::placeholder{color:var(--faint);opacity:.9}
.message-submit-controls{display:flex;flex:0 0 auto;align-items:flex-end;gap:7px}
.attachment-button{flex:0 0 40px;width:40px;height:40px;margin:0 0 2px;border-radius:13px;background:var(--surface-soft);font-size:22px}
.attachment-button:hover{background:var(--hover)}
.send-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:88px;height:42px;min-height:42px;padding:0 14px;border:0;border-radius:15px;background:var(--gold);color:var(--gold-ink);font-size:12px;font-weight:800;box-shadow:0 2px 5px rgba(94,69,3,.09);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,opacity .16s ease}
.send-button::after{content:none}
.send-button:hover:not(:disabled){transform:translateY(-1px);background:var(--gold-hover);box-shadow:0 4px 11px rgba(94,69,3,.14)}
.send-button:active:not(:disabled){transform:translateY(1px) scale(.98);box-shadow:0 1px 3px rgba(94,69,3,.1)}
.send-button:disabled{opacity:.46;box-shadow:none;cursor:not-allowed}
.send-arrow{font-size:15px;line-height:1;transition:transform .16s ease}
.send-button:hover:not(:disabled) .send-arrow{transform:translate(1px,-1px)}
.message-submit-controls .stop-button{min-height:42px;border-radius:14px}
.composer-actions{min-height:35px;padding:0 7px}
.composer-meta{width:100%;min-height:32px}
.composer-meta .chat-status{line-height:1.4}
@media(max-width:560px){
  .message-composer{width:calc(100% - 20px);margin-bottom:10px;padding:0}
  .composer-input-shell{min-height:60px;gap:6px;padding:8px;border-radius:23px}
  .message-input{height:42px;min-height:42px;max-height:160px;padding:9px 1px;font-size:13px}
  .attachment-button{flex-basis:36px;width:36px;height:36px;margin-bottom:3px;border-radius:12px}
  .send-button{min-width:72px;height:38px;min-height:38px;padding:0 10px;border-radius:13px;font-size:11px}
  .message-submit-controls .stop-button{min-height:38px;padding:0 12px}
  .composer-actions{padding:0 4px}
}



/* Full-screen Chicken AI settings */
.app-shell.is-settings-hidden{display:none!important}
.settings-screen{position:fixed;inset:0;z-index:70;display:flex;flex-direction:column;overflow:hidden;background:var(--page);color:var(--ink);animation:settings-enter .2s ease-out both}
@keyframes settings-enter{from{opacity:.55;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}}
.settings-topbar{position:relative;z-index:3;display:grid;grid-template-columns:minmax(170px,230px) 1fr minmax(240px,340px);align-items:center;gap:24px;min-height:82px;padding:12px clamp(18px,3vw,42px);border-bottom:1px solid var(--line);background:var(--surface)}
.settings-back-button{display:inline-flex;align-items:center;justify-self:start;gap:10px;min-height:40px;padding:0 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font-size:12px;font-weight:700;transition:background .16s,border-color .16s,transform .16s}
.settings-back-button span:first-child{font-size:18px;color:var(--muted)}
.settings-back-button:hover{transform:translateX(-2px);border-color:var(--line-strong);background:var(--surface-soft)}
.settings-top-title{min-width:0}
.settings-eyebrow,.settings-category-eyebrow{color:var(--muted);font-size:9px;font-weight:800;letter-spacing:.16em}
.settings-top-title h1{margin:0;font-size:21px;line-height:1.25;letter-spacing:-.04em}
.settings-search-wrap{position:relative;display:flex;align-items:center;gap:9px;min-width:0;height:42px;padding:0 11px;border:1px solid var(--line);border-radius:13px;background:var(--surface-soft);color:var(--muted);transition:border-color .16s,box-shadow .16s}
.settings-search-wrap:focus-within{border-color:color-mix(in srgb,var(--focus) 60%,var(--line));box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 10%,transparent)}
.settings-search-wrap>span{font-size:20px;line-height:1}
.settings-search-wrap input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:0;background:transparent;color:var(--ink);font:inherit;font-size:12px}
.settings-search-wrap input::placeholder{color:var(--faint)}
.settings-search-wrap kbd{flex:0 0 auto;padding:3px 5px;border:1px solid var(--line);border-radius:5px;background:var(--surface);color:var(--faint);font-size:9px}
.settings-search-results{position:absolute;top:calc(100% + 8px);right:0;left:0;z-index:10;max-height:min(60vh,420px);overflow:auto;padding:5px;border:1px solid var(--line);border-radius:13px;background:var(--surface);box-shadow:var(--shadow-pop)}
.settings-search-result{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;padding:10px;border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left;font-size:12px;cursor:pointer}
.settings-search-result:hover,.settings-search-result:focus-visible{background:var(--surface-soft)}
.settings-search-result small{color:var(--muted);font-size:10px;white-space:nowrap}
.settings-search-result mark{border-radius:3px;background:color-mix(in srgb,var(--gold) 35%,transparent);color:inherit}
.settings-search-empty{padding:12px;color:var(--muted);font-size:12px}
.settings-layout{display:grid;grid-template-columns:250px minmax(0,1fr);flex:1;min-height:0}
.settings-sidebar{min-height:0;overflow:auto;padding:22px 14px;background:var(--sidebar);border-right:1px solid var(--line)}
.settings-category-nav{display:flex;flex-direction:column;gap:4px}
.settings-nav-item{display:flex;align-items:center;gap:12px;width:100%;min-height:42px;padding:0 12px;border:1px solid transparent;border-radius:11px;background:transparent;color:var(--muted);text-align:left;font-size:12px;font-weight:650;cursor:pointer;transition:color .15s,background .15s,border-color .15s,transform .15s}
.settings-nav-item:hover{background:color-mix(in srgb,var(--surface) 65%,transparent);color:var(--ink)}
.settings-nav-item.is-active{border-color:color-mix(in srgb,var(--gold) 30%,var(--line));background:var(--surface);color:var(--ink);box-shadow:0 2px 7px rgba(28,25,16,.045);font-weight:800}
.settings-nav-icon{display:grid;flex:0 0 24px;place-items:center;width:24px;height:24px;border-radius:8px;background:color-mix(in srgb,var(--line) 55%,transparent);color:var(--muted);font-size:14px}
.settings-nav-item.is-active .settings-nav-icon{background:color-mix(in srgb,var(--gold) 28%,var(--surface));color:var(--gold-ink)}
.settings-content-pane{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-color:var(--line-strong) transparent;scrollbar-width:thin}
.settings-content{width:min(100%,900px);margin:0 auto;padding:34px clamp(20px,4.8vw,66px) 70px}
.settings-category-heading{margin:0 0 28px;padding:0 0 20px;border-bottom:1px solid var(--line)}
.settings-category-heading h2{margin:5px 0 5px;font-size:29px;line-height:1.2;letter-spacing:-.055em}
.settings-category-heading p{margin:0;color:var(--muted);font-size:13px}
.settings-section{margin:0 0 30px;padding:0 0 4px}
.settings-section-heading{margin:0 0 9px}
.settings-section-heading h2{margin:0;font-size:14px;font-weight:800;letter-spacing:-.015em}
.settings-section-heading p{margin:4px 0 0;color:var(--muted);font-size:11px;line-height:1.55}
.settings-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,260px);align-items:center;gap:22px;min-height:68px;padding:12px 2px;border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent);transition:background .18s,border-radius .18s,box-shadow .18s}
.settings-row:last-child{border-bottom:0}
.settings-row-copy{min-width:0}
.settings-row-copy h3{margin:0;color:var(--ink);font-size:12px;font-weight:750;line-height:1.4}
.settings-row-copy p{max-width:540px;margin:3px 0 0;color:var(--muted);font-size:10.5px;line-height:1.5}
.settings-row-control{display:flex;justify-content:flex-end;align-items:center;min-width:0}
.settings-select,.settings-text-control,.settings-hex-input{width:min(100%,250px);min-height:37px;padding:7px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:11px;outline:none;transition:border-color .15s,box-shadow .15s}
.settings-select:focus,.settings-text-control:focus,.settings-hex-input:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 12%,transparent)}
.settings-select:disabled,.settings-range:disabled{opacity:.5;cursor:not-allowed}
.settings-row-control .model-selector{width:min(100%,300px);min-height:38px;padding:8px 30px 8px 11px}
.settings-text-control{font-size:12px}
textarea.settings-text-control{width:100%;min-height:106px;resize:vertical;line-height:1.6}
.settings-row:has(textarea.settings-text-control){grid-template-columns:minmax(0,1fr);gap:8px;align-items:start;padding:14px 2px}
.settings-row:has(textarea.settings-text-control) .settings-row-control{justify-content:stretch}
.settings-row:has(textarea.settings-text-control) .settings-row-control textarea{max-width:none}
.settings-character-count{padding:5px 2px 0;color:var(--faint);text-align:right;font-size:9px}
.settings-switch{position:relative;display:inline-flex;flex:0 0 auto;align-items:center;cursor:pointer}
.settings-toggle-input{position:absolute;width:1px;height:1px;overflow:hidden;opacity:0}
.settings-toggle-visual{position:relative;display:block;width:39px;height:23px;border:1px solid var(--line-strong);border-radius:99px;background:var(--surface-soft);transition:background .18s,border-color .18s,box-shadow .18s}
.settings-toggle-visual::after{position:absolute;top:3px;left:3px;width:15px;height:15px;border-radius:50%;background:var(--muted);content:'';transition:transform .18s,background .18s}
.settings-toggle-input:checked+.settings-toggle-visual{border-color:var(--gold);background:var(--gold)}
.settings-toggle-input:checked+.settings-toggle-visual::after{transform:translateX(16px);background:var(--gold-ink)}
.settings-toggle-input:focus-visible+.settings-toggle-visual{outline:3px solid color-mix(in srgb,var(--focus) 60%,transparent);outline-offset:3px}
.settings-toggle-input:disabled+.settings-toggle-visual{opacity:.4;cursor:not-allowed}
.settings-range-wrap{display:flex;align-items:center;justify-content:flex-end;gap:12px;width:100%}
.settings-range{width:min(100%,180px);accent-color:var(--gold);cursor:pointer}
.settings-range-value{min-width:42px;color:var(--muted);text-align:right;font-size:10px;font-variant-numeric:tabular-nums}
.accent-picker{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:10px}
.accent-swatches{display:flex;align-items:center;gap:7px}
.accent-swatch{width:21px;height:21px;padding:0;border:2px solid var(--surface);border-radius:50%;background:var(--swatch);box-shadow:0 0 0 1px var(--line-strong);cursor:pointer;transition:transform .14s,box-shadow .14s}
.accent-swatch:hover{transform:scale(1.12)}
.accent-swatch[aria-pressed='true']{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--swatch)}
.settings-hex-input{width:88px;min-height:34px;padding:6px 8px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:10px;text-transform:uppercase}.settings-hex-input[aria-invalid='true']{border-color:var(--danger);box-shadow:0 0 0 2px color-mix(in srgb,var(--danger) 12%,transparent)}
.settings-note{margin:9px 0 4px;padding:13px 15px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);color:var(--muted);font-size:11px;line-height:1.65}
.settings-action-button,.settings-link-button{min-height:35px;padding:7px 12px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font-size:10px;font-weight:750;cursor:pointer;transition:border-color .15s,background .15s,transform .15s}
.settings-action-button:hover,.settings-link-button:hover{transform:translateY(-1px);border-color:var(--line-strong);background:var(--surface-raised)}
.settings-action-button.is-danger{border-color:color-mix(in srgb,var(--danger) 30%,var(--line));color:var(--danger)}
.settings-action-button.is-danger:hover{background:color-mix(in srgb,var(--danger) 9%,var(--surface))}
.settings-link-button{color:var(--muted)}
.settings-confirm-panel p{margin:0 0 18px;color:var(--muted);font-size:13px;line-height:1.65}
.settings-row.is-search-hit{border-radius:12px;background:color-mix(in srgb,var(--gold) 13%,var(--surface));box-shadow:0 0 0 6px color-mix(in srgb,var(--gold) 13%,var(--surface))}
.shortcut-row{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:13px 3px;border-bottom:1px solid var(--line);color:var(--muted);font-size:12px}
.shortcut-row kbd{padding:4px 8px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font-size:10px;white-space:nowrap}
.about-card{max-width:620px;margin:22px auto;padding:32px 36px;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow-soft);text-align:center}
.about-card>img{width:75px;height:75px;object-fit:contain;filter:var(--logo-filter)}
.about-card h2{margin:12px 0 2px;font-size:25px;letter-spacing:-.04em}
.about-card p{color:var(--muted);font-size:12px;line-height:1.65}
.about-card .about-tagline{margin:0 0 20px;color:var(--ink);font-weight:700}
.about-card .about-version{font-size:10px}
.about-card ul{display:inline-block;margin:12px auto;padding-left:20px;color:var(--muted);text-align:left;font-size:11px;line-height:1.9}
.about-card .about-credits{margin-top:18px;font-weight:700}
.about-egg{margin-top:8px}
.settings-import-input{display:none}

/* Live appearance controls */
:root{--chat-reading-width:820px}
.app-shell[data-chat-width='narrow']{--chat-reading-width:640px}
.app-shell[data-chat-width='default']{--chat-reading-width:820px}
.app-shell[data-chat-width='wide']{--chat-reading-width:1040px}
.message-list{max-width:var(--chat-reading-width,820px);gap:var(--message-gap,27px)}
.message-composer{max-width:var(--chat-reading-width,820px)}
:root[data-roundness='slight']{--round-lg:12px}
:root[data-roundness='medium']{--round-lg:22px}
:root[data-roundness='rounded']{--round-lg:30px}
:root[data-density='compact']{--message-gap:15px}
:root[data-density='comfortable']{--message-gap:27px}
:root[data-density='spacious']{--message-gap:40px}
.app-shell[data-font-size='small'] .message-content{font-size:13px}
.app-shell[data-font-size='default'] .message-content{font-size:14px}
.app-shell[data-font-size='large'] .message-content{font-size:16px}
.app-shell[data-font-size='xlarge'] .message-content{font-size:18px}
.app-shell[data-font-size='small'] .message-input{font-size:12px}
.app-shell[data-font-size='large'] .message-input{font-size:16px}
.app-shell[data-font-size='xlarge'] .message-input{font-size:18px}
.app-shell[data-actions-hover='true'] .message-actions{opacity:0;visibility:hidden;transition:opacity .15s ease,visibility .15s}
.app-shell[data-actions-hover='true'] .chat-message:hover .message-actions,.app-shell[data-actions-hover='true'] .chat-message:focus-within .message-actions{opacity:1;visibility:visible}
.app-shell[data-file-previews='false'] .attachment-thumbnail{display:none}
.app-shell[data-file-previews='false'] .generated-file-preview{display:none}
.app-shell[data-show-file-sizes='false'] .generated-file-size{display:none}
.app-shell[data-large-controls='true'] button:not(.settings-nav-item),.app-shell[data-large-controls='true'] .settings-action-button{min-height:42px}
.app-shell[data-large-controls='true'] .message-actions button{min-height:38px;padding:7px 12px}
@media (hover:none){.app-shell[data-actions-hover='true'] .message-actions{opacity:1;visibility:visible}}
:root[data-animations='off'] *, :root[data-animations='off'] *::before, :root[data-animations='off'] *::after{animation-duration:0s!important;transition-duration:0s!important;scroll-behavior:auto!important}
:root[data-reduce-motion='true'] *, :root[data-reduce-motion='true'] *::before, :root[data-reduce-motion='true'] *::after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
:root[data-disable-decorative='true'] *, :root[data-disable-decorative='true'] *::before, :root[data-disable-decorative='true'] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
:root[data-visible-focus='true'] :focus-visible{outline:3px solid color-mix(in srgb,var(--focus) 78%,transparent);outline-offset:3px}
:root[data-visible-focus='false'] :focus-visible{outline:1px solid var(--line-strong);outline-offset:2px}
:root[data-high-contrast='true']{--muted:#535047;--faint:#625d52;--line:#aaa394;--line-strong:#726b5e}
:root[data-theme='dark'][data-high-contrast='true']{--muted:#d1cec4;--faint:#b8b3a7;--line:#79796e;--line-strong:#aaa99c}
:root[data-code-theme='light'] .code-block{border-color:#d6dbd5;background:#f4f6f2;color:#29332d}
:root[data-code-theme='light'] .code-block-toolbar{border-color:#dfe3dd;background:#e9eee8}
:root[data-code-theme='light'] .code-language-label{color:#59675d}
:root[data-code-theme='light'] .code-block pre.code-source{background:#f4f6f2;color:#29332d}
:root[data-code-theme='light'] .code-line-numbers{border-color:#dfe3dd;background:#edf0eb;color:#818a80}
:root[data-code-theme='light'] .code-block .code-block-actions button{border-color:#d5dbd4;background:#f7f8f5;color:#59635a}
:root[data-code-theme='light'] .code-block .hljs-comment,:root[data-code-theme='light'] .code-block .hljs-quote{color:#74806f}
:root[data-code-theme='light'] .code-block .hljs-keyword,:root[data-code-theme='light'] .code-block .hljs-selector-tag,:root[data-code-theme='light'] .code-block .hljs-literal{color:#8a4c96}
:root[data-code-theme='light'] .code-block .hljs-string,:root[data-code-theme='light'] .code-block .hljs-attr{color:#28734d}
:root[data-code-theme='light'] .code-block .hljs-number,:root[data-code-theme='light'] .code-block .hljs-built_in{color:#a45325}
.message-speaker{display:flex;align-items:center;gap:7px}
.message-avatar{display:inline-grid;place-items:center;width:20px;height:20px;border:1px solid var(--line);border-radius:7px;background:var(--surface-soft);font-size:11px;font-weight:800;line-height:1}
.chat-message--user .message-avatar{background:color-mix(in srgb,var(--gold) 18%,var(--surface));color:var(--ink)}
.message-timestamp{margin-left:3px;color:var(--faint);font-size:9px;font-weight:500;letter-spacing:0}
.app-shell[data-font-size='large'] .message-speaker{font-size:12px}
.app-shell[data-font-size='xlarge'] .message-speaker{font-size:13px}

@media(max-width:760px){
 .settings-topbar{grid-template-columns:auto 1fr;gap:8px 16px;min-height:0;padding:11px 14px}
 .settings-back-button{grid-column:1;grid-row:1;min-height:36px;padding:0 9px;font-size:10px}
 .settings-top-title{grid-column:2;grid-row:1}
 .settings-top-title h1{font-size:18px}
 .settings-eyebrow{font-size:8px}
 .settings-search-wrap{grid-column:1/-1;grid-row:2;width:100%;height:39px}
 .settings-layout{display:flex;flex-direction:column;min-height:0}
 .settings-sidebar{flex:0 0 auto;overflow:hidden;padding:9px 10px 8px;border-right:0;border-bottom:1px solid var(--line)}
 .settings-category-nav{flex-direction:row;gap:6px;overflow-x:auto;padding:1px 1px 4px;scrollbar-width:thin}
 .settings-nav-item{flex:0 0 auto;width:auto;min-height:36px;gap:7px;padding:0 10px;border-radius:10px;font-size:10px;white-space:nowrap}
 .settings-nav-icon{flex-basis:20px;width:20px;height:20px;font-size:12px}
 .settings-content-pane{flex:1}
 .settings-content{padding:23px 16px 48px}
 .settings-category-heading{margin-bottom:20px;padding-bottom:15px}
 .settings-category-heading h2{font-size:25px}
 .settings-category-heading p{font-size:11px}
 .settings-section{margin-bottom:24px}
 .settings-row{grid-template-columns:minmax(0,1fr) minmax(90px,150px);gap:10px;min-height:63px;padding:11px 1px}
 .settings-row-copy h3{font-size:11px}
 .settings-row-copy p{font-size:9.5px}
 .settings-select{font-size:10px;min-height:35px;padding:6px 7px}
 .settings-range{max-width:100px}
 .settings-range-wrap{gap:5px}
 .accent-picker{gap:7px}
 .accent-swatches{gap:6px}
 .accent-swatch{width:19px;height:19px}
 .about-card{padding:25px 18px}
}
@media(max-width:460px){
 .settings-back-button{gap:5px;font-size:0}
 .settings-back-button span:first-child{font-size:19px}
 .settings-top-title{padding-left:2px}
 .settings-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
 .settings-row-control{max-width:155px}
 .settings-row:has(textarea.settings-text-control){grid-template-columns:minmax(0,1fr)}
 .settings-row-control .model-selector{width:150px;font-size:9px}
 .settings-select{max-width:150px}
 .settings-range{width:85px}
 .settings-range-value{min-width:34px;font-size:9px}
 .settings-search-result{padding:9px 7px;font-size:11px}
}
@media(prefers-reduced-motion:reduce){.settings-screen{animation:none}.settings-nav-item,.settings-back-button,.settings-toggle-visual{transition:none}}

.app-shell[data-show-avatars='false'] .message-avatar{display:none}
.app-shell[data-font-size='small'] .chat-title,.app-shell[data-font-size='small'] .conversation-select-button,.app-shell[data-font-size='small'] .settings-button,.app-shell[data-font-size='small'] .theme-toggle-button{font-size:11px}
.app-shell[data-font-size='large'] .chat-title{font-size:17px}.app-shell[data-font-size='xlarge'] .chat-title{font-size:19px}
.app-shell[data-font-size='large'] .conversation-select-button{font-size:13px}.app-shell[data-font-size='xlarge'] .conversation-select-button{font-size:14px}
:root[data-large-controls='true'] .settings-screen .settings-action-button,:root[data-large-controls='true'] .settings-screen .settings-link-button{min-height:43px;padding:9px 14px}
:root[data-large-controls='true'] .settings-screen .settings-nav-item{min-height:48px}
:root[data-large-controls='true'] .settings-screen .settings-select,:root[data-large-controls='true'] .settings-screen .settings-text-control{min-height:43px}


.chat-message--user .message-speaker{justify-content:flex-end}
:root[data-font-size='small'] .settings-row-copy h3{font-size:11px}
:root[data-font-size='large'] .settings-row-copy h3{font-size:13px}
:root[data-font-size='xlarge'] .settings-row-copy h3{font-size:14px}
:root[data-font-size='large'] .settings-row-copy p{font-size:11px}
:root[data-font-size='xlarge'] .settings-row-copy p{font-size:12px}

.about-card{text-align:left}
.about-card>img,.about-card>h2,.about-card>.about-greeting,.about-card>.about-signature,.about-card>.about-credits,.about-card>.about-version,.about-card>.about-egg{display:block;margin-right:auto;margin-left:auto;text-align:center}
.about-card .about-greeting{max-width:480px;margin-top:10px;margin-bottom:14px;color:var(--ink);font-size:14px;font-weight:750}
.about-card>p:not(.about-greeting):not(.about-signature):not(.about-credits):not(.about-version){max-width:540px;margin:10px auto 16px;text-align:left}
.about-card .about-section{max-width:540px;margin:21px auto 0;padding-top:17px;border-top:1px solid var(--line)}
.about-card .about-section h3{margin:0 0 8px;font-size:14px;letter-spacing:-.015em}
.about-card .about-section ul{display:block;margin:0;padding-left:21px;color:var(--muted);text-align:left;font-size:11px;line-height:1.8}
.about-card .about-section li+li{margin-top:4px}
.about-card .about-signature{margin:22px auto 12px;color:var(--ink);font-size:14px;font-weight:800}
.about-card .about-credits{margin-top:20px;margin-bottom:0;font-size:10px}
.about-card .about-version{margin-top:3px;font-size:9px}
.about-card .about-egg{margin-top:14px}


/* Import Chat */
.import-chat-button{display:flex;align-items:center;gap:10px;width:100%;min-height:42px;padding:0 14px;border:1px solid var(--line-strong);border-radius:12px;background:color-mix(in srgb,var(--surface) 72%,transparent);color:var(--ink);text-align:left;font-size:12px;font-weight:750;cursor:pointer;transition:background .16s,border-color .16s,transform .16s}
.import-chat-button:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--gold) 70%,var(--line));background:var(--surface)}
.import-chat-button>span:first-child{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:var(--surface-soft);color:var(--muted);font-size:17px;line-height:1}
.app-dialog.chat-import-dialog{width:min(700px,calc(100vw - 24px));max-height:min(90dvh,820px);overflow:auto}
.chat-import-panel{display:flex;flex-direction:column;gap:14px;min-width:0}
.chat-import-intro{margin:0;color:var(--muted);font-size:12px;line-height:1.55}
.chat-import-dropzone{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;min-height:178px;padding:22px;border:1.5px dashed var(--line-strong);border-radius:16px;background:color-mix(in srgb,var(--surface-soft) 60%,transparent);text-align:center;color:var(--muted);cursor:pointer;transition:border-color .15s,background .15s,transform .15s}
.chat-import-dropzone:hover,.chat-import-dropzone.is-import-dragover{border-color:var(--focus);background:color-mix(in srgb,var(--gold) 10%,var(--surface));transform:translateY(-1px)}
.chat-import-dropzone strong{color:var(--ink);font-size:14px}
.chat-import-dropzone>span:last-child{font-size:11px}
.chat-import-upload-icon{display:grid;place-items:center;width:42px;height:42px;margin-bottom:2px;border-radius:13px;background:var(--gold);color:var(--gold-ink);font-size:25px;font-weight:700;line-height:1}
.chat-import-limit,.chat-import-note,.chat-import-safety-note{margin:0;color:var(--muted);font-size:10px;line-height:1.5}
.chat-import-safety-note{padding:9px 11px;border-radius:9px;background:var(--surface-soft)}
.chat-import-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}
.chat-import-actions button{min-height:37px;padding:0 14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:11px;font-weight:750;cursor:pointer}
.chat-import-actions .primary-button{border-color:var(--gold);background:var(--gold);color:var(--gold-ink)}
.chat-import-actions button:hover{filter:brightness(.98);transform:translateY(-1px)}
.chat-import-error{padding:11px 13px;border:1px solid color-mix(in srgb,var(--danger) 28%,var(--line));border-radius:10px;background:color-mix(in srgb,var(--danger) 7%,var(--surface));color:var(--danger);font-size:12px;line-height:1.5}
.chat-import-file-name{color:var(--muted);font-size:10px;overflow-wrap:anywhere}
.chat-import-loading{padding:30px 20px;color:var(--muted);font-size:13px;text-align:center}
.chat-import-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.chat-import-stat{display:flex;flex-direction:column;gap:3px;min-width:0;padding:10px 11px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft)}
.chat-import-stat strong{overflow:hidden;color:var(--ink);font-size:11px;text-overflow:ellipsis;white-space:nowrap}
.chat-import-stat small{color:var(--muted);font-size:9px}
.chat-import-title-field{display:flex;flex-direction:column;gap:6px;color:var(--muted);font-size:10px;font-weight:700}
.chat-import-title-field input,.chat-import-title-field select{width:100%;min-height:39px;padding:8px 10px;border:1px solid var(--line);border-radius:10px;background:var(--page);color:var(--ink);font:inherit;font-size:12px;font-weight:500;outline:0}
.chat-import-title-field input:focus,.chat-import-title-field select:focus{border-color:var(--focus);box-shadow:0 0 0 3px color-mix(in srgb,var(--focus) 12%,transparent)}
.chat-import-preview-heading{margin:0;color:var(--muted);font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}
.chat-import-message{padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);overflow:hidden}
.chat-import-message>strong{display:block;margin-bottom:5px;color:var(--muted);font-size:9px;letter-spacing:.08em;text-transform:uppercase}
.chat-import-message-body{max-height:150px;overflow:auto;color:var(--ink);font-size:11px;line-height:1.55;overflow-wrap:anywhere}
.chat-import-message-body.markdown-body pre{max-width:100%;overflow:auto}.chat-import-message-body.markdown-body img{max-width:100%;height:auto}
.chat-import-message-body.markdown-body p:last-child{margin-bottom:0}
.chat-import-dialog .dialog-header{margin-bottom:13px}
@media(max-width:600px){.app-dialog.chat-import-dialog{width:calc(100vw - 16px);max-height:92dvh;border-radius:15px}.chat-import-dialog .dialog-panel{padding:15px}.chat-import-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.chat-import-dropzone{min-height:155px}.chat-import-actions button{flex:1}}


/* Selectable text, quiet native drag behavior */
.message-content,.markdown-body,.code-block,.code-block pre,.code-block code,.settings-screen,.dialog-content,.conversation-sidebar,.chat-header,.message-composer,.file-preview-text,.generated-file-card,input,textarea{ -webkit-user-select:text; user-select:text; }
img{ -webkit-user-drag:none; user-drag:none; }
img.ai-generated-image{ -webkit-user-drag:element; user-drag:element; cursor:grab; }
img.ai-generated-image:active{cursor:grabbing}
button,button *,svg,.message-avatar,.file-type-icon,.quick-jump-icon,.floating-menu-icon,kbd{ -webkit-user-drag:none; user-drag:none; }
::selection{background:color-mix(in srgb,var(--gold) 42%,transparent);color:var(--ink)}


/* ================================================================
   CHICKEN AI — VISIBLE DESIGN REFRESH / 2026
   Intentional visual redesign; preserves existing DOM and behavior.
   ================================================================ */
:root{
  --page:#f8f8f5;--sidebar:#f0f0e9;--surface:#ffffff;
  --surface-raised:#ffffff;--surface-soft:#f4f4ef;
  --ink:#20231f;--muted:#71776e;--faint:#92988f;
  --line:#e3e6de;--line-strong:#cdd3c8;
  --gold:#ffce45;--gold-hover:#ffdb73;--gold-ink:#2b240b;
  --user-bubble:#fff0b8;--hover:#e7e9e1;
  --shadow-soft:0 3px 10px rgba(25,35,20,.025),0 15px 35px rgba(25,35,20,.035);
  --shadow-pop:0 24px 70px rgba(20,25,16,.18);
}
:root[data-theme='dark']{
  --page:#151715;--sidebar:#1b1e1a;--surface:#242824;
  --surface-raised:#2b302a;--surface-soft:#30352e;
  --ink:#f4f6ee;--muted:#b1b8ac;--faint:#899184;
  --line:#373e36;--line-strong:#515a4d;
  --gold:#ffd15b;--gold-hover:#ffe08a;--gold-ink:#30240a;
  --user-bubble:#4a3f25;--hover:#343b33;
  --shadow-soft:0 8px 24px rgba(0,0,0,.12);
  --shadow-pop:0 25px 70px rgba(0,0,0,.4);
}
body{font-size:15px;line-height:1.65;letter-spacing:-.005em}
.app-shell{grid-template-columns:290px minmax(0,1fr)}
.conversation-sidebar{padding:28px 17px 20px;gap:16px;background:var(--sidebar);border-right:1px solid var(--line)}
.brand-block{padding:7px 10px 16px;gap:13px}
.brand-logo-slot{width:58px;height:58px;flex-basis:58px}
.brand-name{font-size:22px;letter-spacing:-.055em;font-weight:800}
.brand-tagline{font-size:11px;line-height:1.5}
.new-chat-button{min-height:51px;border:0;border-radius:16px;padding-inline:16px;font-size:13px;box-shadow:0 4px 0 rgba(126,89,0,.13),0 11px 24px rgba(168,125,0,.13)}
.new-chat-button::before{width:27px;height:27px;margin-right:10px;border-radius:9px;font-size:23px;background:rgba(255,255,255,.48)}
.new-chat-button:hover{box-shadow:0 5px 0 rgba(126,89,0,.11),0 14px 28px rgba(168,125,0,.17)}
.conversation-list-heading,.floating-menu-section-title{font-size:10px;letter-spacing:.13em}
.conversation-list-row{border-radius:13px;margin-block:2px;padding:4px}
.conversation-list-row:hover{background:var(--hover)}
.conversation-select-button{padding:12px 10px;border-radius:10px;font-size:13px;font-weight:550}
.conversation-select-button[aria-current='page']{background:var(--surface);box-shadow:0 3px 11px rgba(20,25,16,.06);font-weight:800}
.conversation-remove-button{font-size:12px}
.history-search{height:41px;border-radius:12px;font-size:12px;padding-inline:13px}
.quick-jump-button{min-height:45px;border-radius:13px;font-size:12px}
.sidebar-controls{gap:9px;padding-top:16px}
.settings-button,.theme-toggle-button{min-height:44px;border-radius:13px}
.chat-main{background:var(--page)}
.chat-header{min-height:76px;padding:15px clamp(22px,5vw,76px);background:var(--surface);border-bottom:1px solid var(--line)}
.chat-title{font-size:17px;font-weight:800;letter-spacing:-.035em}
.delete-chat-button,.chat-actions-menu summary{min-height:38px;border-radius:11px}
.conversation-view{padding:40px clamp(20px,5vw,80px) 30px}
.message-list{max-width:860px;gap:30px}
.chat-message{max-width:86%}
.chat-message--assistant{width:100%}
.message-speaker{font-size:11px;letter-spacing:.07em;text-transform:uppercase;margin-bottom:9px}
.message-content{padding:19px 23px;border-radius:22px;line-height:1.8;font-size:14px;box-shadow:var(--shadow-soft)}
.chat-message--assistant .message-content{border-top-left-radius:8px}
.chat-message--user .message-content{border-radius:22px 22px 8px 22px;padding:16px 21px}
.message-actions{gap:8px;margin-top:11px}
.message-actions button{min-height:34px;padding:7px 11px;border-radius:10px;font-size:11px}
.message-actions button:hover{background:var(--surface);transform:translateY(-1px)}
.empty-conversation-title{font-size:clamp(36px,5vw,57px);max-width:700px;line-height:1.1;letter-spacing:-.065em}
.empty-conversation-title::after{margin-top:23px;font-size:15px;max-width:440px}
.message-composer{width:calc(100% - 48px);max-width:900px;margin-bottom:26px;gap:12px}
.composer-input-shell{min-height:84px;padding:14px 15px;border:1.5px solid var(--line-strong);border-radius:25px;background:var(--surface);box-shadow:0 6px 14px rgba(25,35,20,.04),0 18px 50px rgba(25,35,20,.075);transition:border-color .18s,box-shadow .18s,transform .18s}
.composer-input-shell:focus-within{border-color:var(--gold);box-shadow:0 0 0 4px color-mix(in srgb,var(--gold) 17%,transparent),0 18px 50px rgba(25,35,20,.09)}
.message-input{min-height:58px;font-size:15px;line-height:1.65}
.attachment-button{width:39px;height:39px;flex-basis:39px;border-radius:13px;font-size:24px}
.send-button{min-width:97px;min-height:43px;border-radius:13px;font-size:13px;box-shadow:0 3px 0 rgba(120,88,5,.15)}
.send-button:hover{transform:translateY(-2px)}
.stop-button{min-height:43px;border-radius:13px}
.composer-actions{padding-inline:7px}
.model-selector{height:39px;border-radius:12px;font-size:12px}
.chat-status{font-size:11px}
.floating-action-menu{border-radius:20px;padding:11px;box-shadow:var(--shadow-pop)}
.floating-menu-item{min-height:46px;border-radius:12px;font-size:13px}
.floating-menu-icon{width:30px;height:30px;flex-basis:30px;border-radius:10px}
.app-dialog{border-radius:23px;box-shadow:var(--shadow-pop)}
.dialog-panel{padding:26px}
.dialog-header h2{font-size:21px}
.dialog-close-button{width:36px;height:36px;border-radius:11px}
.settings-field input,.settings-field textarea,.settings-field select{min-height:42px;border-radius:12px}
.attachment-card,.generated-file-card{border-radius:14px;padding:11px}
.code-block{border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.10)}
.code-block-toolbar{min-height:47px}
.markdown-body h1,.markdown-body h2,.markdown-body h3{letter-spacing:-.04em}
.markdown-body :not(pre)>code{border-radius:7px;padding:.2em .45em}
.markdown-table-scroll{border-radius:13px}
.loading-indicator{padding:11px 17px;border-radius:14px;font-size:12px}
button{transition:background-color .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease}
@media(max-width:800px) and (min-width:561px){
  .app-shell{grid-template-columns:245px minmax(0,1fr)}
  .conversation-sidebar{padding:19px 12px}
  .chat-header{min-height:65px}
  .conversation-view{padding:26px 20px}
  .message-composer{width:calc(100% - 28px)}
}
@media(max-width:560px){
  .app-shell{grid-template-columns:minmax(0,1fr)}
  .conversation-sidebar{padding:11px 12px 9px;gap:8px}
  .brand-block{padding:0;gap:8px}
  .brand-logo-slot{width:43px;height:43px;flex-basis:43px}
  .brand-name{font-size:17px}
  .new-chat-button{min-height:39px;border-radius:11px;padding-inline:9px;font-size:11px}
  .new-chat-button::before{width:19px;height:19px;font-size:16px;margin-right:5px}
  .conversation-navigation{max-height:118px}
  .conversation-select-button{padding:7px 8px;font-size:11px}
  .sidebar-controls{padding-top:0;gap:5px}
  .chat-header{min-height:57px;padding:10px 15px}
  .chat-title{font-size:14px}
  .conversation-view{padding:20px 13px 18px}
  .message-list{gap:23px}
  .chat-message{max-width:96%}
  .message-content{padding:13px 15px;border-radius:17px;font-size:13px}
  .chat-message--user .message-content{padding:12px 15px;border-radius:17px 17px 6px 17px}
  .empty-conversation-title{font-size:clamp(30px,8vw,40px)}
  .empty-conversation-title::after{font-size:12px}
  .message-composer{width:calc(100% - 20px);margin-bottom:11px;gap:8px}
  .composer-input-shell{min-height:64px;padding:10px 11px;border-radius:19px}
  .message-input{min-height:44px;font-size:14px}
  .attachment-button{width:33px;height:33px;flex-basis:33px;border-radius:10px}
  .send-button{min-width:76px;min-height:37px;font-size:11px}
  .composer-actions{padding-inline:3px}
  .dialog-panel{padding:17px}
}
@media(prefers-reduced-motion:reduce){
  button,.composer-input-shell{transition:none!important}
}


.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}
/* Conversation folders */
.folder-section{display:flex;flex:0 1 auto;flex-direction:column;min-height:0;gap:8px}
.folder-section-header{display:flex;align-items:center;gap:7px;min-width:0}
.folder-section-header h2{flex:1;margin:0 0 0 7px;color:var(--muted);font-size:10px;font-weight:850;letter-spacing:.13em;text-transform:uppercase}
.folder-sort-wrap select{max-width:80px;height:28px;padding:0 6px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--muted);font:inherit;font-size:9px;cursor:pointer}
.folder-create-button{flex:0 0 auto;min-height:30px;padding:0 9px;border:1px solid color-mix(in srgb,var(--gold) 50%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--gold) 14%,var(--surface));color:var(--ink);font-size:10px;font-weight:800;cursor:pointer;transition:background .15s,border-color .15s,transform .15s}
.folder-create-button:hover{transform:translateY(-1px);border-color:var(--gold);background:color-mix(in srgb,var(--gold) 25%,var(--surface))}
.folder-list{min-height:0;max-height:min(36vh,370px);overflow:auto;padding:0 2px 2px 0;scrollbar-color:var(--line-strong) transparent;scrollbar-width:thin}
.folder-item{position:relative;margin:2px 0;border:1px solid transparent;border-left:2px solid color-mix(in srgb,var(--folder-color) 70%,transparent);border-radius:11px;background:color-mix(in srgb,var(--surface) 35%,transparent);transition:background .17s,border-color .17s,box-shadow .17s}
.folder-item:hover{background:color-mix(in srgb,var(--surface) 65%,transparent)}
.folder-item.is-selected{border-color:color-mix(in srgb,var(--folder-color) 35%,var(--line));border-left-color:var(--folder-color);background:color-mix(in srgb,var(--folder-color) 9%,var(--surface))}
.folder-item.is-chat-drop-target,.conversation-navigation.is-chat-drop-target{border-color:var(--focus);background:color-mix(in srgb,var(--gold) 16%,var(--surface));box-shadow:0 0 0 2px color-mix(in srgb,var(--gold) 22%,transparent)}
.folder-row{display:flex;align-items:center;gap:3px;min-height:38px;padding:2px 3px 2px 5px}
.folder-toggle{display:flex;flex:1;align-items:center;gap:7px;min-width:0;min-height:33px;padding:2px 4px;border:0;border-radius:8px;background:transparent;color:var(--ink);text-align:left;cursor:pointer}
.folder-toggle:hover{background:color-mix(in srgb,var(--folder-color) 11%,transparent)}
.folder-caret{display:inline-grid;flex:0 0 12px;place-items:center;color:var(--muted);font-size:14px;line-height:1;transition:transform .2s ease}
.folder-item:has(.folder-content.is-expanded) .folder-caret{transform:rotate(0)}
.folder-icon,.folder-choice-icon{display:grid;flex:0 0 23px;place-items:center;width:23px;height:23px;border-radius:8px;background:color-mix(in srgb,var(--folder-color) 27%,var(--surface));color:var(--ink);font-size:13px;line-height:1}
.folder-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:700}
.folder-count{display:inline-grid;flex:0 0 auto;min-width:21px;height:20px;place-items:center;padding:0 5px;border-radius:99px;background:color-mix(in srgb,var(--folder-color) 22%,var(--surface));color:var(--muted);font-size:9px;font-weight:800;font-variant-numeric:tabular-nums}
.folder-new-chat{display:grid;flex:0 0 29px;place-items:center;width:29px;height:29px;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:18px;line-height:1;cursor:pointer}
.folder-new-chat:hover{background:color-mix(in srgb,var(--folder-color) 20%,var(--surface));color:var(--ink)}
.folder-actions-menu{position:relative;flex:0 0 auto}
.folder-actions-menu>summary{display:grid;place-items:center;width:28px;height:29px;border-radius:8px;color:var(--muted);font-size:14px;font-weight:800;list-style:none;cursor:pointer}
.folder-actions-menu>summary::-webkit-details-marker{display:none}
.folder-actions-menu>summary:hover,.folder-actions-menu[open]>summary{background:var(--surface);color:var(--ink)}
.folder-menu-popover{position:fixed;z-index:120;top:8px;left:8px;right:auto;display:flex;flex-direction:column;min-width:155px;padding:5px;border:1px solid var(--line);border-radius:11px;background:var(--surface-raised);box-shadow:var(--shadow-pop)}
.folder-menu-popover button{min-height:34px;padding:6px 9px;border:0;border-radius:7px;background:transparent;color:var(--ink);text-align:left;font-size:10px;cursor:pointer}
.folder-menu-popover button:hover{background:var(--surface-soft)}
.folder-menu-popover button.is-danger{color:var(--danger)}
.folder-menu-popover button:disabled{opacity:.38;cursor:not-allowed}
.folder-content{max-height:0;overflow:hidden;opacity:0;transition:max-height .24s ease,opacity .18s ease}
.folder-content.is-expanded{max-height:440px;overflow:auto;opacity:1;overscroll-behavior:contain}
.folder-chat-list{margin:0;padding:0 3px 5px 15px;list-style:none}
.folder-chat-list .conversation-list-item{margin:2px 0}
.folder-chat-list .conversation-list-row{min-height:32px;padding:2px;border-radius:9px}
.folder-chat-list .conversation-select-button{padding:6px 7px;font-size:10px}
.folder-chat-list .chat-drag-handle{width:19px;flex-basis:19px}
.folder-empty{padding:8px 8px 9px 12px;color:var(--muted);font-size:10px;line-height:1.4}
.chat-drag-handle{display:grid;flex:0 0 20px;place-items:center;width:20px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--faint);font-size:15px;line-height:1;cursor:grab;opacity:.62;-webkit-user-drag:element;user-drag:element;touch-action:none}
.chat-drag-handle:hover{background:var(--surface-soft);color:var(--ink);opacity:1}
.chat-drag-handle:active{cursor:grabbing}
.conversation-navigation{transition:background .15s,border-color .15s,box-shadow .15s;border-radius:12px}
.folder-editor-form{display:flex;flex-direction:column;gap:13px;min-width:min(340px,calc(100vw - 70px))}
.folder-editor-form input[type=color]{width:55px;height:40px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--surface);cursor:pointer}
.folder-delete-panel p,.folder-dialog-note{margin:0 0 12px;color:var(--muted);font-size:12px;line-height:1.6}
.folder-delete-actions{flex-wrap:wrap}
.folder-delete-actions .danger-confirm-button{min-height:36px;padding:0 13px;border:1px solid color-mix(in srgb,var(--danger) 34%,var(--line));border-radius:9px;background:color-mix(in srgb,var(--danger) 9%,var(--surface));color:var(--danger);font-size:11px;font-weight:750;cursor:pointer}
.folder-move-panel{display:flex;flex-direction:column;gap:12px;min-width:min(340px,calc(100vw - 70px))}
.folder-choices{display:flex;flex-direction:column;gap:5px;max-height:min(48vh,360px);overflow:auto}
.folder-choice{display:flex;align-items:center;gap:10px;min-height:43px;padding:6px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);text-align:left;font:inherit;font-size:12px;cursor:pointer;transition:background .15s,border-color .15s}
.folder-choice:hover,.folder-choice.is-current{border-color:color-mix(in srgb,var(--folder-color,var(--gold)) 50%,var(--line));background:color-mix(in srgb,var(--folder-color,var(--gold)) 11%,var(--surface))}
.folder-choice small{margin-left:auto;color:var(--muted);font-size:9px}
.folder-move-cancel{align-self:flex-end;min-height:36px;padding:0 13px;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink);font-size:11px;cursor:pointer}
@media(max-width:800px){.folder-list{max-height:min(31vh,290px)}}
@media(max-width:560px){
  .folder-section{grid-column:1/-1;max-height:27vh;gap:5px;padding:1px 0}
  .folder-section-header{min-height:33px;gap:6px}
  .folder-section-header h2{margin-left:3px;font-size:9px}
  .folder-sort-wrap select{height:27px;max-width:74px}
  .folder-create-button{min-height:31px;padding-inline:8px}
  .folder-list{max-height:calc(27vh - 38px)}
  .folder-item{margin:2px 0}
  .folder-row{min-height:40px}
  .folder-toggle{min-height:37px;gap:7px}
  .folder-new-chat{width:38px;height:38px;flex-basis:38px}
  .folder-actions-menu>summary{width:38px;height:38px}
  .folder-menu-popover{position:fixed;top:auto;right:12px;bottom:auto;max-width:calc(100vw - 24px)}
  .folder-content.is-expanded{max-height:140px}
  .folder-chat-list .conversation-list-row{min-height:36px}
  .folder-chat-list .conversation-select-button{font-size:11px}
  .chat-drag-handle{display:none}
  .conversation-navigation{max-height:100px;min-height:52px}
  .conversation-navigation.is-chat-drop-target{outline:2px dashed var(--focus);outline-offset:2px}
  .folder-editor-form,.folder-move-panel{min-width:0}
  .folder-delete-actions button{flex:1}
}
@media(prefers-reduced-motion:reduce){.folder-content,.folder-caret,.folder-item{transition:none!important}}

@media(max-width:560px){.folder-section{max-height:22vh}.folder-list{max-height:calc(22vh - 38px)}.folder-content.is-expanded{max-height:110px}.conversation-navigation{max-height:82px}}


/* Chicken AI: stable windowed layout, replacing previous conflicting overrides. */
html, body { height: 100%; margin: 0; overflow: hidden; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; max-height: 100dvh; overflow: hidden; }
.chat-main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; height: 100%; max-height: 100%; overflow: hidden; }
.chat-header { grid-row: 1; min-height: 0; }
.conversation-view { grid-row: 2; min-height: 0; overflow-y: auto; }
.message-composer {
  grid-row: 3; position: static; inset: auto; transform: none;
  display: flex; flex-direction: column; flex: none;
  min-height: 0; max-height: min(45dvh, 320px);
  width: calc(100% - 32px); max-width: 850px;
  margin: 0 auto 12px; overflow-y: auto; overscroll-behavior: contain;
}
.composer-input-shell, .composer-actions, .composer-meta, .model-selector-wrap { flex-shrink: 0; }
@media (max-height: 650px) {
  .chat-header { padding-top: 6px; padding-bottom: 6px; }
  .message-composer { padding: 8px 10px; gap: 4px; margin-bottom: 6px; max-height: 55dvh; }
  .message-input { min-height: 24px; max-height: 90px; }
  .composer-input-shell { min-height: 42px; }
}
@media (max-width: 560px) {
  .app-shell { grid-template-rows: auto minmax(0,1fr); }
  .message-composer { width: calc(100% - 16px); margin-bottom: 6px; }
}

/* Viewport-anchored composer: independent of chat grid sizing. */
html,body {height:100%;overflow:hidden}
.app-shell {height:100dvh!important;min-height:0!important;max-height:100dvh!important}
.chat-main {height:100%;min-height:0;overflow:hidden;display:flex;flex-direction:column}
.conversation-view {flex:1 1 0%;min-height:0;overflow-y:auto;padding-bottom:190px!important}
#message-form.message-composer {
  position:fixed!important;left:calc(290px + (100vw - 290px)/2)!important;
  right:auto!important;bottom:12px!important;top:auto!important;
  transform:translateX(-50%)!important;
  z-index:100!important;display:flex!important;visibility:visible!important;
  width:min(850px,calc(100vw - 290px - 32px))!important;
  max-height:min(38dvh,270px)!important;
  margin:0!important;overflow-y:auto!important;
  padding:0!important;
}
@media(max-width:1000px) and (min-width:801px){#message-form.message-composer{left:calc(245px + (100vw - 245px)/2)!important;width:min(850px,calc(100vw - 245px - 24px))!important}}
@media(max-width:800px) and (min-width:561px){#message-form.message-composer{left:calc(228px + (100vw - 228px)/2)!important;width:calc(100vw - 228px - 20px)!important}}
@media(max-width:560px){#message-form.message-composer{left:50%!important;width:calc(100vw - 20px)!important;bottom:6px!important}}
@media(max-height:550px){#message-form.message-composer{max-height:48dvh!important;bottom:4px!important}.conversation-view{padding-bottom:130px!important}}


/* Chicken AI polished composer — retains the proven viewport anchor. */
#message-form.message-composer {
  gap: 9px !important;
  padding: 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 24px !important;
  background: var(--surface) !important;
  box-shadow: 0 14px 42px rgba(22, 27, 20, .13), 0 2px 8px rgba(22, 27, 20, .06) !important;
  scrollbar-width: thin;
}
#message-form .composer-input-shell {
  display: flex; align-items: flex-end; gap: 9px;
  min-height: 55px; padding: 7px 8px;
  border: 1px solid var(--line) !important;
  border-radius: 17px !important;
  background: var(--surface-soft) !important;
  box-shadow: none !important;
}
#message-form .composer-input-shell:focus-within {
  border-color: var(--focus) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 12%, transparent) !important;
}
#message-form .message-input {
  min-height: 40px; height: 40px; max-height: 120px;
  padding: 9px 4px; font-size: 14px; line-height: 1.5;
}
#message-form .attachment-button {
  width: 37px; height: 37px; flex: 0 0 37px;
  margin: 0 0 2px; border-radius: 12px;
  background: var(--surface) !important;
}
#message-form .send-button {
  min-width: 76px; min-height: 38px; height: 38px;
  border-radius: 12px; padding: 0 12px;
  font-size: 12px; font-weight: 750;
}
#message-form .composer-actions { min-height: 32px; padding: 0 4px; }
#message-form .composer-meta { min-height: 30px; gap: 8px; }
#message-form .model-selector-wrap { gap: 7px; }
#message-form .model-selector {
  height: 32px; max-width: 220px;
  padding: 0 27px 0 10px; border-radius: 10px;
  background: var(--surface-soft); font-size: 11px;
}
#message-form .chat-status { font-size: 10px; }
:root[data-theme='dark'] #message-form.message-composer {
  box-shadow: 0 16px 45px rgba(0,0,0,.3) !important;
}
@media (max-width: 560px) {
  #message-form.message-composer { padding: 9px !important; border-radius: 18px !important; gap: 6px !important; }
  #message-form .composer-input-shell { gap: 5px; padding: 6px; border-radius: 13px !important; }
  #message-form .send-button { min-width: 64px; padding: 0 8px; }
  #message-form .model-selector { max-width: 100%; }
}
@media (max-height: 550px) {
  #message-form.message-composer { padding: 7px !important; gap: 4px !important; }
  #message-form .composer-input-shell { min-height: 42px; padding: 4px 6px; }
  #message-form .message-input { min-height: 32px; height: 32px; padding: 5px 3px; }
  #message-form .composer-actions { min-height: 26px; }
}

/* Extra conversation scroll room: no composer styling changes. */
.conversation-view { padding-bottom: max(420px, 52dvh) !important; scroll-padding-bottom: max(420px, 52dvh); }
@media (max-width: 560px) { .conversation-view { padding-bottom: max(340px, 48dvh) !important; scroll-padding-bottom: max(340px, 48dvh); } }
