/* PoiBuilder documentation — distinct, modern styling */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0c0e12;
  --bg-2: #12151b;
  --panel: #181c24;
  --panel-hover: #1f2430;
  --line: #282f3d;
  --line-focus: #3b4557;
  --text: #f0f3f6;
  --muted: #8e99a8;
  --accent: #7c5cff;
  --accent-hover: #9378ff;
  --accent-dim: #372a6b;
  --accent-glow: rgba(124, 92, 255, 0.18);
  --gold: #f59e0b;
  --gold-dim: #78350f;
  --coral: #f43f5e;
  --emerald: #10b981;
  --max: 46rem;
  --side: 16.5rem;
  --top: 3.2rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 92, 255, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(18, 21, 27, 0.6) 0%, transparent 20rem),
    var(--bg);
  background-attachment: fixed;
}

a {
  color: var(--accent-hover);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
a:hover { color: #ffffff; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.2rem 0 1rem;
  background: rgba(12, 14, 18, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 1.05rem;
}
.brand small {
  color: var(--accent-hover);
  background: rgba(124, 92, 255, 0.12);
  border: 1px solid rgba(124, 92, 255, 0.3);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.top-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 0.5rem;
}
.bc-sep { color: var(--line-focus); font-size: 0.8rem; }
.bc-section { color: var(--muted); font-weight: 500; }
.bc-page { color: var(--text); font-weight: 600; }
.top-links { margin-left: auto; display: flex; gap: 1.2rem; font-size: 0.9rem; }
.top-links a { color: var(--muted); text-decoration: none; }
.top-links a:hover { color: var(--text); }

.nav-btn {
  display: none;
  cursor: pointer;
  color: var(--text);
  font-size: 1.25rem;
  padding: 0.2rem 0.45rem;
}
.nav-scrim { display: none; }

.shell { display: flex; position: relative; z-index: 1; min-height: calc(100vh - var(--top)); }
.side {
  width: var(--side);
  flex: 0 0 var(--side);
  border-right: 1px solid var(--line);
  background: rgba(18, 21, 27, 0.94);
  padding: 1.3rem 0.9rem 3rem;
  position: sticky;
  top: var(--top);
  height: calc(100vh - var(--top));
  overflow: auto;
}
.side-kicker {
  margin: 0 0.55rem 0.9rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-hover);
  font-weight: 700;
}
.side .group { margin: 0.9rem 0 0.3rem; }
.side .group-title {
  margin: 0 0.55rem 0.3rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.grp-glyph {
  color: var(--accent);
  margin-right: 0.35rem;
  font-size: 0.75rem;
}
.side a {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 0.32rem 0.6rem;
  border-radius: 6px;
  font-size: 0.92rem;
  transition: all 0.15s ease;
}
.side a:hover { background: var(--panel); color: var(--text); }
.side a.current {
  background: rgba(124, 92, 255, 0.14);
  color: #c4b5fd;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--accent);
}

.main { flex: 1; min-width: 0; padding: 2.2rem 2.2rem 4.5rem; }
.page { max-width: var(--max); }

.hero {
  margin: -0.4rem 0 2.4rem;
  padding: 1.8rem 1.8rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(100% 90% at 100% 0%, rgba(245, 158, 11, 0.10), transparent 50%),
    radial-gradient(90% 80% at 0% 100%, rgba(124, 92, 255, 0.14), transparent 60%),
    var(--panel);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}
.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.1rem, 5vw, 3.15rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-weight: 800;
}
.hero .lead {
  margin: 0 0 1.2rem;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 38rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.52rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-primary, .btn-cyan {
  background: linear-gradient(135deg, #7c5cff, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(124, 92, 255, 0.35);
}
.btn-primary:hover, .btn-cyan:hover {
  background: linear-gradient(135deg, #8b6eff, #7073ff);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(124, 92, 255, 0.5);
  transform: translateY(-1px);
}
.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(24, 28, 36, 0.6);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: #c4b5fd;
  background: rgba(124, 92, 255, 0.08);
}

h1, h2, h3, h4 { letter-spacing: -0.03em; line-height: 1.25; font-weight: 700; }
.page > h1 { margin: 0 0 0.65rem; font-size: 2.15rem; }
h2 {
  margin: 2.4rem 0 0.8rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--line);
  font-size: 1.4rem;
}
h3 { margin: 1.6rem 0 0.5rem; font-size: 1.1rem; color: var(--gold); }
p { margin: 0.75rem 0; }
.lead { font-size: 1.15rem; color: var(--muted); }

ul, ol { padding-left: 1.3rem; }
li { margin: 0.3rem 0; }
li ul { margin: 0.2rem 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 1.1rem 0 1.5rem;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 600; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
tr:hover td { background: var(--panel); }

code, kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
}
code {
  background: var(--panel);
  padding: 0.1em 0.38em;
  border-radius: 5px;
  border: 1px solid var(--line);
  color: #e2e8f0;
}
pre {
  background: #090b0e;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  overflow: auto;
  font-size: 0.86rem;
  line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; }
kbd {
  display: inline-block;
  min-width: 1.4em;
  text-align: center;
  padding: 0.08em 0.42em;
  border: 1px solid var(--line);
  border-bottom: 2px solid #1a202c;
  border-radius: 5px;
  background: #1a1e27;
  color: #fbbf24;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.action-icon {
  display: inline-block;
  vertical-align: -2.5px;
  width: 16px;
  height: 16px;
  margin-right: 3px;
  flex-shrink: 0;
}

blockquote {
  margin: 1.1rem 0;
  padding: 0.65rem 1rem;
  border-left: 3px solid var(--accent);
  background: rgba(124, 92, 255, 0.08);
  border-radius: 0 8px 8px 0;
  color: var(--text);
}
blockquote.tip {
  border-left-color: var(--emerald);
  background: rgba(16, 185, 129, 0.08);
}
blockquote.gotcha {
  border-left-color: var(--coral);
  background: rgba(244, 63, 94, 0.08);
}
blockquote.limit {
  border-left-color: var(--gold);
  background: rgba(245, 158, 11, 0.08);
}

/* Toolbar Locator Component */
.toolbar-locator {
  margin: 1.6rem 0 2.2rem;
  padding: 1.1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}
.tl-bar-wrapper {
  background: #090b0e;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.55rem 0.75rem 0.65rem;
  overflow-x: auto;
}
.tl-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.tl-bar-title { display: flex; align-items: center; gap: 0.45rem; color: var(--text); }
.tl-bar-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--emerald);
  box-shadow: 0 0 6px var(--emerald);
}
.tl-bar-row { color: var(--accent-hover); }
.tl-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  min-width: max-content;
}
.tl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: #14171f;
  border: 1px solid #242b38;
  position: relative;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all 0.15s ease;
}
.tl-btn img { display: block; width: 16px; height: 16px; pointer-events: none; }
.tl-btn.tl-target {
  background: rgba(124, 92, 255, 0.28);
  border-color: var(--accent);
  opacity: 1;
  box-shadow: 0 0 12px rgba(124, 92, 255, 0.6);
}
.tl-target-ring {
  position: absolute;
  inset: -3px;
  border: 2px solid var(--accent);
  border-radius: 7px;
  pointer-events: none;
  animation: tl-pulse 2s ease-in-out infinite;
}
@keyframes tl-pulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50% { transform: scale(1.12); opacity: 0.4; }
}
.tl-pointer-track {
  height: 38px;
  position: relative;
  overflow: visible;
}
.tl-arrow-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.tl-card {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1rem 1.2rem;
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tl-zoom-icon {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.4);
  border-radius: 12px;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(124, 92, 255, 0.2);
}
.tl-zoom-icon img { width: 38px; height: 38px; }
.tl-card-body { flex: 1; min-width: 0; }
.tl-card-header { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.3rem; flex-wrap: wrap; }
.tl-card-title { font-size: 1.2rem; color: #ffffff; letter-spacing: -0.02em; font-weight: 700; }
.tl-card-key kbd { font-size: 0.82rem; }
.tl-card-desc { margin: 0 0 0.55rem; font-size: 0.9rem; color: var(--muted); line-height: 1.45; }
.tl-card-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tl-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.tl-badge-req {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}
.tl-badge-row {
  background: rgba(124, 92, 255, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(124, 92, 255, 0.28);
}

figure {
  margin: 1.25rem 0 1.5rem;
  padding: 0;
}
figure img, figure video, .shot {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #000000;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
figcaption {
  margin-top: 0.5rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
}
.placeholder {
  display: grid;
  place-items: center;
  min-height: 10rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: repeating-linear-gradient(-45deg, #141820, #141820 8px, #0e1117 8px, #0e1117 16px);
  font-size: 0.85rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0 1.8rem;
}
.card {
  display: block;
  padding: 1rem 1.1rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  min-height: 7.2rem;
  transition: all 0.18s ease;
}
.card:hover {
  border-color: rgba(124, 92, 255, 0.5);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 15px rgba(124, 92, 255, 0.1);
}
.card strong { display: block; margin-bottom: 0.35rem; font-size: 1.05rem; }
.card span { color: var(--muted); font-size: 0.9rem; line-height: 1.4; display: block; }

.steps { counter-reset: step; padding: 0; list-style: none; }
.steps > li {
  position: relative;
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem 0.75rem 3.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.8rem; top: 0.8rem;
  width: 1.65rem; height: 1.65rem;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.2);
  color: var(--accent-hover);
  border: 1px solid rgba(124, 92, 255, 0.4);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid; place-items: center;
}

.pager {
  max-width: var(--max);
  margin: 3rem 0 1.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}
.pager-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.pager-card {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.pager-card:hover {
  border-color: rgba(124, 92, 255, 0.4);
  background: var(--panel-hover);
  transform: translateY(-1px);
}
.pager-card.pager-next {
  text-align: right;
  align-items: flex-end;
}
.pager-card .dir {
  font-size: 0.72rem;
  color: var(--accent-hover);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.pager-card .pager-title {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 600;
}
.pager-spacer { display: block; }
.foot {
  max-width: var(--max);
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 1.6rem;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 1.8rem 0; }

@media (max-width: 860px) {
  .nav-btn { display: inline-block; }
  .side {
    position: fixed;
    z-index: 30;
    left: 0; top: var(--top);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: 8px 0 30px rgba(0,0,0,0.5);
  }
  .nav-toggle:checked ~ .shell .side { transform: none; }
  .nav-toggle:checked ~ .shell .nav-scrim {
    display: block;
    position: fixed;
    inset: var(--top) 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 25;
  }
  .main { padding: 1.4rem 1.1rem 3.5rem; }
  .top-links { display: none; }
  .top-breadcrumb { display: none; }
  .pager-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, .top, .side, .pager, .nav-btn, .hero-actions { display: none !important; }
  .main { padding: 0; }
  a { color: inherit; }
  .page { max-width: none; }
}

/* Inline button locator: a button word that opens a mini locator on
   hover / keyboard focus (CSS-only — no JS). */
.btnref {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed rgba(124, 92, 255, 0.55);
  padding-bottom: 1px;
  white-space: nowrap;
}
.btnref:focus { outline: none; border-bottom-color: var(--accent); }
.btnref:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btnref .br-ico { vertical-align: -1.5px; margin-right: 2px; }

.btnref .br-pop {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  top: calc(100% + 7px);
  z-index: 60;
  width: max-content;
  max-width: min(430px, 86vw);
  display: block;
  background: #0c0e14;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  padding: 0.65rem 0.8rem 0.7rem;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.btnref:hover .br-pop,
.btnref:focus .br-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* Keep the tooltip on-screen for words near the viewport edges. */
.btnref .br-pop::before {
  content: "";
  position: absolute;
  inset: -12px -40px;
  z-index: -1;
}
.br-pop .br-strip {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px 6px;
  margin-bottom: 0.5rem;
  background: #090b0e;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow-x: auto;
  max-width: 100%;
}
.br-pop .br-row {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent-hover);
  font-weight: 650;
  margin-bottom: 0.3rem;
}
.br-pop .br-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.3rem;
}
.br-pop .br-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.98rem;
}
.br-pop kbd.br-key { font-size: 0.72rem; }
.br-pop .br-desc {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0.4rem;
}
.br-pop .br-req {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
}
/* Text-only toolbar buttons (V-Snap, Soft) in locator strips. */
.tl-btn .tl-btn-text {
  font-size: 0.62rem;
  font-weight: 650;
  color: var(--text);
  padding: 0 4px;
  white-space: nowrap;
}
