/* Panels ("GUI windows") */

/*
 * Panels are light stone on a dark page, so they re-declare the text colour
 * tokens for everything inside them. Custom properties inherit, so every
 * descendant rule that reads var(--color-text) picks up the dark-on-light
 * pair automatically instead of the light-on-dark page defaults.
 */
.card {
  background: var(--color-surface);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised), var(--shadow-sm);
  --color-text: #23262a;
  --color-text-muted: #43494f;
  --color-accent: #14606f;
  --color-eyebrow: #2f5b20;
  color: var(--color-text);
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-tools {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* Generator card */

.generator-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.generator-card[hidden] {
  display: none;
}

.generator-card:hover {
  background: #d2d2d2;
}

.generator-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.generator-card__name {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-ui);
}

.generator-card__desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  flex-grow: 1;
}

.generator-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
}

.badge-new {
  background: var(--mc-gold);
  color: #3a2a00;
}

.badge-active {
  background: #cfe8bd;
  color: #24571a;
}

.badge-beta {
  background: #f6dfa4;
  color: #6b4400;
}

.badge-coming_soon {
  background: #b9b9b9;
  color: #3a3f45;
}

.badge-disabled {
  background: #b9b9b9;
  color: #3a3f45;
}

.badge-edition {
  background: #dcdcdc;
  color: #2a2e33;
  font-family: var(--font-pixel);
  font-size: 0.7rem;
}

/* Tool directory filters */

.tool-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.tool-search {
  flex: 1 1 240px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  font-size: 1rem;
  background: var(--mc-slot);
  color: #23262a;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 0 14px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  background: var(--mc-deep-raised);
  color: #dfe4e8;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}

.chip:hover {
  background: #3a3f45;
  color: #fff;
}

.chip[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.45);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--color-text-muted);
}

/* Advertisement inventory
 *
 * Slots collapse while empty. Ad-provider code can populate the content node,
 * remove the hidden attribute, and switch data-ad-state to "filled".
 */

.ad-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 22px;
  border: 2px dashed #596168;
  background: #202429;
  color: #c5ccd2;
  text-align: center;
}

.ad-slot[hidden] {
  display: none;
}

.ad-slot--leaderboard {
  min-height: 112px;
}

.ad-slot--infeed {
  min-height: 180px;
}

.ad-slot--rectangle {
  min-height: 250px;
  max-width: 336px;
}

.ad-slot--skyscraper {
  width: 160px;
  min-height: 600px;
}

.ad-slot__label {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.68rem;
  color: #9da6ad;
}

.ad-slot__content {
  width: 100%;
  min-width: 0;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.ad-slot[data-ad-state="filled"] {
  padding: 0;
  border-style: solid;
  background: transparent;
}

.ad-slot--page {
  width: calc(100% - 40px);
  max-width: var(--content-max);
  margin: 28px auto;
}

.directory-ad-slot {
  margin: 24px 0;
}

.ad-rail {
  display: none;
  position: fixed;
  top: 104px;
  z-index: 8;
  width: 160px;
  height: min(600px, calc(100vh - 124px));
  min-height: 0;
  margin: 0;
}

@media (min-width: 1680px) and (min-height: 680px) {
  .has-ad-rails .ad-rail:not([hidden]) {
    display: grid;
  }

  .ad-rail--left {
    left: calc((100vw - var(--content-max)) / 4 - 80px);
  }

  .ad-rail--right {
    right: calc((100vw - var(--content-max)) / 4 - 80px);
  }

}

@media (min-width: 1920px) and (min-height: 680px) {
  .has-ad-rails .ad-rail {
    width: 300px;
  }

  .ad-rail--left {
    left: calc((100vw - var(--content-max)) / 4 - 150px);
  }

  .ad-rail--right {
    right: calc((100vw - var(--content-max)) / 4 - 150px);
  }
}

@media (max-width: 600px) {
  .ad-slot--page {
    width: calc(100% - 32px);
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .ad-slot--leaderboard {
    min-height: 100px;
  }

  .ad-slot--infeed {
    min-height: 160px;
  }
}

/* Forms */

.field {
  margin-bottom: 18px;
}

.field label,
.field legend {
  display: block;
  font-family: var(--font-ui);
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.field-help {
  font-size: 0.84rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.field-help code {
  background: rgba(0, 0, 0, 0.1);
  padding: 1px 4px;
}

/* Inputs read as recessed inventory slots (inset bevel, no rounding) */
/*
 * Matches every text-like input rather than an enumerated list of types —
 * password and email were previously missed here and fell back to the
 * browser's default ~20-character width while text inputs stretched to 100%.
 */
.field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  font-size: 1rem;
  background: var(--mc-slot);
  color: #23262a;
  font-family: inherit;
}

.field textarea {
  min-height: 80px;
  padding: 10px 12px;
}

.field input:disabled,
.field select:disabled {
  background: #b0b0b0;
  color: #5c6167;
  cursor: not-allowed;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
  border-color: var(--mc-redstone);
}

/* Searchable select (progressive enhancement over a native <select>) */

.searchable-select {
  position: relative;
}

.searchable-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.searchable-select__trigger {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  font-size: 0.95rem;
  font-family: var(--font-ui);
  font-weight: 700;
  background: #9d9d9d;
  color: #1c1f22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}

.searchable-select__trigger:hover {
  background: #adadad;
}

.searchable-select__trigger[aria-expanded="true"] {
  box-shadow: var(--bevel-inset);
}

.searchable-select__value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-select__caret {
  color: #2c3034;
  flex: 0 0 auto;
}

.field.has-error .searchable-select__trigger {
  border-color: var(--mc-redstone);
}

.searchable-select__popup {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--color-surface);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised), var(--shadow-sm);
  padding: 8px;
}

.searchable-select__search {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  background: var(--mc-slot);
  color: #23262a;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 6px;
}

.searchable-select__list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
}

.searchable-select__option {
  padding: 8px 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #23262a;
  border: 2px solid transparent;
}

.searchable-select__option.is-highlighted {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--mc-outline);
}

.searchable-select__option.is-selected {
  font-weight: 700;
}

.searchable-select__option.is-disabled {
  color: #6b7178;
  cursor: not-allowed;
}

.searchable-select__empty {
  padding: 8px 10px;
  color: #4d545b;
  font-size: 0.88rem;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Author display rules beat the UA stylesheet, so the flex above would defeat
   el.hidden = true on the capability-gated checkbox fields. */
.field-checkbox[hidden] {
  display: none;
}

.field-checkbox input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
}

.field-error {
  color: #8f251c;
  font-size: 0.85rem;
  margin-top: 4px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-weight: 600;
}

.repeatable-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.repeatable-row > * {
  flex: 1;
  min-width: 0;
}

.repeatable-row > * > * {
  min-width: 0;
}

.repeatable-row .btn-remove {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
}

.repeatable-row input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  background: var(--mc-slot);
  color: #23262a;
  font-size: 1rem;
}

fieldset {
  border: 2px solid var(--mc-outline);
  padding: 16px;
  margin: 0 0 18px;
}

/* Accordion */

.accordion-trigger {
  width: 100%;
  text-align: left;
  background: #9d9d9d;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  padding: 12px 16px;
  min-height: 44px;
  font-family: var(--font-ui);
  font-weight: 700;
  color: #1c1f22;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-trigger:hover {
  background: #adadad;
}

.accordion-trigger[hidden] {
  display: none;
}

.accordion-trigger[aria-expanded="true"] {
  box-shadow: var(--bevel-inset);
}

.accordion-panel {
  padding: 16px 4px 4px;
}

.accordion-panel[hidden] {
  display: none;
}

/* Command output */

.command-output {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
}

.command-output h2 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.command-output__badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* The generated command reads as the in-game console: near-black, pixel
   font, recessed into the panel. */
.command-output__code {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  padding: 14px;
  font-family: var(--font-pixel);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  max-height: 260px;
  overflow: auto;
  white-space: pre;
}

.command-output__code.is-wrapped {
  white-space: pre-wrap;
  word-break: break-word;
}

.command-output__code.is-empty {
  color: #8c9a8e;
  font-family: var(--font-sans);
  white-space: normal;
}

.command-output__code.is-outdated {
  opacity: 0.55;
}

.command-output__length {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  background: #dcebd5;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  color: #24571a;
  font-size: 0.82rem;
}

.command-output__length[hidden] {
  display: none;
}

.command-output__length-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.command-output__length-head strong {
  font-family: var(--font-pixel);
}

.command-output__length-track {
  height: 8px;
  overflow: hidden;
  background: #6f776d;
  border: 1px solid var(--mc-outline);
}

.command-output__length-track span {
  display: block;
  width: 0;
  height: 100%;
  background: #3f8f35;
}

.command-output__length[data-state="long"] {
  background: #f6dfa4;
  color: #6b4400;
}

.command-output__length[data-state="long"] .command-output__length-track span {
  background: #b35a19;
}

.command-output__explanation {
  background: var(--color-primary-soft);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  color: #24571a;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
}

.command-output__explanation p {
  margin: 4px 0 0;
  color: #23262a;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.command-output__warnings {
  background: #f6dfa4;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  color: #6b4400;
  padding: 12px 14px;
  font-size: 0.86rem;
}

.command-output__warnings ul {
  margin: 4px 0 0;
  padding-left: 18px;
}

.command-output__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.command-output__status {
  font-size: 0.85rem;
  min-height: 1.2em;
  font-weight: 600;
}

.command-output__status[data-state="success"] {
  color: #1f6b3d;
}

.command-output__status[data-state="error"] {
  color: #8f251c;
}

/* Shared CmdCraftTools confirmation, notice and text-entry dialog. */
.mc-modal {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  max-height: min(86vh, 680px);
  margin: auto;
  padding: 0;
  overflow: visible;
  color: #f2f4f5;
  background: transparent;
  border: 0;
}

.mc-modal::backdrop {
  background: rgba(7, 9, 10, 0.78);
  backdrop-filter: blur(2px);
}

.mc-modal__frame {
  position: relative;
  overflow: hidden;
  background: var(--mc-deep-raised);
  border: 3px solid var(--mc-outline);
  box-shadow: var(--bevel-raised), 0 12px 0 rgba(0, 0, 0, 0.5);
}

.mc-modal__frame::before {
  content: "";
  display: block;
  height: 10px;
  background:
    linear-gradient(90deg, transparent 0 12px, #70ad45 12px 24px, transparent 24px 36px) 0 0 / 36px 5px repeat-x,
    linear-gradient(#579336 0 50%, #76502c 50% 100%);
  border-bottom: 2px solid var(--mc-outline);
}

.mc-modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}

.mc-modal__icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  color: #3a2a00;
  background: var(--mc-gold);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  font-family: var(--font-pixel);
  font-weight: 700;
}

.mc-modal--danger .mc-modal__icon {
  color: #fff;
  background: #a93226;
}

.mc-modal__title {
  flex: 1 1 auto;
  margin: 0;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 1.08rem;
  line-height: 1.45;
}

.mc-modal__close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  color: #f2f4f5;
  background: var(--mc-stone-muted);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  font: 700 1.15rem/1 var(--font-ui);
  cursor: pointer;
}

.mc-modal__close:active {
  box-shadow: var(--bevel-inset);
}

.mc-modal__form {
  margin: 0;
}

.mc-modal__body {
  display: grid;
  gap: 14px;
  padding: 4px 18px 18px;
}

.mc-modal__message {
  margin: 0;
  color: #d7dde1;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.mc-modal__field {
  display: grid;
  gap: 7px;
}

.mc-modal__label {
  color: #f2f4f5;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 700;
}

.mc-modal__input {
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  color: #f2f4f5;
  background: var(--mc-slot);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  font: inherit;
}

.mc-modal__input:focus {
  outline: 3px solid var(--mc-gold);
  outline-offset: 2px;
}

.mc-modal__feedback {
  margin: -4px 0 0;
  color: #f6c35b;
  font-size: 0.82rem;
}

.mc-modal__feedback.is-valid {
  color: #9ad47b;
}

.mc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  background: rgba(0, 0, 0, 0.18);
  border-top: 2px solid var(--mc-outline);
}

.mc-modal__actions .btn {
  min-width: 112px;
}

.mc-modal__danger {
  color: #fff;
  background: #a93226;
  border-color: var(--mc-outline);
  box-shadow: var(--bevel-raised);
}

.mc-modal__danger:hover:not(:disabled) {
  background: #bf3b2e;
}

.mc-modal__danger:disabled {
  color: #9ca3a8;
  background: #4a4f54;
  cursor: not-allowed;
  box-shadow: var(--bevel-inset);
}

@media (max-width: 520px) {
  .mc-modal {
    width: calc(100vw - 24px);
  }

  .mc-modal__head {
    padding: 14px 14px 10px;
  }

  .mc-modal__body {
    padding: 4px 14px 16px;
  }

  .mc-modal__actions {
    padding: 12px 14px 14px;
  }

  .mc-modal__actions .btn {
    flex: 1 1 140px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .mc-modal[open] .mc-modal__frame {
    animation: mc-modal-enter 140ms ease-out;
  }

  @keyframes mc-modal-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* "What's new" popup
   Built by whats-new.js and appended to <body>, so these rules are the only
   place its look is defined. A native <dialog> supplies the top layer, the
   backdrop and focus trapping; ::backdrop is styled to match the dark page. */

.whatsnew {
  padding: 0;
  border: 2px solid var(--mc-outline);
  background: var(--color-surface);
  box-shadow: var(--bevel-raised), 0 10px 0 0 rgba(0, 0, 0, 0.45);
  width: min(560px, calc(100vw - 32px));
  max-height: min(80vh, 720px);
  color: #23262a;
  --color-text: #23262a;
  --color-text-muted: #43494f;
}

.whatsnew::backdrop {
  background: rgba(9, 10, 12, 0.72);
}

.whatsnew__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  max-height: inherit;
}

.whatsnew__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.whatsnew__badge {
  background: var(--mc-gold);
  color: #4a3200;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  padding: 3px 9px;
  font-family: var(--font-ui);
  font-size: 0.74rem;
  font-weight: 700;
}

.whatsnew__version {
  font-family: var(--font-pixel);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.whatsnew__close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--mc-stone-muted);
  color: #23262a;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  cursor: pointer;
}

.whatsnew__close:active {
  box-shadow: var(--bevel-inset);
}

.whatsnew__title {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.1rem;
  line-height: 1.5;
}

.whatsnew__summary {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.whatsnew__summary[hidden] {
  display: none;
}

.whatsnew__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 0;
}

.whatsnew__item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  background: var(--mc-slot);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  font-size: 0.9rem;
  line-height: 1.6;
}

.whatsnew__tag {
  flex: none;
  padding: 1px 7px;
  border: 2px solid var(--mc-outline);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
}

.whatsnew__tag--new { background: #cfe8bd; color: #24571a; }
.whatsnew__tag--improved { background: #b8d6ea; color: #14425e; }
.whatsnew__tag--fixed { background: #f6dfa4; color: #6b4400; }

.whatsnew__text {
  min-width: 0;
  word-break: break-word;
}

.whatsnew__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.whatsnew__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.whatsnew__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

/* The popup lives on a light panel, where the page-level accent (a bright aqua
   picked for the dark background) does not have enough contrast. */
.whatsnew__history {
  font-size: 0.82rem;
  font-weight: 700;
  color: #14606f;
}
/* Worked examples and the version matrix
 *
 * Lives here rather than in tools.css because the guides reuse the same
 * blocks (see views/guides/item-components.html.php) and only load
 * guides.css — components.css is the sheet every page gets.
 *
 * Commands reuse the recessed console look of .command-output__code so an
 * example on the page and the live output above read as the same kind of
 * thing.
 *
 * Padding is split top/bottom rather than `padding: Xpx 0`, which would zero
 * the horizontal padding .container supplies. */
.tool-reference {
  padding-top: 28px;
  padding-bottom: 56px;
  border-top: 2px solid rgba(255, 255, 255, 0.1);
}

.tool-reference h2 {
  font-size: 1.1rem;
  margin: 28px 0 10px;
}

.tool-reference h2:first-child {
  margin-top: 0;
}

.tool-reference__lead {
  margin: 0 0 16px;
  max-width: 78ch;
  color: var(--color-text-muted);
}

.tool-reference__same {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  background: rgba(255, 255, 255, 0.04);
}

.tool-example {
  padding: 18px;
  margin-bottom: 14px;
}

.tool-example h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.tool-example__note {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  max-width: 78ch;
}

/* Long commands scroll inside their own box instead of pushing the page
   sideways on a phone. */
.tool-example__command {
  background: var(--color-code-bg);
  color: var(--color-code-text);
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-inset);
  padding: 12px;
  margin: 0 0 10px;
  font-family: var(--font-pixel);
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.tool-example__command code {
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

.tool-example__explain {
  margin: 0;
  font-size: 0.94rem;
}

.tool-example__tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 7px;
  border: 2px solid var(--mc-outline);
  background: var(--mc-deep-raised);
  color: #f4f4f8;
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: 1px;
}

.tool-example__warnings {
  margin: 10px 0 0;
  padding-left: 20px;
  font-size: 0.88rem;
  color: #8a5a12;
}

.tool-matrix {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-matrix__row {
  display: grid;
  /* minmax(0, …) so a long command can shrink its track instead of pushing
     the grid past the viewport. */
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--mc-outline);
  box-shadow: var(--bevel-raised);
  background: var(--mc-deep-raised);
}

.tool-matrix__versions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: start;
}

.tool-matrix__chip {
  padding: 3px 9px;
  border: 2px solid var(--mc-outline);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  font-weight: 700;
}

.tool-matrix__result .tool-example__command:last-child {
  margin-bottom: 0;
}

.tool-matrix__result .tool-example__warnings {
  color: #f2bf48;
}

.tool-reference__notes {
  margin: 0;
  padding-left: 20px;
  max-width: 78ch;
  color: var(--color-text-muted);
}

.tool-reference__notes li {
  margin-bottom: 8px;
}

@media (min-width: 961px) {
  .tool-matrix__row {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: start;
  }
}
