/* tcui.css */
/* TC UI tokens. Components use only these variables, so they follow the page they sit on:
   the admin theme (light/dark: --background, --card...), the public site (--tc-*), or EasyUI's own dark defaults. */
:root {
    --tcui-bg: var(--background, var(--tc-paper, #151515));
    --tcui-surface: var(--card, var(--tc-surface, #202020));
    --tcui-raised: var(--muted, var(--tc-paper, #2a2a2a));
    --tcui-border: var(--border, var(--tc-line, rgba(255, 255, 255, 0.08)));
    --tcui-border-strong: var(--border-strong, var(--tc-line-strong, rgba(255, 255, 255, 0.16)));
    --tcui-text: var(--foreground, var(--tc-ink, #ededed));
    --tcui-text-2: var(--muted-foreground, var(--tc-ink-2, #a1a1a1));
    --tcui-primary: var(--primary, var(--tc-ink, #ededed));
    --tcui-primary-fg: var(--primary-foreground, var(--tc-on-ink, #ffffff));
    --tcui-accent: #f5a623;          /* TrustCheck amber */
    --tcui-accent-fg: #15140f;
    --tcui-success: #22c55e;
    --tcui-warning: #f59e0b;
    --tcui-danger: var(--destructive, #ef4444);
    --tcui-info: #3b82f6;
    --tcui-ring: var(--ring, #a1a1aa);
    --tcui-radius-sm: 8px;
    --tcui-radius: 12px;
    --tcui-radius-lg: 16px;
    --tcui-radius-xl: 20px;
    --tcui-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px -12px rgba(0, 0, 0, 0.25);
    --tcui-shadow-lg: 0 24px 48px -16px rgba(0, 0, 0, 0.4);
    --tcui-font: var(--font, var(--tc-font, "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif));
    --tcui-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
    --tcui-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --tcui-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

.tcui-icon { display: inline-block; flex: none; vertical-align: middle; }
.tcui-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; }
[data-tcui] { font-family: var(--tcui-font); box-sizing: border-box; }
[data-tcui] *, [data-tcui] *::before, [data-tcui] *::after { box-sizing: border-box; }
[data-tcui] :focus-visible { outline: 2px solid var(--tcui-ring); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    [data-tcui] *, [data-tcui] *::before, [data-tcui] *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* The legacy admin app.css paints white text on ANY element whose class contains "bg" (*[class*='bg']).
   Same specificity, loaded later, so components inherit their colour again; their own rules (loaded after this file) still win. */
[data-tcui] :where([class*='bg']) { color: inherit; }

/* Badges keep their final box before the component starts (inline-flex, 24px pill), so a margin or the pill height
   never appears late and moves the page (Lighthouse CLS). Matches .tcui-bd in components/badge. */
[data-tcui="badge"]:not([data-tcui-ready]) { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; line-height: 1; white-space: nowrap; vertical-align: middle; }

/* animated-number.css */
.tcui-an { display: inline-flex; align-items: baseline; font-family: var(--tcui-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; color: inherit; user-select: none; }
.tcui-an-prefix { margin-right: 0.08em; }
.tcui-an-suffix { margin-left: 0.08em; }
.tcui-an-row { display: inline-flex; align-items: baseline; overflow: hidden; }
.tcui-an-col { position: relative; display: inline-block; overflow: hidden; height: 1.15em; line-height: 1.15em; width: 1ch; text-align: center; }
.tcui-an-strip { display: flex; flex-direction: column; will-change: transform; }
.tcui-an-digit { display: flex; align-items: center; justify-content: center; height: 1.15em; }
.tcui-an-sep { display: inline-block; margin: 0 -0.06em; }

/* animated-tabs.css */
/* Animated Tabs (EasyUI AnimatedTabs port) */
.tcui-at { display: flex; flex-direction: column; gap: 16px; color: var(--tcui-text); }
.tcui-at-list { position: relative; display: flex; align-items: center; gap: 4px; align-self: flex-start; padding: 4px; border-radius: 10px; background: var(--tcui-raised); border: 1px solid var(--tcui-border); user-select: none; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tcui-at--glass .tcui-at-list { border-radius: 999px; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
.tcui-at-ind { position: absolute; left: 0; top: 0; border-radius: 6px; background: var(--tcui-surface); border: 1px solid var(--tcui-border-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .06); will-change: transform, width; pointer-events: none; }
.tcui-at--glass .tcui-at-ind { border-radius: 999px; }
.tcui-at-tab { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 14px; border: 0; border-radius: 6px; background: transparent; font: inherit; font-size: 12px; font-weight: 500; color: var(--tcui-text-2); cursor: pointer; white-space: nowrap; transition: color .2s var(--tcui-ease); }
.tcui-at--glass .tcui-at-tab { padding: 6px 16px; border-radius: 999px; }
.tcui-at-tab:hover { color: var(--tcui-text); }
.tcui-at-tab.is-active { color: var(--tcui-text); }
@media (min-width: 640px) { .tcui-at-tab { font-size: 14px; } }
.tcui-at-label { position: relative; display: flex; align-items: center; gap: 6px; }
.tcui-at-icon { display: inline-flex; }
.tcui-at-badge { padding: 2px 6px; font-family: var(--tcui-mono); font-size: 10px; line-height: 1.2; border-radius: 4px; background: var(--tcui-raised); border: 1px solid var(--tcui-border); color: var(--tcui-text-2); }
.tcui-at-panels { position: relative; min-height: 60px; }
.tcui-at-panels[hidden], .tcui-at-panel[hidden] { display: none; }
.tcui-at-panel { font-size: 14px; color: var(--tcui-text-2); will-change: transform, opacity; }

/* badge.css */
/* Badge (port of EasyUI badge.tsx) */
.tcui-bd { --tcui-bd-c: var(--tcui-text-2); position: relative; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; vertical-align: middle; }
.tcui-bd--removable { padding-right: 6px; }
.tcui-bd--success { --tcui-bd-c: var(--tcui-success); }
.tcui-bd--warning { --tcui-bd-c: var(--tcui-warning); }
.tcui-bd--danger { --tcui-bd-c: var(--tcui-danger); }
/* soft */
.tcui-bd--soft.tcui-bd--neutral { background: var(--tcui-raised); color: var(--tcui-text); }
.tcui-bd--soft:not(.tcui-bd--neutral) { background: color-mix(in srgb, var(--tcui-bd-c) 12%, transparent); color: color-mix(in srgb, var(--tcui-bd-c) 52%, var(--tcui-text)); } /* 52%: 4.5:1 contrast on light grounds */
/* solid */
.tcui-bd--solid.tcui-bd--neutral { background: var(--tcui-text); color: var(--tcui-bg); }
.tcui-bd--solid.tcui-bd--success { background: #047857; color: #fff; } /* 5.5:1 with white text */
.tcui-bd--solid.tcui-bd--warning { background: #f59e0b; color: #451a03; }
.tcui-bd--solid.tcui-bd--danger { background: #dc2626; color: #fff; }
/* outline */
.tcui-bd--outline.tcui-bd--neutral { border-color: var(--tcui-border-strong); color: var(--tcui-text); }
.tcui-bd--outline:not(.tcui-bd--neutral) { border-color: color-mix(in srgb, var(--tcui-bd-c) 38%, transparent); color: color-mix(in srgb, var(--tcui-bd-c) 72%, var(--tcui-text)); }

.tcui-bd-dotwrap { position: relative; display: flex; flex: none; width: 6px; height: 6px; }
.tcui-bd-dotwrap[hidden] { display: none; }
.tcui-bd-dot, .tcui-bd-ping { border-radius: 999px; background: var(--tcui-bd-c); }
.tcui-bd--neutral .tcui-bd-dot, .tcui-bd--neutral .tcui-bd-ping { background: #a3a3a3; }
.tcui-bd--solid .tcui-bd-dot, .tcui-bd--solid .tcui-bd-ping { background: currentColor; }
.tcui-bd-dot { position: relative; width: 6px; height: 6px; }
.tcui-bd-ping { position: absolute; inset: 0; opacity: 0.6; animation: tcui-bd-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
.tcui-bd-ping[hidden] { display: none; }
@keyframes tcui-bd-ping { 75%, 100% { transform: scale(2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tcui-bd-ping { animation: none; } }

.tcui-bd-content { display: inline-flex; align-items: center; gap: 4px; }
.tcui-bd-roll { position: relative; display: inline-flex; overflow: hidden; padding: 1px 0; }
.tcui-bd-val { display: inline-block; font-variant-numeric: tabular-nums; will-change: transform; }
.tcui-bd-val--leaving { position: absolute; left: 0; top: 1px; }
.tcui-bd-remove { display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; transition: opacity 0.15s, background-color 0.15s; }
.tcui-bd-remove:hover { opacity: 1; background: color-mix(in srgb, currentColor 15%, transparent); }
.tcui-bd-remove[hidden] { display: none; }
.tcui-bd-remove:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }

/* breadcrumb.css */
/* Breadcrumb (port of EasyUI breadcrumb.tsx) */
.tcui-bc { display: block; }
.tcui-bc-list { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; margin: 0; padding: 0; list-style: none; color: var(--tcui-text-2); font-size: 14px; }
.tcui-bc-item { display: flex; align-items: center; gap: 2px; margin: 0; }
.tcui-bc-sep { display: inline-flex; align-items: center; color: color-mix(in srgb, var(--tcui-text-2) 55%, transparent); }
.tcui-bc-slash { font-size: 14px; padding: 0 2px; }
.tcui-bc-link { position: relative; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 6px; font-size: 14px; color: inherit; text-decoration: none; outline: none; }
.tcui-bc-a { transition: color 0.15s; }
.tcui-bc-a:hover, .tcui-bc-a:focus-visible { color: var(--tcui-text); text-decoration: none; }
.tcui-bc-a:focus-visible { }
.tcui-bc-current { font-weight: 500; color: var(--tcui-text); }
.tcui-bc-body { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; }
.tcui-bc-icon { display: inline-flex; }
.tcui-bc-icon svg { width: 16px; height: 16px; }
.tcui-bc-pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 6px; background: var(--tcui-raised); opacity: 0; pointer-events: none; }
.tcui-bc-pill--on { opacity: 1; }
.tcui-bc-more { display: grid; place-items: center; width: 32px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.tcui-bc-more:hover { background: var(--tcui-raised); color: var(--tcui-text); }
.tcui-bc-more:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tcui-ring) 50%, transparent); }

/* command-menu.css */
.tcui-cm-root { display: contents; }
.tcui-cm-overlay { position: fixed; inset: 0; z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 80px 16px 0; }
.tcui-cm-overlay.is-contained { position: absolute; padding-top: 28px; z-index: 30; }
@media (min-width: 640px) { .tcui-cm-overlay { padding-left: 24px; padding-right: 24px; } }
.tcui-cm-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: opacity 0.2s; }
.tcui-cm-overlay:not(.is-contained) .tcui-cm-backdrop { position: fixed; }
.tcui-cm-panel { position: relative; z-index: 10; width: 100%; max-width: 576px; overflow: hidden; border-radius: 12px; border: 1px solid var(--tcui-border); background: var(--tcui-surface); color: var(--tcui-text); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); will-change: transform, opacity; font-family: var(--tcui-font); }
.tcui-cm-bar { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--tcui-border); }
.tcui-cm-bar > .tcui-icon { margin-right: 10px; color: var(--tcui-text-2); opacity: 0.75; }
.tcui-cm .tcui-cm-input, .tcui-cm-panel .tcui-cm-input { width: 100%; min-width: 0; height: auto; padding: 0 !important; margin: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; font: 16px/1.4 var(--tcui-font); color: var(--tcui-text); outline: none !important; }
.tcui-cm-input::placeholder { color: var(--tcui-text-2); opacity: 0.85; }
.tcui-cm-kbd { flex: none; font: 10px var(--tcui-mono); padding: 2px 6px; border-radius: 4px; background: var(--tcui-raised); border: 1px solid var(--tcui-border); color: var(--tcui-text-2); }
.tcui-cm-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.tcui-cm-items { display: flex; flex-direction: column; gap: 2px; }
.tcui-cm-empty { padding: 32px 0; text-align: center; font-size: 12px; color: var(--tcui-text-2); }
.tcui-cm-item { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 8px 12px; border: 0; border-radius: 6px; background: transparent; font: 12px/1.3 var(--tcui-font); color: var(--tcui-text-2); text-align: left; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.tcui-cm-item:hover { background: color-mix(in srgb, var(--tcui-raised) 55%, transparent); }
.tcui-cm-item.is-selected { background: var(--tcui-raised); color: var(--tcui-text); }
.tcui-cm-left, .tcui-cm-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tcui-cm-right { gap: 8px; flex: none; }
.tcui-cm-left > .tcui-icon { color: var(--tcui-text-2); }
.tcui-cm-item.is-selected .tcui-cm-left > .tcui-icon { color: var(--tcui-text); }
.tcui-cm-title { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcui-cm-cat { margin-left: 4px; font-size: 10px; color: var(--tcui-text-2); opacity: 0.7; white-space: nowrap; }
.tcui-cm-enter { color: var(--tcui-text); }
.tcui-cm-short { font: 10px var(--tcui-mono); padding: 2px 6px; border-radius: 4px; background: var(--tcui-surface); border: 1px solid var(--tcui-border); color: var(--tcui-text-2); }
.tcui-cm-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; border-top: 1px solid var(--tcui-border); font-size: 11px; color: var(--tcui-text-2); }
.tcui-cm-foot > div { display: flex; align-items: center; gap: 12px; }
.tcui-cm-foot span.tcui-cm-hint { display: flex; align-items: center; gap: 4px; }
.tcui-cm-foot kbd { font: 10px var(--tcui-mono); padding: 0 4px; border-radius: 4px; background: var(--tcui-raised); border: 1px solid var(--tcui-border); color: var(--tcui-text-2); box-shadow: none; }
.tcui-cm-overlay.is-contained .tcui-cm-list { max-height: 220px; }

/* sheet.css */
/* Sheet (EasyUI sheet port). The panel lives in a body-level .tcui-sh-layer. */
.tcui-sh-layer { position: fixed; inset: 0; z-index: 1050; font-family: var(--tcui-font); }
.tcui-sh-layer[hidden] { display: none; }
.tcui-sh-layer *, .tcui-sh-layer *::before, .tcui-sh-layer *::after { box-sizing: border-box; }
.tcui-sh-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 10, .3); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); opacity: 0; transition: opacity .2s linear; }
html.dark .tcui-sh-backdrop { background: rgba(0, 0, 0, .6); }
.tcui-sh-layer.is-open .tcui-sh-backdrop { opacity: 1; }
.tcui-sh-panel { position: absolute; display: flex; flex-direction: column; overflow: hidden; background: var(--tcui-surface); color: var(--tcui-text); border: 0 solid var(--tcui-border); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .25); outline: none; will-change: transform; }
.tcui-sh--right { top: 0; bottom: 0; right: 0; height: 100%; width: 88vw; max-width: 26rem; border-left-width: 1px; }
.tcui-sh--left { top: 0; bottom: 0; left: 0; height: 100%; width: 88vw; max-width: 26rem; border-right-width: 1px; }
.tcui-sh--top { top: 0; left: 0; right: 0; margin: 0 auto; max-height: 85dvh; width: 100%; max-width: 32rem; border-radius: 0 0 16px 16px; border-width: 0 1px 1px; }
.tcui-sh--bottom { bottom: 0; left: 0; right: 0; margin: 0 auto; max-height: 85dvh; width: 100%; max-width: 32rem; border-radius: 16px 16px 0 0; border-width: 1px 1px 0; }
.tcui-sh-handle { display: flex; height: 28px; flex: none; align-items: center; justify-content: center; cursor: grab; touch-action: none; }
.tcui-sh-handle:active { cursor: grabbing; }
.tcui-sh-grip { width: 36px; height: 4px; border-radius: 999px; background: var(--tcui-border-strong); }
.tcui-sh-close { position: absolute; right: 12px; top: 12px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--tcui-text-2); cursor: pointer; transition: background-color .15s, color .15s, transform .15s; }
.tcui-sh-close:hover { background: var(--tcui-raised); color: var(--tcui-text); }
.tcui-sh-close:active { transform: scale(.95); }
.tcui-sh-close:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--tcui-ring) 50%, transparent); }
.tcui-sh-header { display: flex; flex-direction: column; gap: 4px; padding: 20px 56px 12px 20px; }
.tcui-sh-panel .tcui-sh-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--tcui-text); }
.tcui-sh-panel .tcui-sh-desc { margin: 0; font-size: 14px; color: var(--tcui-text-2); }
.tcui-sh-body { flex: 1; overflow-y: auto; padding: 8px 20px; font-size: 14px; }
.tcui-sh-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--tcui-border); }

/* skeleton.css */
.tcui-sk { position: relative; display: block; overflow: hidden; border-radius: 6px; background: color-mix(in srgb, var(--tcui-raised) 100%, var(--tcui-text) 4%); }
.tcui-sk-sweep { position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--tcui-bg) 62%, transparent), transparent); animation: tcui-sk-sweep 1.8s infinite; }
@keyframes tcui-sk-sweep {
    0% { transform: translateX(-100%); animation-timing-function: ease-in-out; }
    88.9%, 100% { transform: translateX(100%); }
}
.tcui-sk-avatar { flex: none; border-radius: 9999px; }
.tcui-sk-text { display: flex; flex-direction: column; gap: 10px; }
.tcui-sk-text > .tcui-sk { height: 14px; }
.tcui-sk-reveal-skeleton { animation: tcui-sk-fade 0.12s linear both; }
.tcui-sk-reveal-skeleton.is-leaving { animation: tcui-sk-fadeout 0.12s linear both; }
.tcui-sk-reveal-content { animation: tcui-sk-rise 0.3s cubic-bezier(0.32, 0.72, 0, 1) both; }
@keyframes tcui-sk-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tcui-sk-fadeout { from { opacity: 1; } to { opacity: 0; } }
@keyframes tcui-sk-rise { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } to { opacity: 1; transform: none; filter: blur(0); } }
@media (prefers-reduced-motion: reduce) { .tcui-sk-sweep { animation: none; display: none; } }

/* sparkles-core.css */
/* Sparkles Core (port of EasyUI SparklesCore.tsx, MIT) */
.tcui-spk { position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate; color: var(--tcui-text); opacity: 0; transition: opacity .8s ease-out; }
.tcui-spk.is-ready { opacity: 1; }
.tcui-spk-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.tcui-spk-content { position: relative; z-index: 1; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

