/* ---------- Layout state ---------- */

.wiki-page { --side-top: calc(var(--nav-top) + var(--nav-h) + 22px); }

/* ---------- Search ---------- */

.wiki-search {
  position: relative;
  width: min(100%, 600px);
  text-align: left;
}
.page-hero .wiki-search { margin-top: clamp(20px, 2.2vw, 28px); }
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field > svg {
  position: absolute;
  left: 18px;
  width: 22px;
  height: 22px;
  color: var(--blue);
  pointer-events: none;
}
.search-field input {
  width: 100%;
  min-height: 60px;
  padding: 0 58px 0 52px;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: var(--cloud);
  box-shadow: 0 5px 0 var(--navy);
  font: 600 17px/1.2 var(--font-body);
  color: var(--navy);
  -webkit-appearance: none;
  appearance: none;
}
.search-field input::placeholder {
  font-weight: 500;
  color: var(--ink-mute);
  opacity: 1;
}
.search-field input::-webkit-search-cancel-button,
.search-field input::-webkit-search-decoration { -webkit-appearance: none; }
.search-key {
  position: absolute;
  right: 16px;
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--frost);
  font: 700 14px/1 var(--font-mono);
  color: var(--ink-mute);
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.search-field input:focus ~ .search-key,
.search-field input:not(:placeholder-shown) ~ .search-key { opacity: 0; }
@media (hover: none) {
  .search-key { display: none; }
  .search-field input { padding-right: 18px; }
}
.no-js .wiki-search { display: none; }

.search-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: min(62vh, 470px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--navy), 0 26px 48px -22px rgba(0, 22, 53, 0.45);
}
.search-list a {
  display: block;
  padding: 11px 14px 12px;
  border-radius: 12px;
  transition: background-color 0.15s ease;
}
.search-list a:hover,
.search-list a:focus-visible {
  background: var(--aqua-soft);
}
.search-list a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 0;
}
.search-list li + li { margin-top: 2px; }
.hit-where {
  display: block;
  font: 700 11.5px/1.2 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.hit-title {
  display: block;
  margin-top: 4px;
  font: 600 16.5px/1.3 var(--font-display);
  color: var(--navy);
}
.hit-text {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.search-list mark {
  padding: 0 2px;
  border-radius: 4px;
  background: var(--aqua-hi);
  color: var(--navy);
}
.search-empty {
  padding: 12px 14px;
  color: var(--ink-soft);
}

/* ---------- Layout ---------- */

.wiki-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 210px;
  align-items: start;
  gap: clamp(28px, 3vw, 48px);
  max-width: calc(1380px + 2 * var(--pad));
  margin-top: -96px;
  padding-bottom: clamp(36px, 4vw, 56px);
}
.wiki-main { min-width: 0; }

/* ---------- Sidebar ---------- */

.wiki-side {
  position: sticky;
  top: var(--side-top);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - var(--side-top) - 22px);
}
.side-nav {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 10px 14px;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 22px;
  box-shadow: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.wiki-search--side { flex: none; }
.wiki-search--side .search-field input {
  min-height: 50px;
  padding-left: 44px;
  border-radius: 15px;
  box-shadow: 0 4px 0 var(--navy);
  font-size: 15.5px;
}
.wiki-search--side .search-field > svg {
  left: 15px;
  width: 19px;
  height: 19px;
}
.wiki-search--side .search-key { right: 12px; }
.wiki-search--side .search-panel {
  right: auto;
  width: min(440px, calc(100vw - 80px));
}
.side-title,
.rail-title,
.sheet-title {
  font: 700 12px/1 var(--font-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
}
.side-title { padding: 0 10px 10px; }
.side-group {
  margin: 14px 10px 4px;
  font: 700 11px/1 var(--font-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.side-link {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 11px;
  font: 600 15px/1.25 var(--font-display);
  color: var(--navy);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.side-link:hover { background: var(--frost); }
.side-link.is-active {
  background: var(--aqua-soft);
  box-shadow: inset 0 0 0 2px var(--navy);
}
.side-num {
  flex: none;
  min-width: 18px;
  font-size: 12.5px;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}
.side-link.is-active .side-num { color: var(--blue); }
.side-sub {
  margin: 3px 0 2px 19px;
  padding-left: 8px;
  border-left: 2px solid var(--line);
}
.side-sub li + li { margin-top: 1px; }

/* ---------- On this page ---------- */

.wiki-rail {
  position: sticky;
  top: var(--side-top);
  max-height: calc(100vh - var(--side-top) - 22px);
  overflow-y: auto;
  padding: 6px 4px 6px 0;
  scrollbar-width: thin;
}
.rail-title { margin-bottom: 14px; }
.rail-list { border-left: 2px solid var(--line); }
.rail-list a {
  display: block;
  margin-left: -2px;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.35;
  color: var(--ink-soft);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.rail-list a:hover { color: var(--navy); }
.rail-list .rail-sub a {
  padding-left: 26px;
  font-size: 13.5px;
}
.rail-list a.is-active {
  border-left-color: var(--blue);
  font-weight: 700;
  color: var(--navy);
}

/* ---------- Server info ---------- */

.quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.quick-card {
  padding: 22px 24px 24px;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 22px;
  box-shadow: var(--edge-card);
}
.quick-card--join { grid-column: 1 / -1; }
.quick-card .hc-head {
  margin: 0 0 14px;
  font-size: clamp(23px, 2vw, 27px);
}
.quick-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.quick .hc-row {
  align-items: flex-start;
  gap: 6px;
  padding: 12px 14px 13px;
  border: 2px solid var(--line);
  background: var(--ice);
  text-align: left;
}
.quick .hc-copy:hover {
  border-color: var(--navy);
  background: var(--aqua-soft);
}
.quick-facts div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 2px solid var(--line);
}
.quick-facts div:last-child { border-bottom: 2px solid var(--line); }
.quick-facts dt {
  font-weight: 600;
  color: var(--ink-soft);
}
.quick-facts dd {
  font: 700 17px/1.2 var(--font-display);
  color: var(--navy);
}
.quick-links li + li { border-top: 2px solid var(--line); }
.quick-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  font: 600 17px/1.2 var(--font-display);
  color: var(--navy);
  transition: color 0.2s ease;
}
.quick-links a[target]::after {
  content: "\2197";
  margin-left: auto;
  color: var(--blue);
  transition: transform 0.4s var(--ease-soft);
}
.quick-links a:hover { color: var(--blue); }
.quick-links a:hover::after { transform: translate(2px, -2px); }
.quick-links svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: var(--blue);
}

/* ---------- Articles ---------- */

.entry { padding-top: clamp(64px, 7vw, 100px); }
.entry-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 32%, 290px);
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding-bottom: clamp(24px, 2.6vw, 32px);
  border-bottom: 2px solid var(--line);
}
.entry-head--plain { grid-template-columns: minmax(0, 1fr); }
.entry-num {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 34px;
  padding: 0 9px;
  background: var(--aqua);
  border: 2px solid var(--navy);
  border-radius: 11px;
  box-shadow: 0 3px 0 var(--navy);
  font: 700 15px/1 var(--font-display);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.entry-title {
  margin-top: 14px;
  font-family: "Bricolage Grotesque", var(--font-display);
  font-size: clamp(34px, 3.6vw, 48px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.025em;
}
.entry-lead {
  margin-top: 12px;
  max-width: 58ch;
  font-size: clamp(17px, 1.35vw, 18.5px);
  font-weight: 500;
  line-height: 1.6;
  color: var(--ink-soft);
}
.entry-shot { --cut: 20px; }
.entry-shot--art picture {
  display: block;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 55%, var(--sky-low) 100%);
}
.entry-shot--art img {
  padding: 8% 10%;
  object-fit: contain;
}

.entry-body { padding-top: clamp(26px, 3vw, 36px); }
.entry-body > * + * { margin-top: 16px; }
.entry-body > h3 {
  margin-top: clamp(40px, 4.4vw, 54px);
  font-size: clamp(24px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.entry-body > h4 {
  margin-top: 32px;
  font-size: clamp(19.5px, 1.7vw, 22px);
  font-weight: 600;
  line-height: 1.2;
}
.entry-body > h4,
.entry-body > h5 {
  margin-bottom: 0;
  font-family: var(--font-display);
  color: var(--navy);
}
.entry-body > h5 {
  margin-top: 26px;
  font: 700 13px/1.2 var(--font-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.entry-body > :first-child { margin-top: 0; }
.entry-body > h3 + *,
.entry-body > h4 + *,
.entry-body > h5 + * { margin-top: 12px; }
.entry-body p,
.entry-body li {
  max-width: 70ch;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.entry-body strong { color: var(--navy); }
.entry a:not(.cmd-copy) {
  font-weight: 600;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.entry a:not(.cmd-copy):hover { color: var(--navy); }
.entry code,
.wiki-help code {
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.entry-body ul,
.entry-body ol {
  display: grid;
  gap: 8px;
}
.entry-body ul > li {
  position: relative;
  padding-left: 30px;
}
.entry-body ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.85em - 7px);
  width: 20px;
  height: 14px;
  background: url("../assets/img/cloud-bullet.svg") center / contain no-repeat;
}
.entry-body ol { counter-reset: step; }
.entry-body ol > li {
  position: relative;
  min-height: 30px;
  padding-left: 42px;
  counter-increment: step;
}
.entry-body ol > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--navy);
  border-radius: 9px;
  background: var(--aqua);
  font: 700 14px/1 var(--font-display);
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.entry-body ul.cols {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 28px;
  max-width: 640px;
}

.cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 560px;
  min-height: 56px;
  padding: 7px 7px 7px 16px;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 15px;
  box-shadow: 0 4px 0 var(--navy);
}
.cmd code {
  padding: 0;
  background: none;
  font-size: 15.5px;
  color: var(--navy);
}
.cmd-copy {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 2px solid var(--navy);
  border-radius: 11px;
  background: var(--aqua);
  box-shadow: 0 2px 0 var(--navy);
  font: 600 14.5px/1 var(--font-display);
  color: var(--navy);
  cursor: pointer;
  transition: transform 0.18s var(--ease-soft), box-shadow 0.18s var(--ease-soft), background-color 0.25s ease;
}
.cmd-copy svg {
  width: 15px;
  height: 15px;
}
.cmd-copy:hover {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--navy);
  background: var(--aqua-hi);
}
.cmd-copy.is-done { background: var(--aqua-soft); }
.no-js .cmd-copy { display: none; }

.table-wrap {
  overflow-x: auto;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 18px;
  box-shadow: var(--edge);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap th {
  padding: 13px 16px 12px;
  background: var(--aqua-soft);
  border-bottom: 2px solid var(--navy);
  font: 700 12.5px/1.25 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: left;
  color: var(--navy);
}
.table-wrap td {
  padding: 11px 16px;
  border-top: 2px solid var(--line);
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  vertical-align: top;
}
.table-wrap tbody tr:first-child td { border-top: 0; }
.table-wrap td:first-child {
  font-weight: 700;
  color: var(--navy);
}
@media (min-width: 760px) {
  .table-wrap td:first-child code { white-space: nowrap; }
}
.table-wrap td ul {
  display: grid;
  gap: 3px;
}
.table-wrap td li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.45;
}
.table-wrap td li::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(0.725em - 5.5px);
  width: 15px;
  height: 11px;
  background: url("../assets/img/cloud-bullet.svg") center / contain no-repeat;
}

.entry-figure {
  width: min(100%, 290px);
  padding: 8px;
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 18px;
  box-shadow: var(--edge);
}
.entry-figure img {
  width: 100%;
  border-radius: 11px;
}

.is-flash { animation: flash 1.8s var(--ease-out); }
@keyframes flash {
  0%,
  30% { background: var(--aqua-hi); box-shadow: 0 0 0 8px var(--aqua-hi); border-radius: 6px; }
  100% { background: transparent; box-shadow: 0 0 0 8px transparent; border-radius: 6px; }
}

/* ---------- Commands ---------- */

.entry-head--commands { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); }
.cmd-filter { align-self: end; }
.cmd-filter .search-field input {
  min-height: 52px;
  padding-left: 46px;
  border-radius: 15px;
  box-shadow: 0 4px 0 var(--navy);
  font-size: 16px;
}
.cmd-filter .search-field > svg {
  left: 16px;
  width: 19px;
  height: 19px;
}
.cmd-count {
  margin-top: 10px;
  font: 700 12px/1.2 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
}
.no-js .cmd-filter { display: none; }
.entry-body .cmd-note {
  font-size: 15.5px;
  line-height: 1.6;
}
.cmd-or {
  margin-inline: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-mute);
}
.cmd-empty {
  padding: 18px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- Help ---------- */

.wiki-help {
  display: grid;
  justify-items: start;
  gap: 12px;
  margin-top: clamp(72px, 8vw, 110px);
  padding: clamp(24px, 3vw, 36px);
  background: var(--cloud);
  border: 2px solid var(--navy);
  border-radius: 24px;
  box-shadow: var(--edge-card);
}
.wiki-help h2 {
  margin: 0;
  font-family: "Bricolage Grotesque", var(--font-display);
  font-size: clamp(26px, 2.4vw, 32px);
  font-weight: 800;
  letter-spacing: -0.025em;
}
.wiki-help p {
  max-width: 56ch;
  color: var(--ink-soft);
}
.wiki-help p a {
  font-weight: 700;
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.wiki-help p a:hover { color: var(--navy); }
.wiki-help .btn { margin-top: 8px; }

/* ---------- Phone contents ---------- */

.wiki-fab {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 18px 0 15px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--aqua);
  box-shadow: 0 4px 0 var(--navy);
  font: 700 16px/1 var(--font-display);
  color: var(--navy);
  cursor: pointer;
  transform: translateY(170%);
  transition: transform 0.5s var(--ease-out);
}
.wiki-fab svg {
  width: 20px;
  height: 20px;
}
.wiki-fab.is-shown { transform: none; }

.wiki-sheet {
  width: 100%;
  max-width: 560px;
  max-height: min(86vh, 760px);
  margin: auto auto 0;
  padding: 0;
  overflow: hidden;
  background: var(--ice);
  border: 2px solid var(--navy);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  color: var(--ink);
}
.wiki-sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.45s var(--ease-out);
}
.wiki-sheet::backdrop { background: rgba(0, 22, 53, 0.5); }
@keyframes sheet-in {
  from { transform: translateY(40px); opacity: 0; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 12px 20px;
}
.wiki-sheet .sheet-close { display: grid; }
.sheet-close svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}
.wiki-sheet .wiki-search {
  width: auto;
  margin: 0 16px 6px;
}
.wiki-sheet .search-field input {
  min-height: 54px;
  font-size: 16px;
}
.sheet-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px calc(22px + env(safe-area-inset-bottom));
}
.sheet-list .side-nav {
  overflow: visible;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.sheet-list .side-title { display: none; }
.sheet-list .side-link {
  padding-block: 10px;
  font-size: 16.5px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1279px) {
  .wiki-layout { grid-template-columns: 228px minmax(0, 1fr); }
  .wiki-rail { display: none; }
}

@media (max-width: 979px) {
  .wiki-layout { grid-template-columns: minmax(0, 1fr); }
  .wiki-layout > .wiki-side { display: none; }
  .wiki-main {
    width: 100%;
    max-width: 760px;
    margin-inline: auto;
  }
}
@media (min-width: 980px) {
  .wiki-fab,
  .wiki-sheet { display: none !important; }
}

@media (max-width: 759px) {
  .wiki-layout { margin-top: -48px; }

  .quick { grid-template-columns: minmax(0, 1fr); }
  .quick-rows { grid-template-columns: minmax(0, 1fr); }

  .entry-head {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .entry-shot {
    order: -1;
    width: min(100%, 420px);
  }
  .entry-head--commands { grid-template-columns: minmax(0, 1fr); }
  .entry-body ul.cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .table-stack {
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .table-stack table,
  .table-stack tbody,
  .table-stack tr,
  .table-stack td {
    display: block;
    width: 100%;
  }
  .table-stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .table-stack tr {
    padding: 12px 15px 13px;
    background: var(--cloud);
    border: 2px solid var(--navy);
    border-radius: 16px;
    box-shadow: 0 4px 0 var(--navy);
  }
  .table-stack tr + tr { margin-top: 12px; }
  .table-stack td {
    padding: 3px 0;
    border: 0;
    font-size: 15px;
  }
  .table-stack td:first-child {
    padding-bottom: 4px;
    font: 700 17.5px/1.25 var(--font-display);
  }
  .table-stack td[data-label]::before {
    content: attr(data-label);
    margin-right: 8px;
    font: 700 11px/1.3 var(--font-body);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--blue);
  }
  .table-stack td ul { margin-top: 4px; }
  .cmd-table table,
  .cmd-table tbody,
  .cmd-table tr,
  .cmd-table td {
    display: block;
    width: 100%;
  }
  .cmd-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .cmd-table tr { padding: 12px 16px 13px; }
  .cmd-table tbody tr + tr { border-top: 2px solid var(--line); }
  .cmd-table td,
  .cmd-table tbody tr:first-child td {
    padding: 0;
    border: 0;
  }
  .cmd-table td + td {
    margin-top: 5px;
    font-size: 15px;
  }
  .cmd { padding-left: 14px; }
  .cmd-copy span { display: none; }
  .cmd-copy {
    width: 42px;
    padding: 0;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wiki-fab { transition: none; }
  .wiki-sheet[open],
  .is-flash { animation: none; }
}
