:root {
  --bg: #e6dfd2;
  --paper: #f6f3ec;
  --ink: #1b1714;
  --muted: #5c5348;
  --line: #d3cbbd;
  --bar: #1b1714;
  --bar-text: #f6f3ec;
  --save: #0d6a45;
  --more: #8d3418;
  --copper: #a24b24;
  --s3: #f3ead6;
  --warn: #fff4e8;
  --focus: #1b1714;
}

* { box-sizing: border-box; }

html { scroll-padding-top: 56px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px 0 18px;
  background: var(--bar);
  color: var(--bar-text);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  font-size: 16px;
}

.bar-meta {
  margin: 0;
  color: #d9d0c3;
  font-size: 13px;
  white-space: nowrap;
}

.lang-menu { margin-left: auto; position: relative; }

.lang-menu summary {
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 2px 0 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  font-weight: 600;
}

.lang-menu summary::-webkit-details-marker { display: none; }

.lang-menu summary::after {
  content: "";
  margin-left: 6px;
  border: 4px solid transparent;
  border-top-color: #f6f3ec;
  transform: translateY(2px);
}

.lang-menu[open] summary::after { transform: translateY(-2px) rotate(180deg); }

.lang-menu ul {
  position: absolute;
  right: 0;
  top: 48px;
  margin: 0;
  padding: 6px;
  min-width: 148px;
  list-style: none;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(27, 23, 20, 0.12);
}

.lang-menu a {
  display: block;
  padding: 6px 8px;
  text-decoration: none;
}

.lang-menu a[aria-current="page"] { font-weight: 700; }

.lang-menu a:hover { background: #efe8da; }

.first-screen {
  align-content: start;
  display: grid;
  gap: 8px;
  padding: 12px 18px 8px;
}

h1 {
  max-width: none;
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.035em;
  font-weight: 650;
  font-weight: 600;
}

.lede, .unit-note, .foot-note {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.inputs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}

input {
  height: 36px;
  width: 100%;
  padding: 0 8px;
  border: 1px solid #c9c0b2;
  background: white;
  color: var(--ink);
  font: 15px/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.table-wrap {
  overflow-x: auto;
  background: var(--paper);
  border: 1px solid var(--line);
}

table { border-collapse: collapse; width: 100%; min-width: 920px; }

caption {
  caption-side: bottom;
  text-align: left;
  padding: 6px 8px 8px;
  color: var(--muted);
  font-size: 12px;
}

th, td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 13.5px;
  vertical-align: top;
}

th:first-child, td:first-child { text-align: left; }

thead th {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  font-weight: 600;
  background: #efeae1;
}

tbody th { font-weight: 650; font-weight: 600; }

tr[data-provider="s3"] { background: var(--s3); }

tr[data-provider="wasabi"].is-out { background: var(--warn); }

.pname { display: block; }

.flag {
  display: block;
  margin-top: 2px;
  color: var(--copper);
  font-size: 11.5px;
  font-weight: 550;
  font-weight: 500;
}

.save { color: var(--save); font-weight: 650; font-weight: 600; }
.more { color: var(--more); font-weight: 650; font-weight: 600; }

.thresholds {
  display: grid;
  gap: 8px 18px;
  padding: 8px 10px;
  background: var(--paper);
  border-left: 3px solid var(--copper);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 1100px) {
  .thresholds { grid-template-columns: 1fr 1fr; }
}

.thresholds p { margin: 0; font-size: 13px; line-height: 1.35; }

.sheet {
  padding: 8px 18px 20px;
  display: grid;
  gap: 16px;
}

.sheet h2 {
  margin: 0 0 6px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.sheet p, .sheet li { font-size: 14.5px; }

.formulas, .caveats, .example-list { margin: 0; padding-left: 18px; }

.example-list li { margin: 0 0 4px; }

.example-flag {
  font-weight: 650;
  font-weight: 600;
}

.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

.sources a { font-weight: 600; }

.partner {
  padding: 10px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.partner ul { margin: 8px 0 0; padding-left: 18px; }

.disclosure { margin: 0; }

.site-footer {
  margin: 0;
  padding: 0 18px;
  height: 32px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}

.missing { padding: 18px; max-width: 68ch; }

@media (min-width: 1440px) {
  h1 { white-space: nowrap; font-size: 28px; }
  .first-screen { padding: 10px 22px 6px; }
}

@media (max-width: 860px) {
  .bar-meta { display: none; }
  .inputs { grid-template-columns: 1fr 1fr; }
  h1 { font-size: 22px; white-space: normal; }
  .site-footer { white-space: normal; height: auto; padding-top: 6px; padding-bottom: 6px; }
}
