/* Owner view: the owner's own AI page as an admin version of it. Loaded only for owners (app.js wireOwnerView). */
body.ownview .hm-own, body.ownview #siteTools, body.ownview .aipage .footnote { display: none !important; }
.ov-s { display: none; }

/* The bar at the top: says this is the owner's view, with a switch to see it as visitors do. */
.ov-bar { position: relative; z-index: 5; width: min(780px, 100%); margin: 14px auto 0; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 12px;
  border: 1px solid color-mix(in oklab, var(--a) 22%, transparent); background: color-mix(in oklab, var(--a) 6%, #fff); border-radius: 14px; font: 400 13.5px/1.35 var(--f-body); color: var(--c-ink2, #3E434C); }
.ov-pill { display: inline-flex; align-items: center; gap: 6px; flex: none; white-space: nowrap; color: var(--a); font-weight: 600; }
.ov-pill b { font-weight: 600; color: var(--c-ink, #15171C); }
.ov-msg { flex: 1; min-width: 0; }
.ov-msg.vis { display: none; }
.ov-btn { flex: none; border: 1px solid color-mix(in oklab, var(--a) 25%, transparent); background: #fff; color: var(--c-ink, #15171C); border-radius: 10px; padding: 7px 12px; font: 500 13px/1 var(--f-body); cursor: pointer; white-space: nowrap; }
.ov-btn:hover { border-color: var(--a); }
.ov-btn.solid { background: var(--a); color: var(--on-a, #fff); border-color: var(--a); }
body.ov-visitor .ov-bar { background: #fff; border-style: dashed; }
body.ov-visitor .ov-msg { display: none; }
body.ov-visitor .ov-msg.vis { display: block; }
body.ov-visitor .ov-btn.solid, body.ov-visitor .ov-noteh, body.ov-visitor .ov-hello, body.ov-visitor .ownpanel { display: none !important; }

/* The AI's first message to its owner */
.ov-hello { display: flex; gap: 14px; align-items: flex-start; margin: 4px 0 18px; padding: 16px 18px; border-radius: 18px; background: #fff; border: 1px solid color-mix(in oklab, var(--a) 16%, transparent); box-shadow: 0 1px 2px rgba(20,24,50,.04), 0 12px 30px -22px rgba(20,24,50,.3); }
.ov-hello p { margin: 0 0 6px; max-width: 60ch; font: 400 16px/1.55 var(--f-body); color: var(--c-ink, #15171C); }
.ov-hello p:last-child { margin-bottom: 0; }
.ov-hello .small { font-size: 13.5px; }

/* The note under an answer, just for the owner */
.ov-noteh { margin-top: 10px; }
.ov-note { padding: 11px 14px 12px; border-radius: 14px; background: color-mix(in oklab, var(--a) 5%, #fff); border: 1px dashed color-mix(in oklab, var(--a) 40%, transparent); }
.ov-tag { display: inline-flex; align-items: center; gap: 5px; font: 600 11.5px/1 var(--f-body); letter-spacing: .04em; text-transform: uppercase; color: var(--a); }
.ov-note p { margin: 6px 0 0; font: 400 14.5px/1.5 var(--f-body); color: var(--c-ink, #15171C); }
.ov-saves { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ov-save { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: 100%; text-align: left; border: 1px solid color-mix(in oklab, var(--a) 28%, transparent); background: #fff; border-radius: 11px; padding: 8px 11px; cursor: pointer; font: inherit; }
.ov-save b { font: 600 13px/1.2 var(--f-body); color: var(--a); }
.ov-save span { font: 400 12.5px/1.35 var(--f-body); color: var(--c-ink2, #4A4E57); overflow-wrap: anywhere; }
.ov-save:hover { border-color: var(--a); }
.ov-save.saved { background: color-mix(in oklab, var(--a) 8%, #fff); cursor: default; }
.aipage.dark .ov-note, .aipage.dark .ov-hello, .aipage.dark .ov-save, .aipage.dark .ov-bar { background: #1a1d36; color: #eef; }

/* The owner panel */
.ownpanel { box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 20px; background: #fff; border-left: 1px solid var(--a-line, rgba(21,23,28,.08)); overflow-y: auto; font: 400 14px/1.45 var(--f-body); color: var(--c-ink, #15171C); }
.ov-head { display: flex; align-items: center; gap: 10px; padding: 2px 2px 10px; }
.ov-head > div { flex: 1; display: flex; flex-direction: column; }
.ov-head b { font: 600 16px/1.2 var(--f-body); }
.ov-head span { font-size: 12.5px; color: var(--c-muted, #8A8E96); }
.ov-prog { --p: 0; flex: none; font: 600 12px/1 var(--f-body); color: var(--a); padding: 6px 9px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in oklab, var(--a) 16%, #fff) calc(var(--p) * 100%), #F2F0EC 0); }
.ov-x { display: none; border: 0; background: none; font-size: 24px; line-height: 1; color: var(--c-muted, #8A8E96); cursor: pointer; padding: 2px 6px; }
.ov-steps { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-direction: column; }
.ov-steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 4px; border-radius: 10px; }
.ov-steps li[data-to] { cursor: pointer; } .ov-steps li[data-to]:hover { background: #F7F6F2; }
.ov-steps i { flex: none; width: 20px; height: 20px; margin-top: 1px; border-radius: 50%; border: 1.5px solid #D6D3CC; display: grid; place-items: center; color: #fff; }
.ov-steps li.done i { background: var(--a); border-color: var(--a); }
.ov-steps span { display: flex; flex-direction: column; min-width: 0; }
.ov-steps b { font: 600 13.5px/1.3 var(--f-body); }
.ov-steps li.done b { color: var(--c-muted, #8A8E96); font-weight: 500; }
.ov-steps small { font-size: 12.5px; color: var(--c-muted, #8A8E96); overflow-wrap: anywhere; }
.ov-steps .linkbtn { font-size: 12.5px; padding: 0; }
.ov-sec { border-top: 1px solid #EEECE7; padding: 14px 2px 6px; border-radius: 4px; }
.ov-sec.flash { animation: ovflash 1.2s ease; }
@keyframes ovflash { 0%, 40% { background: color-mix(in oklab, var(--a) 9%, #fff); } 100% { background: transparent; } }
.ov-sec h4 { margin: 0 0 8px; font: 600 13.5px/1.2 var(--f-body); }
.ov-sec textarea { width: 100%; box-sizing: border-box; resize: vertical; font-size: 14px; min-height: 72px; }
.ov-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ov-drop { display: flex; align-items: center; gap: 10px; padding: 12px; margin-bottom: 8px; border: 1.5px dashed #D6D3CC; border-radius: 12px; color: var(--c-ink2, #4A4E57); cursor: pointer; transition: border-color .15s, background .15s; }
.ov-drop svg { flex: none; color: var(--a); }
.ov-drop span { display: flex; flex-direction: column; font-size: 13.5px; } .ov-drop small { color: var(--c-muted, #8A8E96); font-size: 12px; }
.ov-drop:hover, .ov-drop.over { border-color: var(--a); background: color-mix(in oklab, var(--a) 5%, #fff); }
.ov-up:empty { display: none; } .ov-up { display: flex; flex-direction: column; gap: 4px; margin: -2px 0 8px; font-size: 12.5px; }
.ov-uprow { display: flex; align-items: center; gap: 8px; } .ov-uprow small { color: var(--c-muted, #8A8E96); }
.ov-docs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ov-docs:empty { display: none; }
.ov-docs li { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.ov-docs .dt { flex: none; font: 600 9.5px/1 var(--f-body); letter-spacing: .03em; padding: 4px 5px; border-radius: 5px; background: #F2F0EC; color: #6A6D74; }
.ov-docs .dn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-docs em { font-style: normal; font-size: 11.5px; color: var(--c-muted, #8A8E96); }
.ov-foot { display: flex; gap: 16px; border-top: 1px solid #EEECE7; padding: 12px 2px 0; margin-top: 6px; }

/* Wide screens: the panel sits beside the chat, always open. */
@media (min-width: 1200px) {
  .aipage.home.ownview { grid-template-columns: 272px minmax(0, 1fr) 340px; }
  .aipage.home.ownview .ownpanel { position: sticky; top: 0; height: 100vh; height: 100dvh; }
  .ov-bar .ov-btn.solid { display: none; }
  body.ov-visitor .aipage.home.ownview { grid-template-columns: 272px minmax(0, 1fr); }
}
/* Narrower: the panel slides in from the right. */
@media (max-width: 1199px) {
  .ownpanel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 70; width: min(380px, 100vw); transform: translateX(104%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 60px -30px rgba(20,24,50,.45); }
  body.ov-open .ownpanel { transform: none; }
  .ov-x { display: block; }
}
@media (max-width: 860px) {
  .ov-bar { margin: 10px 0 0; width: auto; align-self: stretch; margin-left: 46px; padding: 6px 6px 6px 10px; }
  .ov-msg { display: none; }
  .ov-pill { flex: 1; }
  body.ov-visitor .ov-msg.vis { display: none; }
  .ov-btn { padding: 7px 10px; font-size: 12.5px; }
}
@media (max-width: 600px) {
  .ov-l { display: none; } .ov-s { display: inline; }
  .ov-hello { padding: 14px; gap: 10px; }
  .ov-hello p { font-size: 15px; }
}

/* Read my website, logo and looks */
.ov-web { display: flex; gap: 8px; margin-top: 10px; }
.ov-web .input { flex: 1; min-width: 0; font-size: 14px; }
.ov-webout { color: #6B6F78; margin-top: 6px; line-height: 1.45; }
.ov-webout b { color: #15171C; }
.ov-found { margin: 8px 0; padding: 8px 10px; background: #F7F5F0; border-radius: 10px; display: grid; gap: 4px; color: #15171C; }
.ov-found span { color: #6B6F78; margin-right: 4px; }
.ov-logobtn { cursor: pointer; }
.ovdlg { position: fixed; inset: 0; z-index: 400; background: rgba(21,23,28,.45); display: grid; place-items: center; padding: 16px; overflow: auto; }
.ovdlg-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: #fff; color: #15171C; border-radius: 18px; padding: 22px 22px 18px; box-shadow: 0 30px 80px -20px rgba(21,23,28,.5); font: 15px/1.5 var(--f-body, system-ui, sans-serif); }
.ovdlg-card.wide { width: min(1040px, 100%); }
.ovdlg-card h3 { margin: 0 34px 6px 0; font: 600 20px/1.25 var(--f-body, system-ui, sans-serif); letter-spacing: -.01em; }
.ovdlg-card p { margin: 0 0 12px; }
.ovdlg-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #F1EFEA; font-size: 20px; line-height: 1; cursor: pointer; color: #15171C; }
.lk-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 6px 0 14px; min-height: 120px; }
.lk-wait { grid-column: 1 / -1; display: grid; place-items: center; min-height: 160px; }
.lk-card { display: grid; gap: 6px; align-content: start; border: 1px solid #E7E4DD; border-radius: 14px; padding: 10px; }
.lk-card p { margin: 0; min-height: 2.8em; }
.lk-frame { position: relative; aspect-ratio: 4 / 3.4; overflow: hidden; border-radius: 10px; border: 1px solid #E7E4DD; background: #fff; }
.lk-frame iframe { position: absolute; top: 0; left: 0; width: 285.7%; height: 285.7%; transform: scale(.35); transform-origin: 0 0; border: 0; pointer-events: none; }
.lg-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.lg-opt { display: grid; gap: 6px; justify-items: center; padding: 8px; border: 2px solid transparent; border-radius: 14px; background: none; cursor: pointer; font: inherit; color: inherit; }
.lg-opt.on { border-color: #26345E; background: #F4F6FB; }
.lg-tiles { display: flex; gap: 6px; }
.lg-tile { width: 92px; height: 92px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px #E7E4DD; display: grid; place-items: center; }
.lg-tile.dark { background: #1B2440; box-shadow: none; }
.lg-tile img { width: 78%; height: 78%; object-fit: contain; }
@media (max-width: 760px) { .lk-grid { grid-template-columns: 1fr; } .lk-frame { aspect-ratio: 4 / 3; } .ovdlg-card { padding: 18px 16px 14px; } .lg-tile { width: 70px; height: 70px; } }
/* Setup questions, unanswered questions and page type */
.ov-setup { margin: 12px 0 4px; padding: 12px 14px; background: #F7F5F0; border-radius: 12px; display: grid; gap: 10px; }
.ov-sq label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.ov-sqrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ov-sqrow .input { flex: 1 1 180px; min-width: 0; font-size: 14px; }
.ov-gapnote { margin: 10px 0 4px; padding: 10px 12px; border: 1px solid #E0A100; background: #FFF8E6; border-radius: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: space-between; font-size: 14px; }
.ov-gap { border: 1px solid #ECE9E2; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.ov-gap p { margin: 0 0 6px; font-size: 14px; }
.ov-gap small { color: #8A8D96; }
.ov-gap textarea { min-height: 54px; }
.ov-pv { gap: 6px; }
.ov-chip { border: 1px solid #E2DFD8; background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: #15171C; }
.ov-chip.on { background: #15171C; color: #fff; border-color: #15171C; }
/* Right after making it: save, share, who can use it */
.ov-start { margin: 12px 0 6px; display: grid; gap: 10px; }
.ov-st { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid #ECE9E2; border-radius: 12px; background: #fff; }
.ov-st > b { font-size: 14.5px; }
.ov-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #F7F5F0; border-radius: 10px; padding: 6px 6px 6px 12px; font-size: 14px; min-width: 0; }
.ov-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-acc { gap: 6px; flex-wrap: wrap; }
.ov-st .qrwrap { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
/* Tell it the basics, and what we found online (owner's welcome) */
.ov-q { display: grid; gap: 3px; margin-top: 6px; }
.ov-q > span { font: 600 13.5px/1.3 var(--f-body, system-ui); color: #1F2430; }
.ov-q > small { font-size: 12px; color: #6B7080; }
.ov-q .input, .ov-found textarea { width: 100%; font-size: 14px; }
.ov-basics .ov-row, .ov-found .ov-row { margin-top: 6px; }
.ov-found { border-color: #D9E4F5; background: #F7FAFF; }
.ov-found .upstate { display: inline-block; vertical-align: -2px; margin-right: 6px; }
/* Nov 16: the owner hello says what look it picked and why, and offers facts for the top of the page */
.ov-why { margin: 8px 0 10px; padding: 12px 14px; border-radius: 12px; background: color-mix(in oklab, var(--a) 7%, #fff); }
.ov-why p { margin: 0 0 8px; }
.ovf-row { display: grid; grid-template-columns: 1fr 1.7fr; gap: 8px; margin: 8px 0; }
/* Nov 16: one step at a time in the owner hello */
.ov-step-off { display: none !important; }
#ovBasics:not(.ov-last) > .ov-row { display: none; }
.ov-stepnav { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; font: 500 13.5px/1.4 var(--f-body); color: #5A5E66; }
.ov-stepnav:empty { display: none; }
.ov-hello #ovSetup > .small, .ov-hello #ovBasics > .small { display: none; }
/* Nov 16 (tester feedback): the panel never slides on page load; it only animates after the owner taps Panel */
@media (max-width: 1199px) {
  .ownpanel { transition: none; visibility: hidden; }
  body.ov-anim .ownpanel { transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s; }
  body.ov-open .ownpanel { visibility: visible; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
}
/* Visitor view: hide the owner's own recent chats from the side list */
/* visitor view shows Recent, exactly as visitors see it */
/* Saved notes read as done, not as a button */
.ov-save.saved { opacity: 1; background: #EAF5EE; border-color: #B9DEC6; color: #1F5F3A; }
body.ov-visitor .hm-raillabel:has(+ .hm-hist) { display: none !important; }
/* Nov 17 (tester feedback round 2) */
/* The owner bar stays put while you scroll, and its buttons are always readable */
.ov-bar { position: sticky; top: 8px; z-index: 30; box-shadow: 0 6px 18px -12px rgba(20,24,50,.35); }
.ov-btn:not(.solid) { color: #15171C !important; background: #fff !important; border-color: rgba(21,23,28,.22) !important; }
.ov-pill b { color: #15171C; }
.aipage.dark .ov-pill b { color: #eef; }
.ov-tools { display: inline-flex; gap: 6px; flex: none; }
.ov-who { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
body.ov-visitor .ov-tools { display: none; }
@media (max-width: 600px) {
  .ov-bar { flex-wrap: wrap; row-gap: 6px; }
  .ov-tools { order: 5; width: 100%; }
  .ov-tools .ov-btn { flex: 1; }
  .ov-who { max-width: none; }
}
/* The owner's rules show in the sidebar, and long names wrap instead of being cut off */
.hm-docs .hm-rules .dt { background: #E7F2EA; color: #1F5F3A; }
.hm-docs .dn { white-space: normal; overflow-wrap: anywhere; }
/* The owner note's "Saved" reads as done */
.ov-save.saved b { color: #1F5F3A; }
body.ov-visitor .hm-own { display: none !important; }

/* Nov 17 (tester feedback round 3): phones */
.anscard, .msg { scroll-margin-top: 76px; }
.ov-msg { white-space: nowrap; }
@media (max-width: 600px) {
  .ov-bar { position: relative; top: auto; }
  .anscard, .msg { scroll-margin-top: 12px; }
  .ov-msg { display: none; }
  .ov-who { white-space: normal; text-overflow: clip; line-height: 1.2; }
  body.ov-open { overflow: hidden; }
  .ownpanel { width: 100vw; max-width: 100vw; left: 0; right: 0; }
}
html:has(.ownview) , body:has(.ownview) { overflow-x: clip; }

/* Nov 17: the owner's box grows as they type, with a paperclip for files */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.askpill textarea.ov-grow { resize: none; line-height: 1.4; min-height: 0; overflow-y: hidden; font: inherit; align-self: center; padding-top: 0; padding-bottom: 0; background: transparent; border: 0; outline: none; color: inherit; }
.askpill:has(textarea.ov-grow) { align-items: flex-end; }
.askpill:has(textarea.ov-grow) > * { margin-bottom: auto; margin-top: auto; }
.ov-clip { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #5A5E66; cursor: pointer; }
.ov-clip:hover { background: rgba(21,23,28,.06); color: #15171C; }
.aipage.dark .ov-clip { color: #c9cbe0; }
body.ov-visitor .ov-clip { display: none; }
.askpill:has(.ov-clip) textarea.ov-grow { padding-inline-start: 4px !important; }
@media (max-width: 600px) { .ov-clip { width: 32px; margin-left: -6px; } }
/* Nov 17 (Dan, ~620-760px wide): the owner bar never runs off the edge or floats over the page; the paperclip sits at the box's left edge */
.ov-bar { max-width: calc(100vw - 24px); box-sizing: border-box; flex-wrap: wrap; row-gap: 6px; }
@media (max-width: 900px) {
  .ov-bar { position: relative; top: auto; }
}
@media (max-width: 760px) {
  .ov-msg { display: none; }
  .ov-tools { order: 5; width: 100%; }
  .ov-tools .ov-btn { flex: 1; }
}
.askpill:has(.ov-clip) { padding-inline-start: 8px !important; }
.ov-clip { margin-left: 0; }
/* Nov 17 visual pass 3 (owner view at every width) */
/* growing box: a rounded rectangle, buttons at the bottom like any chat box */
.askpill:has(textarea.ov-grow) { border-radius: min(26px, var(--st-br, 26px)) !important; align-items: flex-end !important; }
.askpill:has(textarea.ov-grow) > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.askpill:has(textarea.ov-grow) > textarea { align-self: center; }
textarea.ov-grow { scrollbar-width: thin; }
/* the bar: "Only you see this." only where there's room; buttons don't wrap mid-label */
.ov-msg { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .ov-msg { display: none; } }
@media (min-width: 1200px) and (max-width: 1400px) { .ov-msg { display: none; } }
@media (min-width: 941px) { .ov-bar { flex-wrap: nowrap; } }
@media (max-width: 760px) { .ov-who { max-width: none; } }
.ov-btn { white-space: nowrap; }
@media (max-width: 600px) { .ov-who { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (pointer: coarse) { .ov-btn { min-height: 40px; } #ovClose { min-width: 40px; min-height: 40px; } .ownpanel .btn-sm { min-height: 40px; } }
/* rail title clear of the collapse icon */
.hm-railhead { padding-right: 44px; }
/* owner notes use the page's own font */
.aipage.ownview .ov-hello, .aipage.ownview .ov-note, .aipage.ownview .ov-save, .aipage.ownview .ov-bar { --f-body: var(--st-body, inherit); font-family: var(--st-body, inherit); }
/* slide-in panel: a dimmed backdrop and no page scrolling behind it */
@media (max-width: 1199px) {
  body.ov-open { overflow: hidden; }
  body.ov-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,24,50,.28); z-index: 69; }
}
/* chat at desktop: the header sits under the owner bar */
@media (min-width: 1200px) { .aipage.ownview .hm-top { top: 61px; } }
@media (max-width: 900px) { .msg, .anscard { scroll-margin-top: 64px; } }
/* panel rows: matched heights, one radius, quieter links */
.ov-web { display: flex; align-items: stretch; gap: 8px; }
#ovWeb { height: 44px; }
#ovWebGo { height: auto; min-height: 44px; }
.ownpanel .input, .ov-drop, .ov-link { border-radius: 12px; }
.ownpanel .linkbtn { font-size: 13.5px; }
.ownpanel .btn { box-shadow: none; }
/* readable small text */
.ov-head span, .ov-steps small, .ov-drop small { color: #6B7280; }
.aipage p.hl-report, .aipage.home.st .st-kick { color: #6B7280; }
.aipage #q::placeholder { color: #7A7F87; }
.aipage.dark #q::placeholder { color: #9aa0b4; }
/* line breaks */
.aipage .st-kick, .aipage .st-deck { text-wrap: balance; }
.ov-host { white-space: nowrap; }
@media (max-width: 860px) { #hmRail { top: 12px; } }
/* Nov 17 visual pass 4 (dialogs, bar) */
.ov-btn { height: 32px; display: inline-flex; align-items: center; justify-content: center; }
@media (pointer: coarse) { .ov-btn { height: auto; min-height: 40px; } }
.ovdlg-x { position: sticky; top: 0; float: right; z-index: 2; }
.ovdlg-card h3 { padding-right: 44px; }
.lk-card { display: flex; flex-direction: column; }
.lk-card .btn { margin-top: auto; }
#lkGrid:empty { min-height: 0; }
#ovMarkBtn { min-width: 150px; }
.ov-save.saved { cursor: default; pointer-events: none; }
/* Nov 17 (design system): Hostlet's own controls on AI pages are navy, whatever the AI's color */
.ov-btn.solid { background: #26345E !important; border-color: #26345E !important; color: #fff !important; }
.ov-btn.solid:hover { background: #1E2A4D !important; }
.ownpanel .btn-primary { background: #26345E !important; border-color: #26345E !important; color: #fff !important; }
.ov-pill svg { color: #26345E; }
/* Nov 17 (design system, motion): the owner panel opens one section at a time */
.ov-sec.ov-fold > h4:first-child { cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin: 0; border-radius: 8px; user-select: none; }
.ov-sec.ov-fold > h4:first-child::after { content: ""; width: 8px; height: 8px; border-right: 2px solid #6B7280; border-bottom: 2px solid #6B7280; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s cubic-bezier(.2,.8,.2,1); flex: none; margin-right: 6px; }
.ov-sec.ov-fold.ov-shut > h4:first-child::after { transform: rotate(-45deg); }
.ov-sec.ov-fold > h4:first-child:hover { color: #26345E; }
.ov-sec.ov-fold:not(.ov-shut) > h4:first-child { margin-bottom: 8px; }
.ov-sec.ov-fold.ov-shut > :not(:first-child) { display: none !important; }
.ov-sec.ov-fold.ov-shut { padding-bottom: 10px; }
.ov-sec.ov-fold:not(.ov-shut) > :not(:first-child) { animation: ovIn .2s cubic-bezier(.2,.8,.2,1); }
@keyframes ovIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ov-sec.ov-fold:not(.ov-shut) > :not(:first-child) { animation: none; } }
/* Nov 17 (video 2, relative rules): the panel closes faster than it opens (exit 20% shorter: 280ms in, 220ms out) */
@media (max-width: 1199px) {
  body.ov-anim:not(.ov-open) .ownpanel { transition: transform .22s cubic-bezier(.4,0,1,1), visibility 0s linear .22s; }
}
/* a single soft pulse confirms "Saved" (success, rare: allowed to move) */
@media (prefers-reduced-motion: no-preference) { .ov-save.saved { animation: ovPulse .45s cubic-bezier(.2,.8,.2,1) 1; } }
@keyframes ovPulse { 0% { transform: scale(1); } 40% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(31,95,58,.12); } 100% { transform: scale(1); box-shadow: none; } }
/* dialogs start at 95% and grow from where they were opened, not from nothing */
@media (prefers-reduced-motion: no-preference) { .ovdlg-card { animation: ovPop .2s cubic-bezier(.2,.8,.2,1); } }
@keyframes ovPop { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
/* Nov 17: owner switch for showing visitors "What it knows" */
.ov-switch { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; cursor: pointer; min-height: 40px; }
.ov-switch input { width: 18px; height: 18px; accent-color: #26345E; flex: none; }
.ov-switchnote { margin: 2px 0 0 28px; }
.hm-only { font: 500 10px/1 var(--f-body); letter-spacing: 0; text-transform: none; opacity: .7; margin-left: 4px; }
/* Nov 17 (video 2): dialogs grow from the button that opened them (from 95%, 200ms) and shrink back toward it on close (160ms) */
@media (prefers-reduced-motion: no-preference) {
  .ovdlg { animation: dlgFade .2s ease-out; }
  .ovdlg-card { animation: ovPop .2s cubic-bezier(.2,.8,.2,1); }
  .ovdlg.closing { animation: dlgFadeOut .16s ease-in forwards; }
  .ovdlg.closing .ovdlg-card { animation: ovPopOut .16s cubic-bezier(.4,0,1,1) forwards; }
}
@keyframes dlgFade { from { background-color: transparent; } }
@keyframes dlgFadeOut { to { opacity: 0; } }
@keyframes ovPopOut { to { opacity: 0; transform: scale(.95); } }

/* Nov 17c: selected chips are navy, never black */
.ov-chip.on { background:#26345E; color:#fff; border-color:#26345E; }
/* Nov 17c: a tall owner note keeps its first line clear of the rounded border; clip and send sit at the bottom together */
.aipage .askpill textarea.ov-grow{padding-block:10px !important; scroll-padding-block:10px; line-height:1.45}
.aipage .askpill:has(textarea.ov-grow) .send, .aipage .askpill:has(textarea.ov-grow) .ov-clip{align-self:flex-end !important; margin-bottom:6px}
/* Nov 17c: Hostlet's own controls (owner bar and panel) stay navy whatever the AI's colors */
.ov-bar, #ownPanel, .ownpanel { --a:#26345E; --a-ink:#26345E; --on-a:#fff; --a-line:rgba(21,23,28,.08); }
#ownPanel .linkbtn, .ownpanel .linkbtn { color:#26345E; text-decoration-color:rgba(38,52,94,.35); }
/* done steps stay readable (was #8A8E96, 3.3:1) */
.ov-steps li.done b, .ov-steps small { color:#5F6470; }
/* bigger tap targets in the panel */
#ownPanel .ov-sec > h4 { min-height:44px; display:flex; align-items:center; margin:0; }
#ownPanel .linkbtn { min-height:40px; display:inline-flex; align-items:center; padding:0 2px; }
.ov-chip { min-height:40px; }
/* Spanish owner bar fits: the "only you" line is dropped on phones, labels never break */
@media (max-width:600px){ .ov-bar[lang="es"] .ov-msg{display:none} .ov-bar .ov-btn{padding-inline:10px} }
/* the "show visitors the list" control is a real switch */
.ov-switch{display:flex; align-items:center; gap:12px; min-height:44px; cursor:pointer}
.ov-switch input{appearance:none; -webkit-appearance:none; flex:none; width:44px; height:26px; border-radius:999px; background:#D6D3CC; position:relative; margin:0; cursor:pointer; transition:background .2s}
.ov-switch input::after{content:""; position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.25); transition:transform .2s}
.ov-switch input:checked{background:#26345E}
.ov-switch input:checked::after{transform:translateX(18px)}
.ov-switch input:focus-visible{outline:2px solid #3E62AE; outline-offset:2px}
/* gap between the QR button and the links under it */
#ovShareSec .ov-row + #ovQrBox + .small{display:block; margin-top:12px}
@media (max-width:860px){ .ov-bar .ov-btn{min-height:40px} }
@media (max-width:600px){ .ov-bar[lang="es"] .ov-tools{flex:1 1 auto} .ov-bar[lang="es"] #ovPanelBtn{margin-left:auto} }
/* Owner view fits the screen before anyone asks (the hero is a little more compact under the owner bar) */
@media (min-width:861px){
  .aipage.home.ownview .hm-hero{margin-top:10px !important; padding-top:16px !important; margin-bottom:10px !important}
  .aipage.home.ownview .st-heromark{max-height:68px}
}
/* the owner bar scrolled away: a small way back to the panel */
.ov-mini{position:fixed; top:10px; right:10px; z-index:40; display:none; min-height:40px; padding:0 14px; border-radius:999px; border:0; background:#26345E; color:#fff; font:600 14px/1 var(--f-body, system-ui, sans-serif); box-shadow:0 6px 18px -8px rgba(20,24,50,.5); cursor:pointer}
body.ov-barhidden:not(.ov-open):not(.ov-visitor) .ov-mini{display:inline-flex; align-items:center}
@media (min-width:1200px){ body.ov-barhidden .ov-mini{display:none !important} }
/* Nov 18: owner panel — actions are all plain outline buttons; choices are segmented controls that show what's selected */
#ownPanel .ov-sec .btn-primary { background:#fff; color:#26345E; border:1px solid rgb(38 52 94/.28); box-shadow:none; }
#ownPanel .ov-sec .btn-primary:hover { background:#F3F4F8; }
.ov-grp { display:grid; gap:8px; margin-top:14px; }
.ov-lbl { font-size:13px; font-weight:600; color:#474B54; }
.ov-tip { color:#5F6470; }
.ov-seg { display:inline-flex; flex-wrap:wrap; gap:0; padding:3px; border-radius:999px; background:#F1F2F6; border:1px solid rgb(38 52 94/.12); width:fit-content; max-width:100%; }
.ov-seg .ov-chip { border:0; background:transparent; color:#474B54; border-radius:999px; min-height:36px; padding:0 14px; font-weight:500; box-shadow:none; }
.ov-seg .ov-chip:hover { color:#15171C; background:rgb(255 255 255/.6); }
.ov-seg .ov-chip.on { background:#fff; color:#26345E; font-weight:600; box-shadow:0 1px 3px rgb(20 24 40/.15), inset 0 0 0 1px rgb(38 52 94/.35); }
.ov-seg .ov-chip:focus-visible { outline:2px solid #3E62AE; outline-offset:2px; }
.ov-pv > .small { display:none; }
.ov-full { margin-top:10px; }
@media (max-width:420px){ .ov-seg { border-radius:14px; } .ov-seg .ov-chip { border-radius:11px; } }
.ov-mini { right:auto; left:50%; transform:translateX(-50%); }
/* phones: the Owner panel shortcut sits low on the right, clear of the AI's name and the ask box */
@media (max-width:760px){ .ov-mini{ top:auto; bottom:96px; left:auto; right:12px; transform:none; } }
/* Nov 18: "Who can use it" is a list of three choices, not a pill that breaks when it wraps; page type stays a two-way switch */
.ov-acc.ov-seg{display:grid; grid-template-columns:1fr; width:100%; border-radius:14px; padding:4px; gap:2px}
.ov-acc.ov-seg .ov-chip{border-radius:10px; justify-content:flex-start; text-align:left; width:100%; min-height:40px; padding:0 12px}
.ov-seg{border-radius:14px} .ov-seg .ov-chip{border-radius:10px}
.ov-pv.ov-seg{display:inline-grid; grid-auto-flow:column; grid-auto-columns:1fr}
@media (max-width:380px){ .ov-pv.ov-seg{grid-auto-flow:row} }
/* Page type uses the same clean list as "Who can use it" (two long labels don't fit side by side in the panel) */
.ov-pv.ov-seg{display:grid; grid-auto-flow:row; grid-template-columns:1fr; width:100%; padding:4px; gap:2px}
.ov-pv.ov-seg .ov-chip{justify-content:flex-start; text-align:left; width:100%; min-height:40px; padding:0 12px}
/* C1: readable "only you" note in the owner bar */
.ov-bar .ov-msg{color:#5F6470}
/* C4: on phones the Owner panel shortcut is a round button in the corner, and the page leaves room for it */
@media (max-width:760px){
  .ov-mini{width:48px; height:48px; min-height:48px; padding:0; justify-content:center; border-radius:50%; bottom:16px !important; right:16px !important}
  .ov-mini span{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0)}
  body.ov-barhidden .aipage.home.ownview .hm-main{padding-bottom:72px}
}
@media (min-width:761px){ .ov-mini svg{margin-right:8px} }
.ov-bar .ov-btn.solid{margin-left:auto}
/* phones: the owner bar is one row (Owner view · See as a visitor · Panel); copying the link and who can use it live in the panel's Share it */
@media (max-width:560px){ .ov-bar #ovCopy, .ov-bar #ovWho{display:none} .ov-bar{flex-wrap:nowrap} }
/* Owner view keeps each look's own corners (above); Editorial's box is a single underline, so square ends, not curled-up corners */
.aipage.st-editorial .askpill:has(textarea.ov-grow){border-radius:0 !important}
/* Owner view: one paperclip. The owner's "add a file it should know" replaces the visitor's attach button until they switch to the visitor view. */
body:has(.ov-clip):not(.ov-visitor) #clipBtn { display: none; }
body.ov-visitor .ov-clip { display: none; }
/* "See as a visitor" shows what a stranger sees: not the owner's own chats in the sidebar. */
body.ov-visitor .hm-hist, body.ov-visitor .hm-hist + .hm-more, body.ov-visitor .hm-raillabel:has(+ .hm-hist) { display: none !important; }
.ov-hello .ov-host { overflow-wrap: anywhere; }
/* Owner chat: one quiet line saying it's both a test drive and the place to change things */
.ov-dual{max-width:640px;margin:8px auto 0;padding:0 12px;font-size:13px;line-height:1.45;color:var(--muted,#5B6461);text-align:center}
.ov-knowsw{margin-top:14px}
.ov-name{margin-bottom:12px}.ov-name .ov-lbl{display:block;margin-bottom:6px}
/* New look, owner view below 1440px: the header and title line up with the chat column (which sits 24px in). */
@media (max-width:1439px) and (min-width:861px){
  .aipage.home.st-clear.ownview .hm-hero.cl-hero, .aipage.home.st-clear.ownview #hmNew{padding-inline:24px !important; box-sizing:border-box}
}
@media (max-width:900px) and (min-width:861px){
  .aipage.home.st-clear.ownview .hm-hero.cl-hero, .aipage.home.st-clear.ownview #hmNew{padding-inline:48px !important}
}
/* Owner chat: a picture was added — logo or something to read? */
.ov-imgask{display:flex;gap:14px;align-items:flex-start;max-width:640px;margin:0 auto 10px;padding:12px 14px;border:1px solid var(--line,#E3E6E5);border-radius:14px;background:var(--card,#fff);position:relative}
.ov-imgask img{width:56px;height:56px;object-fit:contain;border-radius:10px;background:#F4F5F5;flex:none}
.ov-imgask p{margin:0 0 8px;font-size:14px}.ov-imgask .btn{margin:0 6px 4px 0}
.ov-imgask .ov-x{position:absolute;top:6px;right:8px;border:0;background:none;font-size:20px;line-height:1;color:var(--muted,#5B6461);cursor:pointer}
.ov-imgask .ov-imgmsg{margin:6px 0 0;color:var(--muted,#5B6461);font-size:13px}
/* Small phones: the owner bar keeps its buttons on screen (the "Owner view" words give way to the eye icon). */
@media (max-width:430px){
  #ovBar{max-width:calc(100vw - 64px); box-sizing:border-box}
  #ovBar .ov-pill b, #ovBar .ov-msg{display:none}
  #ovBar .ov-btn{white-space:nowrap}
}

/* Save prompt (ovSaveNudge in app.js): 15s after an unsaved AI opens.
   Shapes nest: 22px dialog; full-round Google button; the email box is one capsule with its Save button inside (5px in, also round). */
.ovdlg-card.sn-card { width: min(440px, 100%); padding: 32px 32px 20px; border-radius: 22px; font-family: 'Instrument Sans', var(--f-body, system-ui, sans-serif); }
.ovdlg-card.sn-card .ovdlg-x { position: absolute; float: none; top: 14px; right: 14px; width: 36px; height: 36px; }
.sn { display: flex; flex-direction: column; align-items: stretch; text-align: center; }
.sn-ico { align-self: center; width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; margin: 0 0 16px; background: #E8EEF9; color: #26345E; }
.sn-ico img, .sn-ico svg, .sn-ico .ai-libmark { width: 32px; height: 32px; display: block; }
.sn-ico .ai-libmark { background-color: #26345E; }
.sn-ico b { font: 600 20px/1 'Instrument Sans', system-ui, sans-serif; }
.ovdlg-card.sn-card .sn-h { margin: 0; padding: 0 24px; font: 600 26px/1.15 'Newsreader', Georgia, serif; letter-spacing: -.015em; color: #15171C; }
.ovdlg-card.sn-card .sn-p { margin: 10px auto 24px; max-width: 34ch; font-size: 15.5px; line-height: 1.5; color: #474B54; text-wrap: balance; }
.sn-g { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 52px; border: 0; border-radius: 999px; background: #26345E; color: #fff; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer; transition: background .12s; }
.sn-g:hover { background: #1E2A4D; } .sn-g:active { background: #15171C; } .sn-g:disabled { opacity: .7; cursor: default; }
.sn-gmark { width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; flex: none; }
.sn-or { display: flex; align-items: center; gap: 12px; margin: 18px 4px 14px; color: #6B7280; font-size: 13px; }
.sn-or::before, .sn-or::after { content: ''; flex: 1; height: 1px; background: #E4E0D7; }
.sn-row { display: flex; align-items: center; height: 52px; padding: 5px 5px 5px 20px; border: 1px solid #E4E0D7; border-radius: 999px; background: #fff; transition: border-color .12s, box-shadow .12s; }
.sn-row:focus-within { border-color: #3E62AE; box-shadow: 0 0 0 3px rgba(62,98,174,.18); }
.sn-in { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none; font-family: inherit; font-size: 16px; color: #15171C; }
.sn-save { flex: none; height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: #EEF1F8; color: #26345E; font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .12s; }
.sn-save:hover { background: #E1E7F3; } .sn-save:disabled { opacity: .6; cursor: default; }
.ovdlg-card.sn-card .sn-note { margin: 10px 0 8px; font-size: 13px; color: #6B7280; }
.sn-later { align-self: center; min-height: 40px; padding: 0 16px; border: 0; background: none; color: #474B54; font-family: inherit; font-size: 14.5px; font-weight: 500; cursor: pointer; border-radius: 999px; }
.sn-later:hover { background: #F1EFEA; color: #15171C; }
@media (max-width: 480px) { .ovdlg-card.sn-card { padding: 28px 20px 16px; } .ovdlg-card.sn-card .sn-h { font-size: 23px; } }

/* Nov 24 (Dan: "the Panel bar isn't lined up"): on tablets and phones the owner bar and the sidebar button share one centre line,
   the empty tools slot no longer pushes Panel off the right edge, and the eye is readable in dark mode. */
@media (max-width:860px){
  .aipage.home.ownview .hm-railtoggle{top:17px !important; width:40px !important; height:40px !important}
  .ov-bar{margin-top:10px !important}
  .ov-bar #ovVisitor{margin-right:auto}
}
@media (max-width:560px){ .ov-bar .ov-tools{display:none !important} }
/* With the words gone on small phones, a lone eye means nothing: drop it and give the two buttons the room. */
@media (max-width:430px){ #ovBar .ov-pill{display:none} #ovBar{padding-left:6px !important} }
@media (prefers-color-scheme: dark){ html:has(.aipage.home.st-clear) .ov-pill svg{color:#F3F2EE} }
html:has(.aipage.home.st-clear.cl-dark) .ov-pill svg{color:#F3F2EE}

/* Nov 24 (Dan: "occasionally I can see below the owner panel"): the same fix as the visitor drawer (ai-styles.css,
   "Phone drawer"). Scrolling the panel never scrolls the page behind it, and on phones and tablets the panel and its
   shade reach 50vh past the bottom of the screen, so no gap opens when the browser bar slides away mid-scroll.
   The extra padding keeps the panel's last row reachable. */
.ownpanel { overscroll-behavior: contain; }
@media (max-width: 1199px) {
  .ownpanel { bottom: -50vh; padding-bottom: calc(50vh + 20px + env(safe-area-inset-bottom)); }
  html:has(body.ov-open), body.ov-open { overflow: hidden !important; overscroll-behavior: none; }
  body.ov-open::after { bottom: -50vh; touch-action: none; }
}

/* Nov 25: every ask box (visitors too) wraps and grows; the pill opens up once a second line appears */
.askpill.grown { height: auto !important; min-height: 56px; }
.askpill.grown textarea.ov-grow { align-self: center; }
