:root {
    --color-background: #f9f9f9;
    --color-surface: #ffffff;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-border: #e0e0e0;
    --color-primary: #4a4a4a;
    --color-primary-light: #5a5a5a;
    --color-success: #43a047;
    --color-warning: #fdd835;
    --color-error: #e53935;
    --color-github-star: #f1e05a;
    --color-sponsor: #ea4aaa;
    --color-sponsor: #4a4a4a;
    --color-sponsor-hover: #5a5a5a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--color-surface);
    padding: 24px 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 24px;
    font-weight: 500;
    color: var(--color-primary);
    margin: 0 0 16px 0;
}

.github-section {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.github-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-sponsor);
    color: white;
    border: 1px solid var(--color-border);
    padding: 10px 16px;
    margin-left: 16px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.github-button:hover {
    background-color: var(--color-sponsor);
    border-color: var(--color-primary);
}

.github-button svg {
    margin-right: 8px;
}

.github-button svg path {
    fill: var(--color-github-star);
}

main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    background-color: var(--color-surface);
    padding: 24px;
    overflow-y: auto;
    border-right: 1px solid var(--color-border);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    background-color: var(--color-background);
}

form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--color-primary);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text-light);
}

input[type="text"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

button {
    background-color: var(--color-primary);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--color-primary-light);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: var(--color-surface);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

th, td {
    text-align: left;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}

th {
    font-weight: 500;
    color: var(--color-primary);
    background-color: var(--color-surface);
}

.status-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-ok {
    background-color: var(--color-success);
    color: white;
}

.status-pending {
    background-color: var(--color-warning);
    color: var(--color-text);
}

.status-working {
    background-color: var(--color-warning);
    color: var(--color-text);
}

.status-failed {
    background-color: var(--color-error);
    color: var(--color-text);
}

.status-error {
    background-color: var(--color-error);
    color: white;
}

.download-button, .delete-button {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    color: white;
}

.download-button {
    background-color: var(--color-success);
}

.delete-button {
    background-color: var(--color-error);
}

.job-email-controls {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dce4ec;
}

.job-email-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
}

.job-email-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.job-email-actions button {
    padding: 6px 10px;
    font-size: 12px;
}

.job-email-save {
    background: #596579;
}

.job-email-retry {
    background: #3468aa;
}

.job-email-retry:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.email-retry-running,
.email-retry-message {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
}

.email-retry-running {
    color: #8a6200;
}

.email-retry-message {
    color: var(--color-text-light);
}

.job-lead-count {
    display: inline-block;
    margin-right: 6px;
    color: #344b62;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.job-settings-button {
    padding: 6px 12px;
    background: #596579;
    font-size: 12px;
}

.job-settings-row[hidden] {
    display: none;
}

.job-settings-row td {
    padding: 16px 20px;
    background: #f6f9fc;
}

.job-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 24px;
    font-size: 13px;
}

.job-settings-grid h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.job-settings-grid div {
    margin: 3px 0;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .job-settings-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

.error-message {
    display: none;
    background-color: #ffebee;
    border: 1px solid var(--color-error);
    color: var(--color-error);
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.error-message:not(:empty) {
    display: block;
}

.expandable-section summary {
    cursor: pointer;
    padding: 12px 16px;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
}

.expandable-section[open] summary {
    border-bottom: none;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

@media (max-width: 768px) {
    main {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    .content {
        padding: 20px;
    }
}

.sponsor-section {
    position: relative;
    margin-top: 24px;
    padding: 16px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
}

.sponsor-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: none;
    background-color: transparent;
    color: var(--color-text-light);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.sponsor-close:hover {
    color: var(--color-text);
}

.sponsor-text {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--color-text);
    padding-right: 20px; /* Make space for the close button */
}

.sponsor-button {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-sponsor);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.sponsor-button:hover {
    background-color: var(--color-sponsor-hover);
}

.sponsor-button svg {
    margin-right: 8px;
}

nav {
    margin-bottom: 16px;
    padding: 8px 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 8px 16px;
    background-color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 4px;
    transition: all 0.2s ease;
    display: inline-block;
}

nav a:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Job map view */
.view-button {
    background-color: #2c7be5;
    color: #fff;
    padding: 6px 12px;
    font-size: 12px;
}

.view-button:hover {
    background-color: #1a68d1;
}

.map-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.map-modal-content {
    background: #fff;
    width: min(96vw, 1600px);
    height: 92vh;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.map-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

#places-count {
    color: #777;
    font-size: 0.9rem;
    font-weight: 400;
}

.map-modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    color: #555;
}

.map-modal-body {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 16px;
    min-height: 0;
    padding: 16px;
    background: #f6f7f9;
}

#job-map {
    width: 100%;
    height: 300px;
}

.places-list-panel {
    min-width: 0;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 8px;
}

.places-list-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(130px, 1.2fr) minmax(90px, 0.7fr) minmax(180px, 2fr) minmax(95px, 0.8fr) 56px;
    gap: 12px;
    padding: 10px 108px 10px 14px;
    border-bottom: 1px solid #e2e5e9;
    background: #f9fafb;
    color: #666;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
}

.job-map-card {
    align-self: start;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e5e9;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-map-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.job-map-card-header h3 {
    margin: 0;
    font-size: 0.95rem;
}

#job-map-show-all {
    border: 0;
    background: none;
    color: #1a68d1;
    cursor: pointer;
}

#job-map-hint {
    margin: 0;
    padding: 10px 12px;
    color: #666;
    font-size: 0.8rem;
}

.place-item {
    position: relative;
    min-width: 0;
    background: #fff;
    border-bottom: 1px solid #eceef1;
    overflow-wrap: anywhere;
}

.place-select {
    display: grid;
    grid-template-columns: minmax(130px, 1.2fr) minmax(90px, 0.7fr) minmax(180px, 2fr) minmax(95px, 0.8fr) 56px;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 58px;
    padding: 10px 108px 10px 14px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.place-select:disabled {
    cursor: default;
}

.place-item:hover,
.place-item:focus-within,
.place-item.is-selected {
    background: #f4f8ff;
    outline: none;
}

.place-item.is-selected {
    box-shadow: inset 3px 0 #2c7be5;
}

.place-title {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
}

.place-cell {
    font-size: 0.8rem;
    color: #555;
}

.place-address {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.place-fields {
    margin: 0;
}

.place-field {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
}

.place-field dt,
.place-field-label {
    display: block;
    color: #777;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.place-field dd,
.place-field-value {
    display: block;
    margin: 2px 0 0;
    white-space: pre-wrap;
}

.place-details {
    padding: 0 14px;
}

.place-details summary {
    position: absolute;
    top: 18px;
    right: 12px;
    color: #1a68d1;
    cursor: pointer;
    font-size: 0.82rem;
}

.place-details .place-fields {
    max-height: 320px;
    overflow-y: auto;
    padding: 12px 0 16px;
    border-top: 1px solid #e2e5e9;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 4px 18px;
}

.place-no-location {
    margin: 0 14px 8px;
    color: #777;
    font-size: 0.8rem;
}

@media (max-width: 760px) {
    .map-modal-content {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .map-modal-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .job-map-card {
        grid-row: 1;
    }

    #job-map {
        height: 180px;
    }

    .places-list-panel {
        grid-row: 2;
    }

    .places-list-header {
        display: none;
    }

    .place-select {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2px 12px;
        padding: 10px 90px 10px 12px;
    }

    .place-title,
    .place-address {
        grid-column: 1 / -1;
    }

    .place-category,
    .place-phone,
    .place-review_rating {
        font-size: 0.72rem;
    }

    .place-phone,
    .place-review_rating {
        grid-column: 2;
    }

    .place-details summary {
        top: 10px;
    }
}

.map-loading,
.map-empty,
.map-error {
    padding: 12px;
    color: #666;
}

.map-error {
    color: #c0392b;
}

/* Full-page places table */
body.places-page {
    display: flex;
    height: 100vh;
    min-height: 0;
    overflow: hidden;
    background: #f6f7f9;
}

.places-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex: none;
    padding: 16px 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    z-index: 3;
}

.places-page-header h1 {
    margin: 2px 0 0;
    font-size: 1.35rem;
    font-weight: 600;
}

.places-back {
    color: #3468aa;
    font-size: 0.85rem;
    text-decoration: none;
}

.places-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.places-sidebar {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    background: #fff;
}

.places-sidebar-nav {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid #e9edf1;
}

.places-sidebar-nav a {
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #3468aa;
    text-decoration: none;
    font-size: 0.85rem;
}

.places-sidebar-nav a:hover,
.places-sidebar-nav a:focus-visible {
    background: #edf5ff;
    transform: none;
    box-shadow: none;
}

.places-sidebar-heading {
    padding: 14px 16px 10px;
    border-bottom: 1px solid #e9edf1;
}

.places-sidebar-heading h2 {
    margin: 0 0 8px;
    font-size: 0.95rem;
}

.column-menu-actions {
    display: flex;
    gap: 10px;
}

.places-sidebar .column-menu-actions button,
.cell-more {
    padding: 0;
    border: 0;
    background: none;
    color: #1a68d1;
    cursor: pointer;
}

.column-options {
    display: grid;
    align-content: start;
    gap: 2px;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 12px 14px;
}

.places-sidebar .column-options label {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 6px 4px;
    font-size: 0.78rem;
    color: #333;
    cursor: pointer;
}

.places-page-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 300px;
    gap: 14px;
    flex: 1;
    min-height: 0;
    padding: 14px;
}

.places-table-panel {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    border: 1px solid #dce2e8;
    border-radius: 8px;
    background: #fff;
}

#places-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: auto;
    font-size: 0.8rem;
}

#places-table th,
#places-table td {
    min-width: 110px;
    max-width: 240px;
    padding: 9px 12px;
    border-bottom: 1px solid #e9edf1;
    text-align: left;
    vertical-align: middle;
}

#places-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #f8fafc;
    color: #586474;
    font-size: 0.72rem;
    text-transform: uppercase;
    white-space: nowrap;
}

#places-table td {
    background: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#places-table tbody tr {
    cursor: pointer;
}

#places-table tbody tr:hover td,
#places-table tbody tr:focus-visible td,
#places-table tbody tr.is-selected td {
    background: #edf5ff;
}

.cell-preview {
    display: inline;
}

.cell-more {
    margin-left: 6px;
    white-space: nowrap;
}

.places-empty {
    padding: 28px !important;
    color: #777;
    text-align: center !important;
}

.places-page .job-map-card {
    align-self: start;
}

.places-page .job-map-card-header h2 {
    margin: 0;
    font-size: 0.95rem;
}

.places-page #job-map {
    height: 280px;
}

.cell-dialog {
    width: min(720px, 90vw);
    max-height: 80vh;
    padding: 0;
    border: 0;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.cell-dialog::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.cell-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid #e9edf1;
}

.cell-dialog-header h2 {
    margin: 0;
    font-size: 1rem;
}

.cell-dialog-header button {
    border: 0;
    background: none;
    font-size: 1.5rem;
    cursor: pointer;
}

#cell-dialog-value {
    max-height: 65vh;
    overflow: auto;
    margin: 0;
    padding: 18px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace;
}

@media (max-width: 900px) {
    .places-page-body {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: 180px 220px minmax(0, 1fr);
    }

    .places-sidebar {
        grid-row: 1;
    }

    .places-sidebar-nav {
        display: flex;
    }

    .places-sidebar-heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 12px;
    }

    .places-sidebar-heading h2 {
        margin: 0;
    }

    .column-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .places-page .job-map-card {
        grid-row: 2;
    }

    .places-page #job-map {
        height: 165px;
    }

    .places-table-panel {
        grid-row: 3;
    }
}

@media (max-width: 560px) {
    .places-page-header {
        padding: 10px 12px;
    }

    .places-page-header h1 {
        font-size: 1.1rem;
    }

    .places-actions {
        gap: 6px;
    }

    .places-actions .button {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    .column-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Workspace visual system */
:root {
    --color-background: #f5f7fa;
    --color-surface: #ffffff;
    --color-text: #172b3a;
    --color-text-light: #607180;
    --color-border: #dfe7ed;
    --color-primary: #123d52;
    --color-primary-light: #1b5971;
    --color-success: #188a70;
    --color-warning: #f3d889;
    --color-error: #c94b4b;
    --color-sponsor: #123d52;
    --color-sponsor-hover: #1b5971;
    --shadow-panel: 0 10px 32px rgba(18, 61, 82, .06), 0 1px 2px rgba(18, 61, 82, .04);
}

body { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, .button, a { transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, tr:focus-visible {
    outline: 3px solid rgba(26, 154, 161, .35);
    outline-offset: 2px;
}

.app-container > header, .places-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 76px;
    box-sizing: border-box;
    padding: 14px 32px;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
}
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #123d52;
    color: #8ce2d1;
    font-size: 31px;
    line-height: 1;
}
.brand-kicker, .eyebrow {
    display: block;
    color: #1a8d89;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
}
.brand-lockup h1 { margin: 0; color: #173647; font-size: 19px; font-weight: 750; letter-spacing: -.035em; }
.app-container > header nav { margin: 0; padding: 0; }
.app-container > header nav a {
    padding: 9px 14px;
    border: 1px solid #d5e3e8;
    border-radius: 9px;
    background: #fff;
    color: #23495c;
    font-size: 13px;
    font-weight: 700;
}
.app-container > header nav a:hover { background: #eef7f7; box-shadow: none; transform: none; }
.github-section, .sponsor-section { display: none; }

.app-container > main { min-height: 0; }
.sidebar {
    flex: 0 0 340px;
    box-sizing: border-box;
    width: 340px;
    padding: 28px 24px 36px;
    background: #fff;
    border-right: 1px solid var(--color-border);
    box-shadow: none;
}
.content { min-width: 0; padding: 32px 36px; background: var(--color-background); }
.panel-intro, .content-heading { margin-bottom: 25px; }
.panel-intro h2, .content-heading h2 {
    margin: 3px 0 3px;
    color: #173647;
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.045em;
}
.panel-intro p, .content-heading p { margin: 0; color: #6a7c89; font-size: 13px; }
.content-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    padding: 7px 11px;
    border: 1px solid #cce9e1;
    border-radius: 999px;
    background: #eaf8f3;
    color: #167461;
    font-size: 11px;
    font-weight: 700;
}
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: #28a781; box-shadow: 0 0 0 3px #d1f0e5; }

.sidebar form { gap: 18px; }
.sidebar legend { margin-bottom: 13px; color: #27485a; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.sidebar .form-group { margin-bottom: 15px; }
.sidebar label { margin-bottom: 6px; color: #40586a; font-size: 12px; font-weight: 650; }
.sidebar input[type="text"], .sidebar input[type="number"], .sidebar textarea {
    padding: 10px 12px;
    border: 1px solid #d6e1e7;
    border-radius: 9px;
    background: #fcfdfd;
    color: #173647;
    font-size: 13px;
    box-shadow: inset 0 1px 2px rgba(18,61,82,.02);
}
.sidebar input:hover, .sidebar textarea:hover { border-color: #abc6cd; }
.sidebar input:focus, .sidebar textarea:focus { border-color: #1a9aa1; outline: 3px solid rgba(26,154,161,.13); }
.sidebar textarea { resize: vertical; min-height: 90px; }
.sidebar .expandable-section summary {
    padding: 12px 14px;
    border: 1px solid #dce7eb;
    border-radius: 9px;
    background: #f8fbfc;
    color: #315165;
    font-size: 13px;
    font-weight: 700;
    list-style-position: inside;
}
.sidebar .expandable-section[open] summary { border-radius: 9px 9px 0 0; }
.sidebar .expandable-section fieldset { padding: 15px 14px 1px; border: 1px solid #dce7eb; border-top: 0; border-radius: 0 0 9px 9px; }
.sidebar .checkbox { display: flex; align-items: center; gap: 8px; }
.sidebar .checkbox label { margin: 0; }
input[type="checkbox"] { accent-color: #148b8b; }
.sidebar button[type="submit"] { width: 100%; padding: 12px 16px; border-radius: 9px; background: #147e83; font-weight: 750; box-shadow: 0 5px 12px rgba(20,126,131,.14); }
.sidebar button[type="submit"]:hover { background: #106a70; }

#job-table {
    min-width: 820px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: var(--shadow-panel);
}
#job-table th { padding: 14px 16px; background: #f9fbfc; color: #617687; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; }
#job-table td { padding: 16px; color: #334e5f; font-size: 12px; }
#job-table tbody tr:not(.job-settings-row):hover td { background: #f8fcfc; }
#job-table td:first-child { color: #81919e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
#job-table td:nth-child(2) { color: #203e50; font-weight: 700; }
#job-table td:last-child { white-space: nowrap; }
.status-indicator { padding: 5px 10px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.status-ok { background: #e4f6ee; color: #147c5c; }
.status-working, .status-pending { background: #fff4d6; color: #926610; }
.status-failed, .status-error { background: #fde9e9; color: #b83e3e; }
.view-button, .download-button, .delete-button, .job-settings-button, .job-email-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 3px;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-decoration: none;
}
.view-button { background: #e7f4f7; color: #12677a; }
.view-button:hover { background: #d3edf2; }
.download-button { background: #e3f4ed; color: #147657; }
.download-button:hover { background: #d0ebdf; }
.job-settings-button { background: #edf1f5; color: #3e596c; }
.job-settings-button:hover { background: #e2eaf0; }
.delete-button { background: #fff0ef; color: #b64b4b; }
.delete-button:hover { background: #f9dedd; }
.job-lead-count { margin-right: 9px; color: #587284; font-weight: 700; }
.job-settings-row td { background: #f7fbfc; }
.job-settings-row td:first-child, .job-settings-row td:last-child { color: #334e5f; font-family: inherit; font-size: 12px; white-space: normal; }
.job-settings-grid section { padding: 13px 16px; border: 1px solid #dfe9ed; border-radius: 9px; background: #fff; }
.job-settings-grid h3 { margin-bottom: 10px; color: #2d5766; font-size: 12px; }
.job-settings-grid div { margin: 5px 0; }
.job-email-controls { border-color: #e1e9ec; }
.job-email-actions .job-email-save { background: #e8eef2; color: #315166; }
.job-email-actions .job-email-retry { background: #147e83; color: #fff; }

.places-page-header { min-height: 78px; padding: 14px 26px; }
.places-page-header h1 { margin-top: 2px; color: #173647; font-size: 22px; font-weight: 750; letter-spacing: -.035em; }
.places-back { color: #168385; font-weight: 700; }
.places-page-body { gap: 16px; padding: 16px; background: var(--color-background); }
.places-sidebar, .places-table-panel, .job-map-card { border-color: var(--color-border); border-radius: 11px; box-shadow: var(--shadow-panel); }
.places-sidebar-heading, .places-sidebar-nav { border-color: #e7edf1; }
.places-sidebar-heading h2, .job-map-card-header h2 { color: #24475b; font-weight: 750; }
.places-sidebar-nav a { color: #287183; font-weight: 700; }
.places-sidebar .column-options label { gap: 9px; padding: 7px 8px; border-radius: 6px; color: #445f6f; }
.places-sidebar .column-options label:hover { background: #f0f8f8; }
#places-table { box-shadow: none; }
#places-table th { padding: 12px 14px; background: #f8fbfc; color: #617687; font-size: 10px; letter-spacing: .08em; }
#places-table td { padding: 11px 14px; color: #365164; }
#places-table tbody tr:hover td, #places-table tbody tr:focus-visible td, #places-table tbody tr.is-selected td { background: #eaf7f6; }
#places-table tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 #148b8b; }
.job-map-card-header { padding: 14px 15px; border-bottom: 1px solid #e7edf1; }
#job-map-hint { color: #687e8b; }
.cell-dialog { border-radius: 12px; }

@media (max-width: 1050px) {
    .sidebar { flex-basis: 300px; width: 300px; padding: 24px 18px; }
    .content { padding: 24px 20px; }
    .places-page-body { grid-template-columns: 200px minmax(0, 1fr) 250px; }
}
@media (max-width: 900px) {
    .places-page-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 180px 220px minmax(0, 1fr); }
}
@media (max-width: 768px) {
    body { min-height: 100vh; height: auto; }
    .app-container > main { flex-direction: column; overflow: visible; }
    .sidebar { flex: auto; width: 100%; overflow: visible; border-right: 0; border-bottom: 1px solid var(--color-border); }
    .content { overflow-x: auto; }
    .app-container > header { min-height: 68px; padding: 12px 18px; }
    .brand-lockup h1 { font-size: 17px; }
    .content-heading h2, .panel-intro h2 { font-size: 22px; }
}
@media (max-width: 560px) {
    .places-page-header { padding: 10px 12px; }
    .places-page-body { padding: 10px; gap: 10px; }
    .live-pill { display: none; }
}

/* Accounts and platform administration */
.app-container > header nav { display: flex; align-items: center; gap: 9px; }
.workspace-name { color: #506b7b; font-size: 12px; font-weight: 700; margin-right: 7px; }
.app-container > header .logout-form, .admin-header form { display: inline; margin: 0; }
.app-container > header .logout-form button, .admin-header button { padding: 9px 13px; border: 1px solid #d5e3e8; border-radius: 9px; background: #fff; color: #315165; font-size: 12px; font-weight: 700; }
.plan-note { display: inline-block; margin-top: 12px; padding: 6px 9px; border-radius: 7px; background: #eaf8f3; color: #167461; font-size: 11px; font-weight: 700; text-transform: capitalize; }
.account-page { display: grid; place-items: center; min-height: 100vh; height: auto; background: radial-gradient(circle at 20% 15%, #dcefeb, transparent 34%), #f3f7f8; }
.account-shell { display: block; width: min(440px, calc(100vw - 32px)); padding: 40px 0; overflow: visible; }
.account-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 24px; color: #173647; font-size: 20px; font-weight: 800; }
.account-card { padding: 32px; border: 1px solid #dce7eb; border-radius: 16px; background: #fff; box-shadow: var(--shadow-panel); }
.account-card h1 { margin: 7px 0 5px; color: #173647; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.account-card p { margin: 0 0 22px; color: #647b89; font-size: 13px; }
.account-card form { gap: 8px; }
.account-card label { margin: 6px 0 0; color: #385667; font-size: 12px; font-weight: 750; }
.account-card input, .admin-org input, .admin-org select { box-sizing: border-box; width: 100%; padding: 11px 12px; border: 1px solid #d6e1e7; border-radius: 9px; background: #fcfdfd; color: #173647; font-size: 13px; }
.account-card form button { margin-top: 14px; border-radius: 9px; background: #147e83; font-weight: 750; }
.account-card .account-switch { margin: 22px 0 0; text-align: center; }
.account-switch a { color: #147e83; font-weight: 750; }
.account-error { margin: 0 0 16px; padding: 10px 12px; border: 1px solid #f3c4c4; border-radius: 8px; background: #fff0ef; color: #a53b3b; font-size: 12px; }
.admin-page { min-height: 100vh; height: auto; background: #f5f7fa; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 32px; background: #fff; border-bottom: 1px solid #dfe7ed; }
.admin-header a { color: #147e83; font-size: 13px; font-weight: 750; text-decoration: none; }
.admin-header strong { color: #173647; }
.admin-main { display: block; width: min(1100px, calc(100vw - 32px)); margin: 0 auto; padding: 34px 0 70px; overflow: visible; }
.admin-main h1 { margin: 4px 0; font-size: 28px; font-weight: 800; letter-spacing: -.04em; }
.admin-main > p { margin: 0 0 24px; color: #657c89; font-size: 13px; }
.admin-list { display: grid; gap: 14px; }
.admin-org { padding: 20px; border: 1px solid #dfe7ed; border-radius: 12px; background: #fff; box-shadow: var(--shadow-panel); }
.admin-org-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.admin-org-heading h2 { margin: 0 0 3px; color: #173647; font-size: 18px; }
.admin-org-heading small { color: #81919e; font-family: ui-monospace, Consolas, monospace; }
.admin-status { padding: 5px 10px; border-radius: 99px; background: #eaf8f3; color: #167461; font-size: 11px; font-weight: 800; }
.admin-org-meta { display: flex; gap: 14px; margin: 13px 0; color: #607180; font-size: 12px; }
.admin-org-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; align-items: end; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #e8eef1; }
.admin-org-form label { margin: 0; color: #40586a; font-size: 12px; font-weight: 700; }
.admin-org-form input, .admin-org-form select { margin-top: 5px; }
.admin-org-form .admin-active { display: flex; align-items: center; gap: 7px; padding-bottom: 10px; white-space: nowrap; }
.admin-org-form .admin-active input { width: auto; margin: 0; }
.admin-org-form button { padding: 11px 16px; border-radius: 8px; background: #147e83; font-weight: 700; }
.admin-legacy { color: #607180; font-size: 12px; }
@media (max-width: 760px) { .admin-org-form { grid-template-columns: 1fr 1fr; } .workspace-name { display: none; } }
@media (max-width: 500px) { .admin-org-form { grid-template-columns: 1fr; } .account-card { padding: 24px; } .app-container > header nav { gap: 4px; } .app-container > header nav a { padding: 7px; font-size: 11px; } }
