/* Polish layer for AI pages (preview: add ?polish=1). Loaded last; everything is scoped to html.pol so the live
   pages are untouched until this is switched on for everyone. Same template and colors; only the finish changes. */

/* 1. Opens like an app: smaller name and logo, one line of context, the box and starters in view on first load. */
html.pol .aipage.home.st{--st-hs:40px}
html.pol .aipage.home.st .hm-hero .ainame.st-h1{font-size:clamp(28px, 4vw, var(--st-hs)) !important; font-weight:600; letter-spacing:-.02em; line-height:1.12;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
html.pol .aipage.home.st-clear .cl-big{width:56px !important; height:56px !important; margin-bottom:16px !important}
html.pol .aipage.home.st .st-deck{font-size:16px; line-height:1.5; max-width:600px; margin-top:6px}
html.pol .aipage.home.st:has(.st-deck) .ai-greet{display:none}
@media (min-width:861px){ html.pol .aipage.home .hm-hero.st-hero{padding-top:0 !important; margin-top:clamp(32px, 12vh, 112px) !important} }
@media (max-width:860px){ html.pol .aipage.home.st-clear .cl-big{width:44px !important; height:44px !important; margin-bottom:12px !important} html.pol .aipage.home.st{--st-hs:30px} }

/* 2. Under each answer: sources as quiet chips on the left, then small grey icon buttons (label on hover / for screen readers). */
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites:not(:empty){border-block:0 !important; padding:0 !important; margin-top:14px !important; gap:6px !important; align-items:center}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites[data-k]:not(:empty)::before{display:none}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites .chip-cite{order:-2; display:inline-flex !important; align-items:center; gap:6px; min-height:28px !important; padding:0 11px !important; border-radius:999px !important;
  background:color-mix(in oklab, var(--st-ink) 5%, transparent) !important; font:500 13px/1 var(--st-body) !important; color:var(--st-ink2) !important; text-decoration:none !important}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites .chip-cite svg{width:12px; height:12px}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites button.chip-cite:hover{background:color-mix(in oklab, var(--st-ink) 9%, transparent) !important; color:var(--st-ink) !important}
html.pol .aipage.home.st .cites :is(.listen, .act){order:0; font-size:0 !important; width:32px; height:32px; min-height:32px !important; padding:0 !important; display:inline-grid; place-items:center;
  border-radius:8px; color:var(--st-ink3) !important; text-decoration:none !important; background:none !important}
html.pol .aipage.home.st .cites .listen{margin-inline-start:auto}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites .chip-cite ~ .listen, html.pol .aipage.home.st .cites .listen:first-child{margin-inline-start:auto}
html.pol .aipage.home.st .cites :is(.listen, .act) svg{width:17px !important; height:17px !important; display:block !important}
html.pol .aipage.home.st .cites :is(.listen, .act):hover{background:color-mix(in oklab, var(--st-ink) 6%, transparent) !important; color:var(--st-ink) !important}
html.pol .aipage.home.st .cites .fixit{order:1; font:500 13px/1 var(--st-body) !important; color:var(--st-ink3) !important; text-decoration:none !important; padding:0 6px !important}
/* older answers keep the icons out of the way until hovered (always shown on touch screens) */
@media (hover:hover){ html.pol .aipage.home.st .anscard:not(:last-of-type) .cites :is(.listen, .act){opacity:0; transition:opacity .15s}
  html.pol .aipage.home.st .anscard:not(:last-of-type):hover .cites :is(.listen, .act), html.pol .aipage.home.st .cites :is(.listen, .act):focus-visible{opacity:1} }
/* the short accent rule above every answer goes */
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .anscard::before{display:none}
html.pol .aipage.home.st:not(.embed):not(.pv-chat) .msg.me{margin-bottom:12px !important}

/* 3. Chat title bar: just the name, with a hairline once the page scrolls under it. */
html.pol .aipage.home.st .hm-back .hm-sub{display:none !important}
html.pol .aipage.home.st .hm-back .hm-tt{font:600 15px/1.3 var(--st-body)}
html.pol .aipage.home.st.chatting .hm-top{border-bottom:1px solid var(--st-line)}

/* 4. Footer: one quiet, readable line under the box, on the column's left edge. */
html.pol .aipage.home.st .footnote{font-size:13px !important; color:#6B7280 !important; text-align:start !important}
html.pol .aipage.home.st .hl-report, html.pol .aipage.home.st .st-links{font-size:13px !important; text-align:start !important}
html.pol .aipage.home.st .hl-report{width:min(720px, 100% - 48px); margin:8px auto 24px !important; padding:0 !important; display:flex !important; justify-content:flex-start !important}
@media (max-width:600px){ html.pol .aipage.home.st .hl-report{width:calc(100% - 32px)} }
html.pol .aipage.home.st.dark .footnote, html.pol .aipage.home.st-clear.cl-dark .footnote{color:#A29F99 !important}
@media (prefers-color-scheme: dark){ html.pol .aipage.home.st-clear .footnote{color:#A29F99 !important} }

/* 5. Sidebar: one type scale, names on one line. */
html.pol .aipage.home.st .hm-railhead b{-webkit-line-clamp:1; font-weight:600; font-size:14px}
html.pol .aipage.home.st .hm-raillabel{font:600 12px/16px var(--st-body) !important; letter-spacing:0 !important; text-transform:none !important; color:var(--st-ink3) !important}
html.pol .aipage.home.st .hm-rail :is(li > button, a.hm-navrow, .hm-railbtn){font-weight:500; border-radius:10px}

/* 6. The box: a calm border at rest; the accent ring only while typing. */
html.pol .aipage.home.st .askpill{border-color:color-mix(in oklab, var(--st-ink) 16%, transparent)}
html.pol .aipage.home.st .askpill:focus-within{border-color:color-mix(in oklab, var(--sx) 55%, transparent); box-shadow:var(--st-sh)}
html.pol .aipage.home.st .askpill:has(:focus-visible){border-color:var(--sx); box-shadow:var(--st-sh), 0 0 0 3px color-mix(in oklab, var(--sx) 16%, transparent)}

/* 7. Answers: real subheads, quieter bullets, numbers that line up. */
html.pol .aipage.home.st .msg.ai{font-variant-numeric:tabular-nums}
html.pol .aipage.home.st .msg.ai :is(ul, ol){padding-inline-start:1.25em}
html.pol .aipage.home.st .msg.ai li + li{margin-top:4px}
html.pol .aipage.home.st .msg.ai li::marker{color:var(--st-ink3)}
html.pol .aipage.home.st .msg.ai p > strong:only-child{display:block; font-size:17px; font-weight:600; margin:18px 0 -4px}
html.pol .aipage.home.st .msg.ai .katex{font-size:1.02em}

/* Nov 24 (Dan, phone): nothing scrolls out below the box. The "can be wrong" line lives in the box's dock (moved there
   by app.js), Report is in the sidebar, and while the keyboard is up the line hides so the box sits on the keyboard. */
html.pol .aipage.home.st .composer > .footnote{margin:8px 2px 0 !important; padding:0 !important}
html.pol .aipage.home.st.chatting .chatcol > :is(#sugg, .addnote, .footnote, .hl-report){display:none !important}
html.pol .aipage.home.st.chatting .composer{margin-bottom:0 !important; padding-bottom:max(10px, env(safe-area-inset-bottom)) !important}
@media (max-width:860px){ html.pol .aipage.home.st .composer:focus-within > .footnote{display:none !important} }
html.pol .aipage.home.st .hm-rail .pol-report{font-size:13px; color:var(--st-rail-mute, var(--st-ink3)); text-decoration:none; display:flex; align-items:center; gap:10px; min-height:36px}
html.pol .aipage.home.st .hm-rail .pol-report svg{flex:none}
/* Phones: sources on one line, the answer's icon buttons together on the next (no lone speaker icon at the end of the source row). */
@media (max-width:600px){
  html.pol .aipage.home.st:not(.embed):not(.pv-chat) .cites:not(:empty)::after{content:''; order:-1; flex-basis:100%; height:0}
  html.pol .aipage.home.st .cites .listen, html.pol .aipage.home.st .cites .chip-cite ~ .listen{margin-inline-start:-6px}
}

/* Nov 24 (Dan, phone): the sidebar button sat 6px low against the 52px title bar (centre 32 vs 26). Centre it on the bar. */
html.pol .aipage.home.st:not(.ownview) .hm-railtoggle{top:6px !important; height:40px !important; width:40px !important}
/* The owner's long "only you see this chat…" note stays on the home screen, not docked under the box mid-chat. */
html.pol .aipage.home.ownview.chatting .composer > .footnote{display:none !important}
