:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7f9;
  color: #17242d;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top, #e6f6f2 0, #f4f7f9 45%, #eef2f5 100%);
}

.card {
  width: min(32rem, calc(100vw - 3rem));
  padding: 2.25rem;
  border: 1px solid #dbe4e8;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem rgb(20 48 60 / 12%);
}
.card-wide { width: min(76rem, calc(100vw - 3rem)); }

.brand {
  color: #087f6b;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 { margin: .65rem 0 1rem; font-size: 1.75rem; }
h2 { margin: 0 0 .35rem; font-size: 1.25rem; }
h3 { margin: 0 0 .65rem; font-size: 1rem; }
p { line-height: 1.55; }
code {
  display: block;
  padding: .9rem 1rem;
  overflow-wrap: anywhere;
  border-radius: .75rem;
  background: #edf8f5;
  color: #075e50;
  font-size: 1rem;
}
.qr-shell {
  display: grid;
  min-height: 16rem;
  margin: 1rem 0;
  place-items: center;
}
#totp-qr {
  box-sizing: border-box;
  width: min(16rem, 100%);
  height: auto;
  padding: .5rem;
  border: 1px solid #dbe4e8;
  border-radius: .75rem;
  background: #fff;
}
.manual-label { margin-bottom: .5rem; font-size: .9rem; color: #52656e; }
label { display: block; margin: 1.25rem 0 .4rem; font-weight: 700; }
input {
  box-sizing: border-box;
  width: 100%;
  padding: .85rem 1rem;
  border: 1px solid #b8c7cd;
  border-radius: .7rem;
  font: inherit;
  letter-spacing: .2em;
}
select {
  box-sizing: border-box;
  width: 100%;
  padding: .85rem 2.5rem .85rem 1rem;
  border: 1px solid #b8c7cd;
  border-radius: .7rem;
  background: #fff;
  color: inherit;
  font: inherit;
}
button {
  width: 100%;
  margin-top: 1rem;
  padding: .9rem 1rem;
  border: 0;
  border-radius: .7rem;
  background: #087f6b;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: #40545e; }
.compact { width: auto; margin: 0; padding: .65rem .9rem; white-space: nowrap; }
.status:empty { display: none; }
.gate {
  padding: .8rem 1rem;
  border-radius: .7rem;
  background: #fff5d9;
  color: #6b4d00;
}
.hint { margin-top: 1.5rem; color: #62747d; font-size: .875rem; }
.monitoring { margin: 1.5rem 0; padding-top: 1.25rem; border-top: 1px solid #dbe4e8; }
.packages { margin: 1.5rem 0; padding-top: 1.25rem; border-top: 1px solid #dbe4e8; }
.section-heading { display: flex; gap: 1rem; align-items: start; justify-content: space-between; }
.section-heading p { margin: 0; color: #62747d; font-size: .9rem; }
.station-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: .8rem; }
.station { padding: 1rem; border: 1px solid #dbe4e8; border-radius: .8rem; background: #f8fbfc; }
.station div { margin-top: .3rem; color: #40545e; font-size: .875rem; overflow-wrap: anywhere; }
.release-card { margin: 1rem 0; padding: 1rem; border: 1px solid #b9ddd6; border-radius: .8rem; background: #edf8f5; }
.installer-steps { margin: 1rem 0; padding: 1rem; border: 2px solid #087f6b; border-radius: .8rem; background: #edf8f5; color: #173b34; }
.installer-steps p { margin: .45rem 0 0; }
.installer-steps code { display: inline; padding: .1rem .35rem; font-weight: 750; }
.release-card:empty { display: none; }
.release-card div { margin-top: .3rem; color: #40545e; font-size: .875rem; overflow-wrap: anywhere; }
.pharmacy-list { display: grid; gap: .8rem; }
.table-groups { display: grid; gap: 1rem; }
.network-group { min-width: 0; padding: 1rem; border: 1px solid #bfd0d6; border-radius: .9rem; background: #fff; }
.network-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.network-group-heading h3 { margin: 0; color: #075e50; letter-spacing: .04em; overflow-wrap: anywhere; }
.network-group .release-card,
.network-group .pharmacy-list,
.network-group .station-list,
.network-group .data-table-scroll { margin-top: .8rem; }
.station-list > .network-group { grid-column: 1 / -1; }
.network-unavailable { color: #805b00; }
.pharmacy { padding: 1rem; border: 1px solid #dbe4e8; border-radius: .8rem; background: #f8fbfc; }
.slot-list { display: grid; gap: .55rem; }
.slot-row { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding-top: .65rem; border-top: 1px solid #e2e9ec; }
.slot-description { display: grid; gap: .15rem; min-width: 0; }
.slot-description span { color: #62747d; font-size: .85rem; }
.download-button { margin: 0; }
.slot-message { margin: 0; color: #40545e; font-size: .85rem; }
.slot-message:empty { display: none; }
.inline-hint { margin: .5rem 0 0; }

.table-controls {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) minmax(12rem, .45fr);
  gap: .8rem;
  margin: 1rem 0;
  padding: .9rem;
  border: 1px solid #dbe4e8;
  border-radius: .8rem;
  background: #f8fbfc;
}
.table-control { display: grid; gap: .35rem; margin: 0; color: #40545e; font-size: .85rem; }
.table-control span { font-weight: 750; }
.table-search { letter-spacing: normal; }
.data-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid #dbe4e8;
  border-radius: .75rem;
  background: #fff;
}
.data-table {
  width: 100%;
  min-width: 48rem;
  border-collapse: collapse;
  color: #263942;
  font-size: .875rem;
}
.monitoring .data-table { min-width: 62rem; }
.data-table caption { text-align: left; }
.data-table th,
.data-table td { padding: .7rem .75rem; border-bottom: 1px solid #e2e9ec; text-align: left; vertical-align: top; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf8f5;
  color: #173b34;
  font-size: .78rem;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f8fbfc; }
.table-sort {
  width: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  white-space: nowrap;
}
.table-sort:hover { color: #087f6b; }
.sort-direction { color: #087f6b; }
.monospace-cell { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.slot-status { display: inline-flex; padding: .25rem .5rem; border-radius: 999px; font-weight: 750; white-space: nowrap; }
.slot-status-free { background: #def5ec; color: #075e50; }
.slot-status-claimed { background: #e7edf0; color: #40545e; }
.slot-status-conflict { background: #fde8e6; color: #9b2c20; }
.table-muted { color: #829199; }
.data-table td small { display: block; margin-top: .2rem; color: #62747d; font-size: .75rem; }
.table-empty { padding: 1.2rem !important; color: #62747d; text-align: center !important; }
.table-pagination {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  margin-top: .75rem;
  color: #62747d;
  font-size: .8rem;
}
.pagination-actions { display: flex; gap: .5rem; }
.pagination-button { padding: .5rem .7rem; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 48rem) {
  .section-heading { display: block; }
  .compact { width: 100%; margin-top: .75rem; }
  .slot-row { display: block; }
  .download-button { margin-top: .75rem; }
  .table-controls { grid-template-columns: 1fr; }
  .table-pagination { display: grid; }
  .pagination-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .pagination-button { margin: 0; }
}

@media (max-width: 42rem) {
  body { display: block; }
  .card { box-sizing: border-box; width: calc(100vw - 1rem); margin: .5rem; padding: 1.25rem; }
  .data-table-scroll { overflow: visible; border: 0; background: transparent; }
  .data-table,
  .monitoring .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td { display: block; width: 100%; min-width: 0; box-sizing: border-box; }
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }
  .data-table tbody { display: grid; gap: .75rem; }
  .data-table tbody tr { overflow: hidden; border: 1px solid #dbe4e8; border-radius: .7rem; background: #fff; }
  .data-table td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 38%) minmax(0, 1fr);
    gap: .65rem;
    padding: .6rem .75rem;
    border-bottom: 1px solid #edf1f3;
    overflow-wrap: anywhere;
  }
  .data-table td::before { content: attr(data-label); color: #52656e; font-size: .75rem; font-weight: 750; text-transform: uppercase; }
  .data-table td.table-empty { display: block; }
  .data-table td.table-empty::before { content: none; }
  .data-table .download-button { width: 100%; margin: 0; }
}
