/* =============================================================
   Stichbook — the user guide (guide.html).
   Loaded after styles.css + chrome.css. A searchable page: a search
   box in the hero, task shortcuts, a sticky contents list on the left
   and one card per topic, each with its own link.
============================================================= */

.g-hero .container { max-width: 1240px; }
.g-hero h1 { margin-bottom: 4px; }
.g-search {
  position: relative; margin-top: 28px; max-width: 640px;
}
.g-search input {
  width: 100%; height: 56px; padding: 0 52px 0 52px;
  border: 0; border-radius: 14px; background: #fff; color: var(--ink);
  font: inherit; font-size: 17px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
}
.g-search input:focus { outline: 3px solid #6ea0ff; outline-offset: 2px; }
.g-search .g-search-ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink-500); pointer-events: none; }
.g-search .g-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--surface-2);
  color: var(--ink-600); font-size: 20px; line-height: 1; cursor: pointer;
}
.g-search .g-clear[hidden] { display: none; }
.g-hint { margin-top: 12px !important; font-size: 14px; color: #9aa3b5 !important; }
.g-hint button {
  margin: 4px 6px 0 0; padding: 4px 10px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 100px;
  background: none; color: #dfe6f5; font: inherit; font-size: 13px; cursor: pointer;
}
.g-hint button:hover { background: rgba(255, 255, 255, .1); }

.g-wrap > * { min-width: 0; }
.g-wrap { max-width: 1240px; margin: 0 auto; padding: 40px 20px 72px; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }

/* ---------- Contents ---------- */
.g-toc { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow: auto; padding: 4px 4px 12px 0; }
.g-toc p { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); margin: 0 0 10px 12px; }
.g-toc ol { list-style: none; margin: 0; padding: 0; }
.g-toc > ol > li > a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
.g-toc ol ol { margin: 0 0 6px 12px; border-left: 1px solid var(--line); }
.g-toc ol ol a { display: block; padding: 5px 12px; color: var(--ink-600); font-size: 14px; }
.g-toc a:hover { background: var(--primary-l); color: var(--primary); }
.g-toc a.on { color: var(--primary); }
.g-toc > ol > li > a.on { background: var(--primary-l); }
.g-toc .hide { display: none; }

/* ---------- Task shortcuts ---------- */
.g-tasks h2, .g-sec > h2 { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0 0 6px; letter-spacing: -.3px; }
.g-tasks > p { color: var(--ink-600); margin: 0 0 18px; }
.g-task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 48px; }
.g-task {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--ink); transition: border-color .15s, transform .15s;
}
.g-task:hover { border-color: var(--primary); transform: translateY(-1px); }
.g-task b { display: block; font-size: 15px; margin-bottom: 2px; }
.g-task span { font-size: 13px; color: var(--ink-500); line-height: 1.4; }
.g-task i { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-style: normal; font-size: 18px; background: var(--primary-l); }

/* ---------- Sections and topics ---------- */
.g-sec { margin-bottom: 48px; scroll-margin-top: 16px; }
.g-sec > h2 { display: flex; align-items: center; gap: 10px; }
.g-sec > .g-lead { color: var(--ink-600); margin: 0 0 18px; max-width: 760px; }
.g-topic {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 28px; margin-bottom: 14px;
  scroll-margin-top: 16px; color: var(--ink-700); line-height: 1.65;
}
.g-topic:target { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-l); }
.g-topic h3 { display: flex; align-items: baseline; gap: 8px; font-size: 19px; font-weight: 700; color: var(--ink); margin: 0 0 10px; }
.g-topic h3 .g-en { font-size: 13px; font-weight: 500; color: var(--ink-500); }
.g-link {
  margin-left: auto; flex: none; border: 0; background: none; cursor: pointer; padding: 4px 8px; border-radius: 8px;
  color: var(--ink-400); font: inherit; font-size: 13px; white-space: nowrap;
}
.g-link:hover { color: var(--primary); background: var(--primary-l); }
.g-topic h4 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 18px 0 6px; }
.g-topic p { margin: 0 0 10px; }
.g-topic ul, .g-topic ol { margin: 0 0 12px; padding-left: 22px; }
.g-topic li { margin-bottom: 6px; }
.g-topic ol.g-steps { list-style: none; padding: 0; counter-reset: s; }
.g-topic ol.g-steps > li { position: relative; padding-left: 40px; margin-bottom: 10px; counter-increment: s; }
.g-topic ol.g-steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
}
.g-topic kbd, .g-topic .btn-name {
  display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line);
  font-family: inherit; font-size: .92em; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.g-topic table { width: 100%; border-collapse: collapse; margin: 6px 0 14px; font-size: 14.5px; }
.g-topic th, .g-topic td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.g-topic th { background: var(--surface-2); color: var(--ink); font-weight: 700; }
.g-table { overflow-x: auto; }
.g-note { margin: 12px 0; padding: 12px 16px; border-radius: 12px; background: var(--primary-l); color: #17337a; font-size: 14.5px; }
.g-warn { background: var(--red-l); color: #8a1c1c; }
.g-where { display: inline-flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: 13px; }
.g-where span { padding: 3px 10px; border-radius: 100px; background: var(--surface-2); color: var(--ink-600); font-weight: 600; }
.g-where .w-web { background: #ebf0ff; color: #0053e2; }
.g-where .w-app { background: #d8f4f0; color: #01897c; }
.g-where .w-staff { background: #fff2e6; color: #b85b00; }
.g-where .w-sa { background: #f1e9ff; color: #6a1fd1; }

/* Screenshots */
.g-shot { margin: 16px 0 6px; }
.g-shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: zoom-in; }
.g-shot figcaption { margin-top: 8px; font-size: 13px; color: var(--ink-500); }
.g-shot.phone { max-width: 260px; }
.g-shot.modal { max-width: 440px; }
.g-shots .g-shot.half { flex: 1 1 300px; margin: 0; }
.g-shot.phone img { border-radius: 28px; }
.g-shots { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.g-shots .g-shot.phone { flex: 0 1 240px; }

.g-zoom { position: fixed; inset: 0; z-index: 100; background: rgba(0, 7, 17, .88); display: grid; place-items: center; padding: 24px; cursor: zoom-out; }
.g-zoom img { max-width: 100%; max-height: 100%; border-radius: 12px; }

/* Search results */
mark.g-hit { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.g-count { margin: 0 0 18px; color: var(--ink-600); font-weight: 600; }
.g-count[hidden], .g-more[hidden], .g-empty[hidden], .g-langnote[hidden] { display: none; }
.g-empty { background: #fff; border: 1px dashed var(--ink-400); border-radius: 16px; padding: 28px; text-align: center; color: var(--ink-600); }
.g-empty a { font-weight: 700; }
.g-hidden { display: none !important; }
.g-langnote { margin: 0 0 24px; padding: 12px 16px; border-radius: 12px; background: var(--amber-l); color: #7a3d00; font-size: 14.5px; }
.g-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 100px; font-size: 14px; }

.g-help { background: var(--grad); color: #fff; border-radius: 20px; padding: 28px 32px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.g-help h2 { color: #fff; font-size: 22px; margin: 0 0 4px; }
.g-help p { margin: 0; color: #d6e2ff; }
.g-help a { background: #fff; color: var(--ink); font-weight: 700; padding: 12px 20px; border-radius: 100px; }

@media (max-width: 960px) {
  .g-wrap { grid-template-columns: 1fr; gap: 0; padding-top: 24px; }
  .g-toc { position: static; max-height: none; margin-bottom: 28px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; }
  .g-toc ol ol { display: none; }
  .g-toc > ol { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .g-topic { padding: 18px 16px; border-radius: 14px; }
  .g-topic h3 { flex-wrap: wrap; font-size: 17px; }
  .g-link { margin-left: 0; padding-left: 0; }
  .g-tasks h2, .g-sec > h2 { font-size: 22px; }
  .g-task-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .g-task { flex-direction: column; padding: 12px; }
  .g-shot.phone, .g-shots .g-shot.phone { max-width: 46%; flex-basis: 46%; }
  .g-shots { gap: 10px; }
  .g-toc > ol { grid-template-columns: 1fr 1fr; }
  .g-toc > ol > li > a { padding: 7px 10px; font-size: 14px; }
}

/* While searching: only the matching topics, not each section's intro or screenshot. */
.g-searching .g-sec > .g-lead, .g-searching .g-sec > .g-shot { display: none; }
.g-more { order: 9; display: block; margin: 4px 0 40px; padding: 12px 18px; border: 1px dashed var(--ink-400); border-radius: 12px; background: #fff; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; width: 100%; }
.g-more:hover { border-color: var(--primary); }

/* Inside the Stichbook app (guide.html?app=1): no site menu or footer. */
.in-app .subhead, .in-app .foot, .in-app .skip-link { display: none; }
