.guide {
  background: #090d14;
  border-top: 1px solid #273548;
  color: #edf3fa;
}

.guide-section {
  padding-block: clamp(2.8rem, 6.5vw, 6.1rem);
  scroll-margin-top: .65rem;
}
.guide-section + .guide-section { border-top: 1px solid #202c3b; }
.guide-heading {
  display: grid;
  grid-template-columns: minmax(15rem, .9fr) minmax(0, 1.1fr);
  gap: .7rem clamp(1.2rem, 5vw, 4.5rem);
  align-items: end;
  margin-bottom: clamp(1.65rem, 3.5vw, 2.9rem);
}
.guide-heading h2, .install-summary h2 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 580;
  letter-spacing: -.04em;
}
.guide p, .guide dd, .guide td { color: #b9c5d4; }
.guide-heading p { max-width: 40rem; font-size: clamp(1rem, 1.5vw, 1.16rem); }
.guide strong { color: var(--ink); }
.guide p a { color: var(--blue); text-decoration: underline; text-underline-offset: .18em; }
.guide h3 { font-size: clamp(1.35rem, 2.4vw, 2rem); }
.guide h4 { margin: 0; color: var(--ink); font-size: 1rem; }

.guide-grid { display: grid; gap: clamp(1.1rem, 3vw, 2.5rem); }
.install-grid { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; }
.install-summary p { max-width: 33rem; margin-top: .8rem; }
.install-summary .primary { margin-top: 1.15rem; white-space: normal; }
.install-steps { display: grid; gap: .8rem; }
.command-block {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #29374a;
  border-radius: .8rem;
  background: #070b11;
}
.command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 3.15rem;
  padding: .55rem .95rem;
  border-bottom: 1px solid #212c3b;
  background: #101823;
}
.command-header h3, .command-header h4 { font: 620 .9rem/1.3 var(--body); }
.copy-command {
  border: 1px solid #34455c;
  border-radius: .35rem;
  padding: .24rem .61rem;
  background: #172333;
  color: var(--blue);
  font-size: .875rem;
  cursor: pointer;
}
.copy-command:hover { background: #24344b; }
.guide code, .guide kbd { font: .88em/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
.guide :not(pre) > code { color: #d5e7fd; overflow-wrap: anywhere; }
.guide pre {
  margin: 0;
  padding: 1rem .95rem;
  font: 1rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #cde2ff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 4;
}
.guide kbd {
  display: inline-block;
  border: 1px solid #425168;
  border-bottom-width: 2px;
  border-radius: .27rem;
  padding: .03em .32em;
  background: #151f2d;
  color: #e6effc;
  white-space: nowrap;
}

.guide-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #2a374a;
  border-radius: .75rem;
  background: #0d1520;
  overflow: hidden;
  color: #eaf1f8;
  text-align: left;
}
.guide-table th, .guide-table td { padding: .72rem .9rem; overflow-wrap: anywhere; }
.guide-table thead { background: #131f2e; }
.guide-table thead th { font-size: .875rem; font-weight: 640; color: #bdd5f6; }
.guide-table tbody th { font-weight: 550; vertical-align: top; }
.guide-table tbody tr:nth-child(even) { background: #101a27; }
.guide-table tbody :is(th, td) { border-top: 1px solid #202d3d; }
.shortcut-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.shortcut-grid th:first-child { width: 50%; }
.gesture-table th:first-child { width: 44%; }
.feature-grid, .theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.feature-grid article {
  border: 1px solid #29374a;
  border-radius: .8rem;
  padding: clamp(1rem, 2.5vw, 1.6rem);
  background: linear-gradient(155deg, #121d2b, #0e151f 75%);
}
.feature-grid h3 { font-size: clamp(1.25rem, 2vw, 1.7rem); }
.feature-grid p { margin-top: .5rem; }

.wallpaper-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; }
.wallpaper-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(1.7rem, 4vw, 3rem); }
.wallpaper-controls p, .wallpaper-settings p { margin-top: .6rem; }
.wallpaper-controls .command-block { margin-top: 1rem; }
.wallpaper-paths { display: grid; gap: .6rem; margin-block: .8rem; }
.wallpaper-paths div { border-left: 2px solid #51759f; padding-left: .7rem; }
.wallpaper-paths dt { color: var(--ink); font-weight: 620; }
.wallpaper-paths dd { margin-left: 0; }
.picker-preview, .theme-grid figure {
  margin: 0;
  border: 1px solid #29374a;
  border-radius: .8rem;
  overflow: hidden;
  background: #101823;
}
.picker-preview img, .theme-grid img { display: block; width: 100%; height: auto; }
.picker-preview figcaption { padding: .6rem .9rem; color: #b9c5d4; font-size: .875rem; }
.theme-grid figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .75rem .95rem;
  font-weight: 620;
}
.theme-grid figcaption span + span { color: #abc7e9; font-size: .875rem; font-weight: 550; }
.swatches {
  display: grid;
  grid-template-columns: repeat(5, minmax(4.35rem, 1fr));
  gap: .42rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.swatches li { min-width: 0; }
.swatches span {
  display: block;
  background: var(--swatch);
  height: 2.25rem;
  border-radius: .4rem;
  margin-bottom: .25rem;
}
.swatches small { display: block; font-size: .79rem; color: #b9c5d4; }
.guide-footnote { margin-top: 1rem; }

@media (max-width: 860px) {
  .feature-grid, .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallpaper-controls { grid-template-columns: 1fr; }
}
@media (max-width: 690px) {
  .guide-heading, .install-grid, .wallpaper-grid, .shortcut-grid { grid-template-columns: 1fr; }
  .guide-heading { align-items: start; }
}
@media (max-width: 460px) {
  .feature-grid, .theme-grid { grid-template-columns: 1fr; }
  .guide-table th, .guide-table td { padding: .53rem .58rem; }
  .swatches { grid-template-columns: repeat(auto-fit, minmax(4.35rem, 1fr)); }
}

.theme-open {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #070b11;
  cursor: zoom-in;
}
.theme-open .theme-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.theme-open:focus-visible { outline-offset: -4px; }
.theme-open:hover img { filter: brightness(1.09); }

html:has(.theme-viewer[open]) { overflow: hidden; }
.theme-viewer {
  width: min(69rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: clamp(.75rem, 2.1vw, 1.45rem);
  overflow: auto;
  border: 1px solid #344861;
  border-radius: 1rem;
  background: #0d1520;
  color: var(--ink);
  box-shadow: 0 1.5rem 6rem rgb(0 0 0 / .55);
}
.theme-viewer::backdrop { background: rgb(2 5 10 / .87); }
.viewer-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  margin-bottom: .85rem;
}
.viewer-header h2 { font-size: clamp(1.42rem, 3vw, 2.4rem); }
.viewer-mode { color: #a9c3e5; font-size: .875rem; }
.viewer-button {
  border: 1px solid #3b4e65;
  border-radius: .45rem;
  padding: .37rem .65rem;
  background: #142234;
  color: #e5f0ff;
  font-size: .875rem;
  cursor: pointer;
}
.viewer-button:hover { background: #21354e; }
.viewer-close { margin-left: auto; }
.viewer-figure { margin: 0; }
.viewer-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 62dvh;
  border-radius: .55rem;
  background: #05080e;
  overflow: hidden;
}
.viewer-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.viewer-image p { color: var(--muted); }
.viewer-controls {
  display: grid;
  grid-template-columns: 1fr minmax(0, auto) 1fr;
  align-items: center;
  gap: .45rem;
  margin-block: .75rem .5rem;
  text-align: center;
  font-weight: 600;
}
.viewer-controls button:first-child { justify-self: start; }
.viewer-controls button:last-child { justify-self: end; }
.viewer-thumbnails {
  position: relative;
  display: flex;
  gap: .45rem;
  overflow-x: auto;
  padding: .3rem .17rem .55rem;
  scrollbar-width: thin;
  scrollbar-color: #506784 #121f2e;
}
.viewer-thumb {
  flex: 0 0 clamp(4.4rem, 8vw, 7.1rem);
  padding: 2px;
  border: 1px solid #374b64;
  border-radius: .4rem;
  background: #151f2d;
  cursor: pointer;
}
.viewer-thumb img { display: block; width: 100%; height: auto; border-radius: .22rem; }
.viewer-thumb:hover, .viewer-thumb[aria-pressed="true"] { border-color: var(--blue); }
.viewer-thumb[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--blue); }
.viewer-thumb:focus-visible { outline-offset: 1px; }
@media (min-width: 650px) and (min-height: 360px) {
  .theme-viewer[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: min(56rem, calc(100dvh - 2rem));
  }
  .viewer-figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }
  .viewer-image {
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
  }
  .viewer-thumb { flex: 1 0 0; min-width: 0; }
}
@media (max-width: 460px) {
  .theme-viewer { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .viewer-header { column-gap: .45rem; }
  .viewer-controls { font-size: .875rem; }
}
