/* RATING Workspace 1.0 — shared screen design; PDF templates are intentionally separate. */
:root {
  --ui-bg:#f3f6fa;--ui-surface:#fff;--ui-soft:#f7f9fc;--ui-text:#1c2b3a;
  --ui-muted:#5d7084;--ui-line:#d9e2ec;--ui-primary:#245ce2;--ui-hover:#174ac5;
  --ui-tint:#edf3ff;--ui-nav:#123341;--ui-nav-text:#d2e1e9;--ui-gold:#efc348;
  --ui-danger:#bd3939;--ui-success:#147b60;--ui-control:48px;--ui-sidebar:264px;
  --ui-radius:12px;--ui-shadow:0 3px 16px rgb(23 42 69 / 4%);
  color-scheme:light;
}
html[data-theme=dark] {
  --ui-bg:#111a24;--ui-surface:#1b2836;--ui-soft:#17222f;--ui-text:#edf3fa;
  --ui-muted:#a9bbcd;--ui-line:#35495e;--ui-primary:#356bdf;--ui-hover:#2d60d0;
  --ui-tint:#243c60;--ui-nav:#0e2632;--ui-nav-text:#ccdae7;
  --ui-danger:#ff9696;--ui-success:#65d7b3;--ui-shadow:none;color-scheme:dark;
}
html,:root[data-theme] {
  --ink:var(--ui-text);--slate:var(--ui-text);--muted:var(--ui-muted);--canvas:var(--ui-bg);
  --paper:var(--ui-surface);--panel:var(--ui-surface);--surface:var(--ui-surface);--surface-soft:var(--ui-soft);
  --line:var(--ui-line);--coral:var(--ui-primary);--coral-dark:var(--ui-hover);--mint:var(--ui-success);--shadow:var(--ui-shadow);
}
html body {margin:0;background:var(--ui-bg);color:var(--ui-text);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px;line-height:1.55}
html *,html *::before,html *::after {box-sizing:border-box}
html [hidden] {display:none!important}
html :focus-visible {outline:3px solid var(--ui-primary);outline-offset:3px}
html body .app-shell {display:block;min-height:100dvh}
html body main.workspace {margin:0 0 0 var(--ui-sidebar);padding:100px clamp(20px,2.5vw,48px) 40px;width:auto;max-width:none;min-width:0}
/* Page-level sections can be centered on very wide screens. Financial ledger sections must
   fill the same working column; auto side margins would otherwise shrink ordinary panels
   to their content width while wide tables happened to stretch. */
html body main.workspace>* {max-width:1840px;margin-left:auto;margin-right:auto}
html body main.workspace>.ledger>* {max-width:none;width:100%;margin-left:0;margin-right:0}
html body :is(.panel,.module-card,.metric,.ledger-card,.report-kpi,.finance-stat,.time-stat) {background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow);min-width:0}
html body .panel {padding:24px;margin-bottom:22px}
html body :is(.hero,.hero.compact,.page-heading) {background:var(--ui-surface);color:var(--ui-text);border:1px solid var(--ui-line);border-radius:var(--ui-radius);box-shadow:none;min-height:0;padding:26px 28px;margin-bottom:24px;overflow:visible}
html body :is(.hero,.page-heading)::before,html body :is(.hero,.page-heading)::after {display:none}
html body :is(.hero,.page-heading) h1 {font-size:clamp(26px,2.1vw,38px);line-height:1.2;letter-spacing:-.035em;margin:4px 0 10px;color:var(--ui-text)}
html body :is(.hero,.page-heading) p {color:var(--ui-muted);margin:6px 0;max-width:850px;font-size:15px}
html body :is(.eyebrow,.hero .eyebrow,.page-heading .eyebrow) {font-size:11px;font-weight:750;letter-spacing:.13em;color:var(--ui-primary)}
html[data-theme=dark] body :is(.eyebrow,.hero .eyebrow,.page-heading .eyebrow) {color:#a3bfff}
html body h2 {font-size:21px;line-height:1.35;letter-spacing:-.02em;color:var(--ui-text)}
html body h3 {font-size:17px;line-height:1.4;color:var(--ui-text)}
html body :is(.muted,.finance-note,.report-note) {color:var(--ui-muted)}
/* Native controls share one sizing contract, including Safari select and date inputs. */
html body :is(main,.rating-auth,dialog) :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]):not([type=range]),select:not([multiple]):not([size])) {
  display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;
  height:var(--ui-control)!important;min-height:var(--ui-control)!important;box-sizing:border-box!important;
  padding:11px 13px!important;border:1px solid var(--ui-line)!important;border-radius:8px!important;
  background-color:var(--ui-soft)!important;color:var(--ui-text)!important;font:inherit!important;line-height:24px!important;
}
html body :is(main,.rating-auth,dialog) select:not([multiple]):not([size]) {
  appearance:none!important;-webkit-appearance:none!important;padding-right:38px!important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238298ad' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")!important;
  background-size:18px 18px!important;background-repeat:no-repeat!important;background-position:right 12px center!important;
}
html body :is(main,.rating-auth,dialog) :is(textarea,select[multiple],select[size]) {box-sizing:border-box;display:block;width:100%;min-width:0;max-width:100%;min-height:48px;padding:11px 13px;border:1px solid var(--ui-line);border-radius:8px;background:var(--ui-soft);color:var(--ui-text);font:inherit;line-height:24px}
html body :is(main,.rating-auth,dialog) textarea {resize:vertical}
html body :is(main,.rating-auth,dialog) textarea:not(.grow-field) {height:48px}
html body :is(main,.rating-auth,dialog) :is(input,textarea)::placeholder {color:var(--ui-muted);opacity:.85;font-weight:400}
html body :is(main,.rating-auth,dialog) input:is([type=checkbox],[type=radio]) {appearance:auto!important;width:20px!important;height:20px!important;min-height:20px!important;padding:0!important;flex:0 0 20px;accent-color:var(--ui-primary)}
html body :is(main,.rating-auth,dialog) :is(input,select,textarea):disabled {opacity:.65;cursor:not-allowed}
html body :is(main,.rating-auth,dialog) label {color:var(--ui-muted);font-size:13px;font-weight:650;min-width:0}
html body :is(main,.rating-auth,dialog) label>:is(input,select,textarea) {margin-top:6px}
html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form,.form-stack,.visit-grid) {gap:18px 20px;align-items:start}
html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form)>* {min-width:0}
html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form)>:is(.full,.span2,.form-actions,.time-note,.ui-field-wide) {grid-column:1/-1}
html body :is(.payment-form,.time-entry-form)>button {grid-column:1/-1;justify-self:start;margin-top:2px}
html body :is(.form-grid,.ledger-form)>button {align-self:end}
html body :is(.form-actions,.ledger-actions,.field-actions,.invoice-actions,.offer-actions,.ui-actions) {display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin-top:20px}
html body :is(.ledger-filter,.vat-controls,.report-filter,.finance-rate-form,.time-week-form) {gap:12px;align-items:end}
/* Priority sizes: main 176px, secondary 152px, table actions compact, icon actions 44px. */
html body :is(button,.button,.create-button) {font-family:inherit;font-size:14px;font-weight:650;line-height:1.35}
html body :is(main,.rating-auth,dialog) :is(.button,button:not(.ui-icon-button):not(.field-icon)) {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;min-width:152px;max-width:100%;padding:11px 18px;border-radius:8px;
  border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-text);box-shadow:none;text-decoration:none;text-align:center;white-space:normal;cursor:pointer;
}
html body :is(main,.rating-auth,dialog) :is(.button.primary,button.primary,.button:not(.secondary):not(.danger):not(.finance-delete):not(.time-delete)),html body :is(.payment-form,.time-entry-form,.auth-form)>button {
  min-width:176px;background:var(--ui-primary);border-color:var(--ui-primary);color:white;
}
html body :is(main,.rating-auth,dialog) :is(button,.button):hover {filter:brightness(.96)}
html body :is(main,.rating-auth,dialog) :is(.danger,.finance-delete,.time-delete,.button.danger) {background:transparent;border-color:var(--ui-danger);color:var(--ui-danger)}
html body :is(main,.rating-auth,dialog) :is(td,.ledger-table,.sketch-tools) :is(button,.button) {min-width:0;min-height:36px;padding:7px 12px;font-size:13px}
html body :is(.metrics,.finance-metrics,.time-metrics,.ledger-cards,.report-kpis) {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:24px}
html body :is(.metrics>*,.finance-metrics>*,.time-metrics>*,.ledger-card,.report-kpi) {padding:20px;background:var(--ui-surface);border:1px solid var(--ui-line);border-radius:12px;min-width:0;box-shadow:none}
html body :is(.metrics,.finance-metrics,.time-metrics,.ledger-cards,.report-kpis) strong {font-size:clamp(23px,1.8vw,30px);letter-spacing:-.035em;line-height:1.3}
html body :is(.table-wrap,.ledger-table,.report-table-wrap,.ui-table-scroll) {width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;min-width:0}
html body table {border-collapse:collapse;width:100%;font-size:14px}
html body table th {background:var(--ui-soft);color:var(--ui-muted);font-size:11px;font-weight:750;letter-spacing:.07em;padding:14px 16px;border-bottom:1px solid var(--ui-line)}
html body table td {color:var(--ui-text);padding:16px;border-bottom:1px solid var(--ui-line);vertical-align:middle}
html body tbody tr:hover {background:var(--ui-soft)}
html body :is(.good,.finance-positive) {color:var(--ui-success)}
html body :is(.risk,.finance-negative) {color:var(--ui-danger)}
html body .ledger {--ledger-line:var(--ui-line);--ledger-muted:var(--ui-muted);--ledger-bg:var(--ui-surface);--input-bg:var(--ui-soft);--table-head:var(--ui-soft)}
html body.report-page {--report-bg:var(--ui-surface);--report-panel:var(--ui-surface);--report-border:var(--ui-line);--report-soft:var(--ui-soft);--report-ink:var(--ui-text);--report-muted:var(--ui-muted);--report-line:var(--ui-line);--report-accent:var(--ui-primary)}
html body .field-save {background:var(--ui-surface);border:1px solid var(--ui-line);top:82px}
html body .field-canvas,html body canvas {background:#fff}
/* App chrome. Explicit classes replace legacy nth-child navigation decoration. */
html body .sidebar {position:fixed;inset:0 auto 0 0;width:var(--ui-sidebar);height:100dvh;background:var(--ui-nav);border:0;border-right:1px solid rgb(255 255 255 / 6%);padding:18px 14px;display:flex;flex-direction:column;z-index:80;transform:none;overflow:hidden;border-radius:0}
html body .sidebar .brand {height:64px;min-height:64px;display:flex;align-items:center;gap:12px;background:none;border:0;padding:8px 10px;margin:0 0 14px;color:#fff;border-radius:0;text-decoration:none;box-shadow:none}
html body .sidebar .brand::before {display:none!important}
html body .sidebar .brand-logo {display:block;width:35px;height:43px;object-fit:contain;flex:0 0 35px}
html body .sidebar .brand-name {display:block;font-size:17px;font-weight:750;letter-spacing:.12em;white-space:nowrap}
html body .sidebar .brand-name b {color:var(--ui-gold);font-size:10px;letter-spacing:.07em}
html body .sidebar nav {display:flex;flex-direction:column;gap:0;overflow-y:auto;overflow-x:hidden;flex:1;min-height:0;scrollbar-width:thin;scrollbar-color:#466171 transparent;padding:0 0 10px;margin:0}
html body .sidebar nav a::before,html body .sidebar nav a::after {display:none!important}
html body .sidebar nav :is(a,summary) {min-height:42px;display:flex;align-items:center;gap:11px;padding:10px 12px;border:0;border-radius:7px;background:transparent;color:var(--ui-nav-text);font-size:13px;font-weight:550;line-height:1.4;text-decoration:none;letter-spacing:0;position:relative;margin:2px 0;cursor:pointer;box-shadow:none}
html body .sidebar nav :is(a,summary):hover {background:rgb(255 255 255 / 7%);color:white}
html body .sidebar nav a[aria-current=page],html body .sidebar nav .finance-nav-group.is-current>summary {background:#245ce2;color:#fff;box-shadow:none}
html body .sidebar .ui-nav-label {min-width:0;flex:1}
html body .ui-icon {width:20px;height:20px;display:block;flex:0 0 20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
html body .ui-nav-section {margin-top:18px}
html body .ui-nav-heading {font-size:10px;font-weight:700;letter-spacing:.14em;color:#8da7b8;margin:0 12px 8px;text-transform:uppercase}
html body .sidebar .finance-nav-group {margin:0;border:0;padding:0;display:block}
html body .sidebar .finance-nav-group>summary {list-style:none;padding-right:30px}
html body .sidebar .finance-nav-group>summary::-webkit-details-marker {display:none}
html body .sidebar .finance-nav-group>summary::after {content:'›';position:absolute;right:13px;font-size:21px;transform:rotate(0);color:inherit}
html body .sidebar .finance-nav-group[open]>summary::after {transform:rotate(90deg)}
html body .sidebar .finance-nav-links {display:block;border-left:1px solid #3b5667;margin:6px 0 4px 21px;padding:0 0 0 11px}
html body .sidebar .finance-nav-group:not([open])>.finance-nav-links {display:none}
html body .sidebar .finance-nav-links a {padding:9px 8px;min-height:38px;font-size:12px}
html body .sidebar .finance-nav-links a .ui-icon {display:none}
html body .sidebar .ui-pin {border:0;background:transparent;color:#8ca9bb;border-radius:5px;min-width:28px;width:28px;height:28px;min-height:28px;padding:5px;position:absolute;right:4px;top:7px;cursor:pointer;opacity:0}
html body .sidebar .ui-nav-row {position:relative}
html body .sidebar .ui-nav-row>a {padding-right:33px}
html body .sidebar .ui-nav-row:is(:hover,:focus-within)>.ui-pin,html body .sidebar .ui-pin[aria-pressed=true] {opacity:1}
html body .sidebar .ui-pin[aria-pressed=true] {color:var(--ui-gold)}
html body .sidebar .ui-pin .ui-icon {width:17px;height:17px}
html body .ui-menu-search {display:flex;align-items:center;gap:8px;background:rgb(255 255 255 / 5%);border:1px solid #365462;border-radius:8px;padding:0 10px;margin-bottom:6px;min-height:42px;color:#a8c0cf}
html body .ui-menu-search input {min-width:0;width:100%;height:40px;background:transparent;border:0;border-radius:0;color:#fff;font:inherit;font-size:12px;padding:0;outline-offset:0}
html body .ui-menu-search input::placeholder {color:#a8c0cf}
html body .ui-search-empty {color:var(--ui-nav-text);font-size:13px;padding:16px 12px}
html body .sidebar-footer {margin-top:10px;padding-top:12px;border-top:1px solid #34505f;display:grid;gap:5px}
html body .sidebar-footer a {display:flex;align-items:center;justify-content:center;min-height:40px;padding:8px;color:var(--ui-nav-text);font-size:12px;border-radius:7px;background:transparent;text-decoration:none}
html body .sidebar-footer a:first-child {background:rgb(255 255 255 / 7%);border:1px solid #3b5866;color:white}
html body .topbar {position:fixed;inset:0 0 auto var(--ui-sidebar);width:auto;height:72px;padding:12px 28px;display:flex;align-items:center;flex-direction:row;flex-wrap:nowrap;gap:16px;background:var(--ui-surface);border:0;border-bottom:1px solid var(--ui-line);box-shadow:none;z-index:50;color:var(--ui-text)}
html body .topbar-context {display:flex;flex-direction:column;flex:0 1 190px;min-width:0;margin:0}
html body .topbar-context small {color:var(--ui-muted);font-size:9px;letter-spacing:.13em;line-height:1.5}
html body .topbar-context strong {font-size:14px;color:var(--ui-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body .topbar .global-search {display:flex;align-items:center;flex:1 1 260px;min-width:100px;max-width:700px;margin:0 auto;height:44px;padding:0 12px;gap:10px;background:var(--ui-soft);border:1px solid var(--ui-line);border-radius:8px;color:var(--ui-muted)}
html body .topbar .global-search input {min-width:0;width:100%;height:40px;padding:0;border:0;background:transparent;box-shadow:none;color:var(--ui-text);font-size:13px}
html body .topbar .top-actions {display:flex;align-items:center;gap:10px;margin-left:auto;flex:0 0 auto}
html body :is(.topbar,.sidebar) :is(.top-icon,.sidebar-toggle,.theme-toggle,.ui-close-menu) {display:inline-flex;align-items:center;justify-content:center;width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;padding:0!important;border:1px solid var(--ui-line);background:var(--ui-surface);color:var(--ui-muted);border-radius:8px;cursor:pointer;flex:0 0 44px;box-shadow:none;font-size:0}
html body .topbar .create-button {display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:112px;max-width:200px;padding:10px 14px;border-radius:8px;background:var(--ui-primary);color:#fff;border:0;box-shadow:none;font-size:13px;text-decoration:none}
html body .topbar .top-user {display:flex;align-items:center;gap:8px;color:var(--ui-text);font-size:13px;white-space:nowrap}
html body .top-user i {display:flex;align-items:center;justify-content:center;width:32px;height:32px;background:#f5cc60;color:#483600;border-radius:50%;font-style:normal;font-size:12px}
html body .notification-link svg {width:21px;height:21px}
html body .notification-label {display:none}
html body .ui-close-menu {display:none!important}
html body .ui-backdrop {position:fixed;inset:0;background:rgb(4 14 27 / 58%);backdrop-filter:blur(2px);z-index:75;border:0;border-radius:0;cursor:pointer}
html body .ui-bottom-nav {display:none}
html body .ui-skip {position:fixed;top:-100px;left:280px;z-index:200;background:var(--ui-primary);color:white;padding:12px 20px;border-radius:8px}
html body .ui-skip:focus {top:10px}
html body.ui-rail {--ui-sidebar:76px}
html body.ui-rail:not(.ui-menu-open) .sidebar {padding-left:10px;padding-right:10px}
html body.ui-rail:not(.ui-menu-open) .sidebar :is(.brand-name,.ui-nav-label,.ui-nav-heading,.ui-menu-search,.sidebar-footer,.finance-nav-links,.ui-pin,.ui-favorites) {display:none!important}
html body.ui-rail:not(.ui-menu-open) .sidebar .brand {padding:5px;justify-content:center}
html body.ui-rail:not(.ui-menu-open) .sidebar nav :is(a,summary) {justify-content:center;padding:12px;min-height:44px}
html body.ui-rail:not(.ui-menu-open) .sidebar .finance-nav-group>summary::after {display:none}
html body.ui-rail:not(.ui-menu-open) .ui-nav-section {margin-top:12px;padding-top:12px;border-top:1px solid #34505f}
html body.ui-menu-open {overflow:hidden}
html body.ui-menu-open .sidebar {width:284px;box-shadow:10px 0 40px rgb(0 0 0 / 20%)}
html body.ui-menu-open .ui-close-menu {display:flex!important;position:absolute;top:27px;right:16px;background:transparent;border-color:#3b5866;color:white;width:32px!important;min-width:32px!important;height:32px!important;min-height:32px!important}
html body.ui-menu-open .sidebar .brand {padding-right:30px}
@media(min-width:2200px) {html body main.workspace {padding-left:max(48px,calc((100vw - var(--ui-sidebar) - 1840px)/2));padding-right:max(48px,calc((100vw - var(--ui-sidebar) - 1840px)/2))}}
@media(max-width:1199px) {html body .topbar {padding:12px 20px;gap:12px}html body .topbar-context {flex-basis:150px}html body .topbar .top-user {font-size:0;gap:0}html body :is(.metrics,.finance-metrics,.time-metrics,.ledger-cards,.report-kpis) {grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px) {
  html body .topbar .create-button {display:inline-flex;min-width:40px;width:40px;height:40px;min-height:40px;padding:0;font-size:0}
  html body .topbar .create-button::before {content:'+';font-size:23px;line-height:1}
  html body,html body.ui-rail {--ui-sidebar:0px}
  html body .sidebar {width:284px;transform:translateX(-100%);visibility:hidden;pointer-events:none}
  html body.ui-menu-open .sidebar {transform:none;visibility:visible;pointer-events:auto}
  html body main.workspace {margin-left:0;padding:136px 16px 96px;width:100%;max-width:100%}
  html body .topbar {left:0;height:116px;padding:10px 16px;gap:10px;flex-wrap:wrap;align-content:start}
  html body .topbar-context {flex:1;min-width:80px;max-width:none}
  html body .topbar .global-search {order:5;flex:1 0 100%;max-width:none;width:100%;height:40px}
  html body .topbar .global-search input {height:36px;font-size:16px}
  html body .topbar .top-actions {gap:6px}
  html body .topbar .top-user {display:none}
  html body .topbar :is(.top-icon,.sidebar-toggle,.theme-toggle) {width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;flex-basis:40px}
  html body :is(.panel,.ledger .panel) {padding:18px;margin-bottom:18px}
  html body :is(.hero,.hero.compact,.page-heading) {padding:20px;margin-bottom:18px;display:block}
  html body :is(.hero,.page-heading) h1 {font-size:27px}
  html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form,.visit-grid,.detail-grid,.module-grid,.report-filters) {grid-template-columns:1fr}
  html body :is(.form-grid,.ledger-form,.time-entry-form,.payment-form,.visit-grid)>* {grid-column:1/-1!important}
  html body :is(main,.rating-auth,dialog) :is(input,select,textarea) {font-size:16px!important}
  html body :is(.metrics,.finance-metrics,.time-metrics,.ledger-cards,.report-kpis) {gap:10px}
  html body :is(.metrics>*,.finance-metrics>*,.time-metrics>*,.ledger-card,.report-kpi) {padding:15px}
  html body :is(.metrics,.finance-metrics,.time-metrics,.ledger-cards,.report-kpis) strong {font-size:24px}
  html body :is(.form-actions,.ledger-actions,.field-actions)>:is(.button,button),html body :is(.payment-form,.time-entry-form)>button {width:100%;min-width:0}
  html body .field-save {top:124px}
  html body .ui-bottom-nav {position:fixed;bottom:0;left:0;right:0;z-index:60;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--ui-surface);border-top:1px solid var(--ui-line);padding:6px 8px max(7px,env(safe-area-inset-bottom));box-shadow:0 -4px 16px rgb(0 0 0 / 4%)}
  html body .ui-bottom-nav :is(a,button) {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:48px;border:0;background:transparent;color:var(--ui-muted);text-decoration:none;font-size:10px;font-weight:600;border-radius:8px;padding:4px}
  html body .ui-bottom-nav a[aria-current=page] {color:var(--ui-primary);background:var(--ui-tint)}
  html body .ui-skip {left:16px}
}
@media(prefers-reduced-motion:no-preference) {html body :is(.button,button,.sidebar nav a) {transition:background-color .15s,color .15s}}
@media print {.ui-bottom-nav,.ui-backdrop,.ui-skip {display:none!important}}
/* Explicit compatibility boundaries for legacy high-specificity page themes. */
html[data-theme] body .topbar .create-button {background:var(--ui-primary);color:#fff;box-shadow:none}
html body .sidebar .finance-nav-group::before,html body .sidebar::before {display:none!important}
html body .sidebar .finance-nav-links a[aria-current=page] {background:#284d66!important;box-shadow:inset 3px 0 #75a0ff}
html body .sidebar .finance-nav-links a:not([aria-current=page]) {color:var(--ui-nav-text)!important}
html body .sidebar .ui-menu-search input {background:transparent!important;border:0!important;box-shadow:none!important}
html[data-theme] body :is(.finance-summary,.finance-kpis) .negative,html[data-theme] body .finance-summary .warning {color:var(--ui-danger)}
html body :is(.payment-form,.time-entry-form,.ledger-form) label {gap:0}
html body :is(.task-form,.finance-cost-form,.company-cost-form,.offer-form,.invoice-form) {gap:18px 20px}
html body :is(.task-form,.finance-cost-form,.company-cost-form) {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
html body :is(.task-form,.finance-cost-form,.company-cost-form)>* {min-width:0;grid-column:auto}
html body :is(.task-form,.finance-cost-form,.company-cost-form)>:is(button,.task-description) {grid-column:1/-1;justify-self:stretch}
html body :is(.report-panel,.report-metric,.report-result) {background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line);border-radius:12px;box-shadow:none}
html body .report-hero {background:var(--ui-nav);padding:26px 28px;border-radius:12px;min-height:0}
html body .report-hero h1 {font-size:32px;letter-spacing:-.03em}
html body .project-workspace-hero {background:var(--ui-surface);color:var(--ui-text);padding:26px 28px;border-radius:12px;min-height:0}
html body .project-workspace-hero :is(h1,p) {color:var(--ui-text)}
html body .project-workspace-hero h1 {font-size:32px}
/* Commercial project path: derived from existing offers, billings, invoices and payments. */
html body .project-flow-panel {padding:24px;margin-bottom:22px}
html body .project-flow-panel .section-title {margin-bottom:18px}
html body .project-flow-list {list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;counter-reset:project-flow}
html body .project-flow-step {position:relative;display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:222px;padding:18px;border:1px solid var(--ui-line);border-radius:10px;background:var(--ui-soft);overflow:hidden}
html body .project-flow-step::after {content:'';position:absolute;top:30px;right:-15px;width:16px;height:1px;background:var(--ui-line)}
html body .project-flow-step:last-child::after {display:none}
html body .project-flow-number {display:inline-flex;align-items:center;justify-content:center;width:31px;height:31px;border-radius:50%;background:var(--ui-surface);border:1px solid var(--ui-line);color:var(--ui-muted);font-size:11px;font-weight:750;letter-spacing:.06em;flex:0 0 31px}
html body .project-flow-content {display:flex;flex:1;flex-direction:column;min-width:0;padding-top:13px}
html body .project-flow-content p {margin:0 0 4px;color:var(--ui-muted);font-size:12px;font-weight:700;line-height:1.35}
html body .project-flow-content strong {color:var(--ui-text);font-size:16px;line-height:1.35}
html body .project-flow-content small {display:block;margin-top:8px;color:var(--ui-muted);font-size:13px;line-height:1.45}
html body .project-flow-content em {margin-top:9px;color:var(--ui-text);font-size:13px;font-style:normal;font-weight:700}
html body .project-flow-step>.button {width:100%;min-width:0!important;margin-top:16px;padding-left:12px;padding-right:12px}
html body .project-flow-step.is-done {background:color-mix(in srgb,var(--ui-success) 7%,var(--ui-surface));border-color:color-mix(in srgb,var(--ui-success) 25%,var(--ui-line))}
html body .project-flow-step.is-done .project-flow-number {background:var(--ui-success);border-color:var(--ui-success);color:#fff}
html body .project-flow-step.is-active {background:var(--ui-tint);border-color:color-mix(in srgb,var(--ui-primary) 30%,var(--ui-line))}
html body .project-flow-step.is-active .project-flow-number {background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
html body .project-flow-step.is-attention {background:color-mix(in srgb,var(--ui-danger) 7%,var(--ui-surface));border-color:color-mix(in srgb,var(--ui-danger) 28%,var(--ui-line))}
html body .project-flow-step.is-attention .project-flow-number {background:var(--ui-danger);border-color:var(--ui-danger);color:#fff}
html body .project-flow-step.is-waiting {opacity:.88}
html body :is(td,.time-entry-row) :is(button,.button) {min-width:36px!important;width:auto!important;min-height:36px!important;padding:7px 12px!important}
html body .ui-search-results {position:absolute;top:calc(100% + 8px);left:0;right:0;max-height:340px;overflow-y:auto;border:1px solid var(--ui-line);border-radius:10px;padding:8px;background:var(--ui-surface);box-shadow:0 12px 35px rgb(0 0 0 / 15%);font-size:14px}
html body .ui-search-results a {display:flex;align-items:center;gap:10px;padding:12px;border-radius:6px;color:var(--ui-text);text-decoration:none}
html body .ui-search-results a:hover {background:var(--ui-tint)}
html body .ui-search-results p {margin:8px}
html body .topbar .global-search {position:relative}
html body .hero.compact h1 {font-size:clamp(27px,2.2vw,38px);line-height:1.2;margin:6px 0 12px}
html body .hero.compact>.button {margin-top:12px}
html body .metrics:has(>article:last-child:nth-child(3)) {grid-template-columns:repeat(3,minmax(0,1fr))}
html body .ui-start-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
html body .ui-start-grid>a {display:flex;flex-direction:column;gap:8px;padding:20px;border:1px solid var(--ui-line);border-radius:10px;text-decoration:none;color:var(--ui-text);background:var(--ui-soft)}
html body .ui-start-grid>a:hover {border-color:var(--ui-primary);background:var(--ui-tint)}
html body .ui-start-grid span {color:var(--ui-muted);font-size:13px}
html body .rating-auth {font-family:inherit;background:var(--ui-bg);color:var(--ui-text)}
html body .rating-auth .auth-entry {background:var(--ui-bg)}
html body .rating-auth h1 {color:var(--ui-text)}
html body .rating-auth .auth-story h2 {color:#fff;font-size:clamp(34px,3.4vw,54px)}
html body .rating-auth :is(.auth-intro,.auth-help,.auth-entry-footer) {color:var(--ui-muted)}
html body .rating-auth .auth-entry-footer {border-color:var(--ui-line)}
html body .rating-auth .auth-form .auth-submit {width:100%;min-height:48px;background:var(--ui-primary);border-color:var(--ui-primary);color:white;box-shadow:none}
html[data-theme] body .finance-metrics article.risk strong,html[data-theme] body .vat-overview-grid .due strong {color:var(--ui-danger)}
html[data-theme] body .finance-metrics article.good strong,html[data-theme] body .vat-overview-grid .credit strong {color:var(--ui-success)}
@media(max-width:767px) {
  html body .sidebar {width:min(284px,90vw)!important;padding:18px 14px!important}
  html body .sidebar nav :is(a,summary) {padding:10px 12px!important;margin:2px 0!important;min-height:44px!important;font-size:13px!important}
  html body .sidebar .ui-nav-row>a {padding-right:33px!important}
  html body .sidebar-footer a:first-child {display:flex!important}
  html body .sidebar-footer a::before {display:none!important}
  html body .sidebar .ui-pin {opacity:1}
  html body :is(.task-form,.finance-cost-form,.company-cost-form) {grid-template-columns:1fr}
  html body .report-hero h1 {font-size:27px}
  html body .ui-start-grid {grid-template-columns:1fr}
  html body .metrics:has(>article:last-child:nth-child(3)) {grid-template-columns:repeat(2,minmax(0,1fr))}
  html body .metrics>article:last-child:nth-child(3) {grid-column:1/-1}
  html body .project-form .form-actions {position:static;background:transparent}
  html body .project-flow-list {grid-template-columns:1fr;gap:10px}
  html body .project-flow-step {min-height:0;padding:16px 16px 16px 58px}
  html body .project-flow-step::after {display:none}
  html body .project-flow-number {position:absolute;left:16px;top:17px}
  html body .project-flow-content {padding-top:0}
  html body .project-flow-step>.button {margin-top:14px}
}
@media(min-width:768px) and (max-width:1279px) {html body .project-flow-list {grid-template-columns:repeat(2,minmax(0,1fr))}html body .project-flow-step:nth-child(2)::after {display:none}}
