/* Uno-Plus project page: figures, tables and charts on top of the Academic Project Page Template (Bulma). */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-sunk: #f3f5f8;
  --ink: #16181d;
  --ink-soft: #4a4f5c;
  --ink-faint: #7d8496;
  --rule: #e0e4eb;
  --accent: rgb(49, 92, 246);
  --accent-soft: #eaf0fe;

  --series-1: #257de0;    /* Uno-Plus */
  --series-2: #f47230;    /* DFlash2-Rel */
  --series-3: #00b894;    /* DFlash2-Tuned */
  --series-base: #9aa1b0; /* AR / BF16 baseline */

  --o1: #84b9f3; --o2: #519ced; --o3: #257de0; --o4: #1b64be; --o5: #0e3d7e;

  --p1: #dbe9fc; --p2: #a9cdf6; --p3: #5b9fec; --p4: #1f5fb4;
  --n1: #fde0dc; --n2: #f8b4ad; --n3: #ee7b73; --n4: #c43c3c;
  --z0: #eceef2;
  --tp1: #16181d; --tp2: #16181d; --tp3: #16181d; --tp4: #ffffff;
  --tn1: #16181d; --tn2: #16181d; --tn3: #16181d; --tn4: #ffffff;
  --tz0: #4a4f5c;
  --na: #f5f6f8;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

.uno { color: var(--accent); font-weight: 600; }

/* prose */
.up-prose { font-size: 1.08rem; line-height: 1.7; color: #363636; }
.up-prose p { margin-bottom: 1.1em; }
.up-prose code { font-size: .86em; color: #363636; background: var(--surface-sunk); padding: 1px 5px; border-radius: 3px; }
.up-prose h3.title { margin-top: 2.2rem; }
.up-prose .runin { font-weight: 700; }
.up-eq { margin: 1.2em 0; padding: 14px 16px; background: var(--surface-sunk); border-radius: 6px; font-family: var(--mono); font-size: .95rem; text-align: center; overflow-x: auto; }
.up-eq small { display: block; margin-top: 6px; font-family: 'Noto Sans', sans-serif; color: var(--ink-faint); }
.up-callout { margin: 1.4em 0; padding: 18px 22px; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; }
.up-callout p:last-child { margin-bottom: 0; }

/* figures */
.up-figure { margin: 2.2rem 0 2.6rem; }
.up-chartbox { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 18px 16px 14px; }
.up-chart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin: 0 0 12px; }
.up-chart-title { font-family: 'Google Sans', sans-serif; font-size: 1.05rem; font-weight: 600; margin: 0; color: var(--ink); }
.up-chart-sub { font-size: .88rem; color: var(--ink-faint); margin: 2px 0 0; }
.up-caption { font-family: 'Google Sans', sans-serif; font-size: 1rem; line-height: 1.55; color: #4a4a4a; margin-top: 12px; }
.up-caption b { color: #363636; }
.scroll { overflow-x: auto; }
.scroll svg { display: block; width: 100%; height: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 2px 0; font-size: .85rem; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { flex: none; width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch.dash { background: repeating-linear-gradient(90deg, var(--series-base) 0 5px, transparent 5px 9px) !important; }
.swatch.dot { width: 10px; height: 10px; border-radius: 50%; }
.swatch.ring { width: 10px; height: 10px; border-radius: 50%; background: transparent !important; border: 2px solid var(--series-base); }
.swatch.cell { width: 22px; height: 12px; border-radius: 2px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg button { font: inherit; font-size: .85rem; padding: 6px 12px; background: #fff; color: var(--ink-soft); border: 0; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.grid6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid6 > div, .grid2 > div { min-width: 0; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.panels { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.panels > div { flex: 1 1 250px; max-width: 360px; min-width: 0; }
.panel-title { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 4px 4px; }
details.data { margin: 10px 2px 0; font-size: .85rem; color: var(--ink-soft); }
details.data summary { cursor: pointer; color: var(--ink-faint); }
details.data table { font-size: .8rem; margin-top: 8px; border-collapse: collapse; }
details.data th, details.data td { padding: 3px 8px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
details.data th:first-child, details.data td:first-child { text-align: left; }

/* svg */
svg text { font-family: 'Noto Sans', sans-serif; fill: var(--ink-soft); }
svg .ax { fill: var(--ink-faint); font-size: 12px; }
svg .axt { fill: var(--ink-faint); font-size: 12px; font-style: italic; }
svg .cat { fill: var(--ink-soft); font-size: 13px; }
svg .note { fill: var(--ink-faint); font-size: 11.5px; }
svg .grid { stroke: var(--rule); stroke-width: 1; }
svg .base { stroke: var(--ink-faint); stroke-width: 1; }
svg .refline { stroke: var(--ink-faint); stroke-width: 1.4; stroke-dasharray: 6 5; }
svg .key { font-size: 13px; font-weight: 600; }
svg .val { fill: var(--ink); font-size: 13px; font-weight: 600; }
svg .noise { fill: var(--surface-sunk); }
svg .hit { fill: transparent; cursor: crosshair; }
svg .dotring { stroke: var(--surface); stroke-width: 2; }
svg .cellsub { font-size: 10.5px; }
svg .cellmain { font-size: 14px; font-weight: 600; }
svg .na { fill: var(--na); }
svg .naline { stroke: var(--rule); stroke-width: 1; }

/* tables */
.up-tablewrap { overflow-x: auto; margin: 1.6rem 0 1rem; }
table.up-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; font-variant-numeric: tabular-nums; }
table.up-table caption { caption-side: bottom; text-align: left; padding-top: 10px; font-family: 'Google Sans', sans-serif; font-size: .95rem; color: #4a4a4a; line-height: 1.5; }
table.up-table th, table.up-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--rule); }
table.up-table th:first-child, table.up-table td:first-child { text-align: left; }
table.up-table thead th { font-size: .8rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; border-bottom: 2px solid var(--rule); white-space: nowrap; }
table.up-table tr.hero td { background: var(--accent-soft); }
table.up-table tr.hero td:first-child { font-weight: 600; }
table.up-table td .sub { color: var(--ink-faint); font-size: .82rem; }
table.up-table tr.grp td { font-weight: 600; background: var(--surface-sunk); font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-faint); }

/* ablation tree */
ul.abltree, ul.abltree ul { list-style: none !important; margin: 0 !important; padding: 0; }
ul.abltree { margin: .4em 0 1.6em !important; }
ul.abltree ul { margin-left: 13px !important; padding-left: 22px; border-left: 2px solid var(--rule); }
ul.abltree li { margin: 0 !important; padding: 7px 0 0; position: relative; }
ul.abltree ul > li::before { content: ""; position: absolute; left: -22px; top: 20px; width: 16px; height: 2px; background: var(--rule); }
.arm { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; margin-right: 8px; border-radius: 12px; background: var(--surface-sunk); border: 1px solid var(--rule); font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.arm-b { background: var(--accent-soft); border-color: var(--accent); }

#tip { position: fixed; pointer-events: none; opacity: 0; transform: translate(-50%, -118%); background: #16181d; color: #fff; font-size: 13px; line-height: 1.45; padding: 7px 10px; border-radius: 4px; white-space: nowrap; z-index: 50; transition: opacity .09s linear; }
#tip b { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { #tip { transition: none; } }

@media (max-width: 860px) {
  .grid6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .scroll svg.wide { min-width: 600px; }
}

/* section 1 diagrams */
svg.dg { min-width: 640px; }
svg.dg text { font-family: 'Noto Sans', sans-serif; }
svg.dg .dg-t { fill: #16181d; font-size: 15px; }
svg.dg .dg-small { fill: #6b7280; font-size: 12.5px; }
svg.dg .dg-cap { fill: #4a4f5c; font-size: 13px; font-weight: 600; }
svg.dg .dg-m { fill: rgb(49, 92, 246); font-size: 16px; font-weight: 600; }
svg.dg .dg-tok { fill: #f3f5f8; stroke: #c9ced8; stroke-width: 1.2; }
svg.dg .dg-mask { fill: #ffffff; stroke: rgb(49, 92, 246); stroke-width: 1.4; stroke-dasharray: 4 3; }
svg.dg .dg-draft { fill: #eaf0fe; stroke: rgb(49, 92, 246); stroke-width: 1.4; }
svg.dg .dg-w { fill: #ffffff; stroke: #7d8496; stroke-width: 1.6; }
svg.dg .dg-lora { fill: rgb(49, 92, 246); }
svg.dg .dg-lt { fill: #ffffff; font-size: 15px; font-weight: 700; }
svg.dg .dg-lsmall { fill: #dfe7ff; font-size: 11.5px; }
svg.dg .dg-ok { fill: #e1f5ec; stroke: #0f7a55; stroke-width: 1.4; }
svg.dg .dg-okt { fill: #0b5c40; font-size: 15px; font-weight: 600; }
svg.dg .dg-bad { fill: #fde3e1; stroke: #c62828; stroke-width: 1.4; }
svg.dg .dg-badt { fill: #a61f1f; font-size: 15px; font-weight: 600; }
svg.dg .dg-off { fill: #f7f8fa; stroke: #e0e4eb; stroke-width: 1.2; }
svg.dg .dg-offt { fill: #a3a9b6; font-size: 15px; }
svg.dg .dg-strike { stroke: #a3a9b6; stroke-width: 1.5; }
svg.dg .dg-arrow { stroke: #7d8496; stroke-width: 1.6; }
svg.dg .dg-arrowhead { fill: #7d8496; }
svg.dg .dg-link { stroke: #b6bcc8; stroke-width: 1.4; stroke-dasharray: 4 4; }

/* method name: Uno in the Uno blue, -Plus in purple */
.unp { font-weight: 700; white-space: nowrap; }
.unp .u { color: rgb(49, 92, 246); }
.unp .p { color: #8b3dd9; }
.up-placeholder { border: 1.5px dashed #c9b6e8; border-radius: 8px; padding: 12px 16px; margin: 6px 0 20px; color: #6b6b6b; background: #faf7fe; font-style: italic; font-size: .95rem; }
.up-figimg { display: block; width: 100%; height: auto; }
.up-figure-narrow { max-width: 640px; margin-left: auto; margin-right: auto; }
.up-anchor { margin-left: .4em; font-size: .7em; text-decoration: none; opacity: 0; transition: opacity .15s; vertical-align: middle; }
h2:hover > .up-anchor, h3:hover > .up-anchor, h4:hover > .up-anchor, .up-anchor:focus { opacity: .75; }
@media (hover: none) { .up-anchor { opacity: .45; } }
section h2[id], section h3[id], section h4[id], section[id] { scroll-margin-top: 16px; }
