/* Theme-specific CSS for Design Lab */
/* Special effects, animations, and theme-specific layout adjustments */

/* Custom InstaCalc hand-drawn font */
@font-face {
    font-family: InstaCalc;
    src: url("/img/ui/InstaCalc_v2.otf?v=112622") format("opentype");
}

body,
body * {
    font-family: var(--theme-font-family, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

body[data-theme="theme-daylight"] {
    --calc-row-input-bg-color: var(--bg);
    --calc-row-selected-input-bg-color: var(--bg);
}

body[data-theme="theme-daylight"] [data-calc-input] input {
    border-color: var(--border-color);
}

:root {
    /* ================================================
       CANONICAL CSS VARIABLES (Minimal Set)
       ================================================
       These are set by theme.js - theme.js sets ONLY these 11 core variables
       
       Default values are "Daylight" theme - theme.js overrides these
       
       CORE PALETTE (11 variables):
         --bg          Primary background
         --bg-alt      Alternate background (cards, panels)
         --border-color  Border/divider color
       
         --text        Primary text color
         --text-dim    Secondary/muted text
       
         --accent      Primary accent (buttons, links)
         --accent-bright  Secondary accent
       
         --calc-result-color  Calculation result
         --calc-comment-color  Comment text
         --calc-row-type-color  Type indicator
         --calc-row-type-custom-color  Custom type
       ================================================ */

    /* Core palette - defaults to Daylight theme, overridden by theme.js */
    --bg: #f7f8fa;
    --bg-alt: #eef1f5;
    --text: #444;
    --text-dim: #7a7a7a;
    --accent: #3a7ad9;
    --accent-bright: #6ea8ef;
    --border-color: rgba(0, 0, 0, 0.08);

    /* Grid background color - derived from border */
    --grid-color: color-mix(in srgb, var(--text) 8%, transparent);

    /* Calc semantics - defaults, overridden by theme.js */
    --calc-result-color: #C95A6A;
    --calc-comment-color: hsla(200, 65%, 35%, 0.9);
    --calc-row-type-color: #e57373;
    --calc-row-type-custom-color: #AA4499;

    /* --- STATUS COLORS (D5 Header) --- */
    --status-public-fg: #059669;
    /* text-green-600 */
    --status-public-bg: #34d399;
    /* bg-emerald-400 */
    --status-private-fg: #d97706;
    /* text-amber-600 */
    --status-private-bg: #fbbf24;
    /* bg-amber-400 */

    /* --- DERIVED VARIABLES (computed from palette) --- */
    /* theme.js sets ONLY the 11 core variables above
       Everything below is derived in pure CSS */

    /* Accent variations using color-mix - consolidated to 3 variants */
    --accent-light: color-mix(in srgb, var(--accent) 10%, transparent);
    --accent-medium: color-mix(in srgb, var(--accent) 20%, transparent);
    --accent-strong: color-mix(in srgb, var(--accent) 40%, transparent);
    /* Note: --accent-bright is defined in theme palette as a separate color */

    /* ===== GRID LAYOUT VARIABLES ===== */
    /* Set by ViewStrategy and InstaCalc root per view mode */
    /* These enable components to adapt to different grid structures */

    /* Column configuration */
    --grid-col-count: 3;
    --grid-full-span: 3;
    --grid-half-span: 1;
    --grid-row-num-span: 1;
    --grid-input-span: 1;
    --grid-result-span: 1;

    /* Column widths */
    --grid-row-num-width: minmax(20px, 28px);
    --grid-content-width: 1fr;

    /* Row internal grid template - adapts to parent grid structure */
    --grid-row-template: minmax(20px, 28px) 1fr 1fr;

    /* Gaps */
    --grid-gap-x: 0.5rem;
    --grid-gap-y: 0.25rem;

    /* Wave background colors - subtle bg variations with slight accent tint */
    --wave-1: color-mix(in srgb, var(--bg) 88%, var(--accent));
    --wave-2: color-mix(in srgb, var(--bg-alt) 85%, var(--accent));
    --wave-3: color-mix(in srgb, var(--bg) 90%, var(--accent));
    --wave-4: color-mix(in srgb, var(--bg-alt) 82%, var(--accent));
    --wave-5: color-mix(in srgb, var(--bg) 92%, var(--accent));

    /* Background variations */
    --bg-secondary-mix-40: color-mix(in srgb, var(--bg-alt) 40%, transparent);
    --bg-secondary-mix-60: color-mix(in srgb, var(--bg-alt) 60%, transparent);
    --bg-secondary-mix-80: color-mix(in srgb, var(--bg-alt) 80%, transparent);

    /* Border variations */
    --soft-border-color: var(--border-color);
    --border-soft: color-mix(in srgb, var(--border-color) 50%, transparent);
    --row-border: color-mix(in srgb, var(--border-color) 80%, transparent);

    /* ALL CALC VARIABLES - derived from core 11 */
    --calc-bg-color: var(--bg);
    --calc-card-border: var(--border-color);
    --calc-row-number: color-mix(in srgb, var(--text) 10%, var(--text-dim));
    --calc-row-selected-number: var(--text);
    --calc-row-input-bg-color: var(--bg-alt);
    --calc-row-selected-input-bg-color: var(--bg-alt);
    --calc-row-selected-ring: 0 0 0 3px var(--accent-strong), inset 0 0 4px var(--accent-light);
    --calc-result-undefined-color: var(--text-dim);
    --calc-comment-hover-bg-color: var(--bg-alt);
    --calc-row-log-color: var(--text-dim);
    --calc-row-log-bg-color: var(--bg-alt);
    --calc-row-log-border-color: var(--border-color);

    /* Card variables */

    --calc-card-border: var(--border-color);
    --sidebar-card-bg: var(--bg);
    --sidebar-card-border: var(--border-color);

    /* UI variables - ALL derived */
    --link-color: var(--accent);
    --link-hover-color: var(--accent-bright);
    --tab-active-color: var(--accent);
    --highlight-bg-color: var(--accent);
    --highlight-text-color: var(--bg);
    --button-bg-color-hover: var(--bg-alt);
    --button-bg-color-create: var(--accent);
    --button-text-color-create: var(--bg-alt);

    /* Backwards-compatibility aliases - CLEANED UP Jan 2026 */
    /* Most aliases removed - use canonical names instead:
       - Use --accent not --accent-primary
       - Use --text-dim not --text-muted/--text-secondary
       - Use --bg-alt not --bg-secondary
       - Use --border-color not --border
    */
    --accent-secondary: var(--accent-bright);  /* Keep for external embeds/demos */
    --accent-tertiary: var(--calc-result-color);
    --border-color-soft: var(--border-soft);
    --panel: var(--bg-alt);
    --card-bg: var(--sidebar-card-bg);
    --card-border: var(--sidebar-card-border);

    /* Theme typography defaults (overridden by theme.js) */
    --theme-h2-font-size: 1.5rem;
    --theme-h2-font-weight: 700;
    --theme-h2-margin-bottom: 1rem;

    /* --- LAYOUT & SPACING --- */
    --radius-control: 0.625rem;
    --radius-base: 0.75rem;
    --radius-card: 1rem;
    --radius-surface: 1.25rem;
    --radius-sidebar: 1.5rem;

    --dropdown-surface: color-mix(in srgb, var(--bg, #f8fafc) 80%, var(--bg-alt, #ffffff) 20%);
    --dropdown-border-color: color-mix(in srgb, var(--soft-border-color, rgba(15, 23, 42, 0.16)) 80%, transparent);
    --dropdown-shadow: 0 18px 35px rgba(15, 23, 42, 0.18);

    /* Layout dimensions */
    --mobile-bottom-nav-height: 60px;
    --desktop-sticky-offset: 80px;
    --sidebar-width: 460px;
    --sidebar-panel-height: 80vh;

    /* Animation durations */
    --toolbar-close-duration: 1000ms;
    --duration-fast: 150ms;
    /* Quick fades, hover states */
    --duration-normal: 200ms;
    /* Standard UI interactions */
    --duration-medium: 300ms;
    /* Background/color changes */
    --duration-slow: 500ms;
    /* Panel/section animations */

    /* Card style variables - base defaults (overridden by data-* attributes below) */
    --sidebar-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    --sidebar-card-bg: var(--bg);
    --sidebar-card-border: var(--soft-border-color);

    --calc-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 16px -4px rgba(0, 0, 0, 0.06);
    --calc-bg-color: var(--bg);
    --calc-card-border: var(--soft-border-color);

    --header-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --header-card-bg: var(--bg);
    --header-card-border: transparent;

    /* Theme-specific defaults */
    --main-bg-color: var(--bg);
    /* --theme-logo-filter is set dynamically by theme.js from accent color */

    /* Gradient Intensity System
       Controls overall vibrancy of background gradients (orbs, body gradient, dock)
       Range: 0 (off/solid) to 1 (full vibrancy)
       Set by theme.js from theme config's gradientIntensity property */
    --gradient-intensity: 0.1;

    /* Orb opacity - subtle by default */
    --orb-opacity: 0.1;

    /* Dock gradient mix percentage - scaled from intensity (base 15% at 0.4 intensity) */
    --dock-gradient-mix: 15%;

    /* --- PRESENTATION MODE SPECIFIC --- */
    --present-hero-gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
    --present-hero-warning-gradient: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    --present-hero-success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --present-bg: var(--bg);
    /* slate-50 legacy: #f8fafc */
}

/* ================================================
   VIEW MODE GRID OVERRIDES
   ================================================
   Adjust grid configuration per view mode
   data-view-mode attribute set by InstaCalc component
   ================================================ */

/* Calc/Editor Mode - 3 column grid: [row-number | input | result] */
[data-view-mode="calc"],
[data-view-mode="editor"] {
    --grid-col-count: 3;
    --grid-full-span: 3;
}

/* Present/Embed Mode - 6 column flexible grid */
[data-view-mode="present"],
[data-view-mode="embed"] {
    --grid-col-count: 6;
    --grid-full-span: 6;
    --grid-half-span: 3;
    --grid-third-span: 2;
    /* Row spans 6 cols but doesn't define internal grid - uses display:contents or flex */
    --grid-row-template: none;
}

/* ===== GRID UTILITY CLASSES ===== */
/* Tailwind's JIT can't handle CSS vars in arbitrary values like col-span-[var(...)],
   so we define actual CSS classes that use the grid variables */

.col-span-grid-full {
    grid-column: span var(--grid-full-span) / span var(--grid-full-span);
}

.col-span-grid-half {
    grid-column: span var(--grid-half-span) / span var(--grid-half-span);
}

.col-span-grid-third {
    grid-column: span var(--grid-third-span) / span var(--grid-third-span);
}

/* Responsive row number width and grid gaps */
@media (max-width: 768px) {
    :root {
        --grid-row-num-width: minmax(14px, 24px);
    }

    /* Tighter grid on mobile (except embed mode) */
    body:not([data-view-context="embed"]) {
        --grid-gap-x: 0.25rem;
        --grid-gap-y: 0.125rem;
    }
}

/* ================================================
   CARD STYLE VARIATIONS (Data Attribute Based)
   ================================================
   JS sets data-*-style attributes on :root
   CSS derives all styling from base theme variables
   No circular dependencies - always reference --bg, --border-color directly
   ================================================ */

/* --- SIDEBAR CARD STYLES --- */
[data-sidebar-style="elevated"] {
    --sidebar-card-bg: var(--bg);
    --sidebar-card-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    --sidebar-card-border: transparent;
}

[data-sidebar-style="sunken"] {
    --sidebar-card-bg: color-mix(in srgb, var(--bg) 30%, transparent);
    --sidebar-card-shadow: none;
    --sidebar-card-border: transparent;
}

[data-sidebar-style="flat"] {
    --sidebar-card-bg: var(--bg);
    --sidebar-card-shadow: none;
    --sidebar-card-border: transparent;
}

[data-sidebar-style="glass"] {
    --sidebar-card-bg: color-mix(in srgb, var(--bg) 50%, transparent);
    --sidebar-card-shadow: none;
    --sidebar-card-border: color-mix(in srgb, var(--border-color) 50%, transparent);
}

[data-sidebar-style="subtle"] {
    --sidebar-card-bg: var(--bg);
    --sidebar-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sidebar-card-border: var(--border-color);
}

/* --- CALC CARD STYLES --- */
[data-calc-style="elevated"] {

    /* Soft ambient glow (all sides) + subtle drop shadow */
    --calc-card-shadow:
        0 0 12px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.06);
    --calc-card-border: transparent;
}

/* Light themes: Soft glow visible on all edges */
[data-calc-style="elevated"] body.theme-light {
    --calc-card-shadow:
        0 0 12px rgba(0, 0, 0, 0.06),
        0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Dark themes: Subtle glow that doesn't look harsh */
[data-calc-style="elevated"] body.theme-dark {
    --calc-card-shadow:
        0 0 16px rgba(0, 0, 0, 0.12),
        0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-calc-style="sunken"] {
    --calc-bg-color: rgba(0, 0, 0, 0.02);
    --calc-card-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    --calc-card-border: rgba(0, 0, 0, 0.08);
}

[data-calc-style="flat"] {

    --calc-card-shadow: none;
    --calc-card-border: transparent;
}

[data-calc-style="glass"] {
    --calc-bg-color: color-mix(in srgb, var(--bg) 70%, transparent);
    --calc-card-shadow: none;
    --calc-card-border: color-mix(in srgb, var(--border-color) 50%, transparent);
}

/* --- HEADER CARD STYLES --- */
[data-header-style="elevated"] {
    --header-card-bg: var(--bg);
    --header-card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --header-card-border: transparent;
}

[data-header-style="sunken"] {
    --header-card-bg: color-mix(in srgb, var(--bg) 30%, transparent);
    --header-card-shadow: none;
    --header-card-border: transparent;
}

[data-header-style="flat"] {
    --header-card-bg: var(--bg);
    --header-card-shadow: none;
    --header-card-border: transparent;
}

[data-header-style="glass"] {
    --header-card-bg: color-mix(in srgb, var(--bg) 50%, transparent);
    --header-card-shadow: none;
    --header-card-border: color-mix(in srgb, var(--border-color) 50%, transparent);
}

body.single-layout .single-layout-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-surface, 1.25rem);
    background: color-mix(in srgb, var(--calc-bg-color, var(--bg)) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--calc-card-border, rgba(15, 23, 42, 0.12)) 80%, transparent);
    box-shadow: var(--calc-card-shadow, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
    padding: clamp(1.25rem, 2vw, 2.25rem);
    gap: 1.5rem;
}

body.single-layout .single-layout-card>[data-calc-wrapper] {
    background: transparent;
    border: none;
    box-shadow: none;
}

body.single-layout .single-logo img {
    width: 3rem;
    height: 3rem;
    filter: var(--theme-logo-filter, drop-shadow(0 8px 16px rgba(0, 0, 0, 0.25)));
}

body.single-layout .single-logo span {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--theme-text, var(--text, #fff));
}

/* InstaCalc logo - uses theme logo filter (set by theme.js from accent color) */
.ic-logo {
    filter: var(--theme-logo-filter);
}

/* InstaCalc Logo Text - Matches logo by using accent color */
.ic-logo-text {
    color: var(--accent);
    transition: color 0.3s ease, opacity 0.3s ease;
}

/* For Brutalist: Logo and text are Black */
body.theme-brutalist .ic-logo-text {
    color: var(--text);
}

.theme-rounded-xs {
    border-radius: var(--radius-control);
}

.theme-rounded-sm {
    border-radius: var(--radius-base);
}

.theme-rounded-lg {
    border-radius: var(--radius-card);
}

.theme-rounded-xl {
    border-radius: var(--radius-surface);
}

.theme-rounded-sidebar {
    border-radius: var(--radius-sidebar);
}

.theme-rounded-sidebar-left {
    border-top-left-radius: var(--radius-sidebar);
    border-bottom-left-radius: var(--radius-sidebar);
}

.theme-rounded-sidebar-right {
    border-top-right-radius: var(--radius-sidebar);
    border-bottom-right-radius: var(--radius-sidebar);
}

[data-theme-rounded-controls="true"] :where(button, input, select, textarea) {
    border-radius: var(--radius-control);
}

[data-theme-rounded-utilities="true"] :where(.rounded, .rounded-sm, .rounded-md) {
    border-radius: var(--radius-base);
}

[data-theme-rounded-utilities="true"] :where(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl) {
    border-radius: var(--radius-card);
}

/* Removed generic element styling - use Tailwind classes instead */

header .logo {
    transform: scale(var(--theme-logo-scale, 1));
}

/* Apply logo filter to header logo image */
header a[href="/"] img {
    filter: var(--theme-logo-filter);
}

[data-theme-header-centered="true"] header {
    justify-content: center !important;
    text-align: center;
}

[data-theme-logo-centered="true"] header .logo {
    margin-left: auto;
    margin-right: auto;
}

[data-theme-elevated-controls="true"] :where(button, input, select) {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
}

[data-theme-elevated-controls="true"] button:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

[data-theme-borderless-panels="true"] aside button,
[data-theme-borderless-panels="true"] main>div>div>div {
    border: none;
}

[data-theme-main-inner-constrained="true"] main>div>div {
    max-width: var(--theme-main-inner-max-width, 56rem);
    margin-left: auto;
    margin-right: auto;
}

[data-theme-aside-buttons-tight="true"] aside button {
    padding: var(--theme-aside-button-padding, inherit);
    font-size: var(--theme-aside-button-font-size, inherit);
}

[data-theme-typography-h2="true"] h2 {
    font-size: var(--theme-h2-font-size);
    font-weight: var(--theme-h2-font-weight);
    margin-bottom: var(--theme-h2-margin-bottom);
}

/* Responsive variants */
@media (min-width: 768px) {

    .md\:theme-rounded-xs {
        border-radius: var(--radius-control);
    }

    .md\:theme-rounded-sm {
        border-radius: var(--radius-base);
    }

    .md\:theme-rounded-lg {
        border-radius: var(--radius-card);
    }

    .md\:theme-rounded-xl {
        border-radius: var(--radius-surface);
    }

    .md\:theme-rounded-sidebar {
        border-radius: var(--radius-sidebar);
    }

    .md\:theme-rounded-sidebar-left {
        border-top-left-radius: var(--radius-sidebar);
        border-bottom-left-radius: var(--radius-sidebar);
    }

    .md\:theme-rounded-sidebar-right {
        border-top-right-radius: var(--radius-sidebar);
        border-bottom-right-radius: var(--radius-sidebar);
    }
}

/* === TERMINAL THEME === */
.theme-terminal {
    position: relative;
}

.theme-terminal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, rgba(0, 255, 0, 0.03) 0px, transparent 1px, transparent 2px, rgba(0, 255, 0, 0.03) 3px);
    pointer-events: none;
    z-index: -1;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(10px);
    }
}

@keyframes ic-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .5;
        transform: scale(0.95);
    }
}

.animate-pulse {
    animation: ic-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.theme-terminal .content-wrapper {
    position: relative;
    z-index: 2;
}

.theme-terminal .text-flicker {
    animation: flicker 0.15s infinite alternate;
}

@keyframes flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.95;
    }
}

/* === BRUTALIST THEME === (Variables now in THEME_CONFIG_V2) === */

.theme-brutalist .bg-pattern {
    background-image:
        repeating-linear-gradient(0deg, transparent, transparent 50px, #f0f0f0 50px, #f0f0f0 51px),
        repeating-linear-gradient(90deg, transparent, transparent 50px, #f0f0f0 50px, #f0f0f0 51px);
}

.theme-brutalist .card-brutalist {
    border: 4px solid #000000;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.theme-brutalist .card-brutalist:hover {
    transform: translate(-2px, -2px);
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 1);
}

/* === BRUTALIST THEME (2025) === */
.theme-brutalist {
    --calc-card-border: 3px solid #000000;
    --calc-card-shadow: 8px 8px 0px 0px #000000;
    --radius-control: 0px;
    --radius-base: 0px;
    --radius-card: 0px;
    --radius-surface: 0px;
    --radius-sidebar: 0px;
    --calc-row-selected-ring: 4px 4px 0px 0px #000000;
}

/* Force hard edges and borders on main card */
.theme-brutalist [data-calc-wrapper] {
    border: 3px solid #000000 !important;
    box-shadow: 6px 6px 0px 0px #000000 !important;
    /* Static, not too large */
    border-radius: 0px !important;
    background-color: #ffffff !important;
}

/* Hover effect removed per user request for static "cool" shadow */
/* .theme-brutalist [data-calc-wrapper]:hover { ... } */

/* Force uppercase and mono styling */
.theme-brutalist h1,
.theme-brutalist h2,
.theme-brutalist h3,
.theme-brutalist .font-bold {
    text-transform: uppercase !important;
    letter-spacing: 0.05em;
    font-family: 'JetBrains Mono', 'Menlo', monospace;
}

/* Dashed lines for dividers if used */
.theme-brutalist hr,
.theme-brutalist .divider {
    border-style: dashed !important;
    border-width: 2px !important;
    border-color: #000000 !important;
}

/* Hard buttons */
.theme-brutalist button {
    border-radius: 0px !important;
    text-transform: uppercase;
    font-weight: 700;
    box-shadow: 2px 2px 0px 0px #000000;
    border: 1px solid #000000;
    transition: transform 0.1s, box-shadow 0.1s;
}

.theme-brutalist button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px 0px #000000;
    background-color: #f0f0f0;
}

.theme-brutalist button:active {
    transform: translate(1px, 1px);
    box-shadow: 0px 0px 0px 0px #000000;
}

/* Floating Action Button specific override */
.theme-brutalist .fab-main {
    border-radius: 0px !important;
    border: 3px solid #000000 !important;
    box-shadow: 6px 6px 0px 0px #000000 !important;
}

/* === BRUTALIST GLOBAL RESET (The "Easier Way" Override) === */
.theme-brutalist * {
    --radius-control: 0px !important;
    --radius-base: 0px !important;
    --radius-card: 0px !important;
    --radius-surface: 0px !important;
    --radius-sidebar: 0px !important;
}

.theme-brutalist button,
.theme-brutalist input,
.theme-brutalist select,
.theme-brutalist textarea,
.theme-brutalist .rounded,
.theme-brutalist .rounded-sm,
.theme-brutalist .rounded-md,
.theme-brutalist .rounded-lg,
.theme-brutalist .rounded-xl,
.theme-brutalist .rounded-2xl,
.theme-brutalist .rounded-3xl,
.theme-brutalist .rounded-full,
.theme-brutalist [data-calc-wrapper],
.theme-brutalist #mobile-nav,
.theme-brutalist .dock-container,
.theme-brutalist .genius-btn,
.theme-brutalist [data-id-left-sidebar] li,
.theme-brutalist [data-id-left-sidebar] div {
    border-radius: 0px !important;
}

/* Remove gradient from New Calc Button and enforce flat yellow/black */
.theme-brutalist [data-id-left-sidebar] button[style*="linear-gradient"] {
    background: #fde047 !important;
    /* Yellow */
    color: #000000 !important;
    border: 2px solid #000000 !important;
    box-shadow: 4px 4px 0px 0px #000000 !important;
}

.theme-brutalist [data-id-left-sidebar] button[style*="linear-gradient"]:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px 0px #000000 !important;
}

.theme-brutalist [data-id-left-sidebar] button[style*="linear-gradient"]:active {
    transform: translate(1px, 1px);
    box-shadow: 0px 0px 0px 0px #000000 !important;
}

/* Square off the dock and bottom controls */
.theme-brutalist #mobile-nav,
.theme-brutalist .dock-container {
    border-radius: 0px !important;
    border-top: 3px solid #000000 !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    background: var(--bg) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

/* Style buttons inside the dock to be independent floating blocks */
.theme-brutalist #mobile-nav button,
.theme-brutalist .dock-container button {
    background: #ffffff;
    border: 2px solid #000000;
    box-shadow: 4px 4px 0px 0px #000000;
    margin: 0 4px;
    height: 48px;
    padding: 0 16px;
    /* Ensure icon/text layout works */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s, box-shadow 0.1s;
}

.theme-brutalist #mobile-nav button:hover,
.theme-brutalist .dock-container button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px 0px #000000;
}

.theme-brutalist #mobile-nav button:active,
.theme-brutalist .dock-container button:active {
    transform: translate(1px, 1px);
    box-shadow: 0px 0px 0px 0px #000000;
}

/* Login Button in Sidebar Footer */
.theme-brutalist [data-id-left-sidebar] .flex-shrink-0 button {
    border-radius: 0px !important;
}


/* === GLOBAL DESIGN DEFAULTS === */
/* Background elements visibility controlled by [data-bg-style] rules below */
/* See lines 2250+ for solid/gradient/grid/waves visibility rules */


/* Sidebar styling (theme-driven) */
[data-id-left-sidebar] {
    background: var(--bg-alt);
    border-right: none;
    backdrop-filter: none;
    margin-bottom: 0;
    opacity: 1;
}

/* Calc card styling - MOVED TO CALLER (index.html Tailwind classes) */
/* Components should be unstyled (shadcn-style), caller controls styling */
/* [data-calc-wrapper] {
    background: var(--calc-bg-color);
    border: 1px solid var(--calc-card-border);
    box-shadow: var(--calc-card-shadow);
} */

/* Hide header (logo is in sidebar) */
[data-id-header] {
    display: none !important;
}

/* Hide top center nav */
.fixed.top-3 {
    display: none !important;
}

/* Right rail - force width 0 when no panel */
[data-id-right-rail] aside:not([style*="rail-width-expanded"]) {
    width: 0 !important;
    min-width: 0 !important;
    background: transparent !important;
    border: none !important;
}

/* When panel IS open */
[data-id-right-rail] aside[style*="rail-width-expanded"] {
    background: var(--bg-alt) !important;
}

/* Floating toolbar tooltip styling */
.genius-btn {
    position: relative;
}

.genius-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--text);
    color: var(--bg);
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    z-index: 50;
}

.genius-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* === BRUTALIST FLOATING TOOLBAR FIX === */
.theme-brutalist [data-id="desktop-dock"]>div {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

.theme-brutalist [data-id="desktop-dock"] button {
    border: 2px solid #000000 !important;
    box-shadow: 4px 4px 0px 0px #000000 !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
}

.theme-brutalist [data-id="desktop-dock"] button:hover {
    transform: translate(-1px, -1px);
    box-shadow: 6px 6px 0px 0px #000000 !important;
}

.theme-brutalist [data-id="desktop-dock"] button:active {
    transform: translate(1px, 1px);
    box-shadow: 0px 0px 0px 0px #000000 !important;
}

/* === ART DECO THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-deco {
    position: relative;
}

.theme-deco::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent 0px, rgba(212, 175, 55, 0.03) 1px, transparent 2px, transparent 20px),
        repeating-linear-gradient(90deg, transparent 0px, rgba(212, 175, 55, 0.03) 1px, transparent 2px, transparent 20px);
    pointer-events: none;
    z-index: -1;
}

.theme-deco .deco-border {
    border-image: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #d4af37 100%) 1;
    border-width: 2px;
    border-style: solid;
}

.theme-deco h1,
.theme-deco h2,
.theme-deco h3 {
    font-style: italic;
    letter-spacing: 0.05em;
}

/* === CYBERPUNK THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-cyber {
    position: relative;
}

.theme-cyber::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 0, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.theme-cyber .cyber-glitch {
    position: relative;
}

.theme-cyber .cyber-glitch:hover::before,
.theme-cyber .cyber-glitch:hover::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.theme-cyber .cyber-glitch:hover::before {
    animation: glitch-1 0.3s infinite;
    color: #ff00ff;
    z-index: -1;
}

.theme-cyber .cyber-glitch:hover::after {
    animation: glitch-2 0.3s infinite;
    color: #00f0ff;
    z-index: -2;
}

@keyframes glitch-1 {

    0%,
    100% {
        transform: translate(0);
    }

    33% {
        transform: translate(-2px, 2px);
    }

    66% {
        transform: translate(2px, -1px);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        transform: translate(0);
    }

    33% {
        transform: translate(2px, -2px);
    }

    66% {
        transform: translate(-2px, 1px);
    }
}

/* === NORDIC THEME === (Variables now in THEME_CONFIG_V2) === */

.theme-nordic .glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.theme-nordic .animate-in {
    animation: fadeSlideIn 0.6s ease-out forwards;
}

/* === RETRO THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-retro {
    position: relative;
}

.theme-retro::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 30% 30%, rgba(255, 182, 193, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(255, 107, 157, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.theme-retro .crt-effect {
    position: relative;
    animation: crt-flicker 0.2s infinite;
}

@keyframes crt-flicker {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.98;
    }
}

/* === SYNTHWAVE THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-synthwave {
    position: relative;
}

.theme-synthwave::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(0deg, transparent 24%, rgba(255, 0, 255, 0.05) 25%, rgba(255, 0, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.05) 75%, rgba(0, 255, 255, 0.05) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 0, 255, 0.05) 25%, rgba(255, 0, 255, 0.05) 26%, transparent 27%, transparent 74%, rgba(0, 255, 255, 0.05) 75%, rgba(0, 255, 255, 0.05) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.theme-synthwave .neon-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

/* === NEWSPAPER THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-newspaper {
    position: relative;
}

.theme-newspaper::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0, 0, 0, 0.02) 1px, rgba(0, 0, 0, 0.02) 2px);
    pointer-events: none;
    z-index: -1;
}

.theme-newspaper h1,
.theme-newspaper h2,
.theme-newspaper h3 {
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

/* === CHALKBOARD THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-chalkboard {
    position: relative;
}

.theme-chalkboard::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse at top left, rgba(255, 255, 255, 0.02), transparent),
        radial-gradient(ellipse at bottom right, rgba(255, 255, 255, 0.02), transparent);
    pointer-events: none;
    z-index: -1;
}

.theme-chalkboard * {
    font-weight: 700 !important;
}

/* === BLUEPRINT THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-blueprint {
    position: relative;
}

.theme-blueprint::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(0deg, transparent 0px, rgba(255, 255, 255, 0.05) 1px, transparent 2px, transparent 10px),
        repeating-linear-gradient(90deg, transparent 0px, rgba(255, 255, 255, 0.05) 1px, transparent 2px, transparent 10px);
    pointer-events: none;
    z-index: -1;
}

.theme-blueprint * {
    letter-spacing: 0.05em;
}

/* === NEON TOKYO THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-neon-tokyo {
    position: relative;
}

.theme-neon-tokyo::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(255, 23, 68, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(0, 229, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.theme-neon-tokyo .neon-text {
    text-shadow: 0 0 5px currentColor, 0 0 15px currentColor, 0 0 30px currentColor;
}

/* === GAMEBOY THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-gameboy {
    position: relative;
    image-rendering: pixelated;
}

.theme-gameboy::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, transparent 0px, rgba(155, 188, 15, 0.03) 1px, transparent 2px, transparent 4px),
        repeating-linear-gradient(90deg, transparent 0px, rgba(155, 188, 15, 0.03) 1px, transparent 2px, transparent 4px);
    pointer-events: none;
    z-index: -1;
}

.theme-gameboy * {
    font-weight: 400 !important;
}

/* === VAPORWAVE THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-vaporwave {
    position: relative;
}

.theme-vaporwave::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(0deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: -1;
    animation: vaporScroll 20s linear infinite;
}

@keyframes vaporScroll {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 0 100px;
    }
}

/* === HACKER THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-hacker {
    position: relative;
}

.theme-hacker::after {
    content: 'ACCESS GRANTED';
    position: fixed;
    top: 20px;
    right: 20px;
    color: var(--accent);
    font-size: 10px;
    opacity: 0.3;
    font-family: 'Major Mono Display', monospace;
    pointer-events: none;
    z-index: -1;
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    49%,
    51%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0;
    }
}

/* === MIDNIGHT THEME === (Variables now in THEME_CONFIG_V2) === */

/* === SUNSET THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-sunset {
    position: relative;
}

.theme-sunset::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at bottom, rgba(255, 107, 107, 0.2) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* === INDUSTRIAL THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-industrial {
    position: relative;
}

.theme-industrial::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(90deg, transparent 0px, rgba(255, 140, 0, 0.02) 1px, transparent 2px, transparent 100px);
    pointer-events: none;
    z-index: -1;
}

/* === FOREST THEME === (Variables now in THEME_CONFIG_V2) === */

/* === LUXURY THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-luxury {
    position: relative;
}

.theme-luxury::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(212, 175, 55, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* === PASTEL THEME === (Variables now in THEME_CONFIG_V2) === */

/* === GRUNGE THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-grunge {
    position: relative;
}

.theme-grunge::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="noise"><feTurbulence baseFrequency="0.9" /></filter><rect width="200" height="200" filter="url(%23noise)" opacity="0.05"/></svg>');
    pointer-events: none;
    z-index: -1;
}

/* === NEON NOIR THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-neon-noir {
    position: relative;
}

.theme-neon-noir::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 40%, rgba(255, 0, 110, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 60%, rgba(0, 255, 255, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

/* === AMBER TERMINAL THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-amber {
    position: relative;
}

.theme-amber::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(0deg, transparent 0px, rgba(255, 176, 0, 0.03) 1px, transparent 2px, transparent 3px);
    pointer-events: none;
    z-index: -1;
    animation: scanline 8s linear infinite;
}

/* === COSMIC THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-cosmic {
    position: relative;
}

.theme-cosmic::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, white, transparent),
        radial-gradient(2px 2px at 60% 70%, white, transparent),
        radial-gradient(1px 1px at 50% 50%, white, transparent),
        radial-gradient(1px 1px at 80% 10%, white, transparent),
        radial-gradient(2px 2px at 90% 60%, white, transparent),
        radial-gradient(1px 1px at 33% 50%, white, transparent),
        radial-gradient(1px 1px at 66% 90%, white, transparent);
    background-size: 200% 200%;
    opacity: 0.5;
    pointer-events: none;
    z-index: -1;
}

/* === CUTE THEME === (Variables now in THEME_CONFIG_V2) === */
.theme-cute {
    position: relative;
}

.theme-cute::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(122, 178, 221, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(144, 200, 239, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* More padding on row input fields for cute theme */
[data-theme="theme-cute"] calc row input,
[data-theme="theme-cute"] calc row textarea {
    padding: 4px 12px !important;
}

/* === UNIFIED WINDOW MODE (can be applied to any theme) === */
.unified-window {
    padding: 2rem !important;
}


.unified-window .content-wrapper {
    background: var(--bg-alt);
    border-radius: var(--radius-surface, 24px);
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.1),
        0 4px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.unified-window aside {
    opacity: 0.95;
}

.unified-window header {
    opacity: 0.95;
}

/* === SECTION BORDERS CONTROL === */
/* Subtle borders (default) - low opacity - Removed, use Tailwind classes */

/* When borders are set to visible, make them more prominent */
.border-opacity-100 {
    border-opacity: 1 !important;
}

/* === MAIN CONTENT STYLING === */
/* Removed - use Tailwind classes instead */

/* === CALC STYLE VARIANTS === */

/* Base calc holder - ensure it uses pure background color for visual hierarchy */
#calc-holder {
    background: var(--bg);
}

/* Built-in calc mode - merges calc into background, no visual separation */
.calc-built-in main {
    border-radius: 0;
    box-shadow: none !important;
    margin: 0 !important;
    background: transparent !important;
}

.calc-built-in #calc-holder {
    box-shadow: none !important;
}

/* === CALC TOOLBAR POSITION VARIANTS === */

/* Inline (default) - naturally positioned below calc */
.calc-toolbar-inline #calc-toolbar-holder {
    position: relative;
}

/* Bottom Bar - fixed to viewport bottom like mobile nav */
.calc-toolbar-bottom-bar #calc-toolbar-holder {
    position: fixed;
    bottom: 0;
    left: 320px;
    right: 0;
    z-index: 40;
    background: var(--bg-alt);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.calc-toolbar-bottom-bar main {
    padding-bottom: 5rem !important;
    /* Space for fixed bottom bar */
}

/* Top Bar - fixed to viewport top like menu bar */
.calc-toolbar-top-bar #calc-toolbar-holder {
    position: fixed;
    top: 0;
    left: 320px;
    right: 0;
    z-index: 40;
    background: var(--bg-alt);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.calc-toolbar-top-bar main {
    padding-top: 5rem !important;
    /* Space for fixed top bar */
}

/* Sidebar Left */
.calc-toolbar-sidebar-left #calc-toolbar-holder {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    background: var(--bg-alt);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 0.75rem;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Right */
.calc-toolbar-sidebar-right #calc-toolbar-holder {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    background: var(--bg-alt);
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    padding: 1rem 0.75rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Make toolbar buttons stack vertically in sidebar modes */
.calc-toolbar-sidebar-left #calc-toolbar-holder>div,
.calc-toolbar-sidebar-right #calc-toolbar-holder>div {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.calc-toolbar-sidebar-left #calc-toolbar-holder button,
.calc-toolbar-sidebar-right #calc-toolbar-holder button {
    writing-mode: horizontal-tb;
    min-width: 2.5rem;
}

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

/* Note: Common utilities moved to tailwind.config.js for responsive variant support:
   - bg-default, bg-secondary
   - text-color-default, text-color-calc, text-color-active, text-color-muted
   - border-color-soft
   - hover-bg-button, hover-text-color-active
*/



/* Shared dropdown surface + item layout */
.hs-dropdown-menu {
    background: var(--dropdown-surface);
    border: 1px solid var(--dropdown-border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--dropdown-shadow);
    padding: 0.5rem;
    z-index: 500;
}

.hs-dropdown-menu :where(a, button) {
    display: grid;
    grid-template-columns: 1.25rem auto;
    align-items: center;
    gap: 0.65rem;
}

.hs-dropdown-menu :where(a.flex, button.flex) {
    gap: 0.75rem;
    align-items: center;
}

.hs-dropdown-menu :where(a.flex svg, button.flex svg) {
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 1.15rem;
}

.hs-dropdown-menu :where(a svg, button svg) {
    width: 1.15rem;
    height: 1.15rem;
}

.hs-dropdown-menu select {
    width: 100%;
    border-radius: var(--radius-control);
    border: 1px solid var(--dropdown-border-color);
    background: var(--dropdown-surface);
    color: var(--text);
    padding: 0.45rem 0.75rem;
}

.menu-surface {
    background: var(--dropdown-surface);
    border: 1px solid var(--dropdown-border-color);
    border-radius: var(--radius-base);
    box-shadow: var(--dropdown-shadow);
    color: var(--text);
    padding: 0.5rem;
    backdrop-filter: blur(12px);
}

.menu-item {
    display: grid;
    grid-template-columns: 1.25rem auto;
    align-items: center;
    gap: 0.65rem;
    border-radius: var(--radius-control);
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.3rem;
    color: var(--text);
    transition: background 150ms ease, color 150ms ease;
}

.menu-item svg {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 1.05rem;
}

.menu-item:hover,
.menu-item:focus-visible {
    background: color-mix(in srgb, var(--accent, #3b82f6) 14%, transparent);
    color: var(--text);
}

.menu-item:active {
    background: color-mix(in srgb, var(--accent, #3b82f6) 22%, transparent);
}

.menu-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: color-mix(in srgb, var(--text) 70%, transparent);
    margin-bottom: 0.35rem;
    display: block;
}

.menu-surface select {
    width: 100%;
    border-radius: var(--radius-control);
    border: 1px solid var(--dropdown-border-color);
    background: var(--dropdown-surface);
    color: var(--text);
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
    .dark\:bg-gray-800 {
        background-color: var(--bg-alt) !important;
    }

    .dark\:border-gray-700 {
        border-color: color-mix(in srgb, var(--border-color) 50%, transparent) !important;
    }

    .dark\:divide-gray-700>*+* {
        border-color: color-mix(in srgb, var(--border-color) 50%, transparent) !important;
    }
}

.ct-chart {
    position: relative;
    width: 100%;
}







/* === 1984 THEME - Retro Terminal Theme === */
/* Visual effects only - colors are defined in theme.js */

/* Logo with CRT glow */
[data-theme="theme-1984"] .logo,
[data-theme="theme-1984"] .logo-text {
    text-shadow: 0 0 3px var(--text);
}

/* Logo is hidden via .theme-1984 [data-id="header-logo"] { display: none } */
/* 1984 theme alternate logo shown via .theme-1984 [data-id="header-logo-1984"] { display: flex } */

[data-theme="theme-1984"] * {
    border-radius: 0 !important;
}

/* Main Calculator Container */
body[data-theme="theme-1984"] div[style*="box-shadow: var(--calc-card-shadow)"] {
    position: relative;
}

/* Global scanline effect on entire page for CRT monitor look */
[data-theme="theme-1984"] body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.075) 50%);
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

/* Scanline effect on calc card */
[data-theme="theme-1984"] div[style*="box-shadow: var(--calc-card-shadow)"]::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.1) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* Scanlines on sidebar panels */
[data-theme="theme-1984"] div[style*="box-shadow: var(--sidebar-card-shadow)"] {
    position: relative;
}

[data-theme="theme-1984"] div[style*="box-shadow: var(--sidebar-card-shadow)"]::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.075) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 10;
}

/* CRT glow effect on all text */
[data-theme="theme-1984"] * {
    text-shadow: 0 0 2px color-mix(in srgb, var(--text) 20%, transparent);
}

/* User info */
body[data-theme="theme-1984"] userinfo img {
    filter: grayscale(100%) brightness(150%) contrast(200%);
}

/* Old calc element selector for backwards compatibility */
[data-theme="theme-1984"] {
    --calc-row-selected-ring: 0 0 8px var(--text);
}

[data-theme="theme-1984"] calc {
    animation: flicker 0.30s infinite;
}

@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 15ch
    }
}

/* Font Hand (custom handwritten font) styles */
.font-hand calc {
    /* want backup characters for emoji */
    font-family: "InstaCalc", Inter;
}

.font-hand calc c2 {
    font-size: 160%;
}

.font-hand calc c1 {
    font-size: 160%;
}

.font-hand rows row {
    margin-bottom: .5rem;
}

.font-hand calc number {
    font-size: 110%;
}

.font-hand log,
.font-hand parsed {
    font-family: 'Inter';
}

/* ============================================ */
/* MERGED FROM effects.css */
/* ============================================ */

/* CSS Variables are set dynamically by theme.js - no defaults needed here */

/* Hide the description editor in CalcToolbar */
calctoolbar>.mb-4 {
    display: none;
}

/* Essential animations */
@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -30px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Subtle pop animation for interactive elements */
@keyframes selectPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* JS-triggered pop animation class */
.animate-pop {
    animation: selectPop 0.15s ease-out;
}

/* Fun bounce animation for dock buttons - vertical bump */
@keyframes bounce {
    0% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-3px);
    }

    50% {
        transform: translateY(0);
    }

    70% {
        transform: translateY(-1.5px);
    }

    100% {
        transform: translateY(0);
    }
}

.animate-bounce-click {
    animation: bounce 0.3s ease-out;
}

/* Global press feedback for buttons and clickable elements */
button:not(.no-animate):not(:disabled),
[role="button"]:not(.no-animate),
a.cursor-pointer:not(.no-animate),
li.cursor-pointer:not(.no-animate),
.calc-item:not(.no-animate),
.calclist-item:not(.no-animate) {
    transition: transform 0.1s ease-out;
}

button:active:not(.no-animate):not(:disabled),
[role="button"]:active:not(.no-animate),
a.cursor-pointer:active:not(.no-animate),
li.cursor-pointer:active:not(.no-animate),
.calc-item:active:not(.no-animate),
.calclist-item:active:not(.no-animate) {
    transform: scale(0.97);
}

@media (hover: none),
(pointer: coarse) {
    .group-hover\/calc\:flex {
        display: none;
    }
}

/* Exclude elements that shouldn't animate */
input,
textarea,
[role="menuitem"],
row,
.no-animate,
.no-animate:active {
    transform: none !important;
}

/* Coordinate calc wrapper visibility with React's isReady state */
/* Hide wrapper until React sets calc-ready class - prevents flicker */
/* [data-calc-wrapper]:not(.calc-ready) {
    opacity: 0;
} */

/* Calc appears instantly when ready - no animation needed */
[data-calc-wrapper].calc-ready {
    opacity: 1;
}

/* Grid layout is now handled by ic.tailwind.css via data attributes - no override needed */


/* Background image support (for Omarchy themes) */
body {
    background-color: var(--bg);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

/* Gradient overlay with intensity control */
/* Also resets 1984 theme scanline properties when switching themes */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: var(--bg-image, none);
    /* Reset scanline background - explicitly override 1984 theme */
    background: var(--bg-image, none);
    background-size: cover;
    background-position: center;
    opacity: var(--gradient-intensity, 0.1);
    pointer-events: none;
    /* Reset z-index from 1984 theme's 9999 */
    z-index: -1;
    /* Reset scanline animation */
    animation: none;
}

/* Animated background grid */
.grid-bg {
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: var(--grid-size, 50px) var(--grid-size, 50px);
    animation: gridMove 60s linear infinite;
    pointer-events: none;
}

/* Gradient orbs */
.orb {
    filter: blur(80px);
    opacity: var(--orb-opacity);
    animation: float 15s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -10%;
    background: linear-gradient(135deg, var(--accent), var(--accent-bright));
}

.orb-2 {
    width: 400px;
    height: 400px;
    top: 40%;
    right: -5%;
    background: linear-gradient(135deg, var(--accent-tertiary), var(--accent-bright));
    animation-delay: 5s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    bottom: -10%;
    left: 30%;
    background: linear-gradient(135deg, var(--accent), var(--accent-tertiary));
    animation-delay: 2s;
}

/* Sidebar visibility (Alpine-controlled) */
.sidebar.collapsed {
    opacity: 0;
    pointer-events: none;
}

.sidebar.collapsed:hover,
.sidebar.collapsed.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============================================ */
/* MERGED FROM inline styles in index.html */
/* ============================================ */

/* Alpine.js cloak utility */
/* (Note: This was already defined earlier in the file at line 937, keeping for reference) */

/* Calcy AI icon theme-aware color overlay */
.calcy-icon-overlay {
    mix-blend-mode: multiply;
    opacity: 0.7;
}

body.theme-light .calcy-icon-overlay {
    mix-blend-mode: darken;
    opacity: 0.15;
}

/* ============================================ */
/* ALPINE.JS TRANSITION UTILITIES */
/* ============================================ */

/* Panel slide transitions - used by sidebar panels */
.panel-slide-enter {
    @apply transition-all duration-300 ease-out;
}

.panel-slide-enter-start {
    @apply translate-x-8 opacity-0;
}

.panel-slide-enter-end {
    @apply translate-x-0 opacity-100;
}

.panel-slide-leave {
    @apply absolute inset-0 transition-all duration-200 ease-in;
}

.panel-slide-leave-start {
    @apply translate-x-0 opacity-100;
}

.panel-slide-leave-end {
    @apply -translate-x-8 opacity-0;
}

/* Icon spin transitions - used by toggle buttons */
.icon-spin-enter {
    @apply transition-all duration-200 ease-out;
}

.icon-spin-enter-start {
    @apply scale-75 rotate-90 opacity-0;
}

.icon-spin-enter-end {
    @apply scale-100 rotate-0 opacity-100;
}

.icon-spin-leave {
    @apply transition-all duration-150 ease-in;
}

.icon-spin-leave-start {
    @apply scale-100 rotate-0 opacity-100;
}

.icon-spin-leave-end {
    @apply scale-75 -rotate-90 opacity-0;
}

/* Icon spin transitions (reverse direction) */
.icon-spin-reverse-enter {
    @apply transition-all duration-200 ease-out;
}

.icon-spin-reverse-enter-start {
    @apply scale-75 -rotate-90 opacity-0;
}

.icon-spin-reverse-enter-end {
    @apply scale-100 rotate-0 opacity-100;
}

.icon-spin-reverse-leave {
    @apply transition-all duration-150 ease-in;
}

.icon-spin-reverse-leave-start {
    @apply scale-100 rotate-0 opacity-100;
}

.icon-spin-reverse-leave-end {
    @apply scale-75 rotate-90 opacity-0;
}

/* Expand/collapse transitions - used by floating nav */
/* GPU-accelerated: uses transform instead of max-width */
.expand-collapse-enter {
    transition: transform var(--toolbar-close-duration) ease-out, opacity var(--toolbar-close-duration) ease-out;
}

.expand-collapse-enter-start {
    @apply opacity-0 scale-x-0 origin-left;
}

.expand-collapse-enter-end {
    @apply opacity-100 scale-x-100;
}

.expand-collapse-leave {
    transition: transform var(--toolbar-close-duration) ease-in, opacity var(--toolbar-close-duration) ease-in;
}

.expand-collapse-leave-start {
    @apply opacity-100 scale-x-100 origin-left;
}

.expand-collapse-leave-end {
    @apply opacity-0 scale-x-0;
}

/* ============================================ */
/* BOX SHADOW UTILITIES */
/* ============================================ */
/* Note: These utilities are now defined in tailwind.config.js */
/* This ensures responsive variants (lg:, md:, etc.) work correctly */

/* ============================================ */
/* HEADER CARD STYLING */
/* ============================================ */
/* Note: This utility is now defined in tailwind.config.js */

/* ============================================ */
/* COLOR-MIX UTILITIES */
/* ============================================ */

/* Accent color-mix intensity levels (light → medium → heavy → strong) */
:root {
    --accent-mix-light: color-mix(in srgb, var(--accent) 6%, transparent);
    --accent-mix-medium: color-mix(in srgb, var(--accent) 12%, transparent);
    --accent-mix-heavy: color-mix(in srgb, var(--accent) 18%, transparent);
    --accent-mix-strong: color-mix(in srgb, var(--accent) 40%, transparent);

    /* Common bg-secondary color-mix percentages */
    --bg-secondary-mix-40: color-mix(in srgb, var(--bg-alt) 40%, transparent);

    /* Common calc-card-bg color-mix percentages */
    --calc-bg-color-mix-90: color-mix(in srgb, var(--calc-bg-color) 90%, rgba(15, 20, 40, 0.85));
    --calc-bg-color-mix-92: color-mix(in srgb, var(--calc-bg-color) 92%, rgba(10, 10, 20, 0.75));
}

/* Ensure calc inputs inherit theme styling in new layout */
.new-layout-mode .calc-row input {
    background: var(--new-layout-card-bg) !important;
    border: 1px solid var(--new-layout-border) !important;
    color: var(--new-layout-text) !important;
}

/* General style for selected calculator rows - highlight only the input/textarea */
row.selected .rowInput,
row.selected .rowTextarea,
row.selected [data-calc-input] input {
    box-shadow: var(--calc-row-selected-ring);
    border-radius: var(--radius-base);
}

/* === THEME SPECIFIC OVERRIDES (Moved from JS) === */

/* [data-theme="theme-morning"] override removed to respect JS config */

/* Minimal dock style - removes background/blur/shadow for cleaner look */
[data-dock-style="minimal"] {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

/* Background style controls via data attribute */
/* Default: hide all background effects */
.grid-bg,
.gradient-bg {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Solid background - hide everything, reset to plain background */
[data-bg-style="solid"] .grid-bg,
[data-bg-style="solid"] .gradient-bg {
    opacity: 0;
}

[data-bg-style="solid"],
[data-bg-style="solid"] body {
    background: var(--bg) !important;
}

/* Grid background - show grid, hide orbs */
[data-bg-style="grid"] .grid-bg {
    opacity: 1;
}

[data-bg-style="grid"] .gradient-bg {
    opacity: 0;
}

/* Gradient background - smooth diagonal sweep from top-left to bottom-right */
.gradient-bg {
    background: linear-gradient(135deg,
            color-mix(in srgb, var(--accent) 60%, transparent) 0%,
            transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Gradient mode - show gradient-bg, hide grid */
[data-bg-style="gradient"] .grid-bg {
    opacity: 0;
}

[data-bg-style="gradient"] .gradient-bg {
    opacity: var(--gradient-intensity, 0.5);
}

/* Waves background - hide gradient and grid (waves are rendered by bgPlay.js) */
[data-bg-style="waves"] .grid-bg,
[data-bg-style="waves"] .gradient-bg {
    opacity: 0;
}

/* Font style controls via CSS variable --calc-font-family */
/* CSS sets variable based on data attribute */

[data-font-style="clean"] {
    --calc-font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-font-style="mono"] {
    --calc-font-family: 'JetBrains Mono', 'Courier New', monospace;
}

[data-font-style="serif"] {
    --calc-font-family: 'Lora', 'Georgia', serif;
}

[data-font-style="hand"] {
    --calc-font-family: 'InstaCalc', Inter;
}

/* Apply font to ALL elements in calc, then exclude specific ones */
[data-font-style],
[data-font-style] * {
    font-family: var(--calc-font-family) !important;
}

/* Exclude: keep system font for these */
[data-font-style] kbd,
[data-font-style] code,
[data-font-style] .font-mono,
[data-font-style] [data-radix-popper-content-wrapper],
[data-font-style] [role="menu"] {
    font-family: inherit !important;
}

/* Hand font: log/parsed stay Inter for readability */
[data-font-style="hand"] log,
[data-font-style="hand"] parsed {
    font-family: 'Inter', system-ui, sans-serif !important;
}

/* Hand font size adjustments (matches original) */
[data-font-style="hand"] c1,
[data-font-style="hand"] c2 {
    font-size: 160%;
}

[data-font-style="hand"] number {
    font-size: 110%;
}

/* Theme 1984: Swap header logo for terminal-style text */
.theme-1984 [data-id="header-logo"] {
    display: none;
}

.theme-1984 [data-id="header-logo-1984"] {
    display: flex;
}

/* 1984 theme: Use subtle border like original */
.theme-1984 {
    --1984-border-color: #2e2e2e;
    --1984-border-focus: #72f3bb;
}

/* 1984 theme: Minimal dock - no gradient, transparent, no border */
.theme-1984 [data-dock-button-style],
.theme-1984 [data-load*="panel-icons"] {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
}

/* 1984 theme: Calc card - subtle border, phosphor glow, sharp corners */
.theme-1984 .shadow-calc-card,
.theme-1984 [class*="shadow-calc-card"] {
    box-shadow: 0 0 15px color-mix(in srgb, var(--text) 12%, transparent) !important;
    border: 1px solid var(--1984-border-color) !important;
    border-radius: 0 !important;
}

/* 1984 theme: Global Reset for border radius (like Brutalist) */
.theme-1984 * {
    --radius-control: 0px !important;
    --radius-base: 0px !important;
    --radius-card: 0px !important;
    --radius-surface: 0px !important;
    --radius-sidebar: 0px !important;
}

.theme-1984 button,
.theme-1984 input,
.theme-1984 select,
.theme-1984 textarea,
.theme-1984 .rounded,
.theme-1984 .rounded-sm,
.theme-1984 .rounded-md,
.theme-1984 .rounded-lg,
.theme-1984 .rounded-xl,
.theme-1984 .rounded-2xl,
.theme-1984 .rounded-3xl,
.theme-1984 .rounded-full,
.theme-1984 [data-calc-wrapper],
.theme-1984 #mobile-nav,
.theme-1984 .dock-container,
.theme-1984 .genius-btn,
.theme-1984 [data-id-left-sidebar] li,
.theme-1984 [data-id-left-sidebar] div {
    border-radius: 0px !important;
}

/* 1984 theme: Global scanline effect for CRT monitor look */
body.theme-1984::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(transparent 50%, rgba(0, 0, 0, 0.075) 50%);
    background-size: 100% 3px;
    pointer-events: none;
    z-index: 9999;
    animation: scanline 8s linear infinite;
}

/* 1984 theme: CRT glow effect on text */
.theme-1984 * {
    text-shadow: 0 0 2px color-mix(in srgb, var(--text) 20%, transparent);
}

/* ================================================
   BEAUTIFUL CALC PRESETS
   ================================================
   These styles are activated by the data-beautiful attribute.
   CSS custom properties are set by beautiful-presets.js

   Usage:
   - In calc: //theme(glass) or //theme:glass
   - In embed URL: ?beautiful=glass
   - In code: window.applyBeautifulPreset(element, 'glass')
   ================================================ */

/* Beautiful calc card container */
[data-beautiful] .calc-card,
[data-beautiful] [data-calc-wrapper],
[data-beautiful] .instacalc-card {
    background: var(--beautiful-card-bg, var(--bg-alt));
    backdrop-filter: var(--beautiful-card-backdrop, none);
    -webkit-backdrop-filter: var(--beautiful-card-backdrop, none);
    border: var(--beautiful-card-border, 1px solid var(--border-color));
    box-shadow: var(--beautiful-card-shadow, var(--calc-card-shadow));
    border-radius: var(--beautiful-card-radius, 12px);
    padding: var(--beautiful-card-padding, 16px);
    color: var(--beautiful-text-color, var(--text));
}

/* Row gap for beautiful calcs */
[data-beautiful] .calc-rows,
[data-beautiful] [data-rows-container] {
    gap: var(--beautiful-row-gap, 8px);
}

/* Override text colors when beautiful preset defines them */
[data-beautiful] {
    --text: var(--beautiful-text-color, var(--text));
    --text-dim: var(--beautiful-text-dim, var(--text-dim));
}

/* ================================================
   PRESENTATION MODE - Polished calc display

   IMPORTANT: Mode is determined by [data-view-mode="present"] attribute
   on the <calc> element (set by React), NOT by @hero/@icon decorators.
   The data-presentation attribute on rows is ONLY used for styling
   individual rows when the calc is already in present mode.
   ================================================ */

/* Present mode layout is handled by React/Tailwind in InstaCalc.jsx
   No CSS rules needed here - the component applies classes based on displayMode */

/* NOTE: Row number visibility is handled in React via conditional rendering.
   See Row.jsx: {!isPresentMode && <RowNumber />} */

/* Present mode section tint - apply to grouped row containers */
[data-present-stack-style="tint"] .present-section-tint {
    background: var(--present-section-bg, color-mix(in srgb, var(--accent) 8%, var(--bg)));
    border-radius: var(--calc-radius, 0.75rem);
    padding: var(--section-padding, 1rem);
    width: 100%;
    box-sizing: border-box;
    justify-self: stretch;
}

/* Keep stacked rows aligned even without row backgrounds */
[data-view-mode="present"] row[data-stacked="true"] {
    display: block;
    width: 100%;
    border-radius: var(--calc-radius, 0.75rem);
}

/* Calc width - wrapper inherits max-width from CSS variable set by React */
/* Smooth transition between modes (calc uses 100%, present uses narrower width) */
[data-calc-wrapper] {
    max-width: var(--calc-max-width, 100%);
    margin-inline: auto;
    transition: max-width 0.3s ease-out;
}

/* Calcwrap max-width - controlled by view mode via CSS :has() selector
   In Present mode: constrain to xl (576px) for focused, form-like UX
   In Calc/Text mode: full width for editing flexibility */
calcwrap {
    max-width: var(--calcwrap-max-width, 100%);
    width: 100%;
    transition: max-width 0.3s ease-out;
}

calcwrap:has(calc[data-view-mode="present"]) {
    --calcwrap-max-width: var(--calcwrap-present-max-width, 100%);
}

/* ================================================
   PRESENTATION HINTS - Row styles
   ================================================

   Presentation rows use PresentationRowWrapper component
   which handles both display and edit modes in React.
   CSS here just provides basic layout support.
*/

/* Presentation rows use wrapper that spans full width */
row.presentation-row-wrapper {
    display: block !important;
}

/* Hide standard row elements when using wrapper */
row.presentation-row-wrapper row-number,
row.presentation-row-wrapper c1,
row.presentation-row-wrapper c2 {
    display: none !important;
}

/* The wrapper content spans full width */
row.presentation-row-wrapper .presentation-row {
    width: 100%;
}

/* HIDDEN ROWS - Compute but don't display */
row[data-presentation="hidden"] {
    display: none !important;
}

/* ------------------------------------------------
   HERO ROWS - Big, prominent result display
   ------------------------------------------------ */
[data-beautiful] [data-presentation="hero"],
[data-beautiful] .row-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--beautiful-hero-bg, linear-gradient(135deg, var(--accent), var(--accent-bright)));
    color: var(--beautiful-hero-text, white);
    border-radius: var(--beautiful-hero-radius, 16px);
    padding: var(--beautiful-hero-padding, 24px);
    margin: 12px 0;
    text-align: center;
}

[data-beautiful] [data-presentation="hero"] .row-result,
[data-beautiful] .row-hero .row-result {
    font-size: var(--beautiful-hero-font-size, 2.5rem);
    font-weight: 700;
    color: inherit !important;
    line-height: 1.2;
}

[data-beautiful] [data-presentation="hero"] .row-label,
[data-beautiful] .row-hero .row-label {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
    margin-bottom: 4px;
}

[data-beautiful] [data-presentation="hero"] .row-input,
[data-beautiful] [data-presentation="hero"] .row-expression,
[data-beautiful] .row-hero .row-input,
[data-beautiful] .row-hero .row-expression {
    display: none;
}

/* ------------------------------------------------
   HIDDEN ROWS - Compute but don't display
   ------------------------------------------------ */
[data-beautiful] [data-presentation="hidden"],
[data-beautiful] .row-hidden {
    display: none !important;
}

/* ------------------------------------------------
   ICON ROWS - Show icon next to label
   ------------------------------------------------ */
[data-beautiful] [data-icon] .row-label,
[data-beautiful] .row-with-icon .row-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

[data-beautiful] .row-icon {
    width: var(--beautiful-icon-size, 20px);
    height: var(--beautiful-icon-size, 20px);
    color: var(--beautiful-icon-color, var(--accent));
    flex-shrink: 0;
}

/* ------------------------------------------------
   SUMMARY BLOCKS - Interpolated text at bottom
   ------------------------------------------------ */
[data-beautiful] .calc-summary,
[data-beautiful] [data-presentation="summary"] {
    background: var(--beautiful-summary-bg, rgba(var(--accent-rgb, 59, 130, 246), 0.08));
    border: var(--beautiful-summary-border, 1px solid rgba(var(--accent-rgb, 59, 130, 246), 0.2));
    border-radius: var(--beautiful-summary-radius, 12px);
    padding: var(--beautiful-summary-padding, 16px);
    margin-top: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--beautiful-text-color, var(--text));
}

/* Summary value highlights */
[data-beautiful] .calc-summary .summary-value,
[data-beautiful] .summary-highlight {
    font-weight: 600;
    color: var(--accent);
}

/* ------------------------------------------------
   FONT FAMILY OVERRIDE
   ------------------------------------------------ */
[data-beautiful][style*="--beautiful-font-family"] .calc-card,
[data-beautiful][style*="--beautiful-font-family"] .calc-card * {
    font-family: var(--beautiful-font-family) !important;
}

/* ------------------------------------------------
   PRESET-SPECIFIC ADJUSTMENTS
   ------------------------------------------------ */

/* Social preset: Full-width sections */
[data-beautiful="social"] .calc-rows {
    padding: 20px;
}

[data-beautiful="social"] [data-presentation="hero"] {
    margin: 0;
    border-radius: 0;
}

/* Magazine preset: Refined typography */
[data-beautiful="magazine"] [data-presentation="hero"] .row-result {
    font-family: Georgia, serif;
    font-weight: 400;
    font-style: italic;
}

[data-beautiful="magazine"] .calc-summary {
    font-family: Georgia, serif;
    font-style: italic;
    border-left: 2px solid var(--beautiful-icon-color, #d4a373);
    border-right: none;
    border-top: none;
    border-bottom: none;
    background: transparent;
}

/* Gradient-pop preset: White text everywhere */
[data-beautiful="gradient-pop"] .row-label,
[data-beautiful="gradient-pop"] .row-result,
[data-beautiful="gradient-pop"] .row-comment {
    color: white !important;
}

[data-beautiful="gradient-pop"] .row-input,
[data-beautiful="gradient-pop"] input {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Neon preset: Glow effects */
[data-beautiful="neon"] [data-presentation="hero"] {
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5), 0 0 60px rgba(0, 255, 255, 0.3);
}

[data-beautiful="neon"] .row-result {
    text-shadow: 0 0 10px currentColor;
}


/* ================================================
   SLIDER / RANGE INPUT STYLING
   ================================================
   Simple slider - uses accent-color for thumb
   ================================================ */

input[type="range"]:focus {
    outline: none;
}