.c-core-service-downloads{
  --csd-text:var(--color-text,var(--lh-text,#233234));
  --csd-muted:var(--color-text-soft,var(--lh-text-soft,#5b6d6a));
  --csd-surface:var(--color-surface-strong,var(--lh-panel,#fcfbf8));
  --csd-surface-soft:var(--color-surface-muted,#f7f5f1);
  --csd-line:var(--color-border,var(--lh-border,rgba(35,50,52,.18)));
  --csd-accent:var(--color-accent-2,var(--lh-teal-2,#2f8b84));
  --csd-accent-strong:var(--color-accent-3,var(--lh-teal-3,#216762));
  --csd-focus:var(--color-focus,var(--lh-focus,#ffbf47));
  --csd-radius:0 18px 18px 18px;
  --csd-shadow:var(--shadow-soft,var(--lh-shadow-soft,0 14px 28px rgba(10,24,26,.09)));
  color:var(--csd-text);
  font-family:var(--font-body,var(--lh-font-body,Inter,system-ui,sans-serif));
}

.csd-empty{
  padding:1rem 1.125rem;
  border:1px solid var(--csd-line);
  background:var(--csd-surface);
  border-radius:var(--csd-radius);
  color:var(--csd-muted);
}

.csd-table-wrap{
  overflow:auto;
  border:1px solid var(--csd-line);
  border-radius:var(--csd-radius);
  background:var(--csd-surface);
  box-shadow:var(--csd-shadow);
}

.csd-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width:44rem;
}

.csd-table th,
.csd-table td{
  padding:1rem 1.125rem;
  border-bottom:1px solid var(--csd-line);
  vertical-align:middle;
  text-align:left;
}

.csd-table th{
  font-family:var(--font-ui,var(--lh-font-ui,Inter,system-ui,sans-serif));
  font-size:.78rem;
  letter-spacing:.07em;
  text-transform:uppercase;
  color:var(--csd-muted);
  background:color-mix(in srgb, var(--csd-surface-soft) 82%, transparent);
  white-space:nowrap;
}

.csd-table tbody tr:last-child td{
  border-bottom:0;
}

.csd-table tbody tr{
  transition:background-color .18s ease;
}

.csd-table tbody tr:hover{
  background:color-mix(in srgb, var(--csd-accent) 7%, transparent);
}

.csd-name-cell{
  width:72%;
}

.csd-title{
  font-weight:800;
  color:var(--csd-text);
  line-height:1.25;
}

.csd-description{
  margin-top:.35rem;
  color:var(--csd-muted);
  font-size:.94rem;
  line-height:1.55;
  max-width:72ch;
}

.csd-meta{
  margin-top:.45rem;
  color:color-mix(in srgb, var(--csd-muted) 86%, transparent);
  font-size:.82rem;
  line-height:1.3;
}

.csd-action-cell{
  width:8.75rem;
  text-align:center;
  white-space:nowrap;
}

.csd-button{
  appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  min-height:2.55rem;
  padding:.72rem .94rem;
  border:1px solid var(--csd-accent-strong);
  border-radius:0 .875rem .875rem .875rem;
  background:linear-gradient(180deg, color-mix(in srgb, var(--csd-accent) 88%, white 12%), var(--csd-accent-strong));
  color:#fff !important;
  font:inherit;
  font-family:var(--font-ui,var(--lh-font-ui,Inter,system-ui,sans-serif));
  font-weight:800;
  font-size:.9rem;
  line-height:1;
  text-decoration:none !important;
  cursor:pointer;
  box-shadow:0 12px 22px rgba(10,24,26,.12), inset 0 1px 0 rgba(255,255,255,.22);
  transition:transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.csd-button span{
  font-size:.72rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  opacity:.88;
}

.csd-button:hover{
  transform:translateY(-1px);
  filter:saturate(1.04) brightness(1.02);
  box-shadow:0 16px 28px rgba(10,24,26,.16), inset 0 1px 0 rgba(255,255,255,.24);
}

.csd-button:focus-visible{
  outline:3px solid color-mix(in srgb, var(--csd-focus) 84%, white 16%);
  outline-offset:2px;
}

.csd-button--view{
  background:linear-gradient(180deg, color-mix(in srgb, var(--csd-surface) 92%, white 8%), var(--csd-surface-soft));
  color:var(--csd-accent-strong) !important;
  border-color:color-mix(in srgb, var(--csd-accent) 44%, var(--csd-line));
  box-shadow:0 10px 20px rgba(10,24,26,.08), inset 0 1px 0 rgba(255,255,255,.58);
}

.csd-count{
  margin-top:.42rem;
  color:var(--csd-muted);
  font-size:.78rem;
  line-height:1.2;
}

.csd-unavailable{
  color:var(--csd-muted);
  font-size:.9rem;
}

.csd-overlay{
  position:fixed;
  inset:0;
  display:none;
  z-index:1000000;
}

.csd-overlay.is-open{
  display:block;
}

body.csd-overlay-open{
  overflow:hidden;
}

.csd-overlay__backdrop{
  position:absolute;
  inset:0;
  background:rgba(8,18,20,.68);
  backdrop-filter:blur(5px);
}

.csd-overlay__panel{
  position:relative;
  z-index:1;
  width:min(1180px, calc(100vw - 32px));
  height:min(900px, calc(100dvh - 32px));
  margin:16px auto;
  display:grid;
  grid-template-rows:auto 1fr;
  background:var(--csd-surface);
  color:var(--csd-text);
  border:1px solid color-mix(in srgb, var(--csd-line) 74%, white 26%);
  border-radius:0 24px 24px 24px;
  box-shadow:0 30px 80px rgba(0,0,0,.28);
  overflow:hidden;
}

.csd-overlay__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:1rem 1.125rem;
  border-bottom:1px solid var(--csd-line);
  background:linear-gradient(180deg, color-mix(in srgb, var(--csd-surface) 94%, white 6%), var(--csd-surface-soft));
}

.csd-overlay__kicker{
  color:var(--csd-accent-strong);
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  line-height:1.2;
}

.csd-overlay__header h2{
  margin:.2rem 0 0;
  color:var(--csd-text);
  font-family:var(--font-heading,var(--lh-font-heading,Georgia,serif));
  font-size:clamp(1.25rem, 2vw, 1.85rem);
  line-height:1.12;
}

.csd-overlay__close{
  appearance:none;
  width:2.75rem;
  height:2.75rem;
  border:1px solid var(--csd-line);
  border-radius:0 .875rem .875rem .875rem;
  background:var(--csd-surface);
  color:var(--csd-text);
  font-size:1.85rem;
  line-height:1;
  cursor:pointer;
}

.csd-overlay__close:focus-visible{
  outline:3px solid color-mix(in srgb, var(--csd-focus) 84%, white 16%);
  outline-offset:2px;
}

.csd-overlay__body{
  min-height:0;
  background:#303436;
}

.csd-overlay__body iframe{
  display:block;
  width:100%;
  height:100%;
  border:0;
  background:#303436;
}

@media (max-width: 48rem){
  .csd-table,
  .csd-table thead,
  .csd-table tbody,
  .csd-table th,
  .csd-table td,
  .csd-table tr{
    display:block;
    min-width:0;
  }

  .csd-table thead{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0;
  }

  .csd-table tbody tr{
    padding:1rem;
    border-bottom:1px solid var(--csd-line);
  }

  .csd-table tbody tr:last-child{
    border-bottom:0;
  }

  .csd-table td{
    border:0;
    padding:.45rem 0;
    width:auto;
    text-align:left;
    white-space:normal;
  }

  .csd-action-cell{
    display:inline-block;
    margin-right:.5rem;
    vertical-align:top;
  }

  .csd-button{
    width:100%;
    min-width:9.5rem;
  }

  .csd-overlay__panel{
    width:100vw;
    height:100dvh;
    margin:0;
    border-radius:0;
  }
}

/* Explicit Bright/Dark readiness in addition to theme-token fallbacks. */
html[data-theme="bright"] .c-core-service-downloads,
html[data-theme="light"] .c-core-service-downloads{
  --csd-text:var(--color-text,var(--cv2-color-light-text,#233234));
  --csd-muted:var(--color-text-soft,#5b6d6a);
  --csd-surface:var(--color-surface-strong,var(--cv2-color-light-surface,#fcfbf8));
  --csd-surface-soft:var(--color-surface-muted,#f7f5f1);
  --csd-line:var(--color-border,rgba(35,50,52,.18));
  --csd-accent:var(--color-accent-2,var(--cv2-color-light-brand,#2f8b84));
  --csd-accent-strong:var(--color-accent-3,#216762);
}

html[data-theme="dark"] .c-core-service-downloads{
  --csd-text:var(--color-text,var(--cv2-color-dark-text,#edf2f1));
  --csd-muted:var(--color-text-soft,#c4d1cf);
  --csd-surface:var(--color-surface-strong,var(--cv2-color-dark-surface,#1d2b2f));
  --csd-surface-soft:var(--color-surface-muted,#162126);
  --csd-line:var(--color-border,rgba(237,242,241,.18));
  --csd-accent:var(--color-accent-2,var(--cv2-color-dark-brand,#7abeb6));
  --csd-accent-strong:var(--color-accent-3,#98d8d1);
  --csd-shadow:0 18px 42px rgba(0,0,0,.24);
}

.csd-archive-status{
  min-height:1.25rem;
  margin:0 0 .55rem;
  color:var(--csd-muted);
  font-size:.9rem;
  line-height:1.4;
}

.csd-archive-region{
  transition:opacity .18s ease, transform .18s ease;
}

.c-core-service-downloads.is-loading .csd-archive-region{
  opacity:.52;
  transform:translateY(.125rem);
  pointer-events:none;
}

.csd-pagination{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-top:1rem;
  padding:.875rem 1rem;
  border:1px solid var(--csd-line);
  border-radius:0 18px 18px 18px;
  background:var(--csd-surface);
  box-shadow:var(--csd-shadow);
}

.csd-pagination__summary{
  color:var(--csd-muted);
  font-size:.9rem;
  line-height:1.35;
  white-space:nowrap;
}

.csd-pagination__controls{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:.45rem;
}

.csd-page-button{
  appearance:none;
  min-width:2.55rem;
  min-height:2.45rem;
  padding:.55rem .8rem;
  border:1px solid var(--csd-line);
  border-radius:0 .75rem .75rem .75rem;
  background:var(--csd-surface-soft);
  color:var(--csd-text);
  font:inherit;
  font-family:var(--font-ui,var(--lh-font-ui,Inter,system-ui,sans-serif));
  font-size:.9rem;
  font-weight:800;
  cursor:pointer;
  transition:transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}

.csd-page-button:hover:not(:disabled){
  transform:translateY(-1px);
  border-color:color-mix(in srgb, var(--csd-accent) 55%, var(--csd-line));
  background:color-mix(in srgb, var(--csd-accent) 10%, var(--csd-surface-soft));
}

.csd-page-button.is-current,
.csd-page-button[aria-current="page"]{
  background:var(--csd-accent);
  border-color:var(--csd-accent);
  color:#fff;
  cursor:default;
}

html[data-theme="dark"] .csd-page-button.is-current,
html[data-theme="dark"] .csd-page-button[aria-current="page"]{
  color:#102030;
}

.csd-page-button:disabled{
  opacity:.46;
  cursor:not-allowed;
}

.csd-page-button:focus-visible{
  outline:3px solid color-mix(in srgb, var(--csd-focus) 84%, white 16%);
  outline-offset:2px;
}

.csd-title:focus{
  outline:none;
}

@media (max-width: 48rem){
  .csd-table-wrap{
    overflow:visible;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  .csd-table{
    min-width:0;
  }

  .csd-table tbody{
    display:grid;
    gap:.875rem;
  }

  .csd-table tbody tr{
    display:grid;
    gap:.55rem;
    padding:1rem;
    border:1px solid var(--csd-line);
    border-radius:0 18px 18px 18px;
    background:var(--csd-surface);
    box-shadow:var(--csd-shadow);
  }

  .csd-table tbody tr:hover{
    background:var(--csd-surface);
  }

  .csd-action-cell{
    width:100%;
    display:block;
    margin-right:0;
    text-align:left;
  }

  .csd-action-cell::before{
    content:attr(data-label);
    display:block;
    margin:0 0 .35rem;
    color:var(--csd-muted);
    font-family:var(--font-ui,var(--lh-font-ui,Inter,system-ui,sans-serif));
    font-size:.72rem;
    font-weight:800;
    letter-spacing:.07em;
    text-transform:uppercase;
  }

  .csd-button{
    width:100%;
    min-width:0;
  }

  .csd-pagination{
    display:grid;
    justify-items:stretch;
    gap:.75rem;
    padding:.875rem;
  }

  .csd-pagination__summary{
    white-space:normal;
    text-align:center;
  }

  .csd-pagination__controls{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:.45rem;
  }

  .csd-page-button{
    min-width:0;
    width:100%;
    padding:.6rem .35rem;
  }
}

@media (max-width: 30rem){
  .csd-pagination__controls{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}
