/*
 * Styling for migrated guide HTML content (server/migrate-content.mjs pulled
 * these guides in as raw HTML with the original support-centre's class names:
 * .lede-lg, .steps/.step, .note, .auto, .tablewrap/table, .chip, .tag-you/
 * .tag-auto, .step-link). Rather than reinvent guide typography, this is the
 * original /opt/support-centre/style.css content rules, scoped under
 * .guide-content so they can't leak into the rest of the app shell, with the
 * same CentriWeb blue (#4a9fe0) that is now also the app's --primary-500.
 */
.guide-content {
  --gc-paper: #fbfcfd;
  --gc-card: #ffffff;
  --gc-ink: #152230;
  --gc-mut: #5a6b7d;
  --gc-soft: #8b9aab;
  --gc-line: #e4eaf0;
  --gc-line2: #d3dde6;
  --gc-blue: #4a9fe0;
  --gc-blue-d: #2570a8;
  --gc-blue-wash: #eaf3fb;
  --gc-blue-edge: #c9e0f3;
  --gc-ok: #1f9d4d;
  --gc-ok-wash: #e9f7ee;
  --gc-shadow-sm: 0 1px 2px rgba(21, 34, 48, 0.05);
  --gc-shadow-md: 0 10px 30px rgba(21, 34, 48, 0.09);
  color: var(--gc-ink);
  font-size: 17px;
  line-height: 1.7;
}

.dark .guide-content {
  --gc-paper: #0e1420;
  --gc-card: #141b28;
  --gc-ink: #e9eef4;
  --gc-mut: #93a2b4;
  --gc-soft: #657185;
  --gc-line: #232d3d;
  --gc-line2: #2c3849;
  --gc-blue: #5aa8e8;
  --gc-blue-d: #8cc4f2;
  --gc-blue-wash: #182a3c;
  --gc-blue-edge: #26425a;
  --gc-ok: #3ec97e;
  --gc-ok-wash: #132a1f;
  --gc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --gc-shadow-md: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.guide-content .lede-lg { font-size: 16.5px; line-height: 1.65; color: var(--gc-mut); margin: 0 0 6px; max-width: 64ch; }
.guide-content p { max-width: 66ch; margin: 0 0 14px; }
.guide-content h2 { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin: 40px 0 14px; color: var(--gc-ink); }
.guide-content h2:first-child { margin-top: 0; }
.guide-content h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; margin: 26px 0 8px; color: var(--gc-ink); }
/* Keeps a jump from the TOC (or a same-page #anchor link) from landing a
   heading flush under the app's sticky header, where it would be partly
   hidden behind it. */
.guide-content h2, .guide-content h3 { scroll-margin-top: 96px; }

/* Base markdown elements — guides authored as Markdown (contentFormat:
   'md', rendered via react-markdown) produce plain <ul>/<ol>/<a>/<code>/
   <blockquote>/<hr> with no styling hook of their own, unlike the
   migrated-HTML guides above which carry their own classes. Without these,
   a Markdown guide looks unstyled next to a migrated one — this keeps both
   authoring paths reading as the same design system. */
.guide-content ul, .guide-content ol { margin: 0 0 14px; padding-left: 1.35em; max-width: 66ch; }
.guide-content ul { list-style-type: disc; }
.guide-content ol { list-style-type: decimal; }
.guide-content li { margin: 6px 0; padding-left: 2px; line-height: 1.65; }
.guide-content li::marker { color: var(--gc-soft); }
.guide-content li > p { margin: 0; }
.guide-content a { color: var(--gc-blue); text-decoration: underline; text-decoration-color: var(--gc-blue-edge); text-underline-offset: 2px; font-weight: 600; }
.guide-content a:hover { color: var(--gc-blue-d); text-decoration-color: currentColor; }
.guide-content strong { color: var(--gc-ink); font-weight: 700; }
.guide-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--gc-blue-wash); border: 1px solid var(--gc-blue-edge); padding: 0.15em 0.45em; border-radius: 6px; color: var(--gc-blue-d); }
.guide-content pre { background: var(--gc-card); border: 1px solid var(--gc-line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; margin: 6px 0 18px; box-shadow: var(--gc-shadow-sm); }
.guide-content pre code { background: none; border: none; padding: 0; color: var(--gc-ink); font-size: 0.85em; }
.guide-content blockquote { margin: 20px 0; padding: 2px 20px; border-left: 3px solid var(--gc-blue-edge); color: var(--gc-mut); font-style: italic; max-width: 64ch; }
.guide-content hr { border: none; border-top: 1px solid var(--gc-line); margin: 34px 0; }

.guide-content .tag-you, .guide-content .tag-auto {
  display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; margin-left: 8px; vertical-align: middle;
}
.guide-content .tag-you { color: var(--gc-blue-d); background: var(--gc-blue-wash); border: 1px solid var(--gc-blue-edge); }
.guide-content .tag-auto { color: var(--gc-ok); background: var(--gc-ok-wash); border: 1px solid var(--gc-blue-edge); }
.guide-content .step-link { display: block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--gc-blue); text-decoration: none; }
.guide-content .step-link:hover { color: var(--gc-blue-d); }

.guide-content .steps { position: relative; margin: 18px 0 8px; }
.guide-content .steps::before {
  content: ''; position: absolute; left: 21px; top: 16px; bottom: 16px; width: 2px;
  background: linear-gradient(180deg, var(--gc-blue-edge), var(--gc-line));
}
.guide-content .step { position: relative; display: flex; gap: 18px; padding: 14px 0; }
.guide-content .step .n {
  flex: none; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #5aacea, #2f6fb0); color: #fff; font-weight: 800; font-size: 18px;
  display: grid; place-items: center; box-shadow: 0 3px 10px rgba(74, 159, 224, 0.32), 0 0 0 4px var(--gc-paper);
}
.guide-content .step .b { background: var(--gc-card); border: 1px solid var(--gc-line); border-radius: 14px; padding: 15px 19px; flex: 1; box-shadow: var(--gc-shadow-sm); }
.guide-content .step p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--gc-mut); }
.guide-content .step p b, .guide-content .note b, .guide-content td b { color: var(--gc-ink); }

.guide-content .note {
  background: var(--gc-blue-wash); border: 1px solid var(--gc-blue-edge); border-left: 4px solid var(--gc-blue);
  border-radius: 12px; padding: 15px 19px; font-size: 15.5px; line-height: 1.6; margin: 22px 0;
}
.guide-content .note.good { background: var(--gc-ok-wash); border-left-color: var(--gc-ok); }
.guide-content .auto {
  display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--gc-ok);
  text-transform: uppercase; letter-spacing: 0.08em; margin: 34px 0 6px;
}
.guide-content .auto::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--gc-ok); box-shadow: 0 0 0 4px var(--gc-ok-wash); }

.guide-content .tablewrap { overflow-x: auto; border: 1px solid var(--gc-line); border-radius: 14px; margin: 18px 0; box-shadow: var(--gc-shadow-sm); }
.guide-content table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--gc-card); }
.guide-content th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--gc-soft);
  padding: 11px 16px; border-bottom: 1px solid var(--gc-line); font-weight: 700;
}
.guide-content td { padding: 12px 16px; border-bottom: 1px solid var(--gc-line); vertical-align: top; line-height: 1.55; }
.guide-content tr:last-child td { border-bottom: 0; }

.guide-content .chip {
  font-size: 12.5px; font-weight: 700; color: var(--gc-blue-d); background: var(--gc-blue-wash);
  border: 1px solid var(--gc-blue-edge); border-radius: 99px; padding: 4px 12px;
}

.guide-content img {
  max-width: 100%; border: 1px solid var(--gc-line2); border-radius: 12px; box-shadow: var(--gc-shadow-md);
  margin: 14px 0 4px; display: block;
}
.guide-content img + em, .guide-content figcaption { display: block; font-size: 13.5px; color: var(--gc-soft); font-style: normal; margin: 6px 0 18px; }

/* ---------------------------------------------------------------------------
 * Notion-synced guides (server/notion-sync.mjs).
 *
 * The walkthrough content is built almost entirely from toggles and
 * colour-coded callouts, and the colour carries meaning: blue explains what a
 * thing is, yellow warns, gray describes the screenshot that belongs there.
 * Flattening those to one blockquote style lost the distinction, so the sync
 * emits .cw-callout/.cw-toggle with a hue suffix and they are styled here.
 * Hues follow Notion's own palette; anything unrecognised lands on --default.
 * ------------------------------------------------------------------------- */
.guide-content .cw-callout {
  --cw-hue: var(--gc-line2);
  --cw-wash: var(--gc-card);
  border-left: 3px solid var(--cw-hue);
  background: var(--cw-wash);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 0 0 16px;
  max-width: 68ch;
}
.guide-content .cw-callout > :last-child { margin-bottom: 0; }
.guide-content .cw-callout p { max-width: none; }

.guide-content .cw-callout--blue   { --cw-hue: var(--gc-blue);  --cw-wash: var(--gc-blue-wash); }
.guide-content .cw-callout--green  { --cw-hue: var(--gc-ok);    --cw-wash: var(--gc-ok-wash); }
.guide-content .cw-callout--yellow { --cw-hue: #d9a020;         --cw-wash: #fdf6e6; }
.guide-content .cw-callout--orange { --cw-hue: #d97a2b;         --cw-wash: #fdf0e6; }
.guide-content .cw-callout--red    { --cw-hue: #d1495b;         --cw-wash: #fceaec; }
.guide-content .cw-callout--purple { --cw-hue: #8b6bd9;         --cw-wash: #f2eefc; }
.guide-content .cw-callout--pink   { --cw-hue: #cc5f9e;         --cw-wash: #fceef6; }
.guide-content .cw-callout--brown  { --cw-hue: #9c7a5c;         --cw-wash: #f7f1ea; }
.guide-content .cw-callout--gray   { --cw-hue: var(--gc-soft);  --cw-wash: var(--gc-paper); }

.dark .guide-content .cw-callout--yellow { --cw-hue: #e0b04a; --cw-wash: #2b2413; }
.dark .guide-content .cw-callout--orange { --cw-hue: #e89b57; --cw-wash: #2b1e13; }
.dark .guide-content .cw-callout--red    { --cw-hue: #e5697a; --cw-wash: #2b1519; }
.dark .guide-content .cw-callout--purple { --cw-hue: #a68ce8; --cw-wash: #211a33; }
.dark .guide-content .cw-callout--pink   { --cw-hue: #e07fb8; --cw-wash: #2d1826; }
.dark .guide-content .cw-callout--brown  { --cw-hue: #b8977a; --cw-wash: #241d16; }

/* A gray callout in this content is a placeholder describing a screenshot
 * that hasn't been taken yet. Mark it as caption-ish rather than as advice,
 * so it doesn't read like instruction until a real image replaces it. */
.guide-content .cw-callout--gray {
  font-size: 15px;
  color: var(--gc-mut);
  font-style: italic;
}

.guide-content .cw-toggle {
  border: 1px solid var(--gc-line);
  border-radius: 10px;
  background: var(--gc-card);
  margin: 0 0 12px;
  max-width: 68ch;
  overflow: hidden;
}
.guide-content .cw-toggle > summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--gc-ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease;
}
.guide-content .cw-toggle > summary::-webkit-details-marker { display: none; }
.guide-content .cw-toggle > summary::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--gc-soft);
  border-bottom: 2px solid var(--gc-soft);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}
.guide-content .cw-toggle[open] > summary::before { transform: rotate(45deg); }
.guide-content .cw-toggle > summary:hover { background: var(--gc-blue-wash); }
.guide-content .cw-toggle[open] > summary { border-bottom: 1px solid var(--gc-line); }
.guide-content .cw-toggle > :not(summary) { padding: 0 16px; }
.guide-content .cw-toggle > summary + * { padding-top: 14px; }
.guide-content .cw-toggle > :last-child:not(summary) { padding-bottom: 14px; }

/* Nested toggles sit inside an already-bordered parent — drop to a lighter
 * rule so two levels of accordion don't read as two stacked cards. */
.guide-content .cw-toggle .cw-toggle {
  border: 0;
  border-top: 1px solid var(--gc-line);
  border-radius: 0;
  margin: 0;
  background: transparent;
}
.guide-content .cw-toggle .cw-toggle > summary { font-weight: 500; font-size: 15.5px; }

.guide-content .cw-toggle--blue   > summary { box-shadow: inset 3px 0 0 var(--gc-blue); }
.guide-content .cw-toggle--green  > summary { box-shadow: inset 3px 0 0 var(--gc-ok); }
.guide-content .cw-toggle--yellow > summary { box-shadow: inset 3px 0 0 #d9a020; }
.guide-content .cw-toggle--orange > summary { box-shadow: inset 3px 0 0 #d97a2b; }
.guide-content .cw-toggle--purple > summary { box-shadow: inset 3px 0 0 #8b6bd9; }
.guide-content .cw-toggle--red    > summary { box-shadow: inset 3px 0 0 #d1495b; }
.guide-content .cw-toggle--pink   > summary { box-shadow: inset 3px 0 0 #cc5f9e; }
