.touch-guide-page {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #d3f0e3 0%, #d4e2dd 52%, #aae7cf 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

html:not([data-theme="dark"]) body.touch-guide-page {
  --ink: #0b745e;
  --muted: #465b54;
  --mint-dark: #0c7963;
}

html:not([data-theme="dark"]) body.touch-guide-page .touch-guide-hero h1,
html:not([data-theme="dark"]) body.touch-guide-page #body.touch-guide-article h3 {
  color: #3b836c;
}

.touch-guide-main {
  padding-bottom: clamp(84px, 11vw, 142px);
}

.touch-guide-hero h1 {
  max-width: 15ch;
  margin-inline: 0;
  font-size: clamp(3.2rem, 9vw, 7.2rem);
  font-weight: 700;
  line-height: 0.9;
  text-wrap: balance;
}

.touch-guide-page .touch-guide-hero {
  justify-items: stretch;
  text-align: left;
}

.touch-guide-page .touch-guide-hero > div {
  display: grid;
  justify-items: start;
  min-width: 0;
  text-align: left;
}

.touch-guide-page .touch-guide-hero .kicker,
.touch-guide-page .touch-guide-hero .lede {
  margin-inline: 0;
}

.touch-guide-page .touch-guide-hero .page-logo {
  justify-self: end;
}

.touch-guide-purchase-page .touch-guide-hero {
  --page-logo-shift: 0px;
  grid-template-columns: minmax(0, 1fr) clamp(160px, 18vw, 210px);
  gap: clamp(28px, 5vw, 64px);
}

.touch-guide-purchase-page .touch-guide-hero > div {
  min-width: 0;
}

.touch-guide-purchase-page .touch-guide-hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 6.6vw, 5.8rem);
  line-height: 0.92;
}

.touch-guide-purchase-page .touch-guide-hero .page-logo {
  width: clamp(160px, 18vw, 210px);
  justify-self: end;
}

@media (min-width: 881px) {
  .touch-guide-page .touch-guide-hero {
    --page-logo-shift: clamp(22px, 2vw, 26px);
    grid-template-columns: minmax(0, 1fr) clamp(240px, 21.875vw, 280px);
  }

  .touch-guide-page .touch-guide-hero .page-logo {
    width: clamp(240px, 21.875vw, 280px);
  }
}

@media (min-width: 1025px) {
  .touch-guide-page .touch-guide-hero {
    width: min(calc(100% - clamp(40px, 16vw, 160px)), 1240px);
  }
}

.touch-guide-page .site-header {
  color: var(--mint-dark);
}

.touch-guide-page .site-header .brand span {
  color: inherit;
}

.touch-guide-page .site-header a::before,
.touch-guide-page .site-footer a::before {
  content: none !important;
}

.touch-guide-back {
  display: inline-flex;
  margin-top: 18px;
  color: var(--mint-dark);
  font-weight: 850;
}

.touch-guide-back::before {
  content: "← ";
  margin-right: 6px;
}

.touch-guide-language-switch {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 850;
  line-height: normal;
  text-align: left;
}

.touch-guide-language-switch b {
  color: inherit;
  font: inherit;
}

.touch-guide-language-switch a {
  color: var(--mint-dark);
  font-weight: 850;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 160ms ease;
}

.touch-guide-language-switch a:hover,
.touch-guide-language-switch a:focus-visible {
  color: var(--mint);
}

#body.touch-guide-article {
  width: min(calc(100% - 40px), 920px);
  max-width: none;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 58px);
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 74%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint-dark) 27%, transparent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.72;
  text-align: center;
}

/* The legacy calculator stylesheet assigns its dark-mode text color to every
   descendant. Reset that value at the redesigned article boundary so nested
   list and table copy follows the current theme instead. */
#body.touch-guide-article * {
  color: inherit;
}

#body.touch-guide-article > p:first-of-type {
  margin-top: 0;
}

#body.touch-guide-article p {
  margin: 0 0 1.25em;
  color: var(--muted);
  text-align: center;
}

.touch-guide-settings-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-layout-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-flavors-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-keyboard-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-memory-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-color-editor-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-purchase-page #body.touch-guide-article p {
  margin-inline: auto;
}

.touch-guide-privacy-page #body.touch-guide-article p {
  margin-inline: auto;
}

#body.touch-guide-article b,
#body.touch-guide-article strong {
  color: var(--ink);
}

#body.touch-guide-article h3 {
  margin: clamp(42px, 7vw, 72px) 0 18px;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
  text-wrap: balance;
}

#body.touch-guide-article.touch-guide-legal-article {
  font-size: clamp(1.08rem, 1.6vw, 1.18rem);
  text-align: center;
}

#body.touch-guide-article.touch-guide-legal-article h3 {
  margin-inline: auto;
  font-size: clamp(1.7rem, 3.2vw, 2.45rem);
}

#body.touch-guide-article.touch-guide-legal-article > h3:first-of-type {
  margin-top: 0;
}

#body.touch-guide-article.touch-guide-legal-article p {
  margin-inline: auto;
  text-align: center;
}

#body.touch-guide-article ul,
#body.touch-guide-article ol {
  margin: 0 auto 28px;
  padding-left: 0;
  color: var(--muted);
  list-style-position: inside;
  text-align: center;
}

#body.touch-guide-article li {
  margin: 0 0 12px;
  padding-left: 0;
  text-align: center;
}

#body.touch-guide-article li::marker {
  color: var(--mint-dark);
}

#body.touch-guide-article a {
  color: var(--mint-dark);
  font-weight: 760;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

#body.touch-guide-article .ks {
  display: inline-grid;
  min-width: 2.1em;
  min-height: 2.1em;
  place-items: center;
  margin-inline: 0.2em;
  padding: 0.18em 0.48em;
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint-dark) 35%, transparent);
  border-radius: 5px;
  font: 800 0.95em/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--mint-dark) 12%, transparent);
}

#body.touch-guide-article .cartimg {
  display: grid;
  width: 100%;
  max-width: none;
  margin: clamp(28px, 5vw, 48px) 0;
  padding: clamp(16px, 3vw, 26px);
  float: none;
  clear: both;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint-dark) 24%, transparent);
  border-radius: 7px;
}

#body.touch-guide-article .cartimg2 {
  width: 100% !important;
  max-width: 100%;
  margin: 0;
  float: none;
  text-align: center;
}

#body.touch-guide-article .cartimg2 a {
  display: inline-block;
  max-width: 100%;
}

#body.touch-guide-article .cartimg img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 720px;
  margin-inline: auto;
  border: 0;
  border-radius: 5px;
  object-fit: contain;
}

#body.touch-guide-article .cartimgtext {
  width: min(100%, 720px);
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.touch-guide-scroll {
  width: 100%;
  margin: 24px 0 42px;
  padding: 18px;
  overflow-x: auto;
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  border: 1px solid color-mix(in srgb, var(--mint-dark) 23%, transparent);
  border-radius: 7px;
  overscroll-behavior-inline: contain;
}

.touch-guide-scroll .klayout {
  margin: 0 auto !important;
}

.touch-guide-scroll .klayout > div {
  transform: translateY(-5px);
}

.touch-guide-scroll table {
  width: max-content;
  min-width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.touch-guide-scroll th,
.touch-guide-scroll td {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--mint-dark) 20%, transparent);
  text-align: center;
}

html[data-theme="dark"] .touch-guide-back,
html[data-theme="dark"] #body.touch-guide-article a,
html[data-theme="dark"] .touch-guide-language-switch a {
  color: var(--mint);
}

html[data-theme="dark"] .touch-guide-language-switch a:hover,
html[data-theme="dark"] .touch-guide-language-switch a:focus-visible {
  color: color-mix(in srgb, var(--mint) 68%, white);
}

html[data-theme="dark"] #body.touch-guide-article,
html[data-theme="dark"] #body.touch-guide-article .cartimg,
html[data-theme="dark"] .touch-guide-scroll {
  background: color-mix(in srgb, var(--surface) 54%, transparent);
  border-color: color-mix(in srgb, var(--mint) 22%, transparent);
}

@media (max-width: 720px) {
  .touch-guide-purchase-page .touch-guide-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 28px;
    text-align: center;
  }

  .touch-guide-page.touch-guide-purchase-page .touch-guide-hero > div {
    display: grid;
    justify-items: center;
    text-align: center;
  }

  .touch-guide-purchase-page .touch-guide-hero h1 {
    max-width: 100%;
    font-size: clamp(2.8rem, 11vw, 4.6rem);
    overflow-wrap: anywhere;
  }

  .touch-guide-purchase-page .touch-guide-hero .page-logo {
    width: min(48vw, 170px);
    justify-self: center;
  }

  .touch-guide-purchase-page .touch-guide-language-switch {
    text-align: center;
  }
}

@media (max-width: 560px) {
  #body.touch-guide-article {
    width: min(100% - 28px, var(--max));
  }

  #body.touch-guide-article {
    padding: 22px 18px;
  }

  .touch-guide-scroll {
    padding: 12px;
  }
}
