/* Help page (help.html). Same colors as the app (css/style.css). */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root,
[data-theme="dark"] {
  --bg: #0f1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --code-bg: #161b22;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #656d76;
  --accent: #0969da;
  --code-bg: #f6f8fa;
  color-scheme: light;
}

html {
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--accent);
}

code,
kbd,
pre {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--code-bg);
}

kbd {
  padding: 0.05em 0.4em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  white-space: nowrap;
}

pre {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  overflow-x: auto;
}

.help-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.help-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.help-header__title {
  color: var(--text-muted);
  font-weight: 600;
}

.help-lang {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.help-lang__btn {
  padding: 0.3rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.help-lang__btn + .help-lang__btn {
  border-left: 1px solid var(--border);
}

.help-lang__btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

.help-back {
  font-size: 0.875rem;
}

.help-layout {
  display: flex;
  gap: 2.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem;
}

.help-toc {
  position: sticky;
  top: 4.5rem;
  align-self: flex-start;
  flex: 0 0 230px;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  font-size: 0.875rem;
}

.help-toc ol {
  margin: 0.5rem 0 0;
  padding-left: 1.4rem;
}

.help-toc li {
  margin: 0.2rem 0;
}

.help-toc a {
  color: var(--text);
  text-decoration: none;
}

.help-toc a:hover {
  color: var(--accent);
}

.help-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
}

.help-content h1 {
  margin-top: 0;
  font-size: 1.75rem;
}

.help-content h2 {
  margin-top: 2.25rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.35rem;
}

.help-content h3 {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.help-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.help-tip {
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 6px 6px 0;
}

.help-content li {
  margin: 0.3rem 0;
}

.help-content table {
  width: 100%;
  margin: 0.75rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.help-content th,
.help-content td {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.help-content th {
  background: var(--surface);
}

.help-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
}

@media (max-width: 860px) {
  .help-layout {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
  }

  .help-toc {
    position: static;
    max-height: none;
    flex-basis: auto;
  }

  .help-header {
    padding: 0.75rem 1rem;
  }

  .help-lang {
    margin-left: 0;
  }
}
