:root{--mobile-blue:#2367ee;--mobile-ink:#17334e}*{box-sizing:border-box}.mobile-page{max-width:860px;margin:0 auto;padding:24px 18px 150px;color:var(--mobile-ink)}.mobile-page h1{font-size:26px;margin:20px 0 8px}.mobile-muted{font-size:14px;color:#596e82;line-height:1.6}.mobile-page a{color:#205bc1}.mobile-section{background:#fff;border:1px solid #dce5ef;border-radius:14px;margin:16px 0;overflow:hidden}.mobile-section summary{cursor:pointer;padding:18px;font-size:18px;font-weight:700}.mobile-section-body{padding:0 18px 18px}.mobile-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.mobile-field{display:flex;flex-direction:column;gap:8px;min-width:0;font-size:14px}.mobile-field.wide{grid-column:1/-1}.mobile-page input,.mobile-page textarea,.mobile-page select{font:inherit;font-size:16px;min-width:0;width:100%;padding:12px 10px;border:1px solid #aebed0;border-radius:8px;background:#fff;color:#17334e;min-height:46px}.mobile-page input[type=checkbox]{width:26px;height:26px;min-height:26px}.mobile-page input:focus,.mobile-page textarea:focus,.mobile-page select:focus{outline:3px solid #bcd5ff;border-color:#2367ee}.mobile-page button{font:inherit;border:0;border-radius:9px;background:var(--mobile-blue);color:#fff;padding:13px 18px;min-height:46px;cursor:pointer}.mobile-page button:disabled{opacity:.6}.mobile-page .mobile-secondary{background:#e9f1ff;color:#194d9b}.mobile-entry{border-top:1px solid #dce5ef;padding:18px 0}.mobile-entry-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.mobile-page .mobile-danger{background:#fff2f1;color:#b32822;font-size:14px}.mobile-entry>label{display:block;margin-bottom:16px}.mobile-save{position:fixed;z-index:20;bottom:0;left:0;right:0;background:#fff;border-top:1px solid #dce5ef;box-shadow:0 -3px 18px #17334e0d;padding:12px max(18px,calc((100vw - 824px)/2)) calc(12px + env(safe-area-inset-bottom));display:flex;align-items:center;justify-content:space-between;gap:16px}.mobile-save span{font-size:13px;line-height:1.5;max-width:70%;overflow-wrap:anywhere}.mobile-save button{flex-shrink:0}.mobile-note{background:#eaf3ff;padding:16px;border-radius:12px;font-size:14px}.top nav{overflow-x:auto;white-space:nowrap}.mobile-editor-link{display:inline-block;margin-top:12px}.mobile-create{display:flex;gap:12px;flex-wrap:wrap;margin:16px 0}@media(max-width:560px){.mobile-grid{grid-template-columns:1fr}.mobile-page{padding:16px 12px 180px}.mobile-section-body{padding:0 14px 16px}.mobile-save{gap:10px;padding:10px 12px calc(10px + env(safe-area-inset-bottom))}.mobile-save span{max-width:62%}.mobile-section summary{padding:16px}.mobile-page h1{font-size:24px}}@media print{.mobile-save,.mobile-editor-link,.mobile-create{display:none}}

.mobile-field.wide{grid-column:1/-1}.mobile-field input[readonly]{background:#edf3fa;color:#173f6d;font-weight:700}
.education-table{display:grid;grid-template-columns:85px minmax(0,1fr) 100px;gap:16px 12px;align-items:center;font-size:14px}.education-heading{font-size:13px}.mobile-paid{display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:center;gap:6px;white-space:nowrap;font-size:13px}.mobile-paid input{flex:0 0 22px!important;width:22px!important;height:22px!important;min-height:22px!important}
.record-overview{max-height:360px;overflow:auto;margin-bottom:16px}.record-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}.record-table th,.record-table td{border-bottom:1px solid #dce5ef;text-align:left;padding:10px 6px;overflow-wrap:anywhere}.record-table th{background:#edf3fa;position:sticky;top:0}.record-table th:first-child{width:46%}.record-table th:last-child{width:20%}.record-table small{display:block;color:#596e82;margin-top:5px}.record-table tr.selected{background:#e5efff}.mobile-page .record-select{background:none;color:#194d9b;padding:4px 0;text-align:left;min-height:40px;width:100%;font-size:13px}.record-table+button{margin-top:12px}
@media(max-width:560px){.education-table{grid-template-columns:66px minmax(0,1fr) 82px;gap:14px 6px;font-size:12px}.education-table input[type=date]{font-size:13px;padding:8px 3px}.education-table .mobile-paid{font-size:12px;gap:4px}}

.site-result{display:flex;flex-direction:column;gap:9px;text-decoration:none;padding:18px}.site-result strong{font-size:19px;color:#173f70}.site-result small{color:#48698d}.list-search{display:flex;gap:8px;margin:16px 0}.list-search input{flex:1;min-width:0;font-size:16px;padding:12px;border:1px solid #bac9da;border-radius:8px}.panel{margin-top:18px}.task-line{display:flex;gap:16px;flex-wrap:wrap;align-items:center;padding:10px 0;border-bottom:1px solid #e7edf3}.task-line a{margin-left:auto}#schedule-form>label{display:block;margin:18px 0}#schedule-form input[type=checkbox]{vertical-align:middle;margin-right:10px}#delete-schedule{background:#b33131}@media(max-width:760px){.chart .chart-row{display:flex!important;flex-direction:column!important}.chart .chart-row>section{width:100%!important;min-width:0!important}.chart{min-width:0!important}.chart-summary{grid-template-columns:1fr!important}.chart .chart-pair{display:block!important}}

/* Bounded lists: keep all controls usable on narrow phones. */
.paged-search{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:14px 0}.paged-search label{display:flex;flex-direction:column;gap:4px;min-width:120px;flex:1}.paged-search input,.paged-search select{min-width:0;width:100%;box-sizing:border-box;padding:10px;border:1px solid #ccd7e3;border-radius:7px}.pager{display:flex;gap:12px;align-items:center;margin:16px 0}.site-result{overflow-wrap:anywhere}.task-line{flex-wrap:wrap;gap:8px}
@media(max-width:600px){.paged-search label{flex-basis:calc(50% - 8px);min-width:0}.paged-search button{flex:1;min-height:44px}.task-line span{white-space:normal}.pager .btn{min-width:65px;text-align:center}}
@media(max-width:600px){.task-line{grid-template-columns:minmax(0,1fr) auto}.task-line span{grid-column:1}.task-line a{grid-column:2;grid-row:1 / span 2}}
.paged-actions{display:flex;gap:8px}.paged-actions button{white-space:nowrap}.basis-note{flex-basis:100%;font-size:13px;color:#60758c}@media(max-width:600px){.paged-search{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.paged-actions,.basis-note{grid-column:1/-1}.paged-actions button{flex:1}}
.report-context{padding:12px 14px;background:#e8f0fb;border-radius:8px;overflow-wrap:anywhere}.report-table-wrap{max-width:100%;overflow-x:auto;border:1px solid #d6e0eb;border-radius:8px;background:white;margin:16px 0}.report-table{width:100%;min-width:850px;border-collapse:collapse;font-size:14px}.report-table th,.report-table td{padding:12px 10px;text-align:left;border-bottom:1px solid #dce5ee;vertical-align:top}.report-table th{background:#e8f0fb;white-space:nowrap}.report-table tbody tr:nth-child(even){background:#f7fafd}.report-table a{white-space:nowrap}.unpaid-table td:nth-child(5){min-width:200px;max-width:400px;overflow-wrap:anywhere}.report-table td:nth-last-child(2){white-space:nowrap}.page .paged-search{max-width:100%}@media(max-width:600px){.report-table-wrap{margin:12px 0}.report-table{font-size:13px}.report-table td,.report-table th{padding:10px 8px}}
/* Team figures remain complete on desktop. Phone summaries use three columns. */
.card-touch-hint{display:none}.unpaid-table td:nth-child(5){min-width:0;max-width:none}.unpaid-table td:nth-child(3){min-width:200px;max-width:400px;overflow-wrap:anywhere}.unpaid-table td{padding-top:16px;padding-bottom:16px}.report-row{cursor:pointer}.report-row:focus-visible{outline:3px solid #73a5f5;outline-offset:-3px}
@media(max-width:760px){
 .team-summary{min-width:580px;table-layout:fixed}.team-summary th,.team-summary td{overflow-wrap:anywhere}
 .team-summary th:nth-child(n+5):nth-child(-n+9),.team-summary td:nth-child(n+5):nth-child(-n+9){display:none}
 .team-summary th:first-child{width:24%}.team-summary th:nth-child(2){width:20%}.team-summary th:last-child{width:20%}
 .team-summary td:last-child a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:6px;border:1px solid #b8cdf5;border-radius:7px;text-decoration:none;background:#edf4ff}
 .card-touch-hint{display:block;color:#60758c;font-size:13px;margin:12px 0}
 .unpaid-wrap:not(.team-detail-wrap){overflow:visible;border:0;background:transparent;margin-top:12px}
 .unpaid-table:not(.team-detail-table),.unpaid-table:not(.team-detail-table) tbody{display:block;width:100%;min-width:0}.unpaid-table:not(.team-detail-table) thead{display:none}
 .unpaid-table:not(.team-detail-table) .report-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 16px;padding:20px 18px;margin-bottom:14px;background:white;border:1px solid #dce5ee;border-radius:13px;box-shadow:0 2px 5px #17334e0c;touch-action:manipulation}
 .unpaid-table:not(.team-detail-table) .report-row td{display:block;width:auto;min-width:0;max-width:none;padding:0;border:0;white-space:normal;overflow-wrap:anywhere;font-size:15px;line-height:1.55}
 .unpaid-table:not(.team-detail-table) td::before{content:attr(data-label);display:block;font-size:12px;color:#60758c;margin-bottom:3px;font-weight:normal}
 .unpaid-table:not(.team-detail-table) td:nth-child(2),.unpaid-table:not(.team-detail-table) td:nth-child(3){grid-column:1/-1}
 .unpaid-table:not(.team-detail-table) td:nth-child(3){font-size:18px;font-weight:bold;color:#173f70}
 .unpaid-table:not(.team-detail-table) td:nth-child(8){font-weight:bold;color:#b33131}
 .unpaid-table:not(.team-detail-table) .report-chart-action{display:flex;align-items:end;justify-content:flex-end}.report-chart-action::before{display:none}
 .report-chart-action a{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 14px;border-radius:8px;background:#edf4ff;color:#194d9b;text-decoration:none;touch-action:manipulation}
}
/* Compact phone team view, with owner colours as the desktop program. */
.team-mobile{display:none}.team-summary td{vertical-align:middle}.team-summary th:nth-child(2),.team-summary td:nth-child(2),.team-summary th:nth-child(8),.team-summary td:nth-child(8){text-align:center}
.team-detail-table td{padding-top:10px;padding-bottom:10px;vertical-align:middle}
@media(max-width:760px){
 .team-desktop{display:none}.team-mobile{display:inline}.team-summary th,.team-summary td{padding:8px 5px;line-height:1.35;font-size:13px;white-space:normal}
 .team-summary th:nth-child(8),.team-summary td:nth-child(8){display:table-cell!important}
 .team-summary th:first-child{width:20%}.team-summary th:nth-child(2){width:24%}.team-summary th:nth-child(8){width:12%}.team-summary th:last-child{width:20%}
 .team-summary .team-mobile small{font-size:12px}.team-summary td:last-child a{padding:4px 2px;min-height:38px;background:#ffffff80;white-space:normal}
 .unpaid-table:not(.team-detail-table) .report-row{gap:8px 12px;padding:12px 14px;margin-bottom:10px}
 .unpaid-table:not(.team-detail-table) .report-row td{font-size:14px;line-height:1.4}
 .unpaid-table:not(.team-detail-table) td::before{font-size:11px;margin-bottom:2px}
 .unpaid-table:not(.team-detail-table) td:nth-child(2)::before{display:inline;margin-right:7px}
 .unpaid-table:not(.team-detail-table) td:nth-child(3){font-size:17px}
 .unpaid-table:not(.team-detail-table) .report-chart-action::before{display:none}
 .report-chart-action a{padding:6px 12px;min-height:40px}
}

/* Phone actions share the calendar write button position. Desktop/print stay unchanged. */
.phone-chart-actions{display:none}.phone-editor-actions{display:flex;gap:8px}.phone-editor-actions #quick-memo{display:none}
.editor-address-row{display:flex;align-items:center;gap:8px}.editor-address-row input{flex:1;min-width:0}.editor-map{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:46px;padding:8px;background:#edf3ff;border-radius:8px;text-decoration:none}.editor-map[aria-disabled=true]{opacity:.5}
@media screen and (max-width:760px){
 html{scroll-padding-bottom:90px}
 .chart .chart-summary .chart-fields{height:auto}
 .chart .chart-summary .chart-pair,.chart .chart-basic-pair{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px 12px!important}
 .chart .chart-basic-pair .chart-field{display:flex;flex-wrap:wrap;align-content:start;gap:2px 7px;min-width:0}
 .chart .chart-basic-pair .chart-value{min-width:0;overflow-wrap:anywhere}
 .chart .chart-sub .chart-field,.chart .chart-address .chart-field{display:block}.chart .chart-sub .chart-label{display:block;margin-bottom:4px}
 .chart .chart-address .chart-value{display:flex;align-items:center;gap:8px;justify-content:space-between}.chart .chart-address .chart-map-link{flex:none;min-width:44px;min-height:40px;padding:8px 10px;margin:0;text-align:center;text-decoration:none}
 .chart .chart-summary .chart-field{margin:6px 0;line-height:1.5}.chart .chart-summary .chart-pair .chart-label{display:block}
 .phone-chart-actions{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));display:flex;gap:8px;z-index:30}
 .phone-action,.mobile-page .phone-editor-actions button,.mobile-page .phone-schedule-save{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border:0;border-radius:28px;padding:13px 18px;background:#7056ed;color:white;font-size:15px;font-weight:bold;text-decoration:none;box-shadow:0 3px 12px #40307833}
 .phone-action.secondary-action,.mobile-page .phone-editor-actions .mobile-secondary{background:#ece6ff;color:#4d398e}
 .mobile-save{position:static;background:none;border:0;box-shadow:none;padding:10px 0;display:block}.mobile-save span{display:block;max-width:100%}
 .phone-editor-actions{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:30;gap:8px}.phone-editor-actions #quick-memo{display:inline-flex}
 .mobile-page .phone-schedule-save{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:30}
 .mobile-grid.compact-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 10px}.compact-fields .mobile-field{font-size:12px;gap:5px}.compact-fields input{padding:10px 5px;font-size:14px}.compact-fields input[type=date]{font-size:12px;max-width:100%}
 .page:has(.phone-chart-actions){padding-bottom:100px}
}
@media screen and (max-width:760px){
 .phone-create-chart{position:fixed;right:18px;bottom:calc(18px + env(safe-area-inset-bottom));z-index:30;margin:0}
 .phone-create-chart .btn{display:inline-flex;align-items:center;justify-content:center;min-height:48px;border-radius:28px;padding:13px 18px;background:#7056ed;color:white;font-size:15px;font-weight:bold;box-shadow:0 3px 12px #40307833}
 .page:has(.phone-create-chart){padding-bottom:100px}
}
@media print{.phone-chart-actions,.phone-editor-actions,.phone-schedule-save,.phone-create-chart{display:none!important}}

/* Keep receivables and receipts beside each other on phones. */
@media screen and (max-width:760px){
 .chart .chart-row.chart-payment-columns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;align-items:start}
 .chart-payment-columns>section{min-width:0}
 .chart-payment-columns h3{font-size:14px}
 .chart-payment-columns .chart-total{padding:0 0 8px;font-size:12px;line-height:1.6}
 .chart-payment-columns .chart-total-label,.chart-payment-columns .chart-total-amount{display:block}
 .chart-payment-columns .chart-usage{padding:10px 0;font-size:12px;line-height:1.6}
 .chart-payment-columns .chart-usage-heading,.chart-payment-columns .chart-usage-payment{display:flex;flex-direction:column;gap:2px}
 .chart-payment-columns .chart-empty{font-size:12px;overflow-wrap:anywhere}
 .chart-payment-columns .chart-paid-list{border-left:1px solid #d8dee3;padding-left:12px}
}
@media print{.chart .chart-row.chart-payment-columns{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:5mm}}
@media(max-width:760px){.team-summary th:nth-child(3),.team-summary th:nth-child(4){width:12%}.unpaid-table:not(.team-detail-table) td:first-child{grid-column:1/-1}}

/* Local Hubuilds review: desktop fields left/source right, phone source above fields. */
.hubuilds-review{width:min(1050px,94vw);max-width:94vw;max-height:90dvh;box-sizing:border-box;border:1px solid #ccd8e7;border-radius:14px;padding:18px;color:#172c46;background:#fff;overflow:auto}
.hubuilds-review::backdrop{background:#142a4590}
.hubuilds-review-head,.hubuilds-review-tools{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.hubuilds-review-head{justify-content:space-between}
.hubuilds-review-body{display:grid;grid-template-columns:310px minmax(0,1fr);gap:18px}
.hubuilds-review-fields{display:grid;gap:10px}
.hubuilds-review-fields label{display:grid;gap:5px;color:#183550}
.hubuilds-review-fields input,.hubuilds-review-fields textarea{box-sizing:border-box;width:100%;min-width:0;padding:9px;border:1px solid #a9bfd9;border-radius:6px;font:inherit;color:#000;background:#fff}
.hubuilds-review-source{min-width:0}
.hubuilds-review-preview{height:440px;overflow:auto;margin-top:8px;background:#eef2f7;border:1px solid #dbe4ef;touch-action:pan-x pan-y pinch-zoom}
.hubuilds-review-preview img,.hubuilds-review-preview canvas{display:block;max-width:100%;height:auto;cursor:zoom-in}
.hubuilds-review-preview .original-size{max-width:none;cursor:zoom-out}
.hubuilds-review-status{font-size:14px;line-height:1.5;color:#214d78}
.hubuilds-review>.mobile-primary{width:100%;min-height:44px}
@media(max-width:650px){.hubuilds-review{padding:12px}.hubuilds-review-body{grid-template-columns:minmax(0,1fr)}.hubuilds-review-source{grid-row:1}.hubuilds-review-preview{height:220px}.hubuilds-review-tools button{flex:1;white-space:nowrap}}
.hubuilds-review{font:16px/1.45 system-ui,sans-serif}
.hubuilds-review button{font:inherit;cursor:pointer;min-height:40px;border:1px solid #bdcee3;border-radius:8px;padding:8px 12px;background:#edf3ff;color:#183d68}
.hubuilds-review button:disabled{opacity:.55;cursor:wait}
.hubuilds-review>.mobile-primary{position:sticky;bottom:0;background:#2367ee;color:white;font-weight:600;box-shadow:0 -5px 12px #ffffffdd;margin-top:8px}
@media(max-width:650px){.hubuilds-review-preview{height:auto;min-height:100px;max-height:230px}.hubuilds-review-tools button{padding:8px;font-size:14px}}

.hubuilds-photo-frame{position:relative;width:fit-content;max-width:none;line-height:0}
.hubuilds-photo-frame:has(canvas:not(.original-size)){width:100%}
.hubuilds-crop-box{position:absolute;box-sizing:border-box;border:2px solid #1167ff;background:#2479ff22;pointer-events:none}
.hubuilds-photo-tools{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0}
.hubuilds-photo-tools[hidden],.hubuilds-photo-tools button[hidden]{display:none}
.hubuilds-photo-tools button{font-size:13px;padding:7px 9px}
