/* Agentic systems: feature matrix and patterns. Uses the tokens in atlas.css. Plain CSS, no build step. */

:root { --mark: var(--layer-1); }

/* The site follows the operating system's light or dark setting. ?theme=dark or ?theme=light on this
   page forces one (used for checking screenshots); the values repeat the dark block of atlas.css. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #1a1a19; --surface-2: #242423; --text: #ffffff; --text-2: #c3c2b7;
  --grid: #30302e; --border: #42423f; --edge: #ffffff;
  --layer-1: #3987e5; --layer-2: #d95926; --layer-3: #199e70; --layer-4: #c98500;
}
:root[data-theme="light"] {
  color-scheme: light;
  --surface: #fcfcfb; --surface-2: #f3f3f0; --text: #0b0b0b; --text-2: #52514e;
  --grid: #e8e7e2; --border: #d6d5ce; --edge: #0b0b0b;
  --layer-1: #2a78d6; --layer-2: #eb6834; --layer-3: #1baf7a; --layer-4: #eda100;
}

.intro p + p { margin-top: 8px; }
.back { margin: 0 0 6px; font-size: 13px; color: var(--text-2); }
h2.section { font-size: 21px; margin: 34px 0 4px; letter-spacing: -0.01em; }
.section-sub { margin: 0 0 14px; color: var(--text-2); max-width: 86ch; }
.note-box { border-left: 3px solid var(--border); padding: 2px 0 2px 12px; margin: 12px 0 0; color: var(--text-2); font-size: 13.5px; max-width: 90ch; }

/* ---------- Marks: shape carries the value, colour only reinforces it ---------- */

.mk { display: inline-block; width: 13px; height: 13px; border-radius: 50%; vertical-align: -2px; flex: none; box-sizing: border-box; }
.mk-yes { background: var(--mark); border: 1.5px solid var(--mark); }
.mk-partial { border: 1.5px solid var(--mark); background: linear-gradient(to right, var(--mark) 50%, transparent 50%); }
/* no: a cross, the firm negative. not found: an empty dotted ring, a search that came back empty. */
.mk-no { border: 0; border-radius: 0; position: relative; }
.mk-no::before, .mk-no::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 2px; margin: -1px 0 0 -7.5px; background: var(--text); border-radius: 1px; }
.mk-no::before { transform: rotate(45deg); }
.mk-no::after { transform: rotate(-45deg); }
.mk-not_found { border: 1.5px dotted var(--text-2); background: transparent; }
.mk-unknown { border: 0; border-radius: 0; width: 13px; height: 13px; position: relative; }
.mk-unknown::before { content: "?"; position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 13px; font-weight: 600; color: var(--text-2); opacity: 0.75; }
@media (forced-colors: active) {
  .mk-yes { background: CanvasText; border-color: CanvasText; }
  .mk-partial { border-color: CanvasText; background: linear-gradient(to right, CanvasText 50%, Canvas 50%); forced-color-adjust: none; }
  .mk-no::before, .mk-no::after { background: CanvasText; }
  .mk-not_found { border-color: CanvasText; }
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0 0 10px; padding: 0; font-size: 13px; }
.legend li { display: inline-flex; align-items: center; gap: 7px; }
.legend .what { color: var(--text-2); }

/* ---------- Matrix ---------- */

.matrix-scroll { overflow: auto; max-height: min(78vh, 900px); border: 1px solid var(--grid); border-radius: 6px; overscroll-behavior-x: contain; }
table.matrix { border-collapse: separate; border-spacing: 0; width: max-content; font-size: 13px; }
table.matrix th, table.matrix td { padding: 0; border-bottom: 1px solid var(--grid); vertical-align: middle; text-align: center; }
table.matrix thead th { position: sticky; background: var(--surface-2); z-index: 2; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--border); }
table.matrix thead tr.groups th { top: 0; height: 30px; padding: 0 8px; font-size: 12px; text-align: left; border-left: 1px solid var(--border); }
table.matrix thead tr.feats th { top: 30px; height: 118px; vertical-align: bottom; font-weight: 400; }
table.matrix thead th.corner { left: 0; z-index: 4; text-align: left; padding: 0 10px; border-left: 0; vertical-align: bottom; }
table.matrix thead tr.feats th.corner { padding-bottom: 8px; font-weight: 600; }
table.matrix thead tr.feats th.count-h { padding: 0 6px 8px; font-size: 12px; color: var(--text-2); }
.feat-btn {
  font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; padding: 6px 0 8px;
  width: 30px; height: 118px; display: flex; align-items: flex-end; justify-content: center;
}
.feat-btn span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12px; line-height: 1; }
.feat-btn:hover span { text-decoration: underline; }
th.g-start, td.g-start { border-left: 1px solid var(--border); }
table.matrix th.col-on, table.matrix td.col-on { background: var(--surface-2); }
table.matrix thead th.col-on .feat-btn span { font-weight: 700; }

table.matrix tbody th {
  position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; font-weight: 400;
  padding: 0; min-width: 190px; max-width: 230px; border-right: 1px solid var(--border);
}
.sys-btn { font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; padding: 6px 10px; width: 100%; display: block; }
.sys-btn .nm { font-weight: 600; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; display: block; overflow-wrap: anywhere; }
.sys-btn:hover .nm { text-decoration-color: var(--text); }
.sys-btn .sub { color: var(--text-2); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.matrix tbody tr:hover th, table.matrix tbody tr:hover td { background: var(--surface-2); }
table.matrix td.cell { width: 30px; height: 40px; cursor: default; }
table.matrix td.cell:focus-visible { outline-offset: -2px; }
table.matrix td.num { padding: 0 8px; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12px; white-space: nowrap; }
table.matrix td.empty { padding: 18px 12px; text-align: left; color: var(--text-2); }

@media (max-width: 600px) {
  table.matrix .count-h, table.matrix td.num { display: none; }   /* the count is in the detail sheet; the columns need the room */
  table.matrix thead tr.groups th.corner { }
  table.matrix tbody th { min-width: 132px; max-width: 132px; }
  .sys-btn { padding: 6px 8px; }
  .sys-btn .sub { font-size: 11px; }
}

/* ---------- Detail panel (a dialog shown as a side sheet) ---------- */

dialog.sheet {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(560px, 100vw); max-width: 100vw;
  border: 0; border-left: 1px solid var(--border); padding: 0; background: var(--surface); color: var(--text);
}
dialog.sheet::backdrop { background: rgb(0 0 0 / 0.35); }
.sheet-inner { padding: 18px 20px 40px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: 0; background: var(--surface); padding: 14px 0 8px; margin-top: -14px; z-index: 1; }
.sheet h2 { font-size: 22px; line-height: 1.2; margin: 0; overflow-wrap: anywhere; }
.sheet .maker { color: var(--text-2); margin: 2px 0 0; }
.sheet h3 { font-size: 13px; margin: 20px 0 6px; text-transform: none; }
.sheet p { margin: 0 0 6px; overflow-wrap: anywhere; }
.sheet .src { font-size: 12.5px; color: var(--text-2); }
.sheet .facts { margin-top: 12px; }
.feat-list { list-style: none; margin: 0; padding: 0; }
.feat-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 8px; padding: 7px 0; border-top: 1px solid var(--grid); }
.feat-list li:first-child { border-top: 0; }
.feat-list .fl { font-weight: 600; }
.feat-list .fv { color: var(--text-2); font-weight: 400; }
.feat-list .fn, .feat-list .fs { grid-column: 2; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; }
.feat-list .mk { margin-top: 4px; }

/* ---------- Patterns ---------- */

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 12px; }
.pat { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); min-width: 0; }
.pat h4 { font-size: 14.5px; margin: 0 0 6px; line-height: 1.3; }
.pat p { margin: 0 0 6px; font-size: 13.5px; }
.pat .weak { font-size: 12.5px; color: var(--text-2); border-left: 3px solid var(--border); padding-left: 8px; margin-top: 8px; }
.pat details { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.pat summary { cursor: pointer; }
table.two { width: auto; font-size: 12.5px; margin: 6px 0; border-collapse: collapse; }
table.two th, table.two td { padding: 3px 9px; border: 1px solid var(--grid); text-align: right; font-variant-numeric: tabular-nums; position: static; background: none; font-weight: 400; white-space: normal; }
table.two th { color: var(--text-2); text-align: left; }
table.two thead th { text-align: right; padding: 3px 9px; border: 1px solid var(--grid); }
.tag { display: inline-block; font-size: 11px; border: 1px solid var(--border); border-radius: 10px; padding: 0 7px; color: var(--text-2); vertical-align: 1px; margin-left: 4px; font-weight: 400; }

.prev { display: grid; grid-template-columns: minmax(120px, 230px) minmax(60px, 1fr) max-content; gap: 5px 12px; align-items: center; font-size: 13px; max-width: 760px; }
.prev .gh { grid-column: 1 / -1; font-weight: 600; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.prev .bar { height: 10px; background: var(--grid); border-radius: 0 4px 4px 0; position: relative; overflow: hidden; }
.prev .bar { display: flex; }
.prev .bar i { display: block; height: 100%; background: var(--mark); }
.prev .bar i.b-partial { opacity: 0.45; margin-left: 2px; border-radius: 0 4px 4px 0; }
.prev .n { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }

.log { list-style: none; margin: 0; padding: 0; max-width: 90ch; }
.log li { padding: 8px 0; border-top: 1px solid var(--grid); }
.log time { font-variant-numeric: tabular-nums; color: var(--text-2); margin-right: 8px; }

/* atlas.css adds a sort arrow after every button in a table head; these buttons filter, they do not sort. */
table.matrix thead th button::after { content: none; }

h2.section.sub { font-size: 17px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 4px 0 6px; }
.qa { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); }
.qa h3 { font-size: 15px; margin: 0 0 6px; }
.qa p { margin: 0; font-size: 14px; }
details.note-box summary { cursor: pointer; color: var(--text); }
details.note-box ul { margin: 6px 0 2px; padding-left: 18px; }
details.note-box li { margin-bottom: 4px; }
.pat .ev { font-size: 12.5px; color: var(--text-2); }
.legend li { align-items: baseline; }
.legend .mk { align-self: center; }

/* ---------- names with history, and how a fact was sourced ---------- */
.sys { display: flex; align-items: flex-start; }
.sys .sys-btn { flex: 1 1 auto; min-width: 0; }
.sys .info { margin: 7px 8px 0 0; }
.info {
  flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0;
  border: 1.5px solid var(--text-2); border-radius: 50%; background: var(--surface); color: var(--text); cursor: pointer;
  font: italic 700 12px/1 Georgia, "Times New Roman", serif; vertical-align: 3px; position: relative;
}
.info::after { content: ""; position: absolute; inset: -9px; }   /* a finger-sized target around a small symbol */
.info:hover, .info[aria-expanded="true"] { background: var(--text); color: var(--surface); border-color: var(--text); }
.info-static { cursor: default; }
.info-static::after { content: none; }
.pop {
  position: fixed; z-index: 30; max-width: min(360px, calc(100vw - 16px)); background: var(--surface); color: var(--text);
  border: 1px solid var(--text-2); border-radius: 6px; padding: 10px 12px; box-shadow: 0 6px 20px rgb(0 0 0 / 0.25); font-size: 13px; line-height: 1.45;
}
.pop .pop-title { font-weight: 650; margin-bottom: 4px; }
.pop p { margin: 0 0 4px; }
.vtag { display: inline-block; font-size: 11px; line-height: 1.5; border: 1px dashed var(--text-2); border-radius: 3px; padding: 0 5px; color: var(--text); font-weight: 400; white-space: nowrap; }
.vtag-unverified { border-style: solid; border-width: 1.5px; font-weight: 600; }
.sys-btn .vtag { margin: 3px 4px 0 0; }
.vbadge { position: absolute; right: 2px; top: calc(50% - 16px); font-size: 10px; line-height: 1; font-weight: 700; color: var(--text); }
.vbadge.vb-inline { position: static; display: inline-block; border: 1px solid var(--text-2); border-radius: 3px; padding: 1px 4px; }
table.matrix td.cell { position: relative; }
.vnote { border: 1.5px solid var(--text-2); border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 10px 0 0; }
ol.tl { list-style: none; margin: 0; padding: 0; }
ol.tl li { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 0 10px; padding: 7px 0; border-top: 1px solid var(--grid); }
ol.tl li:first-child { border-top: 0; }
ol.tl time { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; grid-row: span 3; }
ol.tl .tl-kind { font-size: 11.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; }
ol.tl .tl-text { font-size: 14px; }
ol.tl .fs { font-size: 12.5px; color: var(--text-2); }
.sheet h2 .info { vertical-align: 5px; margin-left: 6px; }
