/* Shared application shell and semantic tokens. Feature pages own their content. */
:root {
  --line: var(--border);
  --faint: #a0a0ad;
  --field-border: #41414c;
  --sidebar-width: 244px;
  --radius-field: 12px;
  --radius-card: 16px;
  --focus-ring: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}
html[data-theme="light"] { --faint: #737380; --muted: #676773; --field-border: #bcbcc9; --accent: #6854df; }
button, input, textarea, select, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.composer textarea:focus-visible, .sc-input:focus-visible { outline: none; }
input.field, textarea.field, select.field { border-color: var(--field-border); border-radius: var(--radius-field); min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }
.ghost-btn, .cta.slim { min-height: 40px; border-radius: 10px; }
.credits-pill { font-variant-numeric: tabular-nums; }
button.credits-pill { min-height: 36px; }
.bot-ico:not(.sm):not(.xs):not(.md):not(.xl) { box-shadow: none; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 10000; color: var(--text); background: var(--panel); padding: 14px 20px; border-radius: 12px; }
.skip-link:focus { top: 12px; }
.shell-icon-btn { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.shell-icon-btn:hover { background: var(--raise); color: var(--text); }
.shell-icon-btn svg { width: 20px; height: 20px; }
.rail { position: relative; width: var(--sidebar-width); padding: 16px 12px 12px; align-items: stretch; gap: 0; background: var(--rail); flex-shrink: 0; z-index: 20; }
.rail-brand-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 16px 5px; }
.rail .rail-logo { display: flex; width: auto; height: 40px; gap: 9px; margin: 0; filter: none; transform: none; }
.rail .rail-logo img { width: 32px; height: 32px; }
.rail-wordmark { color: var(--text); font: 700 18px/1.2 var(--font); letter-spacing: -.6px; }
.rail .rail-btn { width: 100%; min-height: 44px; height: auto; display: flex; gap: 12px; align-items: center; justify-content: flex-start; padding: 11px 13px; font: 500 14px/1.4 var(--font); border-radius: 10px; flex-shrink: 0; }
.rail .rail-btn svg { width: 20px; height: 20px; flex: none; }
.rail .rail-btn.active, .rail .rail-btn[aria-current="page"] { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); }
.rail .rail-btn:hover { background: var(--surface); }
.rail-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-top-actions { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.rail .rail-new-action { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.rail .rail-search-action { width: 44px; padding: 11px; }
.rail-search-action .rail-label { display: none; }
.rail-primary { display: flex; flex-direction: column; gap: 1px; }
.rail-creation-shortcut { margin: 6px 0 4px; padding: 0; }
.rail .rail-creation-shortcut .rail-btn { min-height: 44px; font-size: 13px; }
.rail .rail-creation-shortcut .rail-btn svg { width: 17px; height: 17px; }
.rail-history-label { display: none; align-items: center; justify-content: space-between; padding: 14px 7px 4px 12px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.rail .rail-history-label .rail-btn { width: 32px; min-height: 32px; padding: 7px; color: var(--muted); background: transparent; }
.rail-history-label .rail-label { display: none; }
.rail .rail-history-label .rail-btn svg { width: 16px; height: 16px; }
.rail .drawer { width: 100%; min-height: 100px; flex: 1 1 0; border: 0; background: transparent; animation: none; }
.rail .drawer-head { display: none; }
.rail .chat-list { padding: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--scroll) transparent; }
.rail .chat-list-empty { font-size: 12px; text-align: left; padding: 16px 13px; color: var(--muted); line-height: 1.8; }
.rail-footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; }
.rail-avatar { width: 30px; height: 30px; font-size: 12px; background: color-mix(in srgb, var(--accent) 18%, var(--panel)); color: var(--accent); margin: 0 7px 0 0; flex: none; }
.shell-more { position: relative; flex: 1; }
.shell-more summary { list-style: none; }
.shell-more summary::-webkit-details-marker { display: none; }
.shell-more-panel { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 65; width: 232px; max-height: min(560px, calc(100dvh - 100px)); overflow-y: auto; padding: 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.shell-menu-label { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 8px 13px; }
.shell-menu-divider { border-top: 1px solid var(--border); margin: 8px; }
.rail .shell-more-panel .rail-btn { min-height: 44px; }
.rail .shell-more-panel .rail-label { display: inline; }
.mobile-topbar, .mobile-bottom-nav { display: none; }
.shell.sidebar-collapsed .rail { width: 72px; padding-left: 12px; padding-right: 12px; }
.shell.sidebar-collapsed .rail-brand-row { flex-direction: column; padding: 0 0 16px; gap: 12px; }
.shell.sidebar-collapsed .rail-wordmark, .shell.sidebar-collapsed .rail-label, .shell.sidebar-collapsed .rail-shortcut-note, .shell.sidebar-collapsed .rail-history-label > span, .shell.sidebar-collapsed .rail-avatar { display: none; }
.shell.sidebar-collapsed .rail-top-actions { flex-direction: column; margin-bottom: 16px; }
.shell.sidebar-collapsed .rail .rail-btn { justify-content: center; padding: 12px; }
.shell.sidebar-collapsed .rail-creation-shortcut { padding-bottom: 4px; }
.shell.sidebar-collapsed .rail-history-label { display: flex; padding: 6px 0; justify-content: center; }
.shell.sidebar-collapsed .rail .drawer { position: fixed; left: 72px; top: 0; bottom: 0; width: 284px; padding: 12px; z-index: 40; background: var(--panel); border-right: 1px solid var(--border); box-shadow: 12px 0 32px rgba(0,0,0,.12); }
.shell.sidebar-collapsed .rail .drawer-head { display: flex; padding: 4px 0 12px; flex-wrap: wrap; }
.shell.sidebar-collapsed .rail .drawer-title { font-size: 14px; }
.shell.sidebar-collapsed .rail .drawer-head #credits-pill { display: none; }
.shell.sidebar-collapsed .shell-more-panel { left: 50px; bottom: 0; }
.shell.sidebar-collapsed .shell-more-panel .rail-btn { justify-content: flex-start; }
.shell.sidebar-collapsed .shell-more-panel .rail-label { display: inline; }
/* Home is a starting point; the full catalog lives in Explore. */
.home { padding: 0 36px 44px; }
.home-head { min-height: 72px; gap: 18px; padding: 12px 0; }
.home-page-label { font-size: 14px; font-weight: 600; color: var(--muted); }
.home-head .head-credits { margin-left: auto; }
.home .hero { max-width: 740px; padding-top: clamp(40px, 8vh, 90px); gap: 18px; }
.hero::before { display: none; }
.home-intro { text-align: center; margin: 0 0 14px; }
.home-intro h1 { margin: 0; font-size: clamp(25px, 2.3vw, 34px); line-height: 1.4; font-weight: 650; letter-spacing: -.9px; }
.home-intro p { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.home .home-note { text-align: left; font-size: 11.5px; line-height: 1.6; margin: -8px 4px 0; }
.home .home-note:not(.error) { display: none; }
.home-recent-section { max-width: 740px; margin: 38px auto 0; }
.home-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.home-section-head h2 { margin: 0; font-size: 13px; color: var(--soft); font-weight: 600; }
.home-section-head .see-all { font-size: 12px; min-height: 36px; }
.home-recents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-recent { border: 1px solid var(--border); border-radius: 13px; background: var(--panel); padding: 16px; color: var(--text); text-align: left; cursor: pointer; min-width: 0; font: 500 13px/1.6 var(--font); }
.home-recent:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); background: var(--surface); }
.home-recent-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; overflow-wrap: anywhere; }
.home-recent-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; margin-top: 12px; font-weight: 400; }
/* Compact catalog cards keep names and capabilities readable. */
.explore { overflow-y: auto; flex: 1; padding: 52px 40px 64px; }
.explore-head, .explore-search-wrap, .explore-search-label, .explore .bot-sections { width: 100%; max-width: 1040px; margin-left: auto; margin-right: auto; }
.page-eyebrow { color: var(--accent); font-size: 12px; font-weight: 600; }
.explore h1 { margin: 10px 0 10px; font-size: 28px; font-weight: 650; letter-spacing: -.7px; }
.explore-head p { margin: 0 0 28px; font-size: 14px; color: var(--muted); }
.explore-search-label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.explore-search-wrap { position: relative; }
.explore-search-wrap > svg { width: 20px; height: 20px; position: absolute; left: 14px; top: 13px; color: var(--muted); }
.explore-search-wrap .field { padding-left: 43px; background: var(--panel); font-size: 14px; min-height: 48px; }
.explore .bot-sections { margin-top: 34px; gap: 34px; }
.explore .bot-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(185px, 1fr)); overflow: visible; gap: 8px; }
.explore .bot-tile { width: 100%; min-width: 0; flex-direction: row; align-items: center; gap: 11px; border: 1px solid var(--border); background: var(--panel); border-radius: 12px; padding: 14px 12px; min-height: 72px; }
.explore .bot-tile:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.explore .bot-tile .bot-ico { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; transform: none; box-shadow: none; }
.explore .ico-wrap { flex: none; }
.explore .bot-badge { display: none; }
.explore .bot-tile-name { text-align: left; font-size: 12px; line-height: 1.5; min-width: 0; }
.explore .bot-section-title { font-size: 15px; font-weight: 600; }
.explore .row-arrow, .explore .see-all { display: none; }
.app-status-notice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border)); color: var(--soft); background: var(--panel); border-radius: 12px; padding: 12px 16px; margin: 12px 20px; font-size: 13px; line-height: 1.6; }
.app-status-notice button { border: 1px solid var(--border); border-radius: 8px; min-height: 36px; padding: 6px 12px; color: var(--text); background: var(--surface); cursor: pointer; font: 500 12px var(--font); }
/* History rows use separate native controls for opening and management. */
.chat-item { position: relative; display: flex; padding: 0; width: 100%; border: 0; border-radius: 10px; background: transparent; align-items: center; flex-wrap: wrap; }
.chat-item:hover, .chat-item.active { background: var(--surface); }
.chat-item-open { display: block; flex: 1; min-width: 0; padding: 9px 10px; text-align: left; border: 0; border-radius: 10px; color: var(--text); background: transparent; font: inherit; cursor: pointer; }
.chat-item .chat-item-title { font-size: 12.5px; line-height: 1.5; font-weight: 500; padding: 0; }
.chat-item .chat-item-meta { font-size: 11px; margin-top: 4px; color: var(--muted); min-width: 0; }
.chat-item .chat-item-meta .bot-ico, .chat-item .chat-item-meta .batch-chat-ico { width: 14px; height: 14px; border-radius: 4px; font-size: 8px; }
.chat-item-actions { position: static; margin-right: 3px; align-self: flex-start; margin-top: 7px; }
.chat-item-actions > summary { list-style: none; display: grid; place-items: center; cursor: pointer; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); font-size: 17px; }
.chat-item-actions > summary::-webkit-details-marker { display: none; }
.chat-item-actions > summary:hover, .chat-item-actions[open] > summary { background: var(--raise); color: var(--text); }
.chat-item-menu { display: flex; gap: 4px; flex-wrap: wrap; position: static; width: 100%; padding: 4px 8px 8px; }
.chat-item-actions[open] { width: 100%; margin: 0; }
.chat-item-actions[open] > summary { position: absolute; top: 9px; right: 3px; }
.chat-item-actions[open] ~ .chat-item-open { padding-right: 34px; }
.chat-item-menu button { border: 1px solid var(--border); border-radius: 8px; color: var(--soft); background: var(--panel); min-height: 34px; padding: 6px 11px; font: 500 12px var(--font); cursor: pointer; }
.chat-item-menu button:hover { border-color: var(--accent); }
.chat-item-menu .danger, .chat-item-menu [data-action="delete"] { color: var(--danger); }
.chat-rename-form { width: 100%; padding: 4px 8px 10px; display: flex; flex-wrap: wrap; gap: 5px; }
.chat-rename-form input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--field-border); color: var(--text); background: var(--panel); border-radius: 8px; font: 13px var(--font); }
.chat-rename-form button { min-height: 32px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font: 12px var(--font); color: var(--text); background: var(--panel); cursor: pointer; }
.chat-item-error { width: 100%; font-size: 11px; line-height: 1.5; color: var(--danger); margin: 0; padding: 0 10px 10px; }
@media (max-width: 1050px) and (min-width: 761px) {
  .rail { --sidebar-width: 218px; }
  .home { padding-left: 26px; padding-right: 26px; }
  .home-recents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-recent:nth-child(3) { display: none; }
}
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .shell { padding-top: calc(56px + env(safe-area-inset-top)); padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
  .shell > .rail, .shell.sidebar-collapsed > .rail { position: fixed; z-index: 45; width: 0; height: 0; padding: 0; border: 0; top: 0; left: 0; background: transparent; }
  .rail > .rail-brand-row, .rail > .rail-top-actions, .rail > .rail-primary, .rail > .rail-creation-shortcut, .rail > .rail-history-label, .rail-footer > .rail-avatar { display: none; }
  .rail > .rail-footer { margin: 0; padding: 0; }
  #shell-more > summary { display: none; }
  #shell-more .shell-more-panel { position: fixed; left: auto; right: 12px; top: calc(60px + env(safe-area-inset-top)); bottom: auto; width: min(280px, calc(100vw - 24px)); max-height: calc(100dvh - 140px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .shell.sidebar-collapsed #shell-more .shell-more-panel { left: auto; bottom: auto; }
  .mobile-topbar { position: fixed; display: flex; align-items: center; gap: 8px; padding: env(safe-area-inset-top) 10px 0; height: calc(56px + env(safe-area-inset-top)); background: var(--rail); border-bottom: 1px solid var(--hairline); left: 0; right: 0; top: 0; z-index: 30; }
  .mobile-topbar .shell-icon-btn { width: 44px; height: 44px; }
  .mobile-brand { display: flex; flex: 1; justify-content: center; align-items: center; gap: 7px; border: 0; background: none; color: var(--text); font: 650 16px var(--font); min-height: 44px; cursor: pointer; }
  .mobile-brand img { width: 25px; height: 25px; }
  .mobile-bottom-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); height: calc(62px + env(safe-area-inset-bottom)); position: fixed; bottom: 0; left: 0; right: 0; background: var(--rail); border-top: 1px solid var(--hairline); z-index: 30; }
  .mobile-bottom-nav button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; min-height: 50px; min-width: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 10px; font: 500 10px var(--font); cursor: pointer; }
  .mobile-bottom-nav svg { width: 20px; height: 20px; }
  .mobile-bottom-nav button.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
  .rail .drawer, .shell.sidebar-collapsed .rail .drawer { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; width: min(88vw, 340px); height: 100dvh; padding: env(safe-area-inset-top) 10px env(safe-area-inset-bottom); border-right: 1px solid var(--border); background: var(--panel); box-shadow: 12px 0 48px rgba(0,0,0,.2); min-height: 0; }
  .rail .drawer-head { display: flex; gap: 8px; padding: 12px 4px; }
  .rail .drawer-title { font-size: 15px; flex: 1; }
  .rail .drawer-head #credits-pill { display: none; }
  .rail .drawer-head #drawer-new { font-size: 12px; min-height: 44px; }
  .rail .drawer-head .shell-icon-btn { width: 44px; height: 44px; }
  .drawer-backdrop { z-index: 42; }
  .main { width: 100%; }
  .home { padding: 0 18px 32px; }
  .home-head { min-height: 44px; padding: 4px 0; gap: 8px; }
  .home-page-label { display: none; }
  .home .hero { padding-top: clamp(12px, 3vh, 24px); gap: 16px; }
  .home-intro { margin-bottom: 8px; }
  .home-intro h1 { font-size: 24px; letter-spacing: -.7px; }
  .home-intro p { font-size: 12.5px; margin-top: 10px; }
  .home-recent-section { margin-top: 34px; }
  .home-recents { display: flex; flex-direction: column; gap: 8px; }
  .home-recent { padding: 13px 14px; }
  .home-recent-title { min-height: auto; -webkit-line-clamp: 1; }
  .home-recent-meta { margin-top: 5px; }
  .home-recent:nth-child(3) { display: block; }
  .explore { padding: 26px 18px 40px; }
  .explore h1 { font-size: 25px; }
  .explore-head p { font-size: 13px; margin-bottom: 24px; }
  .explore .bot-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .explore .bot-tile { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 112px; padding: 14px; }
  .explore .bot-tile-name { font-size: 12px; }
  .explore-search-wrap .field { font-size: 16px; }
  .composer-model, .plus-btn, .send-btn, .ghost-btn, .canvas-icon, .chat-head .rail-btn, .chat-model-btn { min-height: 44px; }
  .send-btn, .canvas-icon, .plus-btn, .chat-head .rail-btn { min-width: 44px; }
  .send-btn { width: 44px; height: 44px; }
  .composer-bar { gap: 1px; }
  .composer-bar .composer-model { padding-left: 8px; padding-right: 8px; }
  .chat-head { padding-top: 8px; padding-bottom: 8px; }
  .chat-composer-wrap { padding-bottom: 8px; }
  .chat-item-open { padding: 12px 10px; }
  .chat-item .chat-item-title { font-size: 13px; }
  .chat-item .chat-item-meta { font-size: 11px; }
  .chat-item-actions { margin-top: 5px; }
  .chat-item-actions > summary, .chat-item-menu button, .chat-rename-form button { min-width: 44px; min-height: 44px; }
  .chat-item-actions[open] > summary { top: 5px; }
  .app-status-notice { margin: 8px 12px; }
  .app-status-notice button { min-height: 44px; }
  .main-credits { top: 13px; right: 16px; }
  .ib-toolbar { padding-right: 16px; }
}
@media (max-height: 500px) and (max-width: 760px), (max-height: 500px) and (pointer: coarse) and (max-width: 1024px) {
  .home .hero { padding-top: 12px; }
  .home-intro { margin-bottom: 0; }
  .home-intro p { display: none; }
  .home-recent-section { margin-top: 24px; }
  .mobile-topbar { height: calc(48px + env(safe-area-inset-top)); }
  .shell { padding-top: calc(48px + env(safe-area-inset-top)); }
}
.preset-pick { border: 0; background: transparent; font: inherit; text-align: left; color: inherit; cursor: pointer; padding: 8px 0; }
@media (hover: none) { .preset-acts { opacity: 1; } }
.chat-item-menu .chat-item-rename, .chat-item-menu .chat-item-del { position: static; display: inline-flex; align-items: center; justify-content: center; width: auto; height: auto; right: auto; top: auto; opacity: 1; transform: none; }
.chat-item-menu .chat-item-del { color: var(--danger); }
.rail .rail-new-action { flex: 1 1 auto; width: auto; min-width: 0; }
.chat-item { flex-direction: row; gap: 0; align-items: center; cursor: default; }
.chat-item-open { text-align: left; }
.shell.sidebar-collapsed .rail .rail-new-action { flex: none; width: 44px; }
.activity:not(.open) { visibility: hidden; }
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .ib-toolbar .ib-mode-button, .ib-toolbar-actions .ib-button { min-height: 44px; }
}
.compare-composer textarea { border-color: var(--field-border); background: var(--panel); }
.shell-modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 4px; }
.shell-modal-heading h2 { margin: 0; font-size: 17px; font-weight: 600; }
#search-overlay .model-search { margin: 10px 16px 12px; width: calc(100% - 32px); border: 1px solid var(--field-border); background: var(--surface); border-radius: 10px; min-height: 44px; font-size: 14px; }
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  #search-overlay .model-search { font-size: 16px; }
  .shell-modal-heading .shell-icon-btn { min-width: 44px; min-height: 44px; }
}
.main-credits { z-index: 10; box-shadow: none; }

/* The history exposes dates once per group and exact model IDs on demand. */
.chat-history-group { margin: 0; padding: 15px 10px 5px; color: var(--muted); font-size: 11px; line-height: 1.5; font-weight: 500; }
.chat-item-details { flex: 0 0 100%; min-width: 0; padding: 8px 2px 4px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.chat-item-detail-label { display: block; margin-top: 4px; font-size: 10.5px; }
.chat-item-details code, .chat-item-details time { display: block; overflow-wrap: anywhere; white-space: normal; color: var(--soft); font: 11px/1.6 var(--font); }
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .chat-history-group { padding-top: 12px; font-size: 12px; }
}

/* One compact composer contains model selection and the current tool state. */
.home .composer, .chat .composer { padding: 12px 14px 9px; border-radius: 16px; box-shadow: 0 2px 12px rgba(20,20,30,.025); }
.home .composer:focus-within, .chat .composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: none; }
.home .composer-row, .chat .composer-row { min-height: 38px; align-items: flex-start; gap: 8px; }
.home .composer textarea, .chat .composer textarea { min-height: 28px; font-size: 16px; line-height: 1.7; padding-top: 4px; }
.home .composer .plus-btn, .chat .composer .plus-btn { width: 34px; height: 34px; min-height: 34px; min-width: 34px; border: 0; border-radius: 8px; margin: 0; background: transparent; }
.home .composer-bar, .chat .composer-bar { gap: 8px; padding-top: 6px; min-height: 42px; }
.composer-model-picker { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 260px; min-height: 36px; padding: 5px 7px; border: 0; border-radius: 8px; color: var(--text); background: transparent; font: 500 12.5px/1.5 var(--font); cursor: pointer; }
.composer-model-picker:hover { background: var(--surface); }
.composer-model-picker .bot-ico { width: 19px; height: 19px; border-radius: 5px; font-size: 9px; }
.composer-model-picker .chev { width: 12px; height: 12px; flex: none; color: var(--muted); }
.composer-model-picker #home-model-name, .composer-model-picker #chat-model-name { min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-width: 0; }
.home .composer-model, .chat .composer-model { border-radius: 7px; padding: 6px 8px; min-height: 36px; font-weight: 450; font-size: 12px; white-space: nowrap; }
.home .composer-model.on, .chat .composer-model.on { color: var(--accent); background: transparent; }
.home .composer-model:hover, .chat .composer-model:hover { background: var(--surface); }
.composer-settings { position: relative; display: inline-flex; }
.composer-settings-toggle { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.composer-settings-toggle svg { width: 17px; height: 17px; }
.composer-settings-toggle:hover, .composer-settings-toggle[aria-expanded="true"] { color: var(--text); background: var(--surface); }
.composer-settings-menu { position: absolute; right: 0; bottom: calc(100% + 8px); min-width: 230px; max-width: calc(100vw - 32px); padding: 6px; z-index: 45; border: 1px solid var(--border); border-radius: 11px; background: var(--panel); box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.composer-settings-menu [role="menuitem"] { width: 100%; text-align: left; justify-content: flex-start; min-height: 40px; border-radius: 6px; }
.composer-settings-menu .preset-label { display: inline; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.composer-preset-status { max-width: 150px; padding: 5px 8px; min-height: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; border-radius: 6px; color: var(--accent); background: transparent; font: 12px var(--font); cursor: pointer; }
.composer-preset-status:hover { background: var(--surface); }
.chat-model-summary { display: inline-flex; gap: 8px; align-items: center; min-width: 0; color: var(--soft); font-size: 13px; font-weight: 500; }
.chat-model-summary #chat-summary-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.chat-model-summary .bot-ico { width: 24px; height: 24px; border-radius: 7px; flex: none; }
.home .send-btn, .chat .send-btn { width: 36px; height: 36px; border-radius: 10px; }
.home .send-btn:hover:not(:disabled), .chat .send-btn:hover:not(:disabled) { transform: none; }
@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .home .composer, .chat .composer { padding: 10px 10px 7px; }
  .home .composer-row, .chat .composer-row { min-height: 42px; }
  .home .composer .plus-btn, .chat .composer .plus-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .home .composer textarea, .chat .composer textarea { padding-top: 8px; }
  .home .composer-bar, .chat .composer-bar { display: grid; grid-template-columns: max-content max-content 44px minmax(0, 1fr) 44px; align-items: center; gap: 0; padding-top: 0; }
  .composer-bar > .composer-model-picker { grid-column: 1 / -1; grid-row: 1; width: 100%; max-width: 100%; min-height: 44px; justify-content: flex-start; padding: 5px 7px; }
  .composer-tools { display: contents; }
  .composer-tools > [id$="-think"] { grid-column: 1; grid-row: 2; }
  .composer-tools > [id$="-web"] { grid-column: 2; grid-row: 2; }
  .composer-tools > .composer-settings { grid-column: 3; grid-row: 2; }
  .composer-tools > .composer-preset-status { grid-column: 1 / -1; grid-row: 3; max-width: 100%; justify-self: start; }
  .composer-bar > .spacer { display: none; }
  .composer-bar > .send-btn { grid-column: 5; grid-row: 2; }
  .composer-bar > .gen-controls { grid-column: 1 / 5; grid-row: 2; }
  .home .composer-model, .chat .composer-model, .composer-preset-status { min-height: 44px; }
  .composer .composer-model .think-label { display: inline; }
  .composer-settings-toggle, .home .send-btn, .chat .send-btn { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
  .composer-settings-menu { right: -42px; min-width: 220px; }
  .composer-settings-menu [role="menuitem"] { min-height: 44px; }
  .composer-preset-status { max-width: 130px; }
  .chat-model-summary { flex: 1; font-size: 12px; }
}
.composer-settings-label { display: none; }
.composer-settings-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border: 0; background: transparent; color: var(--text); font: 12px/1.5 var(--font); cursor: pointer; }
.composer-settings-item:hover { background: var(--surface); }
.preset-menu-status { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; color: var(--muted); font-size: 11px; }

.composer-preset-status .preset-label { display: inline; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px), (pointer: coarse) and (max-width: 1024px) {
  .shell.sidebar-collapsed .rail > .rail-history-label { display: none; }
}
