.portfolio-guide {
  --pg-bg: #171717;
  --pg-text: #fff;
  --pg-muted: #cecece;
  --pg-line: #444;
  --pg-hover: #252525;
  --pg-gap: max(1rem, env(safe-area-inset-right));
  position: fixed;
  z-index: 36;
  inset-inline-end: var(--pg-gap);
  bottom: max(1rem, env(safe-area-inset-bottom));
  color: var(--pg-text);
  text-align: start;
  font: 400 14px/1.5 var(--font-body, Poppins, sans-serif);
  pointer-events: auto;
}
html[data-theme="light"] .portfolio-guide {
  --pg-bg: #fff;
  --pg-text: #090909;
  --pg-muted: #494949;
  --pg-line: #d8d8d8;
  --pg-hover: #f5f5f5;
}
.page-tools .portfolio-guide { position: relative; inset: auto; }
.page-tools:has(.portfolio-guide) .back-to-top:not(.is-visible) { display: none; }
.portfolio-guide [hidden] { display: none !important; }
.portfolio-guide *, .portfolio-guide *::after { box-sizing: border-box; }
.portfolio-guide button, .portfolio-guide a {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  text-decoration: none;
}
.portfolio-guide button:focus-visible, .portfolio-guide a:focus-visible {
  outline: 2px solid var(--pg-text);
  outline-offset: 3px;
}
.portfolio-guide .pg-launch {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 46px;
  padding: 6px 14px 6px 9px;
  border: 1px solid rgb(0 0 0 / 15%);
  border-radius: 100px;
  background: var(--yellow, #ebb400);
  color: #090909;
  font-weight: 600;
  box-shadow: 0 3px 14px rgb(0 0 0 / 18%);
}
.pg-mark {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
  padding: 3px;
  background: #fff;
  border-radius: 50%;
}
.pg-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(100% + 10px);
  display: flex;
  flex-direction: column;
  width: min(22rem, calc(100vw - var(--pg-gap) - 1rem));
  max-height: calc(100vh - 9rem);
  max-height: calc(100dvh - 9rem - env(safe-area-inset-bottom));
  padding: 0;
  border-radius: 16px;
  border: 1px solid var(--pg-line);
  background: var(--pg-bg);
  box-shadow: 0 10px 42px rgb(0 0 0 / 22%);
}
.pg-header {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 7px 0 18px;
  border-bottom: 1px solid var(--pg-line);
}
.pg-header strong { font-size: .84rem; font-weight: 600; color: var(--pg-muted); }
.portfolio-guide .pg-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pg-text);
  font: 400 25px/1 sans-serif;
}
.pg-body { overflow-y: auto; overscroll-behavior: contain; padding: 18px; }
.portfolio-guide .pg-question { font-size: 1.12rem; line-height: 1.35; letter-spacing: -.025em; color: var(--pg-text); margin: 0; outline: 0; }
.portfolio-guide .pg-answer { color: var(--pg-muted); margin: 9px 0 14px; font: inherit; }
.pg-options { display: grid; gap: 6px; }
.portfolio-guide .pg-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--pg-text);
  background: transparent;
  border: 1px solid var(--pg-line);
  border-radius: 8px;
  text-align: start;
}
.pg-options button::after { content: '›'; color: var(--pg-muted); font-size: 1rem; }
.portfolio-guide .pg-action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  margin: 0 0 12px;
  color: #090909;
  background: var(--yellow, #ebb400);
  border-radius: 100px;
  font-weight: 600;
}
.portfolio-guide .pg-back {
  display: block;
  min-height: 44px;
  margin: 5px 0 -9px;
  background: transparent;
  border: none;
  color: var(--pg-muted);
  padding: 3px;
}
.portfolio-guide .pg-close:hover, .pg-options button:hover { background: var(--pg-hover); }
.portfolio-guide .pg-back:hover { color: var(--pg-text); }
@media (max-height: 430px) {
  .pg-panel { bottom: 0; z-index: 1; max-height: calc(100dvh - 6rem); }
  .page-tools:has(.portfolio-guide):has(.back-to-top.is-visible) .pg-panel { max-height: calc(100dvh - 8rem); }
}
@media print { .portfolio-guide { display: none; } }
