/* 20-LOCLIST-ADDRESS — Contact List + Address List tabs */
@layer pages {

  /* ===== Contact List scrollable area ===== */
  .gl-contacts-scroll {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
  }

  /* ===== Address List Tab ===== */

  /* White-page box matching AAG white-page sizing & variables */
  .gl-location-box-wide {
    /* Override the narrow 680px from .gl-location-box */
    width: 75%;
    min-width: min-content;
    overflow-x: auto;

    /* Replicate AAG CSS variables so child classes resolve correctly */
    --aag-font-size:        var(--fs-sm-s);
    --aag-line-height:      1.3;
    --aag-header-font-size: var(--fs-sm-s);
    --aag-header-weight:    600;
    --aag-header-bg:        var(--clr-info-bg);
    --aag-header-color:     var(--clr-black);
    --aag-border-color:     var(--clr-black);
    --aag-offday-bg:        var(--offday-bg);
    --aag-row-bg:           var(--clr-white);
    --aag-title-padding:    16px 20px 12px;
    --aag-title-font-size:  var(--fs-xl-s);
    --aag-subtitle-size:    12px;
    --aag-datestamp-size:    10px;
    --aag-title-rule-color: var(--gray-300);
    --aag-col-wk:           28px;
    --aag-col-date:         80px;
    --aag-col-day:          24px;
    --aag-col-scripted:     160px;
    --aag-col-location:     220px;
    --aag-col-unit:         200px;
    --aag-cell-pad-y:       5px;
    --aag-cell-pad-x:       6px;
    --aag-resize-handle-w:  4px;
    --aag-resize-handle-bg: rgba(var(--clr-berry-500-rgb),0.25);

    font-size: var(--aag-font-size);
  }

  /* Undo .gl-location-box table overrides inside the address box */
  .gl-location-box-wide table {
    font-size: inherit;
    border: none;
    border-collapse: collapse;
  }
  .gl-location-box-wide td {
    text-align: inherit;
    border: none;
    padding: inherit;
    border-top: none;
  }
  .gl-location-box-wide th {
    font-weight: inherit;
  }
  .gl-location-box-wide thead tr {
    background-color: transparent;
    text-align: inherit;
  }
  .gl-location-box-wide td,
  .gl-location-box-wide th,
  .gl-location-box-wide tr {
    color: var(--clr-black);
  }
  .gl-location-box-wide a {
    color: var(--clr-black);
  }

  /* Address table — fixed layout, collapsed borders */
  #gl-addr-table {
    table-layout: fixed;
    width: 100%;
    min-width: 100%;
    border: 1px solid var(--clr-black);
  }

  /* Uniform thin black border on all cells (header + body) */
  #gl-addr-table th,
  #gl-addr-table td {
    border: 1px solid var(--clr-black);
  }

  /* Override .border-cell to match (not none, not thick) */
  #gl-addr-table .border-cell {
    border: 1px solid var(--clr-black) !important;
  }

  /* Sticky header for address table */
  #gl-addr-table thead th {
    position: relative;
    overflow: visible;
    user-select: none;
    box-shadow: none;  /* override AAG sticky shadow — real border instead */
    font-size: var(--th-font-size);
  }

  /* Centre the Date header (AAG sets .col-date to text-align:right) */
  #gl-addr-table thead th.col-date {
    text-align: center;
  }

  /* Wk column cells — 10px font */
  #gl-addr-table td.align-middle {
    font-size: var(--fs-sm-s);
  }

  /* Resize handles on address table headers */
  #gl-addr-table .col-resize-handle {
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: var(--aag-resize-handle-w);
    background: var(--aag-resize-handle-bg);
    cursor: col-resize;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.15s;
  }
  #gl-addr-table th:hover .col-resize-handle,
  #gl-addr-table .col-resize-handle.dragging {
    opacity: 1;
  }

  /* 5px padding on all cells (td + th) */
  #gl-addr-table td,
  #gl-addr-table th {
    padding: 5px;
    vertical-align: top;
  }

  /* Address cell in the table */
  .gl-addr-cell {
    vertical-align: top;
    font-size: var(--fs-sm-s);
    line-height: 1.4;
  }

  /* Location and unit base column default widths */
  .gl-addr-col-loc { width: var(--aag-col-location); }
  .gl-addr-col-ub  { width: var(--aag-col-unit); }

  /* Map link style inside address cells */
  .gl-addr-cell .gl-map-link {
    font-size: var(--fs-xs-s);
    color: var(--clr-info);
    text-decoration: underline;
  }
  .gl-addr-cell .gl-map-link:hover {
    color: var(--clr-info-dark);
  }

  /* Miles line — toggleable */
  .gl-addr-miles {
    color: var(--gray-600);
    font-size: var(--fs-xs-s);
    font-style: italic;
  }


} /* end @layer pages */
