* { box-sizing: border-box; }
:root {
  color: #152a42; background: #f3f6fa;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  --page: #f3f6fa; --accent: #075eaf; --accent-dark: #084a85; --line: #d5e0eb; --muted: #4d6075;
  --blue-wash: #e7f1fd; --green: #176651;
}
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 280px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; }
button, select {
  border: 1px solid #c0d0e0; border-radius: .55rem; padding: .5rem .75rem;
  min-height: 44px; background: white; color: #243e5a; font-weight: 650;
}
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #2474c2; outline-offset: 2px; }
input, textarea {
  display: block; border: 1px solid #bdcddd; border-radius: .55rem; min-height: 44px;
  padding: .6rem .75rem; color: inherit; width: 100%; min-width: 0; background: #fff;
}
input:is([type="date"], [type="time"]) {
  -webkit-appearance: none; appearance: none;
  min-inline-size: 0; max-inline-size: 100%;
}
input:is([type="date"], [type="time"])::-webkit-date-and-time-value { min-width: 0; margin: 0; text-align: start; }
textarea { resize: vertical; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 650; min-width: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.shell { width: min(100% - 2.5rem, 68rem); margin: 0 auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 65px; gap: .5rem 1rem; padding-block: .45rem; }
.brand { display: inline-flex; color: var(--accent-dark); text-decoration: none; align-items: center; gap: .55rem; font-weight: 780; font-size: 1.15rem; flex-shrink: 0; }
.brand img { border-radius: .55rem; }
.brand small { display: block; color: var(--muted); font-weight: 550; font-size: .75rem; }
.account { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; font-size: .85rem; text-align: right; }
.light { background: transparent; color: var(--accent-dark); border-color: var(--line); }
main { padding-top: 1.15rem; padding-bottom: max(3rem, env(safe-area-inset-bottom)); }
.page-head, .map-actions { display: flex; align-items: end; justify-content: space-between; gap: .65rem; flex-wrap: wrap; }
.today { font-size: .875rem; color: var(--muted); }
.today::first-letter { text-transform: uppercase; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.35rem); margin: .13rem 0 0; letter-spacing: -.042em; }
h2 { margin: 0; font-size: 1.14rem; overflow-wrap: anywhere; }
.demo { display: inline-block; margin-top: .5rem; color: #745124; font-weight: 650; font-size: .8rem; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem .75rem;
  position: sticky; top: 0; z-index: 2; padding: .42rem 0; margin: .55rem 0;
  background: var(--page); border-bottom: 1px solid var(--line);
}
.toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.toolbar-actions button { font-size: .8rem; }
#plan-pickup { color: white; background: var(--green); border-color: var(--green); }
.trial-control { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .65rem; padding: .1rem .65rem .65rem; }
.trial-tools { margin-top: 1rem; }
.appointment-result { padding: .7rem .8rem; border-radius: .55rem; background: #def1e6; color: #1b5b42; font-weight: 650; }
.tabs { display: inline-flex; padding: .18rem; gap: .15rem; border-radius: .65rem; background: #e4ebf4; }
.tabs button { border: 1px solid transparent; background: transparent; }
.tabs button[aria-pressed="true"] { background: var(--accent); color: white; }
.tabs button[aria-expanded="true"] { background: #fff; color: var(--accent-dark); border-color: #99b8d8; }
.job-filter-panel { display: grid; gap: .55rem; padding: .7rem; border: 1px solid var(--line); background: #fff; border-radius: .75rem; }
.job-search input { min-height: 46px; }
.filters { display: flex; flex-wrap: wrap; gap: .32rem; }
.filters button { font-size: .83rem; padding-inline: .6rem; }
.filters button[aria-pressed="true"] { color: var(--accent-dark); background: var(--blue-wash); border-color: #91b5df; }
.filter-count { font-variant-numeric: tabular-nums; color: var(--muted); margin-inline-start: .16rem; }
.control-details { border: 1px solid var(--line); background: #fff; border-radius: .55rem; }
.control-details summary { cursor: pointer; color: var(--accent-dark); font-size: .86rem; font-weight: 680; min-height: 44px; padding: .65rem; }
.control-details summary > span { margin-left: .3rem; font-size: .78rem; }
.advanced-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: .65rem; padding: 0 .65rem .65rem; }
.job-filter-panel .control-details { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.job-filter-panel summary { padding-inline: .18rem; }
.job-filter-panel .advanced-fields { padding-inline: .18rem; }
.advanced-fields select, .advanced-fields input { width: 100%; min-width: 0; }
.nearby-controls { display: flex; flex-wrap: wrap; gap: .55rem .75rem; align-items: end; margin-top: .65rem;
  padding: .7rem; background: var(--blue-wash); border: 1px solid #b9d1ee; border-radius: .65rem; }
.nearby-controls > label:first-child { flex: 1 1 12rem; }
.nearby-controls select { width: 100%; }
.results-bar { display: flex; gap: .2rem .5rem; align-items: center; flex-wrap: wrap; margin: .45rem 0; }
.results-bar p { margin-right: auto; font-size: .9rem; font-weight: 730; }
.text-action { background: transparent; color: var(--accent-dark); border-color: transparent; font-size: .82rem; padding-inline: .45rem; }
.text-action:hover { background: var(--blue-wash); }
#list { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr)); }
.card {
  display: flex; flex-direction: column; padding: 1.05rem 1.1rem;
  gap: .6rem; background: white; border: 1px solid var(--line); border-radius: .95rem;
  box-shadow: 0 3px 12px #103a3110; min-width: 0;
}
.card-head { display: flex; align-items: start; justify-content: space-between; gap: .55rem; }
.muted { color: var(--muted); font-size: .875rem; }
.job-card { gap: .42rem; scroll-margin-top: 8rem; }
.job-card h2 { font-size: 1.27rem; letter-spacing: -.022em; }
.job-kind { display: inline-block; margin-bottom: .28rem; padding: .16rem .42rem; border-radius: .28rem;
  font-size: .75rem; font-weight: 760; background: #daf0e6; color: #165b47; }
.job-kind.installation { background: #e3efff; color: #124e8e; }
.job-address { overflow-wrap: anywhere; line-height: 1.4; }
.job-expand { flex-shrink: 0; }
.badge { display: inline-block; border-radius: .35rem; background: #edf2f7; color: #334c69; padding: .27rem .5rem; font-size: .8rem; font-weight: 700; line-height: 1.35; }
.badge.green { color: #154e87; background: #e3efff; }
.badge.amber { color: #77501a; background: #fff0d1; }
.job-appointment { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem .45rem; }
.job-appointment button { font-size: .84rem; }
.note { border-left: 3px solid #75ab9d; padding: .45rem .65rem; background: #eff7f5; border-radius: .25rem; font-size: .88rem; overflow-wrap: anywhere; }
.card footer { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; padding-top: .25rem; margin-top: auto; }
.card footer a { display: inline-flex; align-items: center; min-height: 44px; padding: .35rem .55rem; font-weight: 660; }
.job-card footer { gap: .3rem; font-size: .84rem; }
.job-card footer a { background: #edf4fc; border-radius: .5rem; text-decoration: none; }
.job-work { border-top: 1px solid var(--line); padding-top: .65rem; }
.job-work ul { margin: .35rem 0; padding-left: 1.25rem; }
.primary { background: var(--accent); border: 1px solid var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.message { background: #e6f0f0; padding: .7rem .85rem; border-radius: .6rem; margin: 0 0 1rem; }
.error { color: #9e2426; font-weight: 650; }
.login-card { max-width: 26rem; margin: clamp(1rem, 10vh, 7rem) auto 0; background: white; border: 1px solid var(--line); border-radius: 1.1rem; padding: 1.5rem; display: grid; gap: .85rem; }
.login-card h1 { margin-bottom: .4rem; }
.map-actions { align-items: center; padding-bottom: .55rem; }
#map { height: clamp(300px, 56vh, 590px); background: #dfe9e8; border: 1px solid var(--line); border-radius: .9rem; z-index: 0; }
.map-legend, .map-missing { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1rem; margin-top: .65rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.map-symbol { display: inline-block; width: 1em; height: 1em; border-radius: 50%; background: #37504a; }
.map-symbol.scheduled { background: #188350; }
.map-symbol.service { background: #b3261e; }
.map-symbol.installation { background: #176cbb; }
.map-symbol.reference { border: 2px solid #273c39; background: #fff; }
.map-symbol.diamond { border-radius: 2px; transform: rotate(45deg); }
.job-map-icon { display: grid; place-items: center; }
.job-map-icon .map-symbol { width: 19px; height: 19px; border: 2px solid #fff; box-shadow: 0 0 0 1px #173c36; }
.job-map-icon .map-symbol.reference { border-color: #273c39; }
.map-popup p { margin: .25rem 0; }
.map-popup-actions { display: grid; gap: .32rem; margin-top: .6rem; }
.map-popup-actions button, .map-popup-actions a { display: grid; place-items: center; min-height: 44px; padding: .35rem .55rem; text-align: center; }
.map-popup-actions button:first-child { background: var(--accent); color: white; border-color: var(--accent); }
.map-popup-actions a { background: #e5f4ed; border-radius: .55rem; color: var(--green); font-weight: 700; text-decoration: none; }
dialog {
  color: inherit; width: min(100% - 2rem, 28rem); max-height: 90vh;
  background: white; border: 1px solid var(--line); border-radius: 1rem;
  padding: 1.15rem; box-shadow: 0 20px 55px #102b3550;
}
dialog::backdrop { background: #102b3577; }
dialog form { display: grid; gap: .9rem; }
.dialog-title, .dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: .65rem; flex-wrap: wrap; }
.close { font-size: 1.25rem; line-height: 1; }
.date-fields { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: .7rem; }
@media (max-width: 680px) {
  .shell { width: calc(100% - 1.15rem); }
  main { padding-top: .8rem; }
  .header-row { flex-wrap: wrap; min-height: 60px; }
  .account { margin-left: auto; gap: .4rem; }
  .account span { max-width: 11ch; overflow-wrap: anywhere; line-height: 1.15; }
  .account button { padding-inline: .45rem; font-size: .75rem; }
  .view-tabs { display: grid; flex: 1 0 100%; grid-template-columns: 1fr 1fr minmax(0, 1.45fr); }
  .view-tabs button { padding-inline: .18rem; font-size: .84rem; }
  .toolbar-actions { flex: 1 0 100%; }
  .toolbar-actions button { flex: 1 1 7rem; padding-inline: .35rem; }
  input, textarea, select { font-size: max(16px, 1rem); }
  #pickup-dialog .date-fields { grid-template-columns: minmax(0, 1fr); }
  .page-head { align-items: center; }
  .card { padding: .75rem; }
  .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 4.25rem), 1fr)); }
  .filters button { font-size: .78rem; padding-inline: .2rem; }
}

#pickup-confirm-items { margin: 0; padding-inline-start: 1.35rem; overflow-wrap: anywhere; }
#pickup-confirm-items:empty { display: none; }

.pickup-summary {
  margin-top: .75rem; padding: .8rem 1rem; border: 1px solid #b5d9cd;
  border-radius: .8rem; background: #eaf6f1; display: flex; justify-content: space-between;
  align-items: center; gap: .6rem; flex-wrap: wrap;
}


#service-operations { margin-bottom: 1rem; padding: .65rem .85rem; border-radius: .7rem; border: 1px solid var(--line); background: white; }
#service-operations summary { cursor: pointer; font-weight: 650; }
#service-operations[open] summary { margin-bottom: .8rem; }
#service-operations ul { list-style: none; padding: 0; margin: .45rem 0 .9rem; display: grid; gap: .5rem; }
#service-operations li { padding: .55rem .7rem; border: 1px solid var(--line); border-radius: .5rem; }
#service-operations li button { margin-top: .4rem; }
#service-operations input[type="checkbox"] { display: inline; width: auto; min-height: auto; }
#service-operations label:has(input[type="checkbox"]) { display: inline-block; }

.technician-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .6rem; }
.settlement-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin: .7rem 0; }
.settlement-filters select { width: 100%; padding-inline: .45rem; }
.settlement-summary { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; padding: .65rem 0; font-weight: 650; }
#settlement-refresh { margin-left: auto; }
#settlement-rows, #trial-extras { display: grid; gap: .65rem; }
#trial-completion-dialog { width: min(100% - 1.4rem, 34rem); max-height: 89dvh; }
#trial-completion-dialog h3 { margin: 0; font-size: 1rem; }
.trial-extra { display: grid; gap: .55rem; border: 1px solid var(--line); border-radius: .65rem; padding: .7rem; min-width: 0; }
.trial-extra select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.trial-price-toggle { display: flex; align-items: center; min-height: 44px; }
.trial-price-toggle input { width: 1.2rem; height: 1.2rem; min-height: 0; }
#trial-photo-list { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
#trial-photo-list:empty, #trial-extras:empty { display: none; }
#trial-photo-list li { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
#trial-photo-list img { width: 48px; height: 48px; object-fit: cover; border-radius: .35rem; }
.map-popup > a { display: block; margin: .25rem 0; }
