:root {
  --un-blue: #006fb7;
  --dark-blue: #374c80;
  --ink: #202631;
  --muted: #66717e;
  --line: #d8dee6;
  --soft: #f4f7fa;
  --header-height: 126px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100vh;
  height: 100dvh; /* mobile URL bar: keep the footer inside the visible viewport */
  min-width: 760px;
  padding: 18px 22px 10px;
  background: #fff;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
}

h1 {
  margin: 0;
  color: var(--un-blue);
  font-size: 24px;
  line-height: 1.15;
}

.page-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 570px;
}

.toolbar label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.toolbar input {
  flex: 1;
  min-width: 250px;
  height: 34px;
  border: 1px solid #aeb8c4;
  border-radius: 3px;
  padding: 5px 9px;
}

.toolbar button {
  height: 34px;
  border: 1px solid #9ca8b5;
  border-radius: 3px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.toolbar button:hover,
.toolbar button:focus-visible {
  border-color: var(--un-blue);
}

.toolbar .primary-button {
  border-color: var(--un-blue);
  color: #fff;
  background: var(--un-blue);
}

.table-status {
  display: flex;
  justify-content: space-between;
  min-height: 26px;
  color: var(--muted);
  font-size: 12px;
}

.sort-hint {
  text-align: right;
}

.error-line {
  align-self: start;
  border-left: 3px solid #b42318;
  padding: 8px 10px;
  color: #8f1d14;
  background: #fff3f2;
}

#resolution-table {
  height: 100%;
  min-height: 0;
  border-color: #bdc6d0;
}

#site-footer {
  min-height: 22px;
  padding-top: 7px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.tabulator {
  font-size: 12px;
  background: #fff;
}

.tabulator .tabulator-header {
  border-bottom-color: #9ca8b5;
  color: #1e2a38;
  background: #edf2f7;
}

.tabulator .tabulator-header .tabulator-col {
  border-right-color: #ccd3dc;
  background: #edf2f7;
}

.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
  background: #e2eaf2;
}

.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 6px 5px 4px;
}

.tabulator .tabulator-header-filter input,
.tabulator .tabulator-header-filter select {
  height: 25px;
  border: 1px solid #aeb8c4;
  border-radius: 2px;
  padding: 2px 4px;
  background: #fff;
}

.tabulator-row {
  min-height: 30px;
  border-bottom-color: #e4e8ed;
  background: #fff;
}

.tabulator-row:nth-child(even) {
  background: #fafbfd;
}

.tabulator-row:hover {
  background: #edf6fc;
}

.tabulator-row .tabulator-cell {
  border-right-color: #e1e5ea;
  padding: 6px 7px;
  line-height: 1.35;
  white-space: normal;
  user-select: text;
}

.cell-link,
.text-link {
  border: 0;
  padding: 0;
  color: var(--un-blue);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-decoration: none;
}

.cell-link:hover,
.cell-link:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
}

.drawer {
  position: fixed;
  z-index: 20;
  top: 0;
  right: 0;
  width: 42vw;
  min-width: 520px;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid #b8c2cd;
  padding: 24px 32px 40px;
  background: #fff;
  box-shadow: -8px 0 22px rgb(24 39 57 / 18%);
  transform: translateX(105%);
  transition: transform 180ms ease-out;
  visibility: hidden;
}

.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
}

.drawer-close {
  position: sticky;
  z-index: 2;
  top: 0;
  float: right;
  width: 34px;
  height: 34px;
  border: 1px solid #aeb8c4;
  border-radius: 50%;
  color: #2d3742;
  background: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 28px;
}

.drawer-content {
  clear: both;
  padding-top: 6px;
}

.drawer-content h2 {
  margin: 0 48px 8px 0;
  color: var(--un-blue);
  font-size: 23px;
  line-height: 1.25;
}

.drawer-content h3 {
  margin: 23px 0 7px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--dark-blue);
  font-size: 15px;
}

.drawer-content p {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.48;
}

.drawer-content .meta-line {
  color: #465260;
}

.drawer-content .muted-line {
  color: var(--muted);
}

.detail-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  margin: 0;
  padding: 5px 0;
  font-size: 13px;
  line-height: 1.45;
}

.document-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 7px 0 0;
}

.document-links a {
  color: var(--un-blue);
  font-size: 13px;
  text-decoration: none;
}

.document-links a:hover,
.document-links a:focus-visible {
  text-decoration: underline;
}

.document-links a + a::before {
  content: "·";
  margin: 0 8px;
  color: #9099a4;
  text-decoration: none;
}

.loading-line {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .page-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
  }

  .toolbar {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 899px) {
  .drawer {
    width: 100vw;
    min-width: 0;
    border-left: 0;
    padding-right: 24px;
    padding-left: 24px;
  }

  /* Phone layout: one screen, one scroll context (the table), footer in view. */
  .page-shell {
    min-width: 0;
    padding: 10px 10px 4px;
  }
  .page-header {
    gap: 6px;
    padding-bottom: 8px;
  }
  h1 {
    font-size: 17px;
  }
  .page-header p {
    font-size: 11px;
    margin: 2px 0 0;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar label {
    display: none;
  }
  .table-status {
    font-size: 11px;
    padding-bottom: 4px;
  }
  #site-footer {
    font-size: 10.5px;
    line-height: 1.5;
    padding-top: 4px;
    white-space: normal;
  }
  /* the collapsed-fields panel Tabulator opens under a row */
  .tabulator-responsive-collapse {
    font-size: 12px;
  }
  .tabulator-responsive-collapse td {
    padding: 2px 6px 2px 0;
    vertical-align: top;
  }
}

@media (prefers-reduced-motion: reduce) {
  .drawer {
    transition: none;
  }
}

.footer-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}
.footer-link:hover {
  color: #006FB7;
}
