:root{--paper:#f7f6f2;--panel:#fff;--ink:#2f2a29;--muted:#756c68;--line:#e3ddda;--accent:#463939;--green:var(--accent);--soft:#f0ebe8;--lime:#d8e69d;--warn:#8b633a;--danger:#a13f35;--radius:7px;--sidebar:236px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);font-size:14px}
*{box-sizing:border-box}body{margin:0;background:var(--paper)}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button,a,input,select,textarea{outline-offset:4px}button,a,input,select,textarea:focus-visible{outline-color:var(--green)}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}small{display:block;color:var(--muted);font-size:12px;line-height:1.5;margin-top:4px}.muted,.hint{color:var(--muted)}.hint{font-size:12px;line-height:1.6;margin:0 0 16px}.strong{font-weight:550}.preline{white-space:pre-line}.nowrap{white-space:nowrap}.numeric{text-align:right;font-variant-numeric:tabular-nums}.skip{position:absolute;left:-1000px}.skip:focus{left:250px;top:10px;z-index:20;background:white;padding:12px}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:#f0ede9;border-right:1px solid var(--line);padding:30px 20px 20px;display:flex;flex-direction:column;overflow:auto}.brand{display:flex;align-items:center;gap:14px;padding:0 6px 27px}.brand-mark{display:block;width:152px;max-width:100%;height:auto}.workspace-name{border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 4px;font-size:11px;display:flex;gap:7px;align-items:center}.studio-dot{width:6px;height:6px;background:var(--green);border-radius:50%}.tag{margin-left:auto;font-size:8px;letter-spacing:.8px;border:1px solid #ccd4c6;border-radius:3px;padding:3px 5px}.nav-label{font-size:9px;letter-spacing:1.5px;color:#8a9388;margin:25px 12px 9px}nav>a,nav .nav-bottom>a{padding:10px 13px;display:flex;align-items:center;gap:11px;border-radius:5px;font-size:12px;margin:2px 0;color:#665b57}nav a:hover{background:#e7e0db}nav a.selected{background:var(--green);color:white}.nav-icon{font-size:17px;width:20px;text-align:center}.nav-bottom{border-top:1px solid var(--line);padding-top:12px;margin-top:26px}.nav-bottom a{justify-content:space-between}.owner{display:flex;gap:10px;align-items:center;font-size:11px;margin-top:auto;padding:28px 4px 0}.owner small{font-size:9px}.avatar{width:32px;height:32px;border-radius:50%;background:#e3dad4;display:grid;place-items:center;font-family:Georgia,serif}
.app-shell{margin-left:var(--sidebar);min-height:100vh;display:flex;flex-direction:column}.topbar{height:65px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 40px;font-size:11px;background:#faf9f6}.crumb{color:#b2b9ad;padding:0 13px}.top-date{border-left:1px solid var(--line);margin-left:16px;padding-left:16px}main{padding:40px 40px 54px;flex:1;max-width:1650px;width:100%;margin:0 auto}.page-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:30px}.eyebrow{font-size:9px;font-weight:600;letter-spacing:1.9px;color:var(--muted);text-transform:uppercase;margin:0 0 9px}h1{font-family:Georgia,"Times New Roman",serif;font-weight:400;font-size:39px;letter-spacing:-1.2px;line-height:1.16;margin:0 0 10px}h2{font-size:18px;letter-spacing:-.4px;font-weight:500;margin:0 0 15px}h3{font-size:14px;font-weight:550;margin:0 0 8px}.subtitle{font-size:12px;color:var(--muted);line-height:1.65;margin:0}.heading-actions{display:flex;gap:9px;align-items:center;flex-shrink:0}.button{border:1px solid #d5ddcf;background:white;color:var(--ink);border-radius:5px;padding:10px 15px;font-size:12px;display:inline-flex;justify-content:center;align-items:center;gap:7px;white-space:nowrap;line-height:1.2}.button:hover{background:var(--soft)}.button.primary{color:white;background:var(--green);border-color:var(--green)}.button.primary:hover{background:#342a2a}.button.small{padding:7px 11px;font-size:11px}.button.quiet{background:transparent;border-color:transparent}.text-button,.icon-button{border:0;background:transparent;color:var(--green);padding:5px;font-size:12px}.icon-button{font-size:18px}.row-link{font-size:17px;color:#8c9787}.actions{display:flex;align-items:center;gap:8px}.notice{padding:13px 16px;background:#eef2e8;border:1px solid #dce5d0;border-radius:var(--radius);font-size:12px;line-height:1.6;margin:0 0 22px;color:#5a684e}.notice.warn{background:#fbf6e9;border-color:#ebe0bf;color:#836139}
.metrics{display:grid;grid-template-columns:repeat(4,1fr);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:22px 0;margin-bottom:30px}.metric{padding:0 24px;border-right:1px solid var(--line)}.metric:first-child{padding-left:0}.metric:last-child{border:0}.metric-label{font-size:10px;letter-spacing:.3px;color:var(--muted)}.metric-value{font-size:27px;font-weight:400;letter-spacing:-.8px;margin:9px 0 0;font-variant-numeric:tabular-nums}.metric-value em{font-size:13px;color:var(--muted);font-style:normal;letter-spacing:0}.metric small{font-size:10px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 18px}.toolbar form,.filters{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.toolbar label,.filters label{margin:0}.period-nav{display:flex;align-items:center;gap:15px}.period-nav strong{font-size:16px;font-weight:500}.period-nav .button{padding:6px 10px}.segmented{display:flex;border:1px solid var(--line);border-radius:5px;overflow:hidden}.segmented a{padding:7px 13px;font-size:11px;color:var(--muted)}.segmented a.active{background:white;color:var(--ink)}.search-field{display:flex;position:relative;align-items:center}.search-field span{position:absolute;left:12px;font-size:22px;font-weight:400;color:#939b8d}.search-field input{padding-left:37px;width:235px;background:#fff}.filters select{font-size:11px;padding:9px;min-width:100px}.filters input[type=date]{font-size:11px}
.panel{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel);overflow:hidden}.panel-heading{padding:20px 22px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}.panel-heading h2{margin:0;font-size:14px}.panel-body{padding:23px}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;font-size:12px;text-align:left}th{font-size:9px;text-transform:uppercase;letter-spacing:.9px;font-weight:500;color:#88917f;background:#fbfcf8;padding:13px 20px;border-bottom:1px solid var(--line);white-space:nowrap}td{padding:17px 20px;border-bottom:1px solid #edf0e8;vertical-align:top;line-height:1.5}tr:last-child td{border-bottom:0}tbody tr:hover{background:#fcfdf9}td .strong:hover{text-decoration:underline}.wide{width:32%}.code{display:inline-block;font-size:9px;background:#eef1e8;color:#657653;padding:2px 4px;border-radius:3px;font-weight:500;margin-right:4px;letter-spacing:.6px}.note{font-size:11px;color:var(--muted);max-width:390px;margin-top:3px}.note summary{cursor:pointer;list-style:none;line-height:1.7}.note[open] summary{display:none}.note p{margin:0;font-size:12px;line-height:1.65}.badge{display:inline-block;padding:3px 8px;border:1px solid #dce3d4;border-radius:4px;background:#f3f5ee;font-size:10px;white-space:nowrap;color:#697461}.badge.good{color:#50633a;background:#edf3e4;border-color:#dce6ce}.badge.warn{color:#936b30;background:#fbf3df;border-color:#efe1bd}.badge.quiet-badge{background:#f7f8f5;color:#969e91;border-color:#e9ede3}.balance-due{color:#896333;font-weight:550}.pagination{display:flex;justify-content:space-between;align-items:center;min-height:54px;padding:13px 20px;border-top:1px solid var(--line);font-size:10px;color:var(--muted)}.pagination>div{display:flex;gap:7px}.empty{padding:52px 20px;text-align:center;color:var(--muted)}.empty h3{color:#606c5d}.empty p{font-size:12px;max-width:400px;margin:8px auto;line-height:1.7}.empty-mark{font-family:Georgia,serif;font-size:32px;display:block;margin-bottom:12px}.app-footer{border-top:1px solid var(--line);margin:0 40px;padding:20px 0;display:flex;justify-content:space-between;font-size:9px;color:#98a08f;letter-spacing:.3px}
.table-description{min-width:240px}
.detail-grid{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(250px,1fr);gap:23px;align-items:start}.stack>*+*{margin-top:24px}.definition{display:grid;grid-template-columns:140px 1fr;gap:12px;font-size:12px}.definition dt{color:var(--muted)}.definition dd{margin:0;white-space:pre-line;line-height:1.6}.tabs{display:flex;gap:24px;border-bottom:1px solid var(--line);margin:0 0 25px}.tabs a{font-size:12px;color:var(--muted);padding:0 0 14px;white-space:nowrap}.tabs a.active{color:var(--ink);border-bottom:2px solid var(--green)}.todo{display:flex;align-items:center;gap:9px;padding:11px 0;border-bottom:1px solid var(--line);font-size:12px}.todo.done span{text-decoration:line-through;color:var(--muted)}.large-amount{font-family:Georgia,serif;font-size:36px;letter-spacing:-1px}.total-line{display:flex;justify-content:space-between;font-size:12px;margin:12px 0}.total-line.final{border-top:1px solid var(--line);padding-top:15px;font-size:18px}.selected-period{margin-bottom:20px}.fee-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.fee{border:1px solid var(--line);background:white;border-radius:var(--radius);padding:20px}.fee .metric-value{margin:12px 0}.check-row{display:flex;gap:10px;align-items:center}
label{display:block;font-size:11px;font-weight:500;color:#697164;margin:0 0 17px}input,select,textarea{width:100%;border:1px solid #d7ded0;border-radius:5px;background:#fff;padding:10px 11px;color:var(--ink);margin-top:6px;line-height:1.35;min-width:0}textarea{resize:vertical;line-height:1.6}input[type=checkbox]{width:15px;height:15px;margin:0;accent-color:var(--green);flex-shrink:0}.check{display:flex;align-items:center;gap:9px}.optional{font-weight:400;color:#a0a798;margin-left:3px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 18px}.form-actions{border-top:1px solid var(--line);padding-top:18px;margin-top:8px;display:flex;justify-content:flex-end;gap:8px}.form-error{background:#fff1ed;border:1px solid #efc7bd;color:#963f32;border-radius:5px;padding:13px;margin-bottom:16px;font-size:12px;line-height:1.6}.form-error[hidden]{display:none}.inline-form{display:flex;gap:8px;align-items:flex-end}.inline-form label{flex:1}.inline-form .form-actions{border:0;margin-bottom:17px;padding:0}.inline-form .form-error{flex-basis:100%}dialog{border:1px solid var(--line);border-radius:10px;width:min(620px,calc(100vw - 24px));padding:27px;max-height:90vh;box-shadow:0 24px 90px #16221525}dialog::backdrop{background:#1d291b66;backdrop-filter:blur(2px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:23px}.dialog-heading h2{font-family:Georgia,serif;font-size:26px;font-weight:400;margin:0}.toast{position:fixed;bottom:25px;right:28px;border-radius:6px;background:var(--green);color:#fff;padding:13px 20px;box-shadow:0 8px 25px #0002;font-size:12px;z-index:50}.error-page{max-width:600px;margin:100px auto;padding:40px}.document-note{font-size:12px;line-height:1.8;white-space:pre-line}.report-bar{height:4px;background:#dce7c9;border-radius:2px;margin-top:8px;width:100%}progress{height:5px;max-width:180px;width:100%;appearance:none}progress::-webkit-progress-bar{background:#eef1e9}progress::-webkit-progress-value{background:#c2d59f}.report-number{font-family:Georgia,serif;font-size:43px;letter-spacing:-1px}.history-item{padding:12px 0;border-bottom:1px solid var(--line);font-size:11px}.select-work input{margin:3px 8px 0 0}
@media(min-width:1550px){main{padding-top:50px}.page-heading{margin-bottom:36px}td{padding-top:20px;padding-bottom:20px}}
@media(max-width:1150px){:root{--sidebar:205px}main{padding:30px 24px}.topbar{padding:0 24px}.app-footer{margin:0 24px}.wide{width:auto}.detail-grid{grid-template-columns:1fr}.metric{padding:0 15px}td,th{padding-left:14px;padding-right:14px}}
@media(max-width:760px){:root{--sidebar:64px}.sidebar{padding:22px 8px}.brand{padding:0 6px 24px}.workspace-name,.nav-label,.owner,.nav-bottom{display:none}.brand-mark{width:36px}.sidebar nav>a{font-size:0;padding:12px 7px;gap:0;justify-content:center}.nav-icon{font-size:20px}.topbar{height:52px;padding:0 16px}.top-date{display:none}main{padding:25px 16px}.page-heading{align-items:flex-start;flex-direction:column;gap:13px}h1{font-size:33px}.metrics{grid-template-columns:1fr 1fr;gap:22px 0}.metric:nth-child(3){padding-left:0}.metric:nth-child(2){border:0}.toolbar{align-items:flex-start;flex-direction:column}.filters{width:100%}.search-field input{width:200px}.app-footer{margin:0 16px;font-size:8px;gap:20px}.tabs{overflow:auto;gap:18px}.form-grid,.fee-grid{grid-template-columns:1fr}dialog{padding:20px}.heading-actions{flex-wrap:wrap}.definition{grid-template-columns:100px 1fr}}

.pdf-preview{max-width:820px;margin:24px auto}.pdf-preview figure{margin:0 0 24px}.pdf-preview figcaption{color:var(--muted);font-size:12px;margin:8px 0}.pdf-preview img{display:block;width:100%;height:auto;background:white;border:1px solid var(--line);box-shadow:0 5px 20px #2233220d}.preview-actions{display:flex;justify-content:center;gap:12px;margin:26px 0}.conflict-values{background:#fff6e9;padding:16px;border:1px solid #dfcaaa;border-radius:5px;margin-top:12px}.conflict-values dd{white-space:pre-wrap;overflow-wrap:anywhere}

.invoice-preview{margin-top:24px;scroll-margin-top:24px}

/* Spreadsheet presentation; the cells, rather than each control, define the grid. */
.work-filters { flex-wrap:wrap; margin:16px 0 10px; }
.work-filters label { flex:1 1 150px; min-width:0; max-width:260px; }
.work-filters input,.work-filters select { width:100%; }
.sheet-toolbar { display:flex; justify-content:space-between; gap:16px; padding:10px 14px; color:var(--muted); font-size:11px; border-bottom:1px solid var(--line); }
.sheet-toolbar kbd { font:inherit; color:var(--ink); }
.work-editor { table-layout:fixed; min-width:100%; border-collapse:separate; border-spacing:0; }
.work-editor th { position:relative; height:34px; padding:8px 10px; background:#f0f3ed; border-right:1px solid var(--line); border-bottom:1px solid #cdd6c7; font-size:10px; letter-spacing:.3px; text-transform:none; }
.work-editor th .column-sort { display:inline-flex; padding-right:0; }
.work-editor th [data-resize-column] { position:absolute; top:0; right:0; width:7px; height:100%; cursor:col-resize; border:0; border-right:2px solid transparent; border-radius:0; background:transparent; touch-action:none; padding:0; }
.work-editor th [data-resize-column]:hover,.work-editor th [data-resize-column]:focus { border-right-color:var(--green); }
.work-editor td { position:relative; vertical-align:top; padding:0; border-right:1px solid var(--line); border-bottom:1px solid var(--line); height:38px; overflow-wrap:anywhere; }
.work-editor tbody tr:hover { background:#fafbf8; }
.work-editor td.sheet-row-number,.work-editor th.sheet-row-number { background:#f0f3ed; padding:11px 4px; text-align:center; font-size:10px; color:var(--muted); font-variant-numeric:tabular-nums; }
.work-editor tbody tr:focus-within .sheet-row-number { background:var(--soft); color:var(--green); }
.sheet-cell-content { position:relative; min-height:38px; height:100%; }
.work-editor .sheet-cell:focus-within { box-shadow:inset 0 0 0 2px var(--green); background:var(--panel); z-index:2; }
.work-editor input:not([type=checkbox]),.work-editor select,.work-editor textarea { display:block; width:100%; min-width:0; margin:0; padding:10px; border:0; border-radius:0; box-shadow:none; outline:none; background:transparent; font-size:12px; line-height:18px; color:var(--ink); }
.work-editor input:not([type=checkbox]),.work-editor select { height:38px; }
.work-editor select { appearance:none; -webkit-appearance:none; padding-right:20px; cursor:pointer; text-overflow:ellipsis; }
.work-editor textarea { height:38px; min-height:38px; resize:none; overflow:hidden; white-space:pre; }
.work-editor textarea:focus { min-height:110px; resize:vertical; overflow:auto; white-space:pre-wrap; }
.work-editor [type=number] { appearance:textfield; -moz-appearance:textfield; text-align:right; font-variant-numeric:tabular-nums; }
.work-editor [type=number]::-webkit-inner-spin-button,.work-editor [type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
.work-editor [type=date]::-webkit-calendar-picker-indicator { opacity:0; width:12px; margin:0; padding:0; }
.work-editor [type=date]:focus::-webkit-calendar-picker-indicator,.work-editor [type=date]:hover::-webkit-calendar-picker-indicator { opacity:1; }
.work-editor input[type=checkbox] { width:14px; height:14px; margin:12px auto; display:block; cursor:pointer; }
.work-editor :disabled { opacity:.8; cursor:default; }
.work-editor tfoot td { background:#fafcf7; border-top:1px solid #cdd6c7; }
.work-editor tfoot .sheet-row-number { color:var(--green); font-size:16px; }
.work-editor .sheet-billing { padding:11px 9px; font-size:11px; color:var(--muted); }
.sheet-find { position:absolute; right:0; top:0; z-index:1; width:26px; height:38px; border:0; background:var(--panel); color:var(--muted); opacity:0; font-size:19px; padding:0; }
.sheet-project:hover .sheet-find,.sheet-project:focus-within .sheet-find { opacity:1; }
.work-editor input[data-project-search] { position:absolute; top:100%; left:0; z-index:5; height:38px; border:1px solid var(--green); box-shadow:0 4px 12px #252d2918; background:var(--panel); }
.work-editor [hidden] { display:none!important; }
.work-editor .work-row-actions { padding:5px 4px; white-space:normal; font-size:11px; }
.sheet-action { width:25px; height:27px; padding:0; margin:0; border:0; border-radius:3px; background:transparent; color:var(--muted); font-size:17px; line-height:27px; }
.sheet-action:hover,.sheet-action:focus-visible { background:var(--soft); color:var(--green); }
.work-editor tbody [data-save-row],.work-editor [data-cancel-row] { display:none; }
.work-editor [data-dirty=true] [data-save-row],.work-editor [data-dirty=true] [data-cancel-row] { display:inline-block; }
.sheet-status { display:block; font-size:10px; line-height:1.4; color:var(--muted); white-space:normal; }
.sheet-status-quiet { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.work-editor [data-save-state=error] .sheet-status { color:var(--danger); }
.work-editor [data-row-error] { position:absolute; top:100%; right:0; z-index:8; width:330px; max-height:420px; overflow:auto; padding:12px; background:var(--panel); border:1px solid var(--line); border-radius:4px; box-shadow:0 8px 24px #252d2926; color:var(--danger); font-size:11px; line-height:1.5; }
.work-editor [data-row-error] p { margin:7px 0; }
.work-editor [data-row-error] details { max-height:360px; overflow:auto; min-width:0; }
.work-editor [data-row-error] .definition { display:block; }
.work-editor [data-row-error] dd { margin:0 0 10px; white-space:pre-wrap; }
.work-editor [data-row-error] dt { font-weight:600; }
@media(max-width:600px) { .sheet-toolbar { flex-direction:column; gap:4px; } }
.work-editor .work-row-actions,.work-editor th[data-column=actions] { position:sticky; right:0; z-index:3; background:var(--panel); border-left:1px solid var(--line); }
.work-editor .sheet-row-number { position:sticky; left:0; z-index:3; }
.work-editor textarea:not(:focus) { white-space:nowrap; }
.sheet-cell-content { display:flex; height:auto; align-items:flex-start; }
.work-editor td.sheet-row-number { padding:10px 4px; line-height:18px; }
.work-editor .sheet-billing { padding:10px 9px; line-height:18px; }
.work-editor textarea:not(:focus) { height:28px; min-height:28px; padding-bottom:0; }

/* Shared compact list filters: one working row, secondary controls on demand. */
.compact-filter-row{position:relative;gap:8px;margin-bottom:18px;align-items:center}
.compact-filter-row>.search-field{flex:1 1 180px;max-width:320px}
.compact-filter-row>.search-field input{width:100%;margin:0;height:34px;font-size:11px}
.compact-filter-row>.filter-status select{width:auto;min-width:120px;margin:0;height:34px;padding:6px 32px 6px 10px}
.list-filter-menu{position:relative;flex:none}
.list-filter-menu>summary{list-style:none;display:flex;align-items:center;gap:10px;cursor:pointer;border:1px solid var(--line);border-radius:5px;background:var(--panel);padding:7px 10px;min-height:34px;font-size:11px;white-space:nowrap}
.list-filter-menu>summary::-webkit-details-marker{display:none}
.list-filter-menu>summary:hover,.list-filter-menu[open]>summary{background:var(--soft)}
.list-filter-menu>summary:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.filter-count{display:inline-block;min-width:17px;text-align:center;border-radius:9px;background:var(--green);color:var(--panel);font-size:10px;margin-left:4px;padding:1px 4px}
.list-filter-popover{position:absolute;top:calc(100% + 7px);right:0;z-index:20;width:340px;max-width:calc(100vw - 120px);padding:16px;display:grid;gap:14px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:0 10px 28px #252d2920}
.list-filter-popover .client-project-picker{display:grid;width:100%;gap:12px}
.list-filter-popover .entity-picker{width:100%}
.list-filter-popover .client-project-hint{display:none}
.filter-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.list-filter-popover input,.list-filter-popover select{font-size:11px;min-width:0}
.compact-filter-row .filter-export{margin-left:auto;height:34px}
.filter-clear:empty{display:none}
@media(max-width:760px){.compact-filter-row>.search-field{max-width:none}.compact-filter-row .list-filter-menu{position:static}.compact-filter-row .list-filter-popover{left:0;right:auto;width:340px;max-width:100%}.compact-filter-row .filter-export{margin-left:0}}

/* Normalize single-choice selects in Safari and Chromium, retaining native menus. */
select:not([multiple]):not([size]) {
  -webkit-appearance:none;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%2359504b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:12px 12px;
  padding-right:32px;
  cursor:pointer;
}
select:disabled {cursor:not-allowed;color:var(--muted);background-color:var(--paper)}
@media (forced-colors:active) {
  select:not([multiple]):not([size]) {-webkit-appearance:auto;appearance:auto;background-image:none}
}

/* Visible primary context stays compact; labels remain available to assistive tech. */
.compact-filter-row>.entity-picker{width:240px}
.compact-filter-row>.entity-picker>label{position:absolute;left:-10000px}
.compact-filter-row>.entity-picker .entity-picker-control{margin:0}
.compact-filter-row>.entity-picker .entity-picker-control input{height:34px;min-height:34px}
.compact-filter-row>label:not(.search-field):not(.filter-status){display:flex;align-items:center;gap:8px}
.compact-filter-row>label:not(.search-field):not(.filter-status)>input{margin:0;width:auto;height:34px}
.toolbar>.compact-filter-row{flex:1;margin-bottom:0}

/* Shared contextual menus live in the browser's top layer, outside table clipping. */
.record-actions{display:inline-flex;vertical-align:middle;white-space:normal}
.action-trigger{white-space:nowrap;gap:8px}
.action-popup{margin:0;padding:6px;width:max-content;min-width:220px;max-width:min(340px,calc(100vw - 16px));max-height:calc(100vh - 16px);overflow:auto;border:1px solid var(--border,#d9ded8);border-radius:9px;background:var(--surface,#fff);color:inherit;box-shadow:0 12px 35px #18312626}
.action-popup:popover-open{display:flex;flex-direction:column}
.action-popup [role=menuitem]{display:block;white-space:normal;width:100%;text-align:left;padding:10px 12px;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;font-size:13px;text-decoration:none;cursor:pointer}
.action-popup [role=menuitem]:hover,.action-popup [role=menuitem]:focus-visible{background:#edf2ed;outline:2px solid #8ba08d;outline-offset:-2px}
.action-popup [aria-disabled=true]{color:#747b74;cursor:default}
.action-popup small{display:block;font-size:11px;margin-top:2px}
.selection-actions{display:flex;align-items:center;gap:14px;padding:10px 16px;border-bottom:1px solid var(--border,#d9ded8);flex-wrap:wrap}
.selection-actions .check{margin:0}
.selection-actions small{color:#6c766e}
.work-row-actions .action-trigger{padding:3px 7px;font-size:11px}
.funds-invoice{padding:14px 0;border-bottom:1px solid #e0e4df}
.funds-invoice form{margin-top:16px;max-width:440px}

.document-settings-grid{display:grid;grid-template-columns:minmax(340px,1fr) minmax(360px,1.15fr);gap:24px;align-items:start}.document-settings-grid fieldset{border:0;border-top:1px solid var(--line);padding:20px 0;margin-top:20px;min-width:0}.document-settings-grid legend{padding:0 8px 0 0;font-weight:600}.settings-preview .pdf-preview{margin-top:18px}.settings-preview figure{margin:0 0 20px}.settings-preview img{width:100%;height:auto}.settings-reference{margin-top:30px}.settings-reference>summary,.invoice-document-options>summary{cursor:pointer;margin-bottom:18px}.invoice-document-options{margin:22px 0}.document-settings-grid input[type=color]{height:42px;padding:4px}.document-settings-grid input[type=file]{max-width:100%}.settings-reference .detail-grid{margin-top:20px}@media(max-width:1150px){.document-settings-grid{grid-template-columns:1fr}}

/* Shared form styling for repeatable agreement recipients. */
[data-signer]{min-width:0;border:1px solid var(--line);border-radius:5px;padding:16px;margin:0}
[data-signer] legend{padding:0 6px;font-size:12px;font-weight:600}
[data-recipients]{margin-bottom:16px}
/* Locked commercial scopes retain the ordinary field layout for inspection. */
.scope-fields { border: 0; margin: 0; padding: 0; min-width: 0; }
.scope-fields:disabled { opacity: 1; }

/* Project scope is the primary workspace; operations stay alongside it. */
.project-heading{margin-bottom:18px}.project-status-bar{display:flex;align-items:center;gap:16px;margin:0 0 28px;position:relative;z-index:10}.project-status-bar>p{font-size:12px;color:var(--muted);margin:0;line-height:1.6}.project-stage-menu{position:relative;flex-shrink:0}.project-stage-menu>summary{display:flex;align-items:center;gap:10px;list-style:none;cursor:pointer;background:white;border:1px solid var(--line);border-radius:6px;padding:9px 12px;font-size:12px}.project-stage-menu>summary::-webkit-details-marker{display:none}.status-label{color:var(--muted);font-size:11px}.stage-value{font-weight:600}.stage-draft{color:#687b4d}.project-stage-options{position:absolute;top:calc(100% + 7px);left:0;width:min(340px,calc(100vw - 120px));padding:6px;background:white;border:1px solid var(--line);border-radius:8px;box-shadow:0 12px 35px #30251e20}.project-stage-options button{display:block;width:100%;text-align:left;padding:12px;border:0;border-radius:5px;background:none;color:var(--ink);cursor:pointer}.project-stage-options button:hover{background:#f5f4ef}.project-stage-options button:disabled{background:#f5f5f1;cursor:default;opacity:.6}.project-stage-options button strong{display:block;font-size:13px;font-weight:600;margin-bottom:5px}.project-stage-options button span{display:block;color:var(--muted);font-size:11px;line-height:1.6}.project-stage-options .form-error{margin:6px;font-size:11px}
.project-workspace{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:28px;align-items:start}.project-main,.project-sidebar{display:grid;gap:24px;min-width:0}.project-sidebar .panel-body{padding:20px}.project-sidebar h2{font-size:14px;margin:0 0 14px}.project-sidebar .panel-heading h2{margin:0}.project-sidebar .hint{line-height:1.7}.project-sidebar .todo{flex-wrap:wrap;gap:8px}.project-sidebar .todo .check{flex:1;min-width:140px;margin:0;line-height:1.6}.project-sidebar .todo .form-error{flex-basis:100%}.project-todo-add{margin-top:18px}.project-todo-add label{margin-bottom:0}.project-todo-add .form-actions{margin-bottom:0}.project-todo-add{flex-wrap:wrap}.project-todo-add .form-error:empty{display:none}.project-context{padding:0 20px;font-size:12px}.project-context details{margin-top:22px}.project-context summary{cursor:pointer;color:var(--muted)}
.services-workspace{overflow:visible}.services-heading{padding:25px 25px 20px;display:flex;align-items:center;justify-content:space-between;gap:18px}.services-heading .eyebrow{margin:0 0 7px;font-size:9px}.services-heading h2{font-size:22px;margin:0;letter-spacing:-.4px}.services-heading .hint{margin:9px 0 0;line-height:1.6}.services-heading>.button{flex-shrink:0}.services-filter{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 25px 18px;border-bottom:1px solid var(--line)}.services-filter form,.services-filter label{margin:0}.services-filter select{margin:0}.services-filter>.hint{font-size:11px}.service-composer-row{border-bottom:1px solid var(--line)}.service-composer-row:last-child{border-bottom:0}.service-composer-row>summary{display:grid;grid-template-columns:24px minmax(0,1fr) minmax(105px,auto) 46px;align-items:start;gap:14px;list-style:none;padding:23px 25px;cursor:pointer}.service-composer-row>summary::-webkit-details-marker{display:none}.service-composer-row>summary:hover{background:#fcfcf9}.service-number{color:#a7aca0;font-size:10px;padding-top:3px;font-variant-numeric:tabular-nums}.service-row-description strong{display:block;font-size:14px;line-height:1.5;font-weight:600}.service-row-description>span{display:block;font-size:12px;line-height:1.65;color:var(--muted);margin-top:5px}.service-row-price{font-size:13px;line-height:1.6;font-variant-numeric:tabular-nums;text-align:right}.service-row-price small{font-size:10px;margin-top:5px}.service-edit-label{display:flex;gap:6px;align-items:center;color:var(--green);font-size:11px;padding-top:3px;justify-content:flex-end}.service-composer-row .when-open{display:none}.service-composer-row[open] .when-open{display:inline}.service-composer-row[open] .when-closed{display:none}.service-composer-row[open]>summary{background:#f8f9f4}.service-composer-row[open] .service-edit-label>span:last-child{transform:rotate(180deg)}.service-inline-editor{padding:22px 25px 25px;background:#fdfdfb;border-top:1px solid #edf0e8}.service-inline-editor .form-actions{align-items:center}.service-detail-link{margin-right:auto;font-size:11px}.service-advanced{border-top:1px solid var(--line);padding-top:15px;margin-top:17px}.service-advanced>summary{font-size:12px;cursor:pointer;margin-bottom:16px}.service-advanced:not([open])>summary{margin-bottom:0}.service-estimate-note{margin:0 0 20px}.service-add-area{border-top:1px solid var(--line);padding:23px 25px;background:#fafbf7;scroll-margin-top:24px}.service-add-area h3{font-size:14px;margin:0 0 17px}.service-template-controls{display:flex;gap:10px;align-items:end}.service-template-controls label{flex:1;margin-bottom:0;min-width:0}.service-template-controls>.button{flex-shrink:0;min-height:38px}.service-template-add>.form-error:not([hidden]){margin-top:14px}.service-add-area>.hint{font-size:11px;line-height:1.6;margin:12px 0 20px}.custom-service-add>summary{cursor:pointer;color:var(--green);font-size:12px;list-style:none}.custom-service-add>summary::-webkit-details-marker{display:none}.custom-service-add>form{margin-top:24px}.custom-service-add[open]>summary{font-weight:600}.services-empty{padding:32px 25px}.services-empty h3{font-size:16px;font-weight:500;margin:0 0 10px}.services-empty p{max-width:420px;font-size:12px;line-height:1.8;color:var(--muted);margin:0}.service-allocation-note{padding:17px 25px;border-top:1px solid var(--line);font-size:11px;line-height:1.7}.service-tools-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px}.service-tools-grid h2{font-size:16px;margin-top:0}.service-tools-grid .hint{line-height:1.7}.service-overview-links{display:flex;justify-content:space-between;gap:20px;font-size:12px;padding:0 2px}.service-tracking-table td,.service-tracking-table th{padding:18px 16px}.service-tracking-table td:first-child{width:42%}.service-tracking-table small{line-height:1.7}.service-tracking-table th{font-size:8px}.service-tracking-table td{font-size:12px}
[data-service-basis][hidden]{display:none!important}
@media(max-width:1250px){.project-workspace{grid-template-columns:minmax(0,1fr) 250px;gap:20px}.services-heading,.service-inline-editor,.service-add-area{padding-left:20px;padding-right:20px}.service-composer-row>summary{padding:20px;grid-template-columns:minmax(0,1fr) 115px 40px;gap:12px}.service-number{display:none}.services-filter{padding-left:20px;padding-right:20px}.services-filter>.hint{display:none}.service-tools-grid{grid-template-columns:1fr}.service-template-controls{flex-wrap:wrap}.service-template-controls label{flex-basis:100%}}
@media(max-width:1000px){.project-workspace{grid-template-columns:1fr}.project-sidebar{grid-template-columns:1fr 1fr}.project-context{padding:20px}.service-tools-grid{grid-template-columns:1fr 1fr}.service-template-controls{flex-wrap:nowrap}.service-template-controls label{flex-basis:auto}}
@media(max-width:600px){.project-status-bar{align-items:flex-start;gap:12px}.project-status-bar>p{font-size:11px}.project-sidebar,.service-tools-grid{grid-template-columns:1fr}.services-heading{align-items:flex-start;flex-direction:column}.service-composer-row>summary{grid-template-columns:minmax(0,1fr) 42px}.service-row-price{grid-row:2;text-align:left;font-size:12px}.service-row-price small{display:inline;margin-left:8px}.service-edit-label{grid-row:1;grid-column:2}.service-template-controls{flex-wrap:wrap}.service-template-controls label{flex-basis:100%}.service-overview-links{flex-direction:column;gap:15px}.service-inline-editor .form-actions{flex-wrap:wrap}.service-detail-link{flex-basis:100%;margin-bottom:6px}.service-tracking-table{min-width:550px}}

.service-unsaved{display:none;font-size:10px;font-weight:400;color:var(--muted);margin-left:6px}.service-composer-row:has([data-dirty="true"]) .service-unsaved{display:inline}.service-row-description>small{margin-top:6px}
.services-filter:has(.compact-filter-row)>.hint{display:none}.services-filter .compact-filter-row{flex:1;margin:0}.services-filter .search-field{min-width:130px}.services-workspace>[data-live="project-services"]>p.hint{margin:0;padding:10px 25px;font-size:10px;border-bottom:1px solid var(--line)}

/* Optional phase headers organize services without adding another workflow. */
.service-group + .service-group{margin-top:28px}
.phase-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:20px 0 14px;border-top:1px solid var(--line,#dedbd5)}
.phase-heading h3{margin:2px 0 7px;font-size:21px}.phase-heading .eyebrow{margin:0;font-size:10px}.phase-heading .hint{margin:0}
.phase-actions,.scope-order-controls{display:flex;gap:5px;align-items:center;flex-wrap:wrap}.phase-actions{justify-content:flex-end}.scope-order-controls{margin:0}.scope-order-controls .form-error{flex-basis:100%}.scope-order-controls button{min-width:32px}
.phase-options{position:relative}.phase-options>summary{list-style:none;cursor:pointer}.phase-options>summary::-webkit-details-marker{display:none}.phase-edit-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:15;width:320px;max-width:80vw;background:var(--surface,#fff);padding:20px;border:1px solid var(--line,#dedbd5);border-radius:8px;box-shadow:0 12px 30px #30292318}.phase-edit-panel .form-actions{margin-top:12px;padding-top:12px}.phase-remove{border-top:1px solid var(--line,#dedbd5);padding-top:15px;margin-top:16px}.phase-remove .hint{margin-bottom:12px}
.phase-create{margin-top:20px;padding-top:16px;border-top:1px solid var(--line,#dedbd5)}.phase-create>summary{cursor:pointer;font-weight:600}.phase-create>summary .hint{font-weight:400;margin-left:8px}.phase-create>form{max-width:480px;margin-top:18px}.phase-empty{padding:16px 0}
.service-organization{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-bottom:18px;margin-bottom:22px;border-bottom:1px solid var(--line,#dedbd5)}.service-group-select{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:0}.service-group-select label{min-width:200px}.service-group-select .form-error{flex-basis:100%}.service-template-controls{flex-wrap:wrap}.service-template-controls>label{min-width:180px;flex:1}.service-tools-grid{grid-template-columns:1fr}.contract-phase-title{margin-top:24px}.phase-derived{font-size:13px;color:var(--muted,#716b66);margin:0 0 14px}
@media(max-width:760px){.phase-heading{flex-direction:column;gap:12px}.phase-actions{justify-content:flex-start}.phase-edit-panel{left:auto;right:0}.service-organization{align-items:flex-start;flex-direction:column}.service-group-select{width:100%}.service-group-select label{flex:1}}
.services-workspace .phase-heading{padding-left:26px;padding-right:26px}.services-workspace .phase-create{padding:18px 26px}.services-workspace .phase-empty{padding:16px 26px}.service-group+.service-group{margin-top:14px}.services-workspace>.phase-create{margin-top:0}
.phase-derived[hidden],label[hidden]{display:none!important}
@media(max-width:760px){.services-workspace .phase-heading,.services-workspace .phase-create,.services-workspace .phase-empty{padding-left:18px;padding-right:18px}}
/* Phases read as typographic section headings in a continuous manual scope. */
.services-workspace .phase-heading{align-items:center;gap:10px;padding:16px 25px 10px;border:0;background:none;min-height:48px}.phase-title{display:flex;align-items:baseline;gap:8px;min-width:0}.phase-heading h3{font-size:14px;font-weight:650;margin:0;line-height:1.4}.phase-count{font-size:11px;color:var(--muted)}.phase-rule{height:1px;background:var(--line);flex:1;min-width:16px}.phase-actions{flex-wrap:nowrap;gap:2px}.phase-actions>.button,.phase-options>summary{padding:4px 7px;min-height:28px;background:none;border-color:transparent}.phase-keyboard-order{display:flex;justify-content:space-between;align-items:center;margin-top:12px}.service-group+.service-group{margin-top:10px}.services-filter{justify-content:space-between}.services-filter>.hint{display:block;font-size:11px}.services-filter .filter-status{width:130px}.scope-drag-handle{cursor:grab;touch-action:none;user-select:none;display:inline-flex;align-items:center;justify-content:center;width:18px;min-height:28px;font-size:23px;color:#96968c;flex-shrink:0}.scope-drag-handle:hover{color:var(--ink,#443b39)}.scope-drag-active,.scope-drag-active *{cursor:grabbing!important;user-select:none!important}.service-composer-row>summary:has(.scope-drag-handle){grid-template-columns:18px minmax(0,1fr) minmax(105px,auto) 46px}.service-composer-row>summary:has(.scope-drag-handle)>.service-number{display:none}.scope-dragging{opacity:.35}.scope-drop-before{box-shadow:0 -3px 0 #7b876a!important}.scope-drop-after{box-shadow:0 3px 0 #7b876a!important}.scope-drop-inside{outline:2px solid #7b876a;outline-offset:-2px}.scope-drag-ghost{position:fixed;z-index:1000;pointer-events:none;padding:10px 16px;border-radius:5px;border:1px solid var(--line);background:white;box-shadow:0 6px 24px #30292325;font-size:13px;max-width:360px}.scope-ungroup-drop{display:none;margin:10px 25px;padding:14px;border:1px dashed var(--line);gap:14px}.scope-drag-active .scope-ungroup-drop{display:flex}.scope-drag-status{padding:0 25px}.scope-drag-status .button{margin-left:10px}
@media(max-width:760px){.services-workspace .phase-heading{flex-direction:row;padding-left:18px;padding-right:18px}.phase-title{flex-wrap:wrap}.service-composer-row>summary:has(.scope-drag-handle){grid-template-columns:18px minmax(0,1fr) 90px 32px;gap:8px}.services-filter>.hint{max-width:55%}}
@media(max-width:600px){.service-composer-row>summary:has(.scope-drag-handle){grid-template-columns:18px minmax(0,1fr) 32px}.service-composer-row>summary:has(.scope-drag-handle) .service-row-price{grid-column:2}.service-composer-row>summary:has(.scope-drag-handle) .service-edit-label{grid-column:3}.service-drag-handle{grid-row:1 / span 2}}
.phase-progress{position:relative;font-size:11px;color:var(--muted);font-weight:400;white-space:nowrap}.phase-progress>summary{list-style:none;cursor:pointer;padding:2px 5px;border-radius:3px}.phase-progress>summary:hover{background:var(--paper,#f5f5ef)}.phase-progress>summary::-webkit-details-marker{display:none}.phase-progress-detail{position:absolute;left:0;top:100%;z-index:14;width:260px;white-space:normal;background:#fff;border:1px solid var(--line);border-radius:5px;padding:12px 16px;box-shadow:0 6px 18px #30292312;line-height:1.6}.phase-progress-detail p{margin:0 0 6px}.phase-progress-detail p:last-child{margin:0}
.phase-heading h3{overflow-wrap:anywhere}.phase-title{flex-wrap:wrap}.services-filter>.hint{display:block!important}
/* Creation is a quiet inline affordance; grouping remains secondary. */
.services-workspace .service-add-area{padding:18px 26px;background:none;border-top:1px solid var(--line);scroll-margin-top:20px}.service-add-area>summary{cursor:pointer;font-weight:600;list-style:none}.service-add-area>summary::-webkit-details-marker{display:none}.service-add-content{padding-top:18px}.service-add-content>.hint{margin:0 0 18px}.services-workspace .phase-create{margin-top:0;border-top:1px solid var(--line)}.phase-create>summary{list-style:none}.phase-create>summary::-webkit-details-marker{display:none}.service-secondary-actions{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-top:20px;padding-top:14px;border-top:1px solid var(--line)}.service-organization{display:block;border:0;padding:0;margin:0}.service-organization>summary{font-size:12px;cursor:pointer;color:var(--muted)}.service-organization-controls{display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:14px}.service-visibility{display:flex;flex-direction:column;align-items:flex-end;gap:4px;margin:0}.service-visibility .text-button{font-size:12px}.service-visibility .hint{font-size:10px}.service-phase-option{margin-bottom:18px}.service-phase-option>summary{font-size:12px;cursor:pointer}.service-phase-option>label{margin-top:12px}
@media(max-width:760px){.services-workspace .service-add-area{padding-left:18px;padding-right:18px}.service-secondary-actions{flex-wrap:wrap}.service-visibility{align-items:flex-start}.service-template-controls>label{flex-basis:100%}}

.integration-docs{max-width:1000px;display:grid;gap:24px;line-height:1.7}.integration-docs section{scroll-margin-top:24px;min-width:0}.integration-docs p{font-size:13px}.integration-docs pre{padding:16px;background:var(--soft);border:1px solid var(--line);border-radius:5px;overflow:auto;font-size:12px;line-height:1.65}.integration-docs code{overflow-wrap:anywhere}.integration-docs pre code{overflow-wrap:normal}.integration-docs details{border-top:1px solid var(--line);padding:12px 0}.integration-docs summary{cursor:pointer;font-size:12px}.integration-docs dd{margin-left:0;min-width:0}.integration-docs .heading-actions{flex-wrap:wrap}.nav-bottom .documentation-link{justify-content:flex-start}.integration-docs h3{margin-top:24px}
@media(max-width:760px){.sidebar .nav-bottom{display:block;border-top:0;padding:0;margin-top:12px}.sidebar .nav-bottom>a:not(.documentation-link){display:none}.sidebar .documentation-link{justify-content:center;padding:12px 7px}.documentation-label{display:none}.integration-docs .panel-body{padding:16px}}

/* Sorting belongs to the table column it orders. */
.column-sort{display:inline-flex;align-items:center;gap:5px;min-height:24px;line-height:1.2;color:inherit;text-decoration:none;white-space:nowrap}
.column-sort:hover,th[aria-sort] .column-sort{color:var(--ink)}
.column-sort:focus-visible{outline:2px solid var(--green);outline-offset:4px;border-radius:2px}
.column-sort span{font-size:13px;letter-spacing:0}

.column-sort-group{display:inline-flex;align-items:center;flex-wrap:nowrap;gap:8px;vertical-align:middle}
.column-sort-separator{color:var(--muted);font-weight:400;letter-spacing:0}

@media(max-width:480px){.metrics{grid-template-columns:minmax(0,1fr);gap:18px}.metric,.metric:nth-child(2),.metric:nth-child(3){padding:0;border:0}}

.detail-grid>*{min-width:0}
@media(max-width:760px){.panel-heading{flex-wrap:wrap;gap:10px}.pagination{flex-wrap:wrap;gap:10px}}

/* Public sign-in shares the studio typography and controls. */
.login-shell { max-width: 440px; margin: 12vh auto; padding: 32px; }
.login-shell h1 { margin-top: 32px; }
.login-shell p { margin-bottom: 24px; }
.topbar form { margin: 0; }
