:root {
  font-family:Inter,"Segoe UI",system-ui,sans-serif;
  color:#182b45;
  background:#f2f5fa;
  font-size:16px;
  line-height:1.5;
  font-synthesis:none;
  --muted:#52647a;
  --blue:#174bb7;
  --line:#dce4ef;
  --surface:#fff;
}

* {
  box-sizing:border-box;
}

.status-group {
  display:block;
  margin-bottom:.25rem;
}

body {
  margin:0;
}

button,input,select {
  font:inherit;
}

button,a,input,select {
  touch-action:manipulation;
}

a {
  color:var(--blue);
  text-underline-offset:3px;
}

a:hover {
  color:#102d6b;
}

button {
  cursor:pointer;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #287bea;
  outline-offset:3px;
}

[hidden] {
  display:none!important;
}

.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.skip-link {
  position:absolute;
  left:1rem;
  top:-5rem;
  background:white;
  padding:.7rem;
  z-index:10;
}

.skip-link:focus {
  top:.5rem;
}

.topbar {
  background:#12243e;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1.1rem max(2rem,calc((100vw - 1720px)/2));
  gap:1rem;
}

.brand {
  font-weight:750;
  font-size:1.2rem;
  color:#fff;
  text-decoration:none;
  letter-spacing:-.03em;
}

.brand:hover {
  color:#fff;
}

.brand span {
  font-size:.875rem;
  letter-spacing:0;
  font-weight:400;
  border-left:1px solid #58708f;
  margin-left:1rem;
  padding-left:1rem;
  color:#d3dfee;
}

.read-only {
  font-size:.875rem;
  color:#c4d2e6;
}

main {
  max-width:1784px;
  margin:auto;
  padding:2.5rem 2rem 1rem;
}

.page-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:2rem;
  margin-bottom:1.7rem;
}

h1 {
  font-size:2rem;
  line-height:1.2;
  letter-spacing:-.04em;
  margin:0 0 .65rem;
}

.page-heading p {
  color:var(--muted);
  margin:0;
  max-width:65rem;
}

.heading-meta {
  text-align:right;
  white-space:nowrap;
  display:grid;
  gap:.2rem;
}

.heading-meta span {
  color:var(--muted);
  font-size:.875rem;
}

.heading-meta strong {
  font-weight:650;
}

.overview {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:1rem;
  margin-bottom:1.25rem;
}

.overview a {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:.2rem 1rem;
  padding:1.2rem 1.4rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  color:#182b45;
  text-decoration:none;
  box-shadow:0 2px 3px #162c4903;
}

.overview a:hover {
  border-color:#8ba9d5;
  background:#fbfdff;
}

.overview span {
  font-weight:650;
}

.overview strong {
  grid-column:2;
  grid-row:1/3;
  font-size:2rem;
  font-weight:650;
  color:var(--blue);
  line-height:1;
}

.overview small {
  font-size:.875rem;
  color:var(--muted);
}

.date-note {
  font-size:.875rem;
  color:var(--muted);
  margin:0 0 2rem;
}

.table-section {
  scroll-margin-top:1rem;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  margin:1.5rem 0 2rem;
  overflow:hidden;
}

.section-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:1.25rem 1.4rem .8rem;
  gap:1rem;
}

.section-heading h2 {
  margin:0;
  font-size:1.3rem;
  letter-spacing:-.02em;
}

.section-heading .result-count {
  color:var(--muted);
  font-size:.875rem;
}

.toolbar {
  display:flex;
  gap:1rem;
  align-items:flex-end;
  flex-wrap:wrap;
  padding:0 1.4rem 1.2rem;
}

.control {
  display:grid;
  gap:.3rem;
  font-size:.875rem;
  color:var(--muted);
}

.search-control {
  flex:1;
  min-width:220px;
  max-width:470px;
}

input[type=search],select {
  border:1px solid #aebdd0;
  background:#fff;
  border-radius:6px;
  color:#182b45;
  padding:.55rem .7rem;
  min-height:42px;
  width:100%;
}

select {
  appearance:none;
  padding-right:2.3rem;
  background-image:linear-gradient(45deg,transparent 50%,#52647a 50%),linear-gradient(135deg,#52647a 50%,transparent 50%);
  background-position:calc(100% - 17px) 18px,calc(100% - 12px) 18px;
  background-size:5px 5px;
  background-repeat:no-repeat;
  max-width:310px;
}

.checkbox-control {
  display:flex;
  align-items:center;
  gap:.5rem;
  color:#263c59;
  font-size:.875rem;
  min-height:42px;
}

.checkbox-control input {
  width:18px;
  height:18px;
  accent-color:var(--blue);
}

.reset-button {
  background:#f4f7fb;
  color:#314762;
  border:1px solid #c7d3e2;
  border-radius:6px;
  min-height:42px;
  padding:.5rem .85rem;
  font-size:.875rem;
}

.reset-button:hover {
  background:#e8eff8;
}

.sort-description {
  padding:.5rem 1.4rem;
  background:#f8fafd;
  border-top:1px solid var(--line);
  font-size:.8rem;
  color:var(--muted);
}

.table-scroll {
  overflow:auto;
  max-height:76vh;
  overscroll-behavior-x:contain;
}

table {
  border-collapse:separate;
  border-spacing:0;
  width:100%;
  font-size:.9rem;
  table-layout:fixed;
  min-width:1320px;
}

caption {
  text-align:left;
  padding:.8rem 1.4rem;
  color:var(--muted);
  font-size:.875rem;
}

th {
  position:sticky;
  top:0;
  background:#edf2f8;
  z-index:1;
  border-top:1px solid var(--line);
  border-bottom:1px solid #cbd7e6;
  text-align:left;
  font-size:.8rem;
  font-weight:650;
  color:#354963;
  padding:.8rem 1rem;
}

th button {
  border:0;
  background:none;
  color:inherit;
  padding:0;
  text-align:left;
  font-weight:inherit;
  width:100%;
  display:flex;
  align-items:center;
  gap:.4rem;
}

th[aria-sort=ascending] button,th[aria-sort=descending] button {
  color:var(--blue);
}

th[aria-sort=ascending] button::after {
  content:"A–Z";
  font-size:.65rem;
  background:#dce8fc;
  border-radius:3px;
  padding:.1rem .25rem;
}

th[aria-sort=descending] button::after {
  content:"Z–A";
  font-size:.65rem;
  background:#dce8fc;
  border-radius:3px;
  padding:.1rem .25rem;
}

th.amount[aria-sort=ascending] button::after {
  content:"+";
}

th.amount[aria-sort=descending] button::after {
  content:"−";
}

th.name {
  width:15%;
}

th.account {
  width:15%;
}

th.amount {
  width:12%;
}

th.duration {
  width:13%;
}

th.status {
  width:13%;
}

th.alerts {
  width:24%;
}

th.links {
  width:8%;
}

td {
  padding:1rem;
  border-bottom:1px solid #e6ecf4;
  vertical-align:top;
  overflow-wrap:anywhere;
}

tbody tr:last-child td {
  border-bottom:0;
}

tbody tr:hover {
  background:#f8fbff;
}

.provider {
  font-weight:680;
  display:block;
  font-size:.94rem;
}

.plan {
  display:block;
  color:var(--muted);
  margin-top:.25rem;
  font-size:.85rem;
}

.secondary {
  display:block;
  font-size:.8rem;
  color:var(--muted);
  margin-top:.3rem;
}

.unknown {
  color:#61728a;
}

.price {
  font-weight:650;
  font-variant-numeric:tabular-nums;
}

.status-text {
  font-weight:550;
  display:block;
}

.alert {
  border-left:3px solid #b7c8df;
  padding-left:.65rem;
  margin:0 0 .6rem;
  font-size:.85rem;
}

.alert:last-child {
  margin-bottom:0;
}

.alert.warning {
  border-color:#c98014;
}

.alert.danger {
  border-color:#bf4545;
}

.alert.info {
  border-color:#557fac;
}

.alert strong {
  display:block;
  font-weight:650;
  margin-bottom:.1rem;
}

.details {
  margin-top:.7rem;
  font-size:.85rem;
}

.details summary {
  color:var(--blue);
  cursor:pointer;
  width:fit-content;
}

.details-content {
  margin-top:.6rem;
  color:#40546f;
}

.details-content p {
  margin:.5rem 0;
}

.details-content ul {
  padding-left:1.1rem;
  margin:.5rem 0;
}

.details-content li {
  margin:.3rem 0;
}

.external-link {
  display:block;
  font-size:.85rem;
  margin-bottom:.5rem;
}

.empty {
  text-align:center;
  padding:2.5rem;
  color:var(--muted);
}

.error {
  padding:1rem 1.2rem;
  background:#fff3f1;
  color:#87382c;
  border:1px solid #e7b5ac;
  border-radius:8px;
  margin-bottom:1rem;
}

footer {
  max-width:1784px;
  margin:auto;
  padding:0 2rem 2rem;
  font-size:.8rem;
  color:var(--muted);
}

@media(min-width:1900px) {
  .table-scroll {
    max-height:80vh;
  }
}

@media(max-width:850px) {
  main {
    padding:1.8rem 1rem 1rem;
  }
  .topbar {
    padding:1rem;
  }
  .page-heading {
    gap:1rem;
  }
  h1 {
    font-size:1.65rem;
  }
  .overview {
    gap:.65rem;
  }
  .overview a {
    padding:1rem;
    grid-template-columns:1fr;
  }
  .overview strong {
    grid-column:1;
    grid-row:auto;
    font-size:1.7rem;
    margin:.3rem 0;
  }
  .overview small {
    display:none;
  }
  .overview span {
    font-size:.875rem;
  }
  .heading-meta {
    font-size:.85rem;
  }
  .brand span {
    display:none;
  }
  .section-heading,.toolbar {
    padding-left:1rem;
    padding-right:1rem;
  }
  .toolbar {
    gap:.7rem;
  }
  .section-heading {
    align-items:flex-start;
  }
  .table-scroll {
    max-height:70vh;
  }
  footer {
    padding-left:1rem;
    padding-right:1rem;
  }
}

@media(prefers-reduced-motion:no-preference) {
  html {
    scroll-behavior:smooth;
  }
}

@media print {
  body {
    background:white;
  }
  .topbar,.overview,.toolbar,.skip-link,footer {
    display:none;
  }
  main {
    padding:0;
    max-width:none;
  }
  .table-section {
    border:0;
    overflow:visible;
  }
  .table-scroll {
    overflow:visible;
    max-height:none;
  }
  table {
    min-width:0;
    font-size:8pt;
  }
  th {
    position:static;
    font-size:8pt;
  }
  td,th {
    padding:5pt;
  }
  .details[open] .details-content {
    display:block;
  }
  .sort-description {
    display:none;
  }
}

