:root {
    color-scheme: dark;
    --oc-canvas: #07080a;
    --oc-surface: #131418;
    --oc-raised: #17181c;
    --oc-hover: #1a1c22;
    --oc-well: #0e0f13;
    --oc-border: rgba(255, 255, 255, .08);
    --oc-border-strong: #30333d;
    --oc-text: #f4f4f5;
    --oc-muted: #a1a1ad;
    --oc-subtle: #858593;
    --oc-crimson: #ef4444;
    --oc-success: #10b981;
    --oc-warning: #f59e0b;
    --oc-danger: #f43f5e;
    --oc-info: #06b6d4;
    --oc-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    --oc-shadow: 0 18px 48px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .025);
    --oc-focus: 0 0 0 3px rgba(239, 68, 68, .2);
    --bg: var(--oc-canvas);
    --surface-1: #0b0c0e;
    --surface-2: var(--oc-surface);
    --surface-3: var(--oc-well);
    --surface-4: var(--oc-raised);
    --border: var(--oc-border);
    --text: var(--oc-text);
    --text-muted: var(--oc-muted);
    --font-mono: var(--oc-mono);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

[x-cloak] {
    display: none !important;
}

body {
    background-color: var(--oc-canvas);
    color: var(--oc-text);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
summary,
a {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
summary {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
}

:where(button, a, summary, input, textarea, select):focus-visible {
    outline: 2px solid var(--oc-crimson);
    outline-offset: 3px;
}

::selection {
    color: #fff;
    background: #963039;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #353741 #090a0d;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #090a0d;
}

::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #353741;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--oc-crimson);
}

.credential-text,
.mono-code,
.raw-token,
.table-cell-mono,
.order-result-list code,
.tool-result-list code {
    min-width: 0;
    font-family: var(--oc-mono);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-all;
}

.oc-input,
.oc-textarea,
.oc-select {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--oc-border);
    border-radius: 12px;
    background: var(--oc-well);
    color: var(--oc-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.oc-input:focus,
.oc-textarea:focus,
.oc-select:focus {
    border-color: var(--oc-crimson);
    outline: none;
    box-shadow: var(--oc-focus);
}

.btn-crimson {
    min-height: 48px;
    padding: 12px 20px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    font-weight: 650;
    box-shadow: 0 4px 14px rgba(239, 68, 68, .22);
    transition: transform .15s ease, box-shadow .15s ease;
}

.btn-crimson:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, .35);
}

.btn-crimson:active:not(:disabled) {
    transform: scale(.98);
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

body.min-h-screen {
    margin: 0;
    background-color: var(--oc-canvas) !important;
}

body > .min-h-screen {
    display: flex;
    min-height: 100dvh;
}

body > .min-h-screen > aside {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    width: 244px;
    height: 100dvh;
    flex: 0 0 244px;
    flex-direction: column;
    padding: 16px;
    border-right: 1px solid var(--oc-border);
    background: #0b0c0e !important;
}

body > .min-h-screen > aside > nav {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

body > .min-h-screen > aside > .sso-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

body > .min-h-screen > aside > div:last-child {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--oc-border);
    border-radius: 14px;
    font-size: 12px;
}

body > .min-h-screen > aside > div:last-child > div:nth-child(2) {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    font-size: 10px;
}

body > .min-h-screen > aside > div:last-child > div:nth-child(2) span {
    padding: 4px 8px;
    border-radius: 99px;
}

body > .min-h-screen > aside > div:last-child > a {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    color: var(--oc-muted) !important;
    font-size: 11px;
}

body > .min-h-screen > aside > div:last-child > a svg {
    width: 16px;
    height: 16px;
}

body > .min-h-screen > .min-w-0 {
    min-width: 0;
    flex: 1;
}

body > .min-h-screen > .min-w-0 > header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--oc-border);
    background: rgba(11, 12, 14, .92) !important;
    backdrop-filter: blur(14px);
}

body > .min-h-screen > .min-w-0 > header > div {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 28px;
}

body > .min-h-screen > .min-w-0 > header > div > .sso-icon-button {
    display: none;
}

body > .min-h-screen > .min-w-0 > header > div > div:first-of-type {
    display: block;
    min-width: 0;
}

body > .min-h-screen > .min-w-0 > header p {
    margin: 0 0 3px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .12em;
    text-transform: uppercase;
}

body > .min-h-screen > .min-w-0 > header h1 {
    margin: 0;
    color: var(--oc-text);
    font-size: 14px;
    font-weight: 650;
}

body > .min-h-screen > .min-w-0 > header > div > div:last-child {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.sso-wallet-chip {
    display: grid;
    gap: 3px;
    padding: 9px 16px;
    border: 1px solid #ef444433;
    border-radius: 10px;
    text-align: right;
}

.sso-wallet-chip > span { font-size: 9px; }
.sso-wallet-chip > strong { font-size: 14px; }
.sso-locale-button { display: grid; min-width: 42px; min-height: 44px; place-items: center; font-size: 11px; }

body > .min-h-screen > .min-w-0 > main {
    position: relative;
    width: 100%;
    max-width: 1440px;
    margin-inline: auto;
    padding: 28px 28px 80px;
}

@media (min-width: 1024px) {
    body > .min-h-screen > aside { transform: none; }
}

@media (max-width: 1023px) {
    body > .min-h-screen > aside {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(292px, calc(100vw - 40px));
        transition: transform .2s ease;
    }
    body > .min-h-screen > aside:not(.translate-x-0) { transform: translateX(-100%); }
    body > .min-h-screen > aside.translate-x-0 { transform: translateX(0); }
    body > .min-h-screen > [x-show=sidebar] { position: fixed; inset: 0; z-index: 40; background: #000d; backdrop-filter: blur(12px); }
    body > .min-h-screen > .min-w-0 > header > div { padding-inline: 20px; }
    body > .min-h-screen > .min-w-0 > header > div > .sso-icon-button { display: grid; width: 44px; height: 44px; place-items: center; }
    body > .min-h-screen > .min-w-0 > header > div > div:first-of-type { display: none; }
    body > .min-h-screen > .min-w-0 > main { padding: 24px 24px 72px; }
}

@media (max-width: 639px) {
    body > .min-h-screen > .min-w-0 > header > div { min-height: 68px; padding-inline: 16px; }
    body > .min-h-screen > .min-w-0 > main { padding: 18px 16px 56px; }
    html:has(.boost-page) { scroll-padding-bottom: 280px; }
}

:is(.boost-page, .tool-console, .tool-humanize-dialog, .boost-humanize-dialog, .orders-page, .order-dialog, .settings-console, .ticket-workspace, .dashboard-actions) button {
    border-radius: 12px !important;
}

:is(.boost-page, .tool-console, .tool-humanize-dialog, .boost-humanize-dialog, .settings-console, .ticket-workspace) :is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]), textarea, select) {
    border-color: var(--oc-border) !important;
    border-radius: 12px !important;
    background-color: var(--oc-well) !important;
    color: var(--oc-text) !important;
}

:is(.boost-page, .tool-console, .tool-humanize-dialog, .boost-humanize-dialog, .settings-console, .ticket-workspace) :is(input, textarea, select):focus {
    border-color: var(--oc-crimson) !important;
    box-shadow: var(--oc-focus) !important;
}

:is(.boost-page, .tool-console, .ticket-workspace) :is(.boost-submit, .tool-checkout > button, .ticket-primary-button, .ticket-send-button) {
    border-color: #f36b6b !important;
    background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
    color: #fff !important;
    box-shadow: 0 6px 18px #ef444430 !important;
}

:is(.boost-page, .tool-console, .ticket-workspace) :is(.boost-submit, .tool-checkout > button, .ticket-primary-button, .ticket-send-button):hover:not(:disabled) {
    background: linear-gradient(135deg, #f45b5b, #cc2525) !important;
    box-shadow: 0 8px 24px #ef44444d !important;
}

:is(.boost-page, .tool-console, .ticket-workspace) :is(.boost-submit, .tool-checkout > button, .ticket-primary-button, .ticket-send-button):disabled {
    border-color: #30333d !important;
    background: #25262e !important;
    color: #a1a1ad !important;
    box-shadow: none !important;
}

@keyframes oc-shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

@keyframes oc-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .25); }
    50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
