*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: 'Inter', -apple-system, sans-serif; background: #f0f6ff; color: #0f172a; min-height: 100vh; display: flex; flex-direction: column; }

  /* ── Navigation ─────────────────────────────────────────────────────── */
  .nav {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
  }
  .nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
  }
  .nav-coa {
    width: 38px;
    height: 38px;
    background: #1a3c7a;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .nav-coa .material-icons { font-size: 20px; color: #fff; }
  .nav-name { font-size: 15px; font-weight: 800; color: #1a3c7a; }
  .nav-sub  { font-size: 10px; color: #64748b; margin-top: 1px; }
  .nav-links { display: flex; align-items: center; gap: 8px; }
  .nav-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s;
  }
  .nav-btn-outline { border: 1.5px solid #1a3c7a; color: #1a3c7a; }
  .nav-btn-outline:hover { background: #f0f6ff; }
  .nav-btn-solid { background: #1a3c7a; color: #fff; border: none; }
  .nav-btn-solid:hover { background: #152f63; }

  /* ── Hero ───────────────────────────────────────────────────────────── */
  .hero {
    position: relative;
    background-color: #1a3c7a;
    background-image: url('/tra/themes/img/cert-bg-wildlife.jpg');
    background-size: cover;
    background-position: center 45%;
    padding: 72px 24px 80px;
    text-align: center;
    color: #fff;
    overflow: hidden;
  }
  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,35,80,.75) 0%, rgba(15,35,80,.88) 100%);
  }
  .hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
  .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
  }
  .hero h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.5px;
    margin-bottom: 14px;
    text-shadow: 0 2px 12px rgba(0,0,0,.3);
  }
  .hero p {
    font-size: 16px;
    color: rgba(255,255,255,.85);
    margin-bottom: 32px;
    line-height: 1.65;
  }

  /* Search widget */
  .search-card {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 16px 48px rgba(0,0,0,.25);
  }
  .search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
  }
  .search-input {
    flex: 1;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: #0f172a;
    transition: border-color .15s;
  }
  .search-input:focus { border-color: #1a3c7a; }
  .search-input::placeholder { color: #94a3b8; }
  .search-btn {
    background: #1a3c7a;
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: background .15s;
  }
  .search-btn:hover { background: #152f63; }
  .search-county {
    width: 100%;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    color: #374151;
    background: #f8fafc;
    transition: border-color .15s;
  }
  .search-county:focus { border-color: #1a3c7a; background: #fff; }
  .or-divider {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    margin: 10px 0;
    position: relative;
  }
  .or-divider::before, .or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 42%;
    height: 1px;
    background: #e2e8f0;
  }
  .or-divider::before { left: 0; }
  .or-divider::after  { right: 0; }
  .qr-btn {
    width: 100%;
    background: #f8fafc;
    color: #374151;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    padding: 11px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s;
  }
  .qr-btn:hover { background: #f1f5f9; }

  /* ── Stats strip ────────────────────────────────────────────────────── */
  .stats-strip {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
  }
  .stats-inner {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 0;
  }
  .stat-item {
    padding: 24px 32px;
    text-align: center;
    border-right: 1px solid #e2e8f0;
  }
  .stat-item:last-child { border-right: none; }
  .stat-num {
    font-size: 30px;
    font-weight: 800;
    color: #1a3c7a;
    line-height: 1;
  }
  .stat-label { font-size: 12px; color: #64748b; margin-top: 4px; }

  /* ── Class cards (A-F) ──────────────────────────────────────────────── */
  .classes-section { background: #fff; padding: 48px 24px 16px; }
  .section-header { max-width: 960px; margin: 0 auto 28px; }
  .section-title { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 6px; }
  .section-sub   { font-size: 13px; color: #64748b; }
  .classes-grid {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
  }
  .class-card {
    padding: 24px 18px 20px;
    position: relative;
    cursor: default;
    transition: filter .15s;
    border-right: 1px solid rgba(255,255,255,.2);
  }
  .class-card:last-child { border-right: none; }
  .class-card:hover { filter: brightness(1.07); }
  .class-label { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 8px; }
  .class-desc   { font-size: 11px; color: rgba(255,255,255,.85); line-height: 1.5; }
  .class-arrow  {
    position: absolute;
    bottom: 16px;
    right: 14px;
    width: 24px;
    height: 24px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .class-arrow .material-icons { font-size: 14px; color: #fff; }
  /* TRA actual colours from tra.go.ke */
  .class-a { background: #c8902b; }   /* amber/gold */
  .class-b { background: #d44c5c; }   /* coral red */
  .class-c { background: #a03a9c; }   /* purple/magenta */
  .class-d { background: #2b6db5; }   /* blue */
  .class-e { background: #1a9e9e; }   /* teal */
  .class-f { background: #2d3748; }   /* dark slate */

  /* ── Main content ────────────────────────────────────────────────────── */
  .main {
    flex: 1;
    padding: 40px 24px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
  }

  /* Results */
  .results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .results-title { font-size: 16px; font-weight: 700; color: #0f172a; }
  .results-count { font-size: 13px; color: #64748b; }
  .results-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px,1fr)); gap: 14px; }

  .result-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 6px rgba(0,0,0,.05);
    transition: box-shadow .15s;
  }
  .result-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
  .result-card-name { font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 4px; }
  .result-card-meta { font-size: 12px; color: #64748b; margin-bottom: 6px; }
  .result-card-ref  { font-family: 'Courier New', monospace; font-size: 12px; color: #1a3c7a; font-weight: 600; }
  .result-card-exp  { font-size: 11px; color: #94a3b8; margin-top: 3px; }
  .result-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid #f1f5f9; }

  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 12px; font-size: 11px; font-weight: 700; }
  .badge-active   { background: #dcfce7; color: #15803d; }
  .badge-expiring { background: #fef9c3; color: #b45309; }
  .badge-expired  { background: #fee2e2; color: #dc2626; }

  .verify-link { font-size: 12px; color: #1a3c7a; text-decoration: none; font-weight: 600; }
  .verify-link:hover { text-decoration: underline; }

  /* No results */
  .no-results {
    background: #fff;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    border: 1px solid #e2e8f0;
  }
  .no-results-icon { font-size: 48px; color: #cbd5e1; margin-bottom: 12px; }
  .no-results h3 { font-size: 17px; font-weight: 700; color: #374151; margin-bottom: 6px; }
  .no-results p  { font-size: 13px; color: #94a3b8; }
  .no-results a  { color: #dc2626; font-weight: 600; }

  /* QR scanner placeholder */
  #qr-scanner {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 16px;
    margin-top: 10px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
  }
  #qr-scanner[hidden] { display: none; }

  /* ── Footer ─────────────────────────────────────────────────────────── */
  .footer {
    background: #1a3c7a;
    color: rgba(255,255,255,.7);
    padding: 28px 24px;
    text-align: center;
    font-size: 12px;
    margin-top: auto;
  }
  .footer a { color: rgba(255,255,255,.85); text-decoration: none; }
  .footer a:hover { text-decoration: underline; }
  .footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; flex-wrap: wrap; }

  @media (max-width: 768px) {
    .hero h1 { font-size: 26px; }
    .classes-grid { grid-template-columns: repeat(3, 1fr); }
    .stats-inner { grid-template-columns: repeat(3, 1fr); }
    .search-row { flex-direction: column; }
    .nav-links .nav-btn-outline { display: none; }
  }
  @media (max-width: 480px) {
    .classes-grid { grid-template-columns: repeat(2, 1fr); }
  }

  .icon-xs { font-size: 12px; }
  .icon-sm { font-size: 17px; }
  .qr-placeholder-icon { font-size: 32px; color: #94a3b8; display: block; margin-bottom: 8px; }
  .qr-camera-note { color: #1a3c7a; font-weight: 600; font-size: 11px; margin-top: 6px; display: block; }
  .no-results-icon .material-icons { font-size: 48px; color: #cbd5e1; }
  .badge .material-icons { font-size: 11px; }
