/* Shared visual system. Screen-only: printed and generated documents retain their layout. */
@media screen {
  :root {
    --ui-page:#edf0f4; --ui-surface:#fff; --ui-raised:#f6f8fb; --ui-input:#fff;
    --ui-ink:#202b3a; --ui-muted:#526176; --ui-line:#d5dde7; --ui-soft-line:#e7ecf2;
    --ui-accent:#265f9e; --ui-accent-soft:#eaf2fc; --ui-focus:#4084d2;
    --ui-success:#206747; --ui-success-bg:#edf7f1; --ui-danger:#b63c43; --ui-danger-bg:#fff2f2;
    --ui-shadow:0 2px 5px #172b4610; --ui-radius:10px;
  }
  html[data-theme="dark"] {
    --ui-page:#111213; --ui-surface:#1b1c1e; --ui-raised:#242629; --ui-input:#141517;
    --ui-ink:#f5f5f5; --ui-muted:#b5bbc4; --ui-line:#41454c; --ui-soft-line:#30343a;
    --ui-accent:#a8cfff; --ui-accent-soft:#2c3541; --ui-focus:#8cbeff;
    --ui-success:#98dfba; --ui-success-bg:#1d3028; --ui-danger:#ffa5a8; --ui-danger-bg:#342326;
    --ui-shadow:0 2px 6px #0002;
  }
  body.app-mode {background:var(--ui-page)!important}
  .app-shell {font-family:"Segoe UI",Arial,sans-serif;font-size:13px;line-height:1.45;color:var(--ui-ink);background:var(--ui-page)!important;-webkit-font-smoothing:antialiased}
  .app-shell :is(button,input,select,textarea){font-family:inherit}
  .app-shell :is(.app-main,.page-container,.form-grid,.field,.surface,.monthly-stats article,.stats article){min-width:0}
  .app-shell .page-container{padding:22px 26px 40px;max-width:1760px}
  .app-shell .page-heading{align-items:center;margin-bottom:16px;gap:16px}
  .app-shell .page-heading h1{font-size:25px;line-height:1.2;font-weight:650;letter-spacing:-.65px;color:var(--ui-ink);margin:0 0 5px}
  .app-shell :is(.page-heading p,.section-heading p,.hint,.cell-note,.muted,.surface-note,.record-time){color:var(--ui-muted)!important;line-height:1.5}
  .app-shell .page-heading p{margin:0;font-size:12px}
  .app-shell :is(h2,h3){color:var(--ui-ink);font-weight:650;letter-spacing:-.2px}
  .app-shell h2{font-size:17px;line-height:1.35}
  .app-shell h3{font-size:14px;line-height:1.4}
  .app-shell :is(.surface,.stats article,dialog,.article-capture,.cheque-capture){border:1px solid var(--ui-line)!important;background:var(--ui-surface)!important;color:var(--ui-ink);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
  .app-shell .section-heading{padding:16px 18px;gap:12px;align-items:center}
  .app-shell .section-heading h2{margin:0 0 4px}
  .app-shell .section-heading p{font-size:12px;margin:0}
  .app-shell .spaced{margin-top:16px}
  .app-shell :is(.primary,.secondary,.danger-button){font-size:12px;font-weight:600;border-radius:7px;min-height:34px;padding:7px 12px;gap:7px;line-height:1.35;box-shadow:none;transition:background-color .12s,border-color .12s}
  .app-shell .primary{background:#273547!important;color:#fff!important;border:1px solid #273547;width:auto;box-shadow:0 2px 4px #14243a12}
  .app-shell .primary:hover{background:#354a63!important;border-color:#354a63}
  html[data-theme="dark"] .app-shell .primary{background:#e6e9ed!important;border-color:#e6e9ed;color:#16191d!important}
  html[data-theme="dark"] .app-shell .primary:hover{background:#fff!important;border-color:#fff}
  .app-shell :is(.secondary,.close-button){background:var(--ui-surface)!important;border:1px solid var(--ui-line);color:var(--ui-ink)!important}
  .app-shell :is(.secondary,.close-button):hover{background:var(--ui-raised)!important;border-color:var(--ui-muted)}
  .app-shell :is(button,a):focus-visible{outline:2px solid var(--ui-focus);outline-offset:3px}
  .app-shell button:disabled{cursor:default;opacity:.45;box-shadow:none}
  .app-shell button[aria-busy="true"]{cursor:progress}
  .app-shell :is(.text-button,.table-link){color:var(--ui-accent);font-weight:500}
  .app-shell .text-button:hover{text-decoration:underline;text-underline-offset:3px}
  .app-shell [data-action="trash-record"],.app-shell .remove-line{color:var(--ui-danger)!important}
  .app-shell [data-action="trash-record"]:hover{background:var(--ui-danger-bg)!important}
  .app-shell :is(input,select,textarea){max-width:100%;min-width:0;border:1px solid var(--ui-line)!important;border-radius:6px;background:var(--ui-input)!important;color:var(--ui-ink)!important;font-size:13px;box-shadow:none;line-height:1.4}
  .app-shell :is(input:not([type="checkbox"]):not([type="radio"]),select){height:36px;min-height:36px;padding:7px 10px}
  .app-shell textarea{padding:9px 10px;min-height:64px;resize:vertical}
  .app-shell :is(input,textarea)::placeholder{color:var(--ui-muted);opacity:.85;font-size:12px}
  .app-shell :is(input,select,textarea):focus{outline:2px solid color-mix(in srgb,var(--ui-focus) 25%,transparent);outline-offset:1px;border-color:var(--ui-focus)!important}
  .app-shell :is(input,select,textarea):focus:not(:focus-visible){outline-width:1px}
  .app-shell input:read-only:not([type="checkbox"]){background:var(--ui-raised)!important}
  .app-shell input:is([type="checkbox"],[type="radio"]){width:15px;height:15px;min-height:0;margin:0 6px 0 0;vertical-align:middle;accent-color:#3473b4}
  .app-shell label{color:var(--ui-muted);font-size:12px;font-weight:600;line-height:1.4;margin-bottom:5px}
  .app-shell .field{gap:4px;margin-bottom:10px}
  .app-shell .field>label{margin-bottom:0}
  .app-shell input[type="file"]{font-size:12px;padding:4px 6px;height:36px;overflow:hidden}
  .app-shell input[type="file"]::file-selector-button{font:600 12px "Segoe UI",Arial,sans-serif;color:var(--ui-ink);background:var(--ui-raised);border:0;border-right:1px solid var(--ui-line);border-radius:4px;padding:5px 10px;margin-right:9px;cursor:pointer}
  .app-shell :is(input[type="date"],input[type="month"],.numeric,.line-price,.line-quantity,output){font-variant-numeric:tabular-nums}
  .app-shell :is(.status,.status.error){font-size:12px;padding:9px 12px;line-height:1.5}
  .app-shell .status{background:var(--ui-success-bg);color:var(--ui-success)}
  .app-shell .status.error{background:var(--ui-danger-bg);color:var(--ui-danger)}
  .app-shell .status:empty{display:none}
  .app-shell #toast.status{position:sticky;top:72px;z-index:65;display:flex;align-items:flex-start;gap:12px;margin:0 0 14px;border:1px solid color-mix(in srgb,var(--ui-success) 30%,transparent);box-shadow:var(--ui-shadow)}
  .app-shell #toast.status.error{border-color:color-mix(in srgb,var(--ui-danger) 35%,transparent)}
  .app-shell #toast>span{flex:1;min-width:0;overflow-wrap:anywhere}
  .app-shell .toast-dismiss{flex-shrink:0;min-width:26px;min-height:26px;margin:-4px -5px -4px 0;padding:0;border:0;border-radius:4px;background:transparent;color:inherit;font-size:20px;line-height:1}
  .app-shell .toast-dismiss:hover{background:color-mix(in srgb,currentColor 10%,transparent)}
  .app-shell :is(input,select,textarea):user-invalid{border-color:var(--ui-danger)!important;background:color-mix(in srgb,var(--ui-danger-bg) 35%,var(--ui-input))!important}

  /* Navigation stays available beside the appearance controls. */
  .app-shell .app-topbar{position:sticky;top:0;z-index:80;background:var(--ui-surface)!important;border-color:var(--ui-line);gap:10px;padding:8px 16px;min-height:60px;height:auto}
  .app-shell :is(input,select,textarea,[role="listbox"],.table-scroll){scroll-margin-top:80px}
  .app-shell .app-topbar>.account-tabs{background:var(--ui-raised)!important;border-color:var(--ui-line);padding:3px;border-radius:8px;scrollbar-width:thin}
  .app-shell .app-topbar>.account-tabs button{font-size:11.5px;font-weight:500;min-height:32px;padding:6px 10px;color:var(--ui-muted)}
  .app-shell .app-topbar>.account-tabs button:hover{background:var(--ui-accent-soft);color:var(--ui-ink)}
  .app-shell .app-topbar>.account-tabs button.selected{background:var(--ui-surface);color:var(--ui-accent);font-weight:650;box-shadow:0 1px 4px #0002}
  .app-shell .appearance-control{background:var(--ui-raised)!important;border-color:var(--ui-line);padding:3px 6px 3px 9px;border-radius:8px;gap:7px}
  .app-shell .appearance-control select{height:30px;min-height:30px;padding:3px 7px;width:96px;font-size:12px}
  .app-shell .app-settings-button{min-height:36px;padding:7px 10px;font-size:12px}
  .app-shell>.sidebar{background:var(--ui-surface)!important;border-color:var(--ui-line);padding:22px 14px}
  .app-shell .app-brand{color:var(--ui-ink)!important;padding:0 8px 24px;gap:12px}
  .app-shell .app-brand .logo{box-shadow:none;background:var(--ui-accent-soft);color:var(--ui-accent);border:1px solid var(--ui-line);border-radius:10px}
  .app-shell .sidebar-search{margin:0 5px 16px}
  .app-shell .sidebar nav button{font-size:13px;color:var(--ui-muted);border-radius:7px;line-height:1.35}
  .app-shell .sidebar nav button:hover{background:var(--ui-raised);color:var(--ui-ink)}
  .app-shell .sidebar nav button.active,.app-shell .sidebar nav button.active span{background:var(--ui-accent-soft)!important;color:var(--ui-accent)!important}
  .app-shell .sidebar nav .sidebar-group>button{background:var(--ui-raised)!important;border:1px solid var(--ui-soft-line);font-weight:650}
  .app-shell .sidebar nav .sidebar-group>button span{color:var(--ui-ink)!important}
  .app-shell .sidebar nav .sidebar-group>div{border-color:var(--ui-line);margin-top:5px;margin-left:18px}
  .app-shell>.sidebar-edge{background:var(--ui-raised)!important;color:var(--ui-muted);border-color:var(--ui-line);box-shadow:none}

  /* Compact tables with legible filters and restrained movement colors. */
  .app-shell .table-toolbar{padding:12px 16px;gap:12px}
  .app-shell .searchbox{width:100%;max-width:480px;flex:0 1 480px;min-width:0;gap:9px;background:transparent}
  .app-shell .searchbox input{font-size:12px;height:34px;min-height:34px}
  .app-shell .searchbox svg{flex-shrink:0;width:17px;height:17px;color:var(--ui-muted)}
  .app-shell .table-filter-tools{font-size:12px;color:var(--ui-muted);padding:9px 16px}
  .app-shell .table-scroll table{font-size:12px;color:var(--ui-ink);border-collapse:collapse}
  .app-shell .table-scroll th{font-size:11px;font-weight:650;color:var(--ui-muted);padding:9px 12px;background:var(--ui-raised)!important;border-color:var(--ui-line)}
  .app-shell .table-scroll td{font-size:12px;line-height:1.45;padding:8px 12px;border-color:var(--ui-soft-line);vertical-align:middle}
  .app-shell .table-scroll td strong{font-weight:650;color:var(--ui-ink)}
  .app-shell .table-scroll :is(th,td).numeric,.app-shell .table-scroll td[data-numeric="true"]{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
  .app-shell .table-scroll[tabindex]:focus-visible{outline:2px solid var(--ui-focus);outline-offset:-2px}
  .app-shell .filterable-table{scroll-margin-top:80px}
  .app-shell .filterable-table[aria-busy="true"] tbody{opacity:.55}
  .app-shell .filterable-table[aria-busy="true"] .table-filter-tools [role="status"]{color:var(--ui-accent)}
  .app-shell .column-filters th{padding:6px 10px 9px}
  .app-shell .column-filters input{height:30px;min-height:30px;padding:5px 8px;font-size:12px;font-weight:400}
  .app-shell .column-filters input::placeholder{font-size:11px}
  .app-shell .table-scroll td :is(.text-button,.table-link,.danger-button,.secondary){font-size:11px;min-height:28px;padding:4px 6px;white-space:nowrap;display:inline-flex;align-items:center;width:auto;margin:1px 0;vertical-align:middle}
  .app-shell .table-scroll .cell-note{font-size:11px;line-height:1.45;margin-top:2px}
  .app-shell .event-positive>td{background:var(--ui-success-bg)!important}
  .app-shell .event-negative>td{background:var(--ui-danger-bg)!important}
  .app-shell .event-positive>td:first-child{border-left:3px solid #3e9970}
  .app-shell .event-negative>td:first-child{border-left:3px solid #c96b70}
  .app-shell .table-scroll tbody tr:hover>td{background:var(--ui-accent-soft)!important}
  .app-shell .pill{font-size:10px;font-weight:600;line-height:1.35;white-space:nowrap;border-radius:5px;padding:3px 7px}
  .app-shell .pill.issued{color:var(--ui-success);background:color-mix(in srgb,var(--ui-success) 12%,var(--ui-surface))}
  .app-shell .pill.cancelled{color:var(--ui-danger);background:color-mix(in srgb,var(--ui-danger) 12%,var(--ui-surface))}
  .app-shell .product-pagination{padding:10px 16px;min-height:54px;gap:10px;border-color:var(--ui-soft-line);font-size:12px;color:var(--ui-muted)}
  .app-shell .product-pagination button{min-height:32px;font-size:12px;padding:6px 10px}
  .app-shell .surface-note{padding:12px 16px;margin:0;border-color:var(--ui-soft-line);font-size:12px}
  .app-shell .table-empty td{padding:22px 16px!important;color:var(--ui-muted);text-align:center}

  /* The dashboard shares the same spacing rhythm as forms. */
  .app-shell .monthly-summary{padding:18px;margin-bottom:16px}
  .app-shell .monthly-summary>.section-heading{padding:0;margin-bottom:14px}
  .app-shell .monthly-summary>.section-heading h2{font-size:18px}
  .app-shell .monthly-summary>.section-heading label{display:flex;align-items:center;gap:10px;margin:0}
  .app-shell .monthly-summary .monthly-stats{gap:12px;margin:0 0 14px}
  .app-shell .monthly-stats article{padding:15px 16px;background:var(--ui-raised)!important;border-color:var(--ui-line);border-top:3px solid #5686bd!important;min-height:112px}
  .app-shell .monthly-stats article:nth-child(2){border-top-color:#3d927c!important}
  .app-shell .monthly-stats article:nth-child(3){border-top-color:#9b78bd!important}
  .app-shell .monthly-stats article strong{font-size:28px;line-height:1.2;font-weight:650;letter-spacing:-.6px;margin:10px 0 7px}
  .app-shell .stats{gap:14px;margin-bottom:16px}
  .app-shell .stats>article{padding:17px;min-height:0}
  .app-shell .stats article>span{font-size:12px;color:var(--ui-muted)}
  .app-shell .stats article>strong{font-size:28px;font-weight:650;margin:8px 0;line-height:1.15}
  .app-shell .stats article>small{font-size:11px;line-height:1.5;color:var(--ui-muted)}
  .app-shell .stat-icon{width:32px;height:32px;border-radius:8px;display:inline-grid;place-items:center;background:var(--ui-raised);border:1px solid var(--ui-soft-line);margin-bottom:10px}
  .app-shell .stat-icon svg{width:17px;height:17px}
  .app-shell .monthly-tax{border-top:1px solid var(--ui-soft-line);padding-top:12px;margin-top:12px;font-size:12px}
  .app-shell .monthly-tax summary{font-size:13px;margin-bottom:9px}
  .app-shell #summary-margin{width:160px;display:block;margin:5px 0 9px}
  .app-shell .monthly-comparison{font-size:12px;gap:8px 22px}
  .app-shell .home-grid{gap:16px;align-items:start}
  .app-shell .home-grid .chart{padding-bottom:14px}
  .app-shell .chart-legend{padding:0 18px 10px;font-size:11px}
  .app-shell .chart text{fill:var(--ui-muted)}
  .app-shell .chart .chart-grid{stroke:var(--ui-soft-line)}
  .app-shell .stock-alerts{padding:0 18px 10px}
  .app-shell .stock-alerts button{padding:12px 0;border-color:var(--ui-soft-line);gap:14px}
  .app-shell .stock-alerts strong{font-size:12px;line-height:1.45;color:var(--ui-ink)}
  .app-shell .quick{margin-top:16px;padding:16px 18px}

  /* Full-page forms, matching the compact article editor. */
  .app-shell .document-capture-host{margin-bottom:16px}
  .app-shell .document-capture-host>dialog{padding:16px!important;border-color:var(--ui-line)!important}
  .app-shell .document-capture-host .dialog-title{padding:0 0 10px!important;margin:0 0 12px;border-color:var(--ui-soft-line)}
  .app-shell .dialog-title h2{font-size:18px;font-weight:650}
  .app-shell .form-grid{gap:8px 14px}
  .app-shell .form-grid>.wide{min-width:0}
  .app-shell .form-grid>h3.wide{font-size:13px;padding:9px 0 7px;margin:5px 0 0;border-bottom:1px solid var(--ui-soft-line);color:var(--ui-accent);letter-spacing:.1px}
  .app-shell #editor-form:has(#f-street):not(:has(#purchase-search)) .form-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
  .app-shell #editor-form:has(#f-street) .field:has(:is(#f-name,#f-trade_name,#f-street,#f-contact,#f-tax_regime,#f-payment_terms)){grid-column:span 2}
  .app-shell #editor-form:has(#f-street) .field:has(#f-notes){grid-column:1/-1}
  .app-shell .form-inline-toolbar{position:sticky;top:72px;z-index:25;margin:4px 0 10px;gap:10px;padding:7px 0;background:var(--ui-surface);border-bottom:1px solid var(--ui-soft-line)}
  .app-shell .dialog-actions{gap:7px;flex-wrap:wrap}
  .app-shell .document-product-picker{background:var(--ui-raised)!important;border-color:var(--ui-line);padding:9px 11px!important;margin-bottom:10px!important}
  .app-shell .document-product-picker label{margin:0 0 5px}
  .app-shell #document-search-status:empty{display:none}
  .app-shell #document-search-status{font-size:11px;margin-top:5px}
  .app-shell dialog.compact-parts-editor .document-line{background:var(--ui-raised)!important;border-color:var(--ui-line);border-left:3px solid #5686bd;box-shadow:none;gap:9px;padding:8px 10px;margin:0 0 6px;grid-template-columns:minmax(0,1fr) 72px 80px 108px 98px 28px}
  .app-shell dialog.compact-parts-editor .document-line:nth-child(even){background:var(--ui-accent-soft)!important;border-left-color:#65998c}
  .app-shell dialog.compact-parts-editor .document-line-name{grid-template-columns:minmax(90px,.3fr) minmax(0,1fr);gap:1px 12px;align-items:center}
  .app-shell dialog.compact-parts-editor .document-line-name>strong{font-size:12px;color:var(--ui-ink)!important}
  .app-shell dialog.compact-parts-editor .document-line-name>strong+.cell-note{font-size:12px;font-weight:650;line-height:1.4;color:var(--ui-ink)!important}
  html[data-theme="dark"] .app-shell dialog.compact-parts-editor .document-line-name>strong,html[data-theme="dark"] .app-shell dialog.compact-parts-editor .document-line-name>strong+.cell-note{color:#fff!important}
  .app-shell dialog.compact-parts-editor .document-line label{font-size:11px;color:var(--ui-muted);margin:0 0 3px}
  .app-shell dialog.compact-parts-editor .document-line input{height:32px;min-height:32px;padding:5px 7px;font-size:12px}
  .app-shell dialog.compact-parts-editor .document-line .line-amount{font-weight:650;font-size:12px;color:var(--ui-ink)}
  .app-shell dialog.compact-parts-editor .remove-line{width:28px;height:30px;min-height:30px;font-size:20px;line-height:1;border:0!important;background:transparent!important;border-radius:5px}
  .app-shell dialog.compact-parts-editor .remove-line:hover{background:var(--ui-danger-bg)!important}
  .app-shell dialog.compact-parts-editor .totals-preview{background:var(--ui-raised)!important;border:1px solid var(--ui-soft-line);border-radius:8px;padding:12px;margin:10px 0 4px}
  .app-shell .totals-preview :is(span,strong){color:var(--ui-ink)}
  .app-shell .totals-preview .grand-total strong{font-size:17px;font-weight:700}
  .app-shell .compact-email{padding:12px;background:var(--ui-raised)!important;border-color:var(--ui-line);margin-top:8px}
  .app-shell .compact-email textarea{height:120px;min-height:120px;background:var(--ui-input)!important}
  .app-shell .compact-email .email-clients label{padding:5px 7px;border:1px solid transparent;border-radius:6px}
  .app-shell .compact-email .email-clients label:has(input:checked){background:var(--ui-accent-soft);border-color:var(--ui-line)}
  .app-shell .article-capture{padding:16px;margin-bottom:16px}
  .app-shell .article-capture h2{font-size:17px;margin-bottom:12px}
  .app-shell :is(.supplier-upload summary,.invoice-import-note summary){color:var(--ui-ink)}
  .app-shell .supplier-upload-icon{background:var(--ui-accent-soft);color:var(--ui-accent);border-color:var(--ui-line)}
  .app-shell .cheque-capture{padding:16px}
  .app-shell .cheque-words{color:var(--ui-accent);font-size:12px;line-height:1.5;padding:5px 0}
  .app-shell .cheque-order-head{background:var(--ui-raised)}
  .app-shell .cheque-order-item{border-color:var(--ui-soft-line)}
  .app-shell #cheque-total{color:var(--ui-ink)!important;background:var(--ui-raised)!important;font-size:17px}
  .app-shell .tool-summary{gap:12px;margin:12px 0}
  .app-shell .tool-summary>div{border:1px solid var(--ui-line);border-left:3px solid #b69751;background:var(--ui-surface)!important;padding:12px 14px;border-radius:8px;color:var(--ui-muted);gap:10px}
  .app-shell .tool-summary strong{color:var(--ui-ink);font-size:21px}
  .app-shell .tool-summary span{font-size:12px}
  .app-shell .tool-line-card{border-color:var(--ui-line);background:var(--ui-raised);border-radius:7px}
  .app-shell details.tool-line-card>summary{padding:8px 10px;font-size:12px}
  .app-shell details.tool-line-card>p,.app-shell details.tool-line-card>input,.app-shell details.tool-line-card>button{margin:8px 10px;max-width:calc(100% - 20px)}
  .app-shell #tool-excel-options,.app-shell #tool-excel-status{padding:0 10px}
  .app-shell #tool-excel-options:empty,.app-shell #tool-excel-status:empty{display:none}
  .app-shell #tool-excel-status [data-missing-product]{display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,2fr) 80px auto;gap:10px;align-items:end;padding:10px 0;border-bottom:1px solid var(--ui-soft-line)}
  .app-shell #tool-excel-status [data-missing-product] label{margin:0}
  .app-shell #tool-excel-status [data-create-missing]{margin:12px 0}
  .app-shell .tool-capture-host #tool-lines>.tool-line-card{background:var(--ui-raised)!important;border-color:var(--ui-line);border-left:3px solid #5686bd;gap:12px;box-shadow:none}
  .app-shell .tool-capture-host #tool-lines>.tool-line-card:nth-child(even){background:var(--ui-accent-soft)!important}
  .app-shell .tool-capture-host #tool-lines .section-heading{padding:0}
  .app-shell .tool-capture-host #tool-lines .section-heading :is(strong,p){color:var(--ui-ink)!important;font-size:12px;line-height:1.4}
  .app-shell #tool-lines .tool-line-fields input{height:32px;min-height:32px}
  .app-shell .tool-line-fields label{min-width:0}
  .app-shell .tool-bulk-dates .tool-search{gap:10px}
  .app-shell .tool-capture-host #f-notes{min-height:58px}

  /* Settings fills the window but keeps content easy to scan. */
  .app-shell>dialog.interface-settings{background:var(--ui-page)!important;box-shadow:none}
  .app-shell .interface-settings-heading{background:var(--ui-surface);border-color:var(--ui-line);padding:16px 24px}
  .app-shell .interface-settings-body{width:100%;max-width:1240px;margin:auto;gap:20px;padding:24px}
  .app-shell .interface-settings-body>form,.app-shell .settings-business-entry{background:var(--ui-surface);border-color:var(--ui-line);border-radius:10px}
  .app-shell .interface-section-list{background:var(--ui-surface);border-color:var(--ui-line)}
  .app-shell .interface-section-list label{border-color:var(--ui-soft-line);padding:12px;min-height:48px;color:var(--ui-ink);font-weight:500}
  .app-shell .interface-section-list label:hover{background:var(--ui-raised)}
  .app-shell .interface-settings-footer{background:var(--ui-surface)}
  .app-shell>dialog.interface-settings{border:0!important;border-radius:0}
  .app-shell .interface-section-list label{margin:0}
  .app-shell :is(.settings-form,.account-security-card){background:var(--ui-surface)!important;color:var(--ui-ink);border-color:var(--ui-line)}
  .app-shell .settings-form .form-grid{gap:8px 14px}
  .app-shell .account-security-card{padding:16px 18px}
  .app-shell .presence-box{width:calc(100% - 52px);max-width:1708px;margin:16px auto 0;border-color:var(--ui-line)}
  .app-shell .workspace-context{padding:16px 18px;margin-bottom:16px;border:1px solid var(--ui-line);border-left:3px solid var(--ui-accent);background:var(--ui-raised)!important}
  .app-shell .workspace-context .actions{width:auto}
  .app-shell .workspace-context strong{font-size:17px;font-weight:600;color:var(--ui-ink)}
  .app-shell .empty{padding:28px 18px}
  .app-shell .empty :is(h3,p){color:var(--ui-muted)}
  .app-shell .sidebar-bottom{padding-top:16px;border-color:var(--ui-soft-line)}
  .app-shell .sidebar-bottom :is(strong,small,button){color:var(--ui-muted)}
  .app-shell .workspace-login{color:var(--ui-muted)}
  .app-shell .workspace-context p{color:var(--ui-muted)}
  .app-shell .record-counts span{background:var(--ui-raised);border-color:var(--ui-line);color:var(--ui-muted);padding:4px 6px}
  .app-shell .supplier-upload{margin-bottom:12px}
  .app-shell .home-grid>.surface.spaced{margin-top:0}
  .app-shell .surface.spaced:has(>h2){padding:16px 18px}
  .app-shell .surface.spaced>h2{margin:0 0 8px}
  .app-shell .surface.spaced>p{margin:0;line-height:1.6}
  .app-shell .surface:has([data-action="toggle-site"])+.stats{margin-top:14px}
  .app-shell .monthly-summary .hint{font-size:12px}

  /* Explicit theme context wins over the older per-screen color overrides. */
  html[data-theme] .app-shell :is(.surface,.stats article,dialog,.document-client){background:var(--ui-surface)!important;color:var(--ui-ink);border-color:var(--ui-line)!important}
  html[data-theme] .app-shell :is(.secondary,.close-button){background:var(--ui-surface)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)}
  html[data-theme] .app-shell :is(.secondary,.close-button):hover{background:var(--ui-raised)!important}
  html[data-theme] .app-shell :is(input,select,textarea){background:var(--ui-input)!important;color:var(--ui-ink)!important;border-color:var(--ui-line)!important}
  html[data-theme] .app-shell input:read-only:not([type="checkbox"]){background:var(--ui-raised)!important}
  html[data-theme] .app-shell :is(.text-button,.table-link){color:var(--ui-accent)}
  html[data-theme] .app-shell :is(.hint,.muted,.cell-note,.record-time,.page-heading p,.section-heading p){color:var(--ui-muted)!important}
  html[data-theme] .app-shell :is(.primary,.secondary,.text-button,.table-link){transition:box-shadow .12s}
  html[data-theme] .app-shell .event-positive>td{background:var(--ui-success-bg)!important}
  html[data-theme] .app-shell .event-negative>td{background:var(--ui-danger-bg)!important}
  html[data-theme] .app-shell .table-scroll tbody tr:hover>td{background:var(--ui-accent-soft)!important}
  html[data-theme] .app-shell dialog.compact-parts-editor .document-line{background:var(--ui-raised)!important;border-color:var(--ui-line)}
  html[data-theme] .app-shell dialog.compact-parts-editor .document-line:nth-child(even){background:var(--ui-accent-soft)!important;border-color:var(--ui-line)}
  html[data-theme="dark"] .app-shell dialog.compact-parts-editor .document-line:nth-child(even){background:#2d2f33!important}
  html[data-theme="dark"] .app-shell .monthly-stats article{background:var(--ui-raised)!important}
  html[data-theme] .app-shell .monthly-stats article:nth-child(1){border-top-color:#5686bd!important}
  html[data-theme] .app-shell .monthly-stats article:nth-child(2){border-top-color:#3d927c!important}
  html[data-theme] .app-shell .monthly-stats article:nth-child(3){border-top-color:#9b78bd!important}
  html[data-theme] .app-shell :is(.pill.issued,.pill.cancelled){box-shadow:none}
  html[data-theme] .app-shell .pill.issued{color:var(--ui-success);background:var(--ui-success-bg)}
  html[data-theme] .app-shell .pill.cancelled{color:var(--ui-danger);background:var(--ui-danger-bg)}

  /* The sign-in page uses the same typography and controls as the workspace. */
  body:not(.app-mode){font-family:"Segoe UI",Arial,sans-serif;background:#edf0f4;color:#202b3a}
  body:not(.app-mode)>header{margin:16px 0 26px}
  body:not(.app-mode) .brand{font-size:21px;color:#273547}
  body:not(.app-mode) .logo{background:#273547;border-radius:10px;box-shadow:0 3px 8px #172b4620}
  body:not(.app-mode)>main{border-color:#d5dde7;box-shadow:0 8px 28px #172b4610;border-radius:12px;padding:30px}
  body:not(.app-mode) h1{font-size:25px;font-weight:650;letter-spacing:-.6px}
  body:not(.app-mode) .sub{font-size:14px;color:#526176;line-height:1.6;margin-bottom:22px}
  body:not(.app-mode) label{font-size:13px;color:#526176;margin-bottom:7px}
  body:not(.app-mode) input{height:44px;background:#fff;border-color:#c8d2df;font-size:14px;border-radius:7px}
  body:not(.app-mode) .primary{background:#273547;min-height:44px;font-size:13px}
  body:not(.app-mode) .primary:hover{background:#354a63}
  body:not(.app-mode) .show{top:12px}
  body:not(.app-mode) .lock{background:#eaf2fc;color:#265f9e;border:1px solid #d5dde7;margin-bottom:18px}
  body:not(.app-mode) .help,body:not(.app-mode)>footer{color:#526176;font-size:12px}
  html[data-theme="dark"] body:not(.app-mode){background:var(--ui-page)!important;color:var(--ui-ink)}
  html[data-theme="dark"] body:not(.app-mode)>main{background:var(--ui-surface)!important;border-color:var(--ui-line);color:var(--ui-ink);box-shadow:0 8px 28px #0002}
  html[data-theme="dark"] body:not(.app-mode) :is(.brand,label,.sub,.help,.hint,footer){color:var(--ui-muted)}
  html[data-theme="dark"] body:not(.app-mode) .primary{background:#e6e9ed!important;color:#16191d!important}
  html[data-theme="dark"] body:not(.app-mode) .text-button{color:var(--ui-accent)}
  html[data-theme="dark"] body:not(.app-mode) .lock{background:var(--ui-raised);color:var(--ui-accent);border-color:var(--ui-line)}

  @media(max-width:1100px){
    .app-shell .page-container{padding:18px 20px 32px}
    .app-shell .presence-box{width:calc(100% - 40px)}
    .app-shell .app-topbar>.account-tabs button{padding:6px 9px}
    .app-shell #editor-form:has(#f-street):not(:has(#purchase-search)) .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .app-shell dialog.compact-parts-editor .document-line{grid-template-columns:72px 80px 108px minmax(80px,1fr) 28px}
    .app-shell dialog.compact-parts-editor .document-line-name{grid-column:1/-1}
    .app-shell dialog.compact-parts-editor .document-line>div:nth-child(4){grid-column:auto}
    .app-shell .tool-capture-host #tool-lines>.tool-line-card{grid-template-columns:1fr}
  }
  @media(min-width:1101px){
    .app-shell #editor-form:has(#f-street) .field:has(#f-tax_regime){grid-column:span 3}
    .app-shell #editor-form:has(#f-street) .field:has(#f-phone){grid-column:span 2}
  }
  @media(max-width:760px){
    .app-shell .table-scroll :is(th,td).numeric,.app-shell .table-scroll td[data-numeric="true"]{text-align:left;white-space:normal}
    .app-shell #toast.status{top:120px}
    .app-shell .filterable-table{scroll-margin-top:120px}
    .app-shell .page-container{padding:16px 12px 28px}
    .app-shell .presence-box{width:calc(100% - 24px);margin-top:12px}
    .app-shell .page-heading h1{font-size:23px}
    .app-shell .page-heading{align-items:flex-start;gap:10px}
    .app-shell .app-topbar:has(>.account-tabs){display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:8px;padding:8px 12px}
    .app-shell .app-topbar>.mobile-menu-toggle{grid-column:1;grid-row:1;min-height:34px!important;background:var(--ui-raised)!important;border:1px solid var(--ui-line)!important;color:var(--ui-ink)!important;box-shadow:none;font-size:12px;padding:6px 9px}
    .app-shell .app-topbar>.appearance-control{grid-column:2;grid-row:1;margin-left:auto;font-size:10px}
    .app-shell .app-topbar>.app-settings-button{grid-column:3;grid-row:1;margin:0;padding:7px;min-height:34px}
    .app-shell .app-topbar>.account-tabs{grid-column:1/-1;grid-row:2;width:100%;max-width:100%;margin:0}
    .app-shell .app-topbar>.account-tabs button{font-size:11px}
    .app-shell :is(input,select,textarea,[role="listbox"],.table-scroll){scroll-margin-top:124px}
    .app-shell .monthly-summary{padding:14px}
    .app-shell .monthly-summary>.section-heading{gap:10px;align-items:start}
    .app-shell .monthly-summary .monthly-stats{gap:8px}
    .app-shell .stats>article{padding:13px}
    .app-shell .monthly-stats article{min-height:0}
    .app-shell .monthly-stats article strong{font-size:25px}
    .app-shell .monthly-comparison{gap:7px 16px}
    .app-shell .document-capture-host>dialog{padding:12px!important}
    .app-shell .form-inline-toolbar{align-items:flex-start}
    .app-shell .form-inline-toolbar{top:120px}
    .app-shell .form-inline-toolbar .dialog-actions{justify-content:flex-start}
    .app-shell .table-scroll td{padding:7px 10px}
    .app-shell .column-filters th{padding:6px!important}
    .app-shell .column-filters input{min-height:32px;height:32px}
    .app-shell .table-scroll tbody tr:not(.table-empty){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0;margin:8px;padding:0;border:1px solid var(--ui-line);border-radius:7px;overflow:hidden}
    .app-shell .table-scroll tbody td{display:block;min-width:0;margin:0;border:0;border-bottom:1px solid var(--ui-soft-line);overflow-wrap:anywhere;text-align:left}
    .app-shell .table-scroll tbody td.numeric{white-space:normal}
    .app-shell .table-scroll tbody td::before{display:block;margin-bottom:4px;font-size:10px;font-weight:600;color:var(--ui-muted);text-transform:none}
    .app-shell .table-scroll tbody td:last-child{grid-column:1/-1;border-bottom:0}
    html[data-theme] .app-shell .table-scroll tbody tr{background:var(--ui-surface)}
    html[data-theme] .app-shell .table-scroll tbody tr.event-positive{background:var(--ui-success-bg)}
    html[data-theme] .app-shell .table-scroll tbody tr.event-negative{background:var(--ui-danger-bg)}
    html[data-theme] .app-shell .table-scroll tbody tr:hover{background:var(--ui-accent-soft)}
    .app-shell .column-filters th:not(:has(input)){display:none}
    .app-shell .table-scroll td .account-row-actions{flex-direction:row;flex-wrap:wrap;gap:5px}
    .app-shell .table-scroll td :is(.text-button,.table-link,.danger-button,.secondary){display:inline-flex;margin:0 4px 0 0;min-height:32px;width:auto;white-space:normal;font-size:12px}
    .app-shell .table-scroll .table-empty{display:block}
    .app-shell .table-scroll .table-empty td{display:block}
    .app-shell .product-pagination{padding:10px 12px;gap:8px}
    .app-shell .product-pagination>span{font-size:11px}
    .app-shell .tool-capture-host .tool-editor-actions{justify-content:flex-start}
    .app-shell dialog:has(.tool-editor-actions) #tool-lines .tool-line-fields{grid-template-columns:70px minmax(0,1fr) minmax(0,1fr);gap:8px}
    .app-shell #tool-lines .tool-line-fields label{font-size:11px}
    .app-shell #tool-lines .tool-line-fields input[type=date]{font-size:11px;padding:5px}
    .app-shell .interface-settings-body{padding:14px;gap:14px}
    .app-shell .interface-settings-heading{padding:12px 14px;gap:14px}
    .app-shell #tool-excel-status [data-missing-product]{grid-template-columns:1fr 80px auto;gap:8px}
    .app-shell #tool-excel-status [data-missing-product] label:nth-child(2){grid-column:1/-1;grid-row:2}
  }
  @media(max-width:520px){
    .app-shell .app-topbar>.appearance-control>span{display:none}
    .app-shell .app-settings-button>span{display:none}
    .app-shell .appearance-control{padding:3px}
    .app-shell .appearance-control select{width:92px}
    .app-shell .form-grid{gap:7px 10px}
    .app-shell #editor-form:has(#f-street):not(:has(#purchase-search)) .form-grid{grid-template-columns:1fr}
    .app-shell #editor-form:has(#f-street) .field{grid-column:1!important}
    .app-shell dialog.compact-parts-editor .document-line{position:relative;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;padding:9px}
    .app-shell dialog.compact-parts-editor .document-line-name{grid-template-columns:80px minmax(0,1fr);padding-right:26px;gap:3px 8px}
    .app-shell dialog.compact-parts-editor .document-line .remove-line{position:absolute;top:7px;right:5px}
    .app-shell dialog.compact-parts-editor .document-line input{padding:5px;font-size:12px;min-height:34px;height:34px}
    .app-shell dialog.compact-parts-editor .document-line label{font-size:10px}
    .app-shell dialog.compact-parts-editor .document-line-name>strong+.cell-note{font-size:11px}
    .app-shell dialog.compact-parts-editor .document-line>div:nth-child(5){grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--ui-soft-line);padding-top:6px;gap:10px}
    .app-shell dialog.compact-parts-editor .document-line>div:nth-child(5) label{margin:0}
    .app-shell dialog.compact-parts-editor .totals-preview{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
    .app-shell dialog.compact-parts-editor .totals-preview .grand-total{border:0;padding:0}
    .app-shell .tool-summary{grid-template-columns:1fr;gap:7px}
    .app-shell .tool-summary>div{padding:9px 12px;display:flex;align-items:center}
    .app-shell .tool-capture-host #tool-lines>.tool-line-card{padding:10px}
    .app-shell dialog:has(.tool-editor-actions) #tool-lines .tool-line-fields{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
    .app-shell #tool-lines .tool-line-fields>label:first-child{grid-column:1/-1;max-width:100px}
    .app-shell #tool-lines .tool-line-fields input[type=date]{font-size:12px;height:34px;min-height:34px}
    .app-shell .table-toolbar .searchbox{width:100%}
    .app-shell .quick .actions{flex-wrap:wrap}
    .app-shell .monthly-summary .section-heading label{justify-content:space-between;width:100%}
    .app-shell .monthly-summary .section-heading input[type=month]{width:170px}
  }
  @media(prefers-reduced-motion:reduce){.app-shell :is(button,input,select,textarea){transition:none}}
}
/* Detail pass: readable table actions, field states and quiet empty lists. */
@media screen {
 .app-shell .hint:empty,.app-shell #tool-preview:empty{display:none}
 .app-shell .field>label:has(+:is(input,select,textarea)[required])::after{content:' *';color:var(--ui-accent);font-weight:700}
 .app-shell dialog :is(input,select,textarea,[role="listbox"]){scroll-margin-top:140px}
 .app-shell .document-client-preview:not(:empty){margin:6px 0 0;padding:7px 9px;border-left:2px solid var(--ui-accent);border-radius:0 5px 5px 0;background:var(--ui-raised);line-height:1.5;font-size:11px;overflow-wrap:anywhere}
 .app-shell .table-scroll th:last-child{white-space:nowrap}
 .app-shell .table-scroll td[data-label="Acciones"]{white-space:nowrap}
 .app-shell .table-scroll td[data-label="Acciones"]> :is(button,a){border-radius:5px;padding:5px 7px;margin-right:3px}
 .app-shell .table-scroll td[data-label="Acciones"]> :is(button,a):hover{background:var(--ui-raised);text-decoration:none}
 html[data-theme] .app-shell .table-scroll tbody tr:focus-within>td{background:var(--ui-accent-soft)!important}
 .app-shell .table-filter-tools [data-filters-active="true"]{padding:5px 8px;background:var(--ui-accent-soft);border:1px solid var(--ui-line);border-radius:5px}
 .app-shell .column-filters th:has(input:focus){background:var(--ui-accent-soft)!important}
 .app-shell .table-empty td::before{display:none!important}
 .app-shell .table-empty-content{display:flex;align-items:center;justify-content:center;gap:10px;min-height:42px;color:var(--ui-muted);font-size:12px;line-height:1.5}
 .app-shell .table-empty-content svg{width:23px;height:23px;flex-shrink:0;opacity:.7}
 .app-shell .table-empty-content span{max-width:520px;text-align:left}
 .app-shell .status.error{border:1px solid color-mix(in srgb,var(--ui-danger) 30%,transparent)}
 .app-shell .business-settings-layout{gap:18px;align-items:start}
 .app-shell .business-logo-card{margin-top:0!important}
 .app-shell .business-email-card{padding:16px 18px}
 .app-shell .business-email-card .section-heading{padding:0 0 12px}
 .app-shell .business-email-card .hint{margin-bottom:0}
 .app-shell .settings-form{padding:20px}
 .app-shell .settings-form>h2{margin:0 0 16px}
 .app-shell .settings-form>p{font-size:12px;line-height:1.6;margin:0 0 16px;color:var(--ui-muted)}
 .app-shell .settings-form>button{width:auto;max-width:100%}
 .app-shell .invoice-import-note{background:var(--ui-raised);border-color:var(--ui-soft-line);padding:10px 16px}
 .app-shell .cheque-provider-results{scrollbar-width:thin}
 .app-shell .cheque-provider-results button:focus-visible{outline-offset:-3px}
 @media(max-width:760px){
  .app-shell dialog :is(input,select,textarea,[role="listbox"]){scroll-margin-top:230px}
  .app-shell .table-scroll td[data-label="Acciones"]{white-space:normal;display:flex;flex-wrap:wrap;align-items:center;gap:3px}
  .app-shell .table-scroll td[data-label="Acciones"]::before{flex-basis:100%;margin-bottom:0}
  .app-shell .table-empty-content{padding:8px 2px;min-height:56px}
  .app-shell .settings-form{padding:16px}
  .app-shell .business-email-card{padding:14px}
 }
}
@media screen {
 .app-shell .table-filter-tools .table-load-error{color:var(--ui-danger)!important;white-space:normal;max-width:50ch}
 .app-shell .table-filter-tools:has(.table-load-error){flex-wrap:wrap;justify-content:flex-end;gap:8px}
 .app-shell .table-filter-tools [data-table-retry]{font-size:11px;min-height:30px;padding:5px 9px}
 .app-shell #form-status{scroll-margin-top:140px}
}
@media screen {
 .app-shell .totals-preview strong{min-width:0;overflow-wrap:anywhere}
}
/* PDF workflows share one preview, one download action and a native-viewer fallback. */
@media screen {
 .app-shell .pdf-workflow{display:flex;align-items:center;gap:12px;list-style:none;margin:0;padding:10px 0 14px;border-bottom:1px solid var(--ui-soft-line)}
 .app-shell .pdf-workflow li{display:flex;align-items:center;gap:7px;color:var(--ui-muted);font-size:12px;line-height:1.4}
 .app-shell .pdf-workflow li+li::before{content:'›';margin-right:5px;opacity:.6;font-size:18px}
 .app-shell .pdf-workflow li>span{display:grid;place-items:center;flex-shrink:0;width:23px;height:23px;border:1px solid var(--ui-line);border-radius:50%;font-size:11px;font-weight:650;background:var(--ui-raised)}
 .app-shell .pdf-workflow .current{color:var(--ui-ink);font-weight:650}
 .app-shell .pdf-workflow .current>span{color:var(--ui-accent);border-color:var(--ui-accent);background:var(--ui-accent-soft)}
 .app-shell .pdf-workflow .complete>span{color:var(--ui-success);background:var(--ui-success-bg);border-color:var(--ui-success)}
 .app-shell .pdf-workflow-host{margin-bottom:12px}
 .app-shell .pdf-preview-panel{background:var(--ui-raised);border:1px solid var(--ui-line);border-radius:9px;overflow:hidden;margin:12px 0}
 .app-shell .pdf-preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;background:var(--ui-raised);border-bottom:1px solid var(--ui-soft-line)}
 .app-shell .pdf-preview-toolbar strong{font-size:13px;display:block;color:var(--ui-ink)}
 .app-shell .pdf-preview-toolbar small{display:block;font-size:11px;color:var(--ui-muted);margin-top:3px;line-height:1.4}
 .app-shell .pdf-preview-toolbar>a{flex-shrink:0;text-decoration:none;display:inline-flex;align-items:center;min-height:34px;font-size:12px}
 .app-shell .pdf-inline-preview>summary{padding:8px 14px;cursor:pointer;font-size:12px;font-weight:500;color:var(--ui-muted)}
 .app-shell .pdf-preview-panel .invoice-preview{margin:0!important;max-height:none!important;overflow:hidden;border:0;border-top:1px solid var(--ui-soft-line);border-radius:0;background:var(--ui-raised)}
 .app-shell .pdf-preview-panel iframe{display:block;width:100%;height:clamp(360px,68vh,820px);border:0;background:var(--ui-raised);margin:0}
 .app-shell .pdf-draft-actions{position:sticky;top:132px;z-index:20;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;padding:12px;background:var(--ui-accent-soft);border:1px solid var(--ui-line);border-radius:8px;margin:12px 0 0}
 .app-shell .pdf-draft-actions strong{display:block;font-size:14px;color:var(--ui-ink)}
 .app-shell .pdf-draft-actions small{display:block;font-size:12px;color:var(--ui-muted);margin-top:3px}
 .app-shell .pdf-draft-actions .actions{gap:7px}
 .app-shell .pdf-document-meta{display:grid;grid-template-columns:minmax(0,2fr) minmax(120px,1fr) minmax(120px,1fr) auto;gap:12px;align-items:center;padding:12px 14px;margin:14px 0;background:var(--ui-raised);border:1px solid var(--ui-soft-line);border-radius:8px}
 .app-shell .pdf-document-meta>div{min-width:0}
 .app-shell .pdf-document-meta small{display:block;color:var(--ui-muted);font-size:11px;margin-bottom:4px}
 .app-shell .pdf-document-meta strong{display:block;color:var(--ui-ink);font-size:13px;font-weight:600;overflow-wrap:anywhere}
 .app-shell .pdf-document-meta:has(>div:nth-child(2):last-child){grid-template-columns:1fr 1fr}
 .app-shell .pdf-main-actions{gap:8px;margin:12px 0}
 .app-shell .pdf-main-actions a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
 .app-shell .pdf-document-options{margin:16px 0 0;border:1px solid var(--ui-soft-line);border-radius:7px;padding:10px 12px;font-size:12px}
 .app-shell .pdf-document-options summary{color:var(--ui-muted);font-weight:600;cursor:pointer}
 .app-shell .pdf-document-options .document-actions{margin:10px 0 0;gap:8px}
 .app-shell #invoice-draft{scroll-margin-top:138px}
 @media(max-width:760px){
  .app-shell .pdf-preview-toolbar{align-items:flex-start;flex-wrap:wrap;padding:10px}
  .app-shell .pdf-preview-toolbar>a{min-height:36px}
  .app-shell .pdf-draft-actions{top:220px}
  .app-shell .pdf-document-meta{grid-template-columns:1fr 1fr;padding:10px;gap:10px}
  .app-shell .pdf-document-meta>div:first-child{grid-column:1/-1}
  .app-shell .pdf-document-meta:has(>div:nth-child(2):last-child){grid-template-columns:1fr}
  .app-shell .pdf-workflow{gap:8px;justify-content:space-between}
  .app-shell .pdf-workflow li{font-size:10px;gap:5px;flex-direction:column;align-items:flex-start}
  .app-shell .pdf-workflow li+li::before{display:none}
  .app-shell .pdf-preview-panel iframe{height:60vh;min-height:340px}
  .app-shell #invoice-draft{scroll-margin-top:230px}
 }
}
@media screen {
 .app-shell .document-actions>a:is(.primary,.secondary),.app-shell #cheque-form .actions>a{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;font-size:12px}
}
