/* Atelier · Sources, evidence and the topic matrix. */

/* ── Sources: real material in the UI sans; a team note is dashed; links are marks in the text ── */
.nav-primary__link[href$="/sources"] { --nav-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 12'%3E%3Cpath d='M5.5 1h6l3 3v7h-9z' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'/%3E%3Cpath d='M8 6.5h4M8 9h3' stroke='black' stroke-width='1.3'/%3E%3C/svg%3E"); }
.source-kind { display: inline-block; padding: 1px 8px; border-radius: 999px; font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 500; letter-spacing: .05em; text-transform: uppercase; vertical-align: middle; }
.source-kind--customer { background: var(--on-surface); color: var(--surface-raised); }
.source-kind--team { box-shadow: inset 0 0 0 1px var(--on-surface-faint); border: 1px dashed transparent; color: var(--on-surface-muted); }
.source-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; padding: 0; list-style: none; }
.source-card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 20px 22px; border-radius: 16px; background: var(--surface-raised); box-shadow: 0 0 0 1px var(--line); color: inherit; text-decoration: none; transition: box-shadow .2s var(--ease-standard); }
.source-card:hover { box-shadow: 0 0 0 1.5px var(--on-surface); }
.source-card:focus-visible { outline: 2px solid var(--on-surface); outline-offset: 3px; }
.source-card__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--on-surface-faint); }
.source-card__title { font-size: var(--text-md); font-weight: 600; line-height: 1.3; }
.source-card__excerpt { color: var(--on-surface-muted); font-size: var(--text-sm); }
.source-card__foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--on-surface-muted); }
.source-card__faces { display: flex; }
.source-card__faces .avatar { width: 26px; height: 26px; margin-left: -6px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--surface-raised); font-size: var(--text-xs); }
.source-card__faces .avatar:first-child { margin-left: 0; }
.source-card__faces .avatar img { width: 100%; height: 100%; object-fit: cover; }

.source-head .page-head__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.source-head__warning { padding-left: 12px; border-left: 2px dashed var(--line); }
.source-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(18rem, 1fr); gap: 32px 48px; align-items: start; margin-top: 24px; }
.source-text { max-width: 68ch; font-size: var(--text-md); line-height: 1.65; }
.source-text p { margin: 0 0 1.1em; }
.source-text ::selection { background: color-mix(in oklch, var(--attention) 45%, transparent); }
.source-mark { padding: 1px 0; border-radius: 2px; background: color-mix(in oklch, var(--on-surface) 9%, transparent); box-shadow: inset 0 -2px 0 var(--on-surface); color: inherit; scroll-margin-top: 96px; }
.source-mark--contradicts { background: color-mix(in oklch, var(--attention) 22%, transparent); box-shadow: inset 0 -2px 0 var(--attention); }
.source-mark:target { outline: 2px solid var(--on-surface); outline-offset: 2px; }
.source-panel { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.source-link { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 18px; background: var(--surface-raised); box-shadow: 0 0 0 1px var(--line); }
.source-excerpt-form .textarea { font-size: var(--text-md); }
.source-stance, .source-kinds { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.source-stance .choice, .source-kind-choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.source-stance .choice:has(input:checked), .source-kind-choice:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--on-surface); background: var(--surface-page); }
.source-stance .choice span, .source-kind-choice span { display: flex; flex-direction: column; gap: 2px; }
.source-stance small, .source-kind-choice small { color: var(--on-surface-muted); font-size: var(--text-sm); }
.source-stance input, .source-kind-choice input { margin-top: 4px; accent-color: var(--on-surface); }
.excerpt-list { display: grid; gap: 12px; padding: 0; list-style: none; }
.excerpt { position: relative; padding: 12px 14px; border-left: 2px solid var(--on-surface); border-radius: 0 12px 12px 0; background: var(--surface-raised); }
.excerpt--contradicts { border-left-color: var(--attention); }
.excerpt__quote { display: block; color: var(--on-surface); text-decoration: none; }
.excerpt__quote:hover { text-decoration: underline; text-underline-offset: 3px; }
.excerpt__target, .excerpt__proposal { margin: 6px 0 0; font-size: var(--text-sm); color: var(--on-surface-muted); }
.excerpt__target a, .excerpt__proposal a { color: inherit; text-underline-offset: 3px; }
.excerpt__stance { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .05em; text-transform: uppercase; color: var(--on-surface-faint); }
.excerpt--contradicts .excerpt__stance { color: var(--signal-review); }
.excerpt__remove { margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-sm); color: var(--on-surface-faint); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 24px; }
.excerpt__remove:hover { color: var(--on-surface); }

/* On the persona: passages read in the UI sans, never the persona serif */
.evidence-chip { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--on-surface); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 18px; color: var(--on-surface); text-decoration: none; white-space: nowrap; }
.evidence-chip--disputed { box-shadow: inset 0 0 0 1px var(--attention); background: color-mix(in oklch, var(--attention) 14%, transparent); }
.persona-evidence { margin-block: 32px; scroll-margin-top: 24px; }
.persona-evidence .section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.evidence-list { display: grid; gap: 20px; padding: 0; list-style: none; }
.evidence-group { display: grid; gap: 10px; }
.evidence-group__trait { margin: 0; font-weight: 600; }
.evidence { margin: 0; padding: 12px 16px; border-left: 2px solid var(--on-surface); border-radius: 0 12px 12px 0; background: var(--surface-raised); }
.evidence--contradicts { border-left-color: var(--attention); }
.evidence--team { border-left-style: dashed; }
.evidence blockquote { margin: 0; font-size: var(--text-md); line-height: 1.5; color: var(--on-surface); }
.evidence figcaption { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: var(--text-sm); color: var(--on-surface-muted); }
.evidence figcaption a { color: inherit; text-underline-offset: 3px; }
.evidence__stance { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .05em; text-transform: uppercase; color: var(--on-surface-faint); }
.evidence--contradicts .evidence__stance { color: var(--signal-review); }
.proposal-source blockquote { font-size: var(--text-md); }
.update-card__source { margin: 0; font-size: var(--text-md); line-height: 1.45; color: var(--on-surface); }
.update-card__source span { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: var(--text-xs); color: var(--on-surface-faint); }

@media (max-width: 56rem) {
  .source-layout { grid-template-columns: minmax(0, 1fr); }
  .source-panel { position: static; }
}
.proposal-head__trait { margin: 4px 0 6px; font-size: var(--text-md); color: var(--on-surface-muted); }
.evidence figcaption time { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--on-surface-faint); white-space: nowrap; }

/* Topic matrix: which sources mention what, with the quiet ones dimmed rather than hidden */
.topic-matrix { margin-bottom: 32px; padding: 24px; border-radius: 18px; background: var(--surface-raised); box-shadow: 0 0 0 1px var(--line); }
.topic-matrix__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.topic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.topic-chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.topic-chip .num { font-family: var(--font-mono); font-size: var(--text-xs); opacity: .7; }
.topic-chip[aria-current="true"] { background: var(--on-surface); color: var(--surface-raised); border-color: var(--on-surface); }
.topic-table__scroll { overflow-x: auto; margin-bottom: 12px; }
.topic-table { border-collapse: collapse; font-size: var(--text-sm); }
.topic-table th, .topic-table td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: center; }
.topic-table thead th { font-weight: 500; font-size: var(--text-sm); color: var(--on-surface-muted); white-space: nowrap; }
.topic-table tbody th { text-align: left; font-weight: 500; white-space: nowrap; }
.topic-table tbody th a { color: inherit; text-underline-offset: 3px; }
.topic-table tbody th .source-kind { margin-left: 6px; font-size: 9.5px; }
.topic-table td.is-selected { background: color-mix(in oklch, var(--attention) 10%, transparent); }
.topic-dot { display: inline-block; width: calc(8px + var(--n, 1) * 3px); height: calc(8px + var(--n, 1) * 3px); border-radius: 50%; background: var(--on-surface); vertical-align: middle; }
.topic-dot--none { width: 8px; height: 8px; background: none; box-shadow: inset 0 0 0 1.5px var(--line); }
.topic-add summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: var(--text-sm); font-weight: 600; cursor: pointer; list-style: none; }
.topic-add summary::-webkit-details-marker { display: none; }
.topic-add__form { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(12rem, 2fr) auto; gap: 10px; align-items: end; margin-top: 8px; }
.topic-matrix__note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 12px 0 0; font-size: var(--text-sm); color: var(--on-surface-muted); }
.topic-remove { display: inline; }
.source-list > li.is-dimmed { opacity: .45; transition: opacity .2s var(--ease-standard); }
.source-list > li.is-dimmed:hover { opacity: .8; }
.source-card__topic { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: .04em; color: var(--signal-review); }
.source-text p.is-dimmed { opacity: .4; }
.source-text p.is-topic { padding-left: 12px; border-left: 2px solid var(--attention); }
.source-topic-note { padding: 8px 12px; border-radius: 10px; background: var(--surface-sunken); font-size: var(--text-sm); }
.source-topic-note a { color: inherit; text-underline-offset: 3px; }
@media (max-width: 40rem) { .topic-add__form { grid-template-columns: minmax(0, 1fr); } }
