:root{color-scheme:dark;--ink:#f4f2f1;--canvas:#0a0a0b;--surface:#151517;--inset:#101012;--control:#1d1d20;--hover:#2a2a2e;--rule:#333338;--control-rule:#53535b;--muted:#b8b5bc;--red:#b9202f;--red-deep:#941a27;--accent-text:#ff7d88;--focus:#ffc6ca;--green:#8addac;--gold:#f0c484;--radius:10px;--field-height:44px;--font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{margin:0;background:var(--canvas);color:var(--ink);font:16px/1.45 var(--font)}[hidden]{display:none!important}.skip{position:absolute;left:12px;top:-100px;color:var(--ink);background:var(--surface);padding:12px;z-index:5}.skip:focus{top:12px}
.masthead{background:#0d0d0e;border-bottom:4px solid var(--red)}.mast-content{max-width:1140px;margin:auto;display:flex;align-items:center;justify-content:space-between;min-height:79px;padding:14px 28px;gap:16px}.mast-content img{height:auto;width:min(225px,53vw);object-fit:contain}
.wrap{max-width:1140px;margin:auto;padding:30px 28px}.screen-reader-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.eyebrow{font-size:11px;color:var(--accent-text);font-weight:850;letter-spacing:.12em}.tab-bar{display:flex;gap:4px;background:var(--inset);border:1px solid var(--rule);border-radius:9px;padding:4px;width:max-content;max-width:100%;margin-bottom:12px}.tab-bar .tab{min-width:135px;border:1px solid transparent;background:transparent;text-align:center}.tab-bar .tab[aria-pressed="true"]{color:#fff;background:var(--red);border-color:var(--red)}.notice{font-size:13px;border-left:3px solid var(--red);padding:9px 12px;background:var(--inset);color:var(--muted);margin:0 0 20px}.toast{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);max-width:90vw;background:#28282b;color:var(--ink);border:1px solid var(--rule);padding:12px 16px;border-radius:7px;z-index:30;box-shadow:0 3px 10px #0003;margin:0}
h2{font-size:clamp(22px,4vw,32px);letter-spacing:-.025em;margin:0 0 .5rem}h3{font-size:18px;margin:0 0 .55rem}p{margin:.55em 0}section,form,div{min-width:0}#panel>section+section,#panel>article+article{margin-top:14px}.card,.surface,.panel,.box,fieldset{background:var(--surface);border:1px solid var(--rule);border-radius:var(--radius);padding:18px;margin:0 0 14px}.row,.actions,.toolbar,.button-row,.stack-inline{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.grid,.form-grid,.fields{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:12px}.stack{display:grid;gap:12px}
button,.button,.btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;gap:6px;min-height:42px;border:1px solid var(--control-rule);border-radius:7px;padding:8px 13px;background:var(--control);color:var(--ink);font:700 14px/1.2 var(--font);cursor:pointer}button:hover,.button:hover,.btn:hover{background:var(--hover)}button.primary,.btn-primary,.button.primary{border-color:var(--red);background:var(--red);color:white}.primary:hover,.btn-primary:hover{background:var(--red-deep)}button[disabled]{background:#222225;border-color:#39393f;color:#aaa7ae;cursor:not-allowed}button.danger{color:var(--accent-text)}button.small{min-height:36px;font-size:13px}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{display:block;width:100%;min-width:0;max-width:100%;height:var(--field-height);min-height:var(--field-height);border:1px solid var(--control-rule);border-radius:6px;padding:8px 10px;background:var(--inset);color:var(--ink);font:400 16px/1.25 var(--font)}input[type=checkbox],input[type=radio]{width:18px;height:18px;vertical-align:middle;accent-color:var(--red)}input[type=hidden]{display:none}input[type=file]:not([type=checkbox]){padding:4px 7px}input::-webkit-date-and-time-value{text-align:left}textarea{resize:vertical;min-height:88px}label{min-width:0}label{display:block;font-size:14px;font-weight:650}label input,label select,label textarea{margin-top:4px}fieldset legend{padding:0 5px}a{color:var(--accent-text);overflow-wrap:anywhere}a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible{outline:3px solid var(--focus);outline-offset:2px}summary{font-weight:700;cursor:pointer;padding:6px 0}
table{width:100%;border-collapse:collapse;font-size:14px}th,td{vertical-align:top;text-align:left;padding:10px;border-bottom:1px solid var(--rule)}th{font-size:12px;font-weight:800;color:var(--muted);background:var(--inset)}td input,td select{min-width:100px}.table-wrap,.table-scroll{max-width:100%;overflow:auto}.table-wrap table,.table-scroll table{min-width:610px}
.badge,.pill{display:inline-block;border-radius:4px;background:#28282b;color:var(--muted);padding:4px 7px;font-size:12px;font-weight:750}.badge.ready,.pill.ready,.success{color:var(--green);background:#173526}.badge.warn,.pill.warn,.warning{color:var(--gold);background:#3a2916}.error,[role=alert]{color:#ffd8db;background:#402126}.muted,.hint,.help,.small{color:var(--muted);font-size:13px}footer{margin:26px 0 8px;border-top:1px solid var(--rule);padding-top:12px;font-size:12px;color:var(--muted)}footer span{margin:0 6px}
@media(max-width:650px){.mast-content{min-height:64px;padding:10px 16px}.wrap{padding:22px 14px}.card,.surface,.panel,.box,fieldset{padding:13px}.tab-bar{width:100%}.tab-bar .tab{min-width:0;flex:1}}
.export-ready{display:flex;align-items:center;justify-content:space-between;gap:12px;border-color:var(--red);box-shadow:0 3px 12px #0005}.export-ready p{margin:.2em 0}.tab[data-panel="history"]{white-space:nowrap}
@media(max-width:650px){.tab-bar .tab{font-size:12px;padding-inline:5px}.export-ready{display:block}.export-ready .actions{margin-top:8px}}
/* Stack the complete tables on portrait phones; keep their semantic roles in WebKit. */
#panel{min-width:0;overflow-wrap:anywhere}
.stacked-label{display:none}
.charge-selection{display:inline-flex;align-items:center;gap:8px;min-height:36px}
.charge-selection input{margin:0;flex:none}
.field-actions{align-items:end}
.field-actions>label{flex:1 1 170px}
[data-card-form]>label+[class], [data-card-form]>label+label,[data-receipt-form]>label+label{margin-top:10px}
[data-card-form]>.actions,[data-receipt-form]>.actions{margin-top:12px}
@media(max-width:700px){
 .transaction-table,.mileage-table{overflow:visible}
 .transaction-table table,.transaction-table tbody,.mileage-table table,.mileage-table tbody,.mileage-table tfoot{display:block;min-width:0}
 .transaction-table thead,.mileage-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 .transaction-table tbody tr,.mileage-table tbody tr,.mileage-table tfoot tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 12px;border:1px solid var(--rule);border-radius:8px;padding:11px;margin:8px 0}
 .transaction-table tbody td,.mileage-table td,.mileage-table tfoot th{display:block;min-width:0;border:0;padding:0;overflow-wrap:anywhere}
 .stacked-label{display:block;color:var(--muted);font-size:12px;font-weight:650;margin:0 0 2px}
 .transaction-table tbody td:nth-child(1){grid-column:1;grid-row:1}
 .transaction-table tbody td:nth-child(2){grid-column:1;grid-row:2}
 .transaction-table tbody td:nth-child(3){grid-column:1/-1;grid-row:3}
 .transaction-table tbody td:nth-child(3) .stacked-value{font-weight:750}
 .transaction-table tbody td:nth-child(4){grid-column:2;grid-row:2}
 .transaction-table tbody td:nth-child(5){grid-column:1;grid-row:4}
 .transaction-table tbody td:nth-child(6){grid-column:2;grid-row:4}
 .transaction-table tbody td:nth-child(7){grid-column:2;grid-row:1}
 .transaction-table tbody td:nth-child(8){grid-column:1/-1;grid-row:5}
 .transaction-table .charge-selection{min-height:44px}
 .transaction-table .charge-selection .stacked-label{margin:0}
 .transaction-table,.mileage-table{margin:12px 0}
 .mileage-table tbody td:nth-child(1),.mileage-table tbody td:nth-child(2),.mileage-table tbody td:nth-child(3),.mileage-table tbody td:nth-child(6),.mileage-table .table-empty td,.mileage-table tfoot th{grid-column:1/-1}
 .mileage-table tfoot tr{background:var(--inset)}
 .mileage-table tfoot th{font-size:14px}
 .mileage-table tfoot .desktop-only-cell{display:none}
}
.orientation-notice{display:none}
@media screen{
 html[data-phone-landscape] body > :is(.skip,.masthead,.wrap,.toast){display:none!important}
 html[data-phone-landscape] .orientation-notice{display:flex;min-height:100vh;min-height:100dvh;flex-direction:column;align-items:center;justify-content:center;padding:20px;text-align:center}
 .orientation-notice h1{margin:0;font-size:clamp(24px,5vw,38px)}
 .orientation-notice p{color:var(--muted)}
}

input::placeholder,textarea::placeholder{color:#9a979e;opacity:1}input::file-selector-button{background:var(--control);color:var(--ink);border:1px solid var(--control-rule);border-radius:4px;margin-right:8px;padding:6px 8px;font:inherit;cursor:pointer}::selection{background:var(--red);color:white}
.expense-restore{border-top:1px solid var(--rule);margin-top:14px;padding-top:8px}.recovery-list{padding:0;list-style:none;margin:10px 0 0}.recovery-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid var(--rule);padding:7px 0}.recovery-row span{overflow-wrap:anywhere}.recovery-row button{flex-shrink:0}


.receipt-actions button{min-height:44px}.receipt-actions{gap:10px}@media(max-width:650px){.receipt-actions button{flex:1 1 0}}

/* A compact disclosure keeps Settings distinct from the three workspaces. */
#settings-button{white-space:nowrap;flex:none;min-height:44px}
.settings-panel{margin-bottom:14px}
.settings-option{display:flex;min-height:44px;align-items:center;gap:10px}
.settings-option input{flex:none;margin:0}
.settings-panel h2,.settings-panel p{margin-top:0}
@media(max-width:700px){
 .transaction-table.no-gl tbody td:nth-child(5){grid-column:1;grid-row:4}
 .transaction-table.no-gl tbody td:nth-child(6){grid-column:2;grid-row:1}
 .transaction-table.no-gl tbody td:nth-child(7){grid-column:1/-1;grid-row:5}
}

.receipt-view{margin:10px 0 14px}
[data-receipt-view]{margin-top:10px}
[data-receipt-image] img{display:block;width:auto;height:auto;max-width:100%;max-height:65vh;object-fit:contain}
.receipt-save-original{border:0;background:transparent;color:var(--muted);font-size:13px;padding:6px 0;min-height:36px;text-align:left}
.settings-employee{margin:0 0 10px}
.receipt-detail-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.receipt-detail-fields>.receipt-detail-full{grid-column:1/-1}
.receipt-date,.receipt-date-control,.mileage-calendar,.mileage-calendar-control{min-inline-size:0;max-inline-size:100%}
.receipt-date-control,.mileage-calendar-control{position:relative;display:block}
.receipt-date-control input[type=date],.mileage-calendar-control input:is([type=date],[type=month]){
 -webkit-appearance:none;appearance:none;box-sizing:border-box;display:block;
 width:100%;min-width:0;max-width:100%;height:var(--field-height);min-height:var(--field-height);max-height:var(--field-height);
 padding:8px 10px;overflow:hidden;
}
.receipt-date-control input::-webkit-date-and-time-value,.mileage-calendar-control input::-webkit-date-and-time-value{height:auto;min-width:0;text-align:left;margin:0}
.receipt-date-control input::-webkit-datetime-edit,.mileage-calendar-control input::-webkit-datetime-edit{min-width:0;padding:0}
.receipt-date-cue,.mileage-calendar-cue{display:block;position:absolute;top:50%;transform:translateY(-50%);left:11px;right:38px;overflow:hidden;white-space:nowrap;pointer-events:none;color:var(--muted);font-weight:400}
.receipt-date-control input:focus + .receipt-date-cue,.mileage-calendar-control input:focus + .mileage-calendar-cue{display:none}
.receipt-date-cue,.mileage-calendar-cue{background:var(--inset)}

.mileage-screen fieldset,.mileage-screen .form-grid{min-inline-size:0;max-inline-size:100%}
.mileage-report-details>.mileage-calendar{max-inline-size:100%;margin-bottom:12px}
.mileage-report-actions{margin-top:14px}
.mileage-report-actions>button{max-inline-size:100%}

.mileage-trip-fields{grid-template-columns:repeat(2,minmax(0,1fr))}
.mileage-trip-fields>.mileage-trip-full{grid-column:1/-1}
@media(max-width:349px){.mileage-trip-fields{grid-template-columns:minmax(0,1fr)}}

.mileage-signature{margin-top:12px}
#mile-clear-signature{margin-top:8px}

.mileage-screen>.section-header{margin-bottom:16px}
.mileage-report-details>legend,#mile-trip-heading{font-size:18px;font-weight:800}

/* A 20px line in a 44px field with a 1px border leaves 11px above and below. */
:root{--field-line-height:20px;--field-block-padding:calc((var(--field-height) - var(--field-line-height) - 2px) / 2)}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),select{
 padding-block:var(--field-block-padding);line-height:var(--field-line-height)
}
input::-webkit-date-and-time-value{height:var(--field-line-height);line-height:var(--field-line-height);margin:0;text-align:left}
.receipt-date-control input::-webkit-date-and-time-value,.mileage-calendar-control input::-webkit-date-and-time-value{height:var(--field-line-height)}
input::-webkit-datetime-edit,input::-webkit-datetime-edit-fields-wrapper{padding-block:0;line-height:var(--field-line-height)}
.receipt-date-cue,.mileage-calendar-cue{line-height:var(--field-line-height)}

.mileage-quick-trip{margin:8px 0 0}
#mile-quick-options{margin-top:8px}

/* A table-wide min-width rule must not stretch each selection checkbox. */
.transaction-table .charge-selection input[type=checkbox]{
 inline-size:18px;min-inline-size:18px;max-inline-size:18px;block-size:18px;margin:0;flex:0 0 18px
}
@media(max-width:700px){
 .transaction-table .charge-selection{display:inline-flex;justify-content:flex-start;min-block-size:44px;gap:8px}
 .transaction-table:not(.no-gl) tbody td:nth-child(7),
 .transaction-table.no-gl tbody td:nth-child(6){align-self:center}
}


.report-delete-dialog {max-width: min(30rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; margin: auto;}
.report-delete-dialog::backdrop {background: rgba(0,0,0,.72);}
.report-delete-dialog h2 {margin-top: 0;}
.report-delete-filename {overflow-wrap: anywhere;}
.report-delete-danger {border-color: #ea6666; color: #ffb6b6;}
