@font-face {
  font-family: "Written Units";
  src: url("assets/writtenunits-Regular.ttf") format("truetype");
  font-display: block;
}
@font-face {
  font-family: "ZVVNMOD";
  src: url("assets/zvvnmod.ttf") format("truetype");
  font-display: block;
}
:root {
  color-scheme: light;
  --ink: #13211b;
  --muted: #65726c;
  --line: #dce5e0;
  --line-strong: #c7d5ce;
  --paper: #ffffff;
  --soft: #f4f8f6;
  --soft-2: #eaf3ee;
  --accent: #147d58;
  --accent-soft: #ddf4e8;
  --context: #67a7d8;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #79c7a5; outline-offset: 2px; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 0 max(24px, calc((100vw - 1320px) / 2));
  background: rgb(255 255 255 / .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px);
}
.brand { color: var(--ink); font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand span { color: var(--muted); font-weight: 500; }
.site-header nav { display: flex; align-items: center; gap: 6px; }
.site-header nav a { min-height: 40px; display: grid; place-items: center; padding: 0 12px; color: var(--muted); border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 600; }
.site-header nav a:hover { color: var(--ink); background: var(--soft); }
.nav-compact { display: none; }
main, footer { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.page-heading { padding: 76px 0 42px; border-bottom: 1px solid var(--line); }
.eyebrow, .section-index { color: var(--accent); font: 600 12px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
h1 { max-width: 880px; margin: 10px 0 18px; font-size: clamp(42px, 7vw, 76px); line-height: .98; letter-spacing: -.055em; }
.page-heading > p:not(.eyebrow) { max-width: 760px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.summary { display: flex; flex-wrap: wrap; gap: 10px; margin: 32px 0 0; }
.summary div { min-width: 140px; padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.summary dt { color: var(--muted); font-size: 12px; }
.summary dd { margin: 4px 0 0; font: 600 15px/1.4 var(--mono); }
.toolbar { position: sticky; top: 62px; z-index: 15; margin: 24px 0 0; padding: 14px 16px; background: rgb(244 248 246 / .96); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px); }
.toolbar label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
.search-row { display: flex; gap: 8px; }
.search-row input { width: min(520px, 100%); min-height: 44px; padding: 0 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); font: 15px var(--sans); }
.search-row button { min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; }
.filter-status { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.inventory-section { padding: 74px 0 12px; scroll-margin-top: 124px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.section-index { margin: 0 0 7px; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.035em; }
.section-heading p:not(.section-index) { max-width: 680px; margin: 10px 0 0; color: var(--muted); line-height: 1.55; }
.section-heading > a { flex: none; font-size: 14px; font-weight: 600; }
.table-shell { overflow: auto; max-height: min(74vh, 920px); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 20px rgb(24 70 50 / .04); }
.loading, .empty-state { padding: 40px; color: var(--muted); text-align: center; }
.inventory-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.inventory-table th, .inventory-table td { min-width: 112px; padding: 12px 10px; text-align: center; vertical-align: middle; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.inventory-table tr > :first-child { position: sticky; left: 0; z-index: 3; min-width: 76px; background: var(--paper); font: 650 13px/1.4 var(--mono); }
.inventory-table thead th { position: sticky; top: 0; z-index: 5; background: #edf5f1; color: #42534b; font: 650 11px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.inventory-table thead tr:nth-child(2) th { top: 39px; }
.inventory-table thead tr:first-child th:first-child { z-index: 7; }
.inventory-table tbody tr:hover td { background-color: #f8fbf9; }
.inventory-table tbody tr:hover > :first-child { background: #edf6f1; }
.inventory-table tr > :last-child { border-right: 0; }
.inventory-table tbody tr:last-child > * { border-bottom: 0; }
.utn-table td.undefined, .zvvnmod-table td:empty { background: var(--soft); }
.utn-table .wu { font: 40px/1 "Written Units"; white-space: nowrap; }
.utn-table .wu-context, .utn-table .lig-blue { color: var(--context); opacity: .62; }
.utn-table .lig-gray { color: #94a09b; }
.utn-table i { display: inline-block; max-width: 150px; margin-top: 7px; color: var(--muted); font: 11px/1.45 var(--sans); }
.utn-table .alias + .alias::before { content: " "; }
.z-cell { min-width: 158px !important; padding: 7px !important; vertical-align: top !important; }
.code-list { display: grid; gap: 6px; }
.code-card { display: grid; grid-template-columns: 44px minmax(88px, 1fr); align-items: center; gap: 8px; min-width: 142px; padding: 8px; text-align: left; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.z-glyph { min-width: 44px; min-height: 48px; display: grid; place-items: center; color: #111; background: var(--soft); border-radius: 6px; font: 42px/1 "ZVVNMOD"; }
.code-meta { min-width: 0; }
.code-name { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.25; }
.codepoint, .const-name { display: block; margin-top: 3px; color: var(--muted); font: 10px/1.25 var(--mono); overflow-wrap: anywhere; }
.group-single { background: #eef7f2 !important; }
.group-merged { background: #f1f4f7 !important; }
.group-special { background: #f7f3e9 !important; }
.mapping-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.mapping-actions button, .button-like, .mapping-editor button {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 13px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 9px;
  font: 650 12px/1 var(--sans); text-decoration: none; cursor: pointer;
}
.mapping-actions .primary-action, .mapping-editor .primary-action { color: #fff; background: var(--accent); border-color: var(--accent); }
.mapping-actions button:disabled, .mapping-editor button:disabled { opacity: .45; cursor: not-allowed; }
.mapping-toolbar { margin-bottom: 12px; padding: 14px 16px; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; }
.mapping-toolbar > label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 650; }
.mapping-filter-row { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(170px, 240px); gap: 8px; }
.mapping-filter-row input, .mapping-filter-row select, .source-select, .target-select, .mapping-note-label input {
  min-height: 42px; width: 100%; padding: 0 12px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 9px; font: 13px var(--sans);
}
.mapping-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.summary-count { padding: 5px 8px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; font: 600 11px/1 var(--mono); }
.summary-count.direct { color: #176346; background: #e6f5ed; }
.summary-count.special { color: #6e3b8f; background: #f2e9f8; }
.summary-count.unmapped { color: #875a16; background: #faf1df; }
.mapping-shell { overflow: auto; max-height: min(82vh, 1040px); border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); box-shadow: 0 4px 20px rgb(24 70 50 / .04); }
.mapping-columns, .mapping-row { min-width: 940px; display: grid; grid-template-columns: minmax(285px, .9fr) minmax(160px, .38fr) minmax(350px, 1.2fr); }
.mapping-columns { position: sticky; top: 0; z-index: 10; color: #42534b; background: #edf5f1; border-bottom: 1px solid var(--line-strong); font: 650 11px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.mapping-columns span { padding: 12px 14px; text-align: center; border-right: 1px solid var(--line); }
.mapping-columns span:last-child { border-right: 0; }
.mapping-row { align-items: stretch; min-height: 104px; border-bottom: 1px solid var(--line); }
.mapping-row:last-child { border-bottom: 0; }
.mapping-row > :nth-child(-n + 3) { min-width: 0; padding: 12px; border-right: 1px solid var(--line); }
.mapping-row > :nth-child(3) { border-right: 0; }
.mapping-row:hover { background: #fbfdfc; }
.mapping-source-sequence, .mapping-target-sequence { display: flex; align-items: center; align-content: center; flex-wrap: wrap; gap: 7px; }
.mapping-source-card { min-width: 178px; display: grid; grid-template-columns: 64px minmax(88px, 1fr); align-items: center; gap: 10px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.mapping-source-glyph { min-width: 64px; min-height: 68px; display: grid; place-items: center; color: #111; background: var(--soft); border-radius: 9px; font: 56px/1 "ZVVNMOD"; }
.mapping-source-meta { min-width: 0; }
.mapping-source-name, .mapping-source-code, .mapping-source-const { display: block; overflow-wrap: anywhere; }
.mapping-source-name { font-size: 14px; }
.mapping-source-code { margin-top: 5px; color: var(--muted); font: 11px/1.3 var(--mono); }
.mapping-source-const { margin-top: 3px; color: var(--muted); font: 10px/1.3 var(--mono); }
.mapping-connector { position: relative; min-height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--ink); background: transparent; border: 0; cursor: pointer; }
.connector-line { position: absolute; top: 50%; left: 16px; right: 16px; height: 2px; background: #aebdb6; transform: translateY(-50%); }
.connector-line::after { content: ""; position: absolute; right: -1px; top: 50%; width: 8px; height: 8px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: translateY(-50%) rotate(45deg); color: #77877f; }
.mode-special .connector-line { height: 3px; background: #8751a8; }
.mode-unmapped .connector-line { height: 0; border-top: 2px dashed #b08a4e; }
.mode-badge, .edit-label { position: relative; z-index: 1; padding: 5px 8px; border-radius: 999px; font: 650 10px/1 var(--mono); }
.mode-badge { color: #176346; background: #e6f5ed; border: 1px solid #bfe1cf; text-transform: uppercase; }
.mode-badge.special { color: #6e3b8f; background: #f2e9f8; border-color: #dcc5ea; }
.mode-badge.unmapped { color: #875a16; background: #faf1df; border-color: #ead6ae; }
.edit-label { color: var(--muted); background: var(--paper); border: 1px solid var(--line); }
.mapping-target-card { min-width: 138px; display: grid; grid-template-columns: 54px minmax(72px, 1fr); align-items: center; gap: 8px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.mapping-target-glyph { min-height: 54px; display: grid; place-items: center; background: var(--soft); border-radius: 6px; font: 44px/1 "Written Units"; }
.mapping-target-id, .mapping-target-key { display: block; }
.mapping-target-id { font-size: 12px; }
.mapping-target-key { margin-top: 3px; color: var(--muted); font: 10px/1.2 var(--mono); }
.sequence-plus { color: var(--muted); font: 700 14px var(--mono); }
.mapping-empty-source, .mapping-empty-target { color: #875a16; font-size: 12px; font-style: italic; }
.mapping-editor { grid-column: 1 / -1; padding: 16px; background: #f7faf8; border-top: 1px solid var(--line); box-shadow: inset 3px 0 0 #8751a8; }
.mapping-editor-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.mapping-editor-heading span { color: var(--muted); font-size: 12px; }
.mapping-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sequence-editor { min-width: 0; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.sequence-editor h3 { margin: 0 0 10px; font-size: 13px; }
.sequence-editor-list { display: grid; gap: 7px; }
.sequence-editor-row { display: grid; grid-template-columns: 28px minmax(160px, 1fr) 38px 38px auto; align-items: center; gap: 6px; }
.target-order { color: var(--muted); text-align: center; font: 600 11px var(--mono); }
.mapping-editor .icon-action { min-width: 38px; padding: 0 8px; }
.sequence-add-row { display: grid; grid-template-columns: minmax(160px, 1fr) auto; gap: 7px; margin-top: 10px; }
.mapping-note-label { display: grid; gap: 6px; margin-top: 12px; font-size: 12px; font-weight: 650; }
.mapping-editor-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.mapping-message { min-height: 22px; margin: 10px 2px 0; color: var(--muted); font-size: 12px; }
.mapping-message.error { color: #9d2f2f; }
.particle-table-shell { overflow-x: auto; max-height: min(78vh, 980px); }
.particle-table { width: 100%; min-width: 1040px; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.particle-table th, .particle-table td { padding: 13px; vertical-align: middle; text-align: left; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.particle-table th { position: sticky; top: 0; z-index: 4; color: #42534b; background: #edf5f1; font: 650 11px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.particle-table th:first-child, .particle-table td:first-child { width: 22%; min-width: 220px; }
.particle-table th:nth-child(2), .particle-table td:nth-child(2) { width: 38%; min-width: 380px; }
.particle-table th:nth-child(3), .particle-table td:nth-child(3) { width: 40%; min-width: 400px; border-right: 0; }
.particle-table tbody tr:last-child td { border-bottom: 0; }
.particle-pattern, .particle-sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.particle-aligned-slot { position: relative; display: inline-grid; padding-top: 16px; }
.particle-slot-number { position: absolute; top: 0; left: 4px; color: var(--muted); font: 650 9px/1 var(--mono); }
.pattern-token { padding: 5px 7px; color: var(--ink); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; font: 650 12px/1 var(--mono); }
mark.pattern-token { color: #694409; background: #fff0c9; border-color: #e7cb88; }
.particle-codepoints { margin-top: 8px; color: var(--muted); font: 10px/1.45 var(--mono); }
.particle-chip { min-width: 104px; display: grid; grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 8px; padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.particle-glyph { grid-row: 1 / 3; min-width: 52px; min-height: 56px; display: grid; place-items: center; color: #111; background: var(--soft); border-radius: 7px; }
.zvvnmod-font { font: 46px/1 "ZVVNMOD"; }
.utn-font { font: 44px/1 "Written Units"; }
.particle-chip-name { overflow-wrap: anywhere; font: 650 11px/1.3 var(--mono); }
.particle-chip-code { color: var(--muted); font: 10px/1.3 var(--mono); }
.structural-chip { grid-template-columns: 1fr; min-width: 76px; text-align: center; background: #eef5fb; border-color: #c8dceb; }
.particle-structural-glyph { padding: 8px; color: #305f7f; border-radius: 6px; font: 700 12px/1 var(--mono); }
.blank-particle-chip { grid-template-columns: 1fr; min-width: 118px; color: #875a16; background: #fffaf0; border-style: dashed; border-color: #d9b97d; }
.particle-blank-glyph { font: 650 11px/1.3 var(--mono); }
.particle-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.particle-edit-button { min-height: 34px; padding: 0 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 8px; font: 650 11px/1 var(--sans); cursor: pointer; }
.particle-editor-row > td { padding: 0 !important; background: #f7faf8; border-right: 0 !important; }
.particle-editor { border-top: 0; }
.particle-editor h3 { margin: 0; font-size: 15px; }
.particle-editor-help { margin: 6px 0 12px; color: var(--muted); font-size: 12px; }
.particle-slot-editor-list { display: grid; gap: 8px; }
.particle-slot-editor-row { display: grid; grid-template-columns: 28px minmax(116px, auto) 24px minmax(280px, 1fr); align-items: center; gap: 8px; }
.particle-slot-arrow { color: var(--muted); text-align: center; font: 700 14px var(--mono); }
.particle-slot-select { min-width: 0; }
.particle-load-error { padding: 36px !important; color: #9d2f2f; text-align: center !important; }
#particle-mapping-status.error { color: #9d2f2f; }
[hidden] { display: none !important; }
footer { margin-top: 72px; padding: 26px 0 50px; color: var(--muted); border-top: 1px solid var(--line); font-size: 13px; line-height: 1.6; }
footer p { margin: 4px 0; }
@media (max-width: 720px) {
  .site-header { padding: 0 16px; }
  .brand span { display: none; }
  .site-header nav a { padding: 0 8px; font-size: 12px; }
  main, footer { width: min(100% - 28px, 1320px); }
  .page-heading { padding-top: 52px; }
  .section-heading { align-items: start; flex-direction: column; gap: 10px; }
  .inventory-section { padding-top: 58px; }
  .table-shell { max-height: 70vh; border-radius: 10px; }
  .toolbar { top: 62px; }
  .mapping-actions { justify-content: flex-start; }
  .mapping-filter-row { grid-template-columns: 1fr; }
  .mapping-shell { border-radius: 10px; }
  .mapping-columns, .mapping-row { min-width: 860px; grid-template-columns: 270px 150px 440px; }
  .mapping-editor-heading { align-items: start; flex-direction: column; gap: 4px; }
}
@media (max-width: 420px) {
  .site-header { gap: 8px; padding-inline: 12px; }
  .brand { flex: none; font-size: 0; }
  .brand::before { content: "S"; font-size: 14px; }
  .site-header nav { flex: 1; min-width: 0; justify-content: space-between; gap: 0; }
  .site-header nav a { flex: none; padding-inline: 4px; white-space: nowrap; font-size: 11px; }
  .nav-full { display: none; }
  .nav-compact { display: inline; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
