:root {
  --bg: #fcfcfa;
  --fg: #1c1e21;
  --muted: #5c6470;
  --line: #e3e5e8;
  --accent: #0b6bcb;
  --card: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --fg: #e8eaed;
    --muted: #9aa3af;
    --line: #2b2f36;
    --accent: #6cb2f7;
    --card: #1b1e24;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font:
    16px/1.55 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}
main {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
h1 {
  font-size: 1.7rem;
  margin: 1.2rem 0 0.5rem;
}
h2 {
  font-size: 1.15rem;
  margin: 1.6rem 0 0.4rem;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: 0.01em;
}
.wordmark .logo {
  width: 1.4rem;
  height: 1.4rem;
  display: block;
}
.nav nav a {
  margin-left: 1.1rem;
  color: var(--muted);
}
.nav nav a:hover {
  color: var(--accent);
}

.intro p {
  max-width: 46rem;
  color: var(--muted);
}

#filter {
  margin: 0.8rem 0;
  padding: 0.45rem 0.7rem;
  width: 16rem;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  color: var(--fg);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card);
}
th,
td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  white-space: nowrap;
}
thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  border-bottom: 2px solid var(--line);
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.3;
  max-width: 8rem;
}

/* Sticky product column keeps row identity while the rest scrolls. */
#compare td.name,
#compare thead th:first-child {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
}
#compare thead th:first-child {
  z-index: 3;
}
#compare tbody tr:hover td.name {
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
}

/* Tri-state glyphs. Colors match the /log status badges. */
.g {
  font-size: 0.95rem;
}
.g.yes {
  color: #1e8e3e;
}
.g.no {
  color: #c0392b;
}
.g.na {
  color: var(--muted);
  opacity: 0.6;
}
#compare .g {
  display: block;
  text-align: center;
}
#compare thead th[data-col="free_while_idle"],
#compare thead th[data-col="usage_billed"],
#compare thead th[data-col="memory_snapshots"],
#compare thead th[data-col="wake_on_request"],
#compare thead th[data-col="gpu"],
#compare thead th[data-col="docker"] {
  text-align: center;
}

/* Accessible tooltips: dotted underline is the affordance; the bubble
   shows on hover and on keyboard focus. */
.tipwrap {
  position: relative;
  display: inline-block;
}
.tip {
  border-bottom: 1px dotted var(--muted);
  cursor: help;
}
.tip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 5;
  width: 15rem;
  max-width: 60vw;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 7px;
  padding: 0.5rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--fg);
  white-space: normal;
  line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.tipwrap:hover .tooltip,
.tip:focus-visible + .tooltip {
  display: block;
}
/* Sticky cells form their own stacking contexts, so an open tooltip must
   lift its whole header cell above sibling sticky cells. */
thead th:has(.tipwrap:hover),
thead th:has(.tip:focus-visible) {
  z-index: 10;
}
#compare thead th:nth-last-child(-n + 4) .tooltip {
  left: auto;
  right: 0;
}

/* Pricing column: compact normalized rate by default, the provider's full
   wording when expanded. */
td.price {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}
td.price .p-c {
  display: inline-block;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
/* Long text cells clamp with an ellipsis; the column's expand button or
   the product page has the full wording. Glyph cells are short and
   unaffected. */
#compare td:not(.name):not(.price):not(.cell-full) {
  max-width: 15rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* An expanded column's cells wrap in place, capped so one verbose cell
   cannot blow up the layout. */
#compare td.cell-full {
  white-space: normal;
  min-width: 16rem;
  max-width: 24rem;
  line-height: 1.45;
}
#compare .p-f {
  display: none;
}
#compare td.price.cell-full .p-c {
  display: none;
}
#compare td.price.cell-full .p-f {
  display: inline;
}
.expander {
  margin-left: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--card);
  color: var(--accent);
  font-size: 0.7rem;
  padding: 0.05rem 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}
.expander:hover {
  border-color: var(--accent);
}
thead th[data-dir="asc"]::after {
  content: " \2191";
}
thead th[data-dir="desc"]::after {
  content: " \2193";
}
tbody tr {
  border-top: 1px solid var(--line);
}
tbody tr:hover {
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
}
td.name a {
  font-weight: 600;
  color: var(--fg);
}

.specs {
  max-width: 42rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.specs th {
  width: 12rem;
  color: var(--muted);
  font-weight: 500;
  white-space: normal;
}
.specs td {
  white-space: normal;
}
.provider .summary {
  max-width: 46rem;
  font-size: 1.05rem;
}
.website {
  color: var(--muted);
  margin-top: -0.4rem;
}
.sources {
  padding-left: 1.2rem;
}
.sources li {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}
.verified {
  color: var(--muted);
  font-size: 0.9rem;
}
.notes {
  max-width: 46rem;
}

.turn {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 0.9rem 1.1rem;
  margin: 0.9rem 0;
}
.turn header {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.85rem;
}
.turn h2 {
  margin: 0.35rem 0;
  font-size: 1.05rem;
}
.turn dl {
  display: flex;
  gap: 1.6rem;
  margin: 0.4rem 0 0;
}
.turn dt {
  font-size: 0.75rem;
  color: var(--muted);
}
.turn dd {
  margin: 0;
  font-size: 0.9rem;
}
.badge {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.05rem 0.55rem;
  font-size: 0.75rem;
}
.turn.failed .badge.status {
  border-color: #c0392b;
  color: #c0392b;
}
.turn.applied .badge.status {
  border-color: #1e8e3e;
  color: #1e8e3e;
}
.citations {
  font-size: 0.85rem;
  color: var(--muted);
}

.diagram {
  max-width: 46rem;
  margin: 1.25rem 0;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
}
.diagram text.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.about ol {
  max-width: 46rem;
  padding-left: 1.2rem;
}
.about ol li {
  margin: 0.5rem 0;
}
.about p {
  max-width: 46rem;
}

.legend {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
}

.empty {
  color: var(--muted);
}
footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
footer p {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

/* Small screens: the brand compresses to the periscope, the sticky name
   column wraps inside a cap so data keeps most of the width, and the
   table tightens a step. */
@media (max-width: 430px) {
  .wordmark-text {
    display: none;
  }
  .nav nav a {
    margin-left: 0.8rem;
  }
}
@media (max-width: 700px) {
  #compare {
    font-size: 0.875rem;
  }
  #compare th,
  #compare td {
    padding: 0.45rem 0.55rem;
  }
  #compare td.name {
    max-width: 7.5rem;
    white-space: normal;
    line-height: 1.3;
  }
}
