:root {
  color-scheme: light;
  --ink: #173138;
  --muted: #516972;
  --teal: #104d58;
  --line: #dce7e9;
  --paper: #fff;
  --wash: #f0f6f7;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); font: 16px/1.45 system-ui, sans-serif; }
a { color: var(--teal); text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .56rem .85rem; border: 1px solid transparent; border-radius: 10px; background: var(--teal); color: white; font-weight: 650; text-align: center; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { filter: brightness(.93); }
button:disabled { opacity: .55; cursor: wait; }
button.secondary, .button.secondary { border-color: var(--line); background: #fff; color: var(--teal); }
button.danger { background: #9f302a; }
button.small, .button.small { min-height: 38px; padding: .35rem .65rem; font-size: .84rem; }
:focus-visible { outline: 3px solid #de9a39; outline-offset: 3px; }
[hidden] { display: none !important; }
form { margin: 0; }
label { display: block; margin: .45rem 0 .3rem; font-weight: 650; }
input:not([type=checkbox],[type=hidden]), textarea, select { display: block; width: 100%; min-width: 0; min-height: 44px; border: 1px solid #a7bfc4; border-radius: 9px; background: white; color: var(--ink); padding: .48rem .65rem; }
input[type=checkbox] { width: 1.1rem; height: 1.1rem; vertical-align: middle; accent-color: var(--teal); }
fieldset { margin: .75rem 0; border: 0; padding: 0; min-inline-size: 0; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: clamp(1.45rem, 4vw, 2.2rem); overflow-wrap: anywhere; }
h2 { font-size: 1.12rem; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .84rem; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2rem, 1160px); margin-inline: auto; }
.main { padding-block: 1.35rem 2rem; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .7rem; padding-block: .7rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.brand small { display: block; color: var(--muted); font-size: .64rem; letter-spacing: .09em; }
.brand img { border-radius: 10px; }
.account, .inline { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.account select { min-height: 38px; width: auto; max-width: min(32vw, 18rem); font-size: .85rem; }
.nav { display: flex; gap: .3rem; overflow: auto; padding-block: .25rem .55rem; }
.nav a { flex: none; padding: .42rem .6rem; border-radius: 8px; text-decoration: none; font-size: .85rem; font-weight: 670; }
.nav a:hover { background: #e1f2f1; }
.foot { display: flex; justify-content: space-between; align-items: center; padding-bottom: 1.35rem; color: var(--muted); font-size: .82rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.eyebrow { color: #1a6872; font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .35rem; }
.panel { min-width: 0; margin-bottom: .85rem; padding: clamp(.85rem, 2.5vw, 1.3rem); background: white; border: 1px solid var(--line); border-radius: 14px; }
.narrow { max-width: 590px; }
.login { margin: 1.5rem auto; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.filters > p, .filters > label { flex: 1 1 8.5rem; margin: 0; font-size: .85rem; }
.filters label { margin-top: 0; }
.filters input, .filters select { margin-top: .25rem; }
.filters .errorlist { flex-basis: 100%; }
.table-panel { padding: 0; overflow: hidden; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .87rem; }
th, td { padding: .68rem .75rem; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: #e9f2f3; color: #25474f; font-size: .78rem; }
td small, .compact-list small, .timeline small { display: block; color: var(--muted); }
.empty { color: var(--muted); text-align: center; padding: 1.1rem; }
.tag { display: inline-block; padding: .18rem .46rem; border-radius: 7px; background: #e7f1f3; color: #174750; font-size: .76rem; font-weight: 680; }
.bill-paid, .work-ready { background: #d9f1df; color: #125c33; }
.bill-unpaid, .bill-processing, .bill-refund_pending { background: #fff1d4; color: #77510d; }
.bill-failed, .work-cancelled { background: #f9e2df; color: #8d2e28; }
.pager { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .65rem .8rem; color: var(--muted); font-size: .82rem; }
.notice { margin: .65rem 0; padding: .65rem .8rem; border-radius: 9px; background: #e7f1f3; }
.notice.warning { background: #fff1d4; color: #77510d; }
.notice.error, .errorlist { color: #942e26; }
.notice.error { background: #f9e2df; }
.notice.success { background: #d9f1df; color: #125c33; }
.scan-actions { margin: .55rem 0; }
.quote { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem; padding: .75rem; margin: .8rem 0; border-radius: 10px; background: #e7f1f3; }
.quote span, .tile span { display: block; font-size: .82rem; color: var(--muted); }
.quote strong, .tile strong { font-size: clamp(1rem, 3vw, 1.3rem); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .6rem; margin-bottom: .8rem; }
.tile { min-width: 0; padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 11px; overflow-wrap: anywhere; }
.status-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.status-grid div { display: flex; gap: .35rem; border-radius: 8px; background: #e7f1f3; padding: .35rem .55rem; font-size: .83rem; }
.status-grid meter { width: 2.5rem; align-self: center; }
[data-order-url] { cursor: pointer; }
[data-order-url]:hover { background: #f2f8f8; }
.chart { max-height: 22rem; overflow: auto; }
.chart-row { display: grid; grid-template-columns: 4rem minmax(2rem, 1fr) auto; gap: .5rem; align-items: center; font-size: .8rem; margin-bottom: .4rem; }
meter { width: 100%; accent-color: #1b6974; }
.chart-note { padding-left: 4.5rem; }
.key-value { display: grid; grid-template-columns: minmax(6rem, .65fr) minmax(0, 1fr); gap: .35rem .5rem; }
.key-value dt { color: var(--muted); }
.key-value dd { margin: 0; overflow-wrap: anywhere; }
.receipt { overflow-wrap: anywhere; margin-block: .6rem; padding: .6rem; background: #e9f6ed; border-radius: 9px; }
.action { margin-top: .85rem; }
summary { cursor: pointer; color: var(--teal); font-weight: 650; }
.timeline, .compact-list { margin: .5rem 0 0; padding-left: 1.2rem; }
.timeline li, .compact-list li { padding-block: .35rem; }
.results { display: grid; gap: .35rem; margin-block: .5rem; }
.results button { justify-content: flex-start; text-align: left; }
dialog { width: min(92vw, 480px); padding: 1rem; border: 1px solid var(--line); border-radius: 14px; }
dialog::backdrop { background: #102f3abb; }
video { width: 100%; border-radius: 9px; background: #18343b; }
.camera-dialog { max-height: 92vh; max-height: 92dvh; overflow-y: auto; }
.camera-dialog video { display: block; max-height: 55vh; max-height: 55dvh; object-fit: contain; }
.camera-dialog .scan-actions { margin-bottom: 0; }
@media (max-width: 700px) {
  .wrap { width: calc(100% - 1.25rem); }
  .split { grid-template-columns: 1fr; gap: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  th, td { padding: .5rem .6rem; }
  .account select { max-width: 42vw; }
}
