/* studio/primitives.css: the shared primitives of the new look ("studio"): workspace and captions, buttons, tables, status words, page head, summary strip,
   filters, segmented tabs, menus, forms, and the components form.js builds (split button, row actions, empty state, list footer, dialog). Every rule starts
   with html[data-ui="studio"] and copies the Classic selector from public/app.css verbatim, inside the same media block (SPEC 2026-11-03 section 3). Values:
   panel/02-visual-system.md section 4; states panel/04-interaction-craft.md section 2; floors panel/03-accessibility-mobile.md sections 1, 2 and 5. Every
   colour and size is a token of studio/tokens.css; the one literal is the 16px field size under a finger (SPEC section 3: iOS never zooms a 16px field).
   Two specificity rules keep the keyboard flag and Classic's responsive rules working: this file never writes a transition or animation shorthand (a rule
   here would outrank the flag in tokens.css, same specificity, later file), only transition-property; and a rule here outside a media block outranks a
   Classic rule inside one, so every Classic phone or desktop variant it touches is restated below inside the same media block. */

/* ---- Workspace: the page is the surface. A panel holds a form or the invoice page's step cards; a panel that holds a filter row is a list card and loses
   its card (SPEC 4.1: no cards around lists, rows as lines). Nothing moves on navigation (Admin: still). ---- */
html[data-ui="studio"] .panel{padding:24px;gap:16px}
/* A panel whose child is a filter row or a table is a list (Team, Pending invitations, Message templates, Earlier exports, the invoice page's Payments) and sits
   straight on the page (review R widened the rule to tables, 3 Nov 2026); a form keeps its card. */
html[data-ui="studio"] .panel:has(> .filters),html[data-ui="studio"] .panel:has(> .table){background:none;border:0;border-radius:0;padding:0}
html[data-ui="studio"] .panel.arrive{animation:none}
html[data-ui="studio"] .eyebrow{line-height:18px}
html[data-ui="studio"] .panel>.eyebrow,html[data-ui="studio"] .due-head>.eyebrow{line-height:28px}

/* ---- Buttons: Admin's control. 8px corners, 40px tall, no pill, no outline, no shadow. One light primary per page; every other button is the dark fill;
   a quiet button is bare until the pointer is on it. Disabled is quieter, never see-through. The press stays Classic's (.97 in 140ms); hovers are Classic's
   token rules, which the studio tokens recolour. ---- */
html[data-ui="studio"] .btn{padding:0 16px;border-color:transparent;border-radius:var(--radius-xs);color:var(--text-primary);font-size:var(--type-m);font-weight:700;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html[data-ui="studio"] .btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
html[data-ui="studio"] .btn.primary:focus-visible{outline-offset:3px}
html[data-ui="studio"] .btn.small{min-height:var(--control-s);padding:0 12px;font-size:var(--type-m)}
html[data-ui="studio"] .btn[disabled]{opacity:1;color:var(--text-tertiary);background:var(--bg-panel);border-color:var(--divider);transform:none}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .btn[disabled]:hover{background:var(--bg-panel)}}

/* ---- Tables: rows as lines straight on the page, 48px tall, divided by the one rule (Admin's ledger). Column heads 13 regular secondary in sentence case.
   The name in the primary ink; money, dates and figures in the mono with tabular figures, right aligned (Classic's .num alignment and padding stay).
   Under the pointer the row takes the halfway grey and every word goes to the primary ink; a desktop row cannot be scaled, so a press is a fill step.
   Padding is never restated on th or td: Classic's .num cells swap theirs at a lower specificity. ---- */
html[data-ui="studio"] .table th{font-size:var(--type-xs);line-height:18px;font-weight:400;letter-spacing:0;text-transform:none;padding-bottom:8px}
html[data-ui="studio"] .table td{min-height:var(--row);height:var(--row);font-size:var(--type-m)}
html[data-ui="studio"] .table td.name{color:var(--text-primary)}
html[data-ui="studio"] .table td.num{font-family:var(--font-num);font-variant-numeric:tabular-nums;color:var(--text-primary)}
/* A date in a text cell (the Payments tables, Bills, the Inbox, Recurring) is a figure too: the mono with tabular figures, as the ledger and Activity already draw theirs (review R). */
html[data-ui="studio"] .table td.text[data-label="Date"],html[data-ui="studio"] .table td.text[data-label="Due date"],html[data-ui="studio"] .table td.text[data-label="Received"],html[data-ui="studio"] .table td.text[data-label="Next invoice date"],html[data-ui="studio"] .table td.name[data-label="Payment Date"]>span:first-child{font-family:var(--font-num);font-variant-numeric:tabular-nums}
html[data-ui="studio"] .table tbody tr:active{background:var(--bg-panel-2)}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .table tbody tr:hover{background:var(--row-hover)}html[data-ui="studio"] .table tbody tr:hover td{color:var(--text-primary)}}
@media (max-width:959px){
  /* the row is a grid of blocks (Classic): the 48px height goes, and a pressed row shrinks toward its left edge in place of the fill step */
  html[data-ui="studio"] .table td{height:auto;min-height:0}
  html[data-ui="studio"] .table tbody tr{transition-property:transform;transform-origin:left center}
  html[data-ui="studio"] .table tbody tr:active{background:none;transform:matrix(.97,0,0,.97,0,0)}
}

/* ---- Status words: weight and brightness only, no fill, no colour word. Overdue is bold with the red triangle drawn before it (the one red shape on a
   panel); Unpaid, Sent and Viewed regular in the primary ink; Paid regular secondary; Void regular tertiary. ---- */
html[data-ui="studio"] .status{gap:8px;padding:0;border-radius:0;background:none;font-size:var(--type-m);font-weight:400;line-height:22px;color:var(--text-primary)}
html[data-ui="studio"] .status.act{color:var(--text-primary);background:none}
html[data-ui="studio"] .status.done{color:var(--text-secondary);background:none}
html[data-ui="studio"] .status.dead{color:var(--text-tertiary);background:none}
html[data-ui="studio"] .status.late{color:var(--text-primary);font-weight:700;background:none}
html[data-ui="studio"] .status.late::before{content:"";flex:none;width:12px;height:11px;background:var(--flag);clip-path:polygon(50% 0,100% 100%,0 100%)}

/* ---- Page head, summary strip, filters, segmented tabs ---- */
html[data-ui="studio"] .page-head h1{line-height:36px;text-wrap:balance}
html[data-ui="studio"] .head-actions{gap:8px}
html[data-ui="studio"] .btn.quiet{min-height:var(--control-s);padding:0 8px;font-size:var(--type-m);color:var(--text-primary)}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .btn.quiet:hover{background:var(--bg-raised)}}
/* The summary strip: no card. The figures in a row with a rule between them, a 13px regular caption over a mono figure; stacked on a phone with a rule above each. */
html[data-ui="studio"] .strip{background:none;border:0;border-radius:0;padding:0;gap:0;overflow:visible}
html[data-ui="studio"] .strip .stat{padding:0 24px 0 0}
html[data-ui="studio"] .strip .stat+.stat{padding-left:24px}
html[data-ui="studio"] .strip .stat .eyebrow{font-weight:400}
@media (max-width:719px){html[data-ui="studio"] .strip{flex-direction:column}html[data-ui="studio"] .strip .stat{padding:12px 0}html[data-ui="studio"] .strip .stat+.stat{padding-left:0}}
html[data-ui="studio"] .big{font-family:var(--font-num);line-height:28px}
/* The filter row sits on the page, the controls 8px apart. The count is a bare mono figure, not a capsule (SPEC 4.1: no pills). */
html[data-ui="studio"] .filters,html[data-ui="studio"] .toolbar{gap:8px}
html[data-ui="studio"] .fcount{font-size:var(--type-xs)}
html[data-ui="studio"] .bubble{min-width:0;height:auto;padding:0;border-radius:0;background:none;color:var(--text-secondary);font-family:var(--font-num);font-size:inherit;font-weight:400}
/* Fields: the well, the rule as the edge, the ring at once on focus (no border fade). A disabled field keeps the well, with the tertiary ink and a faint edge.
   A date is read left to right in the mono with tabular figures. Under a finger a field is 16px so iOS never zooms (the one literal size in this file). */
html[data-ui="studio"] input,html[data-ui="studio"] select,html[data-ui="studio"] textarea{transition-property:none}
html[data-ui="studio"] input[disabled]{background:var(--bg-inset);color:var(--text-tertiary);border-color:var(--hair)}
html[data-ui="studio"] input[type=date]{font-family:var(--font-num);font-variant-numeric:tabular-nums}
@media (pointer:coarse){html[data-ui="studio"] input,html[data-ui="studio"] select,html[data-ui="studio"] textarea{font-size:var(--type-input)}}
/* Segmented tabs: no track, no pill. Words 4px apart; the chosen one is the filled shape one step up, bold, at once; the count is a mono figure after the word. */
html[data-ui="studio"] .panel>.seg{align-self:start}
html[data-ui="studio"] .seg{gap:4px;padding:0;background:none;border-radius:0}
html[data-ui="studio"] .seg button .bubble{margin-left:8px;background:none;color:inherit}
html[data-ui="studio"] .seg button[aria-selected=true] .bubble{background:none}
html[data-ui="studio"] .seg button{min-height:var(--control-s);padding:0 12px;border-radius:var(--radius-xs);font-weight:400;font-size:var(--type-m);color:var(--text-secondary);transition-property:transform;touch-action:manipulation;-webkit-user-select:none;user-select:none}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .seg button:hover{background:var(--row-hover);color:var(--text-primary)}html[data-ui="studio"] .seg button[aria-selected=true]:hover{background:var(--bg-panel-2)}}
html[data-ui="studio"] .seg button[aria-selected=true]{background:var(--bg-panel-2);color:var(--text-primary);font-weight:700;box-shadow:none}
/* A row's link is the primary ink, underlined only under the pointer (Classic's hover rule). */
html[data-ui="studio"] .rowlink{color:var(--text-primary)}

/* ---- Menus: the one thing that floats. The raised grey with the rule as its edge and the one shadow; rows 40px (44 under 960px, Classic's rule);
   a row under the pointer or the arrow keys takes the next grey; a danger row is the word in ink with the triangle. The pop and its keyboard exception stay Classic's. ---- */
html[data-ui="studio"] .menu{min-width:220px;padding:4px;background:var(--bg-panel-2);border-color:var(--divider);border-radius:var(--radius-xs);box-shadow:var(--shadow-raised)}
html[data-ui="studio"] .menu button,html[data-ui="studio"] .menu .item{font-size:var(--type-m);touch-action:manipulation;-webkit-user-select:none;user-select:none}
html[data-ui="studio"] .menu .item:focus-visible{background:var(--bg-raised)}
html[data-ui="studio"] .menu .item.danger{color:var(--text-primary);gap:8px}
html[data-ui="studio"] .menu .item.danger::before{content:"";flex:none;width:12px;height:11px;background:var(--flag);clip-path:polygon(50% 0,100% 100%,0 100%)}
html[data-ui="studio"] .menu .item .it-t{font-weight:700}
html[data-ui="studio"] .menu .rule{margin:4px 0}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .menu button:hover,html[data-ui="studio"] .menu .item:hover{background:var(--bg-raised)}html[data-ui="studio"] .menu .item[disabled]:hover{background:none}}

/* ---- Forms: the buttons 8px apart at the left (Admin's forms); the line editor's head is a 13px regular caption over the rule, not a 2px bar. ---- */
html[data-ui="studio"] .form .actions,html[data-ui="studio"] .actions{gap:8px;justify-content:flex-start}
html[data-ui="studio"] .kind-fixed{min-height:var(--control)}
@media (min-width:960px){html[data-ui="studio"] .l-head{font-weight:400;padding-bottom:8px;border-bottom:1px solid var(--divider)}}

/* ---- Shared components for every page (form.js: splitButton, openDialog, confirmDialog, rowActions, emptyState) ---- */
/* Destructive is the secondary fill with the triangle before its word; the confirm dialog is the second press. Never a red fill. */
html[data-ui="studio"] .btn.danger{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--btn-strong);border-color:transparent;color:var(--text-primary)}
html[data-ui="studio"] .btn.danger::before{content:"";flex:none;width:12px;height:11px;background:var(--flag);clip-path:polygon(50% 0,100% 100%,0 100%)}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .btn.danger:hover{background:var(--btn-strong-hover)}}
/* The split button keeps its join (the two parts share the 8px corners); the caret part is divided by a line in the ink on the primary, by the rule on the secondary. */
html[data-ui="studio"] .split .split-main{border-top-right-radius:0;border-bottom-right-radius:0;padding-right:14px}
html[data-ui="studio"] .split .split-caret{width:var(--control);border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:var(--on-accent)}
html[data-ui="studio"] .split .btn:not(.primary).split-caret{border-left-color:var(--divider)}
/* Round buttons become 36px square quiet buttons (the pager's arrows, Move up and down keep their glyph). In the Actions cell the glyph gives way to the word
   More (panel 1's table, SPEC 4.9); the accessible name "More actions" stays on the button. */
html[data-ui="studio"] .act-cell{gap:8px}
html[data-ui="studio"] .circle-btn{width:var(--control-s);height:var(--control-s);min-height:var(--control-s);border-color:transparent;border-radius:var(--radius-xs);background:transparent;color:var(--text-primary)}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .circle-btn:hover{background:var(--bg-raised)}}
html[data-ui="studio"] .act-cell .circle-btn{width:auto;padding:0 8px;font-size:var(--type-m);font-weight:400}
html[data-ui="studio"] .act-cell .circle-btn::before{content:"More"}
html[data-ui="studio"] .act-cell .circle-btn svg{display:none}
/* An empty list: a title, one line, one button. No picture. */
html[data-ui="studio"] .empty{padding:64px 16px;gap:8px}
html[data-ui="studio"] .empty-t{line-height:28px}
html[data-ui="studio"] .empty-s{max-width:40ch}
html[data-ui="studio"] .empty .btn{margin-top:16px}
/* The list footer: a 13px line with tabular figures and a 36px select. */
html[data-ui="studio"] .pager{font-size:var(--type-xs);font-variant-numeric:tabular-nums}
html[data-ui="studio"] .pager select{min-height:var(--control-s)}
/* The dialog: the panel grey with the rule as its edge (a shadow does not survive the dark), a 60 percent backdrop, a 40px close. Its sizes and timing are
   Classic's and tokens.css's (the 260 in, 180 out). */
html[data-ui="studio"] dialog.dlg::backdrop{background:rgba(0,0,0,.6)}
html[data-ui="studio"] .dlg-card{border:1px solid var(--divider);box-shadow:none}
html[data-ui="studio"] .dlg-head{padding:20px 20px 8px 24px}
html[data-ui="studio"] .dlg-title{line-height:28px;padding-top:6px}
html[data-ui="studio"] .dlg-x{width:var(--control);height:var(--control);border-radius:var(--radius-xs)}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .dlg-x:hover{background:var(--bg-raised);color:var(--text-primary)}}
html[data-ui="studio"] .dlg-body{padding:8px 24px 16px}
html[data-ui="studio"] .dlg-foot{gap:8px;padding:16px 24px 24px}

/* ---- Help text under controls is hidden in studio (SPEC 4.4): kept in the DOM and read by a screen reader through aria-describedby. Nothing interactive is hidden.
   The tag picker's line (.ti-help) is not here: tests/simple-mode-purchases.browser.test.mjs:156 waits for it to be visible, so it is the catalog sheet's call. ---- */
html[data-ui="studio"] .help,html[data-ui="studio"] .cu-hint,html[data-ui="studio"] .set-help,html[data-ui="studio"] .drop-s,html[data-ui="studio"] .pv-drop-h{display:none}

/* ---- The searchable picker (ui/picker.js) and the Add a customer and Add a vendor dialogs (ui/customer-quick.js). The list is the menu's surface (the panel
   grey, the rule as its edge, the raised shadow, 8px corners); the row under the keys or the pointer takes the raised grey and every word on it the primary ink
   (secondary text never sits on the raised grey); the chosen one is bold with the tick in the ink; the add row is the ink, not a colour. ---- */
html[data-ui="studio"] .pk-caret{color:var(--text-secondary)}
html[data-ui="studio"] .pk-pop{padding:4px;background:var(--bg-panel-2);border-color:var(--divider);border-radius:var(--radius-xs);box-shadow:var(--shadow-raised)}
html[data-ui="studio"] .pk-opt{font-size:var(--type-m);touch-action:manipulation}
html[data-ui="studio"] .pk-s{font-size:var(--type-xs);line-height:18px}
html[data-ui="studio"] .pk-tick{color:var(--text-primary)}
html[data-ui="studio"] .pk-opt.on,html[data-ui="studio"] .pk-add.on{background:var(--bg-raised)}
html[data-ui="studio"] .pk-opt.on .pk-s{color:var(--text-primary)}
html[data-ui="studio"] .pk-none{font-size:var(--type-m)}
html[data-ui="studio"] .pk-add{margin-top:4px;font-size:var(--type-m);color:var(--text-primary);touch-action:manipulation}
@media (hover:hover) and (pointer:fine){html[data-ui="studio"] .pk-opt:hover,html[data-ui="studio"] .pk-add:hover{background:var(--bg-raised)}html[data-ui="studio"] .pk-opt:hover .pk-s{color:var(--text-primary)}}
html[data-ui="studio"] .qa-sec{font-size:var(--type-xs);line-height:18px;color:var(--text-secondary)}
