/* User guide (guide.html). Builds on site.css tokens; no new colours. */

.guide { padding-top: 36px; }
.g-head h1 { font-size: clamp(30px, 5.4vw, 42px); line-height: 1.15; margin: 0 0 6px; letter-spacing: -0.01em; }
.g-head .sub { color: var(--muted); margin: 0 0 20px; font-size: 15px; }

/* search */
.g-search {
  position: relative; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 0 14px; box-shadow: var(--shadow); max-width: 640px;
}
.g-search svg { width: 20px; height: 20px; fill: var(--muted); flex: 0 0 auto; }
.g-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 17px; padding: 14px 0; outline: none;
}
.g-search:focus-within { outline: 2px solid var(--green); outline-offset: 1px; }
.g-count { font-size: 13px; color: var(--muted); white-space: nowrap; }

/* quick start */
.g-quick { margin: 24px 0 8px; }
.g-quick h2 { font-size: 20px; margin: 0 0 10px; }

/* numbered steps */
.g-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.g-steps > li { counter-increment: step; position: relative; padding-left: 38px; margin: 10px 0; }
.g-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--green-pale); color: var(--accent-text);
  font-size: 14px; font-weight: 700; line-height: 26px; text-align: center;
}

/* on-screen labels */
b.ui {
  font-weight: 600; color: var(--text); white-space: nowrap;
  background: var(--green-pale); border-radius: 6px; padding: 1px 6px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
@media (max-width: 420px) { b.ui { white-space: normal; } }

/* layout: contents on the left from tablet width up */
.g-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 20px; }
@media (min-width: 900px) {
  .g-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
}

.g-toc-title { font-size: 13px; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.g-toc ul { list-style: none; margin: 0; padding: 0; }
.g-toc a {
  display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--muted);
  font-size: 15px; padding: 7px 10px; border-radius: 10px;
}
.g-toc a:hover { color: var(--text); background: var(--surface); }
.g-toc a[aria-current="true"] { color: var(--accent-text); background: var(--green-pale); font-weight: 600; }
.g-toc-icon { width: 20px; text-align: center; }

@media (min-width: 900px) {
  .g-toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; padding-top: 8px; }
}
/* phones and small tablets: chapter chips that scroll sideways under the header */
@media (max-width: 899px) {
  .g-toc {
    position: sticky; top: 56px; z-index: 5; margin: 0 -16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .g-toc-title { display: none; }
  .g-toc ul { display: flex; gap: 6px; overflow-x: auto; padding: 8px 16px; scrollbar-width: none; }
  .g-toc ul::-webkit-scrollbar { display: none; }
  .g-toc a { white-space: nowrap; font-size: 14px; padding: 6px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; }
}

/* chapters and answers */
.g-chapter { padding: 28px 0 8px; scroll-margin-top: 72px; }
@media (max-width: 899px) { .g-chapter, .g-task { scroll-margin-top: 116px; } }
.g-chapter-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; }
.g-chapter-head h2 { font-size: clamp(22px, 3.6vw, 28px); margin: 2px 0 4px; }
.g-intro { margin: 0; color: var(--muted); }

.g-task {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 20px 14px; margin: 14px 0; scroll-margin-top: 76px;
}
@media (max-width: 420px) { .g-task { padding: 16px 14px 12px; } }
.g-task h3 { position: relative; font-size: 18px; line-height: 1.4; margin: 0 0 6px; }
.g-anchor {
  position: absolute; left: -18px; top: 0; color: var(--muted); text-decoration: none;
  opacity: 0; transition: opacity .15s ease;
}
.g-task:hover .g-anchor, .g-anchor:focus { opacity: 1; }
@media (max-width: 899px) { .g-anchor { display: none; } }
.g-task:target { outline: 2px solid var(--green); outline-offset: 2px; }

.g-new {
  display: inline-block; vertical-align: 2px; margin-left: 8px;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--green-deep);
  border-radius: 999px; padding: 2px 8px;
}

.g-tip {
  margin: 10px 0 2px; padding: 10px 12px; border-radius: 12px;
  background: var(--bg); color: var(--muted); font-size: 15px;
}
.g-tip::before { content: "💡 "; }

.g-more { margin: 18px 0 6px; padding: 4px 4px 0; }
.g-more h3 { font-size: 15px; color: var(--muted); margin: 0 0 4px; font-weight: 700; }
.g-more ul { margin: 0; padding-left: 20px; }
.g-more li { margin: 8px 0; }

.g-empty { padding: 24px 0; color: var(--muted); }
.g-help { margin-top: 36px; }
.g-help h2 { font-size: 20px; margin: 0 0 4px; }
.g-help p { margin: 0; }

/* search results: matched words */
mark.g-hit { background: color-mix(in srgb, var(--green) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

@media print {
  header.top, .g-toc, .g-search, footer { display: none; }
  .g-layout { display: block; }
  .g-task { break-inside: avoid; box-shadow: none; }
}
