/* Shared structural styles for prototype variants. Visual identity comes from
   each variant's CSS custom properties; this file only consumes them. */

@font-face {
  font-family: "Nunito";
  src: url("/assets/nunito-latin.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  src: url("/assets/nunito-latin-ext.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font-family: "Nunito", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
#graph { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
button { font-family: inherit; }

/* swatches */
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.swatch.hollow { background: transparent !important; border: 2px solid; width: 8px; height: 8px; }

/* legend */
.legend-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: default; }
label.legend-row { cursor: pointer; }
.legend-row input { margin: 0; accent-color: var(--accent); }
.legend-label { flex: 1; }
.legend-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* search */
.search-wrap { position: relative; }
#search { width: 100%; font-family: inherit; font-size: 14px; color: var(--ink); background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius, 8px); padding: 8px 12px; outline: none; }
#search:focus { border-color: var(--accent); }
#search::placeholder { color: var(--muted); }
#search-results { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 8px); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18); display: none; z-index: 40; overflow: hidden; }
#search-results.open { display: block; }
.search-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer; }
.search-item:hover, .search-item.active { background: var(--surface2); }
.search-type { margin-left: auto; color: var(--muted); font-size: 11px; }

/* preview pane internals */
#preview { overflow-y: auto; overscroll-behavior: contain; }
.preview-head { display: flex; align-items: center; gap: 8px; }
.type-badge { display: inline-block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--type-colour); border: 1px solid var(--type-colour); border-radius: 999px; padding: 2px 10px; }
.industry-chip { display: inline-block; font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface2); border-radius: 999px; padding: 2px 10px; }
.close-btn { margin-left: auto; background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.close-btn:hover { background: var(--surface2); color: var(--ink); }
.preview-title { font-size: 22px; font-weight: 700; color: var(--heading, var(--ink)); margin: 10px 0 6px; line-height: 1.25; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.tag { font-size: 11px; background: var(--surface2); color: var(--ink2, var(--ink)); border-radius: 999px; padding: 2px 9px; }
.preview-dates { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.connections h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.connections.none { font-size: 13px; color: var(--muted); font-style: italic; margin-bottom: 14px; }
.conn-group { margin-bottom: 10px; }
.conn-label { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.conn-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; margin: 0 -8px; border-radius: 8px; font-size: 13px; color: var(--ink); text-decoration: none; }
.conn-row:hover { background: var(--surface2); }
.conn-row.derived .conn-title::after { content: " (derived)"; color: var(--muted); font-size: 11px; }
.conn-title { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-context { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-md { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; font-size: 14px; line-height: 1.6; color: var(--ink2, var(--ink)); }
.record-md h1 { font-size: 20px; } .record-md h2 { font-size: 16px; } .record-md h3 { font-size: 14px; }
.record-md h1, .record-md h2, .record-md h3 { color: var(--heading, var(--ink)); font-weight: 700; }
.record-md table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 10px 0; display: block; overflow-x: auto; }
.record-md th, .record-md td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.record-md th { background: var(--surface2); font-weight: 600; }
.record-md a { color: var(--accent); }
.record-md a.wikilink { color: var(--accent); text-decoration: none; border-bottom: 1px dashed var(--accent); }
.record-md .wikilink.broken { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; }
.record-md pre { background: var(--surface2); padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.record-md hr { border: none; border-top: 1px solid var(--border); }

/* isolate breadcrumb */
#isolate-crumb { display: none; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 30; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 8px 6px 16px; font-size: 13px; box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12); }
#isolate-crumb.open { display: flex; }
#isolate-crumb button { background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }

.load-error #stats::after { content: " — database unavailable"; color: #DC2626; }
