/* OTTOKIWI learning pages. Loaded after styles.css, which supplies colours, fonts, header and footer. */
.learn-main { max-width: 1120px; margin: 0 auto; padding: 96px clamp(20px, 5vw, 48px) 64px; }

.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 28px; padding: 0; font-size: 13.5px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--ink-2); }

.learn-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 48px; align-items: start; }
.article-head { grid-column: 2; }
.side { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; font-size: 14px; line-height: 1.55; }
.side-box > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; font-weight: 700; color: var(--brown-deep); }
.side-box > summary::-webkit-details-marker { display: none; }
.side ol { list-style: none; margin: 0; padding: 0; }
.for-narrow { display: none; }

/* Whole guide: lightweight list, current page in cream with a left marker */
.guide-nav { margin-bottom: 24px; }
.guide-nav .side-box > summary { margin-bottom: 8px; pointer-events: none; }
.guide-nav a { display: flex; gap: 8px; padding: 6px 10px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0; color: var(--ink-2); text-decoration: none; }
.guide-nav a:hover { background: var(--warm); color: var(--ink); }
.guide-nav a[aria-current="page"] { background: var(--cream); border-left-color: var(--brown); color: var(--brown-deep); font-weight: 700; }
.guide-overview { margin: 0 0 4px; }
/* One collapsible group per series; the arrow turns when it is open */
.guide-series > summary { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; list-style: none; cursor: pointer; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--brown-deep); }
.guide-series > summary::-webkit-details-marker { display: none; }
.guide-series > summary::before { content: "▸"; flex: none; width: 1em; color: var(--muted); transition: transform .15s ease; }
.guide-series[open] > summary::before { transform: rotate(90deg); }
.guide-series > summary:hover { background: var(--warm); }
.guide-series .series-title { flex: 1; }
.guide-series .count { flex: none; font-size: 12px; font-weight: 400; color: var(--muted); }
.guide-series ol { margin: 0 0 8px; }
.guide-nav .num { flex: none; min-width: 1.6em; font-variant-numeric: tabular-nums; color: var(--muted); }
.guide-nav a[aria-current="page"] .num { color: inherit; }

/* Contents of this article: the section in view is marked by learn.js */
.toc summary { margin-bottom: 8px; pointer-events: none; }
.toc ol { padding-left: 0; border-left: 2px solid var(--warm-2); }
.toc li { margin: 2px 0; }
.toc a { display: block; margin-left: -2px; padding: 4px 0 4px 12px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }
.toc a[aria-current="location"] { border-left-color: var(--brown); color: var(--brown-deep); font-weight: 700; }

.prose { grid-column: 2; min-width: 0; max-width: 760px; font-size: 16.5px; line-height: 1.85; color: var(--ink); }
.article-head { max-width: 760px; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: clamp(27px, 3.4vw, 38px); line-height: 1.32; color: var(--brown-deep); }
.article-meta { margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.article-meta a { color: var(--ink-2); text-underline-offset: 3px; }
.prose h2 { margin: 48px 0 14px; font-size: clamp(22px, 2.5vw, 27px); line-height: 1.4; color: var(--brown-deep); scroll-margin-top: 84px; }
.prose section:first-of-type h2 { margin-top: 0; }
.prose > p + section h2 { margin-top: 40px; }
.prose h3 { margin: 32px 0 10px; font-size: 19px; line-height: 1.45; color: var(--brown-deep); }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.5em; }
.prose li { margin: 7px 0; }
.prose a { color: var(--brown); text-underline-offset: 3px; overflow-wrap: anywhere; }
.prose a:hover { color: var(--brown-deep); }
.prose a.btn-primary, .prose a.btn-primary:hover { color: #fff; text-decoration: none; }   /* the free card's start button keeps its own colours (2026-12-02) */
.prose code { padding: 1px 6px; border-radius: 6px; background: var(--warm); font-size: .9em; overflow-wrap: anywhere; }
.prose strong { color: var(--brown-deep); }

.prose blockquote { margin: 18px 0; padding: 14px 18px; border-radius: 12px; }
.prose blockquote p { margin: 0 0 10px; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose .sample { background: var(--warm); border-left: 4px solid var(--cream); }
.prose .case-note { background: var(--warn-bg); border-left: 4px solid var(--kiwi); font-size: 15px; line-height: 1.7; }
.demo-link { text-decoration: underline dotted; text-underline-offset: 3px; color: var(--brown); }

.table-wrap { margin: 18px 0 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.rt { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.65; }
.rt th, .rt td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.rt th { background: var(--warm); color: var(--brown-deep); font-weight: 700; white-space: nowrap; overflow-wrap: normal; }
html:not([lang="zh-TW"]) .rt th { white-space: normal; } /* Latin headers are longer; let them wrap instead of forcing a side scroll */
.rt tbody tr:last-child td, .rt tbody tr:last-child th { border-bottom: 0; }

.learn-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 48px 0 16px; }
.learn-pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--brown-deep); font-weight: 600; font-size: 15px; line-height: 1.5; text-decoration: none; }
.learn-pager a:hover { border-color: rgba(70, 45, 28, .35); }
.learn-pager small { display: block; margin-bottom: 2px; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.learn-pager .next { grid-column: 2; text-align: right; }
.back-link { font-size: 14.5px; }
.ft-fine a { color: var(--ink-2); }

/* Source markers and the list they point to */
.cite { font-size: .72em; line-height: 0; }
.cite a { padding: 0 2px; text-decoration: none; font-weight: 600; }
.cite a:hover { text-decoration: underline; }
.prose [id] { scroll-margin-top: 84px; }
.sources { padding-left: 1.7em; font-size: 15px; line-height: 1.7; }
.sources li:target, .cite a:target { background: var(--kiwi-soft); border-radius: 4px; }
.cite-back { margin-left: 4px; text-decoration: none; }

/* Real check: quiet green, distinct from the yellow fictional notes */
.prose .real-note { background: var(--ok-bg); border-left: 4px solid var(--ok); font-size: 15px; line-height: 1.7; }
.prose pre.code { margin: 10px 0 18px; padding: 12px 14px; overflow-x: auto; border-radius: 10px; background: var(--warm); font-size: 13.5px; line-height: 1.6; }
.prose pre.code code { padding: 0; background: none; overflow-wrap: normal; white-space: pre; }

/* Copyable worksheets */
.tool { margin: 20px 0 24px; }
.tool figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.tool-title { font-weight: 700; color: var(--brown-deep); }
.tool-copy { min-height: 40px; padding: 0 14px; border: 1px solid rgba(70, 45, 28, .25); border-radius: 10px; background: #fff; color: var(--brown-deep); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.tool-copy[hidden] { display: none; }
.tool-copy:hover { border-color: var(--brown); background: var(--warm); }
.tool-hint { font-size: 13.5px; color: var(--muted); }
.tool-status { font-size: 13.5px; color: var(--ok); }
.tool-table tbody th { background: none; white-space: normal; word-break: keep-all; }
.tool-table tbody td:last-child { min-width: 7em; height: 44px; }

/* Tablets and phones: one column, and each table row becomes a labelled card, so no sideways scrolling. */
@media (max-width: 899px) {
  .learn-main { padding-top: 76px; }
  .learn-grid { grid-template-columns: minmax(0, 1fr); }
  .article-head, .side, .prose { grid-column: 1; grid-row: auto; }
  .article-head { margin-bottom: 20px; }
  /* Narrow screens: two collapsed panels with full-size touch targets */
  .side { position: static; max-height: none; overflow: visible; margin-bottom: 28px; padding: 0; font-size: 15px; }
  .guide-nav { margin-bottom: 10px; }
  .for-wide { display: none; }
  .for-narrow { display: inline; }
  .side-box { border-radius: 12px; background: var(--warm); }
  .side-box > summary, .toc summary { min-height: 48px; margin: 0; padding: 0 16px; cursor: pointer; pointer-events: auto; border-radius: 12px; }
  .side-box > summary::after { content: "▾"; flex: none; font-size: 15px; transition: transform .15s ease; }
  .side-box[open] > summary::after { transform: rotate(180deg); }
  .guide-series > summary { min-height: 44px; font-size: 14.5px; }
  .side-box ol { padding: 0 8px 10px; border-left: 0; }
  .guide-nav a, .toc a { align-items: center; min-height: 44px; padding: 8px 10px; margin: 0; border-radius: 8px; }
  .toc a { display: flex; border-left: 3px solid transparent; }
  .toc a[aria-current="location"] { background: var(--cream); border-left-color: var(--brown); }
}
@media (prefers-reduced-motion: reduce) { .side-box > summary::after, .guide-series > summary::before { transition: none; } }
@media (max-width: 640px) {
  .prose { font-size: 16px; }
  .table-wrap { overflow: visible; border: 0; }
  .rt, .rt tbody, .rt tr, .rt td { display: block; width: 100%; }
  .rt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rt tr { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .rt tbody tr:last-child { margin-bottom: 0; }
  .rt td { display: grid; grid-template-columns: minmax(0, 34%) minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
  .rt tr td:last-child { border-bottom: 0; }
  .rt tbody th { display: block; padding: 9px 12px; background: var(--warm); border-bottom: 1px solid var(--line); }
  /* Blank cells can't be filled in on a page; they stay in the copied worksheet. */
  .tool-table td:last-child { display: none; }
  .tool-table td:nth-child(2) { grid-template-columns: minmax(0, 1fr); }
  .tool-table td:nth-child(2)::before { display: none; }
  .tool-table tr:last-child td:nth-child(2) { border-bottom: 0; }
  .tool-copy { min-height: 44px; }
  .rt td::before { content: attr(data-label); font-weight: 700; font-size: 13px; color: var(--brown-deep); }
  .learn-pager { grid-template-columns: minmax(0, 1fr); }
  .learn-pager .next { grid-column: 1; }
}
@media print { .side, .site-header, .learn-pager { display: none; } .learn-grid { display: block; } }

/* Product page: price card. The button stays disabled until checkout is connected. */
.buy-card { margin: 20px 0 28px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--warm); }
.prose .buy-name { margin: 0; font-weight: 700; color: var(--brown-deep); }
.prose .buy-price { margin: 6px 0 4px; font-size: 30px; font-weight: 800; line-height: 1.3; color: var(--brown-deep); }
.buy-price span { font-size: 18px; font-weight: 600; color: var(--ink-2); }
.prose .buy-note { margin: 0 0 14px; font-size: 14.5px; color: var(--ink-2); }
.buy-button { width: 100%; min-height: 52px; padding: 8px 18px; border: 0; border-radius: 12px; background: var(--brown-deep); color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.buy-button:disabled { opacity: .55; cursor: not-allowed; }
.prose .buy-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; font-size: 14.5px; }
.article-meta time { white-space: nowrap; }

/* Plan cards inside a text page keep their homepage look */
.prose .plan-grid { margin: 20px 0 24px; gap: 16px; }
.prose .plan { padding: 24px; scroll-margin-top: 84px; }
.prose .plan p { margin: 0; }
.prose .plan .plan-for { margin-top: 10px; }
.prose .plan h3 { margin: 6px 0 10px; font-size: 22px; }
.prose .plan-paid h3 { color: #fff; }
.prose .plan-rows { font-size: 14px; }
.prose .plan .btn-ghost { color: var(--ink); text-decoration: none; }
.prose .plan-paid .plan-more { color: rgba(255, 255, 255, .85); }
.prose .plan:target { outline: 3px solid var(--kiwi); outline-offset: 3px; }
@media (max-width: 1099px) { .prose .plan-grid { grid-template-columns: minmax(0, 1fr); } }

/* Side-by-side actions at the end of an article (:::cta) */
.prose .learn-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 8px; }
.prose .learn-cta .btn { height: 48px; padding: 0 22px; font-size: 15px; text-decoration: none; overflow-wrap: normal; }
.prose .learn-cta .btn-primary, .prose .learn-cta .btn-primary:hover { color: #fff; }
.prose .learn-cta .btn-ghost, .prose .learn-cta .btn-ghost:hover { color: var(--ink); }
@media (max-width: 640px) { .prose .learn-cta .btn { flex: 1 1 100%; justify-content: center; } }

/* service scope line (Founder 2026-12-01): short; the full note is in the checkout and the FAQ */
.scope-line { margin: 14px 0 0; padding-left: 10px; border-left: 3px solid var(--kiwi); font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.buy-card .scope-line { margin: 0 0 14px; }
