:root{color-scheme:light;--ink:#201d2d;--muted:#645e73;--line:#ded9e8;--paper:#fff;--canvas:#f6f4f9;--accent:#5639a3;--violet-soft:#eee8fa}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:var(--canvas);color:var(--ink);font:16px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif}
button,input,select{font:inherit}
button{cursor:pointer}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #987be5;outline-offset:2px}
.top{background:#272039;color:#fff}
.shell{width:min(100% - 40px,1056px);margin-inline:auto}
.brand{height:65px;display:flex;align-items:center;gap:12px;letter-spacing:.045em}
.logo{width:35px;height:35px;display:grid;align-content:center;gap:3px;padding:8px;border-radius:9px;background:#c7b2ff}
.logo span{height:2px;background:#34234f;border-radius:4px}
.logo span:last-child{width:65%}
main{padding-bottom:48px}
.header-settings{margin-inline-start:auto;flex:none;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;border-radius:8px;background:transparent;color:inherit;font-size:1.5rem;line-height:1}
.header-settings:hover,.header-settings[aria-current]{background:var(--violet-soft);color:var(--accent)}
.tabs{display:flex;gap:26px;border-bottom:1px solid var(--line)}
.tabs button{border:0;border-bottom:3px solid transparent;background:transparent;color:var(--muted);padding:15px 3px 12px;font-weight:700}
.tabs button[aria-current]{color:var(--accent);border-color:var(--accent)}
.page-head{display:flex;justify-content:space-between;align-items:end;margin:29px 0 17px}
h1,h2,h3,p{margin:0}
h1{font-size:clamp(1.9rem,5vw,2.3rem);letter-spacing:-.035em}
h2{font-size:1.13rem;margin-bottom:16px}
h3{font-size:1rem}
.page-head p{margin-top:4px;color:var(--muted)}
.samples{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:16px;color:var(--muted);font-size:.875rem}
.samples button,.quiet{background:var(--violet-soft);color:var(--accent);border:1px solid transparent;border-radius:9px;padding:9px 12px;font-weight:650;font-size:.875rem;min-height:40px}
.form-grid{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);align-items:start;gap:16px}
.stack{display:grid;gap:16px}
.panel{min-width:0;background:var(--paper);border:1px solid var(--line);border-radius:14px;padding:20px;box-shadow:0 3px 12px #291d4310}
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
label,legend{font-weight:650;font-size:.875rem}
label{display:block;min-width:0}
input:not([type=checkbox]):not([type=radio]),select{width:100%;min-width:0;padding:9px 10px;height:44px;color:var(--ink);background:#fff;border:1px solid #cfc8dd;border-radius:8px;font-size:1rem;margin-top:5px}
fieldset{border:0;padding:0;margin:16px 0;min-width:0}
legend{margin-bottom:6px;padding:0}
.note{color:var(--muted);font-size:.875rem;font-weight:400}
#visit-duration{margin-top:10px}
#visit-duration:empty{display:none}
.count{background:var(--violet-soft);color:var(--accent);border-radius:25px;padding:2px 8px;margin-left:4px}
.nom-row{display:flex;gap:8px;align-items:end;margin-bottom:8px}
.nom-row label{flex:1}
.nom-row button{height:44px}
.payment{position:sticky;top:16px}
.money-input{position:relative}
.money-input span{position:absolute;left:12px;top:15px;color:var(--accent);font-size:1.1rem}
.money-input input:not([type]){padding-left:32px}
.money-input input[type=number]{padding-left:32px;font-size:1.25rem;font-weight:750;height:51px}
.methods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.methods label{position:relative}
.methods input{position:absolute;width:1px;height:1px;opacity:0}
.methods span{display:block;padding:10px 4px;text-align:center;border:1px solid var(--line);border-radius:8px;color:var(--muted);cursor:pointer}
.methods input:checked+span{background:var(--violet-soft);color:var(--accent);border-color:#ae97e0}
.methods input:focus-visible+span{outline:3px solid #987be5;outline-offset:2px}
.split{margin:14px 0}
.split div,.total{display:flex;justify-content:space-between;align-items:center;gap:8px}
.split div{padding:4px 0;font-size:.92rem}
.split dd{margin:0;font-variant-numeric:tabular-nums}
.total{border-top:1px solid var(--line);padding:13px 0;color:var(--accent);font-weight:750}
.total strong{font-size:1.8rem}
.primary{background:var(--accent);color:#fff;border:0;border-radius:9px;min-height:48px;width:100%;font-weight:750}
.error{color:#a4283b;font-size:.875rem;margin:8px 0}
.status{font-size:.875rem;margin-top:10px;color:var(--accent)}
.extra-group+.extra-group,.setting+.setting{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.extra-group h3{margin-bottom:7px}
.setting label{display:inline-flex;align-items:center;gap:6px;padding:7px 10px 7px 0}
.setting input[type=checkbox]{accent-color:var(--accent);width:17px;height:17px}
.setting-controls{padding-left:24px}
.settings-panel .note{margin-top:12px}
summary{cursor:pointer;font-weight:700}
.saved-info{margin-top:10px;line-height:1.8}
@media(max-width:700px){.shell{width:calc(100% - 28px)}.brand{height:56px}.tabs{gap:20px}.page-head{margin-top:20px}.form-grid{grid-template-columns:minmax(0,1fr)}.payment{position:static}.panel{padding:16px}.samples button{padding-inline:9px}}

/* Constrain iOS's native date and time controls to their grid cell. */
.fields > *{min-inline-size:0}
.fields input[type=date],.fields input[type=time]{
  appearance:none;-webkit-appearance:none;display:block;
  inline-size:100%;max-inline-size:100%;min-inline-size:0;
  box-sizing:border-box;padding-block:0;
}
input[type=date]::-webkit-date-and-time-value,input[type=time]::-webkit-date-and-time-value{
  min-inline-size:0;margin:0;text-align:start
}
.name-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.name-actions .quiet{padding-inline:9px;min-height:44px}
.directory-panel{margin-bottom:16px}
.directory-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.directory-row+.directory-row{margin-top:8px}
.directory-row .name-actions{margin-top:0}
#directory-dialog{width:min(440px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px);overflow:auto;border:1px solid var(--line);box-shadow:0 14px 48px #28203836;border-radius:14px;padding:18px;color:var(--ink);background:var(--paper)}
#directory-dialog::backdrop{background:#272039a8}
.directory-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.directory-head h2{margin:0}
#directory-list{display:grid;gap:5px;max-height:min(34dvh,300px);overflow:auto;margin:10px 0;padding:0;list-style:none}
#directory-list button,#directory-list li.directory-name{display:block;width:100%;text-align:start;padding:8px 10px;min-height:44px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);overflow-wrap:anywhere}
#directory-empty{margin:8px 0 12px}
.directory-submit{display:flex;gap:8px;margin-top:16px}
.directory-submit button:first-child{flex-shrink:0}
@media(max-width:420px){
  .fields{column-gap:10px}
  .name-field{grid-column:1/-1}
  .tabs{gap:12px}
}
@media(max-width:350px){
  .fields{grid-template-columns:minmax(0,1fr)}
}
.picker{width:100%;min-height:44px;margin-top:5px;padding:9px 10px;text-align:left;background:#fff;border:1px solid #cfc8dd;color:var(--accent);border-radius:8px;overflow-wrap:anywhere}
#number-hint{display:block;margin-top:4px}
#customer-sort-row{margin-top:10px}
#customer-filter:empty,#referral-preview:empty{display:none}
.new-name{display:flex;align-items:center;gap:2px}
#new-customer-input-slot{flex:1;min-width:0}
.saved-number{display:flex;align-items:end;gap:8px;flex-wrap:wrap;margin-top:8px}
.saved-number label{width:135px;max-width:100%}
.saved-number button{min-height:44px}

/* Temporary input method colors for review. */
:root{
  --selection-bg:#deefff;--selection-border:#7195be;--selection-ink:#173b68;
  --manual-bg:#fff0d9;--manual-border:#bd8b55;--manual-ink:#62350c;
}
.input-legend{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px;font-size:.875rem;font-weight:700}
.input-legend span{display:inline-block;padding:5px 9px;border:1px solid;border-radius:7px}
.input-legend-select,
#slip :is(select,input[type=date],input[type=time],.nom-row input,.picker,button[data-directory]:not([data-create])),
#slip .methods span,
#directory-dialog :is(select,#directory-list button){
  background:var(--selection-bg);border-color:var(--selection-border);color:var(--selection-ink);
}
#slip .methods input:checked+span{
  background:#bddbfb;border-color:#315e90;box-shadow:inset 0 0 0 1px #315e90;color:var(--selection-ink);
}
.input-legend-manual,
#slip :is(input[type=number],input[name$="-recipient"],button[data-create]),
#directory-dialog :is(input,#directory-add),
.saved-number input[type=number]{
  background:var(--manual-bg);border-color:var(--manual-border);color:var(--manual-ink);
}

.visit-fields .name-field{grid-column:1/-1}

#report .page-head{margin-bottom:0}
.report-date{display:block;max-width:15rem}
.report-totals{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;margin:16px 0 0}
.report-totals > div{padding:10px 8px;border-radius:8px;background:var(--canvas)}
.report-totals dt{color:var(--muted);font-size:.875rem}
.report-totals dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
@media(max-width:350px){
  .tabs{gap:8px}
  .tabs button{font-size:.875rem}
  .report-totals{grid-template-columns:repeat(2,minmax(0,1fr))}
}

#outflows .page-head{margin-bottom:0}
#outflow-status:empty,#receipt-status:empty{display:none}
#referral-payouts:not(:empty){margin-top:12px}
.referral-payout,.expense-line,.outflow-record{padding:12px;border:1px solid var(--line);border-radius:8px}
.referral-payout .quiet,.expense-line .quiet{justify-self:start}
#receipt-image{width:auto;max-width:100%;max-height:260px;object-fit:contain;justify-self:start}
.outflow-record dl{display:grid;grid-template-columns:5rem 1fr;gap:4px 8px;margin:8px 0 0;overflow-wrap:anywhere}
.outflow-record dt{color:var(--muted)}
.outflow-record dd{margin:0}
@media(max-width:480px){
  .tabs{gap:4px;justify-content:space-between}
  .tabs button{font-size:.875rem;padding-inline:2px;white-space:nowrap}
}
.receipt-toggle{display:flex;align-items:center;gap:8px}
.receipt-toggle input{width:auto;margin:0}
#receipt-reconcile{border:1px solid var(--line);border-radius:8px;padding:12px}
#receipt-totals p{overflow-wrap:anywhere}
.expense-detail-entry{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}
.expense-detail-entry > form{margin-top:12px}
.outflow-history:not(:empty){margin-top:16px}
#outflow-grand-total{font-size:1.5rem;font-variant-numeric:tabular-nums}
#report-outflows + .note{margin-top:12px}
.tabs{flex-wrap:wrap}
#people .page-head{margin-bottom:0}
.person-list-button{text-align:left;min-height:44px}
.person-history{margin:8px 0 0;padding-left:1.25rem}
.person-history li + li{margin-top:6px}
#credit-status:empty{display:none}
.report-test-actions{margin-top:12px}
#report-test-status:empty{display:none}
#report > section,#report-list{min-width:0}
.report-table-scroll{--customer-col:clamp(6.5rem,31vw,11rem);--staff-col:clamp(5.5rem,25vw,9rem);overflow-x:auto;border:1px solid var(--line);border-radius:8px;background:var(--paper)}
.report-slip-table{width:calc(var(--customer-col) + var(--staff-col) + 90rem);table-layout:fixed;border-collapse:separate;border-spacing:0;font-size:.875rem;font-variant-numeric:tabular-nums}
.report-slip-table col:first-child{width:var(--customer-col)}
.report-slip-table col:nth-child(2){width:var(--staff-col)}
.report-slip-table th,.report-slip-table td{padding:8px;text-align:left;border-right:1px solid var(--line);border-bottom:1px solid var(--line);vertical-align:middle;overflow-wrap:anywhere;background:var(--paper)}
.report-slip-table tbody tr:nth-child(even)>*{background:var(--canvas)}
.report-slip-table thead th{background:var(--violet-soft)}
.report-slip-table tbody tr:last-child>*{border-bottom:0}
.report-slip-table tr>:nth-child(-n+2){position:sticky;z-index:1}
.report-slip-table tr>:first-child{left:0}
.report-slip-table tr>:nth-child(2){left:var(--customer-col);box-shadow:3px 0 4px #291d4318}
#report-list .report-slip-table tr>:first-child{box-shadow:3px 0 4px #291d4318}
#report-list .report-slip-table tr>:nth-child(2){position:static;left:auto;box-shadow:none}
.report-slip-table tr>:nth-child(n+5):nth-child(-n+9){text-align:right}
.report-slip-link{border:0;padding:4px 0;background:transparent;color:var(--accent);font:inherit;font-weight:700;min-height:32px;max-width:100%;text-align:left;overflow-wrap:anywhere}
#report-slip-dialog{width:min(calc(100% - 28px),36rem);max-height:85dvh;border:1px solid var(--line);border-radius:12px;padding:16px;color:var(--ink)}
#report-slip-dialog form{margin-top:12px}
#report-slip-dialog::backdrop{background:#201d2d80}
#people > section,#person-profile > section,#person-slips{min-width:0}
.profile-table-scroll{--customer-col:6.5rem;--staff-col:clamp(5.5rem,31vw,11rem)}
.profile-table-scroll .report-slip-table{width:calc(var(--customer-col) + var(--staff-col) + var(--scrolling-cols) * 6.75rem)}
.profile-table-scroll .report-slip-table tr>*{text-align:left}
.profile-table-scroll .report-slip-table tr>.numeric-cell{text-align:right}
#person-credit > section{min-width:0}
.credit-table-scroll{margin-top:8px}
.credit-table.report-slip-table{width:100%;min-width:25rem;table-layout:auto}
#credit-receipts .credit-table{min-width:29rem}
.credit-table.report-slip-table tr>*{position:static;text-align:left;white-space:nowrap;box-shadow:none}
.credit-table.report-slip-table tr>.numeric-cell{text-align:right}
#staff-credit-panel > section{min-width:0}
#staff-credit-charges .credit-table{min-width:32rem}
#staff-credit-receipts .credit-table{min-width:37rem}
.monthly-report{display:grid;gap:14px;margin-top:16px}
.monthly-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
.monthly-heading select{min-width:8rem}
.monthly-totals{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8.5rem),1fr));gap:6px;margin:10px 0}
.monthly-totals > div{padding:4px 6px;border:1px solid var(--line);border-radius:4px;min-width:0}
.monthly-totals dt{font-size:.75rem;color:var(--muted)}
.monthly-totals dd{margin:0;font-weight:700;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.monthly-detail{min-width:0}
.monthly-detail h2{margin-bottom:8px}
.monthly-table-scroll{--customer-col:3.25rem;--staff-col:clamp(6.5rem,31vw,11rem);max-height:65dvh;overflow:auto;overscroll-behavior-x:contain;isolation:isolate}
.monthly-table-scroll .report-slip-table{width:calc(var(--customer-col) + var(--staff-col) + 97.5rem)}
.monthly-table-scroll .report-slip-table tr>:first-child{white-space:nowrap}
.monthly-table-scroll .report-slip-table thead th:nth-child(-n+2){z-index:1}
.monthly-table-scroll .report-slip-table thead{position:sticky;top:0;z-index:2;background:var(--violet-soft)}
.monthly-table-scroll .report-slip-table tr>*{text-align:left}
.monthly-table-scroll .report-slip-table tr>:nth-child(n+6):nth-child(-n+10){text-align:right}
@media(max-width:700px){.monthly-header{padding:10px}.monthly-totals{grid-template-columns:repeat(3,minmax(0,1fr))}}
#staff-rankings,#staff-salary,#payroll > section{min-width:0}
#staff-rank-table .credit-table{min-width:0}
#staff-salary-details .credit-table{min-width:28rem}
#payroll-table .credit-table{min-width:33rem}
#settings > nav{margin-bottom:14px;flex-wrap:wrap}
#settings > nav [aria-current]{box-shadow:inset 0 0 0 2px var(--accent)}
#payroll-summary:empty,#payroll-hours-status:empty{display:none}
.payroll-save-actions{flex-wrap:wrap}
#payroll-save-status:empty{display:none}
.cloud-access{max-width:32rem;padding-block:24px}
.cloud-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding-top:12px}
.cloud-toolbar strong{margin-right:auto}
.cloud-write-status{position:sticky;top:0;z-index:10;padding:12px;background:var(--paper);color:#922}
#cloud-access-status:empty{display:none}
