:root {
  --text: #212529;
  --primary: #767b47;
  --accent: #cf7933;
  --ok: #75b798;
  --no: #ea868f;
  --card: #f6f6f6;
  --star: #dee2e6;
  --track: #c8cacc;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font-family: "Segoe UI Variable", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 20px;
}
.container { padding: 0 14px 14px; }
h3, h5, p, ul { margin: 0; padding: 0; }
.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 2px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.14);
}
.icon { width: 20px; height: 20px; flex: none; }

/* resource count */
.resources-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.count-input {
  width: 110px; height: 32px; padding: 0 10px; font: inherit; color: var(--text);
  background: #fff; border: 1px solid #e0e0e0; border-bottom: 1px solid var(--primary); border-radius: 4px 4px 0 0;
}
.count-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.slider-wrap { margin: 16px 12px 24px; position: relative; }
.slider {
  width: 100%; height: 20px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
}
/* --p (0..1, set by app.js) is how far the thumb is along the track: olive up to the thumb, grey after it. */
.slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, var(--primary) calc(10px + (100% - 20px) * var(--p, 0)), var(--track) calc(10px + (100% - 20px) * var(--p, 0)));
}
.slider::-moz-range-track { height: 4px; border-radius: 2px; background: var(--track); }
.slider::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--primary); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--primary); border: 2px solid var(--primary); }
.slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--primary); border: 2px solid var(--primary); }
.slider:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
.ticks { position: relative; height: 16px; margin-top: 4px; }
.tick { position: absolute; left: var(--pos); transform: translateX(-50%); font-size: 12px; }
.tick:first-child { transform: translateX(-30%); }
.tick:last-child { transform: translateX(-70%); }

/* tiers */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; align-items: stretch; }
.tier-card { display: flex; flex-direction: column; }
/* Cards share row tracks (subgrid) so name, description, price, button and feature list each line up
   across a row of cards at any width or language; the shorter cards get the white space. */
@supports (grid-template-rows: subgrid) {
  .tier-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 6;
    row-gap: 0;
    align-content: start;
  }
  .tier-card > .tier-name { grid-row: 1; }
  .tier-card > .tier-description { grid-row: 2; }
  .tier-card > .tier-price { grid-row: 3; }
  .tier-card > .tier-subtitle { grid-row: 4; }
  .tier-card > .cta { grid-row: 5; align-self: start; }
  .tier-card > .features-always, .tier-card > .features-more { grid-row: 6; }
}
.tier-name { font-size: 24px; line-height: 32px; font-weight: 600; margin-bottom: 5px; }
.tier-description { margin-bottom: 5px; }
@supports not (grid-template-rows: subgrid) { .tier-description { min-height: 3.75rem; } }
.tier-price { font-size: 22px; line-height: 28px; font-weight: 600; margin-bottom: 5px; }
.tier-subtitle { margin-bottom: 20px; }
.cta {
  display: block; width: 100%; padding: 6px 12px; text-align: center; text-decoration: none; border-radius: 4px;
  background: var(--primary); color: #fff; font-weight: 600; margin-bottom: 20px;
}
.cta:hover { filter: brightness(1.08); }
.cta:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.features-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feature { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.icon.ok { color: var(--ok); }
.icon.no { color: var(--no); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.toggle {
  display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; margin-top: 8px; padding: 6px 12px;
  font: inherit; color: var(--text); background: transparent; border: 1px solid #8a8a8a; border-radius: 4px; cursor: pointer;
}
.toggle .icon { width: 16px; height: 16px; }
.features-more .features { margin-bottom: 8px; }

/* ribbon */
.ribbon { position: absolute; top: 0; right: 0; width: 44px; height: 44px; background: var(--primary); color: var(--star); clip-path: polygon(0 0, 50% 0, 100% 50%, 100% 100%); }
.ribbon-container { position: absolute; right: 0; }
.ribbon-content { width: 33px; height: 32px; display: flex; justify-content: center; align-items: center; transform: rotate(45deg); }
.star { width: 12px; height: 12px; }

/* Breakpoints follow the former Fluent grid: sm >= 600px, md >= 960px */
.features-always { display: none; }
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .features-always { display: block; }
  .features-more { display: none; }
}
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 599px) {
  .slider-wrap { display: none; }
}
[hidden] { display: none !important; }
#load-error { text-align: center; margin: 2rem 0; }
