/* The approved reading layout is scoped to article pages. */
@scope (.article-page) {
:scope {
  --bg: #fff;
  --surface: #f7f7f6;
  --warm: #f2f2f0;
  --text: #111;
  --secondary: #333;
  --muted: #6b6b67;
  --border: #d2d2ce;
  --border-soft: #e4e4e1;
  --accent: #ff3d00;
  --accent-text: #d93500;
  --accent-deep: #b82d00;
  --accent-tint: #ffede6;
  font-family: Inter, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
  scrollbar-color: var(--border) var(--surface);
}
* { box-sizing: border-box; }
:scope { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
::selection { background: var(--accent-tint); color: var(--text); }
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 5px; }
h2:focus,article:focus { outline: none; }
.container { width: min(100%, 1240px); padding-inline: 32px; margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 24px; z-index: 120; padding: 12px 20px; background: var(--text); color: white; border-radius: 10px; }
.skip-link:focus { top: 8px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; padding-top: 40px; margin-bottom: 28px; color: var(--muted); font-size: 14px; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-text); }
.breadcrumb svg { width: 14px; height: 14px; }
.article-intro { max-width: 840px; padding-bottom: 44px; }
h1 { margin: 0; font-size: clamp(38px, 3.6vw, 52px); font-weight: 600; line-height: 1.08; letter-spacing: -.035em; text-wrap: balance; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; margin-block: 26px 30px; font-size: 14px; color: var(--muted); }
.article-meta span:first-child { color: var(--text); font-weight: 500; }
.intro-copy { max-width: 720px; font-size: 20px; line-height: 1.6; }
.intro-copy p { margin: 0 0 20px; }
.intro-copy p:first-child { font-size: 22px; line-height: 1.5; }
.intro-copy p:last-child { font-size: 17px; line-height: 1.55; color: var(--muted); margin-bottom: 0; }
.reading-layout { display: grid; grid-template-columns: minmax(0, 848px) minmax(190px, 240px); gap: 64px; align-items: start; padding-bottom: 88px; }
.contents { grid-column: 2; grid-row: 1; position: sticky; top: 104px; padding-left: 20px; border-left: 1px solid var(--border-soft); }
.contents-title { margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.contents ol,.mobile-contents ol { list-style: none; margin: 0; padding: 0; }
.contents li + li { margin-top: 14px; }
.contents a { display: block; font-size: 14px; line-height: 1.5; text-decoration: none; color: var(--muted); }
.contents a:hover,.contents a[aria-current='true'] { color: var(--accent-text); }
.article-body { grid-column: 1; grid-row: 1; min-width: 0; font-size: 20px; line-height: 1.65; }
.article-body > p,.article-body > h2,.article-body > h3,.article-body > ol { max-width: 720px; }
.article-body > p { margin: 0 0 22px; }
.article-body > p strong { font-weight: 600; }
.article-body a:not(.course-link) { color: var(--accent-text); text-decoration-color: var(--border); }
.article-body a:not(.course-link):hover { color: var(--accent-deep); text-decoration-color: currentColor; }
h2 { margin: 64px 0 24px; font-size: 34px; font-weight: 600; line-height: 1.18; letter-spacing: -.025em; text-wrap: balance; scroll-margin-top: 98px; }
.article-body > h2:first-of-type { margin-top: 0; }
h3 { margin: 42px 0 18px; font-size: 26px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.article-body > ol { padding-left: 26px; margin: 24px 0; }
.article-body > ol li { padding-left: 6px; margin-block: 12px; }
.article-body > ol li::marker { color: var(--accent-text); font-weight: 600; }
.comparison-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 12px; margin: 32px 0; scrollbar-width: thin; scrollbar-color: var(--muted) var(--surface); }
table { width: 100%; min-width: 790px; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.5; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; background: var(--warm); }
th,td { padding: 16px 14px; vertical-align: top; border-bottom: 1px solid var(--border-soft); }
th:first-child,td:first-child { width: 145px; position: sticky; left: 0; background: var(--bg); border-right: 1px solid var(--border-soft); font-weight: 600; }
th:first-child { background: var(--warm); }
tr:last-child td { border-bottom: 0; }
.article-body > .table-hint { display: none; font-size: 13px; color: var(--muted); margin-top: -18px; }
figure { margin: 30px 0 38px; }
.sheet-button { position: relative; display: block; border: 1px solid var(--border-soft); padding: 0; width: 100%; background: var(--bg); overflow: hidden; border-radius: 12px; }
.sheet-button img { display: block; width: 100%; height: auto; }
.sheet-action { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border-top: 1px solid var(--border-soft); color: var(--secondary); font-size: 14px; font-weight: 500; }
.sheet-button:hover .sheet-action { color: var(--accent-deep); background: var(--accent-tint); }
figcaption { margin-top: 12px; max-width: 720px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.course-ending { background: var(--warm); padding: 32px; margin-top: 40px; border-radius: 16px; }
.course-ending p { margin: 0 0 24px; max-width: 700px; font-size: 20px; line-height: 1.55; }
.course-link { width: fit-content; display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 52px; padding: 12px 20px; border-radius: 16px; background: var(--accent-text); color: white; font-size: 16px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.course-link:hover { background: var(--accent-deep); }
.mobile-contents { display: none; }
.sheet-viewer { width: min(1280px, calc(100% - 40px)); max-height: calc(100dvh - 40px); margin: auto; padding: 0; border: 0; border-radius: 16px; color: var(--text); background: var(--bg); }
.sheet-viewer::backdrop { background: rgb(17 17 17 / 80%); }
.viewer-toolbar { display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 8px 16px; border-bottom: 1px solid var(--border-soft); }
.viewer-toolbar button { border: 0; background: var(--surface); border-radius: 10px; min-height: 42px; padding: 8px 14px; font-size: 14px; }
.viewer-toolbar button:hover { background: var(--warm); }
.viewer-close { display: flex; align-items: center; justify-content: center; width: 42px; }
.viewer-canvas { max-height: calc(100dvh - 180px); overflow: auto; scrollbar-color: var(--muted) var(--surface); }
.viewer-canvas img { display: block; width: 100%; height: auto; }
.viewer-canvas.is-zoomed img { width: max(100%, 1800px); max-width: none; }
#viewer-caption { margin: 0; padding: 14px 20px; font-size: 14px; line-height: 1.5; color: var(--muted); }
@media (max-width: 1000px) {
  .reading-layout { display: block; }
  .contents { display: none; }
  .article-intro,.article-body { max-width: 800px; }
  .mobile-contents { display: block; border-block: 1px solid var(--border-soft); margin-bottom: 40px; }
  .mobile-contents summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; }
  .mobile-contents summary::-webkit-details-marker { display: none; }
  .mobile-contents[open] summary svg { rotate: 180deg; }
  .mobile-contents li { border-top: 1px solid var(--border-soft); }
  .mobile-contents a { display: block; padding-block: 13px; font-size: 15px; line-height: 1.5; text-decoration: none; }
  .article-body > .table-hint { display: block; }
}
@media (max-width: 720px) {
  .container { padding-inline: 20px; }
  .breadcrumb { padding-top: 26px; margin-bottom: 22px; font-size: 13px; }
  h1 { font-size: 34px; line-height: 1.13; letter-spacing: -.03em; text-wrap: pretty; }
  .article-meta { gap: 16px; margin-block: 24px; font-size: 13px; }
  .intro-copy { font-size: 18px; line-height: 1.6; }
  .intro-copy p:first-child { font-size: 20px; line-height: 1.5; }
  .intro-copy p:last-child { font-size: 16px; }
  .article-intro { padding-bottom: 32px; }
  .article-body { font-size: 18px; line-height: 1.65; }
  h2 { margin-top: 50px; margin-bottom: 20px; font-size: 28px; line-height: 1.2; }
  h3 { margin-top: 34px; margin-bottom: 16px; font-size: 23px; }
  .comparison-wrap { margin-block: 26px; }
  figure { margin-block: 26px; }
  figcaption { font-size: 13px; }
  .course-ending { padding: 24px 20px; margin-top: 32px; }
  .course-ending p { font-size: 18px; }
  .course-link { width: 100%; font-size: 15px; gap: 12px; }
  .reading-layout { padding-bottom: 56px; }
  .sheet-viewer { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .viewer-canvas { max-height: calc(100dvh - 170px); }
}
@media (prefers-reduced-motion: reduce) { :scope { scroll-behavior: auto; } }

.article-body a:not(.course-link){text-decoration-line:underline}
}

@scope (.article-page){
.articles-index{padding-bottom:88px;min-height:65vh}
.articles-index h1{max-width:840px}
.articles-index__lead{max-width:62ch;margin:24px 0 44px;font-size:20px;line-height:1.55;color:var(--muted)}
.article-list{max-width:848px;border-top:1px solid var(--border)}
.article-list__link{display:block;padding:32px 0;border-bottom:1px solid var(--border);text-decoration:none}
.article-list h2{max-width:720px;margin:0 0 18px;font-size:30px}
.article-list p{max-width:62ch;margin:0 0 20px;font-size:18px;line-height:1.6;color:var(--secondary)}
.article-list__meta{display:block;font-size:14px;color:var(--muted)}
.article-list__action{display:flex;align-items:center;gap:12px;margin-top:24px;color:var(--accent-text);font-size:16px;font-weight:500}
.article-list__link:hover h2{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:5px}
@media(max-width:720px){.articles-index{padding-bottom:56px}.articles-index__lead{font-size:18px;margin-bottom:32px}.article-list h2{font-size:26px}.article-list p{font-size:16px}}
}
