/* Research desk on the Photos UI kit 1.2.0 (web/kit/tokens.css + components.css).
   This file only lays out the desk: shell, navigation and the desk's own content patterns. Controls, fields,
   badges, segments, dialogs, disclosures and the three-panel workspace come from the kit. */

:root { --desk-sidebar: 248px; --ok-ink: #3d5730; --warn-ink: #665116; --info-ink: #2f5468; --lilac-ink: #5a4790; }
html { background: var(--cream); }
body.photos-ui { margin: 0; min-height: 100vh; font-size: 1rem; }
.photos-ui a { color: var(--purple); text-decoration: none; }
.photos-ui a:hover { color: var(--purple-deep); text-decoration: underline; text-underline-offset: 3px; }
.ico { flex: none; display: block; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--paper); padding: 10px 14px; border-radius: 12px; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; line-height: 1.55; }
.bad { color: var(--danger); }

/* ── Shell ─────────────────────────────────────────────────────────── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--desk-sidebar); display: flex; flex-direction: column; padding: 24px 16px 14px; background: var(--paper); border-right: 1px solid var(--line); z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: var(--ink) !important; text-decoration: none !important; }
.brand-mark { width: 40px; height: 42px; border-radius: 13px; background: var(--peach); color: #a7502a; display: grid; place-items: center; transform: rotate(-5deg); flex: none; }
.brand-text { display: grid; line-height: 1.2; }
.brand-text b { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; font-synthesis: none; }
.brand-text small { color: var(--muted); font-size: .875rem; }
.nav-search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; margin: 22px 0 14px; border: 0; border-radius: 12px; background: var(--control-surface); color: var(--muted); }
.nav-search input { border: 0; background: transparent; width: 100%; min-width: 0; padding: 0; font-size: 1rem; color: var(--ink); outline-offset: 4px; }
.nav-search input::placeholder { color: var(--placeholder); opacity: 1; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.nav-group { margin-bottom: 10px; }
.nav-group-head { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 4px 12px; color: var(--muted); font-size: .8125rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0; border-radius: 9px; }
.nav-group-head:hover { background: var(--cream); color: var(--ink); }
.nav-group-head .ico { transition: transform 160ms ease; }
.nav-group.folded .nav-group-head .ico { transform: rotate(-90deg); }
.nav-group.folded .nav-items { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 9px 12px; border-radius: 11px; color: var(--muted) !important; font-size: 1rem; text-decoration: none !important; }
.nav-item .ico { width: 20px; height: 20px; }
.nav-item:hover { background: var(--cream); color: var(--ink) !important; }
.nav-item[aria-current="page"] { background: var(--purple-soft); color: var(--purple) !important; font-weight: 600; }
.nav-count { margin-left: auto; font-size: .8125rem; background: #ded4f5; color: #6f5ca5; border-radius: 6px; padding: 1px 6px; font-weight: 600; }
.sidebar-foot { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.view { margin-left: var(--desk-sidebar); padding: 28px 40px 96px; max-width: calc(1180px + var(--desk-sidebar)); min-width: 0; outline: none; }
.view.wide { max-width: none; padding: 0; }
.mobile-nav { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .view { margin-left: 0; padding: 18px 16px 120px; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; inset: auto 0 0 0; z-index: 50; min-height: 74px; padding: 6px 8px max(10px, env(safe-area-inset-bottom)); background: #fffdf8f7; border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .mobile-nav > a, .mobile-nav > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; padding: 4px 2px; font-size: .8125rem; line-height: 1.2; color: var(--muted) !important; text-decoration: none !important; text-align: center; }
  .mobile-nav > [aria-current="page"] { color: var(--purple) !important; font-weight: 600; }
  .mobile-nav .ico { width: 22px; height: 22px; }
}
.more-sheet .ph-dialog-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.more-sheet .nav-item { background: var(--cream); }
.more-sheet form.nav-search { grid-column: 1 / -1; margin: 0 0 8px; }

/* ── Page structure ────────────────────────────────────────────────── */
.photos-ui h1 { font-size: 2.375rem; font-weight: 550; line-height: 1.2; margin: 0 0 6px; letter-spacing: 0; }
.photos-ui h1.ph-display { font-size: 2.5rem; }
.photos-ui h2 { font-size: 1.375rem; font-weight: 550; line-height: 1.25; margin: 32px 0 12px; }
.photos-ui h3 { font-size: 1.125rem; font-weight: 600; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin: 4px 0 20px; }
.page-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.head-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumb { font-size: .875rem; color: var(--muted); margin-bottom: 6px; }
.lede { color: var(--muted); font-size: 1.125rem; line-height: 1.5; margin: 0 0 20px; max-width: 68ch; }
.photos-ui p { margin: 0 0 12px; }
@media (max-width: 700px) { .photos-ui h1 { font-size: 1.75rem; } .photos-ui h1.ph-display { font-size: 2rem; } .photos-ui h2 { font-size: 1.25rem; } .lede { font-size: 1rem; } }

/* Lists of things */
.rows { background: var(--paper); border: 1px solid var(--control-border); border-radius: var(--panel-radius); overflow: hidden; }
.rows > p.muted { margin: 0; padding: 16px 20px; }
.row { display: grid; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); align-items: center; min-height: 52px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fffaf2; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.tag { display: inline-block; font-size: .8125rem; line-height: 1.4; background: var(--lilac); color: var(--lilac-ink) !important; border-radius: 7px; padding: 2px 8px; text-decoration: none !important; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 28px; }
.quote { border-left: 3px solid var(--peach); padding: 4px 0 4px 14px; color: var(--muted); margin: 12px 0; font-size: 1.0625rem; }
pre { white-space: pre-wrap; background: var(--paper); border: 1px solid var(--control-border); border-radius: 12px; padding: 14px 16px; font-size: .9375rem; overflow-x: auto; }
code { font-size: .9em; background: var(--control-surface); border-radius: 5px; padding: 1px 5px; }
table.grid { border-collapse: collapse; width: 100%; background: var(--paper); border-radius: 12px; overflow: hidden; font-size: .9375rem; }
table.grid th, table.grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: center; }
table.grid th:first-child, table.grid td:first-child { text-align: left; }
.dot-main { color: var(--purple); } .dot-side { color: var(--muted); }

/* Panels */
.card, .box { background: var(--panel-surface); border: 1px solid var(--control-border); border-radius: var(--panel-radius); padding: 20px 22px; margin: 14px 0; box-shadow: var(--panel-shadow); }
.box { background: var(--cream); box-shadow: none; padding: 14px 16px; }
.needs { background: var(--butter); border-color: #efd88a; }
.needs h2 { margin: 0 0 8px; }
.needs ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Status words (kit badges) */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 7px; padding: 3px 8px; background: var(--control-surface); color: var(--muted); font-size: .8125rem; line-height: 1.4; white-space: nowrap; justify-self: start; }
.pill.ok, .pill.published, .pill.done, .pill.checked { background: var(--green); color: var(--ok-ink); }
.pill.hot, .pill.blocked, .pill.writing { background: var(--butter); color: var(--warn-ink); }
.pill.bad { background: #fbe9e5; color: var(--danger); }
.pill.open, .pill.sent, .pill.received, .pill.new { background: var(--blue); color: var(--info-ink); }
.nb-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; font-size: .75rem; font-weight: 600; background: #ded4f5; color: #6f5ca5; border-radius: 7px; padding: 0 6px; vertical-align: middle; }

/* Filters as kit segments */
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid var(--control-border); border-radius: 14px; background: var(--control-surface); margin: 0 0 12px; max-width: 100%; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border-radius: 10px; color: var(--muted) !important; font-size: .9375rem; text-decoration: none !important; white-space: nowrap; }
.chip:hover { color: var(--ink) !important; background: #fbf3e8; }
.chip.on { color: var(--ink) !important; background: var(--panel-surface); box-shadow: 0 1px 3px #58432718; font-weight: 550; }
.themejump { background: transparent; border: 0; padding: 0; }
.themejump .chip { background: var(--paper); border: 1px solid var(--control-border); min-height: 36px; font-size: .875rem; }

/* Toolbars, forms and fields */
.ptools, .filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.filters .kit-select, .ptools .kit-select { min-width: 180px; }
.photos-ui input[type=search], .photos-ui input[type=text], .photos-ui input:not([type]), .photos-ui input[type=password], .photos-ui textarea {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--control-surface); border: 0; border-radius: 12px; padding: 10px 12px; min-height: 44px; min-width: 0; }
.photos-ui textarea { line-height: 1.5; width: 100%; resize: vertical; }
.photos-ui input::placeholder, .photos-ui textarea::placeholder { color: var(--placeholder); opacity: 1; }
.filters input[type=search], .ptools input[type=search] { flex: 1 1 260px; max-width: 440px; }
.form, .dlg-form .ph-dialog-body { display: grid; gap: 16px; }
.form label, .ph-dialog-body > label, .two label, .formrow label { display: grid; gap: 6px; font-size: 1rem; font-weight: 500; color: var(--ink); }
.form label input, .form label textarea, .ph-dialog-body label input, .ph-dialog-body label textarea { width: 100%; }
.formrow, .two { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.note-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kit-select { min-width: 0; }
.kit-select.compact .ph-select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kit-select .ph-select-trigger { background: var(--panel-surface); }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--purple) !important; font-weight: 550; font-size: .9375rem; text-decoration: none; white-space: nowrap; }
.linkbtn:hover { background: var(--purple-soft); }
.linkbtn.danger { color: var(--danger) !important; }
.photos-ui .ph-button.small { min-height: 36px; padding: 6px 12px; font-size: .9375rem; }

/* ── Home ──────────────────────────────────────────────────────────── */
.home-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin: 0 0 24px; }
.pcard { display: grid; gap: 8px; align-content: start; background: var(--paper); border: 1px solid var(--control-border); border-radius: var(--panel-radius); padding: 18px 20px; color: var(--ink) !important; text-decoration: none !important; box-shadow: var(--panel-shadow); transition: border-color 160ms ease, transform 160ms ease; }
.pcard:hover { border-color: #d9c8b1; transform: translateY(-1px); }
.pcard:nth-child(5n+1) { border-top: 6px solid var(--peach); } .pcard:nth-child(5n+2) { border-top: 6px solid var(--green); }
.pcard:nth-child(5n+3) { border-top: 6px solid var(--butter); } .pcard:nth-child(5n+4) { border-top: 6px solid var(--lilac); } .pcard:nth-child(5n) { border-top: 6px solid var(--blue); }
.tcard-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.tcard-top b { font-size: 1.0625rem; line-height: 1.35; }
.feed-more summary { cursor: pointer; color: var(--muted); font-size: .875rem; min-height: 32px; }

/* ── Board ─────────────────────────────────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kcol { border-radius: var(--panel-radius); padding: 12px; min-height: 160px; background: var(--peach); }
.kcol:nth-child(2) { background: var(--butter); } .kcol:nth-child(3) { background: var(--blue); } .kcol:nth-child(4) { background: var(--lilac); } .kcol:nth-child(5) { background: var(--green); }
.kcol h2 { margin: 2px 4px 12px; font-size: 1rem; }
.tcard { display: block; background: var(--paper); border-radius: 13px; padding: 12px 14px; margin-bottom: 10px; color: var(--ink) !important; text-decoration: none !important; box-shadow: 0 2px 8px -6px #58432760; }
.tcard:hover { box-shadow: 0 6px 16px -8px #58432780; }
.tcard-title { margin: 6px 0; font-size: .9375rem; line-height: 1.4; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(5, 260px); } }

/* ── Projects ──────────────────────────────────────────────────────── */
.pfields { display: grid; gap: 0; margin: 8px 0; }
.pfield { padding: 16px 0; border-bottom: 1px solid var(--line); }
.plabel { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9375rem; font-weight: 600; margin-bottom: 4px; }
.pval { font-size: 1.0625rem; line-height: 1.55; }
.pval ul { margin: 4px 0; padding-left: 22px; }
@media (hover: hover) { .pfield .nb:not(:has(.nb-count)) .nb-toggle { opacity: 0; transition: opacity 160ms; } .pfield:hover .nb .nb-toggle, .pfield .nb-toggle:focus-visible { opacity: 1; } }

/* ── Notes (on anything) ───────────────────────────────────────────── */
.nb { margin-top: 6px; }
.nb-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px; margin-left: -8px; border-radius: 10px; color: var(--muted); font-size: .875rem; }
.nb-toggle:hover { background: var(--cream); color: var(--ink); }
.nb-body { border-left: 3px solid var(--lilac); padding: 6px 0 6px 14px; margin-top: 4px; display: grid; gap: 4px; }
.note { padding: 8px 0; border-bottom: 1px solid var(--line); }
.note.done .note-text { color: var(--muted); text-decoration: line-through; }
.note-text { white-space: pre-wrap; font-size: 1rem; }
.note-acts { display: flex; gap: 2px; flex-wrap: wrap; }
.note-acts button { display: inline-flex; align-items: center; min-height: 36px; padding: 0 8px; border-radius: 10px; color: var(--purple); font-size: .875rem; font-weight: 550; }
.note-acts button:hover { background: var(--purple-soft); }
.note-form { display: grid; gap: 8px; margin-top: 6px; }

/* Click-to-edit text */
.ced[contenteditable="true"] { outline: none; border-radius: 6px; cursor: text; }
.ced[contenteditable="true"]:hover { background: #fbf3e8; }
.ced[contenteditable="true"]:focus { background: var(--purple-soft); box-shadow: none; outline: none; }
.ced[contenteditable]:empty::before { content: attr(data-ph); color: var(--placeholder); }

/* Undo bar (kit toast) */
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; align-items: center; gap: 12px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; transition: transform 180ms ease, opacity 180ms ease;
  background: var(--paper); color: var(--ink); border: 1px solid var(--control-border); border-radius: 14px; box-shadow: 0 10px 40px #30284022; padding: 6px 6px 6px 16px; font-size: .9375rem; max-width: min(640px, calc(100vw - 32px)); }
#toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#toast .toast-undo { min-height: 40px; padding: 0 14px; border-radius: 10px; background: var(--control-surface); font-weight: 600; }
#toast .toast-undo:hover { background: var(--control-hover); }
@media (max-width: 900px) { #toast { bottom: 92px; } }

/* ── Content ───────────────────────────────────────────────────────── */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin: 8px 0 14px; }
.ccard { background: var(--paper); border: 1px solid var(--control-border); border-radius: 16px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.ccard[aria-selected="true"] { border-color: var(--purple); box-shadow: 0 0 0 2px var(--purple-soft); }
.ccard.dim { opacity: .55; }
.chead { display: flex; gap: 8px; align-items: baseline; font-size: 1.0625rem; line-height: 1.35; }
.ccard .sub { color: var(--muted); font-size: .9375rem; }
.cmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ready { flex: none; font-size: 1rem; }
.r-ready { color: #5b8a3c; } .r-partial { color: #b48a1d; } .r-needs { color: var(--muted); }
.cyc { cursor: pointer; }
.handle { cursor: grab; color: var(--muted); user-select: none; font-size: .8125rem; letter-spacing: -2px; }
.theme { scroll-margin-top: 16px; }
.theme-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.theme-head h2 { margin: 0; display: flex; align-items: center; gap: 4px; }
.fold { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); font-size: .875rem; }
.fold:hover { background: var(--control-surface); }
.theme.folded .cgrid, .theme.folded .addpiece { display: none; }
.addpiece, .addtheme { width: 100%; border-style: dashed !important; background: transparent !important; margin: 0 0 10px; }
.ccard.dragging { opacity: .4; }
.ccard.drop-before { box-shadow: 0 -3px 0 var(--purple); }
.ccard.drop-after { box-shadow: 0 3px 0 var(--purple); }
.ccard.flash, .prow.flash { animation: flash 2s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 4px var(--purple); } to { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .ccard.flash, .prow.flash { animation: none; outline: 3px solid var(--purple); } .pcard, #toast, .nav-group-head .ico { transition: none; } }

/* Notepad (inside the Content workspace) */
.pad { display: grid; gap: 12px; }
.pad-head { display: flex; justify-content: space-between; align-items: center; }
.pad-text { min-height: 42vh; font-size: 1.0625rem !important; line-height: 1.55; background: var(--cream) !important; }
.pad-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pad-done { background: var(--green); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.pad-acts { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.pad-msg.bad { color: var(--danger); }
.pad-hist summary { cursor: pointer; color: var(--muted); min-height: 36px; }
.pad-past { border-top: 1px solid var(--line); padding: 10px 0; }
.pad-past-text { color: var(--muted); margin: 4px 0; }
.pad-past ul { margin: 4px 0 0; padding-left: 20px; }

/* ── Three-panel workspaces (kit .ph-workshop) ─────────────────────── */
.desk-ws.ph-workshop { height: 100dvh; min-height: 32rem; }
.desk-ws .ph-workshop-toolbar { position: relative; z-index: 6; }
.desk-ws .ph-workshop-toolbar .ws-title { display: grid; gap: 0; margin-right: auto; min-width: 0; }
.desk-ws .ph-workshop-toolbar .ws-title h1 { font-size: 1.375rem; margin: 0; }
.desk-ws .ph-workshop-toolbar .ws-title .crumb { margin: 0; }
.desk-ws .ws-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.desk-ws .ws-tools input[type=search] { width: 220px; }
.desk-ws .ws-tools .kit-select { min-width: 190px; }
.desk-ws .ph-workshop-canvas { background: var(--cream); padding: 20px 24px 80px; }
.desk-ws .ph-workshop-grid { grid-template-columns: 240px minmax(0, 1fr) 380px; }
.desk-ws[data-left=false] .ph-workshop-grid { grid-template-columns: 0 minmax(0, 1fr) 380px; }
.desk-ws[data-right=false] .ph-workshop-grid { grid-template-columns: 240px minmax(0, 1fr) 0; }
.desk-ws[data-left=false][data-right=false] .ph-workshop-grid { grid-template-columns: 0 minmax(0, 1fr) 0; }
.desk-ws[data-left=false] #outline-panel, .desk-ws[data-right=false] #inspector-panel { visibility: hidden; padding: 0; border: 0; }
.ws-outline { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ws-outline button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; padding: 8px 10px; border-radius: 11px; text-align: left; font-size: .9375rem; }
.ws-outline button:hover { background: var(--cream); }
.ws-outline button[aria-current="true"] { background: var(--purple-soft); color: var(--purple); font-weight: 600; }
.ws-outline .count { color: var(--muted); font-size: .8125rem; }
.ws-pane-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; position: sticky; top: -16px; background: var(--paper); padding: 8px 0; z-index: 2; }
.ws-pane-title h2 { margin: 0; font-size: 1rem; }
.insp-field { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.insp-field .plab { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.insp-field .pval { font-size: 1rem; min-height: 1.5em; white-space: pre-wrap; padding: 4px 6px; margin: 0 -6px; }
.insp-empty { color: var(--muted); padding: 20px 4px; }
.redo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--purple); font-size: .9375rem; }
.redo:hover { background: var(--purple-soft); }
@media (max-width: 1000px) {
  .desk-ws .ph-workshop-grid, .desk-ws[data-left=false] .ph-workshop-grid, .desk-ws[data-right=false] .ph-workshop-grid { display: block; }
  .desk-ws .ws-tools input[type=search] { width: 100%; }
  .desk-ws .ws-tools { width: 100%; }
}
@media (max-width: 900px) { .desk-ws.ph-workshop { height: calc(100dvh - 74px); } }

/* Copy table */
.pgroup { margin: 0 0 26px; scroll-margin-top: 12px; }
.pgroup h2 { margin: 0 0 10px; }
.ptable-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--control-border); border-radius: var(--panel-radius); }
.ptable { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.ptable th { text-align: left; font-weight: 600; font-size: .8125rem; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--control-border); background: #fdf6ec; white-space: nowrap; }
.ptable td { padding: 11px 12px; vertical-align: top; border-bottom: 1px solid var(--line); }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable-wrap.wide .ptable td, .ptable-wrap.wide .ptable th { min-width: 220px; }
.ptable-wrap.wide .ptable td.pnum, .ptable-wrap.wide .ptable th:first-child { min-width: 0; }
.prow { cursor: pointer; }
.prow:hover { background: #fffaf2; }
.prow[aria-selected="true"] { background: var(--purple-soft); }
.pnum { width: 32px; color: var(--muted); }
.ppain { min-width: 180px; }
.plead { min-width: 200px; }
.psearch { font-weight: 600; color: var(--purple); margin-bottom: 3px; }
.ptable td[data-k="headline"] { font-weight: 600; }
.addpain { width: 100%; margin-top: 8px; border-style: dashed !important; background: transparent !important; }
.copy-status { min-height: 1.5em; font-size: .9375rem; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--control-border); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.aiform { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0; padding: 12px 16px; background: var(--lilac); border-bottom: 1px solid var(--control-border); }
.aiform label { display: grid; gap: 6px; font-size: .9375rem; font-weight: 500; }
.aiform .grow { flex: 1; min-width: 220px; }
.pagecard { margin: 0 0 18px; }
.pagecard .copy-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pagecard h2 { margin: 0; }
.mdout { font-size: 1.0625rem; line-height: 1.6; }
.mdout h2, .mdout h3, .mdout h4, .mdout h5 { margin: 18px 0 6px; font-size: 1.125rem; }
.mdout hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.mdout ol, .mdout ul { padding-left: 22px; }
.copyrow-link { color: var(--ink) !important; text-decoration: none !important; }
.copyrow-link b { font-size: 1.0625rem; }
@media (max-width: 760px) {
  .ptable-wrap { border: 0; background: none; overflow: visible; }
  .ptable, .ptable tbody, .ptable tr, .ptable td { display: block; width: auto; min-width: 0 !important; }
  .ptable thead { display: none; }
  .ptable tr.prow { background: var(--paper); border: 1px solid var(--control-border); border-radius: 14px; margin: 0 0 8px; padding: 6px 4px; }
  .ptable td { border: 0; padding: 4px 12px; }
  .ptable td[data-label]::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--muted); }
  .ptable td.pnum { display: none; }
}

/* ── Story ideas ───────────────────────────────────────────────────── */
.lrow { display: grid; grid-template-columns: minmax(0, 1fr) 220px 180px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.lrow > .ltitle { cursor: pointer; }
.lrow.open { background: var(--purple-soft); }
.ldetail { padding: 12px 18px 18px; border-bottom: 1px solid var(--line); background: var(--panel-surface); display: grid; gap: 8px; }
.ldetail .ced { display: block; min-height: 1.5em; white-space: pre-wrap; }
.leads-list { border: 1px solid var(--control-border); border-radius: var(--panel-radius); overflow: hidden; }
@media (max-width: 760px) { .lrow { grid-template-columns: 1fr; gap: 6px; } }

/* Judging finds, packets, owner answers */
.judge { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ph-segment.small { padding: 3px; border-radius: 12px; }
.ph-segment.small button { min-height: 34px; padding: 4px 10px; font-size: .875rem; }
.ph-segment button[data-v="1"][aria-pressed="true"] { color: var(--ok-ink); background: var(--green); }
.ph-segment button[data-v="-1"][aria-pressed="true"] { color: var(--danger); background: #fbe9e5; }
.ph-segment button[data-v="no"][aria-pressed="true"] { color: var(--danger); background: #fbe9e5; }
.ph-segment button[data-v="yes"][aria-pressed="true"] { color: var(--ok-ink); background: var(--green); }

/* Search results */
.sres h2 { font-size: 1.125rem; margin: 22px 0 8px; }

/* ── Ask Claude ────────────────────────────────────────────────────── */
#claude-btn { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; background: var(--paper); color: var(--ink); border: 1px solid var(--control-border); box-shadow: 0 10px 30px -12px #30284055; font-weight: 600; }
#claude-btn:hover { background: var(--cream); }
#claude-panel { position: fixed; right: 16px; top: 16px; bottom: 80px; width: min(440px, calc(100vw - 32px)); z-index: 45; background: var(--paper); border: 1px solid var(--control-border); border-radius: 20px; box-shadow: 0 20px 60px -20px #30284066; display: flex; flex-direction: column; padding: 14px 16px; }
#claude-panel[hidden] { display: none; }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.cp-head b { font-size: 1.125rem; }
.cp-head > span { display: flex; align-items: center; gap: 4px; }
.cp-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.cp-me { align-self: flex-end; background: var(--purple-soft); border-radius: 14px 14px 4px 14px; padding: 8px 12px; max-width: 85%; white-space: pre-wrap; }
.cp-ai { align-self: flex-start; background: var(--cream); border-radius: 14px 14px 14px 4px; padding: 10px 12px; max-width: 92%; line-height: 1.5; }
.cp-act { align-self: center; font-size: .8125rem; color: var(--ok-ink); background: var(--green); border-radius: 10px; padding: 4px 10px; }
.cp-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.cp-form textarea { flex: 1; }
.cp-quick { margin-top: 6px; align-self: flex-start; }
@media (max-width: 900px) { #claude-btn { bottom: 90px; right: 14px; } #claude-panel { left: 8px; right: 8px; width: auto; top: 8px; bottom: 90px; } }

/* Small screens */
@media (max-width: 760px) {
  .row { grid-template-columns: 1fr !important; gap: 4px; padding: 12px 14px; }
  .row, .row > * { min-width: 0; overflow-wrap: anywhere; }
  .tag { white-space: normal; }
  .filters input[type=search], .ptools input[type=search] { flex-basis: 100%; max-width: none; }
  .filters .kit-select, .ptools .kit-select { flex: 1 1 100%; }
  .chips { display: flex; }
}
@media (forced-colors: active) { .nav-item[aria-current="page"], .chip.on, .prow[aria-selected="true"] { outline: 2px solid Highlight; } }
.photos-ui .nav-search input { border: 0; background: transparent; padding: 0; min-height: 0; border-radius: 0; }
.photos-ui .pad-text { min-height: 40vh; }
.desk-ws .cgrid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.desk-ws .ph-workshop-toolbar { flex-wrap: nowrap; }
.desk-ws .ph-workshop-toolbar .ws-title h1 { font-size: 1.125rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.desk-ws .ws-tools { flex-wrap: nowrap; }
.desk-ws .ws-tools .kit-select { min-width: 0; width: 170px; }
.desk-ws .ws-tools input[type=search] { width: 190px; }
.desk-ws .ws-tools .ph-segment button { min-height: 36px; padding: 4px 12px; }
.desk-ws .ws-tools .ph-segment { padding: 3px; }
@media (max-width: 1280px) { .desk-ws .ph-workshop-toolbar, .desk-ws .ws-tools { flex-wrap: wrap; } }
.kit-select .ph-select-trigger { min-width: 0; overflow: hidden; }
.kit-select .ph-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-tools .ph-segment { flex-wrap: nowrap; flex: none; }
.desk-ws .ws-tools > * { flex-shrink: 0; }
.desk-ws .ws-tools { min-width: 0; }
.photos-ui .kit-select.ph-custom-select { display: grid; }
.photos-ui .kit-select .ph-select-trigger { width: 100%; max-width: 100%; }
.desk-ws .ws-tools { flex: 1 1 auto; justify-content: flex-end; }
.desk-ws .ws-tools .kit-select { width: 148px; flex-shrink: 1; }
.desk-ws .ws-tools input[type=search] { width: auto; flex: 1 1 140px; min-width: 120px; max-width: 220px; }
.desk-ws .ph-workshop-toolbar > .ph-button { flex: none; }
.desk-ws .ws-title { flex: 0 1 auto; }
.ph-segment.small { flex-wrap: nowrap; }
@media (max-width: 700px) {
  .desk-ws .ph-workshop-toolbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; }
  .desk-ws .ph-workshop-toolbar > [data-pane="left"] { grid-column: 1; grid-row: 1; }
  .desk-ws .ph-workshop-toolbar .ws-title { grid-column: 2; grid-row: 1; }
  .desk-ws .ph-workshop-toolbar .ws-title h1 { max-width: none; }
  .desk-ws .ph-workshop-toolbar > [data-pane="right"] { grid-column: 3; grid-row: 1; }
  .desk-ws .ws-tools { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .desk-ws .ws-tools > .ph-segment, .desk-ws .ws-tools input[type=search] { grid-column: 1 / -1; max-width: none; }
  .desk-ws .ws-tools .kit-select { width: auto; }
  .desk-ws .ws-tools .ph-segment button { flex: 1; }
  .desk-ws .ph-workshop-canvas { padding: 14px 12px 90px; }
}
@media (max-width: 900px) { #claude-btn { width: 52px; height: 52px; padding: 0; justify-content: center; font-size: 0; gap: 0; border-radius: 18px; } #claude-btn svg { width: 22px; height: 22px; } }
.bots-page { margin: 0 auto !important; max-width: 860px; padding: 40px 24px 80px; }
.bots-page ul { padding-left: 22px; } .bots-page li { margin: 6px 0; }

/* ── Main column with a top bar (Ask Claude lives top right) ───────── */
:root { --claude-w: 400px; --topbar-h: 64px; }
.main-col { margin-left: var(--desk-sidebar); min-width: 0; transition: margin-right 200ms ease; }
.view { margin-left: 0; max-width: 1240px; padding-top: 4px; }
.view.wide { max-width: none; }
.topbar { position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: flex-end; gap: 12px; height: var(--topbar-h); padding: 0 24px; background: color-mix(in srgb, var(--cream) 92%, transparent); backdrop-filter: blur(6px); }
.topbar-brand { display: none; margin-right: auto; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--ink) !important; text-decoration: none !important; }
.desk-ws.ph-workshop { height: calc(100dvh - var(--topbar-h)); }
#claude-btn { position: static; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; background: var(--paper); color: var(--ink); border: 1px solid var(--control-border); box-shadow: none; font-weight: 600; font-size: 1rem; }
#claude-btn:hover { background: var(--control-surface); }
#claude-btn[aria-expanded="true"] { background: var(--purple-soft); color: var(--purple); border-color: #d8cff5; }
#claude-panel { position: fixed; top: 0; right: 0; bottom: 0; left: auto; width: var(--claude-w); z-index: 40; border-radius: 0; border: 0; border-left: 1px solid var(--line); box-shadow: none; background: var(--paper); padding: 22px 18px 16px; }
#claude-panel .cp-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
body.claude-open .main-col { margin-right: var(--claude-w); }
@media (max-width: 1100px) { body.claude-open .main-col { margin-right: 0; } #claude-panel { box-shadow: -16px 0 48px -12px #30284040; } }
@media (max-width: 900px) {
  .main-col { margin-left: 0; }
  .topbar { padding: 0 14px; height: 60px; }
  .topbar-brand { display: block; }
  #claude-btn { width: auto; height: 44px; font-size: 1rem; padding: 0 14px; border-radius: 12px; gap: 8px; }
  #claude-panel { width: 100%; bottom: 74px; border-left: 0; }
  .desk-ws.ph-workshop { height: calc(100dvh - 60px - 74px); }
}
@media (prefers-reduced-motion: reduce) { .main-col { transition: none; } }

/* ── Collection pages: search, filters, sort, list or grid ─────────── */
.cv { padding-top: 8px; }
.cv-eyebrow { margin: 0 0 8px; font-size: .875rem; font-weight: 650; text-transform: uppercase; color: var(--muted); }
.cv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.cv-head h1.ph-display { font-size: 3.25rem; line-height: 1.08; margin: 0 0 12px; }
.cv-head .lede { margin: 0; font-size: 1.1875rem; }
.cv-quicks { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 32px; }
.cv-quick { min-height: 52px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--control-border) !important; background: var(--paper) !important; font-size: 1.0625rem; font-weight: 550; color: var(--ink) !important; }
.cv-quick:hover { background: var(--cream) !important; }
.cv-quick[aria-pressed="true"] { background: var(--purple-soft) !important; border-color: #cfc4f2 !important; color: var(--purple) !important; }
.cv-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto 250px; gap: 24px; align-items: end; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.cv-search, .cv-field { display: grid; gap: 10px; min-width: 0; }
.cv-search > span:first-child, .cv-field > span:first-child { font-size: 1.0625rem; font-weight: 550; }
.cv-search-box { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--control-surface); color: var(--muted); }
.cv-search-box:focus-within { outline: none; background: var(--purple-soft); }
.photos-ui .cv-search-box input { border: 0; background: transparent; padding: 0; min-height: 0; width: 100%; font-size: 1.0625rem; outline: none; }
.cv-filter-btn { min-height: 44px !important; height: 44px; padding: 0 16px !important; font-size: .9375rem !important; }
.cv-fcount { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 7px; background: var(--purple); color: #fff; font-size: .8125rem; }
.cv-sort .ph-select-trigger { min-height: 56px; font-size: 1.0625rem; background: var(--paper); }
.cv-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 28px 0 26px; }
.cv-count { margin: 0; font-size: 1.1875rem; }
.cv-views button { min-width: 52px; display: grid; place-items: center; }
.cv-items.list { display: grid; gap: 18px; }
.cv-items.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.cv-items > div[data-lead] { display: contents; }
.cv-card { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; background: var(--paper); border: 1px solid var(--control-border); border-radius: 22px; padding: 28px 30px; box-shadow: 0 10px 24px -20px #58432740; }
.cv-side { align-self: start; }
.cv-tile { width: 76px; height: 76px; border-radius: 16px; display: grid; place-items: center; font-size: 1.25rem; font-weight: 650; color: var(--ink); text-align: center; line-height: 1.1; padding: 4px; }
.cv-tile.peach { background: var(--peach); } .cv-tile.green { background: var(--green); } .cv-tile.butter { background: var(--butter); }
.cv-tile.lilac { background: var(--lilac); } .cv-tile.blue { background: var(--blue); } .cv-tile.grey { background: #ece6df; color: var(--muted); }
.cv-main { min-width: 0; display: grid; gap: 8px; }
.cv-main h3 { font-size: 1.375rem; font-weight: 550; line-height: 1.3; margin: 0; }
.cv-main h3 a { color: var(--ink) !important; text-decoration: none !important; }
.cv-main h3 a:hover { color: var(--purple) !important; }
.cv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 1.0625rem; }
.cv-text { margin: 0; color: var(--ink); font-size: 1rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.cv-tags .tag, .cv-tags .pill { background: var(--control-surface); color: var(--muted) !important; font-size: .9375rem; padding: 5px 12px; border-radius: 9px; }
.cv-tags .pill.ok { background: var(--green); color: var(--ok-ink) !important; } .cv-tags .pill.bad { background: #fbe9e5; color: var(--danger) !important; } .cv-tags .pill.hot { background: var(--butter); color: var(--warn-ink) !important; }
.cv-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.cv-acts .kit-select { width: 170px; }
.cv-open { min-height: 52px !important; padding: 0 24px !important; font-size: 1.0625rem !important; }
.cv-items.grid .cv-card { grid-template-columns: 1fr; align-items: start; padding: 22px; gap: 14px; }
.cv-items.grid .cv-tile { width: 56px; height: 56px; font-size: 1rem; border-radius: 14px; }
.cv-items.grid .cv-acts { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: auto; }
.cv-items.grid .cv-main h3 { font-size: 1.1875rem; }
.cv-more-wrap { text-align: center; margin: 24px 0; }
.cv-fset { border: 0; padding: 0; margin: 0 0 18px; display: grid; gap: 4px; }
.cv-fset legend { font-weight: 600; margin-bottom: 6px; }
.idea-meta { display: flex; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; align-items: end; }
.idea-meta label { display: grid; gap: 6px; font-weight: 500; min-width: 200px; }
.idea .page-head h1 { font-family: var(--font-display); font-weight: 700; }
@media (max-width: 1000px) { .cv-tools { grid-template-columns: 1fr 1fr; } .cv-search { grid-column: 1 / -1; } }
@media (max-width: 700px) {
  .cv-head h1.ph-display { font-size: 2.25rem; }
  .cv-quicks { gap: 8px; margin-bottom: 22px; } .cv-quick { min-height: 44px; padding: 0 14px; font-size: 1rem; }
  .cv-tools { gap: 14px; padding-bottom: 22px; }
  .cv-card { grid-template-columns: 56px minmax(0, 1fr); padding: 18px; gap: 10px 14px; }
  .cv-tile { width: 52px; height: 52px; font-size: .9375rem; border-radius: 13px; }
  .cv-acts { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; }
  .cv-main h3 { font-size: 1.125rem; }
}
.cv-meta { display: block; } .cv-meta .ico { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.cv-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none !important; }
.cv-link .ico { color: var(--muted); }
.needs-notice { margin: -8px 0 28px; background: var(--butter); border-radius: 16px; padding: 16px 20px; }
.needs-notice ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.cv-tags .small { line-height: 1.5; }

/* One header style on every page: eyebrow, Fredoka title, lede, actions on the right */
.crumb { text-transform: uppercase; font-size: .875rem; font-weight: 650; color: var(--muted); margin: 8px 0 8px; }
.crumb a { color: var(--muted) !important; }
.crumb a:hover { color: var(--purple) !important; }
.view:not(.wide) h1 { font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; line-height: 1.12; font-synthesis: none; letter-spacing: 0; margin: 0 0 12px; }
.view:not(.wide) .cv-head h1.ph-display { font-size: 3.25rem; }
.view:not(.wide) .page-head { align-items: flex-start; margin-bottom: 18px; }
@media (max-width: 700px) { .view:not(.wide) h1 { font-size: 1.875rem; } .view:not(.wide) .cv-head h1.ph-display { font-size: 2.25rem; } }
.kanban .kcol h2, .kanban .tcard-top b { font-family: var(--font-body); }
.cv-items.board { display: block; }
/* Workspace titles: same title font as every other page, sized for the toolbar. */
.desk-ws .ph-workshop-toolbar .ws-title h1 { font-family: var(--font-display); font-weight: 700; font-synthesis: none; letter-spacing: 0; }
/* Phones: long links and code wrap, wide tables scroll inside themselves, never the page. */
.cv-main, .cv-main a, .view code { overflow-wrap: anywhere; }
.view table.grid { display: block; max-width: 100%; overflow-x: auto; }
.cv-tile { overflow: hidden; overflow-wrap: anywhere; }

/* ── Projects: "In projects" box, sections, Add search, suggestions ── */
.in-projects { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 12px 0 20px; }
.in-projects .plabel { margin: 0; }
.in-projects .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.psecs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 4px 0 24px; }
.psec { background: var(--paper); border: 1px solid var(--control-border); border-radius: var(--panel-radius); }
.psec > summary { display: flex; gap: 14px; align-items: baseline; padding: 14px 20px; cursor: pointer; list-style: none; min-width: 0; }
.psec > summary::-webkit-details-marker { display: none; }
.psec-label { font-weight: 650; flex: none; }
.psec-peek { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psec[open] .psec-peek { display: none; }
.psec-body { padding: 0 20px 16px; overflow-wrap: anywhere; }
.psec-body textarea { width: 100%; }
.psec-acts { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.psec-add { justify-self: start; }
.find-results { display: grid; gap: 6px; max-height: 50vh; overflow: auto; margin-top: 12px; }
.find-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.find-main { display: grid; min-width: 0; }
.find-main b { font-weight: 550; overflow-wrap: anywhere; }
.row.sug-row { grid-template-columns: auto minmax(0, 1fr) auto; }
.row.sug-row a { overflow-wrap: anywhere; }
.sug-acts { display: flex; gap: 12px; align-items: center; }
@media (max-width: 700px) { .row.sug-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } .find-row { grid-template-columns: minmax(0, 1fr) auto; } .find-row .pill { display: none; } }
.chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* Research starts with one goal; its progress stays inside the existing task. */
.research-start { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: end; padding: 20px; margin: 0 0 28px; border: 1px solid var(--control-border); border-radius: 16px; background: var(--paper); }
.research-start label { min-width: 0; display: grid; gap: 8px; font-weight: 600; }
.research-start textarea { width: 100%; min-width: 0; resize: vertical; }
.research-start > button { margin-bottom: 2px; min-height: 48px; }
.research-start > p { grid-column: 1 / -1; margin: 0; }
.research-progress { margin: 24px 0; padding: 22px; border: 1px solid var(--control-border); border-radius: 16px; background: var(--paper); overflow-wrap: anywhere; }
.research-progress-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.research-progress-head h2 { margin: 0 auto 0 0; }
.research-progress h3 { font-size: 1.0625rem; margin: 20px 0 8px; }
.research-progress p { margin: 10px 0; }
.research-progress .research-answer { border-top: 1px solid var(--line); margin-top: 18px; }
.research-evidence { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 18px; }
.research-evidence summary { cursor: pointer; font-weight: 600; }
.research-evidence article { border-bottom: 1px solid var(--line); padding: 8px 0; }
.research-evidence article:last-child { border-bottom: 0; }
.research-evidence blockquote { margin: 10px 0; padding-left: 14px; border-left: 2px solid var(--line); color: var(--muted); }
@media (max-width: 700px) { .research-start { grid-template-columns: minmax(0, 1fr); padding: 16px; } .research-start > button { justify-self: start; } .research-progress { padding: 16px; } }

/* Benchmark (Stenson AI Injury Benchmark) */
.bm-board { margin: 8px 0 24px; display: grid; gap: 12px; }
.bm-table { display: table !important; width: 100%; }
.bm-table th[scope=row] { text-align: left; font-weight: 600; }
.bm-table td, .bm-table th { white-space: nowrap; }
.bm-progress { display: grid; gap: 8px; background: var(--paper); border: 1px solid var(--control-border); border-radius: 14px; padding: 14px 16px; }
.bm-meter { height: 8px; border-radius: 99px; background: var(--control-surface); overflow: hidden; }
.bm-meter span { display: block; height: 100%; background: var(--purple); border-radius: 99px; }
.bm-q { font-family: var(--font-display, inherit); font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; margin: 4px 0 8px; overflow-wrap: anywhere; }
.bm-key { background: var(--lilac); border-radius: 16px; padding: 16px 20px; margin: 16px 0 24px; overflow-wrap: anywhere; }
.bm-key h2 { font-size: 1rem; margin: 6px 0; }
.bm-key ul { margin: 0 0 8px; padding-left: 20px; }
.bm-flag { margin: 8px 0 0; }
.bm-tool { background: var(--paper); border: 1px solid var(--control-border); border-radius: 16px; padding: 16px 20px; margin: 0 0 16px; overflow-wrap: anywhere; min-width: 0; }
.bm-tool-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bm-tool-head h2 { margin: 0; font-size: 1.25rem; }
.bm-total { flex: none; font-weight: 700; border-radius: 10px; padding: 4px 10px; background: var(--control-surface); }
.bm-total.ok { background: var(--green); color: var(--ok-ink); }
.bm-total.hot { background: var(--butter); color: var(--warn-ink); }
.bm-total.bad { background: #fbe9e5; color: var(--danger); }
.bm-badges { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 8px 0; font-size: .9375rem; }
.bm-badges > span { display: inline-flex; align-items: center; gap: 6px; }
.bm-note { margin: 8px 0; }
.bm-sub ul { margin: 4px 0 8px; padding-left: 20px; }
.bm-answer { margin: 8px 0; }
.bm-answer summary { cursor: pointer; font-weight: 600; color: var(--purple); min-height: 44px; display: flex; align-items: center; }
.bm-answer-text { white-space: pre-wrap; background: var(--cream); border-radius: 12px; padding: 12px 14px; max-height: 60vh; overflow: auto; font-size: .9375rem; line-height: 1.55; }
.bm-review { border-top: 1px solid var(--control-border); margin-top: 12px; padding-top: 12px; display: grid; gap: 8px; }
.bm-review-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.bm-verdict { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bm-verdict.agree { color: var(--ok-ink); }
.bm-verdict.disagree { color: var(--warn-ink); }
.bm-disagree { display: grid; gap: 8px; }
.bm-disagree textarea { width: 100%; }
.bm-pager { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
@media (max-width: 900px) { .bm-tool, .bm-key { padding: 14px; } .bm-table { font-size: .875rem; display: table !important; width: 100%; } .bm-table th:nth-child(3), .bm-table td:nth-child(3), .bm-table th:nth-child(4), .bm-table td:nth-child(4) { display: none; } .bm-table td, .bm-table th { white-space: normal; } }
.for-bots { margin: 16px 0; border: 1px solid var(--control-border); border-radius: 14px; padding: 4px 16px; background: var(--paper); }
.for-bots > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--muted); }
.home-new { background: var(--paper); border: 1px solid var(--control-border); border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; }
.home-new h2 { font-size: 1rem; margin: 0 0 6px; }
.home-new ul { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 4px; }

/* Docs: contents list, found text, approval; tables read as cards on phones */
.view table.grid th, .view table.grid td { text-align: left; vertical-align: top; }
.doc-toc { background: var(--paper); border: 1px solid var(--control-border); border-radius: 14px; padding: 6px 16px; margin: 0 0 20px; }
.doc-toc > summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.doc-toc ol { margin: 0 0 10px; padding-left: 22px; columns: 2; column-gap: 28px; }
.doc-toc li { break-inside: avoid; margin: 2px 0; }
.found { background: var(--butter); border-radius: 6px; }
.doc-approve { border-top: 1px solid var(--control-border); margin-top: 28px; padding-top: 16px; display: grid; gap: 12px; }
.head-acts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 700px) {
  .doc-toc ol { columns: 1; }
  .doc-body table.grid, .doc-body table.grid tbody, .doc-body table.grid tr, .doc-body table.grid td { display: block; width: 100%; }
  .doc-body table.grid { overflow: visible; }
  .doc-body table.grid thead { display: none; }
  .doc-body table.grid tr { border: 1px solid var(--control-border); border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; background: var(--paper); }
  .doc-body table.grid td { border: 0; padding: 3px 0; }
  .doc-body table.grid td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
}
.doc-body h2, .doc-body h3 { scroll-margin-top: 80px; }
.bm-who { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: .9375rem; color: var(--muted); }

/* Ask Claude: Send sits inside the box; the model picker has room */
.cp-form { position: relative; display: block; }
.cp-form textarea { width: 100%; padding-right: 52px; }
#claude-panel .cp-form .cp-send { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--purple) !important; color: #fff !important; display: grid; place-items: center; cursor: pointer; padding: 0; min-height: 0; }
#claude-panel .cp-form .cp-send::before { content: ""; position: absolute; inset: -4px; }
#claude-panel .cp-form .cp-send:hover { filter: brightness(.92); }
.cp-head { flex-wrap: wrap; }
.cp-head > span { flex: 1 1 160px; justify-content: flex-end; min-width: 0; }
.cp-head .ph-select, .cp-head select { min-width: 150px; }
.merge-row .ph-button { white-space: nowrap; }
@media (max-width: 700px) { .merge-row { grid-template-columns: minmax(0, 1fr) auto !important; } .merge-row .small.muted { display: none; } }

/* Copy table on a phone: an earlier rule already makes the toolbar a two-column grid.
   Here: Projects sits beside Table/Pages, the column picker gets a full row so its label fits. */
@media (max-width: 700px) {
  .desk-ws .ph-workshop-toolbar .ws-title h1 { max-width: none; white-space: normal; overflow: visible; }
  .desk-ws .ws-tools > .ph-segment { grid-column: auto; }
  .desk-ws .ws-tools > .ph-segment button { flex: 1; }
  .desk-ws .ws-tools > [data-pickproj] { width: 100%; justify-content: center; }
  .desk-ws .ws-tools select[data-view] + .kit-select { grid-column: 1 / -1; }
  .desk-ws .ws-tools .kit-select { width: 100%; }
  .desk-ws .ws-tools .kit-select .ph-select-trigger { width: 100%; justify-content: space-between; }
}

/* House rule: no border, outline or ring on an active field. Focus is a soft fill. */
.photos-ui input:not([type=checkbox]):not([type=radio]):focus, .photos-ui input:not([type=checkbox]):not([type=radio]):focus-visible, .photos-ui textarea:focus, .photos-ui textarea:focus-visible, .photos-ui .pad-text:focus { outline: none !important; box-shadow: none !important; background-color: var(--purple-soft); }
.photos-ui .cv-search-box input:focus, .photos-ui .nav-search input:focus { background-color: transparent; }
.photos-ui .nav-search:focus-within { background: var(--purple-soft); outline: none; }

/* ── Detail pages: one calm pattern (Nov 13) ─────────────────────────
   Title, then ONE quiet line (status tag · who and when · projects), the content, and topics at the foot. */
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -6px 0 22px; font-size: .9375rem; color: var(--muted); min-width: 0; }
.meta-row > * { min-width: 0; }
.meta-row form { display: contents; }
.in-projects { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .9375rem; color: var(--muted); }
.in-projects .ico { flex: none; opacity: .7; }
.in-projects .ip-list { color: var(--muted); }
.in-projects .ip-add { padding: 2px 6px; margin-left: 2px; font-size: .875rem; }
.page-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--control-border); display: grid; gap: 8px; font-size: .9375rem; }
.page-foot p { margin: 0; }
.topics a, .links a { white-space: nowrap; }
.links { line-height: 1.9; }
.view > .meta-row + .in-projects, .view .in-projects + .meta-row { margin-top: 0; }

/* Status tag: a small colored pill that opens the menu. The tap area stays 44px. */
.kit-select.chip-select { display: inline-block; width: auto; min-width: 0; vertical-align: middle; }
.photos-ui .kit-select.chip-select .ph-select-trigger { position: relative; width: auto; min-height: 28px; padding: 3px 6px 3px 10px; gap: 2px; border: 0; border-radius: 8px; font-size: .875rem; font-weight: 600; line-height: 1.4; background: var(--control-surface); color: var(--muted); }
.photos-ui .kit-select.chip-select .ph-select-trigger::after { content: ""; position: absolute; inset: -8px -4px; }
.photos-ui .kit-select.chip-select .ph-select-trigger svg { width: 14px; height: 14px; opacity: .7; }
.photos-ui .kit-select.chip-select .ph-select-trigger:hover { filter: brightness(.96); }
.photos-ui .kit-select.chip-select:is([data-tone="new"], [data-tone="sent"], [data-tone="open"], [data-tone="received"]) .ph-select-trigger { background: var(--blue); color: var(--info-ink); }
.photos-ui .kit-select.chip-select:is([data-tone="hot"], [data-tone="blocked"], [data-tone="to verify"]) .ph-select-trigger { background: var(--butter); color: var(--warn-ink); }
.photos-ui .kit-select.chip-select:is([data-tone="published"], [data-tone="done"], [data-tone="checked"], [data-tone="active"]) .ph-select-trigger { background: var(--green); color: var(--ok-ink); }
.photos-ui .kit-select.chip-select:is([data-tone="in progress"], [data-tone="writing"], [data-tone="researching"], [data-tone="returned"], [data-tone="memo"], [data-tone="idea"]) .ph-select-trigger { background: var(--lilac); color: var(--lilac-ink); }
.photos-ui .kit-select.chip-select[data-tone="dropped"] .ph-select-trigger { background: var(--control-surface); color: var(--muted); text-decoration: line-through; }
.cv-meta .kit-select.chip-select { margin-right: 8px; }
.cv-main .cv-meta { font-size: .9375rem; }

.cv-card.no-tile { grid-template-columns: minmax(0, 1fr) auto; }
.cmeta { gap: 4px 10px; }
.cmeta .cmeta-end { margin-left: auto; }
.cmeta .linkbtn { padding: 2px 4px; font-size: .875rem; }
.photos-ui .kit-select.chip-select, .cv-meta .kit-select.chip-select, .cmeta .kit-select.chip-select { display: inline-grid !important; width: auto !important; max-width: 100%; justify-self: start; }
.photos-ui .kit-select.chip-select .ph-select-trigger { display: inline-flex; }

/* ── Clean-up pass 2 (Nov 13): plain, calm, nothing said twice ───────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The one quiet line flows like a sentence, so it wraps cleanly on a phone (no staircase). */
.meta-row { display: block; line-height: 2.1; margin: -4px 0 20px; }
.meta-row > * { display: inline; margin-right: 14px; vertical-align: middle; }
.meta-row > *:last-child { margin-right: 0; }
.meta-row > [hidden] { display: none !important; }
.meta-row > form { display: inline; }
.meta-row > .kit-select.chip-select, .meta-row form > .kit-select.chip-select, .meta-row label > .kit-select.chip-select { display: inline-grid !important; }
.meta-row .linkbtn { padding: 2px 4px; font-size: .9375rem; }
.in-projects { display: inline; white-space: normal; }
.in-projects .ico { display: inline-block; vertical-align: -3px; margin-right: 6px; }
.in-projects .ip-add { margin-left: 8px; }
.bm-who { display: inline; margin: 0; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; }

/* Home: what needs you, what's new */
.home-box { background: var(--paper); border: 1px solid var(--control-border); border-radius: 18px; padding: 18px 22px; margin: 0 0 16px; }
.home-box h2 { font-size: 1.125rem; margin: 0 0 8px; }
.home-h { margin: 28px 0 12px; }
.hneeds, .news { list-style: none; margin: 0; padding: 0; }
.hneed { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 10px 0; border-top: 1px solid var(--line, #eee4d6); }
.hneed:first-child { border-top: 0; padding-top: 2px; }
.hneed:last-child { padding-bottom: 2px; }
.hneed-text { min-width: 0; font-size: 1.0625rem; }
.hneed-acts { display: flex; gap: 8px; flex: none; }
.news li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 5px 0; }
.news .when { color: var(--muted); font-size: .9375rem; }
.news-more { margin-top: 6px; }
.news-more > summary { cursor: pointer; color: var(--purple); min-height: 36px; display: inline-flex; align-items: center; list-style: none; }
.news-more > summary::-webkit-details-marker { display: none; }
.news-more[open] > summary { display: none; }
@media (max-width: 700px) { .hneed { flex-wrap: wrap; } .news li { grid-template-columns: 1fr; gap: 0; } .home-box { padding: 16px; } }

/* Status tags: more values, and a small plain menu (no title bar, no footer, no outlines) */
.photos-ui .kit-select.chip-select:is([data-tone="1"]) .ph-select-trigger { background: var(--green); color: var(--ok-ink); }
.photos-ui .kit-select.chip-select:is([data-tone="-1"]) .ph-select-trigger { background: #fbe9e5; color: var(--danger); }
.photos-ui .kit-select.chip-select:is([data-tone="0"], [data-tone="John"], [data-tone="Scott"]) .ph-select-trigger { background: var(--control-surface); color: var(--ink); }
.photos-ui .kit-select.chip-select .ph-select-header, .photos-ui .kit-select.chip-select .ph-select-status, .photos-ui .kit-select.chip-select .ph-select-label { display: none; }
.photos-ui .kit-select.chip-select .ph-select-dialog { border-radius: 14px; min-width: 0; }
.photos-ui .kit-select.chip-select .ph-select-list { margin: 6px; padding: 0; max-height: none; overflow: visible; outline: none; border: 0; }
.photos-ui .kit-select.chip-select .ph-select-option { min-height: 40px; padding: 8px 12px; border: 0; }
.photos-ui .kit-select.chip-select .ph-select-option:focus-visible, .photos-ui .kit-select.chip-select .ph-select-list:focus-visible { outline: none; }
.judge { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }

/* Compact list view: one line per item, no button */
.cv-items.rows { display: grid; gap: 0; background: var(--paper); border: 1px solid var(--control-border); border-radius: 18px; padding: 4px 20px; }
.cv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 12px 0; border-top: 1px solid var(--line, #eee4d6); min-width: 0; }
.cv-items.rows > :first-child .cv-row, .cv-items.rows > .cv-row:first-child { border-top: 0; }
.cv-row-main { min-width: 0; display: grid; gap: 2px; }
.cv-row-title { font-weight: 600; font-size: 1.0625rem; color: var(--ink) !important; text-decoration: none !important; overflow-wrap: anywhere; }
a.cv-row-title:hover { color: var(--purple) !important; }
.cv-row-meta { color: var(--muted); font-size: .9375rem; }
.cv-row-meta .ico { display: inline-block; vertical-align: -3px; margin-right: 4px; }
.cv-row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.cv-row-side .ph-button { min-height: 36px; padding: 4px 12px; font-size: .9375rem; }
@media (max-width: 700px) { .cv-row { flex-wrap: wrap; } .cv-items.rows { padding: 2px 14px; } }

/* Folding boxes with our own arrow (never the browser's triangle) */
details.foldbox > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-height: 28px; }
details.foldbox > summary::-webkit-details-marker { display: none; }
details.foldbox > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; align-self: center; transition: transform 160ms; }
details.foldbox[open] > summary::before { transform: rotate(45deg); }
details.foldbox[open] > summary { margin-bottom: 12px; }
.bm-more > summary { cursor: pointer; color: var(--purple); font-size: .9375rem; min-height: 36px; display: inline-flex; align-items: center; }
.msg-text { overflow-wrap: anywhere; }

/* Notes button: reads as a button, with an arrow that turns */
.nb-toggle { background: var(--control-surface); padding: 0 12px 0 8px; margin-left: 0; color: var(--ink); }
.nb-toggle .nb-caret { transition: transform 160ms; opacity: .6; }
.nb-toggle[aria-expanded="true"] .nb-caret { transform: rotate(90deg); }
@media (hover: hover) { .pfield .nb:not(:has(.nb-count)) .nb-toggle { background: transparent; } }

/* Board cards: the question is the title */
.tcard-title { margin: 0 0 6px; font-size: 1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kanban .kcol { min-width: 0; }
.psec-peek { flex: 1 1 auto; }

.in-projects { white-space: nowrap; }
.in-projects .ip-list { white-space: normal; }
.cv-meta .pill { margin-right: 6px; }

/* ── Lists: one row of controls, compact rows by default (Nov 13) ───── */
.cv-head { margin-bottom: 20px; }
.cv-quicks { gap: 8px; margin: 0 0 16px; }
.cv-quick { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: .9375rem; }
.cv-tools { display: flex; align-items: center; gap: 8px; padding-bottom: 0; border-bottom: 0; margin: 0 0 8px; }
.cv-tools[hidden] { display: none; }
.cv-tools .cv-search { flex: 1 1 220px; display: block; min-width: 0; }
.cv-search-box { height: 44px; padding: 0 12px; }
.cv-tools .cv-filter-btn { min-height: 44px; flex: none; }
.cv-tools .cv-sort { flex: 0 0 auto; display: block; }
.cv-tools .cv-sort .ph-select-trigger { min-height: 44px; font-size: .9375rem; min-width: 170px; }
.cv-tools .cv-views { flex: none; }
.cv-views button { min-width: 40px; min-height: 36px; }
.cv-count { margin: 4px 0 12px; color: var(--muted); font-size: .9375rem; }
.cv-count b { color: var(--ink); }
.cv-row:hover .cv-row-title { color: var(--purple) !important; }
@media (max-width: 700px) {
  .cv-quicks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .cv-quicks::-webkit-scrollbar { display: none; }
  .cv-quick { flex: none; white-space: nowrap; }
  .cv-tools { flex-wrap: wrap; }
  .cv-tools .cv-search { flex: 1 1 100%; }
  .cv-tools .cv-sort { flex: 1 1 0; }
  .cv-tools .cv-sort .ph-select-trigger { min-width: 0; width: 100%; }
}

/* A small "more" menu on cards */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); position: relative; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary::after { content: ""; position: absolute; inset: -6px; }
.more-menu > summary:hover, .more-menu[open] > summary { background: var(--control-surface); color: var(--ink); }
.more-pop { position: absolute; right: 0; top: 36px; z-index: 5; display: grid; gap: 2px; min-width: 170px; padding: 6px; background: var(--paper); border: 1px solid var(--control-border); border-radius: 12px; box-shadow: 0 12px 28px -14px #58432766; }
.more-pop .linkbtn { justify-content: flex-start; text-align: left; padding: 8px 10px; font-size: .9375rem; width: 100%; }

/* Folding boxes are plain blocks (a card's grid squeezed their contents) */
details.card.foldbox { display: block; }
details.card.foldbox > .rows, details.card.foldbox > .cols { margin-top: 4px; }
/* Assignments board: five columns always fit the page */
.kanban { grid-template-columns: repeat(5, minmax(0, 1fr)); overflow-x: visible; gap: 10px; }
.kcol h2 { font-size: .9375rem; }
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(5, 240px); overflow-x: auto; } }
/* Copy table: two tidy rows. Row 1: stages and title. Row 2: every control on one line. */
@media (min-width: 701px) {
  #copy-ws .ph-workshop-toolbar { flex-wrap: wrap; gap: 8px 12px; height: auto; padding-top: 10px; padding-bottom: 10px; }
  #copy-ws .ph-workshop-toolbar > [data-pane="right"] { display: none; }
  #copy-ws .ph-workshop-toolbar .ws-title { flex: 1 1 auto; }
  #copy-ws .ph-workshop-toolbar .ws-title h1 { max-width: none; }
  #copy-ws .ws-tools { flex: 1 1 100%; order: 5; flex-wrap: nowrap; }
  #copy-ws .ws-tools input[type=search] { flex: 1 1 auto; width: auto; min-width: 140px; }
  #copy-ws .ws-tools select[data-view] + .kit-select { width: 250px; flex: none; }
  #copy-ws .ws-tools .kit-select { width: 150px; flex: none; }
}
@media (max-width: 700px) { .cv-tools .cv-views { display: none; } .cv-tools .cv-sort { flex: 1 1 0; min-width: 0; } .cv-tools .cv-sort .kit-select { width: 100%; } }

/* ── Stress test 04 fixes (Nov 13) ─────────────────────────────────── */
/* Dialogs never run off the screen: the middle scrolls, the buttons stay in view */
.photos-ui .ph-dialog { max-height: calc(100dvh - 32px); }
.photos-ui .ph-dialog .dlg-form { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 34px); }
.photos-ui .ph-dialog .ph-dialog-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; }
/* One menu style everywhere: no title bar, no "N options" line, no outlines */
.photos-ui .kit-select.compact .ph-select-header, .photos-ui .kit-select.compact .ph-select-status { display: none; }
.photos-ui .kit-select.compact .ph-select-list { outline: none; margin: 6px; padding: 0; }
.photos-ui .kit-select.compact .ph-select-option { border: 0; }
.photos-ui .kit-select .ph-select-list:focus-visible, .photos-ui .kit-select .ph-select-option:focus-visible { outline: none; }
.photos-ui .kit-select.chip-select .ph-select-list { max-height: min(70dvh, 420px); overflow-y: auto; }
/* The row of controls above a list: everything 44px tall */
.cv-tools .cv-filter-btn { height: 44px; min-height: 44px; padding: 0 14px; }
.cv-tools .cv-views { height: 44px; padding: 4px; box-sizing: border-box; }
.cv-tools .cv-views button { min-height: 0; height: 36px; }
/* Rows: the whole row opens it */
.cv-row { cursor: pointer; }
.cv-row .kit-select, .cv-row button { cursor: auto; }
.cv-row:hover { background: color-mix(in srgb, var(--purple-soft) 35%, transparent); margin: 0 -12px; padding-left: 12px; padding-right: 12px; border-radius: 10px; }
/* Detail pages share one rhythm: title, 10px, the quiet line, 20px, content */
.view:not(.wide) .page-head { margin-bottom: 0; }
.view:not(.wide) .page-head h1, .view:not(.wide) > h1 { margin-bottom: 0; }
.meta-row { margin: 10px 0 20px; line-height: 1.9; }
.pill, .photos-ui .kit-select.chip-select .ph-select-trigger { min-height: 26px; box-sizing: border-box; }
.bm-q { margin-bottom: 0; }
/* Benchmark: what John has to decide, up front */
.bm-call { background: var(--butter); border-radius: 16px; padding: 14px 20px; margin: 0 0 16px; }
.bm-call h2 { font-size: 1rem; margin: 0 0 6px; }
.bm-call ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.bm-verdict .linkbtn { padding: 2px 6px; font-size: .875rem; }
.dots-key { white-space: nowrap; }
/* Only wide tables turn into cards on a phone; small ones stay tables */
@media (max-width: 700px) {
  .doc-body table.grid:not(.wide), .doc-body table.grid:not(.wide) tbody, .doc-body table.grid:not(.wide) thead { display: table; width: 100%; }
  .doc-body table.grid:not(.wide) thead { display: table-header-group; }
  .doc-body table.grid:not(.wide) tbody { display: table-row-group; }
  .doc-body table.grid:not(.wide) tr { display: table-row; border: 0; padding: 0; margin: 0; background: none; }
  .doc-body table.grid:not(.wide) td, .doc-body table.grid:not(.wide) th { display: table-cell; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line, #eee4d6); }
  .doc-body table.grid:not(.wide) td::before { content: none !important; }
  .bm-answer-text { max-height: none; }
  .meta-row .in-projects { display: block; margin: 0; white-space: normal; }
  .hneed-acts { width: 100%; }
}
/* Copy toolbar wraps when it has to (1100 wide), never under the sidebar */
@media (min-width: 701px) { #copy-ws .ws-tools { flex-wrap: wrap; } }
@media (max-width: 700px) { .doc-body table.grid:not(.wide) { table-layout: fixed; font-size: .9375rem; } .doc-body table.grid:not(.wide) th:first-child, .doc-body table.grid:not(.wide) td:first-child { width: 32%; } .doc-body table.grid:not(.wide) th:nth-child(2):not(:last-child), .doc-body table.grid:not(.wide) td:nth-child(2):not(:last-child) { width: 20%; } }

/* ── Content and Copy as normal pages (Nov 13): same header, one row of controls, rows in a paper list ── */
.content-page .pad-box { padding: 16px 20px; }
.content-page .pad-box h2 { margin: 0 0 8px; }
.content-page .pad { gap: 10px; }
.content-page .pad-head { display: none; }
.photos-ui .content-page .pad-text { min-height: 76px; height: 76px; font-size: 1rem !important; }
.content-page .cv-tools { margin-top: 24px; }
.content-page .theme { scroll-margin-top: calc(var(--topbar-h, 0px) + 12px); }
.content-page .theme-head { margin-top: 28px; flex-wrap: nowrap; }
.content-page .theme-head h2 { font-size: 1.25rem; min-width: 0; }
.content-page .theme-head .nb { flex: none; }
.content-page .cgrid { display: block; margin: 10px 0 10px; background: var(--paper); border: 1px solid var(--control-border); border-radius: 16px; }
.content-page .cgrid:empty { display: none; }
.content-page .ccard { background: none; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: center; }
.content-page .ccard:first-child { border-radius: 15px 15px 0 0; } .content-page .ccard:last-child { border-bottom: 0; border-radius: 0 0 15px 15px; } .content-page .ccard:only-child { border-radius: 15px; }
.content-page .ccard:hover { background: var(--cream); }
.content-page .ccard[aria-selected="true"] { border-color: var(--line); box-shadow: none; background: var(--purple-soft); }
.content-page .ccard .chead { grid-column: 1; font-size: 1rem; align-items: baseline; min-width: 0; }
.content-page .ccard .chead b { font-weight: 600; min-width: 0; }
.content-page .ccard .sub { grid-column: 1; padding-left: 24px; font-size: .9375rem; }
.content-page .ccard .sub:empty:not(:focus) { display: none; }
.content-page .ccard:hover .sub:empty[contenteditable="true"], .content-page .ccard .sub:empty:focus { display: block; }
.content-page .ccard .handle + .ready ~ b { }
.content-page .ccard .cmeta { grid-column: 2; grid-row: 1 / span 2; flex-wrap: nowrap; gap: 4px; align-self: start; }
.content-page .ccard .cproj, .content-page .ccard > .nb { grid-column: 1 / -1; padding-left: 24px; }
.content-page .ccard .cproj { display: flex; align-items: center; gap: 6px; }
.content-page .ccard > .nb .nb-toggle { min-height: 28px; padding: 0 6px; margin-left: -6px; font-size: .875rem; color: var(--muted); background: none; border: 0; }
.content-page .ccard > .nb:not(:has(.nb-toggle[aria-expanded="true"])):not(:has(.nb-count)) { display: none; }
.content-page .ccard:hover > .nb, .content-page .ccard:focus-within > .nb { display: block !important; }
.content-page .addpiece { margin: 0; }
.content-page .handle { visibility: hidden; }
.content-page .ccard:hover .handle, .content-page .ccard:focus-within .handle { visibility: visible; }
@media (hover: none) { .content-page .handle { visibility: visible; } .content-page .ccard > .nb { display: block !important; } .content-page .ccard .sub:empty[contenteditable="true"] { display: none; } }
@media (max-width: 700px) {
  .content-page .ccard { padding: 12px; gap: 2px 8px; }
  .content-page .cv-tools .cv-sort { flex: 1 1 0; min-width: 0; }
}

.copy-page { transition: padding-right .18s ease; }
.copy-page .page-head h1 { font-family: var(--font-display); font-weight: 700; }
.copy-page details.foldbox { margin: 0 0 16px; }
.copy-page details.foldbox summary .muted { font-weight: 400; margin-left: 6px; }
.copy-page .cv-quicks { margin: 0 0 12px; }
.copy-page .cv-tools.ws-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.copy-page .ws-tools input[type=search] { flex: 1 1 200px; min-width: 160px; max-width: 320px; min-height: 44px; }
.copy-page .ws-tools .kit-select { flex: none; }
.copy-page .ws-tools .ph-select-trigger { min-height: 44px; font-size: .9375rem; }
.copy-page .ws-tools .ph-segment { flex: none; height: 44px; padding: 4px; box-sizing: border-box; }
.copy-page .ws-tools .ph-segment button { min-height: 0; height: 36px; padding: 0 14px; }
.copy-page .aiform { border: 1px solid var(--control-border); border-radius: 14px; margin: 0 0 16px; }
.copy-page .copy-status:empty { display: none; min-height: 0; }
.copy-page .pgroup { scroll-margin-top: calc(var(--topbar-h, 0px) + 12px); }
.copy-page .pgroup h2 { font-size: 1.25rem; }
.photos-ui dialog.side-sheet { width: min(440px, 100vw); max-width: 100vw; }
.photos-ui dialog.side-sheet:not(:modal) { position: fixed; inset: var(--topbar-h, 0px) 0 0 auto; margin: 0; height: auto; max-height: none; border-radius: 0; border: 0; border-left: 1px solid var(--control-border); box-shadow: -12px 0 32px #30284014; z-index: 20; }
.photos-ui dialog.side-sheet:modal { width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; border: 0; }
.photos-ui dialog.side-sheet header { padding: 14px 20px 6px; }
.photos-ui dialog.side-sheet header h2 { font-size: 1rem; color: var(--muted); font-weight: 600; }
.photos-ui dialog.side-sheet .ph-dialog-body { padding: 4px 20px 32px; }
@media (min-width: 1100px) { .copy-page.sheet-open { padding-right: 448px; } }
@media (prefers-reduced-motion: reduce) { .copy-page { transition: none; } }
@media (max-width: 700px) {
  .copy-page .cv-tools.ws-tools { display: grid; grid-template-columns: 1fr 1fr; }
  .copy-page .ws-tools .ph-segment, .copy-page .ws-tools input[type=search] { grid-column: 1 / -1; max-width: none; width: 100%; }
  .copy-page .ws-tools .ph-segment button { flex: 1; }
  .copy-page .ws-tools .kit-select, .copy-page .ws-tools .kit-select .ph-select-trigger { width: 100%; }
  .copy-page .ws-tools select[data-view] + .kit-select { grid-column: 1 / -1; }
}
.content-page .ccard[hidden], .content-page section.theme[hidden] { display: none !important; }

.content-page .ccard { position: relative; }
.content-page .ccard .handle { position: absolute; left: 3px; top: 13px; width: 12px; }
.content-page .theme-proj { margin: 2px 0 0 40px; }
.content-page .theme.folded .theme-proj { display: none; }

.tidy-line { margin: -4px 0 16px; color: var(--muted); font-size: .9375rem; }
.tidy-line .linkbtn { font-size: .9375rem; padding: 2px 4px; }
.dupe-list { display: grid; }
.dupe-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dupe-row:last-child { border-bottom: 0; }
.dupe-row > div { min-width: 0; }
.dupe-acts { display: flex; align-items: center; gap: 4px; flex: none; }
@media (max-width: 700px) { .dupe-row { flex-wrap: wrap; } .dupe-acts { margin-left: auto; } }

.cp-blocked { margin: 10px 0 0; color: var(--muted); }
/* Project cards: the same height in every row, the button always at the bottom */
.cv-items.grid { grid-auto-rows: 1fr; }
.cv-items.grid .cv-card { grid-template-rows: auto auto 1fr auto; }
.cv-items.grid .cv-card > :last-child { align-self: end; }

/* ── Stress test 05 fixes (Nov 13) ─────────────────────────────────── */
/* Pop-up bar: readable on a phone, never a tower, swallows a late tap as it leaves */
#toast { max-width: min(560px, calc(100vw - 32px)); }
#toast .toast-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#toast.gone { opacity: 0; pointer-events: auto; }
#toast .toast-undo { min-height: 44px; flex: none; }
dialog > #toast { z-index: 5; bottom: 20px; }
@media (max-width: 700px) { #toast { left: 16px; right: 16px; width: auto; max-width: none; transform: translateY(24px); justify-content: space-between; } #toast.show, #toast.gone { transform: none; } }

/* Menus hang from what you pressed; no grey-out for a small menu; a menu of actions never lists its own name */
.photos-ui .kit-select .ph-select-dialog:not([data-sheet="true"])::backdrop { background: transparent; }
.photos-ui .kit-select .ph-select-dialog { overflow: hidden; }
.photos-ui .kit-select .ph-select-dialog .ph-select-list { min-height: 0; flex: 0 1 auto; overflow-y: auto; }
.photos-ui .kit-select.menu-select .ph-select-option[aria-disabled="true"] { display: none; }
.photos-ui .kit-select.menu-select .ph-select-indicator { display: none; }
@media (max-width: 700px) {
  .photos-ui .kit-select.chip-select .ph-select-dialog[data-sheet="true"] .ph-select-header { display: flex; }
  .photos-ui .kit-select.chip-select .ph-select-dialog[data-sheet="true"] .ph-select-header h2 { font-size: 1rem; }
}
.more-menu.up .more-pop { top: auto; bottom: 36px; }

/* One height for every control in a row */
.photos-ui .cv-tools .cv-filter-btn.ph-button, .photos-ui .cv-tools .ph-button { height: 44px; min-height: 44px; padding-top: 0; padding-bottom: 0; }
.photos-ui .cv-tools input[type=search] { min-height: 0; }
.photos-ui .cv-tools .cv-search-box { height: 44px; box-sizing: border-box; }
.photos-ui .cv-tools .ph-select-trigger { height: 44px; min-height: 44px; box-sizing: border-box; }

/* Content: steady rows. Notes and an empty subhead come from the row's menu, never from hover. */
.content-page .ccard > .nb, .content-page .ccard:hover > .nb, .content-page .ccard:focus-within > .nb { display: none !important; }
.content-page .ccard > .nb.show, .content-page .ccard > .nb:has(.nb-count), .content-page .ccard > .nb:has(.nb-toggle[aria-expanded="true"]) { display: block !important; }
.content-page .ccard .sub:empty, .content-page .ccard:hover .sub:empty[contenteditable="true"] { display: none; }
.content-page .ccard .sub.open, .content-page .ccard .sub:focus { display: block !important; }
.content-page .ccard .sub:empty::before { content: attr(data-ph); color: var(--muted); }
@media (hover: none) { .content-page .ccard > .nb { display: none !important; } }
.content-page .cv-head { margin-top: 8px; }
.content-page .cgrid { border-radius: 18px; }
.content-page .ccard { padding: 14px 20px; }
.content-page .ccard:first-child { border-radius: 17px 17px 0 0; } .content-page .ccard:last-child { border-radius: 0 0 17px 17px; } .content-page .ccard:only-child { border-radius: 17px; }
.content-page .ccard .chead { font-size: 1.0625rem; gap: 10px; align-items: center; }
.content-page .ccard .chead .ready { width: 14px; text-align: center; flex: none; line-height: 1; }
.content-page .ccard .sub, .content-page .ccard .cproj, .content-page .ccard > .nb { padding-left: 24px; }
.content-page .ccard .cmeta { align-self: center; grid-row: 1 / span 3; }
.content-page .ccard .ced[contenteditable="true"]:focus { background: var(--purple-soft); border-radius: 6px; box-shadow: 0 0 0 5px var(--purple-soft); outline: none; }
.content-page .ccard .handle { left: 5px; top: 17px; }
.content-page .cv-count { margin: 14px 0 0; }
.content-page .theme-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; }
.content-page .theme-head h2 { gap: 6px; }
.content-page .theme-head .nb { display: contents; }
.content-page .theme-head .nb-toggle { grid-column: 2; grid-row: 1; margin: 0; }
.content-page .theme-head .nb-body { grid-column: 1 / -1; margin: 8px 0 4px; }
.content-page .fold { width: 28px; height: 28px; flex: none; margin-left: -4px; }
.content-page .fold svg { transform: rotate(90deg); transition: transform 160ms; opacity: .7; }
.content-page .theme.folded .fold svg { transform: none; }
.content-page .theme-n { font: 500 .9375rem var(--font-body); color: var(--muted); margin-left: 4px; }
.content-page .theme-proj { margin: 0 0 0 30px; }
.content-page .addpiece { padding-left: 20px; }
.content-page.searching .addpiece, .content-page.searching .addtheme, .content-page.searching .theme-proj { display: none; }
.content-page .theme.searching.folded .cgrid { display: block; }
.photos-ui .kit-select.chip-select[data-tone="idea"] .ph-select-trigger { background: var(--control-surface); color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .content-page .fold svg { transition: none; } }
@media (max-width: 700px) {
  .content-page .ccard { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; gap: 6px; }
  .content-page .ccard .chead { order: 1; align-items: baseline; }
  .content-page .ccard .cmeta { order: 2; grid-column: 1; grid-row: auto; padding-left: 24px; justify-content: space-between; }
  .content-page .ccard .sub { order: 3; }
  .content-page .ccard .cproj { order: 4; }
  .content-page .ccard > .nb { order: 5; }
  .content-page .cv-tools { position: sticky; top: var(--topbar-h, 60px); z-index: 4; background: var(--cream); padding: 8px 0; margin-bottom: 0; }
  .photos-ui .content-page .pad-text { height: 96px; }
}

/* Copy table */
.copy-page .cv-tools.ws-tools { margin-top: 20px; }
.copy-page .cv-tools .cv-search { flex: 1 1 240px; min-width: 180px; }
.copy-page .ws-tools input[type=search] { max-width: none; min-width: 0; flex: 1; }
.copy-page.searching .addpain { display: none; }
.copy-page .prow:focus-visible { outline: none; background: var(--purple-soft); }
.copy-page .prow:focus:not(:focus-visible) { outline: none; }
.copy-page.sheet-open { padding-right: 0; }
@media (min-width: 1500px) { .copy-page.sheet-open { padding-right: 448px; } }
.insp-ask { display: grid; gap: 6px; margin: 4px 0 10px; }
.insp-ask .ph-segment { justify-self: start; }
.pdetail .note-row + .note-row, .pdetail .insp-ask + .note-row { margin-top: 8px; }
.insp-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.photos-ui dialog.side-sheet:not(:modal) { box-shadow: -16px 0 40px #30284022; }
@media (max-width: 1099px) { .photos-ui dialog.side-sheet:not(:modal) { width: 100vw; inset: var(--topbar-h, 0px) 0 0 0; } }
@media (max-width: 900px) { .photos-ui dialog.side-sheet:not(:modal) { bottom: 74px; } .photos-ui dialog.side-sheet .ph-dialog-body { padding-bottom: 96px; } }
@media (max-width: 700px) {
  .copy-page .cv-tools.ws-tools { grid-template-columns: 1fr 1fr; }
  .copy-page .cv-tools .cv-search { grid-column: 1 / -1; }
  .insp-ask .ph-segment button, .insp-nav .ph-button { min-height: 44px; }
  .insp-ask .ph-segment { justify-self: stretch; } .insp-ask .ph-segment button { flex: 1; }
}

/* Tidy-up list */
.dupe-all { margin: 12px 0 0; text-align: right; }
.dupe-acts .linkbtn { font-size: .9375rem; }
@media (max-width: 700px) { .dupe-acts .ph-button { min-height: 44px; padding: 0 18px; } }

/* John on a phone, and other small ones */
.doc-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 28px 0 0; }
#claude-panel .cp-head .kit-select { min-width: 150px; flex: none; }
@media (max-width: 700px) {
  .bm-review-acts { display: flex; gap: 8px; } .bm-review-acts .ph-button { flex: 1; min-height: 48px; }
  .bm-pager { display: flex; flex-wrap: nowrap; gap: 8px; justify-content: space-between; } .bm-pager .ph-button { padding: 0 12px; font-size: .9375rem; white-space: nowrap; }
  .ph-segment[data-judge] { display: grid; grid-template-columns: 1fr; width: 100%; } .ph-segment[data-judge] button { min-height: 44px; }
}

/* last touches */
.photos-ui .content-page .addpiece { padding-left: 44px !important; }
@media (max-width: 700px), (hover: none) { .content-page .ccard .handle { display: none; } }
@media (max-width: 700px) { .photos-ui .content-page .addpiece { padding-left: 38px !important; } .content-page .theme-head h2 { font-size: 1.125rem; align-items: baseline; } }
.more-pop .linkbtn { color: var(--ink); }
.more-pop .linkbtn.danger { color: var(--danger); }
.more-pop .linkbtn:hover { background: var(--cream); text-decoration: none; }

/* Copy row: "Rewrite" is a quiet word that shows when you're on the field (always on a touch screen) */
.insp-field .redo { width: auto; height: 28px; padding: 0 8px; border-radius: 8px; font-size: .8125rem; font-weight: 600; color: var(--purple); opacity: 0; transition: opacity 120ms; }
.insp-field:hover .redo, .insp-field:focus-within .redo, .insp-field .redo:focus-visible { opacity: 1; }
@media (hover: none) { .insp-field .redo { opacity: 1; height: 44px; margin: -8px 0; } }

/* ── Check round (stress test 06) ─────────────────────────────────── */
.fit-list { display: grid; }
.fit-row { display: grid; gap: 2px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; border-bottom: 1px solid var(--line); color: var(--ink) !important; text-decoration: none !important; }
.fit-row:last-child { border-bottom: 0; }
.fit-row:hover { background: var(--cream); }
/* the Copy row sheet never squeezes the page; its Previous / Next stay at the foot */
@media (min-width: 1500px) { .copy-page.sheet-open { padding-right: 0; } }
.photos-ui dialog.side-sheet .ph-dialog-body { padding-bottom: 0; }
.insp-nav { position: sticky; bottom: 0; background: var(--paper); margin: 20px -20px 0; padding: 12px 20px 14px; z-index: 2; }
.insp-nav .ph-button[disabled] { opacity: .4; pointer-events: none; }
.copy-page .prow:focus-visible { background: none; box-shadow: inset 3px 0 0 var(--purple); }
.copy-page .prow[aria-selected="true"]:focus-visible { background: var(--purple-soft); }
@media (max-width: 900px) { .photos-ui dialog.side-sheet .ph-dialog-body { padding-bottom: 0; } .photos-ui dialog.side-sheet:not(:modal) .insp-nav { bottom: 0; } }
/* Content */
.content-page .theme.searching .fold svg { transform: rotate(90deg); }
@media (max-width: 700px) {
  .content-page .theme { scroll-margin-top: calc(var(--topbar-h, 60px) + 132px); }
  .content-page .cv-tools { box-shadow: 0 -8px 0 var(--cream); }
}
.kanban-more { margin: 12px 0 0; }
/* Ask Claude: the title keeps its room; the chooser goes under it when the panel is narrow */
#claude-panel .cp-head > b { flex: none; white-space: nowrap; }
#claude-panel .cp-head > span { flex: 1 1 auto; }
/* phone bottom bar: every label on one line */
@media (max-width: 900px) { .mobile-nav > a, .mobile-nav > button { white-space: nowrap; font-size: .75rem; letter-spacing: -.005em; } }

/* ── Scott's Eye pass (Nov 13) ─────────────────────────────────────── */
/* Tiles carry a picture that means something: a bot's face, or the icon of the kind of thing. Never letter codes. */
.cv-tile { padding: 0; }
.cv-tile img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.cv-tile .ico { opacity: .8; }
.cv-items.grid .cv-tile:has(img) { width: 72px; height: 72px; border-radius: 18px; box-shadow: 0 6px 16px #3028401f; }
/* A status nobody has set yet rests quietly (no filled tag on every row); set ones keep their colour. */
.photos-ui .kit-select.chip-select:is([data-tone="0"], [data-tone="idea"]) .ph-select-trigger { background: transparent; color: var(--muted); font-weight: 500; padding-left: 4px; }
.photos-ui .kit-select.chip-select:is([data-tone="0"], [data-tone="idea"]) .ph-select-trigger:hover { background: var(--control-surface); color: var(--ink); filter: none; }
/* One fold arrow everywhere (never the browser's own triangle) */
details.for-bots > summary, details.research-evidence > summary, details.doc-toc > summary, details.news-more > summary, details.pad-hist > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.for-bots > summary::-webkit-details-marker, details.research-evidence > summary::-webkit-details-marker, details.doc-toc > summary::-webkit-details-marker, details.news-more > summary::-webkit-details-marker, details.pad-hist > summary::-webkit-details-marker { display: none; }
details.for-bots > summary::before, details.research-evidence > summary::before, details.doc-toc > summary::before, details.news-more > summary::before, details.pad-hist > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; transition: transform 160ms; }
details.for-bots[open] > summary::before, details.research-evidence[open] > summary::before, details.doc-toc[open] > summary::before, details.news-more[open] > summary::before, details.pad-hist[open] > summary::before { transform: rotate(45deg); }
/* Assignment page: the job reads as a short list */
.goal-text { margin: 0 0 12px; max-width: 760px; font-size: 1.0625rem; }
.goal-list { margin: 0 0 20px; padding-left: 22px; max-width: 760px; display: grid; gap: 8px; }
.goal-list li::marker { color: var(--muted); font-weight: 600; }
/* Search results read like every other list */
.sres .rows .row > a { color: var(--ink); font-weight: 600; text-decoration: none; }
.sres .rows .row > a:hover { color: var(--purple); }

.sres .cv-tools { max-width: 720px; margin: 0 0 12px; }
.sres .rows a { color: var(--ink); font-weight: 600; text-decoration: none; }
.sres .rows a:hover { color: var(--purple); }

/* A status that nearly every row shares rests as quiet text (assignments waiting for a bot) */
[data-cv="board"] .cv-row .pill.sent { background: none; padding: 0; color: var(--muted); font-weight: 500; }
[data-cv="board"] .cv-row .pill.sent::after { content: " ·"; }

/* ── Polish run 7 (Nov 14): phone first ────────────────────────────── */
/* Topics: on a phone each topic is a short row (name, count at the right, its dots with tiny labels). Nothing sideways. */
.feed-unit { display: none; }
@media (max-width: 700px) {
  .view table.grid.feeds { display: block; overflow: visible; background: none; border-radius: 0; }
  table.grid.feeds thead { display: none; }
  table.grid.feeds tbody { display: grid; gap: 8px; }
  table.grid.feeds tr { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 8px; padding: 12px 14px; background: var(--paper); border: 1px solid var(--control-border); border-radius: 14px; }
  .view table.grid.feeds td { display: block; border: 0; padding: 0; min-width: 0; }
  table.grid.feeds .feed-name { flex: 0 0 calc(100% - 84px); font-weight: 600; font-size: 1rem; }
  .view table.grid.feeds .feed-n { flex: 0 0 84px; order: 1; text-align: right; color: var(--muted); font-size: .875rem; white-space: nowrap; }
  table.grid.feeds .feed-dot { flex: 0 0 20%; order: 2; display: flex; align-items: center; gap: 5px; font-size: .75rem; line-height: 1; color: var(--muted); white-space: nowrap; }
  table.grid.feeds .feed-dot::after { content: attr(data-label); }
  table.grid.feeds .feed-dot span { font-size: .8125rem; line-height: 1; }
  .feed-unit { display: inline; }
}

/* Tap area, not size: on a phone or any touch screen, small controls keep their look and get an invisible 44px area. */
.photos-ui .kit-select.chip-select .ph-select-trigger { overflow: visible; }
@media (max-width: 900px), (hover: none) {
  .cv-quick, .fold, .nb-toggle, .photos-ui .ph-button.small, .linkbtn, .note-acts button, .ph-segment.small button, .topbar-brand,
  .bm-more > summary, .news-more > summary, details.foldbox > summary, .feed-more summary, .insp-field .redo, .tag, .themejump .chip { position: relative; }
  .cv-quick::after, .fold::after, .nb-toggle::after, .photos-ui .ph-button.small::after, .linkbtn::after, .note-acts button::after, .ph-segment.small button::after, .topbar-brand::after,
  .bm-more > summary::after, .news-more > summary::after, details.foldbox > summary::after, .feed-more summary::after, .insp-field .redo::after, .tag::after, .themejump .chip::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); }
  .photos-ui .kit-select.chip-select .ph-select-trigger::after { inset: -9px -4px; }
  .more-menu > summary::after { inset: -6px; }
}

/* Sheets on a phone: one pattern. A title that names the thing, a close ×, and room under the last row. */
@media (max-width: 700px) {
  .photos-ui .kit-select .ph-select-dialog[data-sheet="true"] .ph-select-header { display: flex; padding: 14px 12px 8px 20px; border-bottom: 0; }
  .photos-ui .kit-select .ph-select-dialog[data-sheet="true"] .ph-select-header h2 { font-size: 1rem; font-weight: 600; color: var(--muted); }
  .photos-ui .kit-select .ph-select-dialog[data-sheet="true"] .ph-select-header .ph-button { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 1.5rem; line-height: 1; color: var(--muted); }
  .photos-ui .kit-select .ph-select-dialog[data-sheet="true"] .ph-select-list { margin: 0 8px 16px; padding: 0; max-height: 62dvh; }
  .photos-ui .kit-select .ph-select-dialog[data-sheet="true"] .ph-select-option { min-height: 44px; padding: 10px 12px; }
  .photos-ui dialog.side-sheet .pdetail > :last-child:not(.insp-nav) { margin-bottom: 16px; }
}
/* A menu can carry small headings (the Copy table's one phone menu): they are labels, never choices. */
.photos-ui select[data-tools] + .kit-select.menu-select .ph-select-option[aria-disabled="true"]:not(:first-child) { display: flex; min-height: 0; padding: 14px 12px 4px; background: none; cursor: default; font-size: .8125rem; font-weight: 650; text-transform: uppercase; color: var(--muted); }

/* Copy table on a phone: ONE row above the table (search + Options). Everything else lives in that menu. */
.photos-ui .copy-page .ws-tools select[data-tools] + .kit-select { display: none; }
@media (max-width: 700px) {
  .copy-page .cv-tools.ws-tools[data-tab="table"] { display: flex; flex-wrap: nowrap; position: sticky; top: var(--topbar-h); z-index: 4; background: var(--cream); padding: 8px 0; margin: 12px 0 8px; }
  .copy-page .cv-tools.ws-tools[data-tab="table"] > .ph-segment, .photos-ui .copy-page .cv-tools.ws-tools[data-tab="table"] > .kit-select { display: none; }
  .photos-ui .copy-page .cv-tools.ws-tools[data-tab="table"] > select[data-tools] + .kit-select { display: grid; flex: none; width: auto; }
  .photos-ui .copy-page .cv-tools.ws-tools[data-tab="table"] > select[data-tools] + .kit-select .ph-select-trigger { width: auto; }
  .copy-page .cv-tools.ws-tools[data-tab="table"] .cv-search { flex: 1 1 0; min-width: 0; }
  .copy-page:has(.cv-tools[data-tab="table"]) > .cv-quicks { display: none; }
  .copy-page .pgroup { scroll-margin-top: calc(var(--topbar-h) + 68px); }
}

/* The top bar is 60px tall on a phone; everything pinned under it measures from that (no strip peeking through). */
@media (max-width: 900px) { :root { --topbar-h: 60px; } }
@media (max-width: 700px) {
  .content-page .cv-tools { box-shadow: none; }
  .content-page .theme { scroll-margin-top: calc(var(--topbar-h) + 124px); }
  .content-page .cv-tools .ph-select-trigger { padding-left: 10px; padding-right: 8px; gap: 6px; }
}
.photos-ui select[data-tools] + .kit-select.menu-select .ph-select-option[aria-disabled="true"] > :not(:first-child) { display: none; }
@media (max-width: 700px) { .pagecard .copy-head { flex-wrap: wrap; gap: 8px 12px; } .pagecard .copy-head h2 { flex: 1 1 100%; } .pagecard .head-acts { flex: 1 1 100%; } }
@media (max-width: 900px), (hover: none) {
  .row > a, .foot-row > a { position: relative; }
  .row > a::after, .foot-row > a::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: max(100%, 44px); transform: translateY(-50%); }
}
/* the quick-pick row scrolls sideways on a phone; give its 44px tap areas room so they are not clipped */
@media (max-width: 700px) { .cv-quicks { padding-top: 2px; padding-bottom: 2px; margin-top: -2px; margin-bottom: 14px; } }

/* Small alignment fixes */
/* Assignments shown as cards (a phone that last chose Board): the same gap as every other card list */
.cv-items.board:has(> .cv-card) { display: grid; gap: 18px; }
/* Copy row sheet: "Remove this row" and "Notes" start on the same left edge as the labels above */
.pdetail > p > .linkbtn { margin-left: -10px; }
.pdetail > .nb > .nb-toggle { margin-left: -8px; background: transparent; }
/* Benchmark question: one left edge inside each box; the two "What it…" lines are the same kind of thing */
.bm-verdict .linkbtn { margin-left: -6px; }
@media (max-width: 900px) { .bm-call { padding: 14px; } }
.bm-more > summary { list-style: none; gap: 8px; color: var(--ink); font-size: 1rem; font-weight: 700; }
.bm-answer > summary { list-style: none; gap: 8px; }
.bm-more > summary::-webkit-details-marker, .bm-answer > summary::-webkit-details-marker { display: none; }
.bm-more > summary::before, .bm-answer > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); flex: none; transition: transform 160ms; }
.bm-more[open] > summary::before, .bm-answer[open] > summary::before { transform: rotate(45deg); }
/* A link-button inside a sentence sits on the sentence's line (it no longer makes its line taller); its tap area is still 44px */
.tidy-line .linkbtn, .cv-count .linkbtn, .bm-verdict .linkbtn { display: inline-block; min-height: 0; line-height: inherit; vertical-align: baseline; }

/* ══ Round 2 (Nov 14): one look for every control row ═════════════════════════════════════════════
   Fields and dropdown buttons: no line, the soft fill the Filters button has, lilac fill on focus.
   One height (44) and one radius (12) for search, the pick, Filters, Sort and the view switch. */
.photos-ui .kit-select:not(.chip-select) .ph-select-trigger, .photos-ui .cv-tools .ph-select-trigger, .photos-ui .cv-sort .ph-select-trigger { border: 0; background: var(--control-surface); border-radius: var(--control-radius); transition: background 160ms ease; }
.photos-ui .kit-select:not(.chip-select) .ph-select-trigger:hover { background: var(--control-hover); }
.photos-ui .kit-select:not(.chip-select) .ph-select-trigger:focus-visible, .photos-ui .kit-select:not(.chip-select) .ph-select-trigger[aria-expanded="true"] { outline: none; background: var(--purple-soft); }
.photos-ui input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), .photos-ui textarea { border: 0; background-color: var(--control-surface); box-shadow: none; }
.photos-ui input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):focus, .photos-ui textarea:focus { background-color: var(--purple-soft); outline: none; }
.photos-ui .cv-search-box, .photos-ui .nav-search { border: 0; background: var(--control-surface); }
.photos-ui .cv-search-box:focus-within, .photos-ui .nav-search:focus-within { background: var(--purple-soft); }
.photos-ui .cv-search-box input, .photos-ui .nav-search input { background: transparent !important; }
.photos-ui .addpiece, .photos-ui .addtheme, .photos-ui .addpain { border: 0 !important; background: color-mix(in srgb, var(--control-surface) 60%, transparent) !important; color: var(--muted); }
.photos-ui .addpiece:hover, .photos-ui .addtheme:hover, .photos-ui .addpain:hover { background: var(--control-surface) !important; color: var(--ink); }
.photos-ui .ph-segment { border-color: transparent; }
.photos-ui .cv-tools .ph-segment.cv-views { border: 0; border-radius: var(--control-radius); background: var(--control-surface); }
.photos-ui .cv-tools .cv-views button { border-radius: 9px; }
.photos-ui .cv-tools .cv-filter-btn.is-on { background: var(--purple-soft); color: var(--purple); }

/* Keyboard focus on anything you press: a soft lilac fill, never an outline or ring. Still always visible. */
.photos-ui :is(button, a, summary, [role="button"], [tabindex]):focus-visible { outline: none; }
.photos-ui :is(button, summary, [role="button"], .ph-button, .linkbtn, .nav-item, .chip, .cv-quick):focus-visible { background-color: var(--purple-soft) !important; }
.photos-ui a:not(.ph-button):not(.nav-item):not(.linkbtn):focus-visible { background-color: var(--purple-soft); border-radius: 4px; }
.photos-ui .ph-button.primary:focus-visible, .photos-ui .ph-button.danger:focus-visible { background-color: var(--purple-deep, var(--purple)) !important; box-shadow: 0 0 0 5px var(--purple-soft); }
.photos-ui .ph-button.danger:focus-visible { background-color: var(--danger) !important; }
.photos-ui input:is([type=checkbox], [type=radio]):focus-visible { outline: none; box-shadow: 0 0 0 5px var(--purple-soft); }
.photos-ui .ph-select-option[data-active="true"] { border-color: transparent; background: var(--purple-soft); }
.photos-ui .ph-select-list:focus-visible { outline: none; }

/* One control row per list: [pick] [search] [Filters] [Sort] [view switch] */
.cv-tools { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.cv-tools .cv-pick { flex: 0 1 auto; min-width: 0; max-width: 260px; display: block; }
.photos-ui .cv-tools .cv-pick .kit-select, .photos-ui .cv-tools .cv-pick .ph-select-trigger { width: 100%; }
.photos-ui .cv-tools .cv-pick .ph-select-trigger { font-weight: 600; font-size: .9375rem; }
.photos-ui .cv-tools .ph-select-trigger > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cv-tools .cv-search { flex: 1 1 220px; min-width: 0; }
.cv-links { display: inline-flex; gap: 4px; flex: none; }
.cv-count { margin: 4px 0 12px; color: var(--muted); font-size: .9375rem; }
.cv-count[hidden] { display: none; }
.cv-fset .ph-check { min-height: 40px; }
.ph-dialog footer .cv-fnote { margin: 0 auto 0 0; align-self: center; color: var(--muted); font-size: .9375rem; }
/* When the list is narrow (a side panel open, a small laptop), search takes its own line and the rest sit under it. */
.cv { container: cv / inline-size; }
@container cv (max-width: 820px) {
  .cv-tools { flex-wrap: wrap; }
  .cv-tools .cv-search { order: -1; flex: 1 1 100%; }
  .cv-tools .cv-pick { flex: 0 1 auto; }
}
@media (max-width: 700px) {
  .cv-tools, .cv-tools.has-pick { flex-wrap: wrap; }
  .cv-tools .cv-search { order: -1; flex: 1 1 100%; }
  .cv-tools .cv-pick { flex: 1 1 0; max-width: none; }
  .cv-tools .cv-sort { flex: 1 1 0; min-width: 0; }
  .cv-tools.has-pick .cv-sort { flex: 1 1 0; }
  .photos-ui .cv-tools .ph-select-trigger { padding-left: 12px; padding-right: 8px; gap: 4px; }
  .cv-tools .cv-filter-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .photos-ui .cv-tools .cv-filter-btn { width: 44px; padding: 0 !important; flex: none; }
  .cv-links { flex: 1 1 100%; }
}

/* A row in its starting state shows no status: the tag fades in on hover or focus, in space that is always there.
   On touch it is always shown, quiet. */
.photos-ui .kit-select.chip-select.is-resting .ph-select-trigger { background: transparent; color: var(--muted); font-weight: 500; padding-left: 4px; }
@media (hover: hover) and (pointer: fine) {
  :is(.cv-card, .cv-row, .ccard) .kit-select.chip-select.is-resting { opacity: 0; transition: opacity 160ms ease; }
  :is(.cv-card, .cv-row, .ccard):is(:hover, :focus-within) .kit-select.chip-select.is-resting { opacity: 1; }
}
[data-cv="board"] :is(.cv-card, .cv-row) .pill.sent { display: none; }

/* The sidebar fits a 900-tall laptop; on a shorter screen its list scrolls with a soft fade at the foot. */
.sidebar-foot:empty { display: none; }
@media (min-width: 901px) and (pointer: fine) {
  .nav-search { margin: 18px 0 10px; }
  .nav-group { margin-bottom: 4px; }
  .nav-group-head { min-height: 30px; padding-top: 2px; padding-bottom: 2px; }
  .nav-item { min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
}
.sidebar nav.more-below { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }

/* The whole card opens: the title is a stretched link, with one small arrow by it. Controls on the card stay pressable. */
.cv-card.has-link { position: relative; transition: border-color 160ms ease, box-shadow 160ms ease; }
.cv-card.has-link:hover { border-color: #d9c8b1; box-shadow: 0 14px 28px -20px #58432760; }
.cv-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 0; }
.cv-card :is(.cv-acts, .cv-meta a, .cv-meta .kit-select, .cv-tags a, .cv-tags .kit-select, .cv-text a) { position: relative; z-index: 1; }
.cv-arrow { display: inline-flex; vertical-align: -2px; margin-left: 8px; color: var(--muted); transition: transform 160ms ease, color 160ms ease; }
.cv-card.has-link:hover .cv-arrow { color: var(--purple); transform: translateX(2px); }
.cv-card.has-link:hover .cv-main h3 a { color: var(--purple) !important; }
.photos-ui .cv-card-link:focus-visible { background: none; }
.cv-card.has-link:has(.cv-card-link:focus-visible) { background: color-mix(in srgb, var(--purple-soft) 55%, var(--paper)); }
/* Trash: Restore is a quiet text button at the end of the row */
.photos-ui .cv-acts [data-restore], .photos-ui .cv-row-side [data-restore] { position: relative; min-height: 36px !important; height: 36px; padding: 0 10px !important; background: transparent; color: var(--purple); font-weight: 550; font-size: .9375rem !important; }
.photos-ui .cv-acts [data-restore]:hover, .photos-ui .cv-row-side [data-restore]:hover { background: var(--purple-soft); }
.photos-ui .cv-acts [data-restore]::after, .photos-ui .cv-row-side [data-restore]::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }

/* One fold arrow everywhere: the Notes arrow (thin chevron, 14px), pointing right when shut, down when open. */
:root { --fold-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E"); }
:is(details.foldbox, details.for-bots, details.research-evidence, details.doc-toc, details.news-more, details.pad-hist, .bm-more, .bm-answer) > summary::before {
  content: ""; width: 14px; height: 14px; border: 0; background: var(--muted); opacity: .85; -webkit-mask: var(--fold-arrow) center / 14px no-repeat; mask: var(--fold-arrow) center / 14px no-repeat; transform: none; flex: none; align-self: center; transition: transform 160ms; }
:is(details.foldbox, details.for-bots, details.research-evidence, details.doc-toc, details.news-more, details.pad-hist, .bm-more, .bm-answer)[open] > summary::before { transform: rotate(90deg); }
.nb-toggle .nb-caret, .content-page .fold svg, .nav-group-head .ico { width: 14px; height: 14px; stroke-width: 2.2; color: var(--muted); opacity: .85; }
@media (prefers-reduced-motion: reduce) { :is(details, .bm-more, .bm-answer) > summary::before { transition: none; } }
/* Notes · 2: the count is quiet words after the label, not a badge */
.nb-count { display: inline; min-width: 0; height: auto; padding: 0; background: none; color: var(--muted); font-size: inherit; font-weight: 500; border-radius: 0; vertical-align: baseline; }
.nb-count::before { content: "· "; }

/* Bot desk · online: the lane switcher at the foot of the sidebar */
.lane-switch { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.lane-switch select { flex: 1; min-width: 0; }
