/* OpenTax docs — layered on styles.css (shared tokens, nav, footer, buttons, code blocks). */
.container--wide { max-width: 1280px; }
.nav__links a[aria-current="page"] { color: var(--ink); font-weight: 600; }

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 96px;
  align-items: start;
}
@media (max-width: 1100px) { .docs-layout { grid-template-columns: 220px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) { .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 20px; } .side { display: none; } }

.side, .toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; }
.side__k { font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: 0.04em; margin: 20px 0 6px; }
.side__k:first-child { margin-top: 0; }
.side a, .side-mobile a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); }
.side a:hover, .side-mobile a:hover { background: var(--canvas); color: var(--ink); }
.side a[aria-current="page"], .side-mobile a[aria-current="page"] { background: var(--canvas); color: var(--ink); font-weight: 600; }
.toc ul { border-left: 1px solid var(--line); }
.toc a { display: block; padding: 4px 0 4px 12px; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.toc a:hover { color: var(--ink); }
.toc .toc--3 a { padding-left: 24px; }

.side-mobile { display: none; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; }
.side-mobile summary { cursor: pointer; padding: 12px 0; font-size: 14px; font-weight: 600; }
.side-mobile nav { padding-bottom: 12px; font-size: 14px; }
@media (max-width: 820px) { .side-mobile { display: block; } }

/* Prose */
.doc { min-width: 0; font-size: 15.5px; line-height: 1.9; }
.doc > * + * { margin-top: 16px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); line-height: 1.3; letter-spacing: -0.01em; }
.doc h2 { font-size: 23px; line-height: 1.4; margin-top: 48px; padding-top: 8px; }
.doc h3 { font-size: 18px; line-height: 1.5; margin-top: 32px; }
.doc h4 { font-size: 16px; margin-top: 24px; }
.doc h1, .doc h2, .doc h3, .doc h4 { position: relative; scroll-margin-top: 88px; }
.doc .anchor { position: absolute; left: -0.9em; color: var(--ink-3); opacity: 0; font-weight: 400; }
.doc :is(h2, h3, h4):hover .anchor { opacity: 1; }
.doc h1 .anchor { display: none; }
.doc p, .doc li { color: #2c2c2e; }
.doc a:not(.card-link):not(.anchor) { color: var(--ink); text-decoration: underline; text-decoration-color: rgb(0 0 0 / .25); text-underline-offset: 3px; }
.doc a:not(.card-link):not(.anchor):hover { text-decoration-color: var(--ink); }
.doc ul, .doc ol { padding-left: 1.4em; }
.doc ul { list-style: disc; }
.doc ol { list-style: decimal; }
.doc li + li { margin-top: 6px; }
.doc li > ul, .doc li > ol { margin-top: 6px; }
.doc strong { font-weight: 700; color: var(--ink); }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc :not(pre) > code { font-size: 0.86em; padding: 2px 6px; border-radius: 6px; background: var(--canvas); color: var(--ink); word-break: break-word; }
.doc .codeblock pre { font-size: 13px; }
.doc blockquote { margin: 16px 0; padding: 4px 18px; border-left: 3px solid var(--line); color: var(--ink-2); }
.doc__lead { font-size: 17px; color: var(--ink-2) !important; }
.doc__edit { margin-top: 64px !important; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; }

.table { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.7; }
.table th, .table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-2); }
.table th { background: var(--canvas); font-weight: 600; white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }

.callout { padding: 14px 18px; border-radius: 14px; background: var(--canvas); border: 1px solid var(--line); font-size: 14.5px; }
.callout p + p { margin-top: 6px; }
.callout__k { font-size: 12.5px; font-weight: 700; letter-spacing: 0.04em; }
.callout--important, .callout--warning, .callout--caution { background: #fff7ed; border-color: rgb(178 80 0 / .22); }
.callout--important .callout__k, .callout--warning .callout__k, .callout--caution .callout__k { color: var(--warning); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card-link { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--r-card); border: 1px solid var(--line); background: var(--surface); transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.card-link:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.card-link span { font-weight: 700; }
.card-link small { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

.notfound { min-height: 60vh; display: grid; place-content: center; text-align: center; gap: 16px; padding: 64px 16px; }
