/* Nexlink user guide (/guide/). Builds on site.css: same tokens, nav, footer, buttons, chips, reveal. */

/* Sticky nav plus, on phones, the sticky chip row of sections. */
@media (max-width: 1023px) { html.g-html { scroll-padding-top: calc(var(--nav-h) + 86px); } }

.nav-links a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, .05); box-shadow: inset 0 -2px 0 var(--beak); }
.sheet-links a[aria-current="page"] { color: var(--beak-text); }
.foot-meta a[aria-current="page"] { color: var(--text2); }

/* ---------- Inline app labels, keys ---------- */
.ui { color: var(--text); font-weight: 600; }
kbd {
  display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px;
  background: var(--surface2); color: var(--text); font-family: var(--mono); font-size: .86em; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
strong { color: var(--text); font-weight: 700; }

/* ---------- Hero ---------- */
.g-hero { position: relative; isolation: isolate; overflow: hidden; padding: 40px 0 28px; }
@media (min-width: 1024px) { .g-hero { padding: 64px 0 36px; } }
.g-hero .hero-bg { -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.g-hero .a1 { top: -260px; right: -200px; }
.g-hero .a2 { top: -40px; }
.g-title {
  margin-top: 16px; font-size: clamp(40px, 6.2vw, 80px); line-height: 1.02; font-weight: 800; letter-spacing: -.045em;
  text-wrap: balance; animation: rise 800ms var(--ease-out) both;
}
:lang(vi) .g-title { line-height: 1.14; }
.g-roles { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; animation: rise 800ms var(--ease-out) 120ms both; }
.g-role {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px 8px 12px; border-radius: 999px;
  background: rgba(20, 27, 37, .72); border: 1px solid var(--line); color: var(--mist); font-size: 15px; font-weight: 500; line-height: 1.35;
}
.g-role .ic { color: var(--beak-text); }

/* The big device switch: two ARIA tabs with a sliding indicator. */
.g-switch {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 600px; margin-top: 32px; padding: 6px;
  border-radius: 26px; background: rgba(20, 27, 37, .85); border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px -30px rgba(0, 0, 0, .8);
  animation: rise 800ms var(--ease-out) 200ms both;
}
.g-sw-ind {
  position: absolute; top: 6px; bottom: 6px; left: 6px; width: calc(50% - 6px); border-radius: 20px; pointer-events: none;
  background: linear-gradient(180deg, #222d3a, var(--surface2)); border: 1px solid rgba(255, 90, 31, .5);
  box-shadow: 0 0 0 4px var(--beak-a12), 0 12px 32px -12px rgba(255, 90, 31, .55);
  transition-property: transform; transition-duration: 420ms; transition-timing-function: var(--ease-out);
}
.g-switch[data-active="iphone"] .g-sw-ind { transform: translateX(100%); }
.g-sw {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-height: 80px; padding: 12px 18px;
  border: 0; border-radius: 20px; background: transparent; color: var(--text2); text-align: left; cursor: pointer;
  transition-property: color, transform; transition-duration: 200ms; transition-timing-function: var(--ease-out);
}
.g-sw:hover { color: var(--text); }
.g-sw:active { transform: scale(.98); }
.g-sw[aria-selected="true"] { color: var(--text); }
.g-sw:focus-visible { outline-offset: -2px; border-radius: 20px; }
.g-sw-ic { width: 30px; height: 30px; flex: none; transition-property: color; transition-duration: 200ms; }
.g-sw[aria-selected="true"] .g-sw-ic { color: var(--beak-text); }
.g-sw-text { display: grid; gap: 2px; min-width: 0; }
.g-sw-t { font-size: 24px; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; }
.g-sw-s { font-size: 14px; font-weight: 500; line-height: 1.3; color: var(--text2); text-wrap: balance; }
.g-sw[aria-selected="true"] .g-sw-s { color: var(--mist); }
@media (max-width: 479px) {
  .g-sw { gap: 10px; padding: 10px 12px; min-height: 72px; }
  .g-sw-ic { width: 24px; height: 24px; }
  .g-sw-t { font-size: 20px; }
  .g-sw-s { font-size: 13px; }
}
@media (scripting: none) { .g-switch { display: none; } }

.g-jump { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; animation: rise 800ms var(--ease-out) 260ms both; }
.g-jump a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--text2); text-decoration: none; font-size: 14.5px; font-weight: 600; border: 1px solid transparent;
  transition-property: color, background-color, border-color; transition-duration: 160ms; transition-timing-function: var(--ease-out);
}
.g-jump a:hover { color: var(--text); background: rgba(255, 255, 255, .04); border-color: var(--line); }
.g-jump .ic { color: var(--slate); }
@media (max-width: 479px) { .g-jump { gap: 2px; } .g-jump a { padding: 0 10px; font-size: 14px; } .g-jump .ic { display: none; } }

/* ---------- Panels ---------- */
.g-tabs { padding-bottom: 32px; }
.g-panel:focus { outline: none; }
.g-panel[hidden] { display: none; }
.g-panel.is-entering { animation: g-enter 420ms var(--ease-out) both; }
@keyframes g-enter { from { opacity: 0; transform: translateY(10px); } }
.g-panel-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (scripting: none) {
  .g-panel-title { position: static; width: auto; height: auto; margin: 40px 0 0; clip-path: none; font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; }
}
.g-layout { display: grid; }
@media (min-width: 1024px) { .g-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 56px; align-items: start; } }
.g-content { min-width: 0; max-width: 880px; }

/* ---------- Table of contents: sticky column on desktop, chip row on phones ---------- */
.g-toc-title { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.g-toc a { text-decoration: none; }
@media (min-width: 1024px) {
  .g-toc {
    position: sticky; top: calc(var(--nav-h) + 24px); max-height: calc(100vh - var(--nav-h) - 48px); overflow-y: auto;
    padding: 28px 4px 24px 0; scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  }
  .g-toc-list { margin-top: 12px; display: grid; gap: 2px; }
  .g-toc-list > li > a {
    position: relative; display: flex; align-items: baseline; gap: 10px; min-height: 40px; padding: 9px 12px; border-radius: 10px;
    color: var(--text2); font-size: 15px; font-weight: 600; line-height: 1.35;
    transition-property: color, background-color; transition-duration: 160ms; transition-timing-function: var(--ease-out);
  }
  .g-toc a::before {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--beak);
    opacity: 0; transform: scaleY(.4); transition-property: opacity, transform; transition-duration: 200ms; transition-timing-function: var(--ease-out);
  }
  .g-toc a:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
  .g-toc a.is-active { color: var(--text); background: rgba(255, 255, 255, .045); }
  .g-toc a.is-active::before { opacity: 1; transform: none; }
  .g-toc-n { font-size: 12px; color: var(--slate); flex: none; }
  .g-toc a.is-active .g-toc-n { color: var(--beak-text); }
  .g-toc-sub { margin: 2px 0 6px 34px; display: grid; gap: 0; border-left: 1px solid var(--line); }
  .g-toc-sub a {
    position: relative; display: flex; align-items: center; min-height: 34px; padding: 5px 12px; margin-left: -1px;
    color: var(--text2); font-size: 14px; font-weight: 500; line-height: 1.35; border-radius: 0 8px 8px 0;
    transition-property: color, background-color; transition-duration: 160ms;
  }
  .g-toc-sub a::before { top: 7px; bottom: 7px; }
}
@media (max-width: 1023px) {
  .g-toc {
    position: sticky; top: var(--nav-h); z-index: 30; margin: 0 calc(var(--gutter) * -1); padding: 10px var(--gutter);
    background: rgba(11, 15, 20, .9); -webkit-backdrop-filter: saturate(140%) blur(16px); backdrop-filter: saturate(140%) blur(16px);
    border-bottom: 1px solid var(--line);
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding-inline: var(--gutter);
  }
  .g-toc::-webkit-scrollbar { display: none; }
  .g-toc-title { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .g-toc-list { display: flex; gap: 8px; width: max-content; }
  .g-toc-sub { display: none; }
  .g-toc-list > li > a {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--line); background: var(--night); color: var(--text2); font-size: 14.5px; font-weight: 600;
    transition-property: color, background-color, border-color; transition-duration: 160ms; transition-timing-function: var(--ease-out);
  }
  .g-toc-n { font-size: 11.5px; color: var(--slate); }
  .g-toc a.is-active { color: var(--ink); background: var(--beak); border-color: var(--beak); }
  .g-toc a.is-active .g-toc-n { color: var(--ink); }
}

/* ---------- Sections and step cards ---------- */
.g-sec { padding-top: 56px; }
.g-sec:first-child { padding-top: 28px; }
.g-sec-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.g-sec-n {
  flex: none; margin-top: 5px; padding: 5px 9px; border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 1.3;
  color: var(--beak-text); background: var(--beak-a12); border: 1px solid rgba(255, 90, 31, .32);
}
.g-sec-t { font-size: clamp(26px, 3.1vw, 36px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; text-wrap: balance; }
:lang(vi) .g-sec-t { line-height: 1.24; }
.g-sec-lead { margin-top: 8px; color: var(--text2); font-size: 16.5px; line-height: 1.55; text-wrap: pretty; }
.g-sec-body { display: grid; gap: 16px; }

.g-card {
  container-type: inline-size; display: grid; gap: 16px; padding: 22px; border-radius: var(--r-card);
  background: var(--night); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
@media (max-width: 479px) { .g-card { padding: 18px 16px; } }
.g-card-head { display: flex; align-items: center; gap: 12px; }
.g-card-n {
  flex: none; padding: 2px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600; line-height: 1.5;
  color: var(--text2); background: var(--surface2); border: 1px solid var(--line);
}
.g-card-t { font-size: 19px; font-weight: 700; letter-spacing: -.015em; line-height: 1.3; text-wrap: balance; }
.g-card-body { display: grid; gap: 12px; margin-top: 14px; color: var(--mist); font-size: 15.5px; line-height: 1.6; }
.g-card > .g-card-body { margin-top: 0; }
.g-card-grid { display: grid; gap: 22px; }
.g-card-text { min-width: 0; }
@container (min-width: 600px) {
  .g-card-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: start; }
}
.g-p, .g-steps li, .g-list li, .g-defs dd { text-wrap: pretty; }
.g-after { color: var(--text2); font-size: 14.5px; }

/* Numbered steps */
.g-steps { display: grid; gap: 12px; counter-reset: g-step; }
.g-steps li { position: relative; padding-left: 40px; min-height: 28px; counter-increment: g-step; }
.g-steps li::before {
  content: counter(g-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--beak-text); background: var(--surface2); border: 1px solid var(--line);
}
/* Bullets */
.g-list { display: grid; gap: 10px; }
.g-list li { position: relative; padding-left: 22px; }
.g-list li::before { content: ""; position: absolute; left: 3px; top: .66em; width: 7px; height: 7px; border-radius: 2px; background: var(--beak); transform: rotate(45deg); }
/* Label + meaning */
.g-defs { display: grid; margin: 0; }
.g-def { display: grid; gap: 2px; padding: 11px 0; border-top: 1px solid var(--line); }
.g-def:first-child { border-top: 0; padding-top: 0; }
.g-def:last-child { padding-bottom: 0; }
.g-defs dt { color: var(--text); font-weight: 600; }
.g-defs dd { margin: 0; color: var(--text2); }
@container (min-width: 560px) {
  .g-def { grid-template-columns: minmax(140px, 36%) minmax(0, 1fr); gap: 4px 20px; }
}

/* ---------- Screenshots ---------- */
.g-fig { margin: 0; min-width: 0; }
.g-fig img { width: 100%; }
.g-window { max-width: 100%; }
.g-window-sheet { max-width: 460px; margin-inline: auto; }
.g-window-tall { width: 232px; margin-inline: auto; }
.g-phone {
  position: relative; width: 228px; aspect-ratio: 9 / 19.5; margin-inline: auto; padding: 7px; border-radius: 40px;
  background: linear-gradient(145deg, #2a3442, var(--ink) 32%, var(--ink) 68%, #2a3442);
  box-shadow: 0 0 0 1px var(--line), 0 0 0 2px #06090d inset, 0 30px 60px -24px rgba(0, 0, 0, .8), 0 0 80px -30px var(--beak-a40);
}
.g-phone::after {
  content: ""; position: absolute; left: 50%; top: 16px; width: 30%; height: 21px; transform: translateX(-50%);
  border-radius: 999px; background: #000;
}
.g-phone-screen { height: 100%; overflow: hidden; border-radius: 33px; background: #000; }
.g-phone-screen img { height: 100%; object-fit: cover; outline: 1px solid rgba(255, 255, 255, .06); outline-offset: -1px; border-radius: inherit; }
/* Session shots are cropped to the useful part: shown as the lower part of a phone. */
.g-phone-crop {
  width: 260px; margin-inline: auto; padding: 0 7px 7px; border-radius: 0 0 40px 40px;
  background: linear-gradient(160deg, var(--ink) 60%, #2a3442);
  box-shadow: 1px 0 0 var(--line), -1px 0 0 var(--line), 0 1px 0 var(--line), 0 30px 60px -24px rgba(0, 0, 0, .8), 0 0 80px -30px var(--beak-a40);
  -webkit-mask-image: linear-gradient(transparent, #000 44px); mask-image: linear-gradient(transparent, #000 44px);
}
.g-phone-crop img { display: block; border-radius: 0 0 33px 33px; background: #000; }
.g-strip { max-width: 440px; overflow: hidden; border-radius: 24px; background: #000; border: 1px solid var(--line); box-shadow: 0 20px 40px -24px rgba(0, 0, 0, .8); }
@container (max-width: 599px) {
  .g-phone { width: min(228px, 70%); }
  .g-phone-crop { width: min(260px, 80%); }
}

/* ---------- Gesture table (cards on narrow widths, never a sideways scroller) ---------- */
.g-table-wrap { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: rgba(11, 15, 20, .45); }
.g-gestures { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.g-gestures thead th {
  padding: 12px 14px; text-align: left; background: var(--surface2);
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text2);
}
.g-gestures tbody th, .g-gestures td { padding: 12px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.g-gestures tbody th { font-weight: 600; color: var(--text); width: 30%; }
.g-gestures td { color: var(--mist); }
.g-gestures td:last-child { color: var(--text2); }
.g-gest { display: flex; align-items: center; gap: 12px; }
.g-gest-ic {
  flex: none; width: 40px; height: 40px; padding: 8px; border-radius: 11px; background: var(--surface2); border: 1px solid var(--line);
  color: var(--beak-text); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
@container (max-width: 579px) {
  .g-gestures thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .g-gestures, .g-gestures tbody, .g-gestures tr, .g-gestures th, .g-gestures td { display: block; width: auto; }
  .g-gestures tr { padding: 14px; border-top: 1px solid var(--line); }
  .g-gestures tbody tr:first-child { border-top: 0; }
  .g-gestures tbody th, .g-gestures td { padding: 0; border: 0; }
  .g-gestures tbody th { width: auto; margin-bottom: 10px; }
  .g-gestures td { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 3px 0; }
  .g-gestures td::before {
    content: attr(data-label); font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text2); padding-top: 3px;
  }
}

/* ---------- Callouts ---------- */
.g-call { display: flex; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 1px solid; }
.g-call .ic { margin-top: 1px; }
.g-call-body { display: grid; gap: 4px; min-width: 0; }
.g-call-t { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1.6; }
.g-call-d { color: var(--mist); font-size: 15px; line-height: 1.6; text-wrap: pretty; }
.g-call-tip { border-color: rgba(255, 90, 31, .34); background: rgba(255, 90, 31, .06); }
.g-call-tip .ic, .g-call-tip .g-call-t { color: var(--beak-text); }
.g-call-note { border-color: rgba(95, 114, 134, .5); background: rgba(95, 114, 134, .1); }
.g-call-note .ic, .g-call-note .g-call-t { color: var(--mist); }
.g-call-na { border-color: rgba(240, 180, 41, .36); border-style: dashed; background: rgba(240, 180, 41, .045); }
.g-call-na .ic, .g-call-na .g-call-t { color: var(--warn); }
.g-card .g-call { margin-top: 4px; }

/* ---------- Next / back link at the end of a panel ---------- */
.g-next {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 48px; min-height: 64px; padding: 18px 22px;
  border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(120deg, rgba(255, 90, 31, .08), transparent 60%), var(--night);
  color: var(--text); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: -.01em;
  transition-property: border-color, transform, box-shadow; transition-duration: 200ms; transition-timing-function: var(--ease-out);
}
.g-next .ic { color: var(--beak-text); transition-property: transform; transition-duration: 200ms; transition-timing-function: var(--ease-out); }
.g-next:hover { border-color: rgba(255, 90, 31, .5); box-shadow: 0 14px 40px -20px rgba(255, 90, 31, .5); }
.g-next:hover .ic { transform: translateX(3px); }
.g-next:active { transform: scale(.99); }
#panel-iphone .g-next { justify-content: flex-start; }
#panel-iphone .g-next:hover .ic { transform: translateX(-3px); }

/* ---------- Shared: troubleshooting ---------- */
.g-shared { border-top: 1px solid var(--line); }
.g-tgroup + .g-tgroup { margin-top: 44px; }
.g-tgroup-t {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text2);
}
.g-tgroup-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.g-tgrid { display: grid; gap: 16px; }
@media (min-width: 720px) { .g-tgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g-tgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-tcard { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-radius: 20px; background: var(--night); border: 1px solid var(--line); }
.g-tcard-t { font-size: 17.5px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; text-wrap: balance; }
.g-msg { padding: 12px 14px; border-radius: 12px; background: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--slate); }
.g-msg-l, .g-todo-l { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text2); }
.g-msg-q { margin-top: 4px; color: var(--text); font-size: 15px; line-height: 1.5; text-wrap: pretty; }
.g-msg-q::before { content: "“"; color: var(--slate); }
.g-msg-q::after { content: "”"; color: var(--slate); }
.g-todo { display: grid; gap: 4px; margin-top: auto; }
.g-todo-l { color: var(--beak-text); }
.g-todo-d { color: var(--mist); font-size: 15px; line-height: 1.55; text-wrap: pretty; }

/* ---------- Shared: not available yet ---------- */
.g-ngrid { display: grid; gap: 12px; }
@media (min-width: 720px) { .g-ngrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .g-ngrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.g-ncard { display: flex; gap: 14px; padding: 18px; border-radius: 18px; border: 1px dashed rgba(240, 180, 41, .34); background: rgba(240, 180, 41, .035); }
.g-ncard .ic { color: var(--warn); margin-top: 2px; }
.g-ncard-t { font-size: 16px; font-weight: 700; line-height: 1.4; text-wrap: balance; }
.g-ncard-d { margin-top: 4px; color: var(--text2); font-size: 14.5px; line-height: 1.55; text-wrap: pretty; }

/* ---------- Need help ---------- */
.g-help { padding: 24px 0 112px; }
.g-help-d { max-width: 52ch; color: var(--text2); font-size: 17px; text-wrap: pretty; }
.g-help .btn { white-space: normal; }

@media (prefers-reduced-motion: reduce) {
  .g-panel.is-entering { animation: none; }
  .g-sw:active, .g-next:active { transform: none; }
}
