/* BEGIN infra CRM foundation */
/* sha256: b940195293b417344aaed048208a2f70f7f33fa5b7ed8f1c1403746e1706d815 */
/* CRM foundation 2026.09.07.1 — observed product patterns, project-owned values.
   Source: infra/design/crm/README.md. Never use a structural line for every data row. */
:root, [data-theme="attio"], [data-ui-skin="attio"] {
  --crm-version: "2026.09.07.1";
  --crm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --crm-canvas:#f7f8fa; --crm-surface:#ffffff; --crm-soft:#f5f6f8; --crm-hover:#f3f5f9;
  --crm-heading:#202124; --crm-body:#41454d; --crm-secondary:#636a75; --crm-meta:#717782;
  --crm-frame:#dfe2e7; --crm-control:#cbd0d8; --crm-separator:#eceef1; --crm-map-line:#d4d9e0;
  --crm-primary:#315ee7; --crm-on-primary:#ffffff; --crm-focus:#315ee7;
  --crm-selected:#edf2ff; --crm-selected-ink:#3157c9; --crm-link:#3b5eb0;
  --crm-panel-radius:8px; --crm-input-radius:6px; --crm-action-radius:6px; --crm-tag-radius:4px;
  --crm-heading-size:24px; --crm-heading-weight:600; --crm-title-size:15px; --crm-title-weight:550;
  --crm-title-leading:1.5; --crm-tracking:-.025em; --crm-row-space:14px; --crm-section-space:20px;
  --crm-panel-gap:16px; --crm-panel-padding:20px; --crm-shadow:0 2px 8px #20263206;
  --crm-info-bg:#edf2ff; --crm-info-ink:#3555a2; --crm-success-bg:#eaf5ef; --crm-success-ink:#286443;
  --crm-warning-bg:#fff6e6; --crm-warning-ink:#875b1e;
  color-scheme:light;
}
[data-theme="folk"], [data-ui-skin="folk"] {
  --crm-canvas:#faf9f6; --crm-surface:#fffefa; --crm-soft:#f1f0ec; --crm-hover:#f5f4ef;
  --crm-heading:#242421; --crm-body:#454540; --crm-secondary:#696963; --crm-meta:#75756f;
  --crm-frame:#686862; --crm-control:#777770; --crm-separator:#e3e2dc; --crm-map-line:#cecfc7;
  --crm-primary:#242421; --crm-on-primary:#fffefa; --crm-focus:#57574e;
  --crm-selected:#eeede7; --crm-selected-ink:#242421; --crm-link:#383833;
  --crm-panel-radius:0px; --crm-input-radius:2px; --crm-action-radius:999px; --crm-tag-radius:999px;
  --crm-heading-size:28px; --crm-heading-weight:600; --crm-title-size:16px; --crm-title-weight:550;
  --crm-title-leading:1.55; --crm-tracking:-.035em; --crm-row-space:17px; --crm-section-space:24px;
  --crm-panel-gap:18px; --crm-panel-padding:22px; --crm-shadow:none;
  --crm-info-bg:#eaf0fa; --crm-info-ink:#405879; --crm-success-bg:#edf2df; --crm-success-ink:#4d6133;
  --crm-warning-bg:#faf0d9; --crm-warning-ink:#78602f;
}
:root[data-appearance="dark"], :root[data-ui-theme="dark"] {
  --crm-canvas:#15181e; --crm-surface:#1d222b; --crm-soft:#262d38; --crm-hover:#2a3240;
  --crm-heading:#eff1f6; --crm-body:#cfd5df; --crm-secondary:#b4bdcb; --crm-meta:#a5aebd;
  --crm-frame:#424b5b; --crm-control:#667389; --crm-separator:#303846; --crm-map-line:#46505f;
  --crm-primary:#91afff; --crm-on-primary:#15213e; --crm-focus:#b1c7ff;
  --crm-selected:#2b3b5c; --crm-selected-ink:#c3d3ff; --crm-link:#b0c6ff; --crm-shadow:none;
  --crm-info-bg:#29394f; --crm-info-ink:#c0d5f7; --crm-success-bg:#293b30; --crm-success-ink:#b8d9ae;
  --crm-warning-bg:#413724; --crm-warning-ink:#ebd298;
  color-scheme:dark;
}
:root[data-appearance="dark"][data-theme="folk"], :root[data-ui-theme="dark"][data-ui-skin="folk"] {
  --crm-canvas:#1b1c19; --crm-surface:#23241f; --crm-soft:#2c2d27; --crm-hover:#30312a;
  --crm-heading:#f0f0e8; --crm-body:#d6d7ce; --crm-secondary:#bbbdb0; --crm-meta:#adafa1;
  --crm-frame:#929388; --crm-control:#a0a194; --crm-separator:#3d3f35; --crm-map-line:#55584a;
  --crm-primary:#eeeee4; --crm-on-primary:#24251e; --crm-focus:#dbdec9;
  --crm-selected:#36382e; --crm-selected-ink:#eceee0; --crm-link:#e1e2d5;
}
/* END infra CRM foundation */
@font-face { font-family:"Inter"; src:url("./InterVariable.woff2") format("woff2"); font-weight:100 900; font-style:normal; font-display:swap; }
:root, [data-theme] {
  --reader-paper:var(--crm-surface);
  --reader-panel:var(--crm-soft);
  --reader-ink:var(--crm-heading);
  --reader-muted:var(--crm-meta);
  --reader-line:var(--crm-separator);
  --reader-border:var(--crm-control);
  --reader-frame:var(--crm-frame);
  --reader-active:var(--crm-selected);
  --reader-accent:var(--crm-link);
  --reader-hover:var(--crm-hover);
  --reader-radius:var(--crm-panel-radius);
  --reader-heading:var(--crm-heading);
  --reader-body:var(--crm-body);
  --reader-secondary:var(--crm-secondary);
  --reader-primary:var(--crm-primary);
  --reader-on-primary:var(--crm-on-primary);
  --reader-focus:var(--crm-focus);
  --reader-heading-weight:var(--crm-heading-weight);
  --reader-title-weight:var(--crm-title-weight);
  --reader-title-size:var(--crm-title-size);
  --reader-title-leading:var(--crm-title-leading);
  --reader-row-space:var(--crm-row-space);
  --reader-heading-size:var(--crm-heading-size);
  --reader-tracking:var(--crm-tracking);
  --reader-button-radius:var(--crm-action-radius);
  --reader-input-radius:var(--crm-input-radius);
  --reader-section-space:var(--crm-section-space);
  --reader-nav-bg:var(--crm-selected);
  --reader-nav-ink:var(--crm-selected-ink);
  --reader-info-bg:var(--crm-info-bg);
  --reader-info-ink:var(--crm-info-ink);
  --reader-success-bg:var(--crm-success-bg);
  --reader-success-ink:var(--crm-success-ink);
  --reader-warning-bg:var(--crm-warning-bg);
  --reader-warning-ink:var(--crm-warning-ink);
  --ui-font:var(--crm-font); --sd-sans:var(--ui-font);
}
body { font-family: var(--ui-font); color: var(--reader-ink); background: var(--reader-paper); -webkit-font-smoothing: antialiased; }
button,input,select,textarea { font-family: inherit; }
inews-appearance { display:flex; align-items:center; gap:12px; }
inews-appearance .nb-skin-choices { display:flex; border:1px solid var(--reader-border); border-radius:999px; overflow:hidden; }
:root inews-appearance button { border:0; border-radius:0; background:transparent; color:var(--reader-ink); padding:6px 14px; min-width:56px; font:500 13px/1.5 var(--ui-font); cursor:pointer; }
inews-appearance button[aria-pressed="true"] { background:var(--reader-primary); color:var(--reader-on-primary); }
inews-appearance label { display:flex; gap:7px; align-items:center; color:var(--reader-muted); font:400 12px/1.5 var(--ui-font); }
:root inews-appearance select { border:1px solid var(--reader-border); border-radius:999px; background:var(--reader-paper); color:var(--reader-ink); padding:6px 10px; height:auto; font:400 13px/1.5 var(--ui-font); }
@media(max-width:800px) { inews-appearance { gap:8px; } :root inews-appearance button { padding:5px 11px; min-width:50px; } }

:root { --reader-positive:#278269; --reader-danger:#a44f48; }
:root[data-appearance="dark"] { --reader-positive:#8fd6af; --reader-danger:#efaaa2; }

/* Semantic roles are shared by the timeline, library and generated reading pages. */
body { color:var(--reader-body); }
:where(h1,h2,h3) { color:var(--reader-heading); font-weight:var(--reader-heading-weight); letter-spacing:var(--reader-tracking); }
:where(button,input,select,textarea):focus-visible { outline:2px solid var(--reader-focus); outline-offset:2px; }
::selection { background:var(--reader-active); color:var(--reader-heading); }
button:disabled { opacity:.45; cursor:default; }

/* Optional, self-hosted Zhuque Fangsong v0.212 (SIL OFL 1.1).
   No preload: browsers request this face only when the user selects it. */
@font-face { font-family:'Inews Fangsong'; src:url('./ZhuqueFangsong-v0.212.woff2') format('woff2'); font-weight:400; font-style:normal; font-display:swap; }
:root { --ui-font:"PingFang SC","Microsoft YaHei","Noto Sans CJK SC",-apple-system,BlinkMacSystemFont,sans-serif; }
:root[data-font="fangsong"] { --ui-font:'Inews Fangsong',"FangSong","STFangsong",serif; --reader-title-weight:400; }
:root[data-text-size="14"] { --reader-title-size:14px; }
:root[data-text-size="16"] { --reader-title-size:16px; }
:root[data-text-size="18"] { --reader-title-size:18px; }
:root[data-text-size="20"] { --reader-title-size:20px; }
:root[data-text-size="22"] { --reader-title-size:22px; }
inews-appearance { flex-wrap:wrap; }
inews-appearance label { white-space:nowrap; }

/* Reader controls follow the quiet text navigation rather than pill-shaped boxes. */
:root body inews-appearance .nb-skin-choices { border:0; border-radius:0; overflow:visible; }
:root body inews-appearance .nb-skin-choices button { border:0; border-bottom:1px solid transparent; border-radius:0; background:transparent; color:var(--reader-secondary); min-width:0; padding:6px 10px; }
:root body inews-appearance .nb-skin-choices button[aria-pressed="true"] { color:var(--reader-heading); background:transparent; border-bottom-color:currentColor; }
:root body inews-appearance select { border:0; border-radius:0; box-shadow:none; background:transparent; padding:6px 4px; }
:root .raw-library, :root .raw-library .article-title { font-family:var(--ui-font); }
:root .raw-library .article-title { font-size:var(--reader-title-size); }
/* Historical reading pages pick up this shared stylesheet without rewriting article content. */
body:has(> .frame--read) > .console { display:none; }
body > .frame--read { padding-top:24px; }
