/* Ladcraft Help Center — isolated styles (does not alter landing tokens) */

:root {
  --help-bg: #fafafa;
  --help-surface: #ffffff;
  --help-text: #111111;
  --help-muted: #5f6368;
  --help-border: rgba(17, 17, 17, 0.08);
  --help-shadow: 0 10px 30px rgba(17, 17, 17, 0.06);
  --help-accent: #fb8760;
  --help-radius: 14px;
  --help-font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --help-sidebar-w: 261px;
  --help-toc-w: 220px;
  --help-content-max: 720px;
}

html.help-page,
body.help-page {
  height: 100%;
}

body.help-page {
  margin: 0;
  font-family: var(--help-font);
  color: var(--help-text);
  background: var(--help-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.help-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-x: clip;
}

.help-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--help-surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--help-border);
}

.help-topbar__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
}

.help-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.help-brand img {
  display: block;
}

.help-brand > span {
  position: relative;
  padding-left: 12px;
  margin-right: 12px;
}

.help-brand > span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 16px;
  background: rgba(10, 10, 10, 0.16);
  transform: translateY(-50%);
}

.help-topnav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.help-topnav a {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--help-muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.help-topnav a:hover {
  background: #f4f4f2;
  color: #111;
}

.help-topbar__spacer {
  display: none;
}

.help-search {
  flex: 1 1 auto;
  width: auto;
  max-width: 472px;
  min-width: 180px;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  position: relative;
  left: auto;
  transform: none;
  margin-left: auto;
}

.help-search__icon {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #717182;
  transform: translateY(-50%);
  pointer-events: none;
}

.help-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: none;
  border-radius: 10px;
  background: #f3f3f3;
  padding: 6px 40px 6px 40px;
  font-family: var(--help-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.0195em;
  color: #0a0a0a;
}

.help-search input::-webkit-search-cancel-button,
.help-search input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}

.help-search input::placeholder {
  color: rgba(10, 10, 10, 0.5);
}

.help-search__clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #8f8fa1;
  cursor: pointer;
}

.help-search__clear[hidden] {
  display: none !important;
}

.help-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.24);
  display: grid;
  place-items: start center;
  padding-top: 68px;
  z-index: 60;
}

.help-search-modal[hidden] {
  display: none;
}

.help-search-modal__panel {
  width: min(920px, calc(100vw - 32px));
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.help-search-modal__head {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #ececec;
  padding: 0 16px;
}

.help-search-modal__head input {
  flex: 1;
  border: 0;
  outline: 0;
  height: 64px;
  font: 500 34px/1.1 var(--help-font);
}

.help-search-modal__head button {
  border: 0;
  background: transparent;
  color: #8c8c96;
  font-size: 32px;
  cursor: pointer;
}

.help-search-modal__list {
  max-height: min(60vh, 520px);
  overflow: auto;
  padding: 8px 0;
}

.help-search-result {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 12px 28px;
  font: 500 34px/1.2 var(--help-font);
  cursor: pointer;
}

.help-search-result:hover {
  background: #f6f6f8;
}

.help-search__clear svg {
  display: block;
  width: 16px;
  height: 16px;
}

.help-search__clear:hover {
  opacity: 0.8;
}

.help-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.help-mobile-actions {
  display: none;
  align-items: center;
  gap: 4px;
}

.help-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #717182;
  cursor: pointer;
}

.help-icon-btn:hover {
  background: #f3f3f3;
}

.help-btn {
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  font-family: var(--help-font);
  border-radius: 10px;
  height: 44px;
  padding: 0 18px;
  border: none;
  position: relative;
  white-space: nowrap;
  background: var(--help-surface);
  color: var(--help-text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.help-btn::before {
  display: none;
}

.help-btn:hover {
  border-color: color-mix(in srgb, var(--help-accent) 35%, var(--help-border));
  box-shadow: 0 6px 18px rgba(251, 135, 96, 0.12);
}

.help-btn--primary {
  background: #111;
  color: #fff;
  border-radius: 10px;
  height: 36px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 1px 3px rgba(0,0,0,0.3);
}

.help-btn--primary::before {
  display: none;
}

.help-btn--primary:hover {
  background: #2a2a2a;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.1) inset,
    0 4px 10px rgba(0,0,0,0.25);
  transform: translateY(-1px);
  border-color: transparent;
}

.help-btn--primary:active {
  background: #000;
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.help-btn--ghost {
  background: transparent;
}

.help-layout {
  width: 100%;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: var(--help-sidebar-w) minmax(0, 1fr) var(--help-toc-w);
  gap: 0;
  align-items: start;
  background: #fff;
}

.help-layout.is-no-toc {
  grid-template-columns: var(--help-sidebar-w) minmax(0, 1fr);
}

.help-sidebar,
.help-toc {
  position: sticky;
  top: 74px;
  align-self: start;
  border: 0;
  border-left: 1px solid var(--help-border);
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  min-height: calc(100vh - 74px);
}

.help-toc {
  background: #fff;
  border: 0;
  box-shadow: none;
}

.help-sidebar__header,
.help-toc__header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--help-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.help-sidebar__title,
.help-toc__title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--help-muted);
  font-weight: 600;
}

.help-nav {
  padding: 24px 24px 32px;
  max-height: calc(100vh - 140px);
  overflow: auto;
  background: #fff;
}

.help-group {
  margin-top: 28px;
}

.help-group:first-child {
  margin-top: 0;
}

.help-group__label {
  list-style: none;
  font-size: 14px;
  line-height: 20px;
  height: 20px;
  color: #717182;
  padding: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}

.help-group__label::-webkit-details-marker {
  display: none;
}

.help-group__label::after {
  content: "";
  width: 16px;
  height: 16px;
  background: url("pic/collapse-icon.svg") center / 16px 16px no-repeat;
  opacity: 0.9;
  transform: rotate(0deg);
  margin-right: 2px;
}

details.help-group[open] > .help-group__label::after {
  transform: rotate(180deg);
}

.help-group__list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.help-subgroup {
  box-sizing: border-box;
  height: 26px;
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 20px;
  font-weight: 500;
  color: rgba(113, 113, 130, 0.7);
  text-transform: none;
  letter-spacing: 0;
  padding: 0;
}

.help-group__list > .help-subgroup {
  margin-top: 8px;
  margin-bottom: 4px;
}

.help-group__list > .help-subgroup:first-child {
  margin-top: 4px;
}

.help-link {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  color: #2b2b2b;
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  border-left: 2px solid transparent;
}

.help-link:hover {
  background: #f3f3f3;
  color: #030213;
  font-weight: 500;
  border-left-color: transparent;
}

.help-link.is-active {
  background: #f3f3f3;
  color: #030213;
  border-left-color: transparent;
}

.help-link--disabled {
  color: #9a9aa4;
  opacity: 1;
  pointer-events: none;
}

.help-main {
  border: 0;
  border-left: 1px solid var(--help-border);
  border-right: 0;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  min-width: 0;
  min-height: calc(100vh - 74px);
}

.help-main__toolbar {
  display: none;
}

.help-breadcrumb {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  font-family: var(--help-font);
  font-size: 13px;
  font-weight: 400;
  color: #9a9aa4;
  line-height: 1.35;
}

.help-breadcrumb code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #2b2b2b;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.help-breadcrumb a,
.help-breadcrumb span {
  display: inline-block;
  min-width: 0;
  max-width: clamp(90px, 16vw, 200px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9a9aa4;
  text-decoration: none;
}

.help-breadcrumb a:hover {
  color: #717182;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.help-breadcrumb__sep {
  flex-shrink: 0;
  color: #c7c7cf;
}

.help-copy {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #717182;
  font-family: var(--help-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.help-copy:hover {
  background: #f3f3f3;
  color: #717182;
}

.help-copy svg {
  flex-shrink: 0;
}

.help-copy-inline {
  display: inline-flex;
  margin: 16px 0 28px;
}

.help-prose h1 + p {
  margin-top: 8px;
  margin-bottom: 0;
}

.help-article {
  padding: 48px 48px 40px;
  background: #fff;
}

.help-prose {
  max-width: var(--help-content-max);
  margin: 0 auto;
}

/* Prose typography (scoped) */
.help-prose h1 {
  font-family: var(--help-font);
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.help-prose > h1 + p {
  margin-top: 0;
  color: var(--help-muted);
  font-size: 16px;
  line-height: 1.55;
}

.help-prose h2 {
  font-family: var(--help-font);
  font-size: 20px;
  margin: 30px 0 12px;
  letter-spacing: -0.01em;
}

.help-prose h3 {
  font-family: var(--help-font);
  font-size: 15px;
  margin: 18px 0 8px;
  color: #1f1f1f;
}

.help-prose p,
.help-prose li {
  font-size: 15.5px;
  line-height: 1.68;
  color: #1f1f1f;
}

.help-prose p {
  margin: 32px 0;
}

.help-prose ul,
.help-prose ol {
  margin: 10px 0 10px 18px;
}

.help-prose li + li {
  margin-top: 8px;
}

.help-prose a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.help-prose a:hover {
  color: #000;
}

.help-prose img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  margin: 12px 0;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
}

.help-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  background: #f6f6f4;
  border: 1px solid var(--help-border);
  padding: 2px 6px;
  border-radius: 8px;
}

.help-prose pre {
  margin: 14px 0;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid var(--help-border);
  background: #0b0b0b;
  color: #f5f5f5;
  overflow: auto;
}

.help-prose pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
}

.help-prose blockquote {
  margin: 14px 0;
  padding: 10px 12px;
  border-left: 3px solid color-mix(in srgb, var(--help-accent) 70%, #ffffff);
  background: color-mix(in srgb, var(--help-accent) 8%, #ffffff);
  border-radius: 10px;
  color: #222;
}

.help-prose hr + hr {
  display: none;
}

.help-prose hr {
  border: 0;
  height: 1px;
  background: #e6e6e6;
  margin: 24px 0;
}

.help-prose > hr:first-of-type {
  display: none;
}

.help-prose aside {
  margin: 20px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(151, 125, 217, 0.1);
  border: 1px solid rgba(151, 125, 217, 0.22);
  color: #1f2937;
  line-height: 1.6;
}

.help-prose aside p {
  margin: 0;
}

.help-prose aside p + p {
  margin-top: 8px;
}

.help-article-nav {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.help-article-nav__link {
  font-family: var(--help-font);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: #717182;
  text-decoration: none;
}

.help-article-nav__link:hover {
  color: #4f4f5c;
}

.help-article-nav__link.is-next {
  margin-left: auto;
  text-align: right;
}

.help-toc__body {
  padding: 24px 24px 0 0;
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.help-toc a {
  display: block;
  padding: 10px 24px;
  color: rgba(10, 10, 10, 0.5);
  text-decoration: none;
  font-size: 14px;
  line-height: 20px;
  font-weight: 400;
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-right: 0;
}

.help-toc a:hover {
  color: rgba(10, 10, 10, 0.8);
}

.help-toc a.is-active {
  color: #0a0a0a;
  border-left-color: #000;
}

.help-mobile-bar {
  display: none;
  gap: 10px;
  padding: 0 0 12px;
}

.help-mobile-overlay {
  display: none;
}

.help-mobile-only {
  display: none;
}

@media (max-width: 768px) {
  /* ── Layout: single column, sidebar and toc out of flow ── */
  .help-layout {
    display: block;
    width: 100%;
    padding: 0;
  }

  .help-sidebar {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border: 0;
    border-radius: 0;
    z-index: 20;
    min-height: unset;
  }

  .help-sidebar.is-open {
    display: block;
  }

  .help-sidebar .help-nav {
    max-height: none;
    padding: 64px 20px 40px;
  }

  .help-toc,
  .help-toc.is-open {
    display: none !important;
  }

  /* ── Topbar ── */
  .help-topbar__inner {
    height: 52px;
    padding: 0 12px;
    gap: 0;
    flex-wrap: nowrap;
    max-width: none;
  }

  .help-brand {
    flex: 1;
    min-width: 0;
  }

  .help-brand > span::before {
    display: none;
  }

  .help-brand > span {
    padding-left: 8px;
    margin-right: 0;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .help-topbar__spacer {
    display: none;
  }

  .help-search {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    top: 52px;
    width: 100%;
    border-radius: 0;
    padding: 8px 12px;
    border-bottom: 1px solid var(--help-border);
    background: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    z-index: 30;
    transform: none;
  }

  .help-search input {
    width: 100%;
    background: #f3f3f3;
  }

  .help-topbar__inner.is-mobile-search-open .help-search {
    display: flex;
  }

  .help-actions {
    display: none;
  }

  .help-mobile-actions {
    display: inline-flex;
    gap: 2px;
    flex-shrink: 0;
  }

  .help-icon-btn {
    width: 40px;
    height: 40px;
  }

  /* ── Overlay ── */
  .help-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 15;
  }

  .help-mobile-overlay[hidden] {
    display: none;
  }

  /* ── Main content: full width ── */
  .help-main {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 0;
    min-height: unset;
  }

  .help-main__toolbar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--help-border);
  }

  .help-copy {
    display: none;
  }

  .help-article {
    padding: 24px 16px 48px;
  }

  .help-prose h1 {
    font-size: clamp(22px, 6vw, 32px);
  }

  .help-prose h2 {
    font-size: 18px;
  }

  .help-prose p,
  .help-prose li {
    font-size: 15px;
  }

  .help-article-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .help-article-nav__link.is-next {
    margin-left: 0;
    text-align: left;
  }
}

.help-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}

.help-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}
