@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500;600;700&family=IBM+Plex+Sans:wght@300;400;500;600;700&display=swap');

/*
 * OBJECT design tokens for ObjectMGMT, read from the UI kit's themes.css
 * (https://themes.apps.object.pl/api/kit/themes.css, linked in App.razor
 * ahead of this file). The kit puts data-theme="light" or "dark" on <html>;
 * the --obj-* names below re-point to the kit tokens of that theme, so the
 * component styles carry no code per theme. Square corners everywhere, no
 * drop shadows: depth comes from 1px teal hairlines and backdrop blur.
 *
 * The app sits on the kit's sheet (--paper) rather than on the teal page.
 * Dark keeps the look the app had when it was dark only: near-black glass
 * cards (--bg-surface, --bg-panel) on the sheet and teal hairlines.
 */
:root,
[data-theme] {
    /* --- Brand --- */
    --obj-teal: var(--paper-teal);
    --obj-orange: var(--color-accent);
    --obj-white: var(--text-on-teal);
    --obj-teal-tint: var(--color-primary-light);

    /* --- Text and lines on the sheet --- */
    --obj-text-main: var(--text-dark);
    --obj-text-muted: var(--paper-text-muted);
    --obj-gray-text: var(--paper-text-muted);
    --obj-gray-border: var(--paper-line);
    --obj-border-heavy: var(--paper-line);
    --obj-border-focus: var(--paper-teal);

    /* --- Surfaces: the sheet over the kit's page colour --- */
    --obj-bg-main: var(--bg-base);
    --obj-page: var(--paper);
    --obj-black: var(--bg-base);
    --obj-hover: var(--paper-card);
    --obj-hover-strong: var(--paper-card-hover);
    --obj-gray-card: var(--obj-bg-card);
    --obj-gray-accent: var(--obj-bg-accent);

    /* --- Typography --- */
    --obj-font-main: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --obj-font-heading: 'IBM Plex Sans', sans-serif;
    --obj-font-mono: 'IBM Plex Mono', monospace;

    /* --- Geometry: square corners are the signature --- */
    --obj-radius: 0px;

    /* --- Visual Effects --- */
    --obj-glass-bg: var(--obj-bg-card);
    --obj-glass-border: var(--obj-border);
    --obj-glass-shadow: none;
    --obj-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --obj-transition-fast: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light: cards of the same paper as the sheet, set apart by the teal
   hairline and by hiding the dot grid; white text on teal fills. */
:root,
[data-theme="light"] {
    --obj-bg-card: var(--paper);
    --obj-bg-card-opaque: var(--paper);
    --obj-bg-panel: var(--paper);
    --obj-bg-accent: var(--paper-card);
    --obj-border: color-mix(in srgb, var(--paper-teal) 35%, transparent);
    --obj-teal-hover: color-mix(in srgb, var(--paper-teal) 80%, var(--text-dark));
    --obj-teal-dark: color-mix(in srgb, var(--paper-teal) 75%, var(--text-dark));
    --obj-text-on-accent: var(--text-on-teal);
}

/* Dark: the kit's dark sheet with the near-black glass the app has always
   had, dark ink on teal fills. */
[data-theme="dark"] {
    --obj-bg-card: var(--bg-surface);
    --obj-bg-card-opaque: var(--bg-panel);
    --obj-bg-panel: var(--bg-panel);
    --obj-bg-accent: var(--bg-surface-hover);
    --obj-border: color-mix(in srgb, var(--paper-teal) 25%, transparent);
    --obj-teal-hover: var(--color-primary-hover);
    --obj-teal-dark: color-mix(in srgb, var(--color-primary) 55%, var(--bg-base));
    --obj-text-on-accent: var(--color-on-accent);
}

/* --- Layout & Utility Classes --- */
.obj-text-gradient {
    background: linear-gradient(135deg, var(--obj-teal) 0%, var(--obj-teal-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.obj-glass-card {
    background: var(--obj-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--obj-glass-border);
    border-radius: var(--obj-radius);
    box-shadow: none;
    transition: var(--obj-transition);
}

.obj-glass-card:hover {
    border-color: var(--obj-border-focus);
    background: var(--obj-bg-panel);
}

.obj-mono-label {
    font-family: var(--obj-font-mono);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--obj-teal);
}

.obj-split-separator {
    width: 1px;
    border-right: 1px solid var(--obj-border);
    position: relative;
    z-index: 20;
}

/* Square corners in the libraries too: Bootstrap's radius variables, and Fluent UI's corner design
   tokens. The tokens are set on every element so a component host never falls back to its default. */
:root {
    --bs-border-radius: 0;
    --bs-border-radius-sm: 0;
    --bs-border-radius-lg: 0;
    --bs-border-radius-xl: 0;
    --bs-border-radius-xxl: 0;
    --bs-border-radius-2xl: 0;
    --bs-border-radius-pill: 0;
}

:root,
body,
body * {
    --control-corner-radius: 0;
    --layer-corner-radius: 0;
}

/* The Fluent splitter draws its grip inside a shadow root; ::part reaches it. */
split-panels::part(handle) {
    border-radius: 0;
}

/* The splitter keeps its 8px grab area but draws one 1px line in the middle, like any other border. */
split-panels::part(median) {
    background: linear-gradient(var(--obj-border), var(--obj-border)) center / 1px 100% no-repeat;
}

split-panels[direction="column"]::part(median) {
    background-size: 100% 1px;
}
