/* The shell: the navy bar, Penny's live status, the tab row, the phone dock, and Ask Penny docked beside the page.
   Loaded after penny.css (tokens, type, buttons, fields). Menus, pop-overs and the count pill stay in penny.css, shared with screens. */

:root {
  --ask-w: clamp(340px, 26vw, 420px);   /* the docked panel; the page makes this much room */
  --ask-w-big: clamp(420px, 20vw, 600px);
  --ask-dur: .28s;
  --ask-top: 109px;                     /* where the bar ends; shell.js and an inline script keep it true as the page scrolls */
  --pen-ring: #8FD6E3;                  /* Penny's activity ring on navy: a light reef teal */
}

/* ---------------------------------------------------------------------------------------------------------- the bar */
.bar { background: var(--navy); color: var(--on-navy); position: relative; z-index: 20; }
.bar-row { display: flex; align-items: center; gap: var(--s4); }
.bar-top .bar-row { min-height: 60px; }
.brand { display: flex; align-items: baseline; gap: var(--s3); margin-right: var(--s2); white-space: nowrap; }
.brand a { font-weight: 800; font-size: 22px; letter-spacing: -0.01em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--navy); border: 2px solid var(--navy); outline: 1px solid rgba(255,255,255,.6); display: inline-grid; place-items: center; font-size: 12px; font-weight: 800; }
.sample { font-size: var(--t-xs); font-weight: 600; color: var(--on-navy-2); letter-spacing: .02em; }
.pickers { display: flex; gap: var(--s2); }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: var(--s3); min-width: 0; }

/* Ask Penny: a plain teal pill. It is a toggle; open, it reads as pressed. */
.ask-btn {
  height: 36px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 18px; flex: none;
  background: var(--teal-text); color: #fff; font-weight: 700; text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.ask-btn:hover { background: #12606E; }
.ask-btn[aria-expanded="true"] { background: var(--navy-3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.ask-short { display: none; }

.who > summary { padding: var(--s1) 0 var(--s1) var(--s4); border-left: 1px solid rgba(255,255,255,.25); white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--teal-text); color: #fff; display: inline-grid; place-items: center; font-size: var(--t-xs); font-weight: 800; letter-spacing: .02em; flex: none; }
.who-name { font-weight: 600; }
.who .pop { padding: var(--s3) 0 var(--s2); }
.who-email { padding: 0 var(--s4); font-weight: 700; }
.who-role { padding: 0 var(--s4) var(--s2); color: var(--muted); border-bottom: 1px solid var(--rule); margin-bottom: var(--s2); }

.bar-nav { background: var(--navy-2); border-top: 1px solid rgba(255,255,255,.08); }
.tabs { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs ul { display: flex; gap: var(--s1); }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 12px 14px 10px; text-decoration: none; color: var(--on-navy-2); font-weight: 600; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a:hover { color: #fff; }
.tabs a[aria-current] { color: #fff; border-bottom-color: var(--teal); }
/* where the books stand, in plain words: three short facts, dotted apart */
.asof { margin-left: auto; display: flex; flex: none; font-size: var(--t-sm); color: var(--on-navy-2); white-space: nowrap; }
.asof span + span::before { content: "·"; margin: 0 var(--s2); }

/* the phone dock: the four places a phone visit goes, plus More */
.dock { display: none; }

/* ---------------------------------------------------------------------------------------- Penny's live status */
/* A coin and one line in the bar; a small panel under it. She is either working (the coin's ring turns, the line says what
   she is on) or idle (everything is still). The ring and the dot exist only while she works; under reduced motion it is words. */
.pstat > summary { height: 36px; padding: 0 12px 0 6px; border-radius: 18px; gap: 10px; color: var(--on-navy-2); border: 1px solid transparent; transition: background .15s, color .15s; }
.pstat > summary:hover, .pstat[open] > summary { background: var(--navy-2); color: #fff; }
.pstat .caret { opacity: .7; }
/* the status line gives way first when the bar runs out of room (it can say anything; the panel it opens always has the whole sentence) */
.pstat { min-width: 0; }
.pstat > summary { min-width: 0; }
.pstat:has(.pstat-line[data-state="working"]) > summary { color: #fff; }
@keyframes pring { to { transform: rotate(360deg); } }
@keyframes pdot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }

@keyframes pfade-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes pfade-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-5px); } }

/* the nine tabs scroll sideways between 761px and about 1100px: a soft edge shows on the side that has more (the sub-navigation strip
   does the same on white), and shell.js scrolls the current tab into view */
.tabs {
  background-color: var(--navy-2);
  background:
    linear-gradient(to right, var(--navy-2) 30%, rgba(25, 31, 94, 0)) left / 36px 100% no-repeat local,
    linear-gradient(to left, var(--navy-2) 30%, rgba(25, 31, 94, 0)) right / 36px 100% no-repeat local,
    linear-gradient(to right, rgba(184, 189, 227, .34), rgba(184, 189, 227, 0)) left / 18px 100% no-repeat scroll,
    linear-gradient(to left, rgba(184, 189, 227, .34), rgba(184, 189, 227, 0)) right / 18px 100% no-repeat scroll var(--navy-2);
}
.tabs a:focus-visible { outline-offset: -3px; }

/* ------------------------------------------------------------------------------------ Ask Penny, beside the page */
/* At 1100px and wider the panel is part of the layout: the page makes room (the main column narrows) and nothing is greyed or
   inert, so you can scroll, click and read the page while she is open. Below that it is a sheet over the page with a scrim.
   One element either way; shell.js opens it, remembers (from page to page) that it is open, and runs the conversation in it. */
.shell-page { transition: margin-right var(--ask-dur) var(--ease); container: page / inline-size; }
/* `page` is a size container: a screen whose layout depends on how wide the page is (not the window, which Ask Penny narrows) can
   write @container page (max-width: 1100px) where it now writes @media (max-width: 1100px). It does not move fixed elements. */
.ask {
  position: fixed; z-index: 15; top: var(--ask-top); right: 0; bottom: 0; width: var(--ask-w);
  display: flex; flex-direction: column; background: var(--panel); color: var(--ink); border-left: 1px solid var(--rule-2);
  transform: translateX(100%); visibility: hidden; contain: layout paint;
  transition: transform var(--ask-dur) var(--ease), visibility 0s linear var(--ask-dur);
}
html.ask-open .ask { transform: none; visibility: visible; transition-delay: 0s; }
.ask[data-inline] { position: static; width: auto; max-width: 720px; transform: none; visibility: visible; border: 1px solid var(--rule-2); border-radius: var(--r); contain: none; }
.ask-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 20, 76, .45); opacity: 0; visibility: hidden; transition: opacity var(--ask-dur) var(--ease), visibility 0s linear var(--ask-dur); }
html.ask-open .ask-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (min-width: 1100px) {
  html.ask-open .shell-page { margin-right: var(--ask-w); }
  .ask-scrim { display: none; }
}
@media (max-width: 1099.98px) {
  /* a sheet: it follows the visible screen, so the question stays above a phone's keyboard (shell.js sets --vvh and --vvt then) */
  .ask:not([data-inline]):not([data-mode="full"]) { top: var(--vvt, 0px); bottom: auto; height: var(--vvh, 100dvh); z-index: 50; width: min(440px, 100%); background: #fff; box-shadow: -12px 0 32px rgba(15, 20, 76, .12); }
}
body.ask-modal { overflow: hidden; }
html:has(body.ask-modal) { scrollbar-gutter: stable; }   /* the page does not shift when its scrollbar goes */

.ask-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s2) var(--s3) var(--s4); background: #fff; border-bottom: 1px solid var(--rule); min-height: 56px; flex: none; }
.ask-head h2 { font-size: var(--t-lg); font-weight: 700; line-height: 1.2; }
.ask-new { margin-left: auto; min-height: var(--hit); padding: 0 var(--s2); background: none; border: 0; color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; cursor: pointer; text-underline-offset: 3px; }
.ask-new:hover { color: var(--navy); text-decoration: underline; text-decoration-color: var(--teal); }
.ask-x { display: inline-grid; place-items: center; width: 40px; height: 40px; background: none; border: 0; border-radius: var(--r); color: var(--navy); cursor: pointer; text-decoration: none; }
.ask-head > .ask-expand { margin-left: auto; }
.ask-head > .ask-new:not([hidden]) + .ask-expand { margin-left: 0; }
.ask-x:hover { background: var(--tint); }
.ask-scope { font-size: var(--t-sm); color: var(--ink-2); }          /* orientation for an empty conversation; it goes once you have asked (the thread is the room) */
.ask-body:has(.ask-ex) .ask-scope { display: none; }

/* what Penny can see on this page: one line, and what she is given when it opens */
.ask-see { border-bottom: 1px solid var(--rule); background: #fff; flex: none; }
.ask-see > summary { list-style: none; cursor: pointer; position: relative; display: block; min-height: 44px; padding: 11px 48px 11px var(--s4); font-size: var(--t-sm); line-height: 1.4; color: var(--ink-2); }
.ask-see > summary::-webkit-details-marker { display: none; }
.ask-see > summary b { color: var(--navy); font-weight: 700; }
.ask-see > summary .caret { position: absolute; right: var(--s4); top: 50%; margin-top: -8px; transition: transform .2s var(--ease); }
.ask-see[open] > summary .caret { transform: rotate(180deg); }
.ask-see-body { padding: 0 var(--s4) var(--s4); max-height: 46vh; overflow: auto; font-size: var(--t-sm); display: grid; gap: var(--s2); }
.see-page { color: var(--navy); }
.see-counts { display: flex; flex-wrap: wrap; gap: 0 var(--s4); color: var(--ink-2); }
.see-counts b { color: var(--navy); }
.see-items, .see-list { display: grid; }
.see-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s3); row-gap: 2px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.see-name { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.see-more { color: var(--muted); padding: 9px 0; }
.see-tech { margin-top: var(--s2); }
.see-tech > summary { cursor: pointer; color: var(--muted); font-size: var(--t-xs); min-height: var(--hit); display: flex; align-items: center; text-underline-offset: 3px; }
.see-tech > summary:hover { color: var(--ink-2); text-decoration: underline; }
.see-note { color: var(--muted); font-size: var(--t-xs); }
.see-tech pre { margin: var(--s2) 0 0; padding: var(--s3); background: var(--tint); border-radius: 2px; max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.see-tech code { font-size: var(--t-xs); }
/* in Work with Penny each row can be asked about: the button adds it to the question as a chip, the way pointing does on a page */
.see-row[data-see-ref] { grid-template-columns: minmax(0, 1fr) auto 36px; }
.see-ask { grid-column: 3; grid-row: 1 / span 2; align-self: center; display: inline-grid; place-items: center; width: 36px; height: 36px; background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--ink-2); cursor: pointer; }
.see-row:hover .see-ask, .see-ask:focus-visible { border-color: var(--rule-2); color: var(--navy); background: #fff; }
.see-ask:hover { border-color: var(--navy); }

/* the conversation: the thread scrolls, the composer stays; a long thread keeps your place */
.ask-stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ask-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--s4); display: grid; gap: var(--s4); align-content: start; overflow-anchor: none; }
.ask-body:has(.ask-ex) .ask-intro { display: none; }
.ask-thread { display: grid; gap: var(--s5); }
.ask-thread:empty { display: none; }
.ask-ex { display: grid; gap: var(--s3); }
.ask-q { justify-self: end; max-width: 88%; background: var(--tint-blue); padding: var(--s2) var(--s3); border-radius: 8px 8px 2px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ask-pointed { justify-self: end; display: flex; flex-wrap: wrap; gap: var(--s1); justify-content: flex-end; }
.chip-ref, .ask-chips li {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 10px; border: 1px solid var(--rule-2); border-radius: 16px;
  background: #fff; color: var(--navy); font-size: var(--t-xs); font-weight: 600; line-height: 1.35;
}
.chip-ref { cursor: default; }
.ask-a { display: grid; gap: var(--s2); min-width: 0; }
.ask-a .penny { min-width: 0; }
.ask-a .penny > div { min-width: 0; overflow-wrap: anywhere; }
.ask-cites { font-size: var(--t-xs); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px var(--s3); align-items: center; }
.ask-cites a { color: var(--teal-text); font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ask-cites a.is-here { text-decoration-thickness: 2px; text-decoration-color: var(--teal); }
.ask-cites a:hover, .ask-cites a:focus-visible { background: var(--teal-tint); }
.cite-file { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.ask-sep { text-align: center; font-size: var(--t-xs); color: var(--muted); display: flex; align-items: center; gap: var(--s3); }
.ask-sep::before, .ask-sep::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.ask-thread > .ask-sep + .ask-ex { margin-top: calc(var(--s2) * -1); }

/* what you gave her with a question: the same chip in the composer and in the thread */
.att { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 4px; border: 1px solid var(--rule-2); border-radius: var(--r); background: #fff; }
.att-thumb { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 2px; overflow: hidden; background: var(--tint); color: var(--ink-2); }
.att-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.att-text { display: grid; min-width: 0; padding-right: var(--s2); line-height: 1.3; }
.att-name { font-size: var(--t-sm); font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.att-meta { font-size: var(--t-xs); color: var(--muted); white-space: nowrap; }
.att.is-reading .att-meta::after { content: " · reading…"; }
.att-x { flex: none; align-self: stretch; display: inline-grid; place-items: center; width: 32px; margin: -4px -4px -4px -6px; border: 0; border-left: 1px solid var(--rule); border-radius: 0 var(--r) var(--r) 0; background: none; color: var(--ink-2); cursor: pointer; }
.att-x:hover { background: var(--tint); color: var(--navy); }
.att-x .ic { width: 12px; height: 12px; }
.ask-atts { justify-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); max-width: 100%; }
.ask-atts .att { background: var(--panel); }
.ask-atts .att-name { max-width: 190px; }

/* the answer on its way: the typing state, then her block filling in word by word, a caret at the end of what she has said */
.ask-wait { display: flex; align-items: center; gap: var(--s3); color: var(--ink-2); font-size: var(--t-sm); min-height: 28px; }
.ask-dots { display: inline-flex; gap: 4px; flex: none; }
.ask-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); opacity: .35; animation: adot 1.1s ease-in-out infinite; }
.ask-dots i:nth-child(2) { animation-delay: .16s; }
.ask-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes adot { 0%, 70%, 100% { opacity: .3; transform: none; } 35% { opacity: 1; transform: translateY(-3px); } }
@keyframes acaret { 50% { opacity: 0; } }
.ask-a.is-streaming .penny > div > p:last-child::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -3px; background: var(--teal-text); animation: acaret 1s steps(1) infinite; }
.ask-stopped, .ask-err { display: flex; align-items: flex-start; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r); font-size: var(--t-sm); line-height: 1.45; }
.ask-stopped { color: var(--ink-2); background: var(--tint); }
.ask-err { color: var(--navy); background: var(--warn-tint); }
.ask-err .ic { color: var(--warn); margin-top: 3px; }
.ask-err > span, .ask-stopped > span { flex: 1; min-width: 0; }
.ask-err .btn { flex: none; align-self: center; }
.ask-over { flex-wrap: wrap; }
.ask-over > span { flex: 1 1 14em; }                                /* in the narrow panel the button wraps under the words */
.ask-over .btn { align-self: flex-start; margin-left: calc(16px + var(--s2)); }
/* what she reads, as she reads it: one row per read, a teal ring while it runs, a navy tick when it is back, rust when it was refused.
   The same rows fold under "Read 6 things in 1 min 12 s" above her answer once it is done. */
.ask-clock { margin-left: auto; font-size: var(--t-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.ask-steps { list-style: none; display: grid; gap: 2px; margin: 0; padding: 0; }
.ask-steps:empty { display: none; }
.ask-step { display: flex; align-items: flex-start; gap: var(--s2); padding: 5px 0; font-size: var(--t-sm); line-height: 1.4; color: var(--navy); min-width: 0; }
.ask-step + .ask-step { border-top: 1px solid var(--rule); }
.ask-step-i { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: -1px; border-radius: 50%; color: var(--ink-2); }
.ask-step-i .ic { width: 14px; height: 14px; }
.ask-step.is-run .ask-step-i { color: var(--teal-text); box-shadow: inset 0 0 0 1.5px var(--teal-line, #BFDDE3); position: relative; }
.ask-step.is-run .ask-step-i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid transparent; border-top-color: var(--teal); animation: aspin .9s linear infinite; }
.ask-step.is-done .ask-step-i { color: var(--navy); }
.ask-step.is-refused .ask-step-i { color: var(--warn); }
.ask-step.is-cut { color: var(--muted); }
.ask-step-b { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.ask-step-t { font-weight: 600; }
.ask-step.is-done .ask-step-t { font-weight: 400; }
.ask-step-c { display: contents; }
.ask-step-c > span { display: inline-block; max-width: 100%; padding: 0 6px; border-radius: 2px; background: var(--tint); color: var(--ink-2); font-size: var(--t-xs); line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-step-r { flex-basis: 100%; font-size: var(--t-xs); color: var(--muted); }
.ask-step-r:empty { display: none; }
.ask-step.is-refused .ask-step-r { color: var(--warn); font-weight: 600; }
@keyframes aspin { to { transform: rotate(360deg); } }
.ask-did { font-size: var(--t-sm); }
.ask-did > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--hit); cursor: pointer; color: var(--ink-2); font-weight: 600; }
.ask-did > summary::-webkit-details-marker { display: none; }
.ask-did > summary .ic { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.ask-did[open] > summary .ic { transform: rotate(90deg); }
.ask-did > summary:hover { color: var(--navy); }
.ask-did > .ask-steps { margin: 2px 0 var(--s2); padding: var(--s1) var(--s3); border-left: 0; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); }
.ask-quiet { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--tint-blue); color: var(--navy); font-size: var(--t-sm); line-height: 1.45; }
.ask-quiet[hidden], .ask-conn[hidden] { display: none; }
.ask-quiet > .ic { margin-top: 3px; color: var(--ink-2); flex: none; }
.ask-quiet > span:first-of-type { flex: 1; min-width: 12em; }
.ask-quiet-b { display: flex; gap: var(--s2); }
.ask-conn { font-size: var(--t-xs); color: var(--muted); }
.ask-jump { position: absolute; z-index: 3; left: 50%; bottom: var(--s3); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 10px; border-radius: 18px;
  border: 1px solid var(--rule-2); background: #fff; color: var(--navy); font-size: var(--t-sm); font-weight: 700; cursor: pointer; box-shadow: var(--shadow-pop); }
.ask-jump[hidden] { display: none; }
.ask-jump:hover { border-color: var(--navy); }

/* questions to try: open on an empty conversation, folded after the first one so the answer stays the last thing you read */
.ask-sugg-wrap > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); min-height: var(--hit); }
.ask-sugg-wrap > summary::-webkit-details-marker { display: none; }
.ask-sugg-h { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.ask-sugg-wrap > summary .caret { transition: transform .2s var(--ease); }
.ask-sugg-wrap[open] > summary .caret { transform: rotate(180deg); }
.ask-sugg { display: grid; gap: var(--s2); margin-top: var(--s2); }
.ask-s {
  width: 100%; min-height: var(--ctl); padding: var(--s2) var(--s3); text-align: left; background: #fff; border: 1px solid var(--rule-2); border-radius: var(--r);
  color: var(--navy); font-size: var(--t-table); font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s;
}
.ask-s:hover { border-color: var(--navy); background: var(--tint); }
.ask-stage.is-busy .ask-sugg-wrap { display: none; }

/* the composer: chips (what you pointed at, what you attached), the question, Ask or Stop, then the tools */
.ask-form { flex: none; display: grid; gap: var(--s2); padding: var(--s3) var(--s4) var(--s3); background: #fff; border-top: 1px solid var(--rule-2); }
.ask-row { display: flex; align-items: flex-end; gap: var(--s2); }
.ask-in { flex: 1; min-width: 0; display: block; padding-top: 8px; padding-bottom: 8px; line-height: 1.5; resize: none; max-height: 9.5em; overflow-y: auto; }
.ask-send { flex: none; min-width: 80px; gap: 6px; }
.ask-send.is-stop { background: #fff; color: var(--navy); border-color: var(--navy); }
.ask-send.is-stop:hover { background: var(--tint); }
.ask-send .ic { width: 14px; height: 14px; }
.ask-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.ask-photo { display: none; }
@media (pointer: coarse) { .ask-photo { display: inline-flex; } }
.ask-chips, .ask-files { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); }
.ask-files { max-height: 8.5rem; overflow-y: auto; }
.ask-chips:empty, .ask-files:empty { display: none; }
.ask-chips li { padding-right: 2px; border-color: var(--teal-line, #BFDDE3); background: var(--teal-tint); }
.ask-chips li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.ask-chips button { display: inline-grid; place-items: center; width: var(--hit); height: var(--hit); border: 0; border-radius: 50%; background: none; color: var(--navy); cursor: pointer; }
.ask-chips button:hover { background: rgba(15, 20, 76, .08); }
.ask-chips .ic { width: 12px; height: 12px; }
.ask-files .att { background: var(--panel); }
.ask-file-err { max-height: 9em; overflow-y: auto; display: flex; gap: var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r); background: var(--warn-tint); color: var(--navy); font-size: var(--t-sm); line-height: 1.45; }
.ask-file-err[hidden] { display: none; }
.ask-file-err .ic { flex: none; margin-top: 3px; color: var(--warn); }
.ask-file-err > span { flex: 1; min-width: 0; }
.ask-file-err button { flex: none; align-self: flex-start; display: inline-grid; place-items: center; width: var(--hit); height: var(--hit); margin: -2px -6px -2px 0; border: 0; border-radius: 50%; background: none; color: var(--navy); cursor: pointer; }
.ask-file-err button:hover { background: rgba(15, 20, 76, .08); }
.ask-acc { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.45; }
.ask-acc-b { padding: 0; border: 0; background: none; color: var(--teal-text); font-size: var(--t-xs); font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ask-acc-more { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.45; display: grid; gap: var(--s2); }
.ask-acc-more[hidden] { display: none; }
.ask-acc-more ul { display: grid; gap: 2px; }
.ask-acc-more b { color: var(--navy); }
.ask-proto { font-size: var(--t-xs); color: var(--muted); }
.ask[data-inline] .ask-head, .ask[data-inline] [data-ask-point], .ask[data-inline] [data-ask-attach], .ask[data-inline] .ask-acc, .ask[data-inline] .ask-acc-more, .ask[data-inline] .ask-photo { display: none; }

/* a file dragged over the page: while Ask Penny is open, the panel and the page both offer "Give it to Penny" (Incoming keeps its own
   target for the page). Zones are shown only for the length of the drag. */
.ask-zone { position: fixed; z-index: 90; display: none; place-items: center; padding: var(--s5); background: rgba(251, 251, 254, .9); pointer-events: auto; transition: background .15s var(--ease); }
.ask-zone::before { content: ""; position: absolute; inset: 10px; border: 2px dashed var(--teal); border-radius: var(--r); pointer-events: none; }
.ask-zone.is-over { background: rgba(228, 242, 245, .96); }
.ask-zone-in { display: grid; justify-items: center; gap: var(--s1); text-align: center; max-width: 30ch; pointer-events: none; color: var(--ink-2); }
.ask-zone-in .ic { width: 28px; height: 28px; color: var(--teal-text); }
.ask-zone-in b { font-size: var(--t-h); color: var(--navy); }
.ask-zone-ask { top: var(--ask-top); right: 0; bottom: 0; width: var(--ask-w); }
.ask-zone-page { z-index: 70; top: var(--ask-top); left: 0; right: var(--ask-w); bottom: 0; background: rgba(255, 255, 255, .8); }
.ask-zone-page.is-over { background: rgba(228, 242, 245, .92); }
.ask-zone-full { z-index: 70; top: var(--ask-top); left: 0; right: 0; bottom: 0; }
html.is-file-drag.ask-open .ask-zone-ask, html.is-file-drag.ask-open .ask-zone-page:not([data-off]) { display: grid; }
html.is-file-drag .ask-zone-full { display: grid; }
@media (max-width: 1099.98px) {
  .ask-zone-ask { top: 0; width: min(440px, 100%); }
  .ask-zone-page { display: none !important; }
}
@media (max-width: 760px) { .ask-zone { display: none !important; } }

/* ------------------------------------------------------------------------------------------------ pointing */
/* One teal ring that glides to whatever Penny or you are pointing at: while you pick, on hover over a source she read, and when
   you click one. It is drawn over the page in page coordinates, so it works for a row, a card or a heading alike. */
.pointer {
  position: absolute; z-index: 12; left: 0; top: 0; width: 0; height: 0; border-radius: 4px; pointer-events: none; opacity: 0;
  border: 2px solid var(--teal); background: rgba(31, 138, 158, .09);
  transition: transform .24s var(--ease), width .24s var(--ease), height .24s var(--ease), opacity .18s var(--ease);
}
.pointer.is-on { opacity: 1; }
.pointer.is-first { transition: opacity .18s var(--ease); }
.pointer.is-pulse { animation: ppulse 1.1s var(--ease) 1; }
@keyframes ppulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 158, .55); } 100% { box-shadow: 0 0 0 16px rgba(31, 138, 158, 0); } }
.pointer-tag {
  position: absolute; left: -2px; bottom: calc(100% + 6px); max-width: min(380px, 70vw); padding: 3px 10px; border-radius: 4px;
  background: var(--teal-text); color: #fff; font-size: var(--t-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pointer.is-below .pointer-tag { bottom: auto; top: calc(100% + 6px); }
html.is-picking .shell-page, html.is-picking .shell-page * { cursor: crosshair; }
.pick-strip {
  position: fixed; z-index: 60; top: calc(var(--ask-top) + 12px); left: var(--s3); right: var(--s3); width: fit-content; max-width: calc(100vw - 24px); margin: 0 auto;
  display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px var(--s4); border-radius: 24px; background: var(--navy); color: #fff; font-weight: 600;
  box-shadow: var(--shadow-pop); animation: pfade-in .26s var(--ease) both;
}
.pick-strip .btn { background: transparent; border-color: rgba(255, 255, 255, .45); color: #fff; min-height: 36px; border-radius: 18px; }
.pick-strip .btn:hover { border-color: #fff; }
.pick-strip[hidden] { display: none; }
@media (min-width: 1100px) { html.ask-open .pick-strip { right: calc(var(--ask-w) + var(--s3)); max-width: calc(100vw - var(--ask-w) - 24px); } }
/* on a tablet or phone the sheet steps aside while you point */
@media (max-width: 1099.98px) {
  html.is-picking .ask:not([data-inline]):not([data-mode="full"]) { transform: translateX(100%); visibility: hidden; transition-duration: .2s; }
  html.is-picking .ask-scrim { opacity: 0; visibility: hidden; }
}

/* ------------------------------------------------------------------------------------ the More page and the index */
.more-lead { color: var(--ink-2); margin-top: calc(var(--s2) * -1); margin-bottom: var(--s5); }
.more-list { border-top: 1px solid var(--rule); }
.more-list a { font-size: var(--t-md); min-height: 56px; }
.pop-note { padding: 0 var(--s4) var(--s2); max-width: 280px; white-space: normal; color: var(--ink-2); font-size: var(--t-sm); }

/* ---------------------------------------------------------------------------------------------------------- responsive */
/* The real-books badge and account controls may need two rows. Keep every control available,
   rather than letting the account menu escape the viewport; the accepted desktop bar stays unchanged. */
@media (max-width: 1439.98px) {
  .bar-top .bar-row { flex-wrap: wrap; row-gap: var(--s2); padding-block: var(--s2); }
  .bar-top .brand { min-width: 0; }
}
@media (max-width: 1180px) {
  .who-name, .who .caret { display: none; }
  .who > summary { padding-left: var(--s3); }
}
/* where the books stand shows once the nine tabs and it both fit (the tabs need about 980px, the three facts about 320px) */
@media (max-width: 1399.98px) {
  .asof { display: none; }
}
@media (max-width: 1100px) {
  .sample { display: none; }
}
@media (max-width: 1024px) {
  .brand a { min-height: 44px; }
  .ask-acc-b { display: inline-block; min-height: 44px; padding-block: 13px; margin-block: -13px; }   /* a tap box for "More" in the middle of a line, without moving the line */
  .tabs a { min-height: 44px; }
  .ask-btn { height: 44px; border-radius: 22px; }
  .pstat > summary { height: 44px; border-radius: 22px; }
  .who > summary { min-height: 44px; }
  .ask-x { width: 44px; height: 44px; }
  .ask-chips button { width: 44px; height: 44px; margin: -8px -4px; }
  .att-x { width: 44px; }
  .att-x .ic { width: 14px; height: 14px; }
  .see-ask { width: 44px; height: 44px; }
  .see-row[data-see-ref] { grid-template-columns: minmax(0, 1fr) auto 44px; }
  .ask-sugg-wrap > summary { min-height: 44px; }
  .ask-file-err button { width: 44px; height: 44px; margin: -12px -14px -12px 0; }
  .ask-jump { min-height: 44px; border-radius: 22px; }
  .ask-send { min-height: 44px; }
  .ask-cites a { display: inline-flex; align-items: center; min-height: 44px; }
  .see-tech > summary { min-height: 44px; }
  .ask-new { min-height: 44px; }
  .ask-s { min-height: 44px; }
  .pick-strip .btn { min-height: 44px; }
}
@media (max-width: 760px) {
  .bar-top .bar-row { min-height: 52px; gap: var(--s2); padding-block: 0; }   /* one row on phones: the wrap padding above would make the bar 60px */
  .brand a { font-size: 20px; }
  .pickers { display: none; }
  .bar-nav { display: none; }
  .bar-end { gap: var(--s1); }
  .ask-btn { padding: 0 14px; }
  .ask-label { display: none; }
  .ask-short { display: inline; }
  .who > summary { border-left: 0; padding: 0; min-height: 44px; min-width: 44px; justify-content: center; }
  /* the status shrinks to the coin with a small working dot; the panel opens from it, across the screen */
  .pstat > summary { width: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .pstat .caret { display: none; }
  .pstat { position: static; }

  .dock {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--navy); color: var(--on-navy-2); padding-bottom: env(safe-area-inset-bottom);
  }
  .dock a { display: grid; justify-items: center; align-content: center; gap: 2px; min-height: 60px; text-decoration: none; font-size: 12px; font-weight: 600; position: relative; }
  .dock a .ic { width: 22px; height: 22px; }
  .dock a[aria-current] { color: #fff; box-shadow: inset 0 3px 0 var(--teal); }
  .dock .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; font-size: 11px; line-height: 16px; padding: 0 4px; }

  .ask:not([data-inline]):not([data-mode="full"]) { width: 100%; border-left: 0; }
  .ask-expand { display: none; }         /* the sheet already fills the screen: it is Work with Penny */
  .ask-lbl-photo, .ask-lbl-long { display: none; }          /* three tools in one row: Attach, a camera, Point */
  .ask-photo { min-width: 44px; padding: 0; }
  .ask-form { gap: var(--s2); }
  .ask-form { padding-bottom: calc(var(--s3) + env(safe-area-inset-bottom)); }
  .pick-strip { top: calc(var(--ask-top) + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  /* words only: no ring, no dot, no moving cue; her answer arrives whole */
  .pointer { transition: none; }
  .ask, .ask-scrim, .shell-page, .ask-zone { transition-duration: 0s !important; transition-delay: 0s !important; }
  .ask-dots i { animation: none; opacity: .6; }
  .ask-step.is-run .ask-step-i::after { animation: none; border-color: var(--teal); }
  .ask-a.is-streaming .penny > div > p:last-child::after { animation: none; }
  .ask-see > summary .caret, .ask-sugg-wrap > summary .caret { transition: none; }
}
@media print {
  .bar-nav, .pickers, .who, .dock, .ask-btn, .pstat, .ask, .ask-scrim, .pointer, .pick-strip, .ask-zone { display: none !important; }
  html.ask-open .shell-page { margin-right: 0; }
}

/* On a big monitor Ask Penny is wider, and still beside the page (the Beside Rule). The thread and the composer have more room, so a
   long answer wraps less and her block keeps a comfortable measure; nothing else changes. */
@media (min-width: 2200px) {
  :root { --ask-w: var(--ask-w-big); }
  .ask-body { padding: var(--s5); gap: var(--s5); }
  .ask-form { padding: var(--s4) var(--s5) var(--s5); }
  .ask-head, .ask-scope, .ask-see > summary { padding-left: var(--s5); }
  .ask-see-body { padding-left: var(--s5); padding-right: var(--s5); }
  .ask-q { max-width: 80%; }
}
