:root {
    --bg: #f1f5f9;
    --nav: #0f172a;
    --nav2: #1e293b;
    --text: #0f172a;
    --muted: #64748b;
    --purple: #89602b;
    --border: #dbe3ee;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* Main application layout */

.app {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    width: 250px;
    height: 100vh;
    overflow-y: auto;
    padding: 28px 18px;
    display: flex;
    flex-direction: column;
    color: white;
    background: linear-gradient(
        180deg,
        var(--nav),
        var(--nav2)
    );
}

.main {
    grid-column: 2;
    min-width: 0;
    width: 100%;
    max-width: 1500px;
    padding: 28px;
}

/* Branding and navigation */

.brand {
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: 900;
}

.brand span {
    color: #c4b5fd;
}

.brand.big {
    font-size: 30px;
}

nav {
    display: grid;
    gap: 6px;
}

nav a {
    padding: 13px 14px;
    border-radius: 10px;
    color: #dbeafe;
    text-decoration: none;
}

nav a:hover {
    background: #334155;
}

.userbox {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #334155;
    display: grid;
    gap: 5px;
}

.userbox small {
    color: #94a3b8;
}

.userbox a {
    margin-top: 6px;
    color: #c4b5fd;
    text-decoration: none;
}

/* Page headings */

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.top h1 {
    margin: 0;
    font-size: 32px;
}

.muted {
    color: var(--muted);
}

.tiny {
    font-size: 12px;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: white;
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.btn.primary {
    border-color: var(--purple);
    background: var(--purple);
    color: white;
}

.btn.danger {
    color: #b91c1c;
    border-color: #fecaca;
    background: #fff7f7;
}

.btn.danger:hover {
    color: #ffffff;
    border-color: #b91c1c;
    background: #b91c1c;
}

.full {
    width: 100%;
    margin-top: 8px;
}

/* Dashboard statistics */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 18px;
}

.report-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-money-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-filters {
    display: flex;
    align-items: end;
    gap: 14px;
}

.report-filters label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 800;
}

.report-filters input {
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    font: inherit;
}

.report-grid {
    gap: 18px;
}

.stat,
.card {
    border: 1px solid var(--border);
    border-radius: 15px;
    background: white;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.04);
}

.stat {
    padding: 20px;
}

.stat small {
    color: var(--muted);
}

.stat strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

/* Cards */

.card {
    padding: 20px;
    margin-bottom: 18px;
}

.cardhead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.cardhead h2 {
    margin: 0 0 12px;
}

/* Tables */

.tablewrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    background: #f8fafc;
}

/* Status badges */

.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: 12px;
    font-weight: 800;
}

.badge.new {
    background: #ede9fe;
    color: #6d28d9;
}

.badge.pending.review {
    background: #fef3c7;
    color: #92400e;
}

.badge.draft {
    background: #e2e8f0;
    color: #475569;
}

.badge.sent {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.paid {
    background: #dcfce7;
    color: #15803d;
}

.badge.partially.paid {
    background: #fef3c7;
    color: #92400e;
}

.badge.voided {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.overdue {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.current {
    background: #dcfce7;
    color: #15803d;
}

.badge.expiring.soon {
    background: #fef3c7;
    color: #92400e;
}

.badge.expired,
.badge.missing {
    background: #fee2e2;
    color: #b91c1c;
}

.badge.archived {
    background: #e2e8f0;
    color: #475569;
}

.compliance-alert {
    border-color: #fbbf24;
    background: #fffbeb;
}

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

.compliance-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.compliance-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
}

.compliance-form input,
.compliance-form select,
.compliance-form textarea {
    width: 100%;
}

.compliance-notes {
    grid-column: span 2;
}

.compliance-archived td {
    color: var(--muted);
    background: #f8fafc;
}

.invoice-total {
    font-size: 30px;
    font-weight: 900;
    color: var(--text);
}

.payment-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 18px;
}

.online-payment-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-color: #bfdbfe;
    background: #eff6ff;
}

.online-payment-card h2,
.online-payment-card p {
    margin-top: 0;
}

.payment-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.payment-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
}

.payment-form input,
.payment-form select {
    width: 100%;
}

.payment-notes {
    grid-column: span 3;
}

.payment-voided td {
    color: var(--muted);
    text-decoration: line-through;
}

.reverse-payment summary {
    color: #b91c1c;
    cursor: pointer;
    font-weight: 800;
}

.reverse-payment form {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    min-width: 260px;
}

.invoice-lines input {
    min-width: 90px;
}

.invoice-lines td:first-child input {
    min-width: 240px;
}

.notice-card {
    margin-bottom: 18px;
    padding: 18px 20px;
    border: 1px solid #c4b5fd;
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    background: #f4ead6;
}

.notice-card p {
    margin: 7px 0 0;
}

.review-notice .btn {
    margin-top: 12px;
}

.submit-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.badge.attempting {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.accepted {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge.completed {
    background: #dcfce7;
    color: #15803d;
}

.badge.canceled {
    background: #fee2e2;
    color: #b91c1c;
}

.cancellation-notice {
    border-color: #fecaca;
    border-left-color: #dc2626;
    background: #fef2f2;
}

.disabled-action {
    cursor: not-allowed;
    opacity: 0.65;
}

.job-stage-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.audit-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 240px) auto auto;
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 760px) {
    .audit-filters {
        grid-template-columns: 1fr;
    }
}

/* Forms */

.search {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.search input {
    flex: 1;
}

.form label {
    display: block;
    margin: 10px 0 6px;
    font-size: 13px;
    font-weight: 800;
}

.form input,
.form select,
.form textarea,
.search input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: white;
    font: inherit;
}

.form textarea {
    min-height: 100px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 14px;
}

.es-document-row {
    min-width: 0;
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}
.es-document-row legend { font-weight: 800; padding: 0 8px; }
.es-document-row .grid2 > div { min-width: 0; }

.row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.hidden-block {
    display: none;
}

/* Job details */

.detailgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

dl {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 9px 15px;
    margin: 0;
}

dt {
    color: var(--muted);
    font-weight: 800;
}

dd {
    margin: 0;
}

.address {
    font-size: 18px;
    line-height: 1.6;
}

/* Attempt history */

.attempt {
    margin-top: 12px;
    padding: 12px 14px;
    border-left: 4px solid var(--purple);
    border-radius: 8px;
    background: #f4ead6;
}

.attempt > div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.attempt span,
.attempt small {
    color: var(--muted);
}

.empty {
    padding: 25px;
    color: var(--muted);
    text-align: center;
}

/* Messages */

.flash {
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 9px;
    background: #fee2e2;
    color: #991b1b;
}

/* Login page */

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0f172a, #312e81);
}

.login-card {
    width: min(440px, 92vw);
    padding: 30px;
    border-radius: 18px;
    background: white;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.login-card h1 {
    margin-bottom: 5px;
}

.login-card label {
    display: block;
    margin: 12px 0 6px;
    font-weight: 800;
}

.login-card input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
}

.login-help {
    margin-top: 16px;
    text-align: center;
}

.login-help a {
    color: var(--primary);
    font-weight: 800;
}

/* Camera and uploaded photos */

.camera-box {
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.camera-box input[type="file"] {
    padding: 8px 0;
    border: 0;
    background: transparent;
}

.photo-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.photo-slot {
    padding: 10px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    background: white;
}

.photo-slot .camera-button {
    display: block;
    margin-bottom: 6px;
}

.photo-slot input[type="file"] {
    width: 100%;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fill,
        minmax(120px, 1fr)
    );
    gap: 10px;
    margin-top: 12px;
}

.photo-grid img {
    display: block;
    width: 100%;
    height: 110px;
    border: 1px solid #dbe3ee;
    border-radius: 10px;
    object-fit: cover;
}

.signature-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 12px 0;
}

.signature-pad-wrap {
    width: 100%;
    max-width: 700px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    background: white;
    overflow: hidden;
    touch-action: none;
}

.signature-pad-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    min-height: 150px;
    touch-action: none;
}

.signature-certification {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #c4b5fd;
    border-radius: 11px;
    background: #f4ead6;
}

.signature-certification input {
    width: auto;
    margin-top: 3px;
}

.proof-review-form,
.proof-review-notes {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #ddd6fe;
    border-radius: 10px;
    background: #f4ead6;
}

.proof-review-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 800;
}

.proof-review-form textarea {
    width: 100%;
    margin-bottom: 10px;
}

.proof-review-form > div {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.proof-approved-notice {
    border-color: #86efac;
    background: #f0fdf4;
}

/* Server dashboard */

.server-job-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(340px, 1fr)
    );
    gap: 16px;
}

.server-job {
    margin: 0;
}

.server-job h2 {
    margin: 5px 0 0;
}

.jobnum {
    color: #6d28d9;
}

.address-small {
    font-size: 17px;
    line-height: 1.5;
}

.field-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

/* Attempt form */

.eyebrow {
    margin-bottom: 5px;
    color: #89602b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.section-title {
    margin: 20px 0 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 900;
}

.conditional-panel {
    display: none;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid #e9d5ff;
    border-radius: 13px;
    background: #f4ead6;
}

.gps-card {
    padding: 14px;
    border: 1px solid #dbe3ee;
    border-radius: 13px;
    background: #f8fafc;
}

.gps-pill {
    display: inline-block;
    align-self: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.gps-pill.good {
    background: #dcfce7;
    color: #166534;
}

.gps-pill.warn {
    background: #fef3c7;
    color: #92400e;
}

.gps-pill.bad {
    background: #fee2e2;
    color: #991b1b;
}

.camera-prominent {
    padding: 18px;
}

.camera-prominent input[type="file"] {
    position: absolute;
    left: -9999px;
}

.camera-button {
    display: inline-block;
    margin: 0 0 8px;
    padding: 14px 18px;
    border-radius: 11px;
    background: #111827;
    color: white;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
}

.quick-notes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.chip {
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.submit-bar {
    position: sticky;
    bottom: 0;
    margin: 22px -20px -20px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
    border-radius: 0 0 15px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(6px);
}

.big-submit {
    padding: 14px 20px;
    font-size: 16px;
}

.field-form textarea {
    min-height: 120px;
}

/* Completion panels */

.moved-panel {
    border-color: #fed7aa;
    background: #fff7ed;
}

.completion-card {
    border: 1px solid #bbf7d0;
}

.next-doc {
    margin-top: 16px;
    padding: 14px;
    border-radius: 10px;
    font-weight: 700;
}

.next-doc.nonservice {
    background: #fff7ed;
    color: #9a3412;
}

.next-doc.served {
    background: #ecfdf5;
    color: #166534;
}

/* Tablet and mobile layout */

@media (max-width: 800px) {
    .app {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        overflow: visible;
        padding: 18px;
    }

    .sidebar nav {
        grid-template-columns: repeat(3, 1fr);
        font-size: 13px;
    }

    .userbox {
        display: none;
    }

    .main {
        grid-column: 1;
        width: 100%;
        padding: 16px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .grid2,
    .detailgrid {
        grid-template-columns: 1fr;
    }

    .payment-summary,
    .payment-form,
    .compliance-form,
    .compliance-stats {
        grid-template-columns: 1fr;
    }

    .payment-notes,
    .compliance-notes {
        grid-column: auto;
    }

    .online-payment-card {
        align-items: stretch;
        flex-direction: column;
    }

    .online-payment-card .btn {
        width: 100%;
        text-align: center;
    }

    .report-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .report-filters input,
    .report-filters .btn {
        width: 100%;
    }

    .top {
        align-items: flex-start;
    }

    .top h1 {
        font-size: 27px;
    }
}

@media (max-width: 600px) {
    .server-job-grid {
        grid-template-columns: 1fr;
    }

    .field-actions .btn {
        width: 100%;
        padding: 14px;
        text-align: center;
    }

    .sidebar nav {
        grid-template-columns: 1fr 1fr;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .field-form {
        padding: 16px;
    }

    .section-title {
        margin-top: 17px;
    }

    .camera-button {
        width: 100%;
        padding: 16px;
        text-align: center;
    }

    .submit-bar {
        display: grid;
        grid-template-columns: 1fr;
    }

    .big-submit {
        width: 100%;
        padding: 16px;
    }

    .quick-notes {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .chip {
        border-radius: 10px;
    }
}
.install-banner {
    position: fixed;
    bottom: max(16px, env(safe-area-inset-bottom));
    right: 16px;
    z-index: 1000;
    width: min(400px, calc(100vw - 32px));
    box-sizing: border-box;
    max-height: 50vh;
    overflow: auto;
    padding: 20px;
    background: #fff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    box-shadow: 0 8px 32px #0f172a33;
}
.install-banner[hidden] { display: none; }
.install-banner p { margin: 10px 0 16px; }
.install-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Pizzazz Serve: courthouse, case documents and the route between people. */
.mail-folders { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 24px; }
.mail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.mail-row { padding: 18px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.mail-row small { display: block; color: var(--muted); }
:root {
    --bg: #f4f2ed;
    --nav: #102e35;
    --nav2: #183d42;
    --text: #183139;
    --muted: #5b6e72;
    --purple: #17645f;
    --primary: #17645f;
    --border: #d9ded9;
}
body {
    background-color: var(--bg);
    background-image: radial-gradient(ellipse at 90% 0, #e4eae3 0, transparent 55%);
    line-height: 1.5;
}
h1, h2, h3 { letter-spacing: -.025em; }
.brand { letter-spacing: -.055em; }
.brand span { color: #9a6b2f; }
.sidebar .brand span { color: #dfbf89; }
.sidebar {
    background: linear-gradient(165deg, #102e35 0%, #183d42 72%, #234a48 100%);
    border-right: 1px solid #c5d0c8;
}
.sidebar nav a { color: #e3eeea; font-size: .94rem; border: 1px solid transparent; }
.sidebar nav a:hover, .sidebar nav a.active {
    background: #ffffff14; border-color: #ffffff24; color: #fff;
}
.sidebar .userbox { border-color: #ffffff24; }
.sidebar .userbox a { color: #dfbf89; }
.sidebar .userbox small { color: #c4d6d2; }
.main { max-width: 1700px; padding: clamp(18px, 2.4vw, 40px); }
.card, .stat, .stat-card, .company-choice {
    background: #fffefa; border-color: var(--border);
    box-shadow: 0 3px 16px #1b353a05;
}
.btn { border-radius: 9px; font-weight: 650; }
.btn.primary { background: #17645f; border-color: #17645f; color: #fff; }
.btn.primary:hover { background: #104e4a; border-color: #104e4a; }
input, select, textarea { accent-color: #17645f; }
input:focus, select:focus, textarea:focus { outline: 2px solid #17645f; outline-offset: 2px; }
a { color: #17645f; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #b78e54; outline-offset: 3px; }
.workspace-welcome {
    display: flex; align-items: center; justify-content: space-between; gap: 20px;
    padding: 10px 0 26px; margin-bottom: 24px; border-bottom: 1px solid #cbd4ce;
}
.workspace-eyebrow { margin: 0 0 8px; font-size: .68rem; font-weight: 750; letter-spacing: .18em; color: #6a7062; }
.workspace-welcome h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(25px, 2.6vw, 39px); margin: 0 0 8px; line-height: 1.2; overflow-wrap: anywhere; }
.workspace-identity { margin: 0; color: #4e6367; font-size: .95rem; }
.workspace-identity span { padding: 0 10px; color: #9a7e54; }
.workspace-seal { width: 94px; flex: 0 0 94px; }
.workspace-seal img { display: block; width: 100%; }
.login-body {
    padding: 28px 0;
    background: url('legal-service-pattern.svg') center / cover fixed,
        radial-gradient(ellipse at 75% 30%, #28534f 0, #173b40 43%, #0d272f 100%);
}
.login-card {
    background: #fffefa;
    border: 1px solid #e4dac7;
    border-top: 4px solid #b78e54;
    border-radius: 14px;
    box-shadow: 0 24px 70px #061a2466;
    padding: clamp(22px, 3vw, 38px);
}
.login-card h1 { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: 2.15rem; }
.login-card input, .login-card select { background: #fff; border: 1px solid #bdcbc5; border-radius: 8px; padding: 12px; }
.login-card input[type='hidden'] { display: none; }
.login-card .brand { margin-bottom: 28px; }
.install-banner { background: #fffefa; border-color: #d8d2c3; }
@media (max-width: 640px) {
    .workspace-welcome { padding-bottom: 20px; gap: 12px; }
    .workspace-seal { display: none; }
    .workspace-identity { font-size: .85rem; }
    .workspace-eyebrow { font-size: .6rem; letter-spacing: .12em; }
    .login-body { background-attachment: scroll; }
}
@media print {
    body { background: white; }
    .workspace-seal { display: none; }
    .workspace-welcome { border-color: #ccc; }
}
/* Route planning remains usable on narrow field devices. */
.map-filters, .map-toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
.map-filters label { flex: 1 1 220px; }
#job-map-canvas { width: 100%; height: min(65vh, 640px); min-height: 320px; border-radius: 12px; }
#job-map-canvas[hidden] { display: none; }
.map-toolbar button:disabled { opacity: .55; cursor: not-allowed; }
.route-stop { padding: 1rem 0; border-bottom: 1px solid #cbd5d1; }
.route-stop input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin-right: .5rem; }
.route-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.route-stop p { overflow-wrap: anywhere; }
#route-form > button { margin-top: 1rem; }
.route-move[hidden] { display: none; }

/* Step 54A: selected Espresso Gold with legal-service line artwork. */
:root {
    --bg: #f5eedf; --nav: #35251e; --nav2: #493326;
    --text: #35251e; --muted: #74604d; --border: #d7c9b5;
    --purple: #89602b; --primary: #d0a75d;
}
body {
    background: url('legal-service-pattern.svg?v=54a') top center / 1100px 760px repeat,
        linear-gradient(135deg, #f5eedf, #eee1cb);
    color: var(--text);
}
.sidebar {
    background: linear-gradient(165deg, #35251e, #493326);
    border-color: #68503c;
}
.sidebar nav a { color: #fff2d9; }
.sidebar nav a:hover, .sidebar nav a.active { background: #d0a75d; border-color: #d0a75d; color: #302016; }
.sidebar .brand span, .sidebar .userbox a { color: #d0a75d; }
.sidebar .userbox small { color: #e1cfb1; }
.brand span { color: #89602b; }
a { color: #795224; }
.card, .stat, .stat-card, .company-choice, .server-job-card, .field-form, .install-banner {
    background: #fffaf1; border-color: #d7c9b5; color: #35251e;
    box-shadow: 0 3px 16px #35251e08;
}
.btn { background: #fffaf1; color: #35251e; border-color: #d7c9b5; }
.btn.primary, .big-submit, .camera-button { background: #d0a75d; color: #302016; border-color: #d0a75d; }
.btn.primary:hover, .big-submit:hover, .camera-button:hover { background: #bd9144; color: #302016; border-color: #bd9144; }
input, select, textarea { background: #fffdf8; color: #35251e; border-color: #d7c9b5; accent-color: #89602b; }
input:focus, select:focus, textarea:focus { outline-color: #89602b; }
input::placeholder, textarea::placeholder { color: #786651; }
.workspace-welcome { border-color: #d7c9b5; }
.workspace-eyebrow, .workspace-identity { color: #74604d; }
.notice-card, .signature-certification, .recipient-details, .attempt-card { background: #f4ead6; border-color: #d7c9b5; }
.submit-bar { background: #fffaf1; border-color: #d7c9b5; }
.login-body {
    background: url('legal-service-pattern.svg?v=54a') center / 1100px 760px repeat,
        radial-gradient(ellipse at 75% 30%, #654730, #35251e 60%, #241a15);
}
.login-card { background: #fffaf1; border-color: #d7c9b5; border-top-color: #d0a75d; box-shadow: 0 24px 70px #241a1566; }
.login-card input, .login-card select { background: #fffdf8; border-color: #d7c9b5; }
@media (max-width: 640px) {
    body, .login-body { background-size: 720px 498px, auto; background-attachment: scroll; }
}
@media print {
    body, .login-body { background: white !important; color: black; }
    .card, .stat, .stat-card { background: white; box-shadow: none; }
}

/* Step 54C: selected courthouse P identity, readable on both surfaces. */
.courthouse-brand { display:flex; align-items:center; gap:10px; max-width:100%; }
.courthouse-brand .brand-symbol { width:48px; height:48px; flex:0 0 48px; object-fit:contain; border-radius:9px; }
.courthouse-brand .brand-wordmark { color:#35251e; font-family:Georgia,'Times New Roman',serif; font-size:24px; font-weight:600; letter-spacing:-1px; line-height:1.15; }
.courthouse-brand .brand-wordmark>span { color:#89602b; }
.sidebar .courthouse-brand .brand-wordmark { color:#fff2d9; }
.sidebar .courthouse-brand .brand-wordmark>span { color:#d0a75d; }
.login-card .courthouse-brand .brand-symbol { width:64px; height:64px; flex-basis:64px; }
.login-card .courthouse-brand .brand-wordmark { font-size:30px; }
.workspace-seal img { border-radius:14px; }
@media(max-width:380px) { .login-card .courthouse-brand .brand-wordmark { font-size:25px; } }

/* Approved brown, gold and cream logo. */
.approved-brand { width:100%; max-width:340px; margin:0 auto 20px; }
.approved-brand img { display:block; width:100%; height:auto; border-radius:10px; }
.sidebar .approved-brand { max-width:220px; margin-bottom:18px; }
@media(max-width:600px) { .sidebar .approved-brand { max-width:175px; } }

/* Grouped company navigation, with native keyboard-accessible disclosures. */
.sidebar .grouped-nav { display:flex; flex-direction:column; gap:5px; }
.sidebar .grouped-nav > a { display:block; padding:10px 12px; }
.sidebar .nav-group { border:1px solid #d0a75d35; border-radius:10px; margin:0; background:transparent; padding:0; }
.sidebar .nav-group > summary { cursor:pointer; color:#fff2d9; font-size:.94rem; font-weight:600; padding:12px; min-height:44px; }
.sidebar .nav-group > summary:hover { background:#d0a75d20; border-radius:10px; }
.sidebar .nav-group[open] > summary { color:#dfbf89; }
.sidebar .nav-group-links { display:grid; gap:2px; padding:0 7px 7px 14px; }
.sidebar .nav-group-links a { display:block; padding:9px 10px; min-height:40px; font-size:.88rem; }
.sidebar .grouped-nav a:focus-visible,.sidebar summary:focus-visible { outline:2px solid #dfbf89; outline-offset:2px; }
.sidebar .userbox { margin-top:16px; }
@media(max-width:800px) {
 .sidebar .userbox { display:grid; grid-template-columns:1fr auto; gap:4px 12px; }
 .sidebar .userbox strong { grid-column:1; }
 .sidebar .userbox small { grid-column:1; }
 .sidebar .userbox a { grid-column:2; grid-row:1 / 3; align-self:center; padding:10px; }
 .sidebar .nav-group-links a { min-height:44px; }
}

/* Server field workspace: cream, brown and gold; no client rules are implied. */
.field-job {max-width:1000px;margin:auto;padding-bottom:115px;}
.field-top {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px;}
.field-top a {color:#35251e;min-height:44px;display:inline-flex;align-items:center;}
.field-tabs {display:grid;grid-template-columns:repeat(3,1fr);padding:5px;background:#35251e;border-radius:18px;margin-bottom:24px;gap:4px;}
.field-tabs a {text-align:center;color:#fff4df;text-decoration:none;padding:15px 8px;border-radius:14px;font-weight:700;}
.field-tabs a.active {background:#d0a75d;color:#35251e;}
.field-subject {font-size:clamp(24px,4vw,34px);margin-bottom:8px;}
.field-text {white-space:pre-wrap;overflow-wrap:anywhere;}
.field-badges {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:20px 0;}
.field-badge {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;padding:16px 6px;border:1px solid #cfbb97;border-radius:14px;background:#f5eedf;color:#35251e;text-align:center;}
.field-badge.met {background:#d0a75d;border-color:#8f682b;}
.field-badge strong {font-size:.95rem;}.field-badge small {font-size:.78rem;}
.field-policy summary,.field-court>summary {cursor:pointer;min-height:44px;padding:10px 0;font-weight:700;}
.field-policy>.card {box-shadow:none;padding:10px 0;border:0;}
.field-photo-group {padding:20px 0;border-bottom:1px solid #cfbb97;}
.field-job .attempt {border-left:3px solid #d0a75d;padding-left:16px;}
.field-actions {position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1fr;gap:10px;background:#fffaf1;padding:14px 10px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #cfbb97;z-index:5;}
.field-actions .btn {justify-content:center;text-align:center;min-height:52px;font-weight:700;}
.field-actions .field-served {background:#35251e;color:#fff4df;}.field-actions .field-attempted {background:#d0a75d;color:#35251e;}
.field-actions small {grid-column:1/-1;text-align:center;color:#68513e;}
.field-menu {display:none;}.field-tabs a:focus-visible,.field-badge:focus-visible {outline:3px solid #8f682b;outline-offset:3px;}
@media(max-width:800px) {
 .field-job-page .sidebar {display:none;}.field-job-page .app {display:block;}.field-job-page .main {margin:0;padding:16px 12px;min-width:0;width:100%;}
 .field-job .card {padding:18px 14px;margin-bottom:14px;}.field-job .detailgrid {display:block;}
 .field-badges {gap:6px;}.field-badge {padding:12px 3px;}.field-badge strong {font-size:.76rem;}.field-badge small {font-size:.7rem;}
 .field-menu {display:block;position:relative;}.field-menu summary {padding:12px;cursor:pointer;}
 .field-menu[open] {position:absolute;right:12px;top:10px;background:#35251e;color:#fff4df;border:1px solid #d0a75d;border-radius:14px;padding:10px;z-index:20;max-height:80vh;overflow:auto;width:min(300px,90vw);}
 .field-menu[open] a {color:#fff4df;display:block;padding:10px;}.field-menu[open] summary {padding:12px;}
 .field-job .btn {white-space:normal;overflow-wrap:anywhere;}.field-job dl {overflow-wrap:anywhere;}
}
@media(max-width:360px) {.field-badges {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media print {.field-top,.field-tabs,.field-actions,.field-menu {display:none!important;}.field-job {padding:0;}}

@media(max-width:800px) {.field-actions {position:fixed;left:0;right:0;bottom:0;}}

.field-job .detailgrid {display:block;}

.attempt-camera-dialog {width:min(92vw,680px);max-height:90vh;overflow:auto;border:2px solid #d0a75d;border-radius:16px;background:#fffaf1;color:#35251e;padding:20px;}
.attempt-camera-dialog::backdrop {background:rgba(0,0,0,.65);}

.photo-grid figure {margin:0;min-width:0;}
.photo-location {overflow-wrap:anywhere;margin-top:8px;}

/* Step67: readable checkbox controls and instruction text. */
input[type="checkbox"], .form input[type="checkbox"],
.signature-certification input[type="checkbox"], .route-stop input[type="checkbox"] {
  appearance:auto; -webkit-appearance:checkbox;
  display:inline-block; width:24px; height:24px; min-width:24px;
  padding:0; margin:0 8px 0 0; vertical-align:middle;
  flex:0 0 24px; accent-color:#75501f; cursor:pointer;
}
label:has(> input[type="checkbox"]), .form label:has(> input[type="checkbox"]) {
  display:flex; align-items:center; gap:8px; min-height:44px;
  font-size:16px; font-weight:700; line-height:1.5; cursor:pointer;
}
input[type="checkbox"]:focus-visible {outline:3px solid #75501f;outline-offset:4px;}
input[type="checkbox"]:disabled {cursor:not-allowed;}
/* Shared instruction and helper text across all roles and sign-in pages. */
p, .muted.tiny, .help-text, .form-help, .hint, .field-text,
label, legend {
  font-weight:700;
}

/* Mobile app navigation: fixed header, off-canvas full menu, and bottom primary tabs. */
.mobile-topbar,
.mobile-bottom-nav,
.mobile-nav-backdrop {
    display: none;
}

.account-entry-card {
    max-width: 980px;
}
.account-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 22px 0;
}
.account-choice-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.account-choice {
    padding: 18px;
    border: 1px solid #d7c9b5;
    border-radius: 14px;
    background: #fffdf8;
}
.account-choice h2 {
    margin: 0 0 8px;
    font-size: 1.12rem;
}
.account-choice p {
    margin: 7px 0 12px;
}
.account-unavailable {
    padding: 10px 12px;
    border-radius: 9px;
    background: #f4ead6;
    color: #68513e;
}
.login-create-account {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #d7c9b5;
}
.login-create-account span {
    display: block;
    margin-bottom: 8px;
    color: #74604d;
    font-weight: 700;
}

@media (max-width: 800px) {
    :root {
        --mobile-topbar-height: 64px;
        --mobile-bottom-height: 72px;
    }

    body {
        padding-top: calc(var(--mobile-topbar-height) + env(safe-area-inset-top));
        padding-bottom: calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom));
        overflow-x: hidden;
    }
    body.mobile-nav-open {
        overflow: hidden;
    }

    .app,
    .field-job-page .app {
        display: block;
        min-height: calc(100vh - var(--mobile-topbar-height));
    }

    .mobile-topbar {
        position: fixed;
        z-index: 1200;
        top: 0;
        left: 0;
        right: 0;
        min-height: calc(var(--mobile-topbar-height) + env(safe-area-inset-top));
        padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
        display: grid;
        grid-template-columns: 46px minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        background: #35251e;
        color: #fff4df;
        border-bottom: 1px solid #6a503b;
        box-shadow: 0 4px 18px #241a1530;
    }

    .mobile-menu-button,
    .mobile-icon-button,
    .mobile-icon-link {
        width: 44px;
        height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #fff4df;
        text-decoration: none;
        font: inherit;
        font-size: 1.55rem;
        cursor: pointer;
    }
    .mobile-menu-button:active,
    .mobile-icon-button:active,
    .mobile-icon-link:active {
        background: #ffffff18;
    }
    .mobile-brand {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        color: #fff4df;
        text-decoration: none;
        font-weight: 900;
        letter-spacing: -.02em;
    }
    .mobile-brand img {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        border-radius: 50%;
    }
    .mobile-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-top-actions {
        display: flex;
        align-items: center;
        gap: 2px;
    }
    .mobile-icon-link {
        position: relative;
        font-size: .8rem;
    }
    .mobile-notification-wrap {
        position: relative;
    }
    .mobile-notification-button[aria-expanded="true"] {
        background: #ffffff18;
    }
    .mobile-notification-dropdown[hidden] {
        display: none !important;
    }
    .mobile-notification-dropdown {
        position: absolute;
        z-index: 30;
        top: calc(100% + 9px);
        right: -48px;
        width: min(350px, calc(100vw - 20px));
        max-height: min(68vh, 520px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
        border: 1px solid #d4bf9b;
        border-radius: 15px;
        background: #fffaf1;
        color: #35251e;
        box-shadow: 0 18px 45px #17100c55;
    }
    .mobile-notification-head {
        padding: 13px 14px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid #e1d2bb;
        background: #f4ead6;
    }
    .mobile-notification-head strong {
        font-size: 1rem;
    }
    .mobile-notification-head a {
        color: #68481f;
        font-size: .86rem;
        font-weight: 900;
    }
    .mobile-notification-list {
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .mobile-notification-item {
        margin: 0;
        border-bottom: 1px solid #eadfce;
    }
    .mobile-notification-item button {
        width: 100%;
        padding: 12px 14px;
        display: grid;
        gap: 3px;
        border: 0;
        background: #fffaf1;
        color: #35251e;
        text-align: left;
        font: inherit;
        cursor: pointer;
    }
    .mobile-notification-item.unread button {
        background: #fff3d8;
    }
    .mobile-notification-title {
        font-weight: 900;
        line-height: 1.25;
    }
    .mobile-notification-meta {
        font-size: .86rem;
        font-weight: 800;
        color: #604b3a;
    }
    .mobile-notification-time {
        font-size: .74rem;
        font-weight: 700;
        color: #7b6858;
    }
    .mobile-notification-empty {
        margin: 0;
        padding: 24px 14px;
        text-align: center;
        color: #6f5a48;
    }
    .mobile-notification-foot {
        padding: 9px 12px;
        border-top: 1px solid #e1d2bb;
        background: #fffdf8;
    }
    .mobile-notification-foot form {
        margin: 0;
    }
    .mobile-notification-readall {
        width: 100%;
        min-height: 40px;
        border: 1px solid #c9aa77;
        border-radius: 9px;
        background: #fffaf1;
        color: #5c3d1b;
        font: inherit;
        font-weight: 900;
        cursor: pointer;
    }
    .mobile-count {
        position: absolute;
        top: 3px;
        right: 2px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: #d0a75d;
        color: #302016;
        font-size: 10px;
        font-weight: 900;
    }

    .sidebar,
    .field-job-page .sidebar {
        position: fixed;
        z-index: 1300;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 340px);
        height: 100dvh;
        padding: calc(18px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
        display: flex;
        overflow-y: auto;
        overscroll-behavior: contain;
        transform: translateX(-104%);
        transition: transform .22s ease;
        box-shadow: 14px 0 35px #241a1540;
    }
    body.mobile-nav-open .sidebar {
        transform: translateX(0);
    }
    .sidebar .approved-brand {
        max-width: 190px;
        margin: 0 auto 16px;
    }
    .sidebar .grouped-nav,
    .sidebar nav {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        gap: 5px;
    }
    .sidebar .userbox,
    .field-job-page .sidebar .userbox {
        display: grid;
        margin-top: 18px;
    }

    .mobile-nav-backdrop {
        position: fixed;
        z-index: 1250;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        padding: 0;
        background: #17100ccc;
        cursor: pointer;
    }
    .mobile-nav-backdrop:not([hidden]) {
        display: block;
    }

    .main,
    .field-job-page .main {
        grid-column: auto;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 14px 12px 24px;
    }
    .workspace-welcome {
        margin-bottom: 14px;
        padding: 4px 2px 14px;
    }
    .workspace-welcome h1 {
        font-size: clamp(24px, 8vw, 32px);
    }

    .mobile-bottom-nav {
        position: fixed;
        z-index: 1150;
        left: 0;
        right: 0;
        bottom: 0;
        min-height: calc(var(--mobile-bottom-height) + env(safe-area-inset-bottom));
        padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        background: #35251e;
        border-top: 1px solid #6a503b;
        box-shadow: 0 -5px 20px #241a1526;
    }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button {
        min-width: 0;
        min-height: 58px;
        padding: 5px 2px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #fff4df;
        text-decoration: none;
        font: inherit;
        font-size: 11px;
        font-weight: 800;
        cursor: pointer;
    }
    .mobile-bottom-nav a.active,
    .mobile-bottom-nav button[aria-expanded="true"] {
        background: #d0a75d;
        color: #302016;
    }
    .mobile-nav-icon {
        display: block;
        min-height: 25px;
        line-height: 25px;
        font-size: 24px;
        font-weight: 900;
    }
    .mobile-more-icon {
        letter-spacing: 2px;
        font-size: 20px;
    }

    .field-job-page {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }
    .field-job-page .mobile-bottom-nav {
        display: none;
    }
    .field-job-page .field-menu {
        display: none;
    }
    .field-job-page .field-actions {
        z-index: 1100;
    }
    /* Keep the Details / Photos / History job tabs permanently fixed below the mobile top bar. */
    .field-job-page .field-job {
        padding-top: 70px;
    }
    .field-job-page .field-tabs {
        position: fixed;
        top: calc(var(--mobile-topbar-height) + env(safe-area-inset-top));
        left: 12px;
        right: 12px;
        width: auto;
        z-index: 1190;
        margin: 0;
        box-sizing: border-box;
        box-shadow: 0 5px 16px rgba(36, 26, 21, 0.22);
    }

    .install-banner {
        bottom: calc(var(--mobile-bottom-height) + 12px + env(safe-area-inset-bottom));
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 46vh;
    }
    .field-job-page .install-banner {
        bottom: calc(92px + env(safe-area-inset-bottom));
    }

    .account-choice-grid,
    .account-choice-grid-three {
        grid-template-columns: 1fr;
    }
    .account-entry-body {
        padding-top: 20px;
        padding-bottom: 20px;
    }
}

@media (max-width: 380px) {
    .mobile-brand span { font-size: .92rem; }
    .mobile-bottom-nav a,
    .mobile-bottom-nav button { font-size: 10px; }
    .mobile-nav-icon { font-size: 22px; }
}

.mobile-drawer-close { display: none; }
@media (max-width: 800px) {
    .mobile-drawer-close {
        position: absolute;
        top: calc(8px + env(safe-area-inset-top));
        right: 8px;
        width: 44px;
        height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #d0a75d55;
        border-radius: 12px;
        background: #ffffff0d;
        color: #fff4df;
        font-size: 30px;
        line-height: 1;
        cursor: pointer;
    }
}

/* Phone job lists: readable stacked rows instead of a squeezed desktop table. */
@media (max-width: 640px) {
    .job-stage-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        margin: 0 -12px 14px;
        padding: 0 12px 4px;
    }
    .job-stage-tabs::-webkit-scrollbar { display: none; }
    .job-stage-tabs .btn {
        flex: 0 0 auto;
        min-height: 44px;
    }

    .search {
        align-items: stretch;
    }
    .search input {
        min-width: 0;
    }

    .tablewrap {
        overflow: visible;
    }
    .tablewrap table,
    .tablewrap tbody {
        display: block;
        width: 100%;
    }
    .tablewrap thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
    .tablewrap tr {
        display: block;
        margin: 0 0 10px;
        padding: 12px 13px;
        border: 1px solid #d7c9b5;
        border-radius: 13px;
        background: #fffdf8;
        box-shadow: 0 2px 9px #35251e08;
    }
    .tablewrap tr.clickable:active {
        background: #f4ead6;
    }
    .tablewrap td {
        width: 100%;
        padding: 7px 0;
        display: grid;
        grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        border: 0;
        text-align: left;
        overflow-wrap: anywhere;
    }
    .tablewrap td::before {
        content: attr(data-label);
        color: #74604d;
        font-size: .76rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: .04em;
    }
    .tablewrap td:first-child {
        padding-top: 0;
        font-size: 1rem;
        font-weight: 900;
        color: #35251e;
    }
    .tablewrap td:last-child {
        padding-bottom: 0;
    }
    .tablewrap td .btn {
        width: fit-content;
        margin-top: 5px;
    }

    .server-job-grid {
        gap: 10px;
    }
    .server-job {
        padding: 12px;
        margin-bottom: 0;
        border-radius: 12px;
        font-size: .875rem;
        line-height: 1.4;
    }
    .server-job .cardhead {
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 8px;
    }
    .server-job .cardhead > div {
        min-width: 0;
    }
    .server-job .jobnum {
        font-size: .8125rem;
    }
    .server-job h2 {
        margin: 3px 0 0;
        font-size: 1rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
    .server-job .badge {
        padding: 3px 6px;
        font-size: .6875rem;
        line-height: 1.35;
    }
    .server-job .cardhead > .badge {
        flex: 0 0 auto;
        max-width: 30%;
        overflow-wrap: anywhere;
    }
    .server-job p {
        margin: 8px 0;
        font-size: .875rem;
        line-height: 1.4;
        font-weight: 600;
        overflow-wrap: anywhere;
    }
    .server-job .address-small {
        margin-bottom: 10px;
    }
    .server-job .field-actions {
        position: static;
        margin-top: 10px;
        padding: 0;
        border: 0;
        background: transparent;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }
    .server-job .field-actions .btn,
    .server-job .field-actions form,
    .server-job .field-actions form .btn {
        width: 100%;
        min-width: 0;
    }
    .server-job .field-actions form {
        margin: 0;
    }
    .server-job .field-actions .btn {
        display: flex;
        align-items: center;
        min-height: 44px;
        height: 100%;
        padding: 8px 6px;
        border-radius: 8px;
        font-size: .8125rem;
        line-height: 1.25;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}


/* First-run phone notification prompt. Persistent controls live in Settings. */
.notification-first-run-layer[hidden] { display: none !important; }
.notification-first-run-layer {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(35, 22, 16, .68);
    backdrop-filter: blur(5px);
}
.notification-first-run-card {
    width: min(92vw, 430px);
    padding: 24px;
    border: 1px solid #d7b56e;
    border-radius: 20px;
    background: #fffaf1;
    box-shadow: 0 24px 70px rgba(31, 19, 13, .28);
    text-align: center;
}
.notification-first-run-card h2 { margin: 8px 0 10px; }
.notification-first-run-card p { margin: 0 0 18px; }
.notification-first-run-icon { font-size: 42px; line-height: 1; }
.notification-first-run-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}
.notification-first-run-actions .btn { width: 100%; }
.notification-settings-card { max-width: 760px; }
.notification-settings-card .actions { margin: 16px 0 10px; }
@media (max-width: 520px) {
    .notification-first-run-layer {
        align-items: flex-end;
        padding: 12px 12px calc(82px + env(safe-area-inset-bottom));
    }
    .notification-first-run-card {
        width: 100%;
        padding: 22px 18px;
        border-radius: 20px;
    }
    .notification-first-run-actions { grid-template-columns: 1fr; }
}

/* Pre-launch legal, registration consent, and account-entry layout. */
.account-entry-card {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    box-sizing: border-box;
}
.account-entry-brand-row {
    display: grid;
    grid-template-columns: minmax(180px, 250px) 1fr;
    gap: clamp(20px, 4vw, 48px);
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #d7c9b5;
}
.account-entry-brand-row .approved-brand {
    max-width: 250px;
    margin: 0;
}
.account-entry-intro h1 {
    margin: 3px 0 8px;
    font-size: clamp(2rem, 4vw, 3.1rem);
}
.account-entry-intro p:last-child { margin-bottom: 0; }
.legal-eyebrow {
    margin: 0 0 4px;
    color: #89602b;
    font-size: .72rem;
    letter-spacing: .14em;
    font-weight: 800;
}
.account-choice-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0;
}
.account-choice {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 24px;
    border: 1px solid #d7c9b5;
    border-radius: 16px;
    background: #fffdf8;
}
.account-choice h2 {
    margin: 10px 0 8px;
    font-size: 1.35rem;
}
.account-choice p {
    margin: 7px 0 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.account-choice .btn { margin-top: auto; }
.account-choice-note {
    color: #74604d;
    font-size: .92rem;
}
.account-choice-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: #35251e;
    color: #f2cf84;
    font-weight: 900;
    letter-spacing: -.03em;
}
.account-entry-legal-note,
.registration-notice-at-collection,
.registration-warning-card {
    margin: 20px 0;
    padding: 18px 20px;
    border: 1px solid #d0a75d;
    border-radius: 14px;
    background: #f4ead6;
}
.account-entry-legal-note p,
.registration-notice-at-collection p,
.registration-warning-card p { margin: 7px 0 0; }
.registration-notice-at-collection h2,
.registration-warning-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.registration-consents {
    margin: 22px 0;
    padding: 18px;
    border: 1px solid #d7c9b5;
    border-radius: 14px;
    background: #fffdf8;
}
.registration-consents legend {
    padding: 0 6px;
    font-weight: 800;
}
.registration-consents label.consent-row,
.shared-card .registration-consents label.consent-row {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    margin: 10px 0;
    font-weight: 650;
}
.registration-consents input[type="checkbox"],
.shared-card .registration-consents input[type="checkbox"] {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px;
    margin: 1px 0 0 !important;
    padding: 0 !important;
    flex: 0 0 24px;
}
.registration-consents .consent-row span { min-width: 0; }
.registration-consents a { font-weight: 800; }
.success-mark {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 0 14px;
    border-radius: 50%;
    background: #dcefdc;
    color: #236d38;
    font-size: 2rem;
    font-weight: 900;
}
.registration-warning-card ul,
.legal-document ul { padding-left: 1.35rem; }
.registration-warning-card li,
.legal-document li { margin: 8px 0; }
.registration-complete-card {
    width: min(720px, calc(100vw - 32px));
    max-width: 720px;
    box-sizing: border-box;
}
.legal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 10px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #d7c9b5;
    color: #74604d;
    font-size: .84rem;
    font-weight: 650;
}
.legal-footer a { color: #795224; }
.main > .legal-footer { margin-top: 46px; padding-bottom: 24px; }

.legal-page-body {
    display: block;
    min-height: 100vh;
    padding: 28px 16px;
}
.legal-shell {
    width: min(1020px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 48px);
    box-sizing: border-box;
    border: 1px solid #d7c9b5;
    border-top: 4px solid #d0a75d;
    border-radius: 18px;
    background: #fffaf1;
    box-shadow: 0 24px 70px #241a1566;
}
.legal-page-header {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 24px;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid #d7c9b5;
}
.legal-brand img { display: block; width: 100%; height: auto; border-radius: 10px; }
.legal-page-header h1 {
    margin: 2px 0 4px;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
}
.legal-page-header p { margin: 0; }
.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 18px 0;
    border-bottom: 1px solid #d7c9b5;
}
.legal-nav a {
    padding: 8px 11px;
    border: 1px solid #d7c9b5;
    border-radius: 999px;
    background: #fffdf8;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 750;
}
.legal-document {
    padding-top: 12px;
    line-height: 1.68;
}
.legal-document section {
    padding: 16px 0;
    border-bottom: 1px solid #eadfce;
}
.legal-document section:last-child { border-bottom: 0; }
.legal-document h2 {
    margin: 0 0 8px;
    font-size: 1.35rem;
}
.legal-document p { margin: 8px 0; font-weight: 550; }
.legal-document li { font-weight: 550; }
.legal-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.legal-link-card {
    display: block;
    padding: 18px;
    border: 1px solid #d7c9b5;
    border-radius: 14px;
    background: #fffdf8;
    color: #35251e;
    text-decoration: none;
}
.legal-link-card strong { display: block; color: #795224; font-size: 1.05rem; }
.legal-link-card span { display: block; margin-top: 6px; font-weight: 550; }
.legal-link-card:hover { border-color: #b78325; box-shadow: 0 5px 18px #35251e12; }

@media (max-width: 900px) {
    .account-entry-card { width: min(720px, calc(100vw - 32px)); }
    .account-choice-grid-three { grid-template-columns: 1fr; }
    .account-choice { min-height: 0; }
}
@media (max-width: 640px) {
    .account-entry-card { width: calc(100vw - 20px); padding: 20px 16px; }
    .account-entry-brand-row { grid-template-columns: 1fr; gap: 12px; }
    .account-entry-brand-row .approved-brand { max-width: 190px; margin: 0 auto; }
    .account-entry-intro { text-align: center; }
    .account-choice { padding: 18px; }
    .legal-page-body { padding: 10px; }
    .legal-shell { padding: 20px 16px; border-radius: 14px; }
    .legal-page-header { grid-template-columns: 1fr; gap: 12px; text-align: center; }
    .legal-brand { width: 170px; margin: 0 auto; }
    .legal-nav { justify-content: center; }
    .legal-card-grid { grid-template-columns: 1fr; }
    .registration-consents { padding: 14px; }
}

/* Tall registration screens scroll from the top instead of being vertically centered off-screen. */
.account-entry-body,
.account-registration-body {
    display: block;
    min-height: 100vh;
    padding: 28px 16px;
    box-sizing: border-box;
}
.account-entry-body .account-entry-card,
.account-registration-body .login-card {
    margin: 0 auto;
}
.account-registration-body .login-card {
    width: min(760px, 100%);
    max-width: 760px;
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .account-entry-body,
    .account-registration-body { padding: 10px; }
}

/* Platform Owner Center */
.owner-body {
    min-height: 100vh;
    padding: 28px 18px;
    background:
        radial-gradient(circle at 15% 0%, rgba(208,167,93,.18), transparent 32%),
        #f4efe7;
    color: #35251e;
}
.owner-shell {
    width: min(1420px, 100%);
    margin: 0 auto;
}
.owner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid #d7c9b5;
    border-radius: 18px;
    background: #fffaf1;
    box-shadow: 0 10px 28px rgba(53,37,30,.08);
}
.owner-brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
}
.owner-brand {
    width: 126px;
    flex: 0 0 126px;
}
.owner-brand img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
.owner-kicker {
    margin: 0 0 4px;
    color: #9a6a22;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.owner-header h1 {
    margin: 0 0 4px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 500;
}
.owner-header p { margin-top: 3px; margin-bottom: 0; }
.owner-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    padding: 10px;
    border: 1px solid #d7c9b5;
    border-radius: 14px;
    background: #35251e;
}
.owner-nav a {
    padding: 10px 14px;
    border-radius: 10px;
    color: #fff4df;
    text-decoration: none;
    font-weight: 800;
}
.owner-nav a:hover,
.owner-nav a.active {
    background: #d0a75d;
    color: #241a15;
}
.owner-panel {
    margin-bottom: 18px;
    padding: 22px;
    border: 1px solid #d7c9b5;
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: 0 7px 20px rgba(53,37,30,.05);
}
.owner-panel h2 { margin: 0 0 8px; }
.owner-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.owner-section-heading p { margin: 5px 0 0; }
.owner-stat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.owner-stat {
    padding: 18px;
    border: 1px solid #d7c9b5;
    border-top: 3px solid #d0a75d;
    border-radius: 14px;
    background: #fffdf8;
}
.owner-stat span {
    display: block;
    color: #74604d;
    font-weight: 750;
    font-size: .88rem;
}
.owner-stat strong {
    display: block;
    margin-top: 7px;
    font-size: 2rem;
    line-height: 1;
}
.owner-table-wrap { overflow-x: auto; }
.owner-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}
.owner-table th,
.owner-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #eadfce;
    vertical-align: top;
    text-align: left;
}
.owner-table th {
    color: #6f4d25;
    background: #f6ecdb;
    font-size: .78rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.owner-table tr:last-child td { border-bottom: 0; }
.owner-email {
    margin-top: 3px;
    color: #74604d;
    font-size: .88rem;
    word-break: break-word;
}
.owner-tag,
.owner-role,
.owner-status {
    display: inline-block;
    margin: 3px 4px 2px 0;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 850;
}
.owner-tag { background: #f4ead6; color: #795224; }
.owner-role { background: #eee8df; color: #4b382e; }
.owner-status { background: #eee8df; }
.owner-status-active,
.owner-status-trial { background: #e2f2e6; color: #28623a; }
.owner-status-expired { background: #fff2cf; color: #7c5b12; }
.owner-status-suspended { background: #fae0e0; color: #8c2f2f; }
.owner-inline-form {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 260px;
}
.owner-inline-form select {
    min-width: 155px;
    padding: 10px 11px;
    border: 1px solid #cdbca7;
    border-radius: 9px;
    background: white;
}
.owner-two-column {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 18px;
    align-items: start;
}
.owner-form {
    display: grid;
    gap: 14px;
}
.owner-form label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}
.owner-form input,
.owner-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cdbca7;
    border-radius: 10px;
    background: #fff;
    color: #35251e;
    font: inherit;
}
.owner-form small { color: #74604d; font-weight: 600; }
.owner-security-confirm {
    margin-top: 5px;
    padding: 14px;
    border: 1px solid #d0a75d;
    border-radius: 12px;
    background: #f8eedb;
}
.owner-detail-list { margin: 0; }
.owner-detail-list div {
    display: grid;
    grid-template-columns: 150px minmax(0,1fr);
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eadfce;
}
.owner-detail-list div:last-child { border-bottom: 0; }
.owner-detail-list dt { color: #74604d; font-weight: 800; }
.owner-detail-list dd { margin: 0; font-weight: 700; word-break: break-word; }
.owner-security-note {
    margin: 14px 0 0;
    padding: 12px;
    border-radius: 10px;
    background: #f4ead6;
    color: #62492f;
    font-weight: 650;
}
.owner-audit-list { display: grid; gap: 8px; }
.owner-audit-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #eadfce;
}
.owner-audit-row:last-child { border-bottom: 0; }
.owner-audit-row span { color: #74604d; font-size: .86rem; text-align: right; }

@media (max-width: 1000px) {
    .owner-stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .owner-two-column { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
    body.owner-body {
        padding: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .owner-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .owner-brand-row { align-items: flex-start; }
    .owner-brand { width: 104px; flex-basis: 104px; }
    .owner-stat-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .owner-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .owner-nav a { text-align: center; }
}
@media (max-width: 520px) {
    .owner-body { padding: 8px; }
    .owner-header, .owner-panel { padding: 16px; }
    .owner-brand-row { display: grid; grid-template-columns: 86px 1fr; gap: 12px; }
    .owner-brand { width: 86px; }
    .owner-stat-grid { grid-template-columns: 1fr 1fr; }
    .owner-stat { padding: 14px; }
    .owner-stat strong { font-size: 1.7rem; }
    .owner-nav { grid-template-columns: 1fr; }
    .owner-detail-list div { grid-template-columns: 1fr; gap: 2px; }
    .owner-audit-row { flex-direction: column; gap: 3px; }
    .owner-audit-row span { text-align: left; }
}
