:root {
    /* Colors — Elegant Light Theme */
    --bg-color: #f7f7f8;
    --text-color: #1a1a2e;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --accent-primary: #6c5ce7;
    /* Refined violet */
    --accent-primary-hover: #5a4bd1;
    --accent-primary-light: rgba(108, 92, 231, 0.08);
    --accent-secondary: #00b894;
    /* Sophisticated teal */
    --accent-secondary-light: rgba(0, 184, 148, 0.08);
    --surface-color: #ffffff;
    --border-color: #e5e7eb;
    --border-light: #f0f0f2;

    /* Semantic Colors */
    --color-success: #00b894;
    --color-warning: #fdcb6e;
    --color-error: #e17055;
    --color-info: #74b9ff;

    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(0, 0, 0, 0.05);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ===========================
   RESET & BASE
   =========================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

/* ===========================
   TYPOGRAPHY
   =========================== */

h1,
h2,
h3,
h4,
h5,
h6,
.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 3rem);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 1.375rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

p {
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 60ch;
    line-height: 1.7;
}

.subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: var(--text-muted);
}

.highlight {
    color: var(--accent-primary);
    font-weight: 600;
}

.mono {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    color: var(--accent-primary);
    font-size: 0.9em;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary-hover);
}

/* ===========================
   LAYOUT
   =========================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

header {
    padding: var(--spacing-sm) var(--spacing-md);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.contact-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    transition: color var(--transition-fast);
}

.contact-link:hover,
.contact-link.active {
    color: var(--text-color);
}

.contact-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background: var(--accent-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
    transform-origin: right;
    border-radius: 1px;
}

.contact-link:hover::after,
.contact-link.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===========================
   BUTTONS
   =========================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-heading);
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    cursor: pointer;
    letter-spacing: 0;
    font-size: 0.875rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    white-space: nowrap;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-primary {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
    border: 1px solid var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-primary-hover);
    box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(108, 92, 231, 0.2);
}

.btn-outline {
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
    background: var(--surface-color);
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
    transform: translateY(-1px);
}

.btn-outline-success {
    border: 1.5px solid var(--color-success);
    color: var(--color-success);
    background: var(--surface-color);
}

.btn-outline-success:hover {
    background: rgba(0, 184, 148, 0.08);
    transform: translateY(-1px);
}

.btn-outline-warning {
    border: 1.5px solid var(--color-warning);
    color: #e67e22;
    background: var(--surface-color);
}

.btn-outline-warning:hover {
    background: rgba(253, 203, 110, 0.1);
    transform: translateY(-1px);
}

.btn-outline-error {
    border: 1.5px solid var(--color-error);
    color: var(--color-error);
    background: var(--surface-color);
}

.btn-outline-error:hover {
    background: rgba(225, 112, 85, 0.08);
    transform: translateY(-1px);
}

.btn-outline-info {
    border: 1.5px solid var(--color-info);
    color: #0984e3;
    background: var(--surface-color);
}

.btn-outline-info:hover {
    background: rgba(116, 185, 255, 0.08);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--text-muted);
}

.btn-ghost:hover {
    color: var(--text-color);
    background: rgba(0, 0, 0, 0.04);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

/* ===========================
   INPUTS
   =========================== */

.input-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.input-field {
    width: 100%;
    background: var(--surface-color);
    border: 1.5px solid var(--border-color);
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.input-field::placeholder {
    color: var(--text-light);
}

.input-field:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.input-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-color);
    letter-spacing: 0;
}

textarea.input-field {
    resize: vertical;
    min-height: 100px;
}

/* ===========================
   CARDS
   =========================== */

.project-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    display: block;
}

.project-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

.project-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.375rem;
    color: var(--text-color);
}

.project-card p {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, var(--accent-primary-light), transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-slow);
    pointer-events: none;
}

.project-card:hover .card-glow {
    opacity: 1;
}

.tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    font-weight: 500;
    margin-left: 8px;
}

/* ===========================
   ALERTS
   =========================== */

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border-left: 4px solid;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    box-shadow: var(--shadow-sm);
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alert-info {
    border-color: var(--color-info);
    color: #0984e3;
    background: rgba(116, 185, 255, 0.06);
}

.alert-primary {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.alert-success {
    border-color: var(--color-success);
    color: #00a884;
    background: rgba(0, 184, 148, 0.06);
}

.alert-purple {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.alert-warning {
    border-color: #e67e22;
    color: #e67e22;
    background: rgba(253, 203, 110, 0.1);
}

.alert-error {
    border-color: var(--color-error);
    color: var(--color-error);
    background: rgba(225, 112, 85, 0.06);
}

/* ===========================
   SOCIAL CARD
   =========================== */

.social-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 500px;
    box-shadow: var(--shadow-sm);
}

.sc-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.sc-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    margin-right: 0.875rem;
}

.sc-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sc-name {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.sc-handle {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.sc-content p {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.sc-image-placeholder {
    width: 100%;
    height: 200px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--border-color);
    margin-bottom: 1rem;
}

.sc-actions {
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.875rem;
}

.sc-action {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.sc-action:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

/* ===========================
   ADVANCED FORMS
   =========================== */

.form-group {
    margin-bottom: 1.5rem;
}

/* Custom Checkbox & Radio */
.custom-checkbox,
.custom-radio {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 2rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.custom-checkbox input,
.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark,
.radiomark {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 0;
    height: 1.25rem;
    width: 1.25rem;
    background-color: var(--surface-color);
    border: 1.5px solid var(--border-color);
    transition: all var(--transition-fast);
}

.checkmark {
    border-radius: var(--radius-sm);
}

.radiomark {
    border-radius: 50%;
}

.custom-checkbox:hover input~.checkmark,
.custom-radio:hover input~.radiomark {
    border-color: var(--accent-primary);
}

.custom-checkbox input:checked~.checkmark,
.custom-radio input:checked~.radiomark {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkmark:after,
.radiomark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-checkbox input:checked~.checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-radio input:checked~.radiomark:after {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
}

.custom-checkbox input:checked~.checkmark:after,
.custom-radio input:checked~.radiomark:after {
    display: block;
}

/* Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 0.875rem;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.toggle-switch input {
    display: none;
}

.slider {
    position: relative;
    width: 46px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all var(--transition-base);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--accent-primary);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

/* Custom Select */
.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--surface-color);
    border: 1.5px solid var(--border-color);
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* ===========================
   CHIPS & BADGES
   =========================== */

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    margin-right: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 500;
}

.chip .dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    margin-right: 6px;
}

.chip-success .dot {
    background: var(--color-success);
    box-shadow: 0 0 4px rgba(0, 184, 148, 0.4);
}

.chip-warning .dot {
    background: #e67e22;
    box-shadow: 0 0 4px rgba(230, 126, 34, 0.4);
}

.chip-error .dot {
    background: var(--color-error);
    box-shadow: 0 0 4px rgba(225, 112, 85, 0.4);
}

.chip-purple .dot {
    background: var(--accent-primary);
    box-shadow: 0 0 4px rgba(108, 92, 231, 0.4);
}

.chip-blue .dot {
    background: #0984e3;
    box-shadow: 0 0 4px rgba(9, 132, 227, 0.4);
}

.chip-indigo .dot {
    background: #4b0082;
    box-shadow: 0 0 4px rgba(75, 0, 130, 0.4);
}

.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--color-error);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    border: 2px solid var(--surface-color);
}

/* ===========================
   NAVIGATION — DROPDOWNS
   =========================== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.dropdown:hover .dropdown-menu {
    display: block;
    animation: fadeIn 0.15s ease;
}

.dropdown-item {
    display: block;
    padding: 0.625rem 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.dropdown-item:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   TABS
   =========================== */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0;
}

.tab-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.875rem 1.25rem;
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9375rem;
    position: relative;
    transition: color var(--transition-fast);
}

.tab-link:hover {
    color: var(--text-color);
}

.tab-link.active {
    color: var(--accent-primary);
}

.tab-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 1px 1px 0 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-content.active {
    display: block;
}

/* ===========================
   TABLES
   =========================== */

.table-container {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--surface-color);
}

.ninjacats-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.ninjacats-table th,
.ninjacats-table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.ninjacats-table th {
    background: var(--bg-color);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

.ninjacats-table tr:last-child td {
    border-bottom: none;
}

.ninjacats-table tr:hover td {
    background: rgba(108, 92, 231, 0.02);
}

/* ===========================
   PROGRESS BAR
   =========================== */

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

/* ===========================
   FLEXBOX COLUMNS SYSTEM
   =========================== */

.columns {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    margin-bottom: 1rem;
}

.column {
    flex-basis: 0;
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0.75rem;
}

.column.is-half {
    flex: none;
    width: 50%;
}

.column.is-one-third {
    flex: none;
    width: 33.3333%;
}

.column.is-two-thirds {
    flex: none;
    width: 66.6666%;
}

.column.is-one-quarter {
    flex: none;
    width: 25%;
}

.column.is-three-quarters {
    flex: none;
    width: 75%;
}

.column.is-full {
    flex: none;
    width: 100%;
}

.column.is-four-fifths {
    flex: none;
    width: 80%;
}

.column.is-one-fifth {
    flex: none;
    width: 20%;
}

/* Grid Utilities */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {

    .column.is-half,
    .column.is-one-third,
    .column.is-two-thirds,
    .column.is-one-quarter,
    .column.is-three-quarters,
    .column.is-four-fifths,
    .column.is-one-fifth {
        width: 100%;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ===========================
   AVATAR STACK
   =========================== */

.avatar-stack {
    display: flex;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    border: 2px solid var(--surface-color);
    margin-left: -10px;
}

.avatar-sm:first-child {
    margin-left: 0;
}

/* ===========================
   CONTEXT MENU
   =========================== */

.context-menu-wrapper {
    position: relative;
    display: inline-block;
}

.context-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 160px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.375rem;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.context-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.context-menu a:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.context-menu a.danger {
    color: var(--color-error);
}

.context-menu a.danger:hover {
    background: rgba(225, 112, 85, 0.06);
}

/* ===========================
   APP SIDEBAR
   =========================== */

.app-sidebar-container {
    display: flex;
    height: 400px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.app-sidebar {
    width: 250px;
    background: var(--surface-color);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
}

.app-sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo {
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.collapsed .sidebar-logo {
    display: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0.75rem;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 0.25rem;
}

.sidebar-title {
    padding: 0.75rem 0.875rem 0.375rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    letter-spacing: 0.05em;
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.sidebar-link:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.sidebar-link.active {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1.25rem;
}

.collapsed .sidebar-link span {
    display: none;
}

.collapsed .sidebar-link {
    justify-content: center;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-light);
}

/* App Main Content Preview */
.app-main {
    flex: 1;
    background: var(--bg-color);
    padding: 2rem;
    overflow-y: auto;
}

/* ===========================
   MODALS
   =========================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    transform: translateY(16px) scale(0.98);
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.modal-title {
    font-size: 1.25rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-color);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.modal-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ===========================
   TOASTS
   =========================== */

.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1100;
}

.toast {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    min-width: 320px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--accent-primary);
}

.toast.success {
    border-left-color: var(--color-success);
}

.toast.error {
    border-left-color: var(--color-error);
}

.toast.info {
    border-left-color: var(--color-info);
}

.toast.warning {
    border-left-color: #e67e22;
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--color-success);
}

.toast.error .toast-icon {
    color: var(--color-error);
}

.toast.info .toast-icon {
    color: var(--color-info);
}

.toast.warning .toast-icon {
    color: #e67e22;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
    font-size: 0.9375rem;
    color: var(--text-color);
}

.toast-message {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===========================
   PAGINATION
   =========================== */

.pagination {
    display: flex;
    list-style: none;
    gap: 0.375rem;
    margin-top: 2rem;
}

.page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
    font-weight: 500;
}

.page-item .page-link:hover,
.page-item.active .page-link {
    background: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-color);
}

/* ===========================
   BREADCRUMBS
   =========================== */

.breadcrumb {
    display: flex;
    list-style: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--accent-primary);
}

.breadcrumb-item+.breadcrumb-item::before {
    content: '/';
    margin: 0 0.5rem;
    color: var(--border-color);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: 500;
}

/* ===========================
   TREE VIEW
   =========================== */

.tree-view {
    list-style: none;
    padding-left: 0;
    margin: 0;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tree-view ul {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
    display: none;
    border-left: 1px solid var(--border-light);
}

.tree-view li {
    margin: 0.125rem 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    gap: 0.5rem;
}

.tree-item:hover {
    background: var(--bg-color);
    color: var(--text-color);
}

.tree-item.selected {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    border-left: 2px solid var(--accent-primary);
}

.tree-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: var(--text-light);
    transition: transform 0.2s ease;
}

.tree-caret:hover {
    color: var(--text-color);
}

.tree-group.open>.tree-item .tree-caret {
    transform: rotate(90deg);
}

.tree-group.open>ul {
    display: block;
    animation: slideDown 0.15s ease;
}

.tree-icon {
    font-size: 1.1rem;
    color: var(--text-light);
}

.tree-item:hover .tree-icon {
    color: var(--text-muted);
}

/* Folder colors */
.ph-folder,
.ph-folder-open {
    color: #e67e22;
    opacity: 0.9;
}

.ph-file-code {
    color: var(--color-success);
}

.ph-file-css {
    color: #0984e3;
}

.ph-image {
    color: var(--color-error);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   CHAT BUBBLES
   =========================== */

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.chat-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.chat-row.right {
    flex-direction: row-reverse;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--font-heading);
    flex-shrink: 0;
}

.chat-row.right .chat-avatar {
    background: var(--accent-secondary);
}

.chat-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9375rem;
    line-height: 1.5;
    position: relative;
    animation: fadeIn 0.2s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-bubble p {
    margin: 0;
    font-size: inherit;
    color: inherit;
}

/* Left bubble (received) */
.chat-row.left .chat-bubble {
    background: var(--surface-color);
    color: var(--text-color);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: var(--radius-xs);
    box-shadow: var(--shadow-sm);
}

/* Right bubble (sent) */
.chat-row.right .chat-bubble {
    background: var(--accent-primary);
    color: #fff;
    border-bottom-right-radius: var(--radius-xs);
    box-shadow: 0 2px 8px rgba(108, 92, 231, 0.25);
}

.chat-bubble .chat-time {
    display: block;
    font-size: 0.6875rem;
    margin-top: 0.375rem;
    opacity: 0.55;
    font-weight: 400;
}

.chat-row.right .chat-bubble .chat-time {
    text-align: right;
    opacity: 0.7;
}

/* Typing indicator */
.chat-bubble.typing {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.875rem 1.25rem;
}

.chat-bubble.typing .dot-typing {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-light);
    animation: typingPulse 1.4s infinite ease-in-out;
}

.chat-bubble.typing .dot-typing:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-bubble.typing .dot-typing:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.85);
    }

    30% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive chat bubbles */
@media (max-width: 480px) {
    .chat-bubble {
        max-width: 85%;
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }

    .chat-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.65rem;
    }

    .chat-row {
        gap: 0.375rem;
    }
}

/* ===========================
   PAGE HEADER & FOOTER
   =========================== */

.page-header {
    padding: var(--spacing-sm) 0;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-light);
}

.page-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-footer {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    background: var(--surface-color);
    border-top: 1px solid var(--border-light);
}

.page-footer .container {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 3rem;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 0.9375rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

footer {
    padding: var(--spacing-md);
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    background: var(--surface-color);
}

/* ===========================
   HERO SECTION
   =========================== */

#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
    position: relative;
    background: linear-gradient(180deg, var(--surface-color) 0%, var(--bg-color) 100%);
}

/* ===========================
   PORTFOLIO / PROJECT GRID
   =========================== */

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* ===========================
   ABOUT SECTION
   =========================== */

#about {
    padding: var(--spacing-xl) 0;
    background-color: var(--surface-color);
    position: relative;
    border-top: 1px solid var(--border-light);
}

#about .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ===========================
   UTILITY: CURSOR GLOW (subtle)
   =========================== */

.cursor-glow {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.06), transparent 70%);
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
    transition: left 0.1s ease, top 0.1s ease;
}

/* ===========================
   APP LAYOUT (sidebar + main)
   =========================== */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-layout .app-sidebar {
    width: 260px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    overflow-y: auto;
}

.app-layout .app-main {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
}

.app-layout .content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.app-layout .content-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
}

/* Upload area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
    transition: all var(--transition-base);
    cursor: pointer;
    background: var(--surface-color);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.upload-area i {
    font-size: 2.5rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    display: block;
}

.upload-area p {
    margin: 0 auto;
}

.upload-area .file-name {
    margin-top: var(--spacing-sm);
    font-weight: 600;
    color: var(--accent-primary);
}

/* Chat layout — pin header top, input bottom, messages scroll between */
.app-main:has(.chat-layout) {
    padding: 0 !important;
    height: 100vh;
    overflow: hidden;
}

.chat-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-layout .chat-header {
    padding: 1rem 2rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.chat-layout .chat-messages {
    flex: 1 1 0;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.chat-layout .chat-input-bar {
    padding: 1rem 2rem;
    background: var(--surface-color);
    border-top: 1px solid var(--border-light);
    flex-shrink: 0;
}

.chat-layout .chat-input-bar form {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.chat-layout .chat-input-bar .input-field {
    flex: 1;
}

/* Form card */
.form-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    max-width: 600px;
    box-shadow: var(--shadow-sm);
}

.form-card h2 {
    font-size: 1.375rem;
    margin-bottom: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    margin: 0 auto;
}

/* ===========================
   LEX MODULE
   =========================== */

/* Hero search block */
.lex-hero {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    overflow: hidden;
}

.lex-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, var(--accent-primary-light), transparent 70%);
    pointer-events: none;
}

.lex-hero > * {
    position: relative;
}

.lex-hero h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.lex-hero p {
    margin: 0 auto 1.5rem;
    max-width: 50ch;
}

.lex-hero .lex-search-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.75rem;
}

.lex-hero .lex-search-form .input-field {
    flex: 1;
}

/* Stats bar */
.lex-stats {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    align-items: center;
}

.lex-stats .lex-stats-push {
    margin-left: auto;
}

/* Section title with icon */
.lex-section-title {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lex-section-title i {
    color: var(--accent-primary);
}

.lex-section-title.secondary i {
    color: var(--accent-secondary);
}

/* Detail card (act detail, document detail) */
.lex-detail-card {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: var(--spacing-md);
}

.lex-detail-card .lex-detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.lex-detail-card .lex-detail-header .lex-detail-body {
    flex: 1;
}

.lex-detail-card .lex-detail-chips {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.lex-detail-card .lex-detail-address {
    font-family: monospace;
    font-size: 0.9375rem;
    color: var(--accent-primary);
    font-weight: 600;
}

.lex-detail-card h1 {
    font-size: 1.75rem;
    margin-bottom: 0;
    line-height: 1.3;
}

.lex-detail-card .lex-detail-formats {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Info grid (3 cols) */
.lex-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-sm);
    margin-bottom: 1.5rem;
}

.lex-info-box {
    background: var(--bg-color);
    padding: 1rem;
    border-radius: var(--radius-md);
}

.lex-info-box .lex-info-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.lex-info-box .lex-info-value {
    font-weight: 500;
}

/* Actions row */
.lex-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.lex-actions .lex-eli {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

.lex-actions .lex-eli code {
    background: var(--bg-color);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* Metadata line (icon + text pairs) */
.lex-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.lex-meta i {
    margin-right: 0.25rem;
}

/* Document card list */
.lex-doc-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lex-doc-card {
    padding: 1rem;
}

.lex-doc-card h4 {
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.lex-doc-card .lex-doc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lex-doc-card .lex-doc-id {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Category grid */
.lex-category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

/* Year chips */
.lex-year-chips {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.lex-year-chips .chip {
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.lex-year-chips .chip:hover {
    transform: translateY(-2px);
}

/* Journal info box */
.lex-journal-info {
    background: var(--surface-color);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

/* Alerts stack */
.lex-alerts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Act table — title-dominant layout */
.lex-act-table {
    table-layout: fixed;
    width: 100%;
}

.lex-act-table th:nth-child(1) { width: auto; }
.lex-act-table th:nth-child(2) { width: 120px; }
.lex-act-table th:nth-child(3) { width: 120px; }
.lex-act-table th:nth-child(4) { width: 100px; }

.lex-act-title {
    font-weight: 500;
    display: block;
    line-height: 1.4;
}

.lex-act-subtitle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.lex-act-subtitle .ph-file-pdf { color: var(--color-error); font-size: 0.8125rem; }
.lex-act-subtitle .ph-code { color: var(--color-success); font-size: 0.8125rem; }

.lex-act-address {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-light);
}

.lex-act-chip {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--accent-primary-light);
    color: var(--accent-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lex-act-chip-blue {
    background: rgba(116, 185, 255, 0.12);
    color: #2d8cf0;
}

.lex-act-date {
    color: var(--text-muted);
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Collapsible sidebar section */
.lex-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.lex-sidebar-toggle:hover {
    color: var(--text-muted);
}

.lex-sidebar-toggle .ph {
    font-size: 0.875rem;
    transition: transform var(--transition-fast);
}

.lex-sidebar-toggle[aria-expanded="false"] .ph {
    transform: rotate(-90deg);
}

.lex-sidebar-list {
    max-height: 300px;
    overflow-y: auto;
    transition: max-height var(--transition-base);
}

.lex-sidebar-list.collapsed {
    max-height: 0;
    overflow: hidden;
}

.lex-sidebar-list .sidebar-link {
    padding-left: 1.25rem;
    font-size: 0.8125rem;
}

.lex-sidebar-count {
    margin-left: auto;
    font-size: 0.6875rem;
    color: var(--text-light);
    font-weight: 400;
    font-family: monospace;
}

/* Sidebar filter input */
.lex-sidebar-filter {
    padding: 0.25rem 0.5rem;
}

.lex-sidebar-search {
    width: 100%;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-family: var(--font-body);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-color);
    color: var(--text-color);
    outline: none;
    transition: border-color var(--transition-fast);
}

.lex-sidebar-search::placeholder {
    color: var(--text-light);
}

.lex-sidebar-search:focus {
    border-color: var(--accent-primary);
}

/* Sidebar journal entry with year chips */
.lex-sidebar-journal .sidebar-link {
    padding-bottom: 0.125rem;
}

.lex-sidebar-years {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem 0.5rem 1.75rem;
}

.lex-sidebar-year-chip {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 500;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-xs);
    background: var(--bg-color);
    color: var(--text-muted);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    line-height: 1.4;
}

.lex-sidebar-year-chip:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.lex-sidebar-year-more {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

/* Document content area */
.lex-doc-content {
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-color);
    white-space: pre-wrap;
    font-family: var(--font-body);
}

/* Standalone search form (outside hero) */
.lex-search-form {
    display: flex;
    gap: 0.75rem;
}

.lex-search-form .input-field {
    flex: 1;
}

/* Search filters */
.lex-filters {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Search result count */
.lex-result-bar {
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lex-result-bar .lex-result-query {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Page wrapper */
.lex-page {
    padding: var(--spacing-md);
}

/* Description text under header */
.lex-description {
    margin-bottom: var(--spacing-md);
    color: var(--text-light);
}

@media (max-width: 768px) {
    .lex-info-grid {
        grid-template-columns: 1fr;
    }

    .lex-category-grid {
        grid-template-columns: 1fr;
    }

    .lex-detail-card .lex-detail-header {
        flex-direction: column;
    }
}

/* ===========================
   RESPONSIVE SIDEBAR
   =========================== */

@media (max-width: 768px) {
    .app-layout .app-sidebar {
        width: 0;
        transform: translateX(-100%);
    }

    .app-layout .app-main {
        margin-left: 0;
    }
}