/* Increment 1: approved Stitch dashboard, maintained locally without a CSS runtime. */
:root {
    color-scheme: light;
    --nav: #101f32;
    --nav-active: #203d59;
    --accent: #456b8c;
    --canvas: #f4f6f8;
    --ink: #102037;
    --muted: #526780;
    --line: #dfe6ee;
}
body { background: var(--canvas); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { background: var(--nav-active); color: white; border: 1px solid transparent; box-shadow: none; }
button:hover { background: var(--nav); }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #6c9ac1; outline-offset: 3px; }
input, select, textarea { background: white; color: var(--ink); border: 1px solid #cbd5e1; border-radius: 7px; }
input::placeholder { color: #74869b; }
input[type=checkbox] { accent-color: var(--nav-active); }
a { color: #1f5d99; }
h1, h2, h3 { color: var(--ink); }
.muted, .summary { color: var(--muted); }
.app-header { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 22px; height: 64px; padding: 0 24px; background: var(--nav); border-bottom: 1px solid #284057; color: white; }
.app-brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 750; letter-spacing: -.7px; }
.app-brand svg { width: 30px; height: 30px; color: #668ca9; }
.app-header p { margin: 0; padding-left: 22px; border-left: 1px solid #34465a; color: #b5c3d2; font-size: 13px; }
.app-sidebar { position: fixed; top: 64px; bottom: 0; left: 0; width: 256px; display: flex; flex-direction: column; background: var(--nav); color: #d4deea; border-right: 1px solid #294056; z-index: 30; }
.app-sidebar h2 { font-size: 10px; line-height: 1.5; text-transform: uppercase; letter-spacing: 1px; color: #a6b8cb; margin: 0 8px 12px; font-weight: 700; }
.sidebar-navigation { padding: 22px 12px 14px; overflow-y: auto; flex: 0 1 auto; min-height: 120px; }
.sidebar-navigation nav, .sidebar-actions { display: grid; gap: 3px; }
.sidebar-actions { border-top: 1px solid #2a3d52; margin-top: 10px; padding-top: 10px; }
.app-sidebar .sidebar-nav-button { width: 100%; min-height: 37px; display: flex; gap: 12px; align-items: center; text-align: left; background: transparent; color: #d4deea; border: 1px solid transparent; border-radius: 7px; padding: 8px 12px; font-size: 13px; font-weight: 550; }
.sidebar-nav-button svg { width: 17px; height: 17px; flex-shrink: 0; color: #9db1c7; }
.app-sidebar .sidebar-nav-button:hover { background: #1a3047; color: white; }
.app-sidebar .sidebar-nav-button[aria-current=page] { background: var(--nav-active); border-color: #34536e; color: white; }
.sidebar-filters { flex: 1 0 350px; min-height: 350px; overflow-y: auto; background: #0d1929; border-top: 1px solid #2a3d52; padding: 18px 18px 20px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.filter-heading h2 { margin: 0; }
.filter-count { font-size: 10px; border: 1px solid #34536e; color: #b8cee1; border-radius: 20px; padding: 2px 7px; white-space: nowrap; }
.sidebar-filter-field { margin-bottom: 14px; }
.sidebar-filter-field label { display: block; font-size: 12px; font-weight: 650; margin-bottom: 7px; color: #e0e8f0; }
.sidebar-filter-field input, .sidebar-filter-field select { width: 100%; min-width: 0; background: #13243a; color: #e0e8f0; border-color: #3b536b; padding: 7px; font-size: 12px; }
.sidebar-filter-field select[multiple] { height: 112px; padding: 5px; }
.sidebar-filter-field option { padding: 3px 5px; }
.sidebar-filter-field small { display: block; font-size: 10px; line-height: 1.5; color: #a6b8cb; margin-top: 5px; }
.app-sidebar .clear-filters { padding: 4px 0; border: 0; background: transparent; color: #c0d0df; font-size: 12px; text-decoration: underline; }
.app-sidebar .clear-filters:hover { color: white; }
main#mainContent { max-width: none; margin: 0 0 0 256px; padding: 30px 32px 90px; min-width: 0; min-height: calc(100vh - 64px); }
.dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 26px; margin-bottom: 28px; }
.dashboard-title { flex: 1; min-width: 190px; }
.dashboard-title h1 { font-size: 32px; line-height: 1.2; letter-spacing: -1px; margin: 0 0 12px; }
.dashboard-title p { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.kpi-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; flex: 2; min-width: 0; }
.kpi-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: white; border-radius: 12px; padding: 18px 14px; min-height: 104px; box-shadow: 0 1px 2px #10203708; }
.kpi-card > svg { width: 32px; height: 32px; color: var(--accent); flex-shrink: 0; background: #f1f5f9; padding: 5px; border-radius: 7px; }
.kpi-card > div { min-width: 0; }
.kpi-card strong { display: block; font-size: 24px; line-height: 1.2; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-card span { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.kpi-card small { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.dashboard-search { display: flex; align-items: center; gap: 12px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0 18px; margin-bottom: 28px; box-shadow: 0 1px 2px #10203706; }
.dashboard-search > svg { width: 21px; height: 21px; color: var(--accent); flex-shrink: 0; }
.dashboard-search #search { width: 100%; min-width: 0; border: 0; border-radius: 8px; padding: 17px 0; background: transparent; font-size: 14px; }
.dashboard-search #search:focus-visible { outline-offset: 0; }
.venue-directory { background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px #10203706; overflow: hidden; }
.directory-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 20px 10px; flex-wrap: wrap; }
.directory-toolbar > div:first-child { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.directory-toolbar .summary { font-size: 16px; color: var(--ink); margin: 0; white-space: nowrap; }
.active-filters { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.directory-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.view-switch { display: flex; border: 1px solid var(--line); background: #f1f5f9; border-radius: 8px; padding: 3px; }
.view-switch button { font-size: 11px; background: transparent; color: var(--muted); border: 0; padding: 6px 9px; }
.view-switch button[aria-pressed=true] { background: white; color: var(--nav); box-shadow: 0 1px 3px #10203714; }
.sort-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.sort-label select { font-size: 11px; padding: 7px; max-width: 180px; }
.selection-hint { margin: 0; padding: 4px 20px 16px; color: var(--muted); font-size: 11px; }
.venue-table-scroll { overflow-x: auto; }
.venue-table-heading, #venueList .venue-card { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(90px, .65fr) minmax(130px, .85fr) minmax(180px, 1.3fr) 45px; gap: 16px; min-width: 760px; }
.venue-table-heading { padding: 15px 20px; font-size: 12px; font-weight: 650; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: #354b63; background: #fafbfd; }
#venueList { display: block; margin: 0; gap: 0; }
#venueList .venue-card { position: relative; padding: 22px 20px; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: white; color: var(--ink); box-shadow: none; cursor: pointer; align-items: start; }
#venueList .venue-card:last-child { border-bottom: 0; }
#venueList .venue-card:hover { background: #f8fafc; }
#venueList .venue-card > .r32-venue-checkbox[type=checkbox] { position: absolute; left: 20px; top: 25px; float: none; width: 18px !important; height: 18px !important; min-width: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--nav-active); }
.venue-identity { min-width: 0; padding-left: 32px; }
#venueList h2 { margin: 0 0 7px; font-size: 14px; line-height: 1.5; }
.venue-open-button { font: inherit; font-weight: 650; padding: 0; background: transparent; color: var(--ink); text-align: left; border: 0; }
.venue-open-button:hover { background: transparent; color: var(--blue, #245f93); text-decoration: underline; }
.venue-address, .venue-parent { font-size: 11px; color: var(--muted); line-height: 1.6; overflow-wrap: anywhere; }
.venue-parent { margin-top: 4px; }
.venue-area-cell { padding-top: 2px; }
.area { display: inline-block; background: #edf4fa; color: #234766; border: 1px solid #b7cde0; border-radius: 20px; padding: 3px 9px; font-size: 11px; white-space: normal; }
.venue-associated-acts { font-size: 12px; margin: 2px 0; overflow-wrap: anywhere; }
.venue-contact-cell { min-width: 0; }
.venue-contact-line { display: flex; flex-direction: column; margin-bottom: 7px; font-size: 11px; overflow-wrap: anywhere; }
.venue-contact-line:last-child { margin-bottom: 0; }
.contact-method-label { font-size: 9px; color: var(--muted); font-weight: 600; }
.venue-contact-line a { text-decoration: none; }
.venue-contact-line a:hover { text-decoration: underline; }
.venue-delete-button { padding: 6px; background: transparent; border: 1px solid transparent; color: #70869c; border-radius: 6px; }
.venue-delete-button svg { width: 18px; height: 18px; display: block; }
.venue-delete-button:hover { background: #fff0ef; color: #a42d2d; border-color: #f2ceca; }
.mailing-marker { display: inline-block; margin-top: 7px; padding: 1px 6px; border-radius: 4px; background: #edf4fa; color: #315e83; font-size: 10px; }
.venue-booking-info { font-size: 10px; margin: 8px 0 0; line-height: 1.5; }
#venueList .venue-card.venue-booking-future { background: #f2faf5; box-shadow: inset 3px 0 #61a57b; }
#venueList .venue-card.venue-booking-past { background: #fffaf0; box-shadow: inset 3px 0 #c49e49; }
#venueList .venue-booking-future:hover { background: #eaf6ef; }
#venueList .venue-booking-past:hover { background: #fff5de; }
.venue-booking-future .venue-booking-info { color: #276141; }
.venue-booking-past .venue-booking-info { color: #795921; }
#venueList.is-compact .venue-card { padding-top: 12px; padding-bottom: 12px; }
#venueList.is-compact .venue-card > .r32-venue-checkbox[type=checkbox] { top: 16px; }
#venueList.is-compact .venue-address, #venueList.is-compact .venue-parent { display: none; }
.detail-section, .canvass-candidate, .canvass-row, .canvass-list-card, .loading, .empty, .error, .success { background: white; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.detail-section h3, .section-heading, .record { border-color: var(--line); }
.secondary-button { background: white; color: var(--nav-active); border: 1px solid #cbd5e1; }
.secondary-button:hover { background: #eaf0f6; color: var(--nav); }
.danger-button { background: #9b3030; color: white; }
.danger-button:hover { background: #792323; }
.error { color: #a42d2d; }
.success { color: #276141; }
#r3Mailer { max-width: 1200px; padding: 0; }
#r3Mailer .r32-layout aside, #r3Mailer .r32-compose { background: white; border: 1px solid var(--line); border-radius: 8px; }
.r32-recipient { border-color: var(--line); }
#emailConfigButton { background: var(--nav-active); font-size: 12px; padding: 10px 14px; }
#emailConfigPanel { color: var(--ink); font-family: inherit; }
#emailConfigPanel h2 { color: var(--ink); }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 10001; background: white; padding: 10px 16px; border-radius: 6px; }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 1800px) {
    main#mainContent { padding-left: 44px; padding-right: 44px; }
    .kpi-card { padding: 20px; }
}
@media (max-width: 1350px) {
    .dashboard-heading { align-items: stretch; flex-direction: column; }
    .dashboard-title p { max-width: none; }
    .kpi-strip { flex: auto; }
    .kpi-card { min-height: 92px; }
}
@media (max-width: 1050px) and (min-width: 761px) {
    .app-sidebar { width: 220px; }
    .sidebar-navigation { padding-left: 8px; padding-right: 8px; }
    .sidebar-filters { padding-left: 14px; padding-right: 14px; }
    main#mainContent { margin-left: 220px; padding: 24px 22px 90px; }
}
@media (max-width: 760px) {
    .app-header { padding: 0 16px; gap: 14px; }
    .app-header p { font-size: 10px; padding-left: 14px; }
    .app-brand { font-size: 22px; gap: 6px; }
    .app-brand svg { width: 24px; }
    .app-sidebar { position: relative; top: auto; bottom: auto; width: 100%; z-index: auto; display: block; }
    .sidebar-navigation { padding: 16px; min-height: 0; overflow: visible; }
    .sidebar-navigation nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .sidebar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .app-sidebar .sidebar-nav-button { font-size: 12px; padding: 7px 8px; min-width: 0; }
    .sidebar-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; min-height: 0; overflow: visible; padding: 16px; }
    .filter-heading { grid-column: 1 / -1; margin-bottom: 12px; }
    .sidebar-filter-field { min-width: 0; margin-bottom: 8px; }
    .sidebar-filter-field select[multiple] { height: 90px; }
    .clear-filters { grid-column: 2; justify-self: start; align-self: end; }
    main#mainContent { margin: 0; padding: 24px 14px 80px; min-height: 0; }
    .dashboard-heading { gap: 20px; margin-bottom: 20px; }
    .dashboard-title h1 { font-size: 28px; }
    .dashboard-title p { font-size: 13px; }
    .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kpi-card { padding: 14px 12px; min-height: 90px; }
    .kpi-card strong { font-size: 23px; }
    .dashboard-search { margin-bottom: 18px; padding: 0 12px; }
    .dashboard-search #search { font-size: 12px; padding: 15px 0; }
    .directory-toolbar { padding: 16px 14px 8px; gap: 12px; }
    .directory-controls { gap: 10px; width: 100%; justify-content: space-between; }
    .selection-hint { padding-left: 14px; padding-right: 14px; font-size: 10px; }
    .venue-table-heading { display: none; }
    #venueList .venue-card { min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 18px 14px; }
    .venue-identity { grid-column: 1 / -1; padding-right: 30px; }
    .venue-area-cell, .venue-associated-acts { padding-left: 32px; }
    .venue-contact-cell { grid-column: 1 / -1; padding-left: 32px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
    .venue-contact-line { max-width: 100%; margin: 0; }
    .venue-delete-cell { position: absolute; right: 10px; top: 14px; }
    #venueList .venue-card > .r32-venue-checkbox[type=checkbox] { left: 14px; top: 22px; }
    .venue-table-scroll { overflow: visible; }
    .venue-directory { overflow: hidden; }
    .venue-associated-acts { font-size: 11px; }
    #venueList.is-compact .venue-card > .r32-venue-checkbox[type=checkbox] { top: 16px; }
    .view-switch button { padding: 6px 8px; }
    .sort-label select { max-width: 145px; }
    .sort-label { gap: 5px; }
}
@media print {
    .app-sidebar, .skip-link, #emailConfigButton, #emailConfigOverlay { display: none !important; }
    main#mainContent { margin: 0; padding: 0; min-height: 0; }
    body, main, #canvassPrintArea { background: white !important; color: #111 !important; }
    #canvassPrintArea * { color: #111 !important; box-shadow: none !important; }
}

@media (max-width: 760px) {
    .area-filter-field { grid-column: 1; grid-row: 2 / 4; }
}

/* Override older ID-level widths while keeping the existing form styles. */
#areaFilter { min-width: 0; }
#emailConfigButton { width: auto; max-width: calc(100vw - 24px); }
@media (max-width: 760px) {
    .venue-contact-cell { display: block; }
    .venue-contact-line { margin-bottom: 7px; }
}
/* Increment 2 controls preserve the existing responsive directory. */
[name="contactChannel"] { width:auto!important; min-width:18px; min-height:18px; margin-right:6px; }
.sidebar-filter-field legend { font-weight:600; }
#csvUploadView, #deletedVenuesView { min-width:0; }
#csvUploadView > button, #deletedVenuesView button { margin:8px 8px 8px 0; }
#csvUploadView code { overflow-wrap:anywhere; }
.csv-table-scroll { overflow:auto; max-width:100%; margin:16px 0; }
.csv-table-scroll table { border-collapse:collapse; width:100%; }
.csv-table-scroll th,.csv-table-scroll td { padding:10px; text-align:left; border-bottom:1px solid #ddd; overflow-wrap:anywhere; min-width:90px; }
.r3-saved-list { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:12px; }
.r3-saved-list p { margin:6px 0; }
#r3ListManager { margin:16px 0; }
#r3ListManager input { box-sizing:border-box; max-width:100%; }
.r3-list-members { max-height:360px; overflow:auto; margin:12px 0; border:1px solid #dbe3ec; }
.r3-list-member { display:flex!important; gap:10px; align-items:flex-start; padding:10px; border-bottom:1px solid #dbe3ec; }
.r3-list-member[hidden] { display:none!important; }
.r3-list-member input { width:20px!important; height:20px; flex:0 0 20px; }
.r3-list-member span { display:block; overflow-wrap:anywhere; }
.kpi-action { color:var(--ink); text-align:left; cursor:pointer; width:100%; }
.kpi-action:hover { background:#f1f5f9; border-color:var(--accent); }
#r3ComposeLayout[hidden] { display:none; }
