/* Frontier Help Center, TextileCloud design tokens (PlatformFrontend DESIGN.md):
   Inter with Noto Sans TC, green-500 #00694D (light) and primary-400 #21B185 (dark), grey scale. */
:root {
  --primary: #00694d;
  --primary-strong: #004c37;
  --primary-soft: #e6f3ee;
  --on-primary: #ffffff;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-muted: #f7f7f7;
  --text: #2b2c2c;
  --text-muted: #5a5b5b;
  --border: #e9e9e9;
  --hover: #f3f3f3;
  --mark: #fff2b3;
  --note: #3b6fd8;
  --warning: #9a5c00;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.05);
  --font: 'Inter', 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #21b185;
    --primary-strong: #3ec39b;
    --primary-soft: #262d2b;
    --on-primary: #08130f;
    --bg: #131414;
    --surface: #1c1d1d;
    --surface-muted: #2b2c2c;
    --text: #f3f3f3;
    --text-muted: #b3b4b4;
    --border: #424343;
    --hover: #303030;
    --mark: #5c4b00;
    --note: #7fa6f0;
    --warning: #e0a040;
    --danger: #ef7b6e;
  }
}
:root[data-theme="dark"] {
  --primary: #21b185;
  --primary-strong: #3ec39b;
  --primary-soft: #262d2b;
  --on-primary: #08130f;
  --bg: #131414;
  --surface: #1c1d1d;
  --surface-muted: #2b2c2c;
  --text: #f3f3f3;
  --text-muted: #b3b4b4;
  --border: #424343;
  --hover: #303030;
  --mark: #5c4b00;
  --note: #7fa6f0;
  --warning: #e0a040;
  --danger: #ef7b6e;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Links to a heading glide there instead of jumping; never for people who asked for less motion. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 0.6em; }
h1 { font-size: 2rem; margin-top: 0.4em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 40; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.skip-link:focus { left: 8px; }
.muted { color: var(--text-muted); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; padding-top: 24px; padding-bottom: 48px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.lead { color: var(--text-muted); font-size: 1.125rem; margin: 0 0 24px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
.brand-title { font-weight: 500; color: var(--text-muted); border-left: 1px solid var(--border); padding-left: 12px; }
.topbar .search { flex: 1; max-width: 480px; margin-left: auto; }
.lang-switch { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
.topbar .search + .lang-switch { margin-left: 0; }
.topbar-link { color: var(--text); font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.topbar-link[aria-current="page"] { color: var(--primary); }

/* Search */
.search { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; display: flex; color: var(--text-muted); pointer-events: none; }
.search-input { width: 100%; font: inherit; color: var(--text); background: var(--surface-muted); border: 1px solid var(--border); border-radius: 999px; padding: 8px 40px 8px 38px; }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-key { position: absolute; right: 12px; font: 12px var(--mono); color: var(--text-muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; }
.search-input:focus ~ .search-key { display: none; }
.search-hero .search-input, .search-page .search-input { font-size: 1.125rem; padding: 14px 120px 14px 46px; background: var(--surface); box-shadow: var(--shadow); }
.search-hero .search-icon, .search-page .search-icon { left: 16px; }
.search-page { margin-bottom: 16px; }
.search-button { position: absolute; right: 6px; font: inherit; font-weight: 600; color: var(--on-primary); background: var(--primary); border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer; }
.search-button:hover { background: var(--primary-strong); }
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30; margin: 0; padding: 6px; list-style: none; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.suggest a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 6px; color: var(--text); }
.suggest a:hover, .suggest [aria-selected='true'] a { background: var(--primary-soft); text-decoration: none; }
.suggest-crumb { font-size: 0.8rem; color: var(--text-muted); }
.suggest-title mark, .suggest-snippet mark { background: var(--mark); }
.suggest-snippet { font-size: 0.8rem; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.suggest-lock { margin-left: 8px; font-size: 0.7rem; font-weight: 500; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.suggest-lock:empty { display: none; }
.suggest-empty { padding: 10px; color: var(--text-muted); font-size: 0.9rem; }
.suggest-all a { color: var(--primary); font-weight: 500; }

/* Home */
.hero { padding: 56px 20px 40px; text-align: center; background: linear-gradient(180deg, var(--primary-soft), var(--bg)); }
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 2.25rem; margin: 0 0 8px; }
.hint { color: var(--text-muted); font-size: 0.875rem; margin: 10px 0 0; }
.home-block { margin: 40px 0; }
.home-block h2, .related h2 { font-size: 1.25rem; margin: 0 0 16px; }
.cards, .tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.cards-list { grid-template-columns: 1fr; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card, .tile { height: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); transition: border-color 0.15s, box-shadow 0.15s; }
.card:hover, .tile:hover { border-color: var(--primary); box-shadow: var(--shadow); text-decoration: none; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.card-title, .tile-title { font-weight: 600; }
.card-summary, .card-crumb, .tile-desc { color: var(--text-muted); font-size: 0.9rem; }
.card-crumb { font-size: 0.8rem; }
.card-date { color: var(--primary); font-size: 0.8rem; font-weight: 600; }
.whats-new-block { padding: 20px; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary-soft); }
.whats-new-block .block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.whats-new-block h2 { margin: 0; }
.whats-new-block .see-all { font-size: 0.9rem; font-weight: 600; white-space: nowrap; }
.tile { display: flex; gap: 14px; padding: 18px; }
.tile-icon { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.tile-icon .icon { width: 22px; height: 22px; }
.tile-body { display: flex; flex-direction: column; gap: 2px; }
.tile-count { margin-top: 4px; color: var(--text-muted); font-size: 0.8rem; }

/* Docs layout */
.doc-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 40px; padding-top: 24px; padding-bottom: 48px; }
.doc-layout.no-toc { grid-template-columns: 240px minmax(0, 1fr); }
.doc-main { max-width: 760px; }
.sidebar { position: sticky; top: 72px; align-self: start; max-height: calc(100vh - 88px); overflow: auto; font-size: 0.925rem; }
.sidebar-toggle { display: none; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li > a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--text); }
.sidebar li > a:hover { background: var(--hover); text-decoration: none; }
.sidebar .open > a { font-weight: 600; }
.sidebar .sidebar-standalone.first { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.sidebar li ul { margin: 2px 0 8px 10px; padding-left: 8px; border-left: 1px solid var(--border); }
.sidebar li ul a { color: var(--text-muted); }
.sidebar a[aria-current='page'] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toc { position: sticky; top: 72px; align-self: start; font-size: 0.875rem; }
.toc-title { font-weight: 600; margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 3px 12px; color: var(--text-muted); }
.toc a:hover, .toc a.active { color: var(--primary); text-decoration: none; }
.toc a.active { font-weight: 600; }
.toc ul ul { border-left: 0; }
.toc .toc-level-1 a { padding-left: 24px; }
.toc-inline { display: none; margin: 0 0 20px; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 0.925rem; }
.toc-inline summary { cursor: pointer; font-weight: 600; }
.toc-inline ul { list-style: none; margin: 8px 0 4px; padding: 0; }
.toc-inline ul ul { padding-left: 14px; }
.toc-inline li { margin: 4px 0; }
.toc-inline a { color: var(--text-muted); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; font-size: 0.875rem; color: var(--text-muted); }
.breadcrumbs li + li::before { content: '›'; margin-right: 6px; }
.breadcrumbs a { color: var(--text-muted); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 16px; margin: -4px 0 24px; color: var(--text-muted); font-size: 0.875rem; }
.notice { padding: 10px 14px; border-radius: 8px; background: var(--primary-soft); font-size: 0.925rem; }

/* Article body */
.markdown { overflow-wrap: anywhere; }
.markdown img { max-width: 100%; height: auto; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px; }
.markdown img.img-small { width: 40%; }
.markdown img.img-medium { width: 60%; }
.markdown img.img-large { width: 80%; }
.markdown figure { margin: 1rem 0; }
.markdown figure img { display: block; margin-bottom: 0; }
.markdown figcaption { margin-top: 6px; font-size: 0.875rem; color: var(--text-muted); }
@media (max-width: 600px) { .markdown img.img-small { width: 60%; } .markdown img.img-medium, .markdown img.img-large { width: 100%; } }
.markdown code { font: 0.9em var(--mono); background: var(--surface-muted); border-radius: 4px; padding: 0.1em 0.35em; }
.markdown pre { overflow-x: auto; padding: 14px; border-radius: 8px; background: var(--surface-muted); }
.markdown pre code { background: none; padding: 0; }
.markdown li { margin: 4px 0; }
.markdown blockquote { margin: 16px 0; padding: 4px 16px; border-left: 3px solid var(--border); color: var(--text-muted); }
.markdown h2, .markdown h3, .markdown h4 { scroll-margin-top: 80px; }
.markdown table { min-width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.markdown th, .markdown td { padding: 8px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.markdown th { background: var(--surface-muted); }

/* Tables scroll sideways instead of squeezing; short cells stay on one line, the last column (usually a description) wraps. */
/* Scroll shadows: a soft edge appears on the side that has more columns, and only while there is more to scroll. */
.table-wrap {
  overflow-x: auto; margin: 16px 0;
  background:
    linear-gradient(to right, var(--bg) 40%, transparent) left / 32px 100% no-repeat local,
    linear-gradient(to left, var(--bg) 40%, transparent) right / 32px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--text) 22%, transparent), transparent) right / 12px 100% no-repeat scroll;
}
.markdown .table-wrap > table { margin: 0; }
.markdown .table-wrap .cell-short { white-space: nowrap; }
.markdown .table-wrap td:last-child:not(.cell-short), .markdown .table-wrap th:last-child:not(.cell-short) { min-width: 12rem; }

/* Sort and filter (tables.js). */
.markdown .table-tools { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin: 16px 0 6px; }
.markdown .table-tools + .table-wrap { margin-top: 0; }
.markdown .table-search { width: 14rem; max-width: 100%; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.markdown .table-search::placeholder, .markdown tr.table-filters input::placeholder { color: var(--text-muted); }
.markdown .table-filter-toggle { font: inherit; font-size: 13px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.markdown .table-filter-toggle:hover, .markdown .table-filter-toggle[aria-expanded="true"] { color: var(--primary); border-color: var(--primary); }
.markdown tr.table-empty td { color: var(--text-muted); font-style: italic; text-align: center; white-space: normal; }
.markdown .table-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: inherit; }
.markdown .table-sort:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 3px; }
.markdown .table-sort::after { content: '\2195'; color: var(--text-muted); font-size: 12px; opacity: .55; }
.markdown th:hover .table-sort::after { opacity: 1; color: var(--text); }
.markdown th[aria-sort="ascending"] .table-sort::after { content: '\2191'; color: var(--primary); opacity: 1; }
.markdown th[aria-sort="descending"] .table-sort::after { content: '\2193'; color: var(--primary); opacity: 1; }
.markdown tr.table-filters td { padding: 4px 6px; background: var(--surface-muted); }
.markdown tr.table-filters input { width: 100%; min-width: 6rem; font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 3px 6px; }
/* Expand (tables.js): the table as a read only spreadsheet in a full screen dialog, styled like the editor's grid. */
.markdown .table-expand, .markdown .table-close, .markdown .table-copy { font: inherit; font-size: 13px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.markdown .table-expand:hover, .markdown .table-close:hover, .markdown .table-copy:hover { color: var(--primary); border-color: var(--primary); }
.markdown .table-expand:focus-visible, .markdown .table-close:focus-visible, .markdown .table-copy:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.markdown .table-dialog { width: calc(100vw - 48px); height: calc(100vh - 48px); max-width: none; max-height: none; margin: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.markdown .table-dialog[open] { display: flex; flex-direction: column; }
.markdown .table-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.markdown .table-dialog .table-tools { justify-content: flex-start; margin: 0 0 10px; }
.markdown .table-dialog .table-close { margin-left: auto; }
.markdown .table-sheet-hint { font-size: 13px; color: var(--text-muted); }
.markdown .table-sheet-scroll { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--border); border-radius: 6px; outline: none; }
.markdown .table-sheet-scroll:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.markdown table.table-sheet { display: table; width: max-content; min-width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.markdown .table-sheet th, .markdown .table-sheet td { border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 8px; white-space: nowrap; max-width: 40rem; overflow: hidden; text-overflow: ellipsis; text-align: left; vertical-align: top; cursor: cell; user-select: none; -webkit-user-select: none; background: var(--surface); }
.markdown .table-sheet .sheet-letters th { position: sticky; top: 0; z-index: 3; height: 22px; padding: 0 8px; color: var(--text-muted); font-size: 11.5px; font-weight: 500; text-align: center; border-bottom: 1px solid var(--border); cursor: pointer; }
.markdown .table-sheet .sheet-head th { position: sticky; top: 23px; z-index: 2; background: var(--surface-muted); font-weight: 600; }
.markdown .table-sheet .sheet-gutter { position: sticky; left: 0; z-index: 1; min-width: 2.75rem; padding: 0 6px; color: var(--text-muted); font-size: 11.5px; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; border-right: 1px solid var(--border); cursor: pointer; }
.markdown .table-sheet .sheet-head .sheet-gutter { z-index: 3; }
.markdown .table-sheet .sheet-corner { left: 0; z-index: 4; border-right: 1px solid var(--border); }
.markdown .table-sheet .sheet-letters th.is-on, .markdown .table-sheet .sheet-gutter.is-on, .markdown .table-sheet .sheet-corner.is-on { background: var(--primary-soft); color: var(--text); font-weight: 650; }
.markdown .table-sheet .is-in-range { background: var(--primary-soft); }
.markdown .table-sheet .is-selected { box-shadow: inset 0 0 0 2px var(--primary); background: var(--primary-soft); }
/* While filtering, the count and Clear sit at the left of the bar above the table. */
.markdown .table-count { display: inline-flex; align-items: baseline; gap: 10px; margin-right: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.markdown .table-count[hidden] { display: none; }
.markdown .table-count button { font: inherit; font-size: 13px; font-weight: 600; color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; }
.markdown .table-count button:hover { text-decoration: underline; }

/* Diagrams */
.markdown pre.mermaid { background: var(--surface); border: 1px solid var(--border); text-align: center; }
.markdown pre.mermaid-failed { text-align: left; }
.admonition { --accent: var(--primary); margin: 20px 0; padding: 12px 16px; border-left: 4px solid var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.admonition > :last-child { margin-bottom: 0; }
.admonition-title { margin: 0 0 4px; font-weight: 700; color: var(--accent); }
.admonition-note, .admonition-info { --accent: var(--note); }
.admonition-warning, .admonition-caution { --accent: var(--warning); }
.admonition-danger { --accent: var(--danger); }

/* After the article */
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 40px 0 24px; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--radius); }
.feedback-question { margin: 0; font-weight: 600; }
.feedback-buttons { display: flex; gap: 8px; }
.feedback-buttons[hidden] { display: none; }
.feedback-thanks:empty { display: none; }
.feedback-thanks { margin: 0; color: var(--primary); font-weight: 500; }
.feedback-buttons button, .button { display: inline-block; font: inherit; font-weight: 500; padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.feedback-buttons button:hover, .button:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.feedback-missing { flex-basis: 100%; max-width: 36rem; display: grid; gap: 8px; }
.feedback-missing[hidden] { display: none; }
.feedback-missing-label { font-weight: 600; }
.feedback-missing textarea { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; resize: vertical; }
.feedback-missing-hint { margin: 0; font-size: 0.9em; }
.feedback-missing-actions { display: flex; gap: 8px; }
.feedback-missing-actions button { font: inherit; font-weight: 500; padding: 6px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.feedback-missing-actions button:hover { border-color: var(--primary); color: var(--primary); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0; }
.pager a { display: flex; flex-direction: column; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.pager-next { grid-column: 2; text-align: right; }
.pager-label { font-size: 0.8rem; color: var(--text-muted); }
.pager-title { font-weight: 600; color: var(--primary); }
.related { margin: 32px 0; }
.support { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 0; padding: 20px; border-radius: var(--radius); background: var(--surface-muted); }
.support p { margin: 0; font-weight: 600; }

/* Search results */
.results { list-style: none; margin: 8px 0 16px; padding: 0; }
.result { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.result:hover { text-decoration: none; }
.result:hover .result-title { text-decoration: underline; }
.result-crumb { font-size: 0.8rem; color: var(--text-muted); }
.result-title { font-size: 1.125rem; font-weight: 600; color: var(--primary); }
.result-snippet { font-size: 0.925rem; color: var(--text-muted); }
mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.empty-title { margin: 24px 0 4px; font-size: 1.25rem; font-weight: 600; }

.footer { margin-top: 48px; border-top: 1px solid var(--border); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 24px 20px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 0.9rem; }
.footer p { margin: 0; }

@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
  .toc-inline { display: block; }
}
@media (max-width: 800px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .topbar .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand-title, .search-key { display: none; }
  .doc-layout, .doc-layout.no-toc { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 12px; }
  .sidebar { position: static; max-height: none; margin-bottom: 8px; }
  .js .sidebar-toggle { display: inline-flex; align-items: center; gap: 8px; font: inherit; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; }
  .js .sidebar-list { display: none; margin-top: 8px; }
  .js .sidebar-list.open { display: block; }
  .hero { padding: 36px 16px 28px; }
  .hero h1, h1 { font-size: 1.6rem; }
  .search-hero .search-input, .search-page .search-input { padding-right: 16px; }
  .search-hero .search-button, .search-page .search-button { display: none; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Theme switch and logo: follow data-theme, else the system setting. */
.brand .logo-dark, .theme-to-light, .theme-toggle { display: none; }
.js .theme-toggle { display: inline-flex; }
.theme-toggle { align-items: center; justify-content: center; padding: 6px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-muted); cursor: pointer; }
.theme-toggle:hover { background: var(--hover); color: var(--text); }
.theme-to-dark, .theme-to-light { align-items: center; }
.theme-to-dark { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light, :root:not([data-theme="light"]) .theme-to-dark { display: none; }
  :root:not([data-theme="light"]) .brand .logo-dark { display: block; }
  :root:not([data-theme="light"]) .theme-to-light { display: inline-flex; }
}
:root[data-theme="dark"] .logo-light, :root[data-theme="dark"] .theme-to-dark { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
:root[data-theme="dark"] .theme-to-light { display: inline-flex; }
.brand .logo-dark { height: 24px; width: auto; }
.footer-legal a { color: var(--text-muted); margin-left: 12px; text-decoration: underline; }
.footer-legal a:hover { color: var(--text); }

/* Article visibility: lock badge, customer header, teaser. */
.badge { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.badge .icon { width: 12px; height: 12px; }
.viewer { display: inline-flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-muted); white-space: nowrap; }
.viewer-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.sign-out { color: var(--text-muted); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.pair-link { margin: 0 0 16px; }
.pair-link a { display: inline-flex; align-items: center; gap: 6px; }
.pair-link .icon { width: 16px; height: 16px; }
.teaser .lead, .teaser .badge { margin-bottom: 12px; }
.viewer[hidden] { display: none; }
.sign-in { font-size: 0.9rem; color: var(--text-muted); text-decoration: underline; white-space: nowrap; }
.signed-hint .sign-in { display: none; }
/* Sign in choice: continue with the TextileCloud account, or another account (site.js opens it from any [data-sign-in] link). */
.sign-in-choice { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.sign-in-choice::backdrop { background: rgba(0, 0, 0, 0.4); }
.sign-in-choice h2 { margin: 0 0 8px; font-size: 1.15rem; }
.sign-in-choice-actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.sign-in-choice-actions .button { text-align: center; }
.sign-in-choice .button-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sign-in-choice .button-primary:hover { color: var(--on-primary); opacity: 0.9; }
.sign-in-choice-note { font-size: 0.85rem; margin: 0 0 12px; }
.sign-in-choice-cancel { font-size: 0.9rem; }
.viewer .switch-account { color: var(--text-muted); text-decoration: underline; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.toc-inline a.active { color: var(--primary); font-weight: 600; }

/* Coloured words (:color[words]{value="#rrggbb"}): the author's colour in light mode, lightened toward the text colour in dark mode so it stays readable. */
.text-colour { color: var(--tc); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .text-colour { color: color-mix(in srgb, var(--tc) 50%, var(--text)); }
}
:root[data-theme="dark"] .text-colour { color: color-mix(in srgb, var(--tc) 50%, var(--text)); }

/* A YouTube embed (::youtube{id="..."}): 16:9 at any width; the frame fills the box. */
.markdown .video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 20px 0; border-radius: 8px; overflow: hidden; background: var(--surface-muted); }
.markdown .video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* A collapsible section (:::details[Question]): the question is the summary, the answer opens under it. */
.markdown details { margin: 16px 0; padding: 10px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.markdown details > summary { cursor: pointer; font-weight: 600; }
.markdown details[open] > summary { margin-bottom: 8px; }
.markdown details > :not(summary):last-child { margin-bottom: 0; }

/* Staff dashboard (/internal/dashboard): stat tiles, plain tables and CSS bars. No script, no chart library. */
.container.dash { max-width: 1120px; padding-top: 28px; padding-bottom: 56px; }
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 20px; }
.dash-head h1 { margin: 0 0 4px; }
.dash-lead { margin: 0; color: var(--text-muted); max-width: 60ch; }
.dash-switch { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.dash-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dash-tabs a { padding: 7px 14px; font-size: 0.875rem; color: var(--text); text-decoration: none; border-right: 1px solid var(--border); white-space: nowrap; }
.dash-tabs a:last-child { border-right: 0; }
.dash-tabs a:hover { background: var(--hover); }
.dash-tabs a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.dash-tabs a[aria-current="page"] { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.dash-period { color: var(--text-muted); font-size: 0.875rem; margin: 0 0 12px; }
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dash-kpi { padding: 18px 20px 16px; border-left: 1px solid var(--border); min-width: 0; }
.dash-kpi:first-child { border-left: 0; }
.dash-kpi dt { font-size: 0.875rem; color: var(--text-muted); }
.dash-kpi dd { margin: 0; }
.dash-kpi-value { font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; margin-top: 4px !important; font-variant-numeric: tabular-nums; }
.dash-kpi-value.is-empty { color: var(--text-muted); font-weight: 400; }
.dash-kpi-sub { font-size: 0.8125rem; color: var(--text-muted); }
.dash-delta { font-size: 0.8125rem; margin-top: 10px !important; font-weight: 600; color: var(--text-muted); }
.dash-delta.is-good { color: var(--primary); }
.dash-delta.is-bad { color: var(--danger); }
.dash-delta.is-flat { color: var(--text-muted); font-weight: 400; }
.dash-panel > .dash-quiet { margin: 0 0 12px; }
.dash-delta .dash-quiet { font-weight: 400; }
.dash-section { margin: 48px 0 0; }
.dash-section > h2 { font-size: 1.375rem; margin: 0 0 4px; }
.dash h3 { font-size: 0.9375rem; font-weight: 600; margin: 24px 0 10px; }
.dash-panel > h3:first-child { margin-top: 0; }
.dash-note { color: var(--text-muted); font-size: 0.875rem; margin: 4px 0 16px; max-width: 75ch; }
.dash-section + .dash-note { margin-top: 16px; }
.dash-how { color: var(--text-muted); font-size: 0.875rem; margin: 8px 0 0; max-width: 75ch; }
.dash-overview { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.dash-overview-status { margin: 0; padding: 14px 20px; color: var(--text-muted); background: var(--surface-muted); border-bottom: 1px solid var(--border); }
.dash-overview .dash-kpis { border: 0; border-radius: 0; background: transparent; }
.dash-quiet { color: var(--text-muted); }
.dash-status { font-weight: 600; }
.dash-status.is-bad { color: var(--danger); }
.dash-status.is-warn { color: var(--text); }
.dash-status.is-ok { color: var(--primary); font-weight: 500; }
.dash-inapp-summary { margin: 0 0 12px; font-weight: 600; }
.dash-inapp-summary.is-bad { color: var(--danger); }
.dash-more { margin-top: 12px; }
.dash-more > summary { cursor: pointer; color: var(--text-muted); font-size: 0.875rem; padding: 6px 0; }
.dash-more > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dash-more[open] > summary { margin-bottom: 8px; }
.dash-back { margin: 0 0 8px; font-size: 0.875rem; }
.dash-back a::before { content: "‹ "; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dash-action { display: inline-block; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.875rem; font-weight: 600; white-space: nowrap; }
.dash-action:hover { background: var(--hover); }
.dash-action:focus-visible, .dash-fix:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dash-fix-col { width: 1%; white-space: nowrap; text-align: right; }
.dash-fix { font-weight: 600; font-size: 0.8125rem; }
.dash-nowrap { white-space: nowrap; }
.dash-alone { border: 1px solid var(--border); border-radius: var(--radius); }
.dash-notes-one { grid-template-columns: minmax(0, 1fr); }
.dash-fix-find { margin: 20px 0 8px; }
.dash-fix-find label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 6px; }
.dash-fix-find > div { display: flex; gap: 8px; }
.dash-fix-find input[type="search"] { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.dash-fix-list { list-style: none; margin: 0; padding: 0; }
.dash-fix-list li { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.dash-fix-list li > div { min-width: 0; }
.dash h2 { margin-top: 32px; }
p.dash-quiet { margin: 0; font-size: 0.875rem; }
.dash-attn { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; min-width: 0; overflow: hidden; }
.dash-panel .dash-table-wrap { border: 0; border-radius: 0; margin: 0 -18px -16px; }
.dash-panel .dash-table th { background: transparent; color: var(--text-muted); font-weight: 500; font-size: 0.8125rem; }
.dash-panel .dash-table th, .dash-panel .dash-table td { padding-left: 18px; padding-right: 18px; }
.dash-panel-wide { grid-column: 1 / -1; }
.dash-strong { font-weight: 700; }
.dash-list, .dash-notes { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.dash-list li:first-child { border-top: 0; padding-top: 0; }
.dash-list-figure { margin-left: auto; font-size: 0.8125rem; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.dash-notes li { padding: 12px 0; border-top: 1px solid var(--border); min-width: 0; }
.dash-notes-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.dash-notes blockquote { margin: 8px 0 0; padding: 0 0 0 12px; border-left: 1px solid var(--border); font-size: 0.875rem; }
.dash-title { font-weight: 500; }
.dash-meta { display: block; font-size: 0.8125rem; color: var(--text-muted); font-weight: 400; }
td.num .dash-meta { white-space: nowrap; }
.dash-id { white-space: nowrap; }
.dash-lang { display: inline-block; font-size: 0.6875rem; font-weight: 600; line-height: 1; padding: 2px 5px; border-radius: 4px; background: var(--surface-muted); color: var(--text-muted); vertical-align: 1px; }
.dash-split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 28px; align-items: start; }
.dash-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.dash-table th, .dash-table td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.dash-table tbody tr:last-child > * { border-bottom: 0; }
.dash-table thead th { background: var(--surface-muted); font-weight: 600; white-space: nowrap; font-size: 0.8125rem; }
.dash-table tbody th { font-weight: 500; }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-rank { width: 1%; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dash-share-col { width: 28%; vertical-align: middle !important; }
.dash-share { display: block; height: 6px; border-radius: 3px; background: var(--surface-muted); overflow: hidden; }
.dash-share > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.dash-empty { border: 1px dashed var(--border); border-radius: var(--radius); padding: 14px 20px; color: var(--text-muted); background: var(--surface-muted); margin: 0 0 16px; }
.dash-chart { position: relative; overflow: hidden; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 14px 10px; }
.dash-chart svg { display: block; width: 100%; height: auto; }
.dash-chart-grid { stroke: var(--border); stroke-width: 1; }
.dash-chart-text { fill: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.dash-chart-weekend { fill: var(--surface-muted); }
.dash-chart-views { fill: var(--primary); opacity: 0.32; }
.dash-chart-solid, .dash-chart-unique { fill: var(--primary); }
.dash-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-muted); font-size: 0.8125rem; margin-top: 6px; }
.dash-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--primary); margin-right: 6px; vertical-align: -1px; }
.dash-key-views { opacity: 0.32; }
.dash-key-weekend { background: var(--surface-muted); border: 1px solid var(--border); }
.dash-details { margin-top: 16px; }
.dash-details summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
@media (max-width: 860px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-kpi:nth-child(3) { border-left: 0; } .dash-kpi:nth-child(n + 3) { border-top: 1px solid var(--border); } .dash-split, .dash-attn, .dash-notes { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) { .dash-switch, .dash-tabs { width: 100%; } .dash-tabs a { flex: 1; text-align: center; padding: 8px 6px; white-space: normal; } .dash-kpi { padding: 14px; } .dash-empty { padding: 12px 14px; } .dash-kpi-value { font-size: 1.5rem; } .dash-hide-sm { display: none; } .dash-share-col { width: 22%; } .dash-chart { padding: 8px 6px 8px; } .dash-chart-text { font-size: 20px; } .dash-chart-minor { display: none; } .dash-table th, .dash-table td { padding: 8px 10px; } }

/* Staff article list (/internal/articles): one collapsible table per category, like the old BetterDocs Docs list. */
.arts-filters[hidden] { display: none; }
.arts-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 0 20px; }
.arts-field { display: flex; min-width: 0; }
.arts-field-grow { flex: 1 1 240px; }
.arts-field input, .arts-field select { width: 100%; min-width: 0; font: inherit; font-size: 0.875rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 7px 12px; }
.arts-field input:focus-visible, .arts-field select:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.arts-shown { margin: 0; color: var(--text-muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.arts-group { margin: 0 0 16px; }
.arts-group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.arts-group > summary::-webkit-details-marker { display: none; }
.arts-group > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); transition: transform 0.15s; margin: 0 4px 0 2px; }
.arts-group[open] > summary::before { transform: rotate(45deg); }
.arts-group > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.arts-group h2 { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 1.0625rem; }
.arts-count { font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-strong); font-variant-numeric: tabular-nums; }
.arts-group[open] > summary { margin-bottom: 8px; }
.arts-table { table-layout: fixed; min-width: 860px; }
/* Fixed column widths, so the tables of every category line up under each other. */
.arts-table th:nth-child(1) { width: auto; }
.arts-table th:nth-child(2) { width: 9.5rem; }
.arts-table th:nth-child(3) { width: 6rem; }
.arts-table th:nth-child(4), .arts-table th:nth-child(5), .arts-table th:nth-child(6) { width: 5.5rem; }
.arts-table th:nth-child(7) { width: 8.5rem; }
.arts-table th:nth-child(8) { width: 9.5rem; }
.arts-table tbody th { overflow-wrap: anywhere; }
.arts-title { display: block; font-weight: 600; }
.arts-other { display: block; color: var(--text-muted); font-weight: 400; font-size: 0.8125rem; }
.arts-table .dash-id { display: block; color: var(--text-muted); font-weight: 400; font-size: 0.75rem; font-family: var(--mono); margin-top: 2px; }
.arts-vis, .arts-status { display: inline-block; font-size: 0.75rem; font-weight: 600; line-height: 1; padding: 3px 8px; border-radius: 999px; white-space: nowrap; margin: 0 2px 4px 0; }
.arts-vis-public { background: var(--primary-soft); color: var(--primary-strong); }
.arts-vis-customers { background: color-mix(in srgb, var(--note) 14%, var(--surface)); color: var(--note); }
.arts-vis-internal { background: color-mix(in srgb, var(--warning) 14%, var(--surface)); color: var(--warning); }
.arts-status { border: 1px solid var(--border); color: var(--text-muted); }
.arts-status-live { display: none; }
.arts-status-draft { border-style: dashed; }
.arts-langs { white-space: nowrap; }
.arts-langs .dash-lang { margin-right: 4px; }
.arts-zh-missing { background: transparent; border: 1px dashed var(--border); opacity: 0.7; }
.arts-zh-out_of_date { background: color-mix(in srgb, var(--warning) 18%, var(--surface)); color: var(--warning); }
.arts-zh-in_sync { background: var(--primary-soft); color: var(--primary-strong); }
.arts-edited { white-space: nowrap; }
.arts-actions { white-space: nowrap; }
.arts-actions a { margin-right: 12px; font-size: 0.8125rem; font-weight: 600; }
.arts-actions a:last-child { margin-right: 0; }
.arts-table tbody tr[hidden] { display: none; }
@media (max-width: 600px) { .arts-field { flex: 1 1 100%; } }

/* The FAQs category page: each question is a collapsible answer (the article body) with a link to the full article. */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 24px; padding: 0; list-style: none; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq-item > summary { cursor: pointer; list-style: none; display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; font-weight: 600; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: '+'; margin-left: auto; color: var(--text-muted); font-weight: 400; font-size: 1.25rem; line-height: 1; }
.faq-item[open] > summary::after { content: '\2212'; }
.faq-item > summary:hover { background: var(--hover); border-radius: var(--radius); }
.faq-item > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius); }
.faq-answer { padding: 0 18px 16px; }
.faq-answer > .markdown > :first-child { margin-top: 0; }
.faq-more { display: inline-block; margin-top: 4px; font-size: 0.875rem; font-weight: 600; }
.faq-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.faq-locked .faq-q { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .arts-group > summary::before { transition: none; } }
