:root {
    --tbos-smart-blue: #0d47a1;
    --tbos-smart-blue-deep: #062a63;
    --tbos-smart-cyan: #23b9ff;
    --tbos-smart-gold: #f5b51b;
    --tbos-smart-green: #1aa77a;
    --tbos-smart-red: #d64545;
    --tbos-smart-ink: #102744;
    --tbos-smart-muted: #617591;
    --tbos-smart-surface: rgba(255, 255, 255, .96);
    --tbos-smart-border: rgba(17, 75, 145, .16);
    --tbos-smart-shadow: 0 24px 70px rgba(5, 35, 82, .22);
}

.tbos-smart-experience body {
    position: relative;
    isolation: isolate;
}

.tbos-smart-ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.tbos-smart-orb {
    position: absolute;
    width: min(46vw, 680px);
    height: min(46vw, 680px);
    border-radius: 50%;
    filter: blur(70px);
    opacity: .12;
    animation: tbos-smart-orbit 18s ease-in-out infinite alternate;
}

.tbos-smart-orb.orb-one {
    top: -18%;
    left: -12%;
    background: radial-gradient(circle, var(--tbos-smart-cyan), transparent 68%);
}

.tbos-smart-orb.orb-two {
    right: -12%;
    bottom: -22%;
    background: radial-gradient(circle, var(--tbos-smart-gold), transparent 68%);
    animation-delay: -7s;
    animation-duration: 22s;
}

.tbos-smart-grid {
    position: absolute;
    inset: 0;
    opacity: .025;
    background-image:
        linear-gradient(rgba(13, 71, 161, .7) 1px, transparent 1px),
        linear-gradient(90deg, rgba(13, 71, 161, .7) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 75%, transparent);
}

.tbos-smart-health-chip,
.tbos-smart-assistant-launcher {
    position: fixed;
    z-index: 2147482950;
    border: 0;
    font: inherit;
    cursor: pointer;
    box-shadow: 0 16px 38px rgba(4, 35, 78, .24);
}

.tbos-smart-health-chip {
    left: 20px;
    bottom: 78px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #53657d, #2d4059);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .01em;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.tbos-smart-health-chip:hover,
.tbos-smart-health-chip:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(4, 35, 78, .32);
    outline: 3px solid rgba(35, 185, 255, .25);
    outline-offset: 2px;
}

.tbos-smart-health-chip.healthy {
    background: linear-gradient(135deg, #13845f, #0c6548);
}

.tbos-smart-health-chip.warning {
    color: #3e2b00;
    background: linear-gradient(135deg, #ffd669, #f1ad16);
}

.tbos-smart-health-chip.danger {
    background: linear-gradient(135deg, #d64b4b, #9d2424);
}

.tbos-smart-health-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 0 currentColor;
    animation: tbos-smart-pulse-ring 2s ease-out infinite;
}

.tbos-smart-assistant-launcher {
    left: 18px;
    bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 50px;
    padding: 10px 18px 10px 12px;
    overflow: hidden;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, var(--tbos-smart-blue-deep), var(--tbos-smart-blue) 58%, #147bd1);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .02em;
    transition: transform .22s ease, box-shadow .22s ease;
}

.tbos-smart-assistant-launcher:hover,
.tbos-smart-assistant-launcher:focus-visible {
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 22px 50px rgba(4, 35, 78, .36);
    outline: 3px solid rgba(35, 185, 255, .28);
    outline-offset: 2px;
}

.tbos-smart-launcher-icon {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #05295d;
    background: linear-gradient(135deg, #fff7c5, var(--tbos-smart-gold));
    font-size: 17px;
    box-shadow: 0 0 20px rgba(245, 181, 27, .48);
}

.tbos-smart-launcher-orbit {
    position: absolute;
    left: 10px;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 50%;
    animation: tbos-smart-rotate 5s linear infinite;
}

.tbos-smart-launcher-orbit::after {
    content: "";
    position: absolute;
    top: -3px;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 8px #fff;
}

.tbos-smart-assistant-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147483200;
    opacity: 0;
    visibility: hidden;
    background: rgba(4, 22, 49, .38);
    backdrop-filter: blur(4px);
    transition: opacity .24s ease, visibility .24s ease;
}

.tbos-smart-assistant-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.tbos-smart-assistant-panel {
    position: fixed;
    top: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 2147483210;
    width: min(430px, calc(100vw - 28px));
    padding: 20px;
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 25px;
    color: var(--tbos-smart-ink);
    background:
        linear-gradient(145deg, rgba(255,255,255,.99), rgba(240,247,255,.97)),
        var(--tbos-smart-surface);
    box-shadow: var(--tbos-smart-shadow);
    transform: translateX(calc(100% + 40px));
    opacity: .2;
    transition: transform .34s cubic-bezier(.2,.8,.2,1), opacity .25s ease;
}

.tbos-smart-assistant-panel.is-open {
    transform: translateX(0);
    opacity: 1;
}

.tbos-smart-assistant-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tbos-smart-eyebrow {
    display: block;
    margin-bottom: 4px;
    color: var(--tbos-smart-blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
}

.tbos-smart-assistant-header h2 {
    margin: 0;
    color: #08264a;
    font-size: clamp(20px, 3vw, 28px);
    line-height: 1.08;
}

.tbos-smart-assistant-close {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--tbos-smart-border);
    border-radius: 12px;
    color: #28496d;
    background: #fff;
    font-size: 25px;
    cursor: pointer;
}

.tbos-smart-assistant-close:hover,
.tbos-smart-assistant-close:focus-visible {
    color: #fff;
    background: var(--tbos-smart-blue);
    outline: none;
}

.tbos-smart-assistant-hero {
    position: relative;
    padding: 18px;
    overflow: hidden;
    border-radius: 19px;
    color: #fff;
    background: linear-gradient(135deg, #072b61, #0d51a9 60%, #1689d8);
    box-shadow: 0 16px 34px rgba(8, 62, 128, .24);
}

.tbos-smart-assistant-hero::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    right: -70px;
    top: -80px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 50%;
    box-shadow: 0 0 0 22px rgba(255,255,255,.04), 0 0 0 48px rgba(255,255,255,.03);
    animation: tbos-smart-breathe 4.8s ease-in-out infinite;
}

.tbos-smart-assistant-hero h3 {
    position: relative;
    z-index: 1;
    margin: 12px 0 6px;
    font-size: 18px;
}

.tbos-smart-assistant-hero p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: rgba(255,255,255,.86);
    font-size: 13px;
    line-height: 1.55;
}

.tbos-smart-assistant-status {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tbos-smart-assistant-status.healthy::before,
.tbos-smart-assistant-status.warning::before,
.tbos-smart-assistant-status.danger::before,
.tbos-smart-assistant-status.checking::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: #fff;
}

.tbos-smart-assistant-status.healthy::before { background: #67f0ba; }
.tbos-smart-assistant-status.warning::before { background: #ffd25f; }
.tbos-smart-assistant-status.danger::before { background: #ff8383; }

.tbos-smart-assistant-card {
    margin-top: 13px;
    padding: 15px;
    border: 1px solid var(--tbos-smart-border);
    border-radius: 17px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 10px 26px rgba(16, 52, 94, .08);
}

.tbos-smart-assistant-card.compact {
    padding-bottom: 11px;
}

.tbos-smart-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #123c6e;
    font-size: 13px;
}

.tbos-smart-card-title > span {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--tbos-smart-blue), var(--tbos-smart-cyan));
}

.tbos-smart-assistant-card p {
    margin: 10px 0 12px;
    color: var(--tbos-smart-muted);
    font-size: 12px;
    line-height: 1.5;
}

.tbos-smart-action {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(13, 71, 161, .22);
    border-radius: 11px;
    color: var(--tbos-smart-blue);
    background: #f6faff;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.tbos-smart-action.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--tbos-smart-blue-deep), var(--tbos-smart-blue));
}

.tbos-smart-action:hover,
.tbos-smart-action:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(13, 71, 161, .16);
    outline: none;
}

.tbos-smart-assistant-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 13px;
}

.tbos-smart-assistant-footer {
    margin-top: 15px;
    padding: 10px 4px 0;
    color: #71839b;
    font-size: 10px;
    line-height: 1.45;
    text-align: center;
}

.tbos-smart-quality-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    margin: 0 0 9px;
    padding: 5px 10px;
    border: 1px solid rgba(13, 71, 161, .16);
    border-radius: 999px;
    color: #0f6048;
    background: #eafaf4;
    font: inherit;
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.tbos-smart-quality-badge.warning {
    color: #7a4700;
    background: #fff4d7;
    border-color: rgba(194, 118, 0, .22);
}

tr.tbos-smart-watch-row > td {
    background-image: linear-gradient(90deg, rgba(255, 181, 27, .10), rgba(255, 255, 255, 0));
}

tr.tbos-smart-watch-row > td:first-child {
    box-shadow: inset 3px 0 0 var(--tbos-smart-gold);
}

tr.tbos-smart-duplicate-row > td:first-child {
    box-shadow: inset 3px 0 0 var(--tbos-smart-red);
}

.tbos-smart-form-meter {
    position: fixed;
    left: 18px;
    bottom: 132px;
    z-index: 2147482870;
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 210px;
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #8b3c3c, #b84a4a);
    box-shadow: 0 14px 34px rgba(5, 35, 82, .22);
    font-size: 10px;
    font-weight: 800;
    transition: background .2s ease, transform .2s ease;
}

.tbos-smart-form-meter.warning {
    color: #4b3300;
    background: linear-gradient(135deg, #ffd873, #f2b528);
}

.tbos-smart-form-meter.healthy {
    background: linear-gradient(135deg, #168d65, #0b6849);
}

.tbos-smart-form-meter-track {
    width: 72px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.28);
}

.tbos-smart-form-meter-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: currentColor;
    transition: width .28s ease;
}

.tbos-smart-toast-region {
    position: fixed;
    top: 18px;
    left: 50%;
    z-index: 2147483300;
    display: grid;
    gap: 9px;
    width: min(520px, calc(100vw - 28px));
    transform: translateX(-50%);
    pointer-events: none;
}

.tbos-smart-toast {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 15px;
    color: #163456;
    background: rgba(255,255,255,.97);
    box-shadow: 0 16px 44px rgba(5, 35, 82, .22);
    opacity: 0;
    transform: translateY(-12px) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

.tbos-smart-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tbos-smart-toast.is-leaving {
    opacity: 0;
    transform: translateY(-9px) scale(.98);
}

.tbos-smart-toast-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    color: #fff;
    background: var(--tbos-smart-blue);
    font-weight: 900;
}

.tbos-smart-toast.success .tbos-smart-toast-icon { background: var(--tbos-smart-green); }
.tbos-smart-toast.warning .tbos-smart-toast-icon { color: #543700; background: var(--tbos-smart-gold); }
.tbos-smart-toast.danger .tbos-smart-toast-icon { background: var(--tbos-smart-red); }

.tbos-smart-toast-message {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.42;
}

.tbos-smart-toast-close {
    border: 0;
    color: #6f8096;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
}

.tbos-smart-card-motion {
    --smart-rotate-x: 0deg;
    --smart-rotate-y: 0deg;
    --smart-glow-x: 50%;
    --smart-glow-y: 50%;
    position: relative;
    transform: perspective(1000px) rotateX(var(--smart-rotate-x)) rotateY(var(--smart-rotate-y));
    transform-style: preserve-3d;
    transition: transform .18s ease, box-shadow .2s ease;
}

.tbos-smart-card-motion::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--smart-glow-x) var(--smart-glow-y), rgba(35, 185, 255, .14), transparent 42%);
    transition: opacity .2s ease;
}

.tbos-smart-card-motion:hover::before {
    opacity: 1;
}

.tbos-smart-card-motion > * {
    position: relative;
    z-index: 1;
}

.tbos-smart-motion-paused *,
.tbos-smart-motion-paused *::before,
.tbos-smart-motion-paused *::after {
    animation-play-state: paused !important;
}

.tbos-smart-focus-mode .sidebar,
.tbos-smart-focus-mode .side-nav,
.tbos-smart-focus-mode nav:not(.tbos-command-box),
.tbos-smart-focus-mode .tbos-smart-launcher,
.tbos-smart-focus-mode .tbos-scroll-top {
    opacity: .14 !important;
    filter: grayscale(.8);
    transition: opacity .2s ease;
}

.tbos-smart-focus-mode .sidebar:hover,
.tbos-smart-focus-mode .side-nav:hover,
.tbos-smart-focus-mode nav:hover {
    opacity: 1 !important;
    filter: none;
}

@keyframes tbos-smart-orbit {
    0% { transform: translate3d(-2%, -1%, 0) scale(.95); }
    100% { transform: translate3d(10%, 8%, 0) scale(1.12); }
}

@keyframes tbos-smart-rotate {
    to { transform: rotate(360deg); }
}

@keyframes tbos-smart-pulse-ring {
    0% { box-shadow: 0 0 0 0 currentColor; }
    70% { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes tbos-smart-breathe {
    0%, 100% { transform: scale(.95); opacity: .72; }
    50% { transform: scale(1.08); opacity: 1; }
}

@media (max-width: 760px) {
    .tbos-smart-health-chip {
        left: 11px;
        right: auto;
        bottom: 68px;
    }

    .tbos-smart-assistant-launcher {
        left: 11px;
        right: auto;
        bottom: 10px;
        width: 50px;
        height: 50px;
        padding: 9px;
    }

    .tbos-smart-launcher-text {
        display: none;
    }

    .tbos-smart-form-meter {
        left: 10px;
        bottom: 116px;
        min-width: 0;
        max-width: calc(100vw - 82px);
    }

    .tbos-smart-form-meter-label {
        display: none;
    }

    .tbos-smart-assistant-panel {
        top: 8px;
        right: 8px;
        bottom: 8px;
        width: calc(100vw - 16px);
        padding: 16px;
        border-radius: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tbos-smart-orb,
    .tbos-smart-launcher-orbit,
    .tbos-smart-health-dot,
    .tbos-smart-assistant-hero::after {
        animation: none !important;
    }

    .tbos-smart-card-motion {
        transform: none !important;
    }
}

@media print {
    .tbos-smart-ambient,
    .tbos-smart-health-chip,
    .tbos-smart-assistant-launcher,
    .tbos-smart-assistant-backdrop,
    .tbos-smart-assistant-panel,
    .tbos-smart-form-meter,
    .tbos-smart-toast-region,
    .tbos-smart-quality-badge {
        display: none !important;
    }

    tr.tbos-smart-watch-row > td,
    tr.tbos-smart-duplicate-row > td {
        background: transparent !important;
        box-shadow: none !important;
    }
}
