/* =============================================================
 * UB Intelligence beta (intelligence.php). Markup intelligence.php, script assets/js/intelligence-page.js,
 * the radar-core box itself assets/css/ubi-hero.css + assets/js/ubi-hero.js.
 *
 * The same language as the homepage console (assets/css/home.css, which this file does not touch):
 *   .ubx          the stage: a full-width room (.ubx-env) with a HUD strip, the serif title, the hero box,
 *                 "try" chips and the flagship row
 *   .ubx-tele     the box's readout strip: 0 B uploaded, bytes read here, time, readings, keys
 *   .ubx-panel    the readings console: a bar, the recognizer board (.ubx-sig, lit by what fired), the engine's
 *                 answer (.ubx-ans) and the ranked readings (.ubi-r; the active one opens out)
 *   .ubx-about    four HUD cards
 * Uses the site's tokens (site.css), so both themes and the vision presets carry over. Text colours are the site's
 * AA pairs; the accent is decoration only in light mode. Motion is transforms and opacity, off for reduced motion.
 * ============================================================= */

.ubx-wrap {
    --ubx-k: var(--accent, #d4943a);
    --ubx-ok: #7be0a5;
    --ubx-serif: Georgia, 'Times New Roman', Times, serif;
    --ubx-line: rgba(160, 185, 225, .13);
    --ubx-line-2: rgba(160, 185, 225, .24);
    --ubx-panel: rgba(10, 13, 18, .88);
    --ubx-row: rgba(255, 255, 255, .022);
    --ubx-row-2: rgba(255, 255, 255, .045);
    --ubx-chip: rgba(18, 22, 29, .72);
    --ubx-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 40px 90px -44px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .25);
}
[data-theme="light"] .ubx-wrap {
    --ubx-ok: #157a4c;
    --ubx-line: rgba(22, 36, 62, .13);
    --ubx-line-2: rgba(22, 36, 62, .26);
    --ubx-panel: #ffffff;
    --ubx-row: rgba(22, 36, 62, .022);
    --ubx-row-2: rgba(22, 36, 62, .05);
    --ubx-chip: rgba(255, 255, 255, .86);
    --ubx-shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .05), 0 34px 80px -40px rgba(20, 30, 50, .3);
}
.ubx-wrap :is(a, button):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ================================================================== the stage */
.ubx { position: relative; isolation: isolate; overflow: hidden; padding: clamp(14px, 2.2vw, 26px) 0 clamp(30px, 4vw, 48px); color: var(--text-primary); }
.ubx-env { position: absolute; inset: 0; z-index: -2; pointer-events: none; overflow: hidden; }
.ubx-env > * { position: absolute; }
.ubx-env__base {
    inset: 0;
    background:
        radial-gradient(ellipse 60% 55% at 82% -8%, rgba(228, 176, 96, .13), transparent 62%),
        radial-gradient(ellipse 70% 60% at 6% 108%, rgba(70, 110, 180, .2), transparent 70%),
        linear-gradient(180deg, #0a0d12 0%, #0b0e13 60%, var(--bg-primary) 100%);
}
[data-theme="light"] .ubx-env__base {
    background:
        radial-gradient(ellipse 60% 55% at 82% -8%, rgba(228, 176, 96, .2), transparent 62%),
        radial-gradient(ellipse 70% 60% at 6% 108%, rgba(120, 160, 230, .13), transparent 70%),
        linear-gradient(180deg, #fbfaf7 0%, #f7f6f2 62%, var(--bg-primary) 100%);
}
.ubx-env__grid {                                     /* a faint plotting grid, fading out from the box */
    inset: 0;
    background:
        linear-gradient(var(--ubx-line) 1px, transparent 1px) 0 0 / 48px 48px,
        linear-gradient(90deg, var(--ubx-line) 1px, transparent 1px) 0 0 / 48px 48px;
    opacity: .45;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 62%, #000, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 60% at 50% 62%, #000, transparent 75%);
}
.ubx-env__aura {
    left: 50%; top: 62%;
    width: min(1400px, 140vw); height: 900px;
    margin: -450px 0 0 calc(min(1400px, 140vw) / -2);
    background: radial-gradient(closest-side, color-mix(in srgb, var(--ubx-k) 13%, transparent), transparent 72%);
}
[data-theme="light"] .ubx-env__aura { background: radial-gradient(closest-side, color-mix(in srgb, var(--ubx-k) 8%, transparent), transparent 72%); }
.ubx-env__vignette { inset: 0; background: radial-gradient(ellipse 120% 95% at 50% 38%, transparent 58%, rgba(4, 6, 9, .5)); }
[data-theme="light"] .ubx-env__vignette { background: radial-gradient(ellipse 120% 95% at 50% 38%, transparent 64%, rgba(214, 206, 190, .26)); }
.ubx-env__fade { left: 0; right: 0; bottom: 0; height: 120px; background: linear-gradient(180deg, transparent, var(--bg-primary)); }
.ubx-inner { position: relative; }

/* HUD strip: small mono readouts over a ruler */
.ubx-hud {
    position: relative;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
    padding: 4px 0 10px; margin: 0 0 clamp(20px, 3.2vw, 36px);
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary);
}
.ubx-hud::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
    background:
        linear-gradient(90deg, transparent, var(--ubx-line-2) 12%, var(--ubx-line-2) 88%, transparent) left bottom / 100% 1px no-repeat,
        repeating-linear-gradient(90deg, var(--ubx-line) 0 1px, transparent 1px 24px) left bottom / 100% 4px no-repeat;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.ubx-hud p { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ubx-hud__brand b { font-weight: 500; color: var(--text-secondary); }
.ubx-hud__sep { opacity: .5; }
.ubx-beta { padding: 1px 8px; border: 1px solid color-mix(in srgb, var(--ubx-k) 60%, transparent); border-radius: 999px; color: var(--text-primary); background: color-mix(in srgb, var(--ubx-k) 12%, transparent); }
.ubx-hud__stats { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.ubx-hud__stats b { font-weight: 500; color: var(--text-primary); letter-spacing: .04em; }
.ubx-hud__stats .is-zero b { color: var(--ubx-ok); }
.ubx-dot {
    flex: none; width: 7px; height: 7px; border-radius: 50%; background: #7be0a5;
    box-shadow: 0 0 0 3px rgba(123, 224, 165, .15), 0 0 12px rgba(123, 224, 165, .55);
    animation: ubx-breathe 2.6s ease-in-out infinite alternate;
}
[data-theme="light"] .ubx-dot { background: #1f9a62; box-shadow: 0 0 0 3px rgba(31, 154, 98, .15); }
@keyframes ubx-breathe { from { opacity: .45; } to { opacity: 1; } }

.ubx-title { margin: 0 auto clamp(20px, 3vw, 32px); max-width: 980px; text-align: center; font-weight: 400; }
.ubx-title__lead { display: block; font-family: var(--ubx-serif); font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.08; letter-spacing: -.014em; color: var(--text-primary); }
.ubx-title__lead em { font-style: italic; color: color-mix(in srgb, var(--ubx-k) 60%, var(--text-primary)); }
[data-theme="light"] .ubx-title__lead em { color: color-mix(in srgb, var(--ubx-k) 45%, var(--text-primary)); }
.ubx-title__sub { display: block; max-width: 64ch; margin: 14px auto 0; font-family: var(--font-body); font-size: clamp(.98rem, 1.25vw, 1.06rem); line-height: 1.6; color: var(--text-secondary); }

/* ---- the box's readout strip (inside the hero card) ---- */
.ubx-tele {
    position: relative; z-index: 2;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0;
    padding: 9px 18px 11px;
    border-top: 1px solid var(--ubh-line, var(--ubx-line));
    background: var(--ubx-row);
    font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary);
}
.ubx-tele > span { display: inline-flex; align-items: center; gap: 6px; padding-right: 14px; margin-right: 14px; border-right: 1px solid var(--ubx-line); white-space: nowrap; }
.ubx-tele > span:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.ubx-tele b { font-weight: 500; color: var(--text-secondary); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ubx-tele .is-zero b { color: var(--ubx-ok); }
.ubx-tele__help { margin-left: auto; text-transform: none; letter-spacing: .02em; gap: 5px !important; }
.ubx-wrap kbd {
    display: inline-block; min-width: 18px; padding: 1px 5px; border: 1px solid var(--ubx-line-2); border-bottom-width: 2px; border-radius: 4px;
    background: var(--ubx-row-2); font: 500 .62rem/1.4 var(--font-mono); color: var(--text-secondary); text-align: center; text-transform: none;
}
.ubx-tele__help kbd + kbd { margin-left: -2px; }

/* ---- try chips and flagships (as on the homepage) ---- */
.ubx-try, .ubx-flags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.ubx-flags { margin-top: 10px; }
.ubx-k { margin-right: 4px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-tertiary); }
.ubx-chip {
    display: inline-flex; align-items: center; gap: 7px; height: 30px; max-width: 100%; padding: 0 11px;
    border: 1px solid var(--ubx-line-2); border-radius: 999px; background: var(--ubx-chip); color: var(--text-secondary);
    font-family: var(--font-mono); font-size: .76rem; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
    transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.ubx-chip:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--ubx-k) 55%, var(--ubx-line-2)); transform: translateY(-1px); }
.ubx-chip__sw { flex: none; width: 10px; height: 10px; border-radius: 3px; background: #ff7518; }
.ubx-fchip {
    --a: #e4b060; --a-l: #83570b; --a-ink: var(--a);
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 5px;
    border: 1px solid var(--ubx-line-2); border-radius: 10px; background: var(--ubx-chip); color: var(--text-primary);
    font-size: .82rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
[data-theme="light"] .ubx-fchip { --a-ink: var(--a-l); }
.ubx-fchip svg {
    flex: none; width: 24px; height: 24px; padding: 3.5px; box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--a) 45%, transparent); border-radius: 7px; background: color-mix(in srgb, var(--a) 12%, transparent); color: var(--a-ink);
}
.ubx-fchip:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--a) 60%, transparent); box-shadow: 0 10px 26px -16px var(--a); transform: translateY(-1px); }
.ubx-fchip:hover svg { animation: ubx-draw .9s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes ubx-draw { 0% { stroke-dasharray: 1; stroke-dashoffset: 1; } 100% { stroke-dasharray: 1; stroke-dashoffset: 0; } }
.ubx-more { margin-left: auto; padding: 6px 2px; color: var(--text-primary); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.ubx-more:hover { color: var(--accent); }

/* ================================================================== the box's own controls (the hero styles build on these) */
.ubi-field { position: relative; }
.ubi-input {
    display: block; width: 100%; min-height: 96px; max-height: 40vh; resize: vertical; padding: 12px 14px;
    background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font: 15px/1.5 var(--font-mono); transition: border-color var(--transition);
}
.ubi-input::placeholder { color: var(--text-tertiary); }
.ubi-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.ubi-field.has-file .ubi-input { min-height: 0; height: 44px; resize: none; }
.ubi-file {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-top: 8px; padding: 8px 12px;
    border: 1px dashed var(--accent-border); border-radius: var(--radius-md); background: var(--accent-muted); min-width: 0;
}
.ubi-file[hidden] { display: none; }
.ubi-file__name { font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.ubi-file__meta { font-size: .85rem; color: var(--text-secondary); }
.ubi-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 12px; }
.ubi-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
    background: transparent; border: 1px solid var(--border); border-radius: var(--radius-md);
    color: var(--text-primary); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}
.ubi-btn:hover { border-color: var(--accent-border); background: var(--bg-card-hover); }
.ubi-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ubi-btn[hidden] { display: none; }
.ubi-btn--go { background: var(--accent); border-color: var(--accent); color: var(--text-inverse); box-shadow: 0 8px 24px -12px var(--accent); }
.ubi-btn--go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.ubi-status { flex: 1 1 200px; min-width: 0; font-family: var(--font-mono); font-size: .74rem; letter-spacing: .04em; color: var(--text-tertiary); text-align: right; }

/* ================================================================== the readings console */
.ubx-below { position: relative; padding-bottom: 56px; }
.ubx-panel {
    position: relative; min-width: 0;
    border: 1px solid var(--ubx-line-2); border-radius: 18px;
    background:
        radial-gradient(ellipse 50% 60% at 0% 0%, color-mix(in srgb, var(--ubx-k) 6%, transparent), transparent 70%),
        var(--ubx-panel);
    box-shadow: var(--ubx-shadow);
}
.ubx-panel::after, .ubx-card::after, .ubx-ans::after {      /* corner brackets */
    content: ''; position: absolute; inset: 7px; pointer-events: none;
    --c: color-mix(in srgb, var(--ubx-k) 50%, transparent);
    background:
        linear-gradient(var(--c), var(--c)) left top / 12px 1px, linear-gradient(var(--c), var(--c)) left top / 1px 12px,
        linear-gradient(var(--c), var(--c)) right top / 12px 1px, linear-gradient(var(--c), var(--c)) right top / 1px 12px,
        linear-gradient(var(--c), var(--c)) left bottom / 12px 1px, linear-gradient(var(--c), var(--c)) left bottom / 1px 12px,
        linear-gradient(var(--c), var(--c)) right bottom / 12px 1px, linear-gradient(var(--c), var(--c)) right bottom / 1px 12px;
    background-repeat: no-repeat; opacity: .7;
}
.ubx-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-height: 46px; padding: 8px 20px;
    border-bottom: 1px solid var(--ubx-line);
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary);
}
.ubx-bar__ch { display: inline-flex; align-items: center; gap: 8px; margin: 0; font: inherit; font-weight: 500; color: var(--text-primary); letter-spacing: .14em; }
.ubx-led { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ubx-k); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ubx-k) 18%, transparent), 0 0 10px color-mix(in srgb, var(--ubx-k) 60%, transparent); }
.ubx-bar__kind { min-width: 0; flex: 1 1 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: .02em; font-size: .78rem; color: var(--text-secondary); }
.ubx-bar__kind::before { content: '\21B3  '; color: var(--text-tertiary); }
.ubx-bar__meta { margin-left: auto; letter-spacing: .06em; font-variant-numeric: tabular-nums; }

/* the recognizer board: every recognizer, lit when it found something */
.ubx-sig { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 12px 20px; list-style: none; border-bottom: 1px solid var(--ubx-line); }
.ubx-sig li {
    display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px;
    border: 1px solid var(--ubx-line); border-radius: 7px; background: var(--ubx-row);
    font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary);
    transition: color .25s ease, border-color .25s ease, background-color .25s ease;
}
.ubx-sig__led { width: 6px; height: 6px; border-radius: 50%; background: var(--ubx-line-2); transition: background-color .25s ease, box-shadow .25s ease; }
.ubx-sig b { font-weight: 500; color: var(--text-primary); letter-spacing: 0; }
.ubx-sig b:empty { display: none; }
.ubx-sig li.is-on { color: var(--text-primary); border-color: color-mix(in srgb, var(--ubx-k) 45%, var(--ubx-line)); background: color-mix(in srgb, var(--ubx-k) 8%, transparent); }
.ubx-sig li.is-on .ubx-sig__led { background: var(--ubx-k); box-shadow: 0 0 8px color-mix(in srgb, var(--ubx-k) 70%, transparent); }

/* ---- the answer: an engine's own result, above the readings ---- */
.ubx-ans {
    position: relative; margin: 16px 16px 4px; min-width: 0; overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--ubx-k) 45%, transparent); border-radius: 14px;
    background:
        radial-gradient(ellipse 60% 120% at 0% 50%, color-mix(in srgb, var(--ubx-k) 14%, transparent), transparent 70%),
        linear-gradient(var(--ubx-line) 1px, transparent 1px) 0 0 / 22px 22px,
        linear-gradient(90deg, var(--ubx-line) 1px, transparent 1px) 0 0 / 22px 22px,
        var(--ubx-panel);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ubx-k) 7%, transparent), 0 24px 60px -36px color-mix(in srgb, var(--ubx-k) 70%, transparent);
}
.ubx-ans[hidden] { display: none; }
.ubx-ans__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 14px; padding: 10px 18px; border-bottom: 1px solid var(--ubx-line); }
.ubx-ans__k { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-family: var(--font-mono); font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }
.ubx-ans__src { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; color: var(--text-tertiary); min-width: 0; overflow-wrap: anywhere; }
.ubx-ans__body { padding: 16px 20px 6px; }
.ubi-ans__v { font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 650; line-height: 1.3; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text-primary); overflow-wrap: anywhere; white-space: pre-wrap; max-height: 12em; overflow: auto; padding-bottom: 3px; }
.ubi-ans__v.is-mono { font-family: var(--font-mono); font-size: clamp(1rem, 1.8vw, 1.2rem); font-weight: 500; letter-spacing: 0; line-height: 1.45; }
.ubi-ans__sw { display: inline-block; width: 1em; height: 1em; margin-right: 10px; vertical-align: -0.12em; border-radius: 6px; border: 1px solid var(--ubx-line-2); }
.ubi-ans__lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: .8rem; color: var(--text-secondary); }
.ubi-ans__lines[hidden] { display: none; }
.ubi-ans__lines li { position: relative; padding-left: 16px; overflow-wrap: anywhere; }
.ubi-ans__lines li::before { content: '\203A'; position: absolute; left: 2px; color: var(--text-tertiary); }
.ubx-ans__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px 16px; }
.ubx-ans.is-in { animation: ubx-in .4s cubic-bezier(.2, .7, .2, 1) both; }

/* ---- the readings ---- */
.ubi-list { list-style: none; margin: 0; padding: 14px 16px 6px; display: grid; gap: 6px; }
.ubi-empty { display: grid; gap: 6px; padding: 22px 18px; border: 1px dashed var(--ubx-line-2); border-radius: 12px; color: var(--text-secondary); font-size: .92rem; }
.ubi-empty a { color: var(--accent); }
[data-theme="light"] .ubi-empty a { color: var(--text-primary); }
.ubx-empty__k { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-tertiary); }
.ubx-caret { display: inline-block; width: 7px; height: 12px; margin-left: 6px; vertical-align: -1px; background: var(--ubx-k); animation: ubx-blink 1.1s steps(1) infinite; }
@keyframes ubx-blink { 50% { opacity: 0; } }

.ubi-r {
    --i: 0;
    position: relative; min-width: 0;
    border: 1px solid var(--ubx-line); border-radius: 12px; background: var(--ubx-row);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}
.ubi-list.is-fresh .ubi-r { animation: ubx-in .35s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--i) * 35ms); }
@keyframes ubx-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ubi-r::before { content: ''; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 2px; border-radius: 2px; background: transparent; transition: background-color .18s ease, box-shadow .18s ease; }
.ubi-r:hover { border-color: var(--ubx-line-2); background: var(--ubx-row-2); }
.ubi-r.is-active {
    border-color: color-mix(in srgb, var(--ubx-k) 55%, var(--ubx-line));
    background: linear-gradient(100deg, color-mix(in srgb, var(--ubx-k) 9%, transparent), transparent 60%), var(--ubx-row);
    box-shadow: 0 18px 44px -30px color-mix(in srgb, var(--ubx-k) 80%, transparent);
}
.ubi-r.is-active::before { background: var(--ubx-k); box-shadow: 0 0 12px var(--ubx-k); }
.ubi-r__main { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 11px 16px 4px 14px; cursor: pointer; }
.ubi-r__n { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; color: var(--text-tertiary); }
.ubi-r.is-active .ubi-r__n { color: var(--text-primary); }
.ubi-r__id { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.ubi-r__t { font-weight: 650; font-size: 1rem; color: var(--text-primary); text-decoration: none; overflow-wrap: anywhere; min-width: 0; }
.ubi-r__t:hover { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ubx-k) 70%, transparent); text-underline-offset: 3px; }
.ubi-r.is-active .ubi-r__t { font-size: 1.08rem; }
.ubi-r__cat { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); }
.ubi-r__meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.ubi-r__meter i { width: 4px; height: 100%; border-radius: 1px; background: var(--ubx-line-2); }
.ubi-r__meter i:nth-child(odd) { height: 70%; }
.ubi-r__meter i.is-on { background: var(--ubx-k); }
.ubi-r.is-active .ubi-r__meter i.is-on { box-shadow: 0 0 6px color-mix(in srgb, var(--ubx-k) 70%, transparent); }
.ubi-r__pct { min-width: 3.4em; text-align: right; font-family: var(--font-mono); font-size: 1rem; font-weight: 500; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.ubi-r__pct small { font-size: .7em; color: var(--text-tertiary); margin-left: 1px; }
.ubi-r__sub {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 0; padding: 0 16px 11px 58px; min-width: 0;
    font-family: var(--font-mono); font-size: .7rem; letter-spacing: .03em; color: var(--text-tertiary);
}
.ubi-r__sub > span { min-width: 0; }
.ubi-r__sub > span + span::before { content: '\00B7'; margin: 0 8px; opacity: .7; }
.ubi-r__word { color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: .08em; }
.ubi-r__hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }
.ubi-r.is-active .ubi-r__hint { display: none; }

/* the active reading opens out */
.ubi-r__more { display: none; padding: 2px 16px 14px 58px; }
.ubi-r.is-active .ubi-r__more { display: grid; gap: 10px; animation: ubx-in .3s ease both; }
.ubi-r__vals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.ubi-r__vals > span:first-child { margin-right: 4px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-tertiary); }
.ubi-r__val { padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--ubx-k) 45%, var(--ubx-line)); border-radius: 7px; background: color-mix(in srgb, var(--ubx-k) 9%, transparent); font-family: var(--font-mono); font-size: .8rem; color: var(--text-primary); overflow-wrap: anywhere; }
.ubi-r__why { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: .88rem; color: var(--text-secondary); }
.ubi-r__why li { position: relative; padding-left: 16px; overflow-wrap: anywhere; }
.ubi-r__why li::before { content: '\203A'; position: absolute; left: 2px; color: var(--text-tertiary); font-family: var(--font-mono); }
.ubi-r__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ubi-r__src { display: flex; flex-wrap: wrap; gap: 5px; flex: 1 1 auto; min-width: 0; }
.ubi-src { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border: 1px solid var(--ubx-line); border-radius: 6px; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.ubi-src::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--ubx-k); }
.ubi-r__open { min-height: 34px; font-size: .85rem; }

.ubx-legend { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 8px 20px 14px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-tertiary); }
.ubx-legend span { display: inline-flex; align-items: center; gap: 7px; }
.ubx-legend i { width: 30px; height: 5px; border-radius: 2px; background: linear-gradient(90deg, var(--ubx-k) calc(var(--n) * 10%), var(--ubx-line-2) 0); }

/* ================================================================== about */
.ubx-about { margin-top: 40px; }
.ubx-about__title { display: grid; gap: 6px; margin: 0 0 16px; font-family: var(--ubx-serif); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 400; letter-spacing: -.01em; }
.ubx-about__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.ubx-card {
    position: relative; padding: 20px 20px 18px;
    border: 1px solid var(--ubx-line-2); border-radius: 14px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--ubx-k) 5%, transparent), transparent 40%), var(--ubx-panel);
    box-shadow: var(--ubx-shadow);
}
.ubx-card::before { content: ''; position: absolute; left: 20px; right: 20px; top: -1px; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ubx-k) 70%, transparent), transparent); }
.ubx-card__n { margin: 0 0 10px; font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; color: var(--text-tertiary); }
.ubx-card h3 { margin: 0 0 8px; font-size: 1.02rem; }
.ubx-card p:last-child { margin: 0; color: var(--text-secondary); font-size: .92rem; line-height: 1.6; }

/* ================================================================== small screens */
@media (max-width: 720px) {
    .ubx-tele__help { display: none !important; }
    .ubx-bar, .ubx-sig { padding-left: 14px; padding-right: 14px; }
    .ubi-list { padding: 12px 10px 4px; }
    .ubx-ans { margin: 12px 10px 4px; }
    .ubi-r__main { grid-template-columns: 24px minmax(0, 1fr) auto; padding: 10px 12px 4px 10px; gap: 4px 10px; }
    .ubi-r__meter { display: none; }
    .ubi-r__sub, .ubi-r__more { padding-left: 44px; padding-right: 12px; }
    .ubx-more { margin-left: 0; }
}
@media (max-width: 600px) {
    .ubi-status { text-align: left; flex-basis: 100%; }
    .ubx-tele { padding: 8px 14px 10px; }
    .ubx-hud__local { display: none; }
    .ubx-sig li:not(.is-on) { display: none; }        /* a phone shows only the recognizers that fired */
    .ubx-sig:not(:has(.is-on)) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ubi-input, .ubi-btn, .ubx-chip, .ubx-fchip { transition: none; }
    .ubx-dot, .ubx-caret, .ubi-list.is-fresh .ubi-r, .ubi-r.is-active .ubi-r__more, .ubx-ans.is-in, .ubx-fchip:hover svg { animation: none; }
}

/* ---- beta feedback: "Wrong pick?" (intelligence-page.js; only tool names are sent) ---- */
.ubx-wrong {
    flex: none; height: 26px; padding: 0 11px; border: 1px solid var(--ubx-line-2); border-radius: 999px; background: var(--ubx-row);
    font: 600 .72rem/1 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--text-secondary); cursor: pointer;
}
.ubx-wrong:hover { color: var(--text-primary); border-color: color-mix(in srgb, var(--ubx-k) 55%, var(--ubx-line-2)); }
.ubx-wrong[hidden] { display: none; }
.ubx-report { display: grid; gap: 8px; margin: 0; padding: 12px 20px 14px; border-bottom: 1px solid var(--ubx-line); background: color-mix(in srgb, var(--ubx-k) 5%, transparent); }
.ubx-report[hidden] { display: none; }
.ubx-report__k { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); }
.ubx-report__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ubx-report__in {
    flex: 1 1 260px; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-input); color: var(--text-primary); font: inherit;
}
.ubx-report__in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-muted); }
.ubx-report__err { margin: 0; font-size: .82rem; color: var(--text-primary); }
.ubx-report__err[hidden] { display: none; }
.ubx-report__note { margin: 0; font-size: .78rem; color: var(--text-tertiary); }
.ubx-report__done { margin: 0; padding: 10px 20px; border-bottom: 1px solid var(--ubx-line); font-size: .85rem; color: var(--text-secondary); }
.ubx-report__done[hidden] { display: none; }
