*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --primary:   #18457E;
      --secondary: #ffcc32;
      --text:      #4A4A49;
      --accent:    #132B51;
      --gray-lt:   #C8C8C8;
      --gray-bg:   #E7E9E8;
      --orange:    #ED9D04;
      --red:       #EF5122;
      --indigo:    #495B9B;
      --teal:      #009F9E;
      --sky:       #ACCBEB;
      --white:     #FFFFFF;
      --purple:    #A078B1;
      --text-muted: #8A8A88;

        --header-h: 50px;        
        --header-h-tablet: 58px; 
        --header-h-mobile: 54px; 
        --header-h-small: 50px;  
        --header-h-landscape: 47px; 

        --panel-h: 234px;        

        --section-pad: 18px 18px 36px;      
        --table-pad: 23px 23px 32px;        
        --table-pad-tablet: 14px 14px 22px; 
        --table-pad-mobile: 11px 11px 18px; 
        --table-pad-top: 12px;      
        --table-pad-side: 23px;
        --table-pad-bottom: 32px;

        --table-pad-top-tablet: 8px;
        --table-pad-side-tablet: 14px;
        --table-pad-bottom-tablet: 22px;
        --table-pad-top-mobile: 6px;
        --table-pad-side-mobile: 11px;
        --table-pad-bottom-mobile: 18px;
    }

    @font-face {
        font-family: 'Geometria';
        src: url("/static/fonts/Geometria/Geometria.9a696efdf56e.woff2") format('woff2'),
            url("/static/fonts/Geometria/Geometria.cb688af8daac.woff") format('woff');
        font-weight: normal;
        font-style: normal;
        font-display: swap;
    }

    html { 
      scroll-behavior: smooth;
      height: 100%;
      overflow-x: hidden;
      font-size: 90%;
    }

    body {
      font-family: 'Calibri';
      background: var(--gray-bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      margin: 0;
      padding: 0;
      overflow-x: hidden;
      overflow-y: hidden;
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
    }

    .bg-pattern {
      position: fixed;
      inset: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      pointer-events: none;
      background-color: #F6F9FC;
    }

    .bg-pattern svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    /* ── HEADER ─────────────────────────────── */
    header {
      background: var(--accent);
      position: sticky;
      top: 0;
      z-index: 100;
      overflow-y: hidden;
      box-shadow: 0 2px 24px rgba(19,43,81,.35);
      transition: transform 0.3s ease;
    }

    .header-inner {
      max-width: 100%;
      margin: 0 auto;
      display: flex;
      gap: 24px;
      padding: 0 32px;
      height: var(--header-h);
      align-items: center;
    }

    .notice-text {
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--red);
      letter-spacing: .02em;
    }

    /* Icon / Logo */
    .logo {
      display: flex;
      align-items: center;
      gap: 12px;
      text-decoration: none;
      flex-shrink: 0;
    }

    .logo-img {
      width: 42px;
      height: 42px;
      object-fit: contain;
      border-radius: 10px;
    }

    .logo-text {
      font-family: 'Calibri';
      font-size: 1.25rem;
      font-weight: 700;
      color: var(--white);
      letter-spacing: .02em;
    }

    .logo-text span { color: var(--secondary); }

    /* Tab Nav */
    nav {
      display: flex;
      align-items: flex-end;
      gap: 4px;
      margin-left: auto;
      height: 100%;
      min-width: 0;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      flex-shrink: 1;
    }

    nav::-webkit-scrollbar { display: none; }

    nav.has-scroll-right {
      -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
      mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }

    nav.has-scroll-left {
      -webkit-mask-image: linear-gradient(to left, black 85%, transparent 100%);
      mask-image: linear-gradient(to left, black 85%, transparent 100%);
    }

    /* both ends scrollable */
    nav.has-scroll-left.has-scroll-right {
      -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
      mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
    }

    .nav-scroll-btn {
    display: none;              
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(172, 203, 235, 0.12);
    color: var(--sky);
    cursor: pointer;
    transition: background .2s, color .2s;
    align-self: center;
}

.nav-scroll-btn:hover {
    background: rgba(172, 203, 235, 0.22);
    color: var(--white);
}

.nav-scroll-btn.show {
    display: inline-flex;
}

@media (max-width: 900px) {
    .nav-scroll-btn {
        display: none !important;
    }
}

    .tab {
      position: relative;
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 0 20px;
      height: 46px;
      border-radius: 8px 8px 0 0;
      background: transparent;
      color: var(--sky);
      font-family: 'DM Sans', sans-serif;
      font-size: .88rem;
      font-weight: 500;
      letter-spacing: .03em;
      text-decoration: none;
      cursor: pointer;
      border: none;
      transition: background .2s, color .2s;
      white-space: nowrap;
      min-height: 44px;
    }

    .tab svg { flex-shrink: 0; opacity: .75; transition: opacity .2s; }

    .tab:hover {
      background: rgba(172,203,235,.1);
      color: var(--white);
    }

    .tab:hover svg { opacity: 1; }

    .tab.active {
      background: var(--gray-bg);
      color: var(--primary);
      font-weight: 600;
    }

    .tab.active svg { opacity: 1; }

    .tab.active::after {
      content: '';
      position: absolute;
      bottom: 0; left: 0; right: 0;
      height: 3px;
      background: var(--secondary);
      border-radius: 3px 3px 0 0;
    }

    /* ── BUTTONS ─────────────────────────────── */
    .btn-primary {
      background: var(--primary);
      color: var(--white);
      padding: 14px 28px;
      border-radius: 8px;
      font-weight: 600;
      font-size: .95rem;
      border: none;
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background .2s, transform .15s;
      min-height: 44px;
      touch-action: manipulation;
    }

    .btn-primary:hover { background: #1d529a; transform: translateY(-2px); }

    .btn-secondary {
      background: transparent;
      color: var(--primary);
      padding: 14px 28px;
      border-radius: 8px;
      font-weight: 600;
      font-size: .95rem;
      border: 2px solid var(--primary);
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      transition: background .2s, color .2s, transform .15s;
      min-height: 44px;
      touch-action: manipulation;
    }

    .btn-secondary:hover { background: var(--primary); color: var(--white); transform: translateY(-2px); }

    .btn-tertiary {
      background: transparent;
      color: var(--red);
      padding: 5px;
      border-radius: 8px;
      font-weight: 600;
      font-size: .65rem;
      border: 2px solid var(--orange);
      cursor: pointer;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      transition: background .2s, color .2s, transform .15s;
      min-height: 44px;
      touch-action: manipulation;
    }

    .btn-tertiary:hover { background: var(--red); color: var(--white); transform: translateY(-2px); }

    /* ── CARDS SECTION ──────────────────────── */
    .section {
      display: flex;
      flex-direction: column;
      height: calc(100vh - var(--header-h));
      overflow: hidden;
      padding: var(--section-pad);
    }

    .section--scrollable {
      height: auto;
      min-height: calc(100vh - var(--header-h));
      overflow-y: auto;
    }

    .page-layout {
      flex-shrink: 0;
      height: var(--panel-h);
    }

    .section-header {
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      margin-bottom: 36px;
      flex-wrap: wrap;
      gap: 12px;
    }

    .see-all {
      font-size: .85rem;
      font-weight: 600;
      color: var(--primary);
      text-decoration: none;
      display: flex; align-items: center; gap: 5px;
      transition: gap .2s;
      min-height: 44px;
      align-items: center;
    }
    .see-all:hover { gap: 9px; }

    .card-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
      gap: 24px;
    }

    .card {
      background: var(--white);
      border-radius: 16px;
      overflow: hidden;
      box-shadow: 0 2px 16px rgba(19,43,81,.07);
      transition: transform .2s, box-shadow .2s;
    }

    .card:hover { transform: translateY(-5px); box-shadow: 0 12px 36px rgba(19,43,81,.14); }

    .card-thumb {
      height: 140px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 2.4rem;
    }

    .card-body { padding: 22px; }

    .card-tag {
      display: inline-block;
      font-size: .7rem;
      font-weight: 700;
      letter-spacing: .08em;
      text-transform: uppercase;
      padding: 3px 10px;
      border-radius: 100px;
      margin-bottom: 10px;
    }

    .card-title {
      font-family: 'Playfair Display', serif;
      font-size: 1.05rem;
      color: var(--accent);
      margin-bottom: 8px;
      line-height: 1.3;
    }

    .card-desc {
      font-size: .84rem;
      color: var(--text);
      line-height: 1.6;
    }

    /* ── FOOTER ─────────────────────────────── */
    footer {
      background: var(--accent);
      color: var(--sky);
      text-align: center;
      padding: 20px 32px;
      font-size: .82rem;
      letter-spacing: .04em;
      margin: 0;
      flex-shrink: 0;
    }

    footer strong { color: var(--secondary); }

    /* ── DATATABLE CUSTOMIZATION ────────────────────────── */

    .table-container {
      background: var(--white);
      padding: var(--table-pad-top) var(--table-pad-side) var(--table-pad-bottom);
      border-radius: 12px;
      box-shadow: 0 2px 16px rgba(19,43,81,.07);
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .tree-controls {
      flex-shrink: 0;
    }

    /* Custom controls layout */
    .custom-controls {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      align-items: center;
      gap: 20px;
      margin-bottom: 6px;     
      padding-bottom: 6px;     
      border-bottom: 2px solid var(--gray-bg);
    }

    .custom-controls .left-controls {
      display: grid;
      gap: 15px;
      align-items: center;
      color: var(--text);
      font-size: .88rem;
      justify-self: start;
    }

   .custom-controls .center-controls {
      display: flex;
      align-items: center;
      justify-self: center;
    }

  .custom-controls .right-controls {
    display: flex;
    align-items: center;
    justify-self: end;
  }

    /* Table info text styling */
  .table-info-text {
    padding-left: 5px;
    font-size: .8rem;        
    color: var(--text);
    font-weight: 500;
    text-align: right;        
    white-space: nowrap;
  }
    /* Pagination in top controls */
    .table-pagination-top {
      display: flex;
      gap: 5px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .table-pagination-top .paginate_button {
      padding: 4px 10px;     
      border: 2px solid var(--gray-lt);
      border-radius: 6px;
      background: var(--white);
      color: var(--text);
      cursor: pointer;
      font-weight: 500;
      font-size: .8rem;
      font-family: 'DM Sans', sans-serif;
      transition: all 0.2s ease;
      user-select: none;
      min-height: 32px;         
      min-width: 32px;          
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }

    .table-pagination-top .paginate_button:hover:not(.disabled) {
      background: var(--primary);
      color: var(--white);
      border-color: var(--primary);
      transform: translateY(-1px);
    }

    .table-pagination-top .paginate_button.current {
      background: var(--primary);
      color: var(--white);
      border-color: var(--primary);
      font-weight: 600;
    }

    .table-pagination-top .paginate_button.disabled {
      opacity: 0.4;
      cursor: not-allowed;
      background: var(--gray-bg);
    }

    .dataTables_filter,
    .dataTables_length {
      display: none;
    }

    /* Custom search box */
    #customSearch {
      padding: 10px 15px;
      border: 2px solid var(--gray-lt);
      border-radius: 8px;
      width: 300px;
      font-size: .88rem;
      font-family: 'DM Sans', sans-serif;
      color: var(--text);
      transition: all 0.3s ease;
      font-size: 16px;
    }

    #customSearch:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(24, 69, 126, 0.1);
    }

    #customSearch::placeholder {
      color: var(--gray-lt);
    }

    #customPageLength {
      padding: 8px 12px;
      border: 2px solid var(--gray-lt);
      border-radius: 8px;
      font-size: .88rem;
      font-family: 'DM Sans', sans-serif;
      color: var(--text);
      background-color: var(--white);
      cursor: pointer;
      transition: all 0.3s ease;
      min-height: 44px;
      font-size: 16px;
    }

    #customPageLength:focus {
      outline: none;
      border-color: var(--primary);
    }

    /* DataTable styling */
    #dataTable {
      width: 100% !important;
      border-collapse: collapse;
      font-family: 'DM Sans', sans-serif;
    }

    #dataTable thead th {
      background: linear-gradient(to bottom, var(--primary), var(--accent));
      color: var(--white);
      padding: 14px 10px;
      text-align: left;
      font-weight: 600;
      font-size: .82rem;
      letter-spacing: .03em;
      border-right: 1px solid rgba(255,255,255,0.2);
      position: sticky;
      top: 0;
      z-index: 10;
      white-space: nowrap;
    }

    #dataTable thead th:last-child {
      border-right: none;
    }

    /* Sortable column indicator */
    #dataTable thead th.sorting,
    #dataTable thead th.sorting_asc,
    #dataTable thead th.sorting_desc {
      cursor: pointer;
    }

    #dataTable thead th.sorting:hover,
    #dataTable thead th.sorting_asc:hover,
    #dataTable thead th.sorting_desc:hover {
      background: var(--indigo);
    }

    #dataTable tbody td {
      padding: 12px 10px;
      border-bottom: 1px solid var(--gray-bg);
      font-size: .84rem;
      max-width: 120px;
      color: var(--text);       
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    #dataTable tbody tr:hover {
      background-color: var(--sky);
      transition: background-color 0.2s ease;
    }

    #dataTable tbody tr:nth-child(even) {
      background-color: #F9F9F9;
    }

    #dataTable tbody tr:nth-child(even):hover {
      background-color: var(--sky);
    }

    /* First column styling */
    #dataTable tbody td:first-child {
      font-weight: 600;
      color: var(--primary);
    }

    /* Pagination styling */
    .dataTables_paginate {
      margin-top: 20px;
      text-align: center;
    }

    .dataTables_paginate .paginate_button {
      padding: 8px 14px;
      margin: 0 3px;
      border: 2px solid var(--gray-lt);
      border-radius: 8px;
      background: var(--white);
      color: var(--text);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-weight: 500;
      font-size: .84rem;
      font-family: 'DM Sans', sans-serif;
      transition: all 0.2s ease;
      min-height: 44px;
      min-width: 44px;
    }

    .dataTables_paginate .paginate_button:hover {
      background: var(--primary);
      color: var(--white);
      border-color: var(--primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(24, 69, 126, 0.25);
    }

    .dataTables_paginate .paginate_button.current {
      background: var(--primary);
      color: var(--white);
      border-color: var(--primary);
      box-shadow: 0 2px 8px rgba(24, 69, 126, 0.3);
    }

    .dataTables_paginate .paginate_button.disabled {
      opacity: 0.4;
      cursor: not-allowed;
      background: var(--gray-bg);
      border-color: var(--gray-lt);
    }

    .dataTables_paginate .paginate_button.disabled:hover {
      transform: none;
      box-shadow: none;
      background: var(--gray-bg);
      color: var(--text);
      border-color: var(--gray-lt);
    }

    /* Info text */
    .dataTables_info {
      margin-top: 20px;
      color: var(--text);
      font-size: .84rem;
      text-align: center;
    }

    .tree-child-marker {
      margin-right: -0.36rem;
      color: var(--primary);
    }

    .tree-grandchild-marker {
      color: var(--primary);
      margin-left: -0.65rem;
    }

    .tree-row.search-match {
      background-color: rgba(255, 204, 50, 0.15); /* var(--secondary) at low opacity */
    }

    /* Processing indicator */
    .dataTables_processing {
      background: rgba(255,255,255,0.95);
      border: 2px solid var(--primary);
      color: var(--primary);
      padding: 20px;
      border-radius: 8px;
      font-weight: 600;
      font-family: 'DM Sans', sans-serif;
      position: fixed;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 1000;
    }

    /* Scroll wrapper */
    .dataTables_wrapper .dataTables_scroll {
      border: 1px solid var(--gray-bg);
      border-radius: 8px;
      overflow: hidden;
    }

    .dataTables_scrollBody {
      border-top: none !important;
    }

    /* Highlight selected row */
    #dataTable tbody tr.selected {
      background-color: rgba(255,204,50,.25) !important;
      color: var(--accent);
      font-weight: 600;
    }

    #dataTable tbody tr.selected:hover {
      background-color: rgba(255,204,50,.25) !important;
    }

    /* ── INFO CARD WITH TABS ──────────────── */

    .info-card {
      background: var(--white);
      border-radius: 12px;
      box-shadow: 0 2px 16px rgba(19,43,81,.08);
      overflow: hidden;
      border: none;
      height: var(--panel-h);
      display: flex;         
      flex-direction: column;
    }

    .info-tabs {
      background: linear-gradient(135deg, var(--primary), var(--accent));
      border-bottom: none;
      padding: 0 18px;
      display: flex;
      align-items: center;
      gap: 4px;
      min-height: 48px;
      overflow-x: auto;
      scrollbar-width: none;
      flex-shrink: 0;
    }

    .info-tabs::-webkit-scrollbar {
      display: none;
    }

    .info-tab {
      padding: 0 16px;
      height: 48px;
      font-size: .82rem;
      font-weight: 500;
      letter-spacing: .03em;
      color: rgba(172, 203, 235, 0.85); 
      cursor: pointer;
      border-bottom: 3px solid transparent;
      display: none;          
      align-items: center;
      gap: 7px;
      white-space: nowrap;
      transition: color .2s, border-color .2s;
      user-select: none;
      min-height: 48px;
      touch-action: manipulation;
    }

    .info-tab:hover {
      color: var(--white);
      background: rgba(172,203,235,.1);
    }

    .info-tab.active {
      color: var(--white);
      font-weight: 700;
      border-bottom-color: var(--secondary);
      background: transparent;
    }

    .info-tab.apparent {
      display: flex;
    }

    .info-content {
      padding: 10px 20px;
      background: var(--white);
      overflow-y: auto;
      min-height: 0;
      flex: 1;
    }

    .info-pane {
      display: none;
    }

    .info-pane.active {
      display: block;
    }

    .info-pane p {
      margin: 0;
      color: var(--text);
      font-size: 1.2rem;
      line-height: 1.5;
    }

    .span-text {
      color: var(--primary);
    }

    .instruction-strip {
      background: linear-gradient(135deg, var(--white), var(--sky));
      padding: 10px 18px;
      font-size: .78rem;
      color: var(--red);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 7px;
      letter-spacing: .02em;
      border-radius: 0 0 12px 12px;
      flex-shrink: 0;
  }

    /* ── TERMS & CONDITIONS STYLING ────────────────────────── */

  .terms-container {
    position: relative;
    max-width: 900px;
    width: calc(100% - 32px);
    margin: 20px auto 48px;   /* extra space above the footer */
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(79, 89, 106, 0.07);
    line-height: 1.8;
    flex: 0 0 auto;           /* grow with its content */
  }

    .terms-header {
      text-align: center;
      margin-bottom: 40px;
      padding-bottom: 20px;
      border-bottom: 3px solid var(--secondary);
    }

    .terms-header h1 {
      font-family: 'Geometria';
      font-size: 2.5rem;
      color: var(--accent);
      font-weight: 700;
      margin: 0;
    }

    .terms-section {
      margin-bottom: 30px;
    }

    .terms-attribution {
      font-size: 1rem;
      color: var(--text);
      line-height: 1.8;
      padding: 20px;
      background: var(--gray-bg);
      border-left: 4px solid var(--primary);
      border-radius: 4px;
    }

    .terms-attribution em {
      font-style: italic;
      color: var(--accent);
      font-weight: 500;
    }

    .terms-list {
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .terms-list li {
      position: relative;
      padding: 20px 20px 20px 50px;
      margin-bottom: 15px;
      background: var(--gray-bg);
      border-radius: 8px;
      font-size: 1rem;
      color: var(--text);
      line-height: 1.8;
      transition: all 0.3s ease;
    }

    .terms-list li:hover {
      background: var(--sky);
      transform: translateX(5px);
    }

    .terms-list li::before {
      content: '•';
      position: absolute;
      left: 20px;
      top: 20px;
      font-size: 1.5rem;
      color: var(--primary);
      font-weight: bold;
    }

    .terms-footer {
      margin-top: 40px;
      padding-top: 20px;
      border-top: 2px solid var(--gray-lt);
      text-align: center;
    }

    .terms-footer p {
      font-size: 0.95rem;
      color: var(--text);
      font-weight: 500;
    }

        /* ── PRACTITIONER SETUP MODAL ─────────────────── */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(19, 43, 81, 0.55);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      padding: 16px;
    }

    .modal-overlay.open { display: flex; }

    .setup-card {
      width: 480px;
      max-width: 100%;
      max-height: 90vh;
      overflow-y: auto;
      background: var(--white);
      border-radius: 12px;
      box-shadow: 0 12px 40px rgba(19,43,81,.3);
      animation: modalIn 0.2s ease;
    }
        /* ── VERSION NUMBER ─────────────────── */
    .version-number {
      color: var(--text-muted);
      position: absolute;
      bottom: 12px;
      right: 16px;
    }

    /* Bell trigger */
    .inbox-trigger {
      position: relative;
      width: 38px;
      height: 38px;
      border-radius: 50%;
      border: none;
      background: rgba(172,203,235,.12);
      color: var(--sky);
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: background .2s, color .2s;
    }

    .inbox-trigger:hover { background: rgba(172,203,235,.22); color: var(--white); }

    .inbox-trigger .dot {
      position: absolute;
      top: 6px;
      right: 7px;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--secondary);
      border: 2px solid var(--accent);
    }

    @keyframes modalIn {
      from { opacity: 0; transform: translateY(-12px) scale(0.98); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }

    @media (max-width: 620px) {
      .setup-body { padding: 18px 18px 20px; }
      .setup-actions { flex-direction: column-reverse; }
      .btn-primary, .btn-tertiary { width: 100%; justify-content: center; }
    }

    @media (max-width: 380px) {
      .rcf-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 2px;
      }
      .rcf-input { width: 100%; }
      .rcf-input input { width: 100%; text-align: right; }
      .setup-titlebar h1 { font-size: .95rem; }
    }

    /* ═══════════════════════════════════════════════════════
       RESPONSIVE BREAKPOINTS
       ═══════════════════════════════════════════════════════ */

    /* ── TABLET (≤ 900px) ─────────────────── */
    @media (max-width: 900px) {
      .custom-controls {
        grid-template-columns: 1fr;
        gap: 15px;
      }

      .custom-controls .left-controls,
      .custom-controls .center-controls,
      .custom-controls .right-controls {
        justify-self: stretch;
        justify-content: center;
        align-items: center;
      }

      .custom-controls .right-controls {
        align-items: stretch;
      }

      #customSearch {
        width: 100%;
      }

      #customPageLength {
        width: 100%;
      }

      .table-info-text {
        white-space: normal;
        text-align: center;
      }
    }

    /* ── TABLET PORTRAIT / LARGE PHONE (≤ 768px) ── */
    @media (max-width: 768px) {
      body {
        overflow-y: auto;
      }

      /* Header */
      .header-inner { padding: 0 20px; gap: 16px; height: var(--header-h-tablet); }

      /* Cards */
      .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
      }

      /* Section */
      .section {
        height: calc(100vh - var(--header-h-tablet));   
        overflow: hidden;                               
      }

      .search-panel {
        height: 100%;      
        overflow-y: auto;
      }

      /* Table container */
      .table-container {
        flex: 1;          
        min-height: 0;      
        overflow: hidden;   
        padding: var(--table-pad-top-tablet) var(--table-pad-side-tablet) var(--table-pad-bottom-tablet);
        border-radius: 8px;
      }

      /* Table cells */
      #dataTable thead th {
        font-size: .75rem;
        padding: 10px 8px;
      }

      #dataTable tbody td {
        font-size: .8rem;
        padding: 10px 8px;
        max-width: 120px;
      }

      /* Info card */
      .info-card {
        height: var(--panel-h);
      }
      
      .info-pane p {
        font-size: 1rem;
      }

      /* Terms */
      .terms-container {
        padding: 25px 20px;
        border-radius: 8px;
      }

      .terms-header h1 {
        font-size: 2rem;
      }

      .terms-list li {
        padding: 15px 15px 15px 40px;
        font-size: 0.95rem;
      }

      .terms-list li::before {
        left: 15px;
        top: 15px;
      }

      .terms-list li:hover {
        transform: translateX(3px);
      }

      /* Footer */
      footer {
        padding: 20px 16px;
      }

      .btn-primary,
      .btn-secondary,
      .btn-tertiary {
        padding: 12px 20px;
        font-size: .9rem;
      }

      .page-layout {
        height: var(--panel-h);   
      }
    }

    /* ── MOBILE PHONE (≤ 620px) ──────────── */
    @media (max-width: 620px) {
      .header-inner { padding: 0 12px; height: var(--header-h-mobile); gap: 8px; }

      .logo-text { display: none; }

      .logo-img {
        width: 36px;
        height: 36px;
      }

      .tab span { display: none; }
      .tab { padding: 0 12px; }

      .card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
      }

      .card-thumb { height: 110px; }

      .section { height: calc(100vh - var(--header-h-mobile)); }

      .section-header {
        margin-bottom: 20px;
      }

      .table-container {
        padding: var(--table-pad-top-mobile) var(--table-pad-side-mobile) var(--table-pad-bottom-mobile);
        border-radius: 6px;
      }

      .dataTables_wrapper .dataTables_scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
      }

      #dataTable thead th {
        font-size: .72rem;
        padding: 8px 6px;
        letter-spacing: 0;
      }

      #dataTable tbody td {
        font-size: .75rem;
        padding: 8px 6px;
        max-width: 100px;
      }

      .dataTables_paginate .paginate_button {
        padding: 6px 10px;
        margin: 0 2px;
        font-size: .78rem;
        min-width: 36px;
        min-height: 36px;
      }

      .table-pagination-top .paginate_button {
        min-width: 36px;
        min-height: 36px;
        padding: 4px 8px;
        font-size: .78rem;
      }

      .dataTables_scrollBody {
        -webkit-overflow-scrolling: touch;
      }

      /* Info tabs */
      .info-tab {
        padding: 10px 14px;
        font-size: .82rem;
      }

      .info-content {
        padding: 12px 14px;
      }

      .info-pane p {
        font-size: .95rem;
      }

      /* Terms */
      .terms-container {
        padding: 20px 14px;
        margin: 0 4px;
      }

      .terms-header h1 {
        font-size: 1.6rem;
      }

      .terms-attribution {
        font-size: .9rem;
        padding: 14px;
      }

      .terms-list li {
        padding: 12px 12px 12px 36px;
        font-size: .88rem;
        line-height: 1.6;
      }

      .terms-list li::before {
        left: 12px;
        top: 12px;
        font-size: 1.2rem;
      }

      .terms-list li:hover {
        transform: none; 
      }

      .terms-footer p {
        font-size: .88rem;
      }

      .btn-primary,
      .btn-secondary,
      .btn-tertiary {
        width: 100%;
        justify-content: center;
        padding: 13px 16px;
        font-size: .88rem;
      }

      /* Footer */
      footer {
        padding: 18px 12px;
        font-size: .78rem;
      }

      .custom-controls {
        gap: 10px;
      }

      #customSearch {
        font-size: 16px; 
      }

      #customPageLength {
        font-size: 16px; 
      }
    }

    /* ── SMALL PHONE (≤ 380px) ────────────── */
    @media (max-width: 380px) {
      .header-inner { height: var(--header-h-small); }

      .logo-img {
        width: 32px;
        height: 32px;
      }

      .tab {
        padding: 0 10px;
      }

      .terms-header h1 {
        font-size: 1.4rem;
      }

      .card-body {
        padding: 16px;
      }

      .info-pane p {
        font-size: .88rem;
      }
      .section { height: calc(100vh - var(--header-h-small)); }
    }

    /* ── LANDSCAPE PHONE ─────────────────── */
    @media (max-width: 812px) and (orientation: landscape) {
      header { position: relative; }
      .header-inner { height: var(--header-h-landscape); }
      .section { height: calc(100vh - var(--header-h-landscape)); }
    }

    @media (hover: none) and (pointer: coarse) {
      .card:hover {
        transform: none;
        box-shadow: 0 2px 16px rgba(19,43,81,.07);
      }

      .btn-primary:hover,
      .btn-secondary:hover,
      .btn-tertiary:hover {
        transform: none;
      }

      .see-all:hover {
        gap: 5px;
      }

      .btn-primary:active { background: #1d529a; opacity: 0.9; }
      .btn-secondary:active { background: var(--primary); color: var(--white); }
      .btn-tertiary:active { background: var(--red); color: var(--white); }
      .card:active { transform: scale(0.98); }
      .tab:active { background: rgba(172,203,235,.15); }

      .dataTables_paginate .paginate_button {
        min-height: 44px;
        min-width: 44px;
      }
    }

  @media (max-height: 800px) {
    .search-body {
      padding: 8px 12px;
      gap: 4px;
    }

    .search-panel-header {
      padding: 6px 14px;
    }

    .field-group {
      gap: 2px;
    }

    .field-label {
      font-size: .68rem;
    }

    .search-input {
      padding: 6px 10px 6px 32px;
    }
  }