/* Homepage and model conversations: scoped so the existing sidebar stays intact. */
.monochrome-shell .home-topbar{border-bottom-color:transparent}
.home-topbar .conversation-status{display:none}
.monochrome-shell #main.home-view .chat-scroll{display:none}
.home-surface{flex:1;min-height:0;overflow:auto;padding:0 32px 56px;scrollbar-width:thin;scrollbar-color:transparent transparent}
.home-surface:hover{scrollbar-color:var(--line-strong) transparent}
.home-hero{width:100%;max-width:840px;margin:0 auto;padding-top:clamp(28px,4vh,52px)}
.home-brand{display:flex;align-items:center;justify-content:center;gap:16px;margin:0 0 32px;color:var(--ink);font-size:48px;font-weight:600;line-height:1.2;letter-spacing:normal;overflow-wrap:anywhere}
.home-brand-icon{display:flex;align-items:center;justify-content:center;width:48px;height:48px;flex:none;border-radius:50%;overflow:hidden;aspect-ratio:1}
.home-brand-icon img{width:100%;height:100%;object-fit:cover}
.home-shortcuts{display:flex;align-items:center;justify-content:center;gap:8px;max-width:100%;margin-bottom:16px;flex-wrap:wrap}
.home-shortcut{display:flex;align-items:center;gap:8px;min-width:0;max-width:210px;min-height:40px;padding:6px 9px;border:1px solid transparent;border-radius:9px;background:transparent;color:var(--muted);font:inherit;font-size:14px;line-height:20px;cursor:pointer;touch-action:manipulation;transition:background-color .14s,color .14s,border-color .14s}
.home-shortcut:hover{background:var(--accent-faint);color:var(--ink)}
.home-shortcut.active{background:var(--hover);border-color:var(--line);color:var(--ink)}
.home-shortcut .identity-image{width:24px;height:24px;flex:none;border-radius:6px}
.home-shortcut>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-shortcuts[hidden]{display:none}
.monochrome-shell .home-view .composer-zone{max-width:none;padding:0;margin:0;background:transparent}
.monochrome-shell .home-view .composer,.monochrome-shell .model-chat-view .composer{background:var(--hover);border:1px solid var(--line);box-shadow:none;border-radius:16px;padding:14px 18px 12px}
.monochrome-shell .home-view .composer textarea{min-height:48px;font-size:16px;line-height:1.65;caret-color:var(--ink)}
.monochrome-shell .home-view .composer-bottom{margin-top:12px}
.monochrome-shell .home-view .composer-meta,.monochrome-shell .home-view .composer-disclaimer{display:none}
.monochrome-shell .home-view #composer-model{display:inline-flex}



.home-view .composer-upload span{display:none}
.home-view .composer-upload{width:32px;padding:0}
.home-catalog{width:100%;max-width:1120px;margin:64px auto 0}
.home-model-section{margin-bottom:32px;min-width:0}
.home-section-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.home-section-heading h2{margin:0;color:var(--ink);font-size:16px;font-weight:650;line-height:24px;letter-spacing:-.015em;text-wrap:balance}
.home-view-all{display:inline-flex;align-items:center;border:0;background:transparent;color:var(--muted);cursor:pointer;font:inherit;font-size:13px;font-weight:500;line-height:20px;white-space:nowrap;min-height:32px;padding:6px 0;touch-action:manipulation}
.home-view-all:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.home-rail-wrap{position:relative}
.home-model-rail{display:grid;grid-auto-flow:column;grid-auto-columns:108px;justify-content:start;gap:16px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding:4px 0 8px;scrollbar-width:none;overscroll-behavior-x:contain}
.home-model-rail::-webkit-scrollbar{display:none}
.home-model-tile{display:flex;flex-direction:column;align-items:center;gap:12px;padding:10px 6px 8px;color:var(--ink);text-decoration:none;text-align:center;min-width:0;scroll-snap-align:start;border-radius:12px;touch-action:manipulation;transition:background-color .14s}
.home-model-icon{display:block;width:68px;height:68px;border-radius:16px;overflow:hidden;border:1px solid var(--line)}
.home-model-icon .identity-fallback{font-size:23px;color:var(--ink)}
.home-model-tile:hover{background:var(--accent-faint)}
.home-model-tile:hover .home-model-icon{border-color:var(--line-strong)}
.home-model-name{font-size:13px;font-weight:450;line-height:1.5;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:39px;max-width:126px}
.home-rail-arrow{position:absolute;top:26px;display:grid;place-items:center;width:36px;height:36px;padding:0;border:1px solid var(--line-strong);border-radius:50%;background:var(--surface);color:var(--ink);box-shadow:none;cursor:pointer;touch-action:manipulation}
.home-rail-arrow[hidden]{display:none}
.home-rail-arrow.next{right:-8px}.home-rail-arrow.previous{left:-8px}
.home-rail-arrow.next svg{transform:rotate(-90deg)}.home-rail-arrow.previous svg{transform:rotate(90deg)}
.home-all-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(124px,1fr));gap:24px 12px;padding:12px 0}
.home-no-models{text-align:center;color:var(--muted);padding:22px 10px}
.monochrome-shell #main.model-chat-view{--reading-width:1000px}
#model-intro-host{width:100%;max-width:var(--reading-width);margin:0 auto;flex:none}
/* Header card of a model page: structure and metrics of Poe's bot card
   (768px wide; 16px padding; 48px avatar; 24px title and byline rows; 32px
   pill and round buttons; 16px/24px description; divider; 14px footer). */
.model-intro{--card-bg:#f5f5f7;--card-chip:#e7e7ec;--card-link:#5d5cde;width:100%;max-width:768px;margin:4px auto 24px;padding:16px 16px 14px;background:var(--card-bg);border-radius:12px;min-width:0;color:var(--ink)}
html[data-theme=dark] .model-intro{--card-bg:#1d1e22;--card-chip:#2c2d33;--card-link:#a9a8ff}
.model-intro-top{display:flex;align-items:center;gap:12px;min-width:0}
.model-intro-icon{width:48px;height:48px;border-radius:10px;overflow:hidden;flex:none}
.model-intro-icon .identity-fallback{font-size:16px;color:var(--ink)}
.model-intro-title{min-width:0;flex:1}
.model-intro-title h2{margin:0;font-size:18px;line-height:24px;font-weight:700;letter-spacing:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.model-intro-title p{display:flex;align-items:center;gap:6px;margin:0;height:24px;font-size:14px;line-height:24px;color:var(--muted);min-width:0;white-space:nowrap}
.model-intro-publisher{display:inline-flex;align-items:center;gap:6px;min-width:0}
.model-intro-publisher-icon{width:20px;height:20px;border-radius:50%;overflow:hidden;flex:none;background:var(--card-chip)}
.model-intro-publisher-icon .identity-fallback{font-size:10px;font-weight:600;color:var(--ink)}
.model-intro-handle{color:var(--card-link);overflow:hidden;text-overflow:ellipsis}
.model-intro-category{overflow:hidden;text-overflow:ellipsis}
.model-intro-dot{color:var(--muted)}
.model-intro-badge{flex:none;padding:0 6px;height:18px;line-height:18px;border-radius:4px;background:var(--card-chip);color:var(--ink);font-size:11px;font-weight:700;letter-spacing:.02em}
.model-intro-actions{display:flex;align-items:center;gap:8px;flex:none;align-self:flex-start;margin-top:6px}
.model-intro-actions .icon-btn,.model-rate{display:inline-flex;align-items:center;justify-content:center;height:32px;min-height:32px;border:0;border-radius:16px;background:var(--card-chip);color:var(--ink);cursor:pointer}
.model-intro-actions .icon-btn{width:32px;min-width:32px;padding:0}
.model-rate{gap:8px;padding:0 14px;font:inherit;font-size:14px;font-weight:600;white-space:nowrap}
.model-intro-actions .icon-btn:hover,.model-rate:hover{filter:brightness(.96)}
html[data-theme=dark] .model-intro-actions .icon-btn:hover,html[data-theme=dark] .model-rate:hover{filter:brightness(1.18)}
.model-bookmark[aria-pressed=true]{color:var(--card-link)}.model-bookmark[aria-pressed=true] svg{fill:currentColor}
.model-intro-description{margin:12px 0 0;max-height:144px;overflow:auto;scrollbar-width:thin;font-size:16px;line-height:24px;white-space:pre-wrap;overflow-wrap:anywhere}
.model-intro-description:empty{display:none}
.model-intro-footer{margin-top:10px;padding-top:12px;border-top:1px solid var(--line-strong);font-size:14px;line-height:20px;color:var(--muted);overflow-wrap:anywhere}
.model-intro-footer>svg{display:inline-block;vertical-align:-3px;margin-right:8px}
.model-intro-more{margin-left:8px;padding:0;border:0;background:none;font:inherit;color:var(--card-link);cursor:pointer;text-decoration:none}
.model-intro-more:hover{text-decoration:underline}
.model-rates{display:grid;grid-template-columns:minmax(0,1fr);gap:14px}.model-rates p,.model-rate-list dd,.model-rate-list dt{overflow-wrap:anywhere}
.model-rate-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(120px,100%),1fr));gap:8px;margin:0;min-width:0}
.model-rate-list>div{padding:10px 12px;border:1px solid var(--line);border-radius:10px}
.model-rate-list dt{font-size:12px;color:var(--muted)}.model-rate-list dd{margin:2px 0 0;font-size:18px;font-weight:600}
.model-rate-note{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.model-rates .model-specifications{margin:0}
.model-rates .model-rate-list{grid-template-columns:repeat(2,minmax(0,1fr));font-variant-numeric:tabular-nums}
.model-rates .model-rate-list dd{font-size:16px;line-height:1.5}
.model-details-description{white-space:pre-wrap;overflow-wrap:anywhere}
.monochrome-shell .model-chat-view .composer textarea{min-height:40px;font-size:17px}
.monochrome-shell .model-chat-view .composer-zone{padding-bottom:0}
.monochrome-shell .model-chat-view .composer-disclaimer{text-align:center}
.home-layout-editor{max-width:1100px}.home-layout-editor>.section-heading{margin:28px 0 14px}
.layout-section{margin-bottom:18px;padding:20px}
.layout-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:16px}
.layout-section-head h2{margin:0 0 5px;font-size:16px}.layout-section-head p,.home-layout-editor>.section-heading p{margin:0;color:var(--muted);font-size:12px}
.layout-section-name{flex:1;min-width:100px}.layout-section-name input{font-weight:600;width:100%}
.layout-section-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.layout-visible{display:flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap}
.layout-visible input,.layout-pick-row input{width:16px;height:16px;flex:none;margin:0}
.layout-model-row{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:10px 0;min-width:0}
.layout-model-row.dragging{opacity:.45}.layout-drag{color:var(--muted);cursor:grab;font-size:22px;user-select:none}
.layout-model-row>.identity-image,.layout-pick-row>.identity-image{width:36px;height:36px;border-radius:10px;flex:none}
.layout-model-title{min-width:0;flex:1;display:grid;gap:4px}.layout-model-title strong{font-size:13px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.layout-model-title small{font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.layout-row-actions{display:flex;align-items:center;gap:4px;flex:none}.layout-row-actions .icon-btn{width:28px;height:28px}
.layout-empty{color:var(--muted);font-size:12px;margin:0;padding:16px 0 3px}
.layout-model-picker{max-height:45vh;overflow:auto;padding:4px 0}
.layout-pick-row{display:flex;align-items:center;gap:12px;padding:10px 6px;cursor:pointer;border-bottom:1px solid var(--line)}
.layout-pick-row>span:not(.identity-image){display:grid;gap:4px;flex:1;min-width:0}.layout-pick-row strong{font-size:13px;overflow-wrap:anywhere}.layout-pick-row small{font-size:11px;color:var(--muted);overflow-wrap:anywhere}
@media(min-width:1600px){.home-hero{padding-top:52px}.home-brand-icon{width:52px;height:52px}}
@media(max-width:1000px){.home-surface{padding:0 24px 40px}.home-brand{font-size:42px}.home-brand-icon{width:44px;height:44px}.home-catalog{margin-top:56px}.layout-section-head{flex-wrap:wrap}.layout-section-actions{margin-left:auto}}
@media(max-width:600px){
 .home-surface{padding:0 20px 32px}.home-hero{padding-top:24px}.home-brand{gap:12px;font-size:36px;letter-spacing:-1px;margin-bottom:28px}.home-brand-icon{width:42px;height:42px}
 .home-brand-icon svg{width:45px;height:45px}.home-shortcuts{justify-content:flex-start;gap:8px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-bottom:14px;padding:2px;scroll-padding-inline:2px}.home-shortcut{font-size:13px;flex:none;max-width:180px;min-height:44px;padding:8px}.home-shortcut .identity-image{width:23px;height:23px}
 .monochrome-shell .home-view .composer{padding:15px 14px 12px}.monochrome-shell .home-view .composer textarea{font-size:16px;min-height:42px}.home-catalog{margin-top:44px}
 .home-section-heading h2{font-size:15px}.home-view-all{font-size:13px;min-height:44px}.home-model-rail{grid-auto-columns:96px;gap:16px;padding-left:0}.home-model-icon{width:64px;height:64px;border-radius:16px}.home-model-name{font-size:13px;min-height:39px}.home-model-section{margin-bottom:28px}.home-rail-arrow{top:20px;width:44px;height:44px}
 .model-intro{margin-top:0}.model-intro-top{flex-wrap:wrap}.model-intro-title{flex:1 1 0}.model-rate span{display:none}.model-rate{width:32px;padding:0}.model-intro-description{font-size:15px}.model-intro-footer{font-size:13px}
 .layout-section{padding:13px}.layout-section-name{width:100%;flex-basis:100%}.layout-row-actions{gap:0}.layout-model-row{gap:7px}.layout-model-row>.identity-image{width:28px;height:28px}.layout-row-actions .text-btn{font-size:11px}
}
@media(prefers-reduced-motion:reduce){.home-model-tile,.home-shortcut{transition:none}.home-model-rail{scroll-behavior:auto}}

/* Keep the actual selection visible without changing the administrator's shortcuts. */
.monochrome-shell .home-view #composer-model.home-selection-other{display:inline-flex}

/* The handle is the sole pointer sorting control for homepage models. */
.home-layout-editor .layout-drag{border:0;background:transparent;color:var(--muted);font:inherit;font-size:23px;cursor:grab;touch-action:none;user-select:none;width:32px;min-width:32px;padding:4px;border-radius:6px}
.home-layout-editor .layout-drag:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.home-layout-editor .layout-model-row.dragging{opacity:.5;background:var(--hover)}
.home-layout-editor .layout-model-row.layout-drop-target{box-shadow:inset 0 -2px var(--ink);background:var(--hover)}

/* All model groups mirror the homepage's left-to-right order. */
.home-layout-editor .layout-horizontal-rows{display:flex;align-items:stretch;gap:12px;overflow-x:auto;overscroll-behavior-x:contain;padding:2px 2px 10px;scroll-padding-inline:2px;scrollbar-width:thin;scrollbar-color:var(--muted) transparent}
.home-layout-editor .layout-horizontal-rows .layout-model-row{display:grid;grid-template-columns:28px 32px minmax(0,1fr);grid-template-rows:auto auto;column-gap:9px;row-gap:10px;align-content:center;flex:0 0 clamp(190px,calc((100% - 48px)/5),218px);padding:12px;border:0;border-radius:12px;background:var(--hover)}
.home-layout-editor .layout-horizontal-rows .layout-drag{box-sizing:border-box;display:grid;place-items:center;align-self:center;width:28px;min-width:28px;height:28px;min-height:28px;padding:0;cursor:grab}
.home-layout-editor .layout-horizontal-rows .layout-model-row>.identity-image{width:32px;height:32px;border-radius:9px}
.home-layout-editor .layout-horizontal-rows .layout-model-title{width:100%;gap:4px}
.home-layout-editor .layout-horizontal-rows .layout-model-title strong{font-size:13px;font-weight:600}
.home-layout-editor .layout-horizontal-rows .layout-row-actions{grid-column:1/-1;justify-content:flex-end;gap:4px}
.home-layout-editor .layout-horizontal-rows .layout-row-actions .text-btn{font-size:12px;padding:4px 0}
.home-layout-editor .layout-horizontal-rows .layout-row-actions .icon-btn{box-sizing:border-box;flex:none;width:32px;min-width:32px;height:32px;min-height:32px;padding:0;border-radius:9px}
.home-layout-editor .layout-horizontal-rows .layout-model-row.layout-drop-target{box-shadow:inset 2px 0 var(--ink)}

/* Keep the icon clear of the admin dialog input padding override. */
body.admin-mode dialog .layout-model-search #layout-model-search{padding-left:42px}
.layout-model-search>svg{pointer-events:none}
.layout-autosave [hidden]{display:none!important}
.model-intro-icon .identity-image,.model-intro-publisher-icon .identity-image{background:var(--card-chip)}
#model-more svg{stroke-width:3}


/* Quiet homepage surfaces; model conversation styles keep their own geometry. */
.home-view{--home-composer:#191b20;--home-composer-line:#353940}
html[data-theme=light] .home-view{--home-composer:#f7f8fa;--home-composer-line:#dee2e8}
.monochrome-shell .home-view .composer{background:var(--home-composer);border-color:var(--home-composer-line);padding:18px 20px 14px}
.monochrome-shell .home-view .composer:focus-within{border-color:var(--muted);box-shadow:none}
.home-view :is(.home-shortcut,.home-model-tile,.home-view-all,.home-rail-arrow):focus-visible{outline:2px solid var(--muted);outline-offset:2px}
.home-view .home-model-rail:focus-visible{outline:2px solid var(--muted);outline-offset:-2px;border-radius:12px}
.home-view .home-rail-arrow:hover{background:var(--hover);border-color:var(--muted)}
.home-view .home-brand-icon svg{max-width:100%;max-height:100%}
@media(max-width:600px){.monochrome-shell .home-view .composer{padding:15px 14px 12px}}
@media(pointer:coarse),(max-width:600px){
 .monochrome-shell .home-view :is(.attachment-add,.composer-tools .icon-btn,.send-btn){min-width:44px;min-height:44px}
 .monochrome-shell .home-view .composer-model{min-height:44px}
 .home-view .chat-mode-switch button{min-width:44px;min-height:44px}
}
@media(min-width:361px) and (max-width:600px){
 .monochrome-shell .home-view .composer-bottom{flex-wrap:nowrap;gap:6px}
 .monochrome-shell .home-view .composer-tools{flex:none}
 .home-view .chat-mode-switch{margin-left:2px;padding:2px}
 .monochrome-shell .home-view .composer-actions{flex:1 1 0;min-width:0}
 .monochrome-shell .home-view .composer-model{flex:1 1 0;min-width:44px;max-width:100%;padding-inline:6px;gap:4px}
 .home-view .composer-model .identity-image{width:18px;height:18px}
}

/* Keep the original horizontal browsing on phones; compact its visual rhythm. */
@media(max-width:760px){
 .home-surface{padding:0 12px 24px;min-width:0}
 .home-hero{padding-top:12px}
 .home-brand{gap:10px;margin-bottom:18px}
 .home-brand-icon{width:32px;height:32px}
 .home-shortcuts{display:flex;flex-wrap:nowrap;justify-content:flex-start;gap:4px;overflow-x:auto;overflow-y:hidden;padding:0;margin-bottom:12px;scrollbar-width:none;overscroll-behavior-x:contain}
 .home-shortcuts::-webkit-scrollbar{display:none}
 .home-shortcut{flex:none;width:auto;min-width:0;max-width:180px;min-height:44px;padding:6px;gap:5px;font-size:12px;line-height:16px;justify-content:flex-start;border-radius:9px}
 .home-shortcut .identity-image{width:18px;height:18px;flex:none}
 .home-shortcut>span:last-child{white-space:nowrap;text-align:left}
 .monochrome-shell .home-view .composer{padding:12px 10px 10px;border-radius:14px}
 .monochrome-shell .home-view .composer textarea{min-height:36px;line-height:1.5}
 .home-catalog{margin-top:20px}
 .home-model-section{margin-bottom:12px}
 .home-section-heading{margin-bottom:0;gap:8px}
 .home-section-heading h2{font-size:14px;line-height:20px;font-weight:650}
 .home-view-all{min-height:44px;padding:0 4px;font-size:12px}
 .home-model-rail{grid-auto-flow:column;grid-auto-columns:80px;grid-template-columns:none;gap:6px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding:2px 0 4px}
 .home-model-tile{gap:5px;padding:2px;border-radius:10px;min-height:75px}
 .home-model-icon{width:36px;height:36px;border-radius:10px}
 .home-model-name{max-width:100%;min-height:30px;font-size:12px;line-height:15px;overflow-wrap:anywhere}
 .home-rail-arrow{display:none}
 .home-all-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:8px 0}
 .model-intro{margin:0 auto 16px;padding:12px;border-radius:12px}
 .model-intro-top{gap:8px;flex-wrap:nowrap}
 .model-intro-icon{width:36px;height:36px;border-radius:9px}
 .model-intro-title h2{font-size:15px;line-height:21px}
 .model-intro-title p{font-size:12px;line-height:18px;height:auto}
 .model-intro-actions{gap:0;margin-top:0}
 .model-intro-actions :is(button,.model-rate){width:36px;min-width:36px;height:44px;padding:0}
 .model-rate span{display:none}
 .model-intro-description{margin-top:10px;font-size:14px;line-height:22px}
 .model-intro-footer{margin-top:10px;padding-top:10px;font-size:12px;line-height:20px}
}
@media(max-width:350px){.home-model-rail,.home-all-grid{column-gap:4px}.model-intro-icon{display:none}}

.home-layout-editor .layout-horizontal-rows .layout-row-actions .text-btn{margin-right:auto;white-space:nowrap;flex-shrink:0}
.home-layout-editor .layout-horizontal-rows .layout-model-title{overflow:hidden}
.home-layout-editor .layout-horizontal-rows .layout-row-actions .icon-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
