/* Prototype-only styles on top of the app's own tokens.css, bundle.css, app.css, glass.css and top-bar.css.
   The app is a single light look (brand cream and evergreen), so the page commits to it. */
:root { --font-bricolage: "Bricolage Grotesque"; --font-onest: "Onest"; color-scheme: light; }
html, body { height: 100%; }
body { background: var(--canvas); color: var(--ink); }

.px-search { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; width: clamp(200px, 30vw, 380px); color: var(--muted); }
.px-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); outline: none; }
.px-search:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }

/* A job page: back link, title, the one primary action, then the workbook's tabs and one table. */
.px-back { color: var(--muted); font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.px-back:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.px-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.px-head .yr { color: var(--muted); font-weight: 600; }

.px-tabs { display: flex; gap: 4px; padding: 5px; border-radius: var(--radius-control); overflow-x: auto; scrollbar-width: thin; }
.px-tabs button { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 400 14px/20px var(--font-sans); cursor: pointer; white-space: nowrap; }
.px-tabs button:hover { background: var(--row-hover); color: var(--ink); }
.px-tabs button[aria-selected="true"] { background: var(--glass-selected); color: var(--ink); font-weight: 500; box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(30,29,27,.08); }
.px-tabs .n { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

.px-sign { display: flex; align-items: center; gap: 8px 22px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; }
.px-sign b { color: var(--ink); font-weight: 500; }
.px-sign .wp-btn { margin-left: auto; }

.px-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.px-split.open { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 1180px) { .px-split.open { grid-template-columns: minmax(0, 1fr); } }
.px-scroll { overflow-x: auto; }
.px-table { min-width: 720px; }
.px-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-table td.note { color: var(--muted); min-width: 22ch; }
.px-table tbody tr.pick { cursor: pointer; }
.px-table tbody tr.pick:hover td { background: var(--row-hover); }
.px-table tbody tr.on td { background: var(--highlight); }
.px-table tr.group td { font-weight: 600; padding-top: 20px; }
.px-table tr.total td { font-weight: 600; }
.px-table tr.net td { font-weight: 600; font-size: 15.5px; border-top: 1.5px solid var(--ink); border-bottom: 0; }
.px-table tr.checks td { color: var(--muted); }
.px-table td.st-check { font-weight: 600; }
.px-table td.st-out, .px-table tr.out .num { color: var(--muted); }
.px-table tr:last-child td { border-bottom-color: transparent; }
.px-link { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }

/* Source: the pack page a row came from. Opens only when a row is picked. */
.px-src { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); position: sticky; top: 76px; }
.px-sheet { padding: 18px 14px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 2px; }
.px-sheet .t { font: 600 13px/20px var(--font-sans); padding: 0 10px 8px; }
.px-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Drop and reading */
.px-drop { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-card); padding: 64px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; background: var(--field-bg); }
.px-drop.over { border-color: var(--ink); background: var(--glass-selected); }
.px-drop p { max-width: 54ch; }
.px-reading { padding: 28px var(--space-5); display: flex; flex-direction: column; gap: 14px; }
.px-meter { height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; max-width: 520px; }
.px-meter i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .25s linear; }

textarea.px-area { height: auto; min-height: 44px; padding: 10px 12px; resize: vertical; line-height: 21px; }
.px-table textarea.px-area { min-width: 24ch; }

.px-dialog { border: 0; padding: 28px; width: 440px; max-width: calc(100vw - 32px); color: var(--ink); }
.px-dialog.wide { width: 720px; }
.px-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.px-file { background: var(--panel-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow-panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.px-lead { padding: 22px; border-radius: var(--radius-sm); overflow-x: auto; }
.px-lead .table { min-width: 420px; font-size: 13px; }

.px-note { color: var(--muted); max-width: 60ch; }
@media (max-width: 1000px) { .topbar .tb-centre { display: none; } }

/* Breadcrumb, the confirm step, late documents */
.px-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.px-confirm { display: flex; flex-direction: column; gap: 14px; max-width: 560px; padding: var(--space-5); }
.px-fields { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
.px-choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.px-choice label { display: flex; align-items: center; gap: 8px; }
.px-choice input { accent-color: var(--primary); width: 16px; height: 16px; }
.px-status { color: var(--ink-2); }
main .page { padding-bottom: 120px; }

/* The drop veil: shown while files are dragged over the app, and in the walkthrough */
.px-veil { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--scrim); }
.px-veil-card { padding: 32px; width: 520px; max-width: 100%; display: flex; flex-direction: column; gap: 16px; border: 1.5px dashed var(--ink-2); }
.px-veil-files { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--ink-2); font-size: 13px; }
.px-veil-files span { opacity: 0; animation: px-in .35s ease-out forwards; }
@keyframes px-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* The walkthrough: a pointer and one caption line */
.px-cursor { position: fixed; left: -11px; top: -11px; z-index: 60; width: 22px; height: 22px; border-radius: 50%; background: var(--highlight); border: 2px solid var(--primary); pointer-events: none; transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.px-cursor.press { background: var(--primary); }
.px-tour { position: fixed; z-index: 50; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); width: max-content; max-width: min(760px, calc(100vw - 32px)); padding: 12px 14px 12px 20px; display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; justify-content: center; }
.px-tour #tour-say { flex: 1 1 280px; min-width: 0; color: var(--ink); font-weight: 500; }
.px-tour[data-mode="idle"] { padding: 8px; }
.px-tour-btns { flex-wrap: nowrap; }
@media (prefers-reduced-motion: reduce) { .px-cursor { transition: none; } .px-veil-files span { animation: none; opacity: 1; } }

/* v4: today's Home, upload page and Clients, plus the new screens */
.px-yr { color: var(--muted); font-weight: 600; }
.px-tabs { overflow-x: auto; max-width: 100%; }
nav.px-tabs { display: flex; gap: 0; padding: 4px; }
.cl-meta .px-link { color: var(--ink); }
.px-pick { position: static; max-height: 220px; overflow-y: auto; }
.px-pick li { cursor: pointer; }
.px-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-5); align-items: start; }
@media (max-width: 1100px) { .px-two { grid-template-columns: minmax(0, 1fr); } }
.px-form { gap: 14px; padding: 20px; }
.px-form .hstack input { width: 16px; height: 16px; accent-color: var(--primary); }
.px-lh { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line-strong); }
.px-lh-logo { width: 36px; height: 36px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: inline-flex; align-items: center; justify-content: center; font: 600 17px var(--font-sans); flex: none; }
.cx.is-over { outline: 2px dashed var(--primary); outline-offset: 4px; }
.px-veil-card { text-align: left; }

/* A person: initials in a small circle, then the name */
.px-who { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; white-space: nowrap; }
.px-who .avatar { width: 22px; height: 22px; font-size: 10px; }
.px-who small { color: var(--muted); font-size: inherit; margin-left: 6px; }
.px-by { display: inline-flex; align-items: center; gap: 8px; }
.px-table td { vertical-align: middle; }
.px-table td.note, .px-table tr.group td { vertical-align: top; }
.px-table tbody tr:not(.group):not(.checks):not(.net):not(.total) td { padding-block: 11px; }
.cl-meta { align-items: center; }

/* Walkthrough v2: step arrows, and an outline that draws itself around what is about to be pressed */
.px-tour { max-width: min(900px, calc(100vw - 32px)); padding: 10px 12px; gap: 10px 14px; }
.px-tour #tour-say { flex: 1 1 300px; }
.px-arrow { padding: 0 8px; min-width: 34px; justify-content: center; }
.px-arrow[disabled] { opacity: .45; }
.px-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.px-ring { position: fixed; z-index: 58; pointer-events: none; overflow: visible; }
.px-ring rect { stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.px-ring.on rect { animation: px-draw .7s cubic-bezier(.5, 0, .2, 1) forwards; }
@keyframes px-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.px-ring.off { opacity: 0; transition: opacity .24s ease-out; }
@media (prefers-reduced-motion: reduce) { .px-ring.on rect { animation: none; stroke-dashoffset: 0; } }
/* The pack opened by the walkthrough sits under its controls instead of blocking them. */
dialog.px-dialog[open]:not(:modal) { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100vh - 140px); overflow-y: auto; z-index: 40; box-shadow: var(--shadow-dialog), 0 0 0 100vmax var(--scrim); }

.px-cursor { width: 16px; height: 16px; left: -8px; top: -8px; }

/* v7: add, edit and delete; the document itself in a wider side panel */
.px-split.open { grid-template-columns: minmax(0, 1fr) 440px; }
@media (max-width: 1280px) { .px-split.open { grid-template-columns: minmax(0, 1fr); } }
.px-src { top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; gap: 14px; }
.px-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; font-size: 13.5px; }
.px-tools .px-sign { margin: 0; }
.px-acts { white-space: nowrap; text-align: right; }
.px-acts .wp-btn + .wp-btn { margin-left: 4px; }
.px-del.armed { background: var(--danger-soft); color: var(--danger); }
.px-in { height: 36px; font-size: 14px; }
.px-in + .px-in { margin-top: 6px; }
.px-sel { width: auto; min-width: 150px; }
.px-in.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.px-editing td { background: var(--surface-sunk); vertical-align: top; }
.px-qs td:nth-child(2) { min-width: 28ch; }
.px-was { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.px-edit { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.px-fields2 { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; }
.px-danger { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.px-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.px-rowlink { cursor: pointer; }
.px-rowlink:hover, .dc-table tr.px-rowlink:hover td { background: var(--row-hover); }
.dc-table tr.sel td { background: var(--highlight); }

/* A page of the pack, drawn as the document */
.px-doc { padding: 20px 18px 14px; border-radius: 4px; display: flex; flex-direction: column; gap: 14px; font-size: 12.5px; line-height: 18px; color: var(--ink-2); }
.px-doc-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.px-doc-top b { display: block; font-size: 15px; color: var(--ink); }
.px-doc-kind { text-align: right; font-weight: 600; color: var(--ink); max-width: 46%; }
.px-doc-to { display: flex; justify-content: space-between; gap: 12px; }
.px-doc-to span { display: block; color: var(--muted); }
.px-doc-to b { display: block; color: var(--ink); font-weight: 500; }
.px-doc-lines { width: 100%; border-collapse: collapse; }
.px-doc-lines th { text-align: left; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--line-strong); padding: 5px 8px; }
.px-doc-lines th:last-child, .px-doc-lines td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.px-doc-lines td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.px-doc-lines tr.hl td { background: var(--highlight); color: var(--ink); font-weight: 600; box-shadow: inset 0 2px 0 var(--highlight-edge), inset 0 -2px 0 var(--highlight-edge); }
.px-doc-lines tr.hl td:first-child { box-shadow: inset 2px 0 0 var(--highlight-edge), inset 0 2px 0 var(--highlight-edge), inset 0 -2px 0 var(--highlight-edge); }
.px-doc-lines tr.hl td:last-child { box-shadow: inset -2px 0 0 var(--highlight-edge), inset 0 2px 0 var(--highlight-edge), inset 0 -2px 0 var(--highlight-edge); }
.px-doc-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 11.5px; }
.px-doc-none { color: var(--muted); margin: 0; }

/* The client's documents: search and filters on one line, no gaps */
.px-docs { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.px-docbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.px-docsearch { flex: 1 1 280px; min-width: 0; height: 38px; padding: 0 12px; gap: 8px; }
.px-docsearch input { flex: 1; min-width: 0; height: 36px; font: inherit; font-size: 14px; color: var(--ink); border: 0; background: transparent; outline: none; }

/* What just happened, with a way back */
.px-toast { position: fixed; z-index: 55; right: 22px; bottom: calc(86px + env(safe-area-inset-bottom, 0px)); max-width: min(420px, calc(100vw - 32px)); background: var(--ink); color: var(--on-primary); border-radius: 12px; padding: 12px 16px; display: flex; gap: 14px; align-items: center; font-size: 13.5px; box-shadow: var(--shadow-dialog); }
.px-toast .px-link { color: var(--on-primary); font-weight: 600; white-space: nowrap; }

.px-src { top: 136px; max-height: calc(100vh - 160px); }

/* v8: PrepDesk's own dropdown, date picker, checkboxes and radios. No browser pickers. */
.px-dd { display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; text-align: left; color: var(--ink); font: inherit; }
.px-dd.input { width: 100%; }
.px-dd > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.px-dd > svg { flex: none; color: var(--muted); transition: transform .15s ease-out; }
.px-dd[aria-expanded="true"] { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.px-dd[aria-haspopup="listbox"][aria-expanded="true"] > svg { transform: rotate(180deg); }
.px-dd[disabled] { opacity: .6; cursor: default; }
.px-dd.pill { height: 36px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--control-edge); background: var(--control-fill); box-shadow: var(--control-shadow); font-size: 13.5px; }
.px-dd.pill:hover { background: var(--control-hover-fill); border-color: var(--control-hover-edge); }
.dc-filter.on .px-dd.pill { border-color: var(--ink-2); font-weight: 500; }
.px-dd.px-sel { width: auto; min-width: 170px; }
.px-pop { z-index: 70; background: var(--surface-solid); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-dialog); padding: 6px; max-width: min(360px, calc(100vw - 16px)); }
.px-opts { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow-y: auto; }
.px-opts li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 20px; }
.px-opts li > svg { flex: none; color: var(--primary); visibility: hidden; }
.px-opts li[aria-selected="true"] { font-weight: 500; }
.px-opts li[aria-selected="true"] > svg { visibility: visible; }
.px-opts li:hover, .px-opts li:focus { background: color-mix(in srgb, var(--ink) 6%, transparent); outline: none; }
.px-opts li:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.px-cal { width: 272px; padding: 6px; display: flex; flex-direction: column; gap: 8px; }
.px-cal-head { display: flex; align-items: center; justify-content: space-between; }
.px-cal-head b { font-weight: 600; font-size: 14px; }
.px-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.px-cal-dow span { text-align: center; font-size: 12px; color: var(--muted); padding: 4px 0; }
.px-day { height: 34px; border: 0; border-radius: 9px; background: transparent; font: 400 13.5px var(--font-sans); font-variant-numeric: tabular-nums; color: var(--ink); cursor: pointer; }
.px-day:hover, .px-day:focus { background: color-mix(in srgb, var(--ink) 7%, transparent); outline: none; }
.px-day:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.px-day.today { box-shadow: inset 0 0 0 1px var(--line-strong); }
.px-day.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
dialog.px-dialog:not(.wide) { overflow: visible; }
input[type="checkbox"], input[type="radio"] { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border: 1.5px solid var(--control-edge-strong); background: var(--surface-solid); display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle; }
input[type="checkbox"] { border-radius: 5px; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]::before { content: ""; width: 10px; height: 10px; transform: scale(0); background: var(--on-primary); clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 22%, 86% 10%, 38% 72%); transition: transform .12s ease-out; }
input[type="radio"]::before { content: ""; width: 8px; height: 8px; border-radius: 50%; transform: scale(0); background: var(--on-primary); transition: transform .12s ease-out; }
input[type="checkbox"]:checked, input[type="radio"]:checked { background: var(--primary); border-color: var(--primary); }
input[type="checkbox"]:checked::before, input[type="radio"]:checked::before { transform: scale(1); }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
