:root {
  color-scheme: light dark;
  --bg: #fafaf9;
  --fg: #1a1a1a;
  --muted: #666;
  --card: #ffffff;
  --border: #e5e5e3;
  --accent: #0058ad;
  --accent-fg: #ffffff;
  --good: #1f8b3a;
  --warn: #b35900;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15161a;
    --fg: #ececec;
    --muted: #999;
    --card: #1f2026;
    --border: #2c2d34;
    --accent: #6fb3ff;
    --accent-fg: #0a0f1c;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 16px; line-height: 1.55; }
header { display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px; border-bottom: 1px solid var(--border); }
header .brand { font-weight: 700; font-size: 20px; }
header .brand .dot { color: var(--accent); }
header nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 14px; }
header nav a:hover { color: var(--fg); }
footer { padding: 32px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 60px; }

.step { display: none; padding: 32px; max-width: 1100px; margin: 0 auto; }
.step.active { display: block; }
.hero h1 { font-size: 36px; line-height: 1.15; margin: 24px 0 8px; max-width: 720px; }
.hero .lede { font-size: 17px; color: var(--muted); max-width: 720px; }
.bullets { list-style: none; padding: 0; margin: 16px 0 28px; max-width: 720px; }
.bullets li { padding: 6px 0; }
.bullets strong { color: var(--fg); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 22px 26px; margin: 18px 0; }
.card.narrow { max-width: 560px; }
.card.center { text-align: center; }
.card h2 { margin: 0 0 12px; font-size: 22px; }
.card .lede { color: var(--muted); }

label { display: block; margin: 14px 0; font-size: 14px; color: var(--muted); }
label input[type="email"], label input[type="password"], label input[type="number"] {
  display: block; width: 100%; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font-size: 15px;
}
label input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
label.check { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; color: var(--fg); }
label.check input { margin-top: 4px; }

button, .cta-button { padding: 11px 18px; border-radius: 8px; border: none;
  background: var(--accent); color: var(--accent-fg);
  font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: none;
  display: inline-block; }
button:hover, .cta-button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.cta-button { margin-top: 18px; }

.howto { padding-left: 22px; color: var(--muted); margin: 12px 0 18px; }
.howto li { padding: 4px 0; }
.howto code { background: var(--bg); padding: 1px 6px; border-radius: 3px; border: 1px solid var(--border); }
.screenshot { margin: 8px 0 18px; padding: 0; }
.screenshot img { width: 100%; max-width: 520px; border: 1px solid var(--border); border-radius: 8px; display: block; }
.screenshot figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; }

.trust { background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: var(--muted); margin: 14px 0; }
.trust strong { color: var(--fg); }
.trust ul { margin: 6px 0 0; padding-left: 20px; }
.trust li { padding: 2px 0; }

/* progress */
.progress-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; }
@media (max-width: 880px) { .progress-layout { grid-template-columns: 1fr; } }
.log { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow-y: auto;
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.log li { padding: 4px 0; border-bottom: 1px dotted var(--border); color: var(--muted); }
.log li.info { color: var(--fg); }
.log li.warn { color: var(--warn); }
.log li.error { color: #c0392b; }
.log li time { color: var(--muted); margin-right: 8px; font-size: 11px; }

.count { display: inline-block; margin-left: 8px; background: var(--accent); color: var(--accent-fg);
  border-radius: 12px; padding: 1px 10px; font-size: 13px; font-weight: 500; vertical-align: middle; }

.live-files { max-height: 60vh; overflow-y: auto; font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px; }
.live-files .file { padding: 2px 0; color: var(--muted); border-bottom: 1px dotted var(--border); }
.live-files .file.new { color: var(--good); animation: flash 1.2s ease-out; }
@keyframes flash { from { background: rgba(31,139,58,0.18); } to { background: transparent; } }

#browseSearch { width: 100%; padding: 10px 12px; margin: 12px 0;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--fg);
  font-size: 14px; }
.browse-layout { display: grid; grid-template-columns: 320px 1fr; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px; min-height: 60vh; }
@media (max-width: 760px) { .browse-layout { grid-template-columns: 1fr; } }
.browse-sidebar { background: var(--bg); border-right: 1px solid var(--border);
  overflow-y: auto; max-height: 60vh; padding: 6px 0; }
.browse-sidebar .course { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--border); }
.browse-sidebar .course:hover { background: var(--card); }
.browse-sidebar .course.active { background: rgba(0,88,173,0.12); }
.browse-sidebar .course .name { font-weight: 500; }
.browse-sidebar .course .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.browse-tree { padding: 12px 16px; overflow-y: auto; max-height: 60vh; font-size: 13.5px; }
.browse-tree h3 { margin: 0 0 8px; font-size: 16px; }
.tree-folder { padding: 3px 0; cursor: pointer; user-select: none; font-weight: 500; }
.tree-folder::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); }
.tree-folder.open::before { content: "▾"; }
.tree-children { display: none; padding-left: 16px; border-left: 1px solid var(--border); margin-left: 6px; }
.tree-folder.open + .tree-children { display: block; }
.tree-file { padding: 2px 0 2px 14px; }
.tree-file a { color: var(--accent); text-decoration: none; }
.tree-file a:hover { text-decoration: underline; }
.tree-file .size { color: var(--muted); font-size: 11px; margin-left: 8px; }
.tree-file .icon { display: inline-block; width: 18px; text-align: center; margin-right: 4px; opacity: .8; }
.empty-browse { color: var(--muted); padding: 16px; font-style: italic; }

.pricing-input { display: flex; align-items: center; gap: 6px; font-size: 28px; font-weight: 600; }
.pricing-input input { width: 160px; font-size: 28px; font-weight: 600; }

/* Anchor banner — visually dominant, no other prices on the page so this
   does the heavy psychological lifting for willingness-to-pay capture. */
.anchor {
  margin: 18px 0 22px;
  padding: 18px 22px;
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(0,88,173,0.08), rgba(0,88,173,0));
  font-size: 17px;
  line-height: 1.5;
  color: var(--fg);
  border-radius: 0 8px 8px 0;
}
.anchor strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
@media (max-width: 540px) {
  .anchor { font-size: 15px; padding: 14px 18px; }
  .anchor strong { font-size: 20px; }
}

.docs { padding: 24px 32px; max-width: 720px; margin: 0 auto; color: var(--muted); font-size: 14px; border-top: 1px solid var(--border); }
.docs h2 { color: var(--fg); }

/* ---- Floating support button + modal ----------------------------------- */
#supportFab {
  position: fixed; right: 20px; bottom: 20px; z-index: 100;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg);
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}
#supportFab:hover { filter: brightness(1.07); transform: translateY(-1px); }
.support-fab-icon { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.22);
  font-weight: 700; font-size: 14px; }
.support-fab-label { line-height: 1; }
@media (max-width: 540px) {
  #supportFab { right: 14px; bottom: 14px; padding: 8px 12px; font-size: 13px; }
  .support-fab-label { display: none; }
}
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: none; align-items: center; justify-content: center; z-index: 200;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  max-width: 520px; width: 100%; padding: 24px 26px; position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
  max-height: 90vh; overflow-y: auto;
}
.modal-panel h2 { margin: 0 0 8px; }
.modal-panel .modal-lede { color: var(--muted); margin: 0 0 12px; font-size: 14px; }
.modal-panel label em { color: var(--muted); font-style: normal; font-size: 12px; }
.modal-panel textarea {
  display: block; width: 100%; padding: 10px 12px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--fg); font-size: 14px;
  font-family: inherit; resize: vertical;
}
.modal-panel textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.modal-close {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  border: none; background: transparent; color: var(--muted);
  font-size: 22px; line-height: 1; cursor: pointer;
}
.modal-close:hover { background: var(--bg); color: var(--fg); }
.modal-result { margin-top: 12px; font-size: 13px; }
.modal-result.success { color: var(--good); }
.modal-result.error { color: #c0392b; }
