:root {
    color-scheme: light;
    --canvas: #f4f6f2;
    --surface: #ffffff;
    --surface-muted: #edf3ed;
    --ink: #16231e;
    --muted: #5d6c65;
    --border: #dbe2dc;
    --forest: #173f35;
    --forest-dark: #0f3028;
    --green: #2f765d;
    --lime: #cbe760;
    --lime-pale: #f0f8d8;
    --blue: #326b91;
    --blue-pale: #eaf3f8;
    --amber: #956715;
    --amber-pale: #fff4d9;
    --red: #a3473d;
    --red-pale: #fcece9;
    --shadow: 0 14px 36px rgba(22, 35, 30, 0.07);
}

* {
    box-sizing: border-box;
}

html {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    background: var(--canvas);
    color: var(--ink);
}

body {
    margin: 0;
    min-width: 320px;
}

a {
    color: var(--green);
}

button,
input {
    font: inherit;
}

button,
.button {
    min-height: 44px;
    touch-action: manipulation;
}

:focus-visible {
    outline: 3px solid #e5b52e;
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: -9999px;
    top: 8px;
    z-index: 100;
    border-radius: 8px;
    background: #fff;
    color: var(--forest);
    padding: 10px 14px;
    font-weight: 750;
}

.skip-link:focus {
    left: 8px;
}

svg {
    display: block;
}

.app-shell {
    min-height: 100dvh;
}

.sidebar {
    background: var(--forest);
    color: #fff;
    padding: 15px 16px 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: #fff;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 174px;
    height: auto;
}

.primary-nav {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    margin-top: 14px;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 43px;
    border-radius: 9px;
    color: #d7e3df;
    padding: 9px 12px;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.9rem;
    font-weight: 700;
}

.nav-link svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link:first-child svg {
    fill: currentColor;
    stroke: none;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-link.is-disabled {
    opacity: 0.68;
    cursor: default;
}

.sidebar-note {
    display: none;
}

.app-main {
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 65px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    padding: 10px 16px;
}

.topbar > div:first-child {
    display: flex;
    gap: 7px;
}

.topbar-label,
.user-name {
    color: var(--muted);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.88rem;
}

.user-avatar {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--forest);
    font-weight: 800;
}

.inline-form {
    display: inline;
    margin: 0;
}

.link-button {
    border: 0;
    background: transparent;
    color: var(--forest);
    cursor: pointer;
    font-weight: 750;
    padding: 5px;
}

.link-button:hover {
    text-decoration: underline;
}

.page-shell {
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: 22px 16px 54px;
}

.page-header {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 22px;
}

.heading-meta,
.status-row,
.header-actions,
.visit-actions,
.task-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1,
h2,
h3 {
    color: var(--forest);
    line-height: 1.18;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.8rem, 7vw, 2.45rem);
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 0;
    font-size: 1.22rem;
    letter-spacing: -0.015em;
}

h3 {
    margin-bottom: 7px;
    font-size: 1.04rem;
}

.page-intro {
    max-width: 54ch;
    margin-bottom: 0;
    color: var(--muted);
}

.eyebrow {
    margin-bottom: 4px;
    color: var(--green);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.heading-meta .eyebrow {
    margin: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 14px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 750;
}

.button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.button-primary {
    background: var(--forest);
    color: #fff;
}

.button-primary:hover {
    background: var(--forest-dark);
    color: #fff;
}

.button-secondary {
    border-color: #b9c7c0;
    background: #fff;
    color: var(--forest);
}

.button-quiet {
    background: transparent;
    color: var(--green);
}

.button.is-disabled,
.text-action.is-disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(22, 35, 30, 0.04);
    padding: 14px;
}

.summary-card-primary {
    border-color: #cada97;
    background: var(--lime-pale);
}

.summary-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #dfeeb8;
    color: var(--forest);
}

.summary-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.summary-icon.icon-amber {
    background: var(--amber-pale);
    color: var(--amber);
}

.summary-icon.icon-blue {
    background: var(--blue-pale);
    color: var(--blue);
}

.summary-icon.icon-red {
    background: var(--red-pale);
    color: var(--red);
}

.summary-card div {
    display: grid;
    min-width: 0;
}

.summary-card strong {
    color: var(--forest);
    font-size: 1.45rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
}

.summary-card span:last-child {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.managed-sites-overview {
    margin-bottom: 22px;
}

.managed-site-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    border: 1px solid #cada97;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbfdf4 0%, #fff 62%);
    box-shadow: var(--shadow);
    padding: 17px;
}

.managed-site-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 12px;
    background: #dfeeb8;
    color: var(--forest);
}

.managed-site-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.managed-site-copy {
    min-width: 0;
}

.managed-site-copy h3 {
    margin: 8px 0 2px;
    font-size: 1.08rem;
}

.managed-site-copy > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.managed-site-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 14px 0 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--border);
}

.managed-site-metrics > div {
    display: grid;
    background: rgba(255, 255, 255, 0.9);
    padding: 9px 10px;
}

.managed-site-metrics dt {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.managed-site-metrics dd {
    margin: 0;
    color: var(--forest);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.managed-site-actions {
    display: flex;
    grid-column: 2;
    flex-wrap: wrap;
    gap: 8px;
}

.dashboard-grid {
    display: grid;
    gap: 18px;
}

.dashboard-section {
    min-width: 0;
}

.live-dashboard .summary-card span:last-child {
    margin-top: 5px;
    white-space: normal;
}

.live-dashboard h3,
.live-dashboard .address,
.live-dashboard .visit-note {
    overflow-wrap: anywhere;
}

.live-dashboard .visit-actions {
    margin-top: 16px;
}

.live-dashboard .text-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.dashboard-queues {
    display: grid;
    align-content: start;
    gap: 18px;
}

.dashboard-queue {
    margin-top: 24px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.section-heading .eyebrow {
    margin-bottom: 3px;
}

.small-label,
.task-date,
.job-reference {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.visit-card,
.attention-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.visit-card {
    display: grid;
    margin-bottom: 12px;
    overflow: hidden;
}

.visit-card-next {
    border-color: #cbdc9b;
    box-shadow: 0 14px 36px rgba(53, 77, 32, 0.09);
}

.visit-time {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    background: var(--forest);
    color: #fff;
    padding: 11px 16px;
}

.visit-time strong {
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

.visit-time span {
    color: #d1dfda;
    font-size: 0.78rem;
    font-weight: 650;
}

.visit-details {
    min-width: 0;
    padding: 17px;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.pest-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.badge,
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.badge-green {
    background: #e2f2ea;
    color: #236449;
}

.badge-red {
    background: var(--red-pale);
    color: var(--red);
}

.badge-amber {
    background: var(--amber-pale);
    color: var(--amber);
}

.badge-blue {
    background: var(--blue-pale);
    color: var(--blue);
}

.badge-preview {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--muted);
}

.address {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.address svg {
    flex: 0 0 17px;
    width: 17px;
    margin-top: 2px;
    fill: none;
    stroke: var(--green);
    stroke-width: 1.8;
}

.context-strip {
    display: grid;
    gap: 1px;
    margin: 16px 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--border);
}

.context-strip > div {
    display: grid;
    background: #f8faf8;
    padding: 9px 11px;
}

.context-strip span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.context-strip strong {
    color: var(--forest);
    font-size: 0.84rem;
}

.visit-note {
    margin: 14px 0 16px;
    border-left: 3px solid #a8c04d;
    border-radius: 0 8px 8px 0;
    background: #f7faed;
    color: var(--muted);
    padding: 10px 12px;
    font-size: 0.88rem;
}

.visit-note strong {
    color: var(--forest);
}

.attention-panel {
    align-self: start;
    padding: 18px;
}

.count-badge {
    min-width: 28px;
    background: var(--forest);
    color: #fff;
}

.task-list {
    display: grid;
}

.task-item {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr);
    gap: 13px;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.task-item:first-child {
    padding-top: 4px;
}

.task-item:last-child {
    border-bottom: 0;
}

.task-marker {
    width: 5px;
    height: 100%;
    min-height: 72px;
    border-radius: 999px;
}

.marker-red {
    background: #d17a70;
}

.marker-amber {
    background: #deb963;
}

.marker-blue {
    background: #7daecb;
}

.task-topline {
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-item h3 {
    margin-bottom: 3px;
}

.task-item p {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.87rem;
}

.text-action {
    color: var(--green);
    font-size: 0.84rem;
    font-weight: 800;
}

.preview-note {
    margin: 10px 0 0;
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 10px 12px;
    font-size: 0.78rem;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.breadcrumb a {
    color: var(--green);
    text-decoration: none;
}

.job-page-header .heading-meta {
    margin-bottom: 8px;
}

.job-layout,
.job-main-column,
.job-side-column {
    display: grid;
    gap: 14px;
}

.job-side-column {
    align-content: start;
}

.detail-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px;
}

.next-action-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    border-color: #cada97;
    background: var(--lime-pale);
}

.next-action-card .eyebrow {
    margin-bottom: 2px;
}

.next-action-card h2 {
    margin-bottom: 3px;
}

.next-action-card p:last-child {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.next-action-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 11px;
    background: #dcecad;
    color: var(--forest);
}

.next-action-icon svg {
    width: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.text-link {
    grid-column: 2;
    color: var(--forest);
    font-size: 0.86rem;
    font-weight: 800;
    text-decoration: none;
}

.detail-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.detail-list > div {
    display: grid;
    gap: 3px;
    border-bottom: 1px solid var(--border);
    padding: 11px 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 0;
    color: var(--ink);
    font-size: 0.91rem;
    font-weight: 650;
}

.site-note {
    margin-top: 15px;
    border-left: 3px solid #a8c04d;
    border-radius: 0 9px 9px 0;
    background: #f7faed;
    padding: 11px 13px;
}

.site-note strong {
    color: var(--forest);
    font-size: 0.86rem;
}

.site-note p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
}

.timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 0 0 18px;
}

.timeline li:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: -2px;
    left: 5px;
    width: 1px;
    background: #c9d4ce;
}

.timeline li:last-child {
    padding-bottom: 0;
}

.timeline-mark {
    z-index: 1;
    width: 11px;
    height: 11px;
    margin-top: 5px;
    border: 3px solid #d7e6b0;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px #fff;
}

.timeline strong {
    color: var(--forest);
    font-size: 0.9rem;
}

.timeline p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.visit-form {
    display: grid;
    gap: 14px;
}

.visit-record-fields {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.visit-form label {
    display: grid;
    gap: 6px;
    color: var(--forest);
    font-size: 0.84rem;
    font-weight: 750;
}

.visit-form input,
.visit-form select,
.visit-form textarea {
    width: 100%;
    min-height: 44px;
    margin: 0;
    border: 1px solid #adbbb4;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 9px 11px;
    font: inherit;
}

.visit-form textarea {
    min-height: 110px;
    resize: vertical;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.money-input {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #adbbb4;
    border-radius: 8px;
}

.money-input > span {
    display: grid;
    place-items: center;
    border-right: 1px solid #adbbb4;
    background: var(--surface-muted);
    color: var(--muted);
}

.money-input input {
    border: 0;
    border-radius: 0;
}

.visit-form .checkbox-row {
    display: flex;
    align-items: center;
    gap: 9px;
}

.checkbox-row input {
    flex: 0 0 20px;
    width: 20px;
    min-height: 20px;
    height: 20px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.form-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.follow-up-panel {
    display: grid;
    gap: 13px;
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    padding: 14px;
}

.follow-up-panel[hidden] {
    display: none;
}

.follow-up-panel legend {
    color: var(--forest);
    padding: 0 5px;
    font-size: 0.88rem;
    font-weight: 800;
}

.follow-up-panel .form-hint {
    margin: 0;
}

.form-error-summary ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.visit-history p + p {
    margin-top: 7px;
}

.customer-initial {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-muted);
    color: var(--forest);
    font-size: 0.8rem;
    font-weight: 800;
}

.contact-row {
    display: grid;
    gap: 2px;
    border-top: 1px solid var(--border);
    padding: 11px 0;
    text-decoration: none;
}

.contact-row span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.contact-row strong {
    color: var(--forest);
    font-size: 0.9rem;
}

.customer-history {
    display: grid;
    gap: 2px;
    margin-top: 8px;
    border-radius: 9px;
    background: var(--surface-muted);
    padding: 10px 12px;
}

.customer-history strong {
    color: var(--forest);
    font-size: 0.83rem;
}

.customer-history span {
    color: var(--muted);
    font-size: 0.76rem;
}

.property-card > p:not(.eyebrow) {
    color: var(--muted);
    font-size: 0.88rem;
}

.property-map {
    position: relative;
    height: 130px;
    margin: 14px 0;
    overflow: hidden;
    border: 1px solid #d6dfda;
    border-radius: 10px;
    background: #edf1ed;
}

.property-map::before,
.property-map::after {
    content: "";
    position: absolute;
    background: rgba(255, 255, 255, 0.7);
    transform: rotate(-14deg);
}

.property-map::before {
    top: 45px;
    left: -10px;
    width: 360px;
    height: 13px;
}

.property-map::after {
    top: -20px;
    left: 80px;
    width: 12px;
    height: 210px;
}

.property-map svg {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.property-map path {
    fill: none;
    stroke: #b6c4bc;
    stroke-width: 7;
}

.property-map circle {
    fill: var(--forest);
    stroke: var(--lime);
    stroke-width: 5;
}

.property-map span {
    position: absolute;
    z-index: 2;
    right: 10px;
    bottom: 9px;
    border-radius: 6px;
    background: #fff;
    color: var(--forest);
    padding: 4px 7px;
    font-size: 0.7rem;
    font-weight: 750;
    box-shadow: 0 4px 12px rgba(22, 35, 30, 0.12);
}

.full-width {
    width: 100%;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 4px rgba(203, 231, 96, 0.12);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--forest);
    padding: 0.9rem 1rem;
}

.public-brand {
    min-height: 48px;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.top-nav a {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.auth-panel {
    max-width: 460px;
    margin: 1rem auto;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1.2rem;
}

.stacked-form {
    display: grid;
    gap: 1rem;
}

.stacked-form label {
    color: var(--ink);
    font-weight: 700;
}

input {
    width: 100%;
    margin-top: 0.35rem;
    border: 1px solid #adbbb4;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 0.8rem;
}

input:focus {
    border-color: var(--green);
    outline: 3px solid rgba(47, 118, 93, 0.16);
}

button:not(.link-button) {
    border: 0;
    border-radius: 8px;
    background: var(--forest);
    color: #fff;
    cursor: pointer;
    font-weight: 750;
    padding: 0.85rem 1rem;
}

.notice {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-muted);
    padding: 0.85rem;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-error {
    border-color: #edb9b9;
    background: var(--red-pale);
    color: var(--red);
}

.notice-warning {
    border-color: #e6cf9c;
    background: var(--amber-pale);
    color: var(--amber);
}

.notice-success {
    border-color: #b8dec5;
    background: #edf8f1;
    color: var(--forest);
}

.site-footer {
    color: var(--muted);
    font-size: 0.9rem;
    padding: 1.5rem 1rem 2rem;
    text-align: center;
}

.summary-link {
    color: inherit;
    text-decoration: none;
}

.summary-link:hover {
    border-color: #b7c6be;
    color: inherit;
    transform: translateY(-1px);
}

.text-action {
    text-decoration: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.demo-callout {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: -4px 0 20px;
    border: 1px solid #d6dfda;
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 10px 12px;
    font-size: 0.82rem;
}

.demo-callout svg {
    flex: 0 0 18px;
    width: 18px;
    margin-top: 1px;
    fill: none;
    stroke: var(--green);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.demo-callout strong {
    color: var(--forest);
}

.small-button {
    min-height: 38px;
    padding: 7px 11px;
    font-size: 0.82rem;
}

.schedule-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
}

.date-switcher {
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-switcher > div {
    display: grid;
    min-width: 160px;
    text-align: center;
}

.date-switcher strong {
    color: var(--forest);
    font-size: 0.92rem;
}

.date-switcher span:not(.icon-button) {
    color: var(--muted);
    font-size: 0.74rem;
}

.icon-button {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--forest);
    font-weight: 800;
}

.is-disabled {
    cursor: not-allowed;
}

.week-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(72px, 1fr));
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 20px;
    padding-bottom: 3px;
}

.week-strip > a {
    display: grid;
    min-width: 72px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: inherit;
    padding: 10px;
    text-align: center;
    text-decoration: none;
}

.week-strip span,
.week-strip small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.week-strip strong {
    color: var(--forest);
    font-size: 1.15rem;
}

.week-strip .is-today {
    border-color: #bcd267;
    background: var(--lime-pale);
}

.week-strip .is-selected {
    outline: 2px solid var(--green);
    outline-offset: -2px;
}

.week-strip .is-today span,
.week-strip .is-today strong {
    color: var(--forest);
}

.schedule-layout,
.customers-layout,
.invoice-layout,
.invoice-main-column,
.invoice-side-column,
.schedule-side {
    display: grid;
    gap: 15px;
}

.schedule-side,
.invoice-side-column {
    align-content: start;
}

.agenda-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px;
}

.schedule-heading {
    align-items: flex-start;
}

.agenda-timeline {
    display: grid;
}

.empty-schedule {
    border: 1px dashed var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
    padding: 22px;
    text-align: center;
}

.empty-schedule h3 {
    margin-bottom: 4px;
}

.empty-schedule p {
    margin: 0;
    color: var(--muted);
}

.agenda-item {
    display: grid;
    grid-template-columns: 62px 12px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.agenda-time {
    display: grid;
    align-content: start;
    padding-top: 14px;
    text-align: right;
}

.agenda-time strong {
    color: var(--forest);
    font-size: 0.9rem;
}

.agenda-time span {
    color: var(--muted);
    font-size: 0.7rem;
}

.agenda-line {
    position: relative;
    width: 2px;
    height: 100%;
    min-height: 74px;
    margin: 0 auto;
    background: #d8e2dc;
}

.agenda-line::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 50%;
    width: 9px;
    height: 9px;
    border: 3px solid #ddecaf;
    border-radius: 50%;
    background: var(--green);
    transform: translateX(-50%);
}

.agenda-visit {
    min-width: 0;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fbfcfb;
    padding: 14px;
}

.agenda-visit .address {
    margin-bottom: 0;
}

.compact-context {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px;
    margin: 12px 0 9px;
    color: var(--muted);
    font-size: 0.78rem;
}

.compact-context strong {
    color: var(--forest);
}

.travel-item .agenda-line::before {
    width: 7px;
    height: 7px;
    border: 0;
    background: #aab9b1;
}

.travel-note {
    display: flex;
    align-items: center;
    gap: 8px;
    align-self: start;
    margin: 9px 0 13px;
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 8px 10px;
    font-size: 0.76rem;
    font-weight: 650;
}

.travel-note svg {
    width: 18px;
    fill: none;
    stroke: var(--green);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.day-summary dl,
.payment-breakdown {
    display: grid;
    gap: 0;
    margin: 10px 0 0;
}

.day-summary dl > div,
.payment-breakdown > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding: 9px 0;
}

.day-summary dl > div:last-child,
.payment-breakdown > div:last-child {
    border-bottom: 0;
}

.day-summary dt,
.payment-breakdown dt {
    color: var(--muted);
    font-size: 0.8rem;
}

.day-summary dd,
.payment-breakdown dd {
    margin: 0;
    color: var(--forest);
    font-size: 0.82rem;
    font-weight: 800;
}

.follow-up-row {
    display: grid;
    grid-template-columns: 5px minmax(0, 1fr);
    gap: 11px;
    border-top: 1px solid var(--border);
    padding: 13px 0;
}

.follow-up-row h3 {
    margin: 5px 0 2px;
}

.customer-job-history {
    margin-bottom: 24px;
    overflow-wrap: anywhere;
}

.follow-up-row p {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.8rem;
}

.customer-toolbar {
    display: flex;
    gap: 9px;
    margin-bottom: 14px;
}

.search-field {
    position: relative;
    flex: 1;
}

.search-field svg {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    width: 19px;
    fill: none;
    stroke: var(--muted);
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: translateY(-50%);
}

.search-field input {
    height: 46px;
    margin: 0;
    padding-left: 42px;
}

.mini-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 20px;
}

.mini-summary-grid article {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    padding: 12px;
}

.mini-summary-grid strong {
    color: var(--forest);
    font-size: 1.25rem;
}

.mini-summary-grid span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.customer-list {
    display: grid;
    gap: 9px;
}

.customer-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 7px 20px rgba(22, 35, 30, 0.035);
    padding: 13px;
}

.customer-row-featured {
    border-color: #cada97;
    background: #fbfdf4;
}

.customer-row-managed {
    border-color: #bfd4e1;
    background: #fbfdfe;
}

.customer-row .customer-initial {
    width: 40px;
    height: 40px;
}

.initials-blue {
    background: var(--blue-pale);
    color: var(--blue);
}

.initials-red {
    background: var(--red-pale);
    color: var(--red);
}

.initials-amber {
    background: var(--amber-pale);
    color: var(--amber);
}

.initials-neutral {
    background: #edf0ee;
    color: #53645c;
}

.customer-identity {
    min-width: 0;
}

.customer-identity h3 {
    margin: 0;
}

.customer-identity p {
    overflow: hidden;
    margin: 3px 0 1px;
    color: var(--muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-identity > span {
    color: var(--muted);
    font-size: 0.74rem;
}

.customer-job {
    display: grid;
    grid-column: 2;
}

.customer-job span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.customer-job strong {
    color: var(--forest);
    font-size: 0.8rem;
}

.customer-row > .button {
    grid-column: 2;
    justify-self: start;
}

.customer-actions {
    display: flex;
    grid-column: 2;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 11px;
}

.customer-actions .text-action {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.enquiry-card {
    align-self: start;
    scroll-margin-top: 16px;
}

.entry-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}

.entry-progress li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 9px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    padding: 10px;
}

.entry-progress li > span {
    display: grid;
    grid-row: 1 / 3;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #edf1ef;
    color: var(--muted);
    font-weight: 800;
}

.entry-progress li.is-current {
    border-color: #cada97;
    background: var(--lime-pale);
}

.entry-progress li.is-current > span {
    background: var(--green);
    color: #fff;
}

.entry-progress strong {
    color: var(--forest);
    font-size: 0.82rem;
}

.entry-progress small {
    color: var(--muted);
    font-size: 0.7rem;
}

.guided-entry-layout,
.guided-entry-form {
    display: grid;
    gap: 15px;
}

.guided-entry-help {
    align-self: start;
}

.guided-entry-section {
    display: grid;
    gap: 14px;
}

.guided-step-heading {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 11px;
    align-items: center;
}

.guided-step-heading > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--forest);
    color: #fff;
    font-weight: 800;
}

.guided-step-heading .eyebrow,
.guided-step-heading h2 {
    margin: 0;
}

.guided-entry-next {
    display: grid;
    gap: 14px;
    border-color: #cada97;
    background: var(--lime-pale);
}

.guided-entry-next p:not(.eyebrow),
.guided-entry-help p:not(.eyebrow) {
    color: var(--muted);
}

.form-field-error {
    color: var(--red);
    font-weight: 700;
}

.form-intro {
    margin-bottom: 15px;
    color: var(--muted);
    font-size: 0.84rem;
}

.equal-form-grid {
    grid-template-columns: 1fr;
}

.settings-form .equal-form-grid > label {
    align-self: start;
    align-content: start;
}

.settings-form input[id^="settings-"] {
    scroll-margin-top: 40px;
}

.invoice-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.invoice-summary {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 14px;
}

.invoice-summary.ready {
    border-color: #cada97;
    background: var(--lime-pale);
}

.invoice-summary.overdue {
    background: #fff8f7;
}

.invoice-summary.paid {
    background: #f2f8f5;
}

.invoice-summary span,
.invoice-summary small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.invoice-summary strong {
    color: var(--forest);
    font-size: 1.55rem;
    font-variant-numeric: tabular-nums;
}

.ready-card {
    scroll-margin-top: 16px;
}

.ready-invoice-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 13px 0;
}

.ready-invoice-row h3 {
    margin: 0;
}

.ready-invoice-row p {
    margin: 2px 0 1px;
    color: var(--muted);
    font-size: 0.79rem;
}

.ready-invoice-row .button {
    grid-column: 2 / -1;
    justify-self: start;
}

.money-value {
    color: var(--forest);
    font-size: 0.95rem;
    font-variant-numeric: tabular-nums;
}

.filter-pills {
    display: flex;
    gap: 5px;
}

.filter-pill {
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 5px 9px;
    font-size: 0.7rem;
    font-weight: 750;
}

.filter-pill.active {
    background: var(--forest);
    color: #fff;
}

.invoice-list {
    display: grid;
}

.invoice-row {
    display: grid;
    grid-template-columns: minmax(92px, 0.65fr) minmax(130px, 1fr);
    gap: 8px 12px;
    align-items: center;
    border-top: 1px solid var(--border);
    padding: 13px 0;
}

.invoice-row > div {
    display: grid;
}

.invoice-row strong {
    color: var(--forest);
    font-size: 0.84rem;
}

.invoice-row div span {
    color: var(--muted);
    font-size: 0.73rem;
}

.invoice-row .badge {
    justify-self: start;
}

.invoice-total {
    text-align: right;
}

.invoice-row > .text-action {
    grid-column: 2;
    justify-self: end;
}

.payment-focus {
    border-color: #e3bdba;
    background: #fffafa;
}

.payment-focus-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.payment-focus-heading h2 {
    margin-bottom: 3px;
}

.payment-focus-heading p {
    color: var(--muted);
    font-size: 0.8rem;
}

.payment-focus-heading > strong {
    color: var(--red);
    font-size: 1.45rem;
}

.payment-detail {
    display: grid;
    gap: 2px;
    margin: 5px 0 13px;
    border-radius: 9px;
    background: #fff;
    padding: 10px;
}

.payment-detail span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.payment-detail strong {
    overflow-wrap: anywhere;
    color: var(--forest);
    font-size: 0.78rem;
}

.payment-focus .button + .button {
    margin-top: 8px;
}

.progress-track {
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-muted);
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--green);
}

.progress-label {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

@media (min-width: 580px) {
    .page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }

    .header-actions {
        justify-content: flex-end;
    }

    .context-strip {
        grid-template-columns: 1.2fr 1.4fr 0.7fr;
    }

    .form-grid {
        grid-template-columns: 1.4fr 0.6fr;
    }

    .detail-list > div {
        grid-template-columns: minmax(120px, 0.55fr) minmax(0, 1.45fr);
        gap: 16px;
    }

    .next-action-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .text-link {
        grid-column: auto;
    }

    .equal-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-row {
        grid-template-columns: 42px minmax(180px, 1.4fr) minmax(145px, 0.85fr) auto;
    }

    .customer-job,
    .customer-row > .button,
    .customer-actions {
        grid-column: auto;
    }

    .customer-row > .button {
        justify-self: end;
    }

    .customer-actions {
        justify-self: end;
    }

    .ready-invoice-row {
        grid-template-columns: 42px minmax(0, 1fr) auto auto;
    }

    .ready-invoice-row .button {
        grid-column: auto;
        justify-self: end;
    }

    .invoice-row {
        grid-template-columns: minmax(95px, 0.65fr) minmax(135px, 1fr) auto minmax(85px, 0.55fr) auto;
    }

    .invoice-row > .text-action {
        grid-column: auto;
    }
}

@media (min-width: 760px) {
    .summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 13px;
    }

    .summary-card {
        padding: 16px;
    }

    .managed-site-metrics,
    .mini-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .visit-card {
        grid-template-columns: 106px minmax(0, 1fr);
    }

    .visit-time {
        display: block;
        padding: 19px 15px;
        text-align: center;
    }

    .visit-time strong,
    .visit-time span {
        display: block;
    }

    .visit-time strong {
        font-size: 1.35rem;
    }

    .visit-time span {
        margin-top: 5px;
    }
}

@media (min-width: 1040px) {
    .app-shell {
        display: grid;
        grid-template-columns: 230px minmax(0, 1fr);
    }

    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        padding: 25px 17px;
    }

    .primary-nav {
        display: grid;
        overflow: visible;
        margin-top: 35px;
    }

    .nav-link {
        padding: 10px 12px;
    }

    .sidebar-note {
        display: block;
        margin: auto 4px 0;
        color: #bfd0ca;
        font-size: 0.78rem;
        font-weight: 650;
    }

    .topbar {
        padding: 10px 30px;
    }

    .page-shell {
        padding: 30px 30px 64px;
    }

    .dashboard-grid {
        grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.75fr);
        gap: 20px;
    }

    .managed-site-card {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
    }

    .managed-site-actions {
        grid-column: 3;
        justify-content: flex-end;
    }

    .job-layout {
        grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.72fr);
        gap: 20px;
    }

    .schedule-layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
        gap: 20px;
    }

    .customers-layout {
        grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.65fr);
        gap: 20px;
    }

    .guided-entry-layout {
        grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.55fr);
        gap: 20px;
    }

    .invoice-layout {
        grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.65fr);
        gap: 20px;
    }

    .invoice-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .user-name,
    .topbar-label {
        display: none;
    }

    .header-actions,
    .header-actions .button {
        width: 100%;
    }

    .managed-site-actions,
    .managed-site-actions .button {
        width: 100%;
    }

    .visit-actions .button {
        flex: 1 1 calc(50% - 5px);
    }

    .summary-card {
        align-items: flex-start;
    }

    .customer-toolbar .button {
        min-width: 76px;
    }

    .customer-row .status-row {
        align-items: flex-start;
    }

    .entry-progress li {
        display: flex;
        justify-content: center;
        padding: 8px;
    }

    .entry-progress strong,
    .entry-progress small {
        display: none;
    }

    .agenda-card {
        padding: 14px 11px;
    }

    .agenda-item {
        grid-template-columns: 52px 10px minmax(0, 1fr);
        gap: 7px;
    }

    .agenda-visit {
        padding: 12px 10px;
    }

    .date-switcher {
        width: 100%;
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Bait-station register and client portal */

select,
textarea {
    font: inherit;
}

.site-selector-card {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(22, 35, 30, 0.04);
    padding: 15px;
}

.site-selector-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-selector-copy > div {
    display: grid;
    min-width: 0;
}

.site-selector-copy > div > span,
.site-select-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    text-transform: uppercase;
}

.site-selector-copy strong {
    color: var(--forest);
    font-size: 1rem;
}

.site-selector-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-record-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 11px;
    margin-top: 7px;
}

.site-record-links .text-action {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}

.site-select-label {
    display: grid;
    gap: 5px;
}

.site-select-label select,
.station-form select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #adbbb4;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 9px 34px 9px 11px;
    text-transform: none;
}

.station-summary-grid,
.portal-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 18px;
}

.station-summary-grid article {
    display: grid;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    padding: 12px;
}

.station-summary-grid article.summary-attention {
    border-color: #ead5a2;
    background: var(--amber-pale);
}

.station-summary-grid span,
.station-summary-grid small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.station-summary-grid strong {
    color: var(--forest);
    font-size: 1.28rem;
    font-variant-numeric: tabular-nums;
}

.station-workspace,
.station-main-column,
.station-side-column {
    display: grid;
    gap: 15px;
}

.station-side-column {
    align-content: start;
}

.map-card {
    overflow: hidden;
    padding: 0;
}

.map-heading {
    align-items: flex-start;
    margin: 0;
    padding: 18px 18px 7px;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(22, 35, 30, 0.18);
}

.legend-green {
    background: var(--green);
}

.legend-amber {
    background: #bd7e18;
}

.legend-red {
    background: var(--red);
}

.map-instruction {
    margin: 0;
    color: var(--muted);
    padding: 0 18px 14px;
    font-size: 0.8rem;
}

.site-map {
    position: relative;
    min-height: 360px;
    overflow: hidden;
    border-block: 1px solid #cad5ce;
    background: #e6eee5;
    isolation: isolate;
}

.site-map.is-placing {
    cursor: crosshair;
    box-shadow: inset 0 0 0 4px rgba(47, 118, 93, 0.34);
}

.site-map.is-placing::after {
    content: "Tap to place BS-09";
    position: absolute;
    z-index: 8;
    top: 12px;
    left: 50%;
    border-radius: 999px;
    background: var(--forest);
    color: #fff;
    padding: 7px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    pointer-events: none;
    transform: translateX(-50%);
}

.site-plan {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.plan-grass {
    fill: #dce9d5;
}

.plan-grass-detail {
    opacity: 0.28;
}

.plan-grass-detail + path,
.site-plan pattern path {
    fill: none;
    stroke: #82a278;
    stroke-width: 2;
    stroke-linecap: round;
}

.plan-stream {
    fill: none;
    stroke: #9cc8d4;
    stroke-width: 34;
    stroke-linecap: round;
}

.plan-drive {
    fill: none;
    stroke: #d3cec3;
    stroke-width: 72;
    stroke-linecap: round;
}

.plan-boundary {
    fill: none;
    stroke: #7e8f83;
    stroke-width: 5;
    stroke-dasharray: 14 9;
}

.plan-building {
    fill: #fffdf8;
    stroke: var(--forest);
    stroke-width: 8;
}

.plan-room {
    fill: rgba(255, 255, 255, 0.38);
    stroke: #aab8af;
    stroke-width: 3;
}

.plan-outbuilding {
    fill: #ede4d2;
    stroke: #817b70;
    stroke-width: 5;
}

.plan-hedge {
    fill: none;
    stroke: #5d8758;
    stroke-width: 20;
    stroke-dasharray: 7 12;
    stroke-linecap: round;
}

.plan-gate {
    fill: none;
    stroke: #7b6552;
    stroke-width: 6;
}

.plan-labels text {
    fill: #486057;
    font-family: inherit;
    font-size: 18px;
    font-weight: 750;
    text-anchor: middle;
}

.plan-labels text:first-child {
    fill: var(--forest);
    font-size: 24px;
}

.station-marker {
    position: absolute;
    z-index: 5;
    display: grid;
    width: 44px;
    min-height: 44px;
    height: 44px;
    place-items: center;
    border: 3px solid #fff !important;
    border-radius: 50% !important;
    color: #fff !important;
    padding: 0 !important;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    line-height: 1;
    box-shadow: 0 5px 13px rgba(22, 35, 30, 0.28);
    transform: translate(-50%, -50%);
    transition: box-shadow 180ms ease, transform 180ms ease;
}

.station-marker:hover,
.station-marker.is-selected {
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.76), 0 8px 20px rgba(22, 35, 30, 0.34);
    transform: translate(-50%, -50%) scale(1.12);
}

.marker-tone-green {
    background: var(--green) !important;
}

.marker-tone-amber {
    background: #a86d11 !important;
}

.marker-tone-red {
    background: var(--red) !important;
}

.draft-marker {
    border-style: dashed !important;
    background: #fff !important;
    color: var(--forest) !important;
    box-shadow: 0 0 0 5px rgba(203, 231, 96, 0.55), 0 8px 20px rgba(22, 35, 30, 0.28);
}

.draft-marker[hidden] {
    display: none;
}

.map-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    color: var(--muted);
    padding: 11px 18px;
    font-size: 0.74rem;
}

.map-footer strong {
    color: var(--forest);
}

.print-button {
    min-height: 44px;
    border: 0 !important;
    background: transparent !important;
    color: var(--green) !important;
    cursor: pointer;
    padding: 6px !important;
}

.station-register {
    display: grid;
    border-top: 1px solid var(--border);
}

.station-register-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 7px 10px;
    align-items: center;
    min-height: 68px;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
    padding: 11px 7px !important;
    text-align: left;
}

.station-register-row:last-child {
    border-bottom: 0 !important;
}

.station-register-row:hover,
.station-register-row.is-selected {
    background: #f5f8f4 !important;
}

.station-register-row.is-selected {
    box-shadow: inset 4px 0 0 var(--lime);
}

.station-reference-cell,
.station-location-cell,
.station-check-cell {
    display: grid;
    min-width: 0;
}

.station-register-row strong {
    overflow: hidden;
    color: var(--forest);
    font-size: 0.8rem;
    text-overflow: ellipsis;
}

.station-register-row small {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    text-overflow: ellipsis;
}

.station-location-cell {
    grid-column: 2 / -1;
}

.station-register-row > .badge {
    grid-row: 1;
    grid-column: 3;
    justify-self: end;
}

.station-check-cell {
    grid-column: 2 / -1;
}

.station-register-row > svg {
    display: none;
    width: 18px;
    fill: none;
    stroke: var(--green);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.station-detail-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.selected-location {
    margin: 5px 0 12px;
    border-left: 3px solid var(--lime);
    border-radius: 0 8px 8px 0;
    background: #f7faed;
    color: var(--forest);
    padding: 9px 11px;
    font-size: 0.86rem;
    font-weight: 750;
}

.station-detail-list,
.portal-service-list {
    display: grid;
    margin: 0 0 14px;
}

.station-detail-list > div,
.portal-service-list > div {
    display: grid;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    padding: 9px 0;
}

.station-detail-list dt,
.portal-service-list dt {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 750;
    text-transform: uppercase;
}

.station-detail-list dd,
.portal-service-list dd {
    display: grid;
    margin: 0;
    color: var(--forest);
    font-size: 0.82rem;
    font-weight: 700;
}

.station-detail-list dd small {
    color: var(--muted);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
}

.add-station-card {
    scroll-margin-top: 16px;
}

.placement-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin-bottom: 13px;
    border-radius: 10px;
    background: var(--surface-muted);
    padding: 5px;
}

.placement-toggle button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--muted) !important;
    padding: 7px 8px !important;
    font-size: 0.76rem;
}

.placement-toggle button.is-selected {
    border-color: var(--border) !important;
    background: #fff !important;
    color: var(--forest) !important;
    box-shadow: 0 3px 9px rgba(22, 35, 30, 0.07);
}

.placement-toggle svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.placement-panel {
    margin-bottom: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8faf8;
    padding: 11px;
}

.placement-panel[hidden] {
    display: none;
}

.field-help,
.save-status {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.74rem;
}

.coordinate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.coordinate-grid label,
.station-form > label,
.station-form .coordinate-grid label {
    display: grid;
    gap: 4px;
    color: var(--forest);
    font-size: 0.74rem;
    font-weight: 750;
}

.coordinate-grid input,
.station-form input {
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 9px 10px;
}

.station-form {
    display: grid;
    gap: 11px;
}

.inspection-history-card,
.client-report-history {
    margin-top: 15px;
}

.inspection-history {
    display: grid;
}

.inspection-history article {
    display: grid;
    gap: 7px;
    border-top: 1px solid var(--border);
    padding: 13px 0;
}

.inspection-history time {
    color: var(--forest);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.inspection-history strong {
    color: var(--forest);
    font-size: 0.84rem;
}

.inspection-history p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.inspection-history .badge {
    justify-self: start;
}

.portal-body {
    background: #f5f7f4;
}

.portal-topbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    background: var(--forest);
    color: #fff;
}

.portal-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, 1180px);
    min-height: 74px;
    margin: 0 auto;
    padding: 12px 16px;
}

.portal-topbar .brand {
    min-width: 0;
}

.portal-topbar .brand-logo {
    width: 148px;
}

.portal-product-label {
    border-left: 1px solid rgba(255, 255, 255, 0.34);
    color: #d7e3df;
    padding-left: 10px;
    font-size: 0.76rem;
    font-weight: 750;
    white-space: nowrap;
}

.portal-account {
    display: flex;
    align-items: center;
    gap: 9px;
}

.portal-account > div {
    display: none;
    text-align: right;
}

.portal-account span,
.portal-account strong {
    display: block;
}

.portal-account > div span {
    color: #bfd0ca;
    font-size: 0.67rem;
}

.portal-account > div strong {
    color: #fff;
    font-size: 0.78rem;
}

.portal-topbar .user-avatar {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.72rem;
}

.portal-secure-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #d7e3df;
    font-size: 0.74rem;
    font-weight: 750;
}

.portal-secure-label svg {
    width: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.portal-page-shell {
    width: min(100%, 1180px);
}

.portal-breadcrumb {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.portal-breadcrumb a {
    color: var(--green);
    text-decoration: none;
}

.portal-preview-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 17px;
    border: 1px solid #cbdc9b;
    border-radius: 11px;
    background: var(--lime-pale);
    color: var(--muted);
    padding: 11px 13px;
}

.portal-preview-note > div {
    display: grid;
}

.portal-preview-note strong {
    color: var(--forest);
    font-size: 0.84rem;
}

.portal-preview-note span:last-child {
    font-size: 0.76rem;
}

.portal-preview-icon {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 9px;
    background: #dcecad;
    color: var(--forest);
}

.portal-preview-icon svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.portal-status-grid article {
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 13px;
}

.portal-status-grid article.portal-status-attention {
    border-color: #ead5a2;
    background: #fffaf0;
}

.portal-status-grid article > div {
    display: grid;
    min-width: 0;
}

.portal-status-grid strong {
    color: var(--forest);
    font-size: 1.08rem;
    font-variant-numeric: tabular-nums;
}

.portal-status-grid span,
.portal-status-grid small {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.portal-detail-card {
    border-color: #cbdc9b;
}

.portal-contact-card {
    display: grid;
    gap: 2px;
    border-radius: 9px;
    background: var(--surface-muted);
    padding: 10px 12px;
}

.portal-contact-card strong {
    color: var(--forest);
    font-size: 0.8rem;
}

.portal-contact-card span,
.portal-contact-card a {
    font-size: 0.74rem;
}

.portal-contact-card span {
    color: var(--muted);
}

.portal-contact-card a {
    margin-top: 5px;
    color: var(--green);
    font-weight: 800;
}

.service-result {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 5px;
    border-radius: 9px;
    background: #edf8f1;
    padding: 10px;
}

.service-result > div {
    display: grid;
}

.service-result strong {
    color: var(--forest);
    font-size: 0.82rem;
}

.service-result span {
    color: var(--muted);
    font-size: 0.72rem;
}

.status-check {
    display: grid;
    flex: 0 0 35px;
    width: 35px;
    height: 35px;
    place-items: center;
    border-radius: 50%;
    background: #d9eee2;
    color: var(--green) !important;
}

.status-check svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.3;
}

.portal-service-list > div {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.portal-service-list dd {
    font-size: 0.95rem;
}

.portal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 5px 24px;
    width: min(100%, 1180px);
    margin: 0 auto;
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 20px 16px 30px;
    font-size: 0.72rem;
}

.portal-login-layout {
    display: grid;
    align-items: center;
    gap: 24px;
    min-height: min(650px, calc(100dvh - 160px));
    padding-block: 18px 30px;
}

.portal-login-copy {
    max-width: 600px;
}

.portal-login-copy h1 {
    max-width: 16ch;
}

.portal-login-copy > p:not(.eyebrow) {
    max-width: 54ch;
    color: var(--muted);
}

.portal-benefit-list {
    display: grid;
    gap: 10px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.portal-benefit-list li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--forest);
    font-size: 0.87rem;
    font-weight: 750;
}

.portal-benefit-list span {
    display: grid;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 50%;
    background: #e3efc1;
    color: var(--green);
}

.portal-benefit-list svg {
    width: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.2;
}

.portal-login-panel {
    width: 100%;
    max-width: 440px;
    justify-self: center;
    padding: 22px;
}

.portal-login-panel h2 {
    margin-bottom: 6px;
    font-size: 1.45rem;
}

.portal-login-intro {
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 0.82rem;
}

.portal-login-help {
    display: grid;
    gap: 2px;
    margin-top: 15px;
    border-radius: 9px;
    background: var(--surface-muted);
    color: var(--muted);
    padding: 10px 12px;
    font-size: 0.74rem;
}

.portal-login-help strong {
    color: var(--forest);
}

.portal-back-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
}

@media (min-width: 580px) {
    .site-selector-card {
        grid-template-columns: minmax(0, 1fr) minmax(235px, 0.45fr);
        align-items: center;
    }

    .station-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .portal-status-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .portal-account > div {
        display: block;
    }

    .inspection-history article {
        grid-template-columns: 92px minmax(0, 1fr) auto;
        align-items: start;
        gap: 14px;
    }
}

@media (min-width: 760px) {
    .site-map {
        min-height: 500px;
    }

    .station-register-row {
        grid-template-columns: 72px minmax(210px, 1.3fr) auto minmax(165px, 0.8fr) 18px;
        gap: 10px;
        padding-inline: 10px !important;
    }

    .station-location-cell,
    .station-check-cell,
    .station-register-row > .badge {
        grid-row: auto;
        grid-column: auto;
    }

    .station-register-row > svg {
        display: block;
    }

    .portal-login-layout {
        grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
        gap: 48px;
    }
}

@media (min-width: 1040px) {
    .station-workspace {
        grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.58fr);
        gap: 20px;
    }

    .portal-station-workspace {
        grid-template-columns: minmax(0, 1.5fr) minmax(315px, 0.62fr);
    }
}

@media (max-width: 520px) {
    .site-map {
        min-height: 390px;
    }

    .map-heading {
        display: grid;
    }

    .plan-labels text {
        font-size: 21px;
    }

    .portal-topbar .brand-logo {
        width: 128px;
    }

    .portal-product-label {
        display: none;
    }

    .portal-preview-return {
        display: none;
    }
}

@media print {
    :root {
        --canvas: #fff;
        --shadow: none;
    }

    .sidebar,
    .topbar,
    .portal-topbar,
    .breadcrumb,
    .portal-breadcrumb,
    .header-actions,
    .demo-callout,
    .portal-preview-note,
    .add-station-card,
    .print-button,
    .portal-footer {
        display: none !important;
    }

    .app-shell,
    .station-workspace,
    .portal-station-workspace {
        display: block;
    }

    .page-shell,
    .portal-page-shell {
        width: 100%;
        padding: 0;
    }

    .detail-card,
    .map-card,
    .station-summary-grid article,
    .portal-status-grid article {
        break-inside: avoid;
        box-shadow: none;
    }

    .station-side-column,
    .inspection-history-card,
    .client-report-history {
        margin-top: 14px;
    }

    .site-map {
        min-height: 390px;
    }
}
