/* ============================================
   TESTING GUIDE — light mode, multi-page layout
   For /testing-real-world-python-apis/* and paid-book
   chapter sub-pages (chapter14-v2 onwards).

   Self-contained; all rules scoped under .tg-layout.
   Editorial light-mode: warm off-white page, dark code
   blocks (inherited from chapter-styles-v3.css), teal
   accent retained from brand palette.

   Reader-surface stylesheet. The commercial surface
   (landing page, pricing, About) stays on the dark
   DeveloperCraft palette — do NOT use this file there.
   ============================================ */

.tg-layout {
    /* Palette — light-mode reader surface */
    --tg-bg: #fdfcfa;                             /* warm off-white page */
    --tg-panel: #ffffff;                          /* pure white cards/details */
    --tg-panel-2: #f5f4f0;                        /* slightly warmer alt panel */
    --tg-text: #1f2937;                           /* dark slate body text */
    --tg-text-strong: #1C1E21;                    /* Meta/FB native text, slightly warm on cream */
    --tg-muted: #6b7280;                          /* standard muted grey */
    --tg-border: #e5e7eb;                         /* subtle borders */
    --tg-border-soft: #f3f4f6;                    /* very subtle dividers */
    --tg-accent: #0d7a60;                         /* darker teal for AA link contrast on light */
    --tg-accent-soft: #065f46;                    /* deeper hover teal */
    --tg-accent-glow: rgba(16, 163, 127, 0.08);   /* decorative background tint (bright teal fine here) */
    --tg-code-bg: #f6f7f8;                        /* inline code background (Docusaurus-inspired) */

    background: var(--tg-bg);
    color: var(--tg-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: calc(100vh - 4rem);
    padding: 2rem 0 0 0;
}

/* ============================================
   GRID: sidebar + main
   ============================================ */
.tg-container {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    max-width: 1200px;
    margin: 0 auto;
    gap: 4rem;
    padding: 0 2rem 0 0;
}

/* ============================================
   FLOW DIAGRAMS

   Palette: indigo #6366f1 node labels (matches h2 accent),
   slate connectors/diamond, teal #0d7a60 = served-from-database
   branch, amber #b45309 = network-fetch branch. Colours are set
   on SVG attributes inline; the legend swatches below mirror them.
   ============================================ */
   
.tg-main .tg-flow {
    margin: 2.25rem 0 2.75rem;
    background: var(--tg-bg);
    padding: 1.75rem 1.5rem 1.5rem;
}
 
.tg-main .tg-flow svg {
    display: block;
    width: 100%;
    height: auto;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Narrow vertical-stack variant (e.g. a linear step pipeline): cap the
   width and centre it so it does not stretch awkwardly wide on desktop.
   Wide branching diagrams omit this modifier and use the full card width. */
.tg-main .tg-flow--stack svg {
    max-width: 440px;
    margin: 0 auto;
}
 
/* Colour key beneath the diagram */
.tg-main .tg-flow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--tg-border-soft);
    font-size: 0.8rem;
    color: var(--tg-muted);
}
 
.tg-main .tg-flow-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}
 
.tg-main .tg-flow-legend i {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}
 
@media (max-width: 640px) {
    .tg-main .tg-flow {
        padding: 1.25rem 1rem 1.1rem;
    }
 
    .tg-main .tg-flow-legend {
        gap: 1rem;
    }
}

/* ============================================
   SIDEBAR
   ============================================ */
.tg-sidebar {
    position: sticky;
    top: 5rem;
    align-self: start;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding: 1rem 0 2rem 0;

    /* Firefox: thin + low-contrast thumb/track (inverted for light bg) */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.12) transparent;
}

/* Chromium/WebKit: slim hover-reveal scrollbar, inverted for light bg */
.tg-sidebar::-webkit-scrollbar {
    width: 6px;
}

.tg-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.tg-sidebar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
    transition: background 0.2s;
}

.tg-sidebar:hover::-webkit-scrollbar-thumb,
.tg-sidebar:focus-within::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
}

.tg-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.28);
}

.tg-sidebar::-webkit-scrollbar-button {
    display: none;
}

.tg-sidebar-heading {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tg-muted);
    margin: 0 0 0.85rem 0.75rem;
}

.tg-sidebar-guide-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--tg-text-strong);
    margin: 0 0 0.25rem 0.75rem;
    line-height: 1.3;
}

.tg-sidebar-guide-subtitle {
    font-size: 0.8rem;
    color: var(--tg-muted);
    margin: 0 0 1.5rem 0.75rem;
    line-height: 1.4;
}

.tg-sidebar-divider {
    border: none;
    border-top: 1px solid var(--tg-border);
    margin: 0 0 1rem 0;
}

.tg-sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tg-sidebar-list li {
    margin: 0;
}

.tg-sidebar-link {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    margin: 0.1rem 0;
    color: var(--tg-muted);
    text-decoration: none;
    font-size: 0.92rem;
    line-height: 1.4;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.tg-sidebar-link:hover {
    color: var(--tg-text);
    background: rgba(0, 0, 0, 0.03);
}

.tg-sidebar-link.is-active {
    color: var(--tg-accent);
    background: var(--tg-accent-glow);
    border-left-color: var(--tg-accent);
    font-weight: 500;
}

.tg-sidebar-num {
    color: var(--tg-muted);
    font-size: 0.82em;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 1.1rem;
    flex-shrink: 0;
}

.tg-sidebar-link.is-active .tg-sidebar-num {
    color: var(--tg-accent);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.tg-main {
    max-width: 700px;
    padding: 1rem 0 6rem 0;
}

/* Force Inter to win against bare-selector rules in chapter-styles-v3.css
   (e.g. `p { font-family: 'Open Sans' }`). An explicit rule on an element
   beats ancestor inheritance, so the font declared on .tg-layout alone
   isn't enough — these descendants need to re-declare it. */
.tg-main h1,
.tg-main h2,
.tg-main h3,
.tg-main p,
.tg-main ul,
.tg-main ol,
.tg-main li {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-main h1 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--tg-text-strong);
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--tg-border);
    margin: 0 0 1.5rem 0;
    line-height: 1.75;
    letter-spacing: -0.02em;
}

.tg-chapter-header h1 {
    font-size: 1.85rem;
    font-weight: 750;
    color: var(--tg-text-strong);
    padding: 0 0 18px 0;
    border-bottom: 1px solid var(--tg-border);
    margin: 0 0 2rem 0;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.tg-main h1 + p.tg-lead {
    color: var(--tg-text);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0 0 3rem 0;
}


.tg-main h2 {
    color: var(--tg-text-strong);
    font-weight: 600;
    font-size: 1.25rem;
    margin: 2.5rem 0 0.8rem 0;
    padding: 0 0 10px 0;
    border-bottom: 1px solid var(--tg-border);
    line-height: 1.4;
    position: relative;
}

/* Indigo accent stripe carried over from chapter-styles-v3.css's
   .subsection-header::after (60px × 2px). After the h3 -> h2 migration
   promotion, this lands on h2. */
.tg-main h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 60px;
    height: 1px;
    background: #6366f1;
}

.tg-main-chapter-start > h2:first-of-type {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding: 0 0 16px 0;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

/* H3 (sub-subsection) — lighter than h2, used for narrow grouping inside a
   subsection (e.g. OS-specific instructions within "Setting a variable"). */
.tg-main h3 {
    color: var(--tg-text-strong);
    font-weight: 600;
    font-size: 1.05rem;
    margin: 2rem 0 1rem 0;
    line-height: 1.4;
}

.tg-main h4 {
    color: var(--tg-text-strong);
    font-weight: 600;
    font-size: 1rem;
    margin: 1.5rem 0 0.75rem 0;
    line-height: 1.4;
}


.tg-main p {
    color: var(--tg-text);
    line-height: 1.75;
    margin: 0 0 1.1rem 0;
    font-size: 1rem;
}

.tg-main ul,
.tg-main ol {
    color: var(--tg-text);
    line-height: 1.75;
    padding-left: 1.5rem;
    margin: 0 0 1.1rem 0;
}

.tg-main ul { list-style: disc outside; }
.tg-main ol { list-style: decimal outside; }

.tg-main li::marker {
    color: var(--tg-muted);
}

.tg-main ul li,
.tg-main ol li {
    margin: 0.5rem 0;
}

/* Match v3's .spaced-list rhythm — wider vertical gap between list items */
.tg-main ul.spaced-list li,
.tg-main ol.spaced-list li {
    margin-bottom: 0.75em;
}

.tg-main strong {
    color: #5664e0; 
    font-weight: 600;
}

.tg-main b {
    font-weight: 600;
}

.tg-main a {
    color: var(--tg-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.tg-main a:hover {
    color: var(--tg-accent-soft);
}

/* Inline images/diagrams inside the main content. */
.tg-main img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 2rem 0;
    display: block;
}

/* Inline code -- pill background for any plain <code>, plus the
   original .code-heading variant for explicit heading-style usage */

/* Default inline code -- matches .code-heading exactly so plain <code>
   in markup picks up the styling without needing a class. */
.tg-main :not(pre) > code {
    background: var(--tg-code-bg);
    color: var(--tg-text-strong);
    padding: 0.15rem 0.3rem;
    border-radius: 5px;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .9em;
    font-weight: 400;
    white-space: nowrap;
}

.tg-main .code-heading {
    background: var(--tg-code-bg);
    color: var(--tg-text-strong);
    padding: 0.15rem 0.3rem;
    border-radius: 5px;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .9em;
    font-weight: 400;
}

/* Headings: keep monospace shift, drop the pill -- looks heavy at heading scale */
.tg-main h1 :not(pre) > code,
.tg-main h2 :not(pre) > code,
.tg-main h3 :not(pre) > code,
.tg-main h4 :not(pre) > code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.9em;
}

/* Code blocks, program-title, code-header all inherit directly from
   chapter-styles-v3.css — dark code blocks stay dark by design, so the
   code becomes the visual anchor on the light page. No overrides needed. */

/* ============================================
   PREV/NEXT NAV FOOTER
   ============================================ */
.tg-nav-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--tg-border);
}

.tg-nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--tg-border);
    border-radius: 6px;
    background: var(--tg-panel);
    color: var(--tg-text);
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.tg-nav-link:hover {
    border-color: var(--tg-accent);
    background: var(--tg-panel);
    color: var(--tg-text-strong);
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
}

.tg-nav-prev {
    grid-column: 1;
    text-align: left;
}

.tg-nav-next {
    grid-column: 2;
    text-align: right;
    align-items: flex-end;
}

.tg-nav-link-only {
    grid-column: 1 / -1;
}

.tg-nav-label {
    font-size: 0.8rem;
    color: var(--tg-muted);
    font-weight: 500;
}

.tg-nav-title {
    font-size: 0.98rem;
    color: var(--tg-text-strong);
    font-weight: 500;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .tg-container {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 1.25rem;
    }

    .tg-sidebar {
        position: static;
        max-height: none;
        padding: 1rem 0;
        border-bottom: 1px solid var(--tg-border);
        margin-bottom: 1.5rem;
        overflow-y: visible;
    }

    .tg-main {
        padding: 0 0 4rem 0;
        max-width: 100%;
    }

    .tg-main h1 {
        font-size: 2rem;
    }

    .tg-main h2 {
        font-size: 1.2rem;
    }

    .tg-main h3 {
        font-size: 1rem;
    }

    .tg-nav-footer {
        grid-template-columns: 1fr;
    }

    .tg-nav-prev,
    .tg-nav-next {
        grid-column: 1;
        text-align: left;
        align-items: flex-start;
    }
}

/* ============================================
   .tg-lead-in — paragraph lead-in before a content block
   ============================================ */
.tg-main .tg-lead-in {
    font-weight: 600;
    color: #4f46e5;                               /* matches strong colour for consistency */
    margin: 2.5rem 0 1rem 0;
    font-size: 1.05rem;
    line-height: 1.5;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================
   .tg-details — collapsible details with chevron
   ============================================ */
.tg-details {
    background: var(--tg-panel);
    border: 1px solid var(--tg-border);
    border-radius: 6px;
    margin: 0.75rem 0;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.tg-details summary {
    padding: 0.9rem 1.25rem 0.9rem 2.75rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--tg-text);
    list-style: none;
    user-select: none;
    position: relative;
    transition: background 0.15s;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-details summary::-webkit-details-marker {
    display: none;
}

.tg-details summary::before {
    content: '▶';
    position: absolute;
    left: 1.1rem;
    top: 1.05rem;
    color: var(--tg-muted);
    font-size: 0.7em;
    transition: transform 0.2s ease;
}

.tg-details[open] summary::before {
    transform: rotate(90deg);
}

.tg-details summary:hover {
    background: rgba(0, 0, 0, 0.025);
}

/* Allow inline code inside the summary to wrap naturally */
.tg-details summary code {
    white-space: pre-wrap;
}

.tg-details-body {
    padding: 0 1.25rem 1.25rem 2.75rem;
    color: var(--tg-text);
}

.tg-details-body p {
    margin: 0.5rem 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.65;
}

.tg-details-body p:last-child {
    margin-bottom: 0;
}

.tg-details-body ul,
.tg-details-body ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================
   .tg-quiz — end-of-chapter review wrapper
   ============================================ */
.tg-quiz {
    margin: 2.5rem 0;
}

.tg-quiz-heading {
    font-weight: 600;
    color: var(--tg-text-strong);
    margin: 0 0 1.25rem 0;
    font-size: 1rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ============================================
   .tg-warning — critical-warning callout
   Red-based, kept distinct from .tg-caution.
   Use sparingly — only for genuinely interruptive
   material ("don't commit this", "this deletes prod data").
   ============================================ */
.tg-warning {
    border-left: 3px solid #dc2626;
    background: #fef2f2;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.tg-warning-heading {
    font-weight: 600;
    color: #991b1b;
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-warning-heading::before {
    content: '⚠ ';
}

.tg-warning p {
    margin: 0 0 0.75rem 0;
    color: var(--tg-text);                        /* readable body; accent stays on heading/border */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-warning p:last-child {
    margin-bottom: 0;
}

/* ============================================
   .tg-caution — tripwire callout
   Amber accent for heading + border, dark slate for body text.
   Tailwind amber palette (500 border / 700 heading / 50 bg) to
   match the dark version's #f59e0b border. See TEACHING-STYLE-GUIDE.md
   §16 for when this is appropriate vs. prose.
   ============================================ */
.tg-caution {
    border-left: 3px solid #f59e0b;               /* amber-500 — matches dark theme */
    background: #fffbeb;                          /* amber-50 */
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.tg-caution-heading {
    font-weight: 600;
    color: #b45309;                               /* amber-700 — AA on amber-50 */
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-caution-heading::before {
    content: '⚠ ';
}

.tg-caution p {
    margin: 0 0 0.75rem 0;
    color: var(--tg-text);                        /* readable body; accent stays on heading/border */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-caution p:last-child {
    margin-bottom: 0;
}

/* ============================================
   .tg-note — cognitive-load callout
   Brand teal accent for heading + border, dark slate for body.
   See TEACHING-STYLE-GUIDE.md §15 — reserved for model-shortcut,
   forward-release, and framing-insight moves only. Not a tip box.
   ============================================ */
.tg-note {
    border-left: 3px solid var(--tg-accent);      /* brand teal (light-mode dark teal) */
    background: var(--tg-accent-glow);            /* very subtle teal tint */
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.tg-note-heading {
    font-weight: 600;
    color: var(--tg-accent-soft);                 /* deeper teal — AA on tinted bg */
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-note p {
    margin: 0 0 0.75rem 0;
    color: var(--tg-text);                        /* readable body; accent stays on heading/border */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-note p:last-child {
    margin-bottom: 0;
}

/* Inline code inside .tg-note uses the default neutral pill — no tint override.
   The border + background already signal the note context. */

/* ============================================
   .tg-compare — two-option comparison cards
   Side-by-side panels (e.g. current approach vs
   advanced) that stack on narrow viewports. Reuses
   the callout border-left + padding language.
   ============================================ */
.tg-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.tg-compare-card {
    border: 1px solid var(--tg-border);
    border-left: 3px solid #94a3b8;               /* slate-400 — neutral default */
    background: #f8fafc;                          /* slate-50 */
    padding: 1rem 1.25rem;
    border-radius: 4px;
}

.tg-compare-card.is-recommended {
    border-left-color: #16a34a;                   /* green-600 — the path to take now */
}

.tg-compare-title {
    font-weight: 600;
    margin: 0 0 0.6rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--tg-text);
}

.tg-compare-card ul {
    margin: 0;
    padding-left: 1.2rem;
}

.tg-compare-card li {
    margin: 0.3rem 0;
    color: var(--tg-text);
}

@media (max-width: 640px) {
    .tg-compare {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   .tg-info — orientation/logistics callout
   Neutral grey accent for heading + border, dark slate for body.
   Tailwind slate palette (400 border / 700 heading / 50 bg) to
   read as available rather than attention-grabbing. No glyph: this
   is procedural information, not interruption or insight.

   Reserved for reader-orientation and logistics — onboarding asides,
   drop-in module availability, prerequisite reassurance, where-to-
   find-files notes. Not a general-purpose info box: framing insights
   belong in .tg-note; tripwires in .tg-caution; warnings in
   .tg-warning. If the content explains the material being taught
   (rather than how the reader navigates the material), it's a note,
   not an aside.
   ============================================ */
.tg-info {
    border-left: 3px solid #94a3b8;               /* slate-400 — present but not loud */
    background: #f8fafc;                          /* slate-50 — very subtle neutral tint */
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.tg-info-heading {
    font-weight: 600;
    color: #334155;                               /* slate-700 — AA on slate-50, available not loud */
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-info p {
    margin: 0 0 0.75rem 0;
    color: var(--tg-text);                        /* readable body; accent stays on heading/border */
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-info p:last-child {
    margin-bottom: 0;
}

/* Inline code inside .tg-info uses the default neutral pill — no tint override.
   The border + background already signal the aside context, and grey-on-grey
   tinted code would muddy the visual. */

/* ============================================
   .tg-table — tabular data
   ============================================ */

/* .trail-table — specific for data-heavy API response logs */
.trail-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.95rem;
}

.trail-table thead {
    background-color: var(--tg-panel-2); /* The warmer off-white from your palette */
    border-bottom: 2px solid var(--tg-border);
}

.trail-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--tg-text-strong);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trail-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tg-border-soft);
    color: var(--tg-text);
    line-height: 1.5;
}

/* Zebra striping to help the eye track weather rows */
.trail-table tbody tr:nth-child(even) {
    background-color: var(--tg-bg);
}

/* Hover state for row-level focus */
.trail-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.03);
}

/* Monospace helper for IDs and Timestamps */
.trail-table .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-size: 0.85em;
    color: var(--tg-accent); /* Uses your brand teal */
}

.oauth-credentials-table td {
  color: #1f2937;
}

.oauth-credentials-table .credential-group td {
  color: #1f2937;
  font-weight: 700;
  background: #f7f7fb;
}

.oauth-credentials-table td:first-child strong {
  color: #4f5ff0;
}



.tg-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tg-border);
    color: var(--tg-text-strong);
    font-weight: 600;
    font-size: 0.9rem;
}

.tg-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--tg-border-soft);
    color: var(--tg-text);
    vertical-align: top;
    line-height: 1.5;
}

.tg-table tbody tr:hover td {
    background: rgba(0, 0, 0, 0.02);
}

.tg-table tbody tr:last-child td {
    border-bottom: none;
}

.tg-table code {
    font-size: 0.9em;
}

/* .tg-table-wrap-code — modifier for character-comparison tables */
.tg-table-wrap-code code {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    display: inline-block;
    max-width: 100%;
}

/* ============================================
   .tg-label — utility: body-text-size section label
   ============================================ */
.tg-main .tg-label {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--tg-text-strong);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

/* ============================================
   .tg-chapter-plan — chapter orientation block
   Paid-book overview pages only. Top-and-bottom horizontal
   rules bound the block as a distinct orientation section
   without reading as a filled callout. Stacked layout:
   "What you'll learn" sits above "What you'll build",
   separated by a fainter inner hairline.
   ============================================ */
.tg-main .tg-chapter-plan {
    margin: 1.75rem 0 2.5rem 0;
    padding: 1.5rem 0;
    border-top: 1px solid var(--tg-border);
    border-bottom: 1px solid var(--tg-border);
}

/* When a chapter-plan immediately follows an h2, the h2's bottom border
   already supplies the upper hairline — suppress the plan's redundant top
   border to avoid a double rule. */
.tg-main h2 + .tg-chapter-plan {
    border-top: none;
    padding-top: 1.25rem;     
    margin-top: 1rem;         
}

.tg-main .tg-chapter-plan-group + .tg-chapter-plan-group {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--tg-border-soft);
}

.tg-main .tg-chapter-plan-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tg-main .tg-chapter-plan-list li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.1rem;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--tg-text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.tg-main .tg-chapter-plan-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.9rem;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--tg-muted);
}

.tg-main .tg-chapter-plan-list li::marker {
    content: '';
}

/* Inline filenames should read as easily as the list text itself */
.tg-main .tg-chapter-plan-list li code {
    font-size: 1em;
}

@media (max-width: 640px) {
    .tg-main .tg-chapter-plan {
        padding: 1.25rem 1.5rem;
    }
}
