.howto-rich {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 72px;
  color: var(--ink);
}

@media (max-width: 760px) {
  .howto-rich {
    width: var(--mobile-content-width, 95%);
  }
}

.howto-kicker {
  margin: 0 0 8px;
  color: var(--accent, #956300);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.howto-rich h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.howto-intro,
.howto-rich p,
.howto-rich li {
  line-height: 1.6;
  color: var(--muted);
}

.howto-rich p { margin: 0 0 12px; }

.howto-rich h2 {
  margin: 36px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--ink);
}

.howto-rich h3 {
  margin: 20px 0 8px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.howto-rich ul,
.howto-rich ol {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.howto-rich strong { color: var(--ink); }

.howto-rich code {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.92em;
  color: var(--ink);
}

.howto-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 8px 0 28px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.howto-toc a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
}

.howto-toc a:hover { color: var(--accent, #956300); }

.howto-callout {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent, #C88708) 40%, var(--line));
  background: color-mix(in srgb, var(--paper) 82%, #F3D38A);
}

.howto-callout-kicker {
  margin: 0 0 4px !important;
  color: var(--accent, #956300) !important;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.howto-example {
  margin: 16px 0 20px;
}

.howto-example figcaption {
  margin: 0 0 8px;
  color: var(--ink);
  font-weight: 600;
}

.howto-example-note {
  margin: 8px 0 0 !important;
  font-size: 0.92rem;
}

.howto-mini {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(28px, 36px));
  gap: 3px;
  width: max-content;
  max-width: 100%;
}

.howto-mini-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.95rem;
  font-weight: 600;
}

[data-game="binary-puzzle"] .howto-mini-cell {
  font-family: var(--font-sans, Inter, "Segoe UI", sans-serif);
  font-variant-numeric: lining-nums;
  font-feature-settings: "zero" 0, "tnum" 0, "ss01" 0;
}

.howto-mini-cell.is-empty { background: color-mix(in srgb, var(--paper) 88%, #eee6d4); }

.howto-mini-cell.is-clue {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper-bright);
  border-color: var(--ink);
}
[data-ds-theme="dark"] .howto-mini-cell.is-clue {
  background: color-mix(in srgb, var(--cta-ink) 78%, var(--paper));
  color: var(--ivory);
  border-color: color-mix(in srgb, var(--cta-ink) 78%, var(--paper));
}
.howto-mini-cell.is-clue .kakuro-diag {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom left, transparent calc(50% - 0.5px), currentColor 50%, transparent calc(50% + 0.5px));
  opacity: 0.45;
}
.howto-mini-cell.is-clue .kakuro-across {
  position: absolute;
  top: 3px;
  right: 4px;
  bottom: auto;
  left: auto;
  font-size: 0.62rem;
  line-height: 1;
}
.howto-mini-cell.is-clue .kakuro-down {
  position: absolute;
  bottom: 3px;
  left: 4px;
  top: auto;
  right: auto;
  font-size: 0.62rem;
  line-height: 1;
}
.howto-mini-cell.is-focus {
  border-color: var(--accent, #C88708);
  background: color-mix(in srgb, var(--paper) 70%, #F3D38A);
}
.howto-mini-cell.is-user { color: #956300; font-weight: 600; }
.howto-mini-cell.is-given { color: #201A12; font-weight: 700; }
.howto-mini-cell.is-ineq {
  border: none;
  background: transparent;
  font-weight: 700;
  font-size: 1.05rem;
}

.howto-mini-mark {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--muted);
}

.howto-table-wrap { overflow-x: auto; margin: 12px 0 18px; }

.howto-table-caption {
  margin: 0 0 6px !important;
  color: var(--ink) !important;
  font-weight: 600;
}

.howto-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.howto-table th,
.howto-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.howto-table th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.howto-faq dt {
  margin: 16px 0 4px;
  color: var(--ink);
  font-weight: 600;
}

.howto-faq dd {
  margin: 0 0 8px;
  color: var(--muted);
}

.howto-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 32px 0 8px;
}

html[data-ds-theme="dark"] .howto-callout,
[data-ds-theme="dark"] .howto-callout {
  background: color-mix(in srgb, var(--paper) 78%, #5a4218);
}

html[data-ds-theme="dark"] .howto-mini-cell.is-given,
[data-ds-theme="dark"] .howto-mini-cell.is-given {
  color: #F7F0E2;
}

html[data-ds-theme="dark"] .howto-mini-cell.is-user,
[data-ds-theme="dark"] .howto-mini-cell.is-user {
  color: #E0C078;
}

@media (max-width: 390px) {
  .howto-rich { width: var(--mobile-content-width, 95%); }
  .howto-mini { grid-template-columns: repeat(var(--cols, 3), minmax(26px, 32px)); }
}

.howto-infos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 4px 0 24px;
}

.howto-info-card,
.howto-info-card:link,
.howto-info-card:visited {
  display: flex;
  align-items: center;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px);
  background: var(--paper-bright);
  color: var(--ink);
  text-decoration: none;
}

.howto-info-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: inherit;
}

.howto-info-card:hover {
  border-color: var(--cta, #C88708);
  color: var(--ink);
  background: color-mix(in srgb, var(--cta, #C88708) 10%, var(--paper-bright));
}

.howto-info-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--paper), 0 0 0 4px var(--indigo, #3d4a7a));
}

@media (min-width: 640px) {
  .howto-infos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
