
    :root {
      --color-primary: #1D351C;
      --color-primary-hover: #142614;
      --color-secondary: #6C7C37;
      --color-accent: #DAE066;
      --color-accent-hover: #CBD250;
      --color-accent-text: #142413;
      --color-tertiary: #2E4A3E;

      --bg-canvas: #F9FAF5;
      --bg-surface: #FFFFFF;
      --bg-surface-elevated: #F3F5EC;
      --bg-surface-accent: #EBF0DE;
      --bg-dark-banner: #142213;

      --text-main: #142213;
      --text-muted: #4A5646;
      --text-light: #71806D;

      --border-subtle: #E2E8D8;
      --border-prominent: #CAD4BE;

      --badge-claimed-bg: #EAF7EC;
      --badge-claimed-text: #1B5E20;
      --badge-claimed-border: #A3D9A5;

      --badge-queued-bg: #FDF6E7;
      --badge-queued-text: #8A5311;
      --badge-queued-border: #F3D9A2;

      --badge-requested-bg: #EBF5FF;
      --badge-requested-text: #1E40AF;
      --badge-requested-border: #93C5FD;

      --badge-unassigned-bg: #FEF2F2;
      --badge-unassigned-text: #991B1B;
      --badge-unassigned-border: #FECACA;

      --font-headline: 'Playfair Display', Georgia, serif;
      --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
      --font-mono: 'JetBrains Mono', monospace;

      --radius-sm: 6px;
      --radius-md: 12px;
      --radius-lg: 20px;
      --radius-full: 9999px;

      --shadow-sm: 0 2px 6px rgba(29, 53, 28, 0.04);
      --shadow-md: 0 8px 24px rgba(29, 53, 28, 0.08);
      --shadow-lg: 0 16px 42px rgba(29, 53, 28, 0.12);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      background-color: var(--bg-canvas);
      color: var(--text-main);
      font-family: var(--font-body);
      -webkit-font-smoothing: antialiased;
      line-height: 1.5;
    }

    .svg-icon {
      display: inline-block;
      vertical-align: middle;
      flex-shrink: 0;
    }

    /* Global 5-Portal Ecosystem Bar */
    .ecosystem-nav {
      background-color: #0E190D;
      color: #FFFFFF;
      padding: 10px 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 12.5px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      flex-wrap: wrap;
      gap: 12px;
    }
    .ecosystem-brand {
      font-weight: 700;
      letter-spacing: 0.06em;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11.5px;
      text-transform: uppercase;
      color: #CAD4BE;
    }
    .ecosystem-pills {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
    }
    .ecosystem-pill {
      color: rgba(255,255,255,0.75);
      text-decoration: none;
      padding: 5px 13px;
      border-radius: var(--radius-full);
      font-weight: 600;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: all 0.2s;
    }
    .ecosystem-pill:hover {
      color: #FFFFFF;
      background: rgba(255,255,255,0.1);
    }
    .ecosystem-pill.active {
      color: var(--bg-dark-banner);
      background-color: var(--color-accent);
      font-weight: 700;
    }

    /* Portal Header */
    .portal-header {
      background: var(--bg-surface);
      border-bottom: 1px solid var(--border-subtle);
      padding: 16px 32px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 100;
      flex-wrap: wrap;
      gap: 16px;
    }
    .partner-brand {
      display: flex;
      align-items: center;
      gap: 14px;
    }
    .partner-brand img {
      height: 42px;
      width: auto;
    }
    .partner-brand h1 {
      font-family: var(--font-headline);
      font-size: 20px;
      font-weight: 700;
      color: var(--color-primary);
      line-height: 1.15;
    }
    .partner-brand span {
      font-size: 12px;
      color: var(--text-muted);
      display: block;
    }
    .view-switcher {
      display: flex;
      background: var(--bg-surface-elevated);
      padding: 4px;
      border-radius: var(--radius-full);
      border: 1px solid var(--border-prominent);
    }
    .view-btn {
      padding: 8px 16px;
      font-size: 12.5px;
      font-weight: 700;
      border: none;
      background: none;
      cursor: pointer;
      border-radius: var(--radius-full);
      color: var(--text-muted);
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .view-btn.active {
      background: var(--color-primary);
      color: #FFFFFF;
    }

    .container {
      max-width: 1440px;
      margin: 0 auto;
      padding: 28px 32px;
    }

    /* Google Maps API & Active Field Agent Bar */
    .ops-config-ribbon {
      background: var(--bg-surface);
      border: 1px solid var(--border-prominent);
      border-radius: var(--radius-md);
      padding: 14px 20px;
      margin-bottom: 24px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 16px;
      box-shadow: var(--shadow-sm);
    }

    .agent-selector-group {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .agent-select {
      padding: 7px 12px;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border-prominent);
      background: var(--bg-surface-elevated);
      font-family: var(--font-body);
      font-size: 13px;
      font-weight: 700;
      color: var(--color-primary);
      outline: none;
    }

    .gmaps-api-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: var(--badge-claimed-bg);
      border: 1px solid var(--badge-claimed-border);
      color: var(--badge-claimed-text);
      padding: 6px 12px;
      border-radius: var(--radius-full);
      font-size: 11.5px;
      font-family: var(--font-mono);
      font-weight: 600;
      cursor: pointer;
    }

    /* Ledger State Machine Architecture Explainer */
    .state-machine-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-prominent);
      border-radius: var(--radius-md);
      padding: 20px 24px;
      margin-bottom: 24px;
      box-shadow: var(--shadow-sm);
    }

    .state-machine-grid {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 12px;
      margin-top: 14px;
    }

    .state-step-box {
      background: var(--bg-surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      padding: 12px 14px;
      position: relative;
    }

    .state-step-box strong {
      display: block;
      font-size: 12px;
      font-family: var(--font-mono);
      margin-bottom: 4px;
    }

    .state-step-box p {
      font-size: 11.5px;
      color: var(--text-muted);
      line-height: 1.45;
    }

    /* KPI Row */
    .kpi-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 18px;
      margin-bottom: 24px;
    }
    .kpi-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 20px;
      box-shadow: var(--shadow-sm);
    }
    .kpi-label {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .kpi-val {
      font-family: var(--font-headline);
      font-size: 32px;
      font-weight: 700;
      color: var(--color-primary);
      line-height: 1.1;
      margin-bottom: 8px;
    }
    .kpi-delta {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11.5px;
      font-weight: 700;
      padding: 3px 9px;
      border-radius: var(--radius-full);
    }
    .kpi-delta.pos {
      background: var(--badge-claimed-bg);
      color: var(--badge-claimed-text);
    }
    .kpi-delta.warn {
      background: var(--badge-queued-bg);
      color: var(--badge-queued-text);
    }

    /* Map & Analytics Row */
    .analytics-row {
      display: grid;
      grid-template-columns: 7fr 5fr;
      gap: 20px;
      margin-bottom: 26px;
    }
    .chart-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 22px;
      box-shadow: var(--shadow-sm);
    }
    .card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
      flex-wrap: wrap;
      gap: 8px;
    }
    .card-head h3 {
      font-family: var(--font-headline);
      font-size: 18px;
      font-weight: 700;
      color: var(--color-primary);
    }
    #botswana-map {
      height: 360px;
      border-radius: var(--radius-sm);
      overflow: hidden;
      border: 1px solid var(--border-prominent);
    }

    /* Stacked Chart */
    .velocity-chart {
      height: 360px;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding-top: 16px;
    }
    .chart-bars-container {
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      height: 270px;
      border-bottom: 2px solid var(--border-subtle);
      padding-bottom: 8px;
    }
    .chart-bar-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 44px;
      gap: 6px;
    }
    .chart-bar-stack {
      width: 100%;
      display: flex;
      flex-direction: column-reverse;
      border-radius: 4px;
      overflow: hidden;
    }
    .stack-segment-1 { background: var(--color-primary); }
    .stack-segment-2 { background: var(--color-secondary); }
    .stack-segment-3 { background: var(--color-accent); }
    .chart-bar-label {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
    }
    .chart-legend {
      display: flex;
      justify-content: center;
      flex-wrap: wrap;
      gap: 16px;
      margin-top: 14px;
      font-size: 11.5px;
      color: var(--text-muted);
    }
    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 2px;
      display: inline-block;
      margin-right: 5px;
    }

    /* Responsive Table Wrapper (per modern-web-guidance: responsive-table) */
    .table-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 22px;
      box-shadow: var(--shadow-sm);
      margin-bottom: 28px;
    }
    .table-toolbar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 18px;
      flex-wrap: wrap;
      gap: 12px;
    }
    .filter-tabs {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }
    .filter-tab {
      padding: 6px 14px;
      background: var(--bg-surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-full);
      font-size: 12px;
      font-weight: 700;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.2s;
    }
    .filter-tab.active {
      background: var(--color-primary);
      color: #FFFFFF;
    }

    .table-wrapper {
      overflow: auto;
      max-inline-size: 100%;
      max-block-size: min(560px, 80vh);
      container-type: inline-size;
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
    }

    table.data-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0;
      font-size: 13px;
    }

    table.data-table thead {
      position: sticky;
      inset-block-start: 0;
      z-index: 1;
    }

    table.data-table th {
      background: var(--bg-surface-elevated);
      padding: 12px 14px;
      text-align: left;
      font-weight: 700;
      color: var(--color-primary);
      border-bottom: 1px solid var(--border-subtle);
    }

    table.data-table tbody th {
      position: sticky;
      inset-inline-start: 0;
      background: var(--bg-surface);
      font-family: var(--font-mono);
    }

    table.data-table td {
      padding: 14px;
      border-bottom: 1px solid var(--border-subtle);
      vertical-align: middle;
      background: var(--bg-surface);
    }

    @container (width < 600px) {
      table.data-table, table.data-table thead, table.data-table tbody, table.data-table tr, table.data-table th, table.data-table td {
        display: block;
      }
      table.data-table thead {
        display: none;
      }
      table.data-table tr {
        margin-block-end: 1rem;
        border: 1px solid var(--border-prominent);
      }
      table.data-table tbody th {
        position: sticky;
        inset-block-start: 0;
        z-index: 2;
        background: var(--bg-surface-elevated);
      }
      table.data-table {
        --label-2: "Beneficiary / Initiative";
        --label-3: "Location & Coordinates";
        --label-4: "Media Proof";
        --label-5: "Impact Points";
        --label-6: "Ledger State";
        --label-7: "Action";
      }
      table.data-table td:nth-child(2)::before { content: var(--label-2) ": " / var(--label-2); font-weight: 700; }
      table.data-table td:nth-child(3)::before { content: var(--label-3) ": " / var(--label-3); font-weight: 700; }
      table.data-table td:nth-child(4)::before { content: var(--label-4) ": " / var(--label-4); font-weight: 700; }
      table.data-table td:nth-child(5)::before { content: var(--label-5) ": " / var(--label-5); font-weight: 700; }
      table.data-table td:nth-child(6)::before { content: var(--label-6) ": " / var(--label-6); font-weight: 700; }
      table.data-table td:nth-child(7)::before { content: var(--label-7) ": " / var(--label-7); font-weight: 700; }
    }

    .table-thumb {
      width: 42px;
      height: 42px;
      border-radius: 6px;
      object-fit: cover;
      border: 1px solid var(--border-subtle);
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: var(--radius-full);
      font-size: 11px;
      font-weight: 700;
      font-family: var(--font-mono);
    }
    .status-badge.locked {
      background: var(--badge-claimed-bg);
      color: var(--badge-claimed-text);
      border: 1px solid var(--badge-claimed-border);
    }
    .status-badge.pool {
      background: #F3F5EC;
      color: var(--color-primary);
      border: 1px solid var(--border-prominent);
    }
    .status-badge.requested {
      background: var(--badge-requested-bg);
      color: var(--badge-requested-text);
      border: 1px solid var(--badge-requested-border);
    }
    .status-badge.unassigned {
      background: var(--badge-unassigned-bg);
      color: var(--badge-unassigned-text);
      border: 1px solid var(--badge-unassigned-border);
    }
    .status-badge.queued {
      background: var(--badge-queued-bg);
      color: var(--badge-queued-text);
      border: 1px solid var(--badge-queued-border);
    }

    .action-btn-sm {
      background: var(--bg-surface-elevated);
      border: 1px solid var(--border-prominent);
      padding: 7px 13px;
      border-radius: var(--radius-sm);
      font-size: 12px;
      font-weight: 700;
      color: var(--color-primary);
      cursor: pointer;
      transition: all 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .action-btn-sm:hover {
      background: var(--color-primary);
      color: #FFFFFF;
    }

    /* =========================================================================
       UNIFIED FIELD LOGGER STYLES (SHARED BY MOBILE PWA & DESKTOP MODAL)
       ========================================================================= */
    #mobile-view-wrapper {
      display: none;
      max-width: 460px;
      margin: 0 auto;
      background: var(--bg-surface);
      border-radius: 34px;
      border: 8px solid #1E2B1D;
      box-shadow: 0 25px 60px rgba(0,0,0,0.22);
      overflow: hidden;
    }
    .mobile-screen-header {
      background: var(--bg-dark-banner);
      color: #FFFFFF;
      padding: 16px 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .pwa-badge {
      background: var(--color-accent);
      color: var(--bg-dark-banner);
      font-size: 10.5px;
      font-weight: 800;
      padding: 3px 9px;
      border-radius: var(--radius-full);
      text-transform: uppercase;
      cursor: pointer;
    }
    .form-mode-tabs {
      display: flex;
      background: #233322;
      padding: 4px;
      margin: 12px 16px 0;
      border-radius: var(--radius-md);
    }
    .form-mode-btn {
      flex: 1;
      padding: 9px;
      font-size: 12px;
      font-weight: 700;
      background: none;
      border: none;
      color: rgba(255,255,255,0.7);
      cursor: pointer;
      border-radius: 8px;
      text-align: center;
    }
    .form-mode-btn.active {
      background: var(--color-primary);
      color: #FFFFFF;
    }
    .logger-scroll-body {
      padding: 18px;
      max-height: 720px;
      overflow-y: auto;
    }
    .form-card {
      background: var(--bg-surface);
      border: 1px solid var(--border-prominent);
      border-radius: var(--radius-md);
      padding: 16px;
      margin-bottom: 14px;
      box-shadow: var(--shadow-sm);
    }
    .form-card-title {
      font-size: 12px;
      font-weight: 800;
      color: var(--color-primary);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }
    .input-group { margin-bottom: 12px; }
    .input-label {
      display: block;
      font-size: 12px;
      font-weight: 700;
      color: var(--text-muted);
      margin-bottom: 5px;
    }
    .text-input {
      width: 100%;
      padding: 9px 12px;
      font-family: var(--font-body);
      font-size: 13.5px;
      border: 1px solid var(--border-prominent);
      border-radius: var(--radius-sm);
      background: var(--bg-surface);
      outline: none;
    }
    .mono-input {
      font-family: var(--font-mono);
      font-weight: 600;
    }
    .tier-cards {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }
    .tier-card {
      border: 1.5px solid var(--border-prominent);
      border-radius: var(--radius-sm);
      padding: 10px;
      cursor: pointer;
      background: var(--bg-surface-elevated);
      transition: all 0.2s;
      position: relative;
    }
    .tier-card.selected {
      border-color: var(--color-primary);
      background: #FFFFFF;
      box-shadow: 0 0 0 2px var(--color-accent);
    }
    .tier-card.locked-by-admin {
      opacity: 0.48;
      cursor: not-allowed;
      background: #EFEFEF;
      border-style: dashed;
    }
    .tier-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--color-primary);
    }
    .tier-pts {
      font-size: 11px;
      font-weight: 600;
      color: var(--color-secondary);
    }
    .tier-quota {
      font-size: 10px;
      font-family: var(--font-mono);
      color: var(--text-muted);
      margin-top: 3px;
    }

    .media-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .dropzone {
      border: 1.5px solid var(--color-secondary);
      border-radius: var(--radius-sm);
      padding: 4px;
      text-align: center;
      background: #FFFFFF;
    }
    .dropzone img {
      width: 100%;
      height: 84px;
      object-fit: cover;
      border-radius: 4px;
    }
    .dropzone-label {
      font-size: 10.5px;
      font-weight: 700;
      color: var(--color-primary);
      margin-top: 4px;
    }

    .voice-recorder-box {
      background: var(--bg-surface-elevated);
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-md);
      padding: 12px;
      text-align: center;
    }
    .mic-record-btn {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--color-primary);
      color: #FFFFFF;
      border: none;
      cursor: pointer;
      margin: 6px auto;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 0 5px rgba(218, 224, 102, 0.4);
    }
    .transcription-box {
      background: #FFFFFF;
      border: 1px solid var(--border-prominent);
      border-radius: var(--radius-sm);
      padding: 10px;
      font-size: 12.5px;
      color: var(--text-main);
      text-align: left;
      margin-top: 8px;
      min-height: 58px;
    }

    /* Modals */
    .modal-backdrop {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(20, 34, 19, 0.72);
      backdrop-filter: blur(4px);
      z-index: 1000;
      align-items: center;
      justify-content: center;
      padding: 20px;
    }
    .modal-box {
      background: #FFFFFF;
      width: 100%;
      max-width: 720px;
      max-height: 92vh;
      overflow-y: auto;
      border-radius: var(--radius-md);
      padding: 28px;
      box-shadow: var(--shadow-lg);
      border: 1px solid var(--border-prominent);
    }
  