/* Nexus Platform — component stylesheet. Loads after tokens.css. Prefix: up- */

/* ---------- base ---------- */
.up-root, .up-shell, .up-auth, .up-card, .up-dialog, .up-menu, .up-toast { box-sizing: border-box; }
.up-root *, .up-shell *, .up-auth *, .up-card *, .up-dialog *, .up-menu *, .up-toast * { box-sizing: inherit; }
.up-root { font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
.up-root a, .up-link { color: var(--link); text-decoration: none; }
.up-root a:hover, .up-link:hover { text-decoration: underline; text-underline-offset: 2px; }
.up-root :focus-visible, .up-shell :focus-visible, .up-auth :focus-visible, .up-dialog :focus-visible, .up-menu :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-sm); }
.up-mono { font-family: var(--font-mono); font-size: 13px; }
.up-num { font-variant-numeric: tabular-nums; text-align: right; }
.up-muted { color: var(--ink-muted); }
.up-secondary { color: var(--ink-secondary); }
.up-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.up-icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.up-icon--lg { width: 20px; height: 20px; }
.up-icon--xl { width: 32px; height: 32px; stroke-width: 1.5; }
.up-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.up-row { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.up-spacer { flex: 1; }
.up-divider { border: 0; border-top: 1px solid var(--line); margin: var(--space-4) 0; }
.up-kbd { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); color: var(--ink-secondary); background: var(--surface-raised); }

/* ---------- product hue scope ---------- */
.up-product-motion { --product: var(--motion); --product-soft: var(--motion-soft); }
.up-product-pulse  { --product: var(--pulse);  --product-soft: var(--pulse-soft); }
.up-product-nexus  { --product: var(--nexus);  --product-soft: var(--nexus-soft); }
.up-product-platform { --product: var(--primary); --product-soft: var(--primary-soft); }

/* ---------- app shell ---------- */
.up-shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; grid-template-rows: var(--topbar-height) 1fr; min-height: 100%; font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
.up-shell.is-collapsed { grid-template-columns: var(--sidebar-width-collapsed) 1fr; }
.up-sidebar { grid-row: 1 / 3; grid-column: 1; background: var(--shell); color: var(--shell-ink-muted); display: flex; flex-direction: column; border-right: 1px solid var(--shell-line); position: sticky; top: 0; height: 100vh; overflow: hidden; z-index: var(--z-shell); }
.up-sidebar__brand { height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-3); padding: 0 var(--space-4); border-bottom: 1px solid var(--shell-line); flex: none; }
.up-mark { width: 28px; height: 28px; border-radius: var(--radius-md); background: var(--product); color: #ffffff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: 0; flex: none; }
.up-mark--lg { width: 40px; height: 40px; font-size: 18px; border-radius: var(--radius-lg); }
.up-sidebar__brand .up-mark { color: #0f1216; }
.up-sidebar__name { color: var(--shell-ink); font-weight: 600; font-size: 15px; line-height: 18px; white-space: nowrap; }
.up-sidebar__platform { color: var(--shell-ink-muted); font-size: 11px; line-height: 14px; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.up-sidebar__scroll { flex: 1; overflow-y: auto; padding: var(--space-3) var(--space-3) var(--space-4); }
.up-nav-section { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--shell-ink-muted); padding: var(--space-4) var(--space-3) var(--space-1); white-space: nowrap; }
.up-nav-section:first-child { padding-top: var(--space-1); }
.up-nav-item { position: relative; display: flex; align-items: center; gap: var(--space-3); height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--shell-ink-muted); text-decoration: none; font-weight: 500; white-space: nowrap; cursor: pointer; border: 0; background: transparent; width: 100%; font: inherit; text-align: left; }
.up-nav-item:hover { background: var(--shell-raised); color: var(--shell-ink); text-decoration: none; }
.up-nav-item.is-active { background: var(--shell-active); color: var(--shell-ink); font-weight: 600; }
.up-nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--product); }
.up-nav-item .up-icon { width: 18px; height: 18px; opacity: .9; }
.up-nav-item__count { margin-left: auto; font-size: 11px; font-weight: 600; line-height: 18px; min-width: 18px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--shell-raised); color: var(--shell-ink); text-align: center; }
.up-nav-item.is-active .up-nav-item__count { background: var(--product); color: #0f1216; }
.up-sidebar__footer { border-top: 1px solid var(--shell-line); padding: var(--space-3); flex: none; }
.up-user { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-2); border-radius: var(--radius-md); color: var(--shell-ink-muted); cursor: pointer; }
.up-user:hover { background: var(--shell-raised); }
.up-user__name { color: var(--shell-ink); font-weight: 600; font-size: 13px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-user__role { font-size: 12px; line-height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-user__text { min-width: 0; }
.is-collapsed .up-sidebar__name, .is-collapsed .up-sidebar__platform, .is-collapsed .up-nav-section, .is-collapsed .up-nav-item span, .is-collapsed .up-user__text, .is-collapsed .up-nav-item__count { display: none; }
.is-collapsed .up-nav-item { justify-content: center; padding: 0; }
.is-collapsed .up-sidebar__brand { justify-content: center; padding: 0; }

.up-topbar { grid-row: 1; grid-column: 2; height: var(--topbar-height); display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--space-6); background: var(--shell); color: var(--shell-ink-muted); border-bottom: 1px solid var(--shell-line); position: sticky; top: 0; z-index: var(--z-shell); }
.up-topbar__title { color: var(--shell-ink); font-weight: 600; }
.up-topbar .up-breadcrumb { color: var(--shell-ink-muted); }
.up-topbar .up-breadcrumb a { color: var(--shell-ink-muted); }
.up-topbar .up-breadcrumb [aria-current] { color: var(--shell-ink); }
.up-topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.up-iconbtn { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: var(--radius-md); border: 0; background: transparent; color: inherit; cursor: pointer; }
.up-iconbtn:hover { background: var(--shell-raised); color: var(--shell-ink); }
.up-root .up-iconbtn:hover, .up-card .up-iconbtn:hover, .up-table .up-iconbtn:hover { background: var(--surface-hover); color: var(--ink); }
.up-env { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; background: var(--shell-raised); color: var(--shell-ink); border: 1px solid var(--shell-line); }
.up-env::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.up-env--staging::before { background: var(--warning); }
.up-env--sandbox::before { background: var(--neutral); }
.up-env--down::before { background: var(--danger); }
.up-main { grid-row: 2; grid-column: 2; padding: var(--space-8) var(--space-8) var(--space-12); min-width: 0; }
.up-container { max-width: var(--content-max); margin: 0 auto; }

/* app switcher */
.up-switcher { position: absolute; top: calc(var(--topbar-height) - 8px); right: var(--space-6); width: 300px; padding: var(--space-2); background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); display: none; z-index: var(--z-menu); color: var(--ink); }
.up-switcher.is-open { display: block; }
.up-switcher__item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); text-decoration: none; color: var(--ink); }
.up-switcher__item:hover { background: var(--surface-hover); text-decoration: none; }
.up-switcher__item.is-current { background: var(--surface-selected); }
.up-switcher__item .up-mark { color: #ffffff; }
.up-switcher__title { font-weight: 600; line-height: 18px; }
.up-switcher__desc { font-size: 12px; line-height: 16px; color: var(--ink-muted); }

/* ---------- page header ---------- */
.up-page-header { display: flex; align-items: flex-start; gap: var(--space-4); margin-bottom: var(--space-6); }
.up-page-header__text { min-width: 0; flex: 1; }
.up-page-header__eyebrow { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: var(--space-1); }
.up-page-header h1, .up-page-header__title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.up-page-header__desc { margin: var(--space-1) 0 0; color: var(--ink-secondary); max-width: 720px; }
.up-page-header__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; padding-top: 2px; }
.up-section-title { margin: var(--space-8) 0 var(--space-3); font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); display: flex; align-items: baseline; gap: var(--space-3); }
.up-section-title small { font-size: 13px; font-weight: 400; color: var(--ink-muted); }

/* ---------- buttons ---------- */
.up-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); height: var(--control-height); padding: 0 14px; border-radius: var(--radius-md); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; line-height: 20px; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color .12s ease, border-color .12s ease, color .12s ease; position: relative; }
.up-btn:hover { text-decoration: none; }
.up-btn--primary { background: var(--primary); color: var(--ink-on-fill); }
.up-btn--primary:hover { background: var(--primary-hover); }
.up-btn--primary:active { background: var(--primary-active); }
.up-btn--secondary { background: var(--surface-raised); color: var(--ink); border-color: var(--line-strong); }
.up-btn--secondary:hover { background: var(--surface-hover); }
.up-btn--ghost { background: transparent; color: var(--ink-secondary); }
.up-btn--ghost:hover { background: var(--surface-hover); color: var(--ink); }
.up-btn--danger { background: var(--danger); color: var(--ink-on-fill); }
.up-btn--danger:hover { background: var(--danger-hover); }
.up-btn--danger-quiet { background: transparent; color: var(--danger-ink); border-color: transparent; }
.up-btn--danger-quiet:hover { background: var(--danger-soft); }
.up-btn--link { background: transparent; color: var(--link); padding: 0 4px; height: auto; font-weight: 500; }
.up-btn--link:hover { text-decoration: underline; text-underline-offset: 2px; }
.up-btn--sm { height: var(--control-height-sm); padding: 0 10px; font-size: 13px; }
.up-btn--sm .up-icon { width: 14px; height: 14px; }
.up-btn--lg { height: var(--control-height-lg); padding: 0 20px; font-size: 15px; }
.up-btn--block { width: 100%; }
.up-btn--icon { width: var(--control-height); padding: 0; }
.up-btn--icon.up-btn--sm { width: var(--control-height-sm); }
.up-btn[disabled], .up-btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.up-btn.is-loading { color: transparent !important; pointer-events: none; }
.up-btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid; border-color: currentColor transparent currentColor currentColor; color: var(--ink-on-fill); animation: up-spin .8s linear infinite; }
.up-btn--secondary.is-loading::after, .up-btn--ghost.is-loading::after { color: var(--ink-secondary); }
@keyframes up-spin { to { transform: rotate(360deg); } }
.up-btn-group { display: inline-flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.up-form { display: flex; flex-direction: column; gap: var(--space-4); max-width: var(--form-max); }
.up-form--wide { max-width: none; }
.up-form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); }
.up-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.up-label { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.up-label__optional { font-weight: 400; color: var(--ink-muted); }
.up-label--overline { font-size: 11px; line-height: 16px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }
.up-input, .up-select, .up-textarea { width: 100%; height: var(--control-height); padding: 0 var(--space-3); border: 1px solid var(--input-line); border-radius: var(--radius-md); background: var(--input-bg); color: var(--ink); font: inherit; font-size: 14px; line-height: 20px; transition: border-color .12s ease, box-shadow .12s ease; }
.up-input::placeholder, .up-textarea::placeholder { color: var(--ink-muted); }
.up-input:hover, .up-select:hover, .up-textarea:hover { border-color: var(--ink-secondary); }
.up-input:focus, .up-select:focus, .up-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.up-input[disabled], .up-select[disabled], .up-textarea[disabled], .up-input[readonly] { background: var(--surface-sunken); color: var(--ink-secondary); cursor: not-allowed; }
.up-input--mono { font-family: var(--font-mono); font-size: 13px; }
.up-input--sm { height: var(--control-height-sm); font-size: 13px; }
.up-input--lg { height: var(--control-height-lg); font-size: 15px; }
.up-textarea { height: auto; min-height: 88px; padding: var(--space-2) var(--space-3); resize: vertical; }
.up-select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7482' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.up-help { font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.up-error { font-size: 12px; line-height: 16px; color: var(--danger-ink); display: flex; gap: 4px; align-items: center; }
.up-field.is-invalid .up-input, .up-field.is-invalid .up-select, .up-field.is-invalid .up-textarea { border-color: var(--danger); }
.up-field.is-invalid .up-input:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.up-input-group { position: relative; display: flex; align-items: stretch; }
.up-input-group .up-input { padding-right: 40px; }
.up-input-group__affix { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--ink-muted); background: transparent; border: 0; cursor: pointer; }
.up-input-group__affix:hover { background: var(--surface-hover); color: var(--ink); }
.up-input-group__prefix { position: absolute; left: 10px; top: 0; bottom: 0; display: grid; place-items: center; color: var(--ink-muted); pointer-events: none; }
.up-input-group--prefixed .up-input { padding-left: 34px; padding-right: var(--space-3); }
.up-check { display: inline-flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; color: var(--ink); font-size: 14px; line-height: 20px; }
.up-check input { appearance: none; width: 16px; height: 16px; margin: 2px 0 0; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-raised); flex: none; display: grid; place-items: center; cursor: pointer; }
.up-check input[type=radio] { border-radius: 50%; }
.up-check input:checked { background: var(--primary); border-color: var(--primary); }
.up-check input[type=checkbox]:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--ink-on-fill); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.up-check input[type=radio]:checked::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-on-fill); }
.up-check input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.up-check__help { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.up-switch { appearance: none; -webkit-appearance: none; width: 36px; height: 20px; border-radius: var(--radius-pill); background: var(--line-strong); border: 0; position: relative; cursor: pointer; padding: 0; flex: none; transition: background-color .15s ease; }
.up-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.up-switch[aria-checked="true"] { background: var(--primary); }
.up-switch[aria-checked="true"]::after { transform: translateX(16px); }
.up-switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.up-switch-row:last-child { border-bottom: 0; }
.up-switch-row__title { font-weight: 600; }
.up-switch-row__desc { font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.up-fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.up-fieldset legend { padding: 0; margin-bottom: var(--space-2); font-size: 15px; line-height: 22px; font-weight: 600; }
.up-form-section { padding-top: var(--space-5); border-top: 1px solid var(--line); }
.up-form-section__title { font-size: 15px; line-height: 22px; font-weight: 600; margin: 0 0 2px; }
.up-form-section__desc { font-size: 13px; color: var(--ink-muted); margin: 0 0 var(--space-4); }
.up-form-actions { display: flex; gap: var(--space-2); align-items: center; padding-top: var(--space-2); }

/* ---------- card ---------- */
.up-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); }
.up-card__header { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--line); }
.up-card__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.up-card__subtitle { margin: 2px 0 0; font-size: 13px; line-height: 18px; color: var(--ink-muted); }
.up-card__actions { margin-left: auto; display: flex; gap: var(--space-2); align-items: center; flex: none; }
.up-card__body { padding: var(--space-5); }
.up-card__body--flush { padding: 0; }
.up-card__footer { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--line); display: flex; align-items: center; gap: var(--space-3); font-size: 13px; color: var(--ink-muted); }
.up-card--danger { border-color: var(--danger-soft); }
.up-card--danger .up-card__header { border-bottom-color: var(--danger-soft); }
.up-card--danger .up-card__title { color: var(--danger-ink); }
.up-card--interactive { cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease; }
.up-card--interactive:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.up-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.up-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.up-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ---------- stat tile ---------- */
.up-stat { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.up-stat__label { font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); display: flex; justify-content: space-between; gap: var(--space-2); }
.up-stat__value { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ink); }
.up-stat__value--danger { color: var(--danger-ink); }
.up-stat__meta { display: flex; align-items: center; gap: var(--space-2); font-size: 12px; line-height: 16px; color: var(--ink-muted); flex-wrap: wrap; }
.up-delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-variant-numeric: tabular-nums; }
.up-delta--up { color: var(--success-ink); }
.up-delta--down { color: var(--danger-ink); }
.up-delta--flat { color: var(--ink-muted); }
.up-stat__spark { height: 32px; margin-top: var(--space-1); }
.up-stat__spark svg { width: 100%; height: 100%; display: block; }
.up-stat__spark path { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.up-meter { height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; margin-top: var(--space-2); }
.up-meter > span { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.up-meter--success > span { background: var(--success); }
.up-meter--warning > span { background: var(--warning); }
.up-meter--danger > span { background: var(--danger); }

/* ---------- badge ---------- */
.up-badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-secondary); border: 1px solid transparent; }
.up-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--neutral); flex: none; }
.up-badge--success { background: var(--success-soft); color: var(--success-ink); } .up-badge--success::before { background: var(--success); }
.up-badge--warning { background: var(--warning-soft); color: var(--warning-ink); } .up-badge--warning::before { background: var(--warning); }
.up-badge--danger  { background: var(--danger-soft);  color: var(--danger-ink); }  .up-badge--danger::before  { background: var(--danger); }
.up-badge--info    { background: var(--info-soft);    color: var(--info-ink); }    .up-badge--info::before    { background: var(--info); }
.up-badge--primary { background: var(--primary-soft); color: var(--primary-ink); } .up-badge--primary::before { background: var(--primary); }
.up-badge--running::before { animation: up-pulse 1.4s ease-in-out infinite; }
@keyframes up-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.up-badge--nodot::before { display: none; }
.up-badge--outline { background: transparent; border-color: var(--line-strong); color: var(--ink-secondary); }
.up-badge--solid { color: var(--ink-on-fill); }
.up-badge--solid::before { background: var(--ink-on-fill); opacity: .8; }
.up-badge--solid.up-badge--success { background: var(--success); } .up-badge--solid.up-badge--warning { background: var(--warning); } .up-badge--solid.up-badge--danger { background: var(--danger); } .up-badge--solid.up-badge--info { background: var(--info); } .up-badge--solid.up-badge--primary { background: var(--primary); }
.up-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--radius-pill); font-size: 11px; line-height: 1; font-weight: 600; background: var(--neutral-soft); color: var(--ink-secondary); }
.up-count--danger { background: var(--danger); color: var(--ink-on-fill); }
.up-count--primary { background: var(--primary); color: var(--ink-on-fill); }
.up-method { display: inline-grid; place-items: center; height: 20px; min-width: 44px; padding: 0 6px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; border: 1px solid; }
.up-method--get    { color: var(--info-ink);    background: var(--info-soft);    border-color: transparent; }
.up-method--post   { color: var(--success-ink); background: var(--success-soft); border-color: transparent; }
.up-method--patch, .up-method--put { color: var(--warning-ink); background: var(--warning-soft); border-color: transparent; }
.up-method--delete { color: var(--danger-ink);  background: var(--danger-soft);  border-color: transparent; }
.up-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; background: var(--surface-sunken); color: var(--ink-secondary); border: 1px solid var(--line); }
.up-chip--mono { font-family: var(--font-mono); }
.up-chip--product { background: var(--product-soft); color: var(--ink); }
.up-chip--product::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--product); }

/* ---------- table ---------- */
.up-table-wrap { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.up-table-wrap__toolbar { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.up-table-wrap__toolbar .up-input { width: 260px; }
.up-table-wrap__summary { font-size: 13px; color: var(--ink-muted); }
.up-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 20px; }
.up-table th { text-align: left; font-size: 11px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); background: var(--surface-sunken); padding: 10px var(--space-4); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: var(--z-sticky); }
.up-table th.is-sortable { cursor: pointer; }
.up-table th.is-sorted { color: var(--ink); }
.up-table th .up-sort { display: inline-block; width: 10px; margin-left: 4px; opacity: .6; }
.up-table td { padding: 10px var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; color: var(--ink); }
.up-table tbody tr:last-child td { border-bottom: 0; }
.up-table tbody tr:hover td { background: var(--surface-hover); }
.up-table tbody tr.is-selected td { background: var(--surface-selected); }
.up-table td.is-primary, .up-table .is-primary a { font-weight: 600; color: var(--ink); }
.up-table .is-secondary { color: var(--ink-secondary); }
.up-table .is-muted { color: var(--ink-muted); font-size: 13px; }
.up-table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.up-table .is-mono { font-family: var(--font-mono); font-size: 13px; }
.up-table .is-actions { text-align: right; white-space: nowrap; width: 1%; }
.up-table .is-actions .up-btn-group { justify-content: flex-end; flex-wrap: nowrap; gap: var(--space-1); }
.up-table .is-check { width: 1%; padding-right: 0; }
.up-table--compact td { padding: 6px var(--space-3); }
.up-table--compact th { padding: 8px var(--space-3); }
.up-table__sub { display: block; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.up-table-wrap__footer { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-muted); }
.up-pagination { display: inline-flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.up-pagination__page { min-width: 28px; height: 28px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; color: var(--ink-secondary); font: inherit; font-size: 13px; cursor: pointer; }
.up-pagination__page:hover { background: var(--surface-hover); color: var(--ink); }
.up-pagination__page.is-active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 600; }
.up-pagination__page[disabled] { opacity: .4; cursor: not-allowed; }

/* ---------- alert / banner ---------- */
.up-alert { display: flex; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px solid; background: var(--info-soft); border-color: transparent; color: var(--ink); align-items: flex-start; }
.up-alert .up-icon { margin-top: 2px; width: 18px; height: 18px; }
.up-alert__body { flex: 1; min-width: 0; }
.up-alert__title { font-weight: 600; margin: 0; }
.up-alert__text { margin: 2px 0 0; color: var(--ink-secondary); }
.up-alert__text code { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-raised); padding: 1px 5px; border-radius: 3px; }
.up-alert__actions { margin-top: var(--space-2); display: flex; gap: var(--space-2); }
.up-alert__close { background: transparent; border: 0; color: var(--ink-muted); cursor: pointer; width: 24px; height: 24px; display: grid; place-items: center; border-radius: var(--radius-sm); margin: -2px -4px 0 0; }
.up-alert__close:hover { color: var(--ink); background: rgba(0,0,0,.06); }
.up-alert--info    { background: var(--info-soft); }    .up-alert--info .up-icon, .up-alert--info .up-alert__title { color: var(--info-ink); }
.up-alert--success { background: var(--success-soft); } .up-alert--success .up-icon, .up-alert--success .up-alert__title { color: var(--success-ink); }
.up-alert--warning { background: var(--warning-soft); } .up-alert--warning .up-icon, .up-alert--warning .up-alert__title { color: var(--warning-ink); }
.up-alert--danger  { background: var(--danger-soft); }  .up-alert--danger .up-icon, .up-alert--danger .up-alert__title { color: var(--danger-ink); }
.up-alert--neutral { background: var(--surface-sunken); border-color: var(--line); } .up-alert--neutral .up-icon { color: var(--ink-muted); }
.up-alert--inline { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: 13px; }
.up-callout { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); background: var(--primary-soft); color: var(--ink); border: 1px solid transparent; }
.up-callout__title { font-weight: 600; color: var(--primary-ink); margin: 0 0 2px; }
.up-callout p { margin: 0; color: var(--ink-secondary); }

/* ---------- toast ---------- */
.up-toast-region { position: fixed; right: var(--space-6); bottom: var(--space-6); display: flex; flex-direction: column; gap: var(--space-2); z-index: var(--z-toast); width: 360px; max-width: calc(100vw - 48px); }
.up-toast { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); background: var(--surface-overlay); color: var(--ink); border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); animation: up-toast-in .18s ease-out; }
@keyframes up-toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.up-toast .up-icon { margin-top: 2px; width: 18px; height: 18px; }
.up-toast--success .up-icon { color: var(--success-ink); } .up-toast--danger .up-icon { color: var(--danger-ink); } .up-toast--warning .up-icon { color: var(--warning-ink); } .up-toast--info .up-icon { color: var(--info-ink); }
.up-toast__title { font-weight: 600; }
.up-toast__text { font-size: 13px; color: var(--ink-secondary); }
.up-toast__body { flex: 1; min-width: 0; }
.up-toast__action { color: var(--link); font-weight: 600; font-size: 13px; background: none; border: 0; cursor: pointer; padding: 0; margin-top: 4px; font-family: inherit; }
.up-toast-region--static { position: static; width: auto; }

/* ---------- tabs ---------- */
.up-tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); margin-bottom: var(--space-5); overflow-x: auto; }
.up-tab { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 40px; padding: 0 var(--space-3); border: 0; background: transparent; color: var(--ink-secondary); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.up-tab:hover { color: var(--ink); }
.up-tab.is-active, .up-tab[aria-selected="true"] { color: var(--primary-ink); font-weight: 600; }
.up-tab.is-active::after, .up-tab[aria-selected="true"]::after { content: ""; position: absolute; left: var(--space-3); right: var(--space-3); bottom: 0; height: 2px; background: var(--primary); border-radius: 1px 1px 0 0; }
.up-tab .up-count { margin-left: 2px; }
.up-tabpanel[hidden] { display: none; }
.up-segmented { display: inline-flex; padding: 3px; background: var(--surface-sunken); border-radius: var(--radius-md); border: 1px solid var(--line); gap: 2px; }
.up-segmented__item { height: 28px; padding: 0 12px; border-radius: 4px; border: 0; background: transparent; color: var(--ink-secondary); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.up-segmented__item:hover { color: var(--ink); }
.up-segmented__item.is-active, .up-segmented__item[aria-pressed="true"], .up-segmented__item[aria-selected="true"] { background: var(--surface-raised); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.up-segmented__sub { font-size: 11px; font-weight: 400; color: var(--ink-muted); }

/* ---------- menu ---------- */
.up-menu-wrap { position: relative; display: inline-block; }
.up-menu { position: absolute; top: calc(100% + 4px); right: 0; min-width: 200px; padding: var(--space-1); background: var(--surface-overlay); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); z-index: var(--z-menu); display: none; color: var(--ink); font-size: 14px; }
.up-menu.is-open, .up-menu--static { display: block; }
.up-menu--static { position: static; display: block; box-shadow: var(--shadow-md); }
.up-menu--left { right: auto; left: 0; }
.up-menu__item { display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; text-decoration: none; }
.up-menu__item:hover { background: var(--surface-hover); text-decoration: none; }
.up-menu__item .up-icon { color: var(--ink-muted); }
.up-menu__item--danger { color: var(--danger-ink); } .up-menu__item--danger .up-icon { color: var(--danger-ink); } .up-menu__item--danger:hover { background: var(--danger-soft); }
.up-menu__item[aria-disabled="true"] { color: var(--ink-disabled); cursor: not-allowed; }
.up-menu__shortcut { margin-left: auto; font-size: 12px; color: var(--ink-muted); }
.up-menu__sep { height: 1px; background: var(--line); margin: var(--space-1) 0; }
.up-menu__label { padding: 6px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted); }

/* ---------- dialog ---------- */
.up-dialog-backdrop { position: fixed; inset: 0; background: rgba(9, 12, 16, .55); display: none; align-items: center; justify-content: center; padding: var(--space-6); z-index: var(--z-modal); }
.up-dialog-backdrop.is-open, .up-dialog-backdrop--static { display: flex; }
.up-dialog-backdrop--static { position: static; background: transparent; padding: 0; }
.up-dialog { width: 100%; max-width: 480px; background: var(--surface-overlay); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); animation: up-toast-in .16s ease-out; }
.up-dialog--wide { max-width: 720px; }
.up-dialog__header { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-5) var(--space-5) 0; }
.up-dialog__icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-ink); }
.up-dialog__icon--danger { background: var(--danger-soft); color: var(--danger-ink); }
.up-dialog__icon--warning { background: var(--warning-soft); color: var(--warning-ink); }
.up-dialog__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.up-dialog__desc { margin: 4px 0 0; color: var(--ink-secondary); }
.up-dialog__body { padding: var(--space-4) var(--space-5); }
.up-dialog__footer { display: flex; justify-content: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-5) var(--space-5); }
.up-dialog__close { margin-left: auto; }

/* ---------- empty state / skeleton ---------- */
.up-empty { padding: var(--space-12) var(--space-6); text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); color: var(--ink-secondary); }
.up-empty__icon { width: 44px; height: 44px; border-radius: var(--radius-lg); background: var(--surface-sunken); color: var(--ink-muted); display: grid; place-items: center; margin-bottom: var(--space-2); }
.up-empty__title { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ink); }
.up-empty__text { margin: 0; max-width: 420px; }
.up-empty__actions { margin-top: var(--space-3); display: flex; gap: var(--space-2); }
.up-skeleton { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--surface-hover) 50%, var(--surface-sunken) 75%); background-size: 200% 100%; animation: up-shimmer 1.4s ease-in-out infinite; }
@keyframes up-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- breadcrumb ---------- */
.up-breadcrumb { display: flex; align-items: center; gap: var(--space-2); font-size: 13px; line-height: 18px; color: var(--ink-muted); list-style: none; margin: 0; padding: 0; }
.up-breadcrumb li { display: inline-flex; align-items: center; gap: var(--space-2); }
.up-breadcrumb li + li::before { content: "/"; color: var(--line-strong); }
.up-breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.up-breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.up-breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* ---------- description list ---------- */
.up-dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-6); margin: 0; }
.up-dl dt { font-size: 13px; line-height: 20px; color: var(--ink-muted); font-weight: 500; }
.up-dl dd { margin: 0; color: var(--ink); line-height: 20px; }
.up-dl--rows { grid-template-columns: 1fr; gap: var(--space-3); }
.up-dl--rows dt { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; line-height: 16px; }
.up-dl--bordered dt, .up-dl--bordered dd { padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }

/* ---------- avatar ---------- */
.up-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font-size: 12px; font-weight: 700; letter-spacing: 0.02em; flex: none; }
.up-avatar--sm { width: 24px; height: 24px; font-size: 10px; }
.up-avatar--lg { width: 40px; height: 40px; font-size: 14px; }
.up-avatar--shell { background: var(--shell-active); color: var(--shell-ink); }
.up-avatar--agent { background: var(--primary); color: var(--ink-on-fill); border-radius: var(--radius-md); }

/* ---------- stepper ---------- */
.up-stepper { display: flex; align-items: center; gap: 0; counter-reset: step; }
.up-step { display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: 0; }
.up-step__dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; background: var(--surface-sunken); color: var(--ink-muted); border: 1px solid var(--line); flex: none; }
.up-step__label { font-size: 13px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-step__line { flex: 1; height: 1px; background: var(--line); margin: 0 var(--space-2); min-width: 16px; }
.up-step.is-done .up-step__dot { background: var(--success); color: var(--ink-on-fill); border-color: var(--success); }
.up-step.is-done .up-step__line { background: var(--success); }
.up-step.is-active .up-step__dot { background: var(--primary); color: var(--ink-on-fill); border-color: var(--primary); }
.up-step.is-active .up-step__label { color: var(--ink); font-weight: 600; }
.up-step:last-child .up-step__line { display: none; }

/* ---------- code block ---------- */
.up-code { background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.up-code__bar { display: flex; align-items: center; gap: var(--space-1); padding: 4px var(--space-2); border-bottom: 1px solid var(--line); }
.up-code__lang { height: 28px; padding: 0 10px; border: 0; background: transparent; color: var(--ink-muted); font: inherit; font-size: 13px; border-radius: var(--radius-sm); cursor: pointer; }
.up-code__lang:hover { color: var(--ink); }
.up-code__lang.is-active { color: var(--ink); font-weight: 600; background: var(--surface-raised); }
.up-code__copy { margin-left: auto; }
.up-code pre { margin: 0; padding: var(--space-4); font-family: var(--font-mono); font-size: 13px; line-height: 20px; color: var(--ink); overflow-x: auto; white-space: pre; }
.up-code .tok-c { color: var(--ink-muted); } .up-code .tok-s { color: var(--success-ink); } .up-code .tok-k { color: var(--primary-ink); } .up-code .tok-v { color: var(--warning-ink); }
.up-inline-code, .up-root code:not(pre code) { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-sunken); border: 1px solid var(--line); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
.up-secret { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-mono); font-size: 13px; padding: 8px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-raised); }
.up-secret .up-btn { margin-left: auto; }

/* ---------- auth ---------- */
.up-auth { min-height: 100%; display: grid; grid-template-columns: 1fr 1fr; font-family: var(--font-sans); font-size: 14px; line-height: 20px; color: var(--ink); background: var(--surface); -webkit-font-smoothing: antialiased; }
.up-auth__brand { background: var(--shell); color: var(--shell-ink); padding: var(--space-10); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.up-auth__brand-top { display: flex; align-items: center; gap: var(--space-3); }
.up-auth__brand-name { font-weight: 600; font-size: 15px; }
.up-auth__brand-sub { color: var(--shell-ink-muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.up-auth__headline { font-size: 32px; line-height: 40px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 var(--space-3); max-width: 420px; }
.up-auth__lede { color: var(--shell-ink-muted); max-width: 420px; margin: 0; font-size: 15px; line-height: 22px; }
.up-auth__products { display: flex; gap: var(--space-2); margin-top: var(--space-6); flex-wrap: wrap; }
.up-auth__product { display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 10px 6px 6px; border-radius: var(--radius-md); background: var(--shell-raised); color: var(--shell-ink); font-size: 13px; font-weight: 600; }
.up-auth__product .up-mark { width: 20px; height: 20px; font-size: 10px; border-radius: 4px; color: #0f1216; }
.up-auth__legal { color: var(--shell-ink-muted); font-size: 12px; }
.up-auth__pane { display: flex; align-items: center; justify-content: center; padding: var(--space-10) var(--space-6); }
.up-auth__card { width: var(--auth-card-width); max-width: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-xl); padding: var(--space-8); display: flex; flex-direction: column; gap: var(--space-5); }
.up-auth__title { margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.015em; }
.up-auth__sub { margin: 4px 0 0; color: var(--ink-secondary); }
.up-auth__sep { display: flex; align-items: center; gap: var(--space-3); color: var(--ink-muted); font-size: 12px; }
.up-auth__sep::before, .up-auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.up-auth__foot { text-align: center; font-size: 13px; color: var(--ink-muted); }
.up-auth__status-icon { width: 44px; height: 44px; border-radius: var(--radius-lg); display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); }
.up-auth__status-icon--success { background: var(--success-soft); color: var(--success-ink); }
.up-auth__status-icon--danger { background: var(--danger-soft); color: var(--danger-ink); }
.up-otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--space-2); }
.up-otp input { height: 48px; text-align: center; font-family: var(--font-mono); font-size: 20px; font-weight: 600; padding: 0; }
.up-countdown { text-align: center; padding: var(--space-4); background: var(--surface-sunken); border-radius: var(--radius-lg); }
.up-countdown__value { font-family: var(--font-mono); font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: 0.02em; }
.up-countdown__label { font-size: 12px; color: var(--ink-muted); }
.up-recovery { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-4); font-family: var(--font-mono); font-size: 14px; padding: var(--space-4); background: var(--surface-sunken); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (max-width: 900px) { .up-auth { grid-template-columns: 1fr; } .up-auth__brand { display: none; } }

/* ---------- chat ---------- */
.up-chat { display: grid; grid-template-rows: auto 1fr auto; height: 100%; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-xl); overflow: hidden; }
.up-chat__head { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); }
.up-chat__head-title { font-weight: 600; }
.up-chat__log { padding: var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }
.up-msg { display: flex; gap: var(--space-3); max-width: 78%; }
.up-msg--user { align-self: flex-end; flex-direction: row-reverse; }
.up-msg__bubble { padding: 10px 14px; border-radius: var(--radius-lg); background: var(--surface-sunken); color: var(--ink); border: 1px solid var(--line); }
.up-msg--user .up-msg__bubble { background: var(--primary-soft); border-color: transparent; }
.up-msg__meta { font-size: 11px; color: var(--ink-muted); margin-top: 4px; display: flex; gap: var(--space-2); }
.up-msg--user .up-msg__meta { justify-content: flex-end; }
.up-msg__bubble table { border-collapse: collapse; margin-top: var(--space-2); font-size: 13px; }
.up-msg__bubble th, .up-msg__bubble td { padding: 4px 10px; border: 1px solid var(--line); text-align: left; }
.up-msg__bubble th { background: var(--surface-raised); font-weight: 600; font-size: 12px; color: var(--ink-muted); }
.up-msg__bubble .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.up-msg__typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.up-msg__typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-muted); animation: up-pulse 1.2s ease-in-out infinite; }
.up-msg__typing i:nth-child(2) { animation-delay: .2s; } .up-msg__typing i:nth-child(3) { animation-delay: .4s; }
.up-chat__composer { display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--line); }
.up-chat__composer .up-textarea { min-height: 44px; max-height: 160px; }
.up-attachment { display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-raised); font-size: 13px; }
.up-attachment__meta { color: var(--ink-muted); font-size: 12px; }
.up-source-line { font-size: 12px; color: var(--ink-muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.up-source-line::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.up-source-line--stale::before { background: var(--warning); }

/* ---------- filter bar ---------- */
.up-filterbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }
.up-filterbar .up-input, .up-filterbar .up-select { height: var(--control-height-sm); font-size: 13px; width: auto; }
.up-filterbar__label { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); margin-right: 2px; }

/* ---------- utilities for previews ---------- */
.up-preview-pad { padding: var(--space-5); }
.up-preview-grid { display: grid; gap: var(--space-4); }
