/* Hosted-site additions. Shared theme tokens only, so dark and light modes match. */

/* =========================================================
   ALLOWANCE IN THE HEADER
   A compact figure beside the appearance controls: "3 / 5" with
   "requests" or "Next available in 02:41:18" underneath. On phones
   the two lines sit side by side. The full sentence is in aria-label.
   ========================================================= */
.hosted-usage {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-right: 22px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  line-height: 1.15;
  white-space: nowrap;
}
.hosted-usage-count {
  font-size: 14px;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.hosted-usage-short {
  display: none;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hosted-usage-detail {
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.hosted-usage[data-state="exhausted"],
.hosted-usage[data-state="paused"] {
  border-color: var(--blue);
}
.hosted-usage[data-state="exhausted"] .hosted-usage-count,
.hosted-usage[data-state="paused"] .hosted-usage-count {
  color: var(--blue);
}
.hosted-usage:hover {
  border-color: var(--blue);
}
.hosted-usage:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* =========================================================
   FREE LIMIT NOTIFICATION
   A native dialog: the same countdown as the header, one close
   control, no colour-only meaning. Centred, narrow, quiet.
   ========================================================= */
.hosted-limit {
  width: min(92vw, 420px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
}
.hosted-limit::backdrop {
  background: rgba(8, 10, 14, 0.62);
}
.hosted-limit-body {
  margin: 0;
  padding: 30px 30px 26px;
  display: grid;
  gap: 14px;
}
.hosted-limit .eyebrow {
  margin: 0;
}
.hosted-limit-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.2px;
}
.hosted-limit-clock {
  margin: 6px 0 2px;
  display: grid;
  gap: 4px;
}
.hosted-limit-time {
  font-size: clamp(38px, 11vw, 48px);
  line-height: 1;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.hosted-limit-clock span {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.hosted-limit-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--secondary);
}
.hosted-limit-note a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hosted-limit-close {
  justify-self: start;
  min-height: 46px;
  padding: 0 22px;
  margin-top: 6px;
  border: 0;
  background: var(--text);
  color: var(--bg, #101112);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.hosted-limit-close:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
@media (max-width: 480px) {
  .hosted-limit-body {
    padding: 26px 22px 22px;
  }
  .hosted-limit-close {
    justify-self: stretch;
  }
}

/* =========================================================
   OPEN SOURCE / EDUCATION
   Editorial: a wide headline block, then the Source Edition
   (left) beside the How To (right), then a thin line of secondary
   actions. Type and rules carry the hierarchy; no fills, no gradients.
   ========================================================= */
.hosted-source {
  margin: 0 5.2% 44px;
  padding: 52px 0 0;
  border-top: 1px solid var(--line);
}
.hosted-source-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 18px 56px;
  align-items: end;
  margin-bottom: 40px;
}
.hosted-source-head .eyebrow {
  grid-column: 1 / -1;
  margin: 0;
}
.hosted-source h2 {
  font-size: clamp(34px, 3.6vw, 52px);
  font-weight: 400;
  letter-spacing: -1.4px;
  line-height: 1.04;
  margin: 0;
}
.hosted-source-lede {
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--secondary);
  margin: 0;
}
.hosted-source-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 56px;
  border-top: 1px solid var(--line);
}
.hosted-edition,
.hosted-howto {
  padding: 30px 0 34px;
  min-width: 0;
}
.hosted-edition {
  border-right: 1px solid var(--line);
  padding-right: 56px;
}
.hosted-edition-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--blue);
  margin: 0 0 14px;
}
.hosted-edition h3,
.hosted-howto h3 {
  font-size: 24px;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 0 0 20px;
}
.hosted-edition-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 9px 22px;
  margin: 0 0 26px;
}
.hosted-edition-meta div {
  display: contents;
}
.hosted-edition-meta dt {
  font-size: 10px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  align-self: baseline;
}
.hosted-edition-meta dd {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
/* The one primary action in the section: solid, compact, quiet. */
.hosted-download {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 22px;
  background: var(--text);
  color: var(--bg, #101112);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.2px;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.hosted-download svg {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}
.hosted-download:hover {
  opacity: 0.88;
}
.hosted-download:hover svg {
  transform: translateY(2px);
}
.hosted-download:active {
  transform: translateY(1px);
}
.hosted-download:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.hosted-edition-note {
  max-width: 46ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin: 18px 0 0;
}
.hosted-howto-list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 0;
}
.hosted-howto-list li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--secondary);
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.hosted-howto-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.hosted-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--text);
  line-height: 1;
  padding: 0;
  min-height: 0;
  padding-bottom: 6px;
}
.hosted-link span {
  display: inline-block;
  transition: transform 0.15s ease;
}
.hosted-link:hover {
  color: var(--blue);
  border-bottom-color: var(--blue);
}
.hosted-link:hover span {
  transform: translateX(3px);
}
.hosted-link:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}
.hosted-card-status,
.hosted-share-status {
  font-size: 12px;
  color: var(--muted);
}
.hosted-card-status:empty,
.hosted-share-status:empty {
  display: none;
}
.hosted-card-status {
  display: block;
  margin-top: 10px;
}
.hosted-source-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.hosted-source-footer a,
.hosted-share button {
  color: var(--secondary);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.hosted-source-footer a:hover,
.hosted-share button:hover {
  color: var(--blue);
}
.hosted-share button:focus-visible,
.hosted-source-footer a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}
.hosted-share {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
@media (prefers-reduced-motion: reduce) {
  .hosted-download,
  .hosted-download svg,
  .hosted-link span,
  .hosted-share button,
  .hosted-source-footer a {
    transition: none;
  }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .hosted-source-head {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }
  .hosted-source-body {
    grid-template-columns: minmax(0, 1fr);
  }
  .hosted-edition {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
  }
}
@media (max-width: 800px) {
  .hosted-usage {
    margin-right: 10px;
    padding: 5px 9px;
    flex-direction: row;
    gap: 7px;
    align-items: baseline;
  }
  .hosted-usage-count {
    font-size: 13px;
  }
  /* Phones show the count and a short clock; the sentence stays in the aria-label. */
  .hosted-usage-detail {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .hosted-usage-short {
    display: inline;
  }
  .hosted-usage-unit {
    display: none;
  }
  /* The version label yields to the allowance on the narrowest headers. */
  .masthead .tool-name {
    display: none;
  }
  .hosted-source {
    margin: 0 24px 32px;
    padding-top: 34px;
  }
  .hosted-source-head {
    margin-bottom: 26px;
  }
  .hosted-source h2 {
    font-size: clamp(30px, 9vw, 36px);
  }
  .hosted-edition,
  .hosted-howto {
    padding: 24px 0 26px;
  }
  .hosted-download {
    width: 100%;
    justify-content: center;
  }
  .hosted-share {
    margin-left: 0;
  }
}
