:root {
  color-scheme: light;
  --bg: #f4f6f1; --hero-panel: #edf3e8; --input: #fbfcfa; --notice-error: #9b302c; --danger-bg: #fbe9e6; --paper: #fff; --ink: #142c27; --muted: #52655c; --line: #dbe5da;
  --forest: #123f35; --green: #245d4c; --action: #f9ce54; --action-ink: #262004; --soft: #e6f1e3;
  --warn: #79520c; --warn-bg: #fff3d7; --danger: #9b302c;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101a18; --paper: #192622; --ink: #edf4ee; --muted: #b3c6bd; --line: #354841;
  --forest: #205444; --green: #a8d7bb; --soft: #233a31;
  --warn: #ffda8f; --warn-bg: #3b2e18; --danger: #ffbdb6; --danger-bg: #452523;
  --hero-panel: #172822; --input: #111e1a;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
a { color: var(--green); }
button, summary { cursor: pointer; }
button:disabled { opacity: .53; cursor: default; }
:focus-visible { outline: 3px solid #4a9369; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5.1vw, 3.15rem); line-height: 1.02; letter-spacing: -.07em; }
h2 { font-size: 1.35rem; letter-spacing: -.045em; line-height: 1.2; }
h3 { font-size: 1rem; line-height: 1.35; }
p { line-height: 1.5; }
small, .muted { color: var(--muted); }
strong { font-weight: 700; }
.loading { padding: 3rem 1.35rem; text-align: center; }
.shell { max-width: 1080px; margin-inline: auto; padding: 0 22px 36px; }
.shell.mobile { max-width: 632px; }
.header { background: var(--paper); border-bottom: 1px solid var(--line); }
.header-wrap { min-height: 70px; max-width: 1080px; padding: 0 22px; margin: auto; display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; letter-spacing: -.04em; }
.brand img { width: 36px; height: 36px; }
.header-end { display: flex; align-items: center; gap: 8px; }
.theme-toggle { color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; padding: 0; flex-shrink: 0; display: grid; place-items: center; }
.theme-toggle:hover { background: var(--soft); }
.theme-toggle::before { content: "☾"; font-size: 1.36rem; line-height: 1; }
:root[data-theme="dark"] .theme-toggle::before { content: "☀"; }
.header-end .btn { padding: 8px 10px; min-height: 34px; font-size: .8rem; }
.demo { display: inline-block; color: var(--warn); background: var(--warn-bg); border-radius: 30px; font-size: .72rem; font-weight: 650; padding: 6px 10px; white-space: nowrap; }
.page-head { padding: 27px 0 17px; }
.page-head p { margin-top: 7px; color: var(--muted); }
.eyebrow { font-weight: 700; font-size: .77rem; letter-spacing: .085em; text-transform: uppercase; }
.hero { margin: 0 0 17px; border-radius: 23px; background: var(--forest); color: white; padding: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; width: 180px; height: 180px; border: 1px solid #75be923c; border-radius: 50%; position: absolute; right: -48px; bottom: -90px; box-shadow: 0 0 0 20px #75be921a, 0 0 0 47px #75be920e; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero p { color: #d5e9da; font-size: .94rem; margin-top: 6px; }
.hero .eyebrow { color: #c9efb7; margin-bottom: 8px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.hero .btn.ghost { color: white; border-color: #81a89c; }
.hero .btn.ghost:hover { color: #142c27; background: #e6f1e3; }
.auth { max-width: 980px; display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr); gap: 18px; margin-top: 42px; align-items: start; }
.auth .hero { min-height: 350px; margin: 0; padding: clamp(24px, 5vw, 45px); display: grid; align-content: end; gap: 10px; }
.auth .hero img { width: 55px; height: 55px; margin-bottom: 17px; }
.auth .hero h1 { font-size: clamp(2.35rem, 5vw, 4rem); max-width: 12ch; }
.auth .hero p { max-width: 34ch; }
.stack { display: grid; gap: 14px; }
.section-gap { margin-top: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 19px; padding: 18px; min-width: 0; }
.card > * + * { margin-top: 13px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-head p { margin: 4px 0 0; font-size: .88rem; color: var(--muted); }
.btn {
  display: inline-flex; gap: 8px; align-items: center; justify-content: center; text-decoration: none;
  border: 1px solid transparent; min-height: 45px; padding: 10px 15px; border-radius: 11px;
  font-size: .88rem; font-weight: 750; background: var(--action); color: var(--action-ink); text-align: center;
}
.btn:hover { filter: brightness(.973); }
.btn.ghost { border-color: var(--line); background: transparent; color: var(--green); }
.btn.ghost:hover { background: var(--soft); }
.btn.dark { background: var(--forest); color: white; }
.btn.danger { background: var(--danger-bg); color: var(--danger); }
.btn.wide { width: 100%; }
.btn svg, .service svg, .circle-icon svg { width: 19px; height: 19px; flex: 0 0 auto; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions .btn { flex: 1; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.nav button { flex: 1; }
.nav .selected { background: var(--forest); color: #fff; border-color: var(--forest); }
.services { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.service { display: grid; justify-items: start; gap: 5px; padding: 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-align: left; }
.service[aria-selected="true"] { background: var(--soft); border-color: #93bda3; }
.service svg { width: 22px; height: 22px; color: var(--green); }
.service span { font-size: .79rem; color: var(--muted); }
form { display: grid; gap: 12px; }
form label { display: grid; gap: 6px; font-weight: 650; font-size: .84rem; }
form .row, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
input, textarea, select { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--input); color: var(--ink); }
textarea { min-height: 76px; resize: vertical; }
input[type="file"] { min-width: 0; padding: 7px; font-size: .76rem; }
input[type="checkbox"] { width: 16px; min-height: 16px; accent-color: var(--forest); }
label.check { display: flex; align-items: center; gap: 7px; }
.hint { font-size: .82rem; color: var(--muted); }
.pill { border-radius: 30px; padding: 5px 9px; display: inline-flex; width: fit-content; align-items: center; gap: 6px; font-size: .75rem; font-weight: 750; color: var(--green); background: var(--soft); }
.pill.warn { color: var(--warn); background: var(--warn-bg); }
.pill.bad { color: var(--danger); background: var(--danger-bg); }
.pill .dot { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.jobs { display: grid; gap: 9px; }
.job { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-info { min-width: 0; flex: 1; }
.job-info small { display: block; overflow-wrap: anywhere; }
.circle-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); color: var(--green); flex: 0 0 auto; }
.value { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.balance { background: var(--paper); }
.balance.is-blocked { background: var(--warn-bg); border-color: #efd6a1; }
.progress { height: 8px; border-radius: 15px; overflow: hidden; background: #d9e7d9; }
.progress span { height: 100%; display: block; border-radius: inherit; background: #477f5d; }
.details { display: grid; gap: 7px; font-size: .91rem; overflow-wrap: anywhere; }
.details b { color: var(--green); }
.pay { display: grid; gap: 9px; justify-items: center; padding: 13px; background: var(--input); border-radius: 13px; text-align: center; }
.pay img { max-width: min(100%, 200px); height: auto; image-rendering: pixelated; background: white; padding: 6px; border-radius: 7px; }
.code { word-break: break-all; max-width: 100%; font-size: .76rem; }
.map { position: relative; height: 215px; overflow: hidden; border: 1px solid #d4e3d4; border-radius: 12px; background: #e3ecdd; }
.map.large { height: 295px; }
.map-scene, .map-tiles, .map-overlay { position: absolute; inset: 0; overflow: hidden; }
.map-scene { touch-action: none; cursor: grab; background-image: linear-gradient(#9bb59d26 1px, transparent 1px), linear-gradient(90deg,#9bb59d26 1px, transparent 1px); background-size: 24px 24px; }
.map-scene:active { cursor: grabbing; }
.map-tiles, .map-overlay { pointer-events: none; }
.map-tiles img { position: absolute; top: 0; left: 0; display: none; width: 256px; height: 256px; transform-origin: top left; }
.map-tiles img.loaded { display: block; }
.map-overlay svg { width: 100%; height: 100%; }
.map-overlay polyline { stroke: #245d4c; stroke-width: 4; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.pin { position: absolute; transform: translate(-50%,-100%); background: var(--forest); border: 2px solid white; color: white; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50% 50% 50% 4px; box-shadow: 0 2px 8px #24392d48; font-size: .76rem; font-weight: 800; }
.pin.destination { background: #6f4626; }
.map-location-dot, .map-accuracy { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; }
.map-location-dot { width: 18px; height: 18px; background: #1765e8; border: 3px solid #fff; box-shadow: 0 0 0 4px #1765e836, 0 2px 8px #12245255; }
.map-accuracy { background: #1765e826; border: 1px solid #1765e867; }
.map-position-status { position: absolute; left: 8px; bottom: 18px; max-width: calc(100% - 65px); padding: 3px 7px; background: #fff; color: #1b355d; border-radius: 5px; font-size: 0.75rem; pointer-events: none; }
.map-tools { position: absolute; right: 8px; top: 8px; display: grid; gap: 4px; }
.map-tools button { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font-size: 1.15rem; width: 38px; height: 38px; }
.map-tools button[aria-pressed="true"] { color: #174fa2; border-color: #9fc0f4; background: #e8f1ff; }
.map-credit { background: #ffffffeb; color: #263b31; padding: 2px 4px; border-radius: 4px 0 0 0; font-size: 10px; position: absolute; bottom: 0; right: 0; }
.map-fallback { position: absolute; left: 8px; top: 8px; color: #52655c; background: #f9fcf8ec; padding: 4px 7px; font-size: .73rem; border-radius: 6px; pointer-events: none; }
.board { display: grid; grid-template-columns: 1.08fr .92fr; align-items: start; gap: 14px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.metric { background: var(--paper); padding: 13px 16px; border: 1px solid var(--line); border-radius: 14px; display: grid; gap: 4px; }
.metric b { font-size: 1.5rem; letter-spacing: -.055em; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
summary { font-weight: 700; padding: 3px 1px; }
details[open] > * + * { margin-top: 10px; }
#notice { position: fixed; z-index: 4; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 12px 15px; border-radius: 11px; max-width: min(92vw, 460px); width: max-content; background: var(--forest); color: white; box-shadow: 0 3px 15px #123c3440; font-size: .9rem; }
#notice.error { background: var(--notice-error); }
@media (max-width: 700px) {
  .shell { padding: 0 14px 26px; }
  .header-wrap { padding: 0 14px; min-height: 58px; }
  .auth { grid-template-columns: 1fr; gap: 11px; margin-top: 14px; max-width: 490px; }
  .auth .hero { min-height: auto; padding: 20px; gap: 2px; }
  .auth .hero img { display: none; }
  .auth .hero h1 { font-size: 2.05rem; max-width: none; }
  .page-head { padding-top: 21px; }
  .board { grid-template-columns: 1fr; }
}
@media (max-width: 365px) {
  .brand { font-size: .9rem; }
  .brand img { width: 30px; height: 30px; }
  .demo { padding: 5px 7px; }
  .card { padding: 14px; }
  .hero-grid { grid-template-columns: 1fr; }
  .metric { padding: 10px; }
}
.brand { text-decoration: none; }
.public-shell { display: grid; gap: 1rem; padding-top: 3rem; padding-bottom: 2rem; }
.public-shell > p { max-width: 72ch; }
.admin-nav { flex-wrap: wrap; }
.admin-nav .btn { flex: 1 1 7rem; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.65rem; }
.doc-preview { display: grid; gap: 0.4rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: 0.6rem; overflow: hidden; }
.doc-preview img { width: 100%; max-height: 10rem; object-fit: contain; background: var(--bg); }
.messages { display: grid; gap: 0.6rem; }
.messages article { padding: 0.7rem; border: 1px solid var(--line); border-radius: 0.55rem; }
.messages p { white-space: pre-wrap; overflow-wrap: anywhere; }
.feedback { display: block; color: var(--danger); padding-top: 0.3rem; }
.stars { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0; border: 0; padding: 0; }
.stars label { font-size: 1.25rem; position: relative; }
.stars input, .sr-only { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.stars label span:first-of-type { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid var(--line); border-radius: 0.5rem; }
.stars input:checked + span { background: #e1a938; color: #26220e; }
.stars input:focus-visible + span { outline: 2px solid currentColor; }
