/* ============================================================
   XNCE Market Holidays - Frontend Styles v2.0
   Multi-template design system with full-width layout
   ============================================================ */

/* ==================== BASE VARIABLES ==================== */
.xnce-mh-container {
    --xnce-bg-primary: #0a0e17;
    --xnce-bg-secondary: #111827;
    --xnce-bg-card: #151d2c;
    --xnce-bg-card-hover: #1c2840;
    --xnce-bg-input: #0d1421;
    --xnce-border: #1e2d42;
    --xnce-border-light: #2c3e5a;
    --xnce-text-primary: #e8edf5;
    --xnce-text-secondary: #8899aa;
    --xnce-text-muted: #556677;
    --xnce-accent: #22c55e;
    --xnce-accent-dim: rgba(34,197,94,0.12);
    --xnce-accent-secondary: #f97316;
    --xnce-accent-secondary-dim: rgba(249,115,22,0.12);
    --xnce-danger: #ef4444;
    --xnce-danger-dim: rgba(239,68,68,0.10);
    --xnce-warn: #eab308;
    --xnce-warn-dim: rgba(234,179,8,0.10);
    --xnce-info: #3b82f6;
    --xnce-info-dim: rgba(59,130,246,0.10);
    --xnce-gradient-accent: linear-gradient(135deg, var(--xnce-accent), color-mix(in srgb, var(--xnce-accent) 70%, #000));
    --xnce-gradient-header: linear-gradient(135deg, var(--xnce-bg-primary) 0%, var(--xnce-bg-card) 100%);
    --xnce-shadow-sm: 0 2px 6px rgba(0,0,0,0.35);
    --xnce-shadow-md: 0 4px 20px rgba(0,0,0,0.45);
    --xnce-shadow-lg: 0 12px 48px rgba(0,0,0,0.55);
    --xnce-shadow-glow: 0 0 24px color-mix(in srgb, var(--xnce-accent) 20%, transparent);
    --xnce-radius-sm: 8px;
    --xnce-radius-md: 12px;
    --xnce-radius-lg: 18px;
    --xnce-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --xnce-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --xnce-font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
    --xnce-font-size-base: 13px;
    --xnce-cal-align: center;
    --xnce-list-align: left;
    --xnce-header-align: left;
    --xnce-cal-height: auto;
    --xnce-cal-padding: 12px;
    --xnce-cal-gap: 16px;
    --xnce-cal-day-size: 24px;
    --xnce-cal-day-font: 11px;
    --xnce-holiday-dot-size: 28px;
}

/* ==================== TEMPLATE: NEON ==================== */
.xnce-mh-tpl-neon {
    --xnce-bg-primary: #05080f;
    --xnce-bg-secondary: #0a1018;
    --xnce-bg-card: #0e1520;
    --xnce-bg-card-hover: #141e2e;
    --xnce-bg-input: #070c14;
    --xnce-border: #1a2a40;
    --xnce-border-light: #243650;
    --xnce-accent: #00ff88;
    --xnce-accent-dim: rgba(0,255,136,0.08);
    --xnce-accent-secondary: #00d4ff;
    --xnce-accent-secondary-dim: rgba(0,212,255,0.08);
    --xnce-shadow-glow: 0 0 30px rgba(0,255,136,0.12), 0 0 60px rgba(0,255,136,0.04);
}
.xnce-mh-tpl-neon .xnce-mh-header { background: linear-gradient(135deg, #05080f 0%, #0e1520 50%, rgba(0,255,136,0.02) 100%); }
.xnce-mh-tpl-neon .xnce-mh-day.xnce-mh-holiday { box-shadow: 0 0 12px rgba(0,255,136,0.35); }

/* ==================== TEMPLATE: ELEGANT ==================== */
.xnce-mh-tpl-elegant {
    --xnce-bg-primary: #0c0a0d;
    --xnce-bg-secondary: #15121a;
    --xnce-bg-card: #1a1620;
    --xnce-bg-card-hover: #221d2a;
    --xnce-bg-input: #0e0b12;
    --xnce-border: #2a2435;
    --xnce-border-light: #3a3248;
    --xnce-accent: #d4a853;
    --xnce-accent-dim: rgba(212,168,83,0.10);
    --xnce-accent-secondary: #c084fc;
    --xnce-accent-secondary-dim: rgba(192,132,252,0.10);
    --xnce-shadow-glow: 0 0 30px rgba(212,168,83,0.12);
}
.xnce-mh-tpl-elegant .xnce-mh-header { background: linear-gradient(135deg, #0c0a0d 0%, #1a1620 50%, rgba(212,168,83,0.03) 100%); }

/* ==================== TEMPLATE: OCEAN ==================== */
.xnce-mh-tpl-ocean {
    --xnce-bg-primary: #060d1a;
    --xnce-bg-secondary: #0b1628;
    --xnce-bg-card: #0f1c33;
    --xnce-bg-card-hover: #152540;
    --xnce-bg-input: #081020;
    --xnce-border: #1a2e50;
    --xnce-border-light: #264070;
    --xnce-accent: #06b6d4;
    --xnce-accent-dim: rgba(6,182,212,0.10);
    --xnce-accent-secondary: #818cf8;
    --xnce-accent-secondary-dim: rgba(129,140,248,0.10);
    --xnce-shadow-glow: 0 0 30px rgba(6,182,212,0.12);
}
.xnce-mh-tpl-ocean .xnce-mh-header { background: linear-gradient(135deg, #060d1a 0%, #0f1c33 50%, rgba(6,182,212,0.03) 100%); }

/* ==================== TEMPLATE: LIGHT ==================== */
.xnce-mh-tpl-light {
    --xnce-bg-primary: #f5f7fa;
    --xnce-bg-secondary: #ffffff;
    --xnce-bg-card: #ffffff;
    --xnce-bg-card-hover: #f0f4f8;
    --xnce-bg-input: #f5f7fa;
    --xnce-border: #e2e8f0;
    --xnce-border-light: #cbd5e1;
    --xnce-text-primary: #0f172a;
    --xnce-text-secondary: #475569;
    --xnce-text-muted: #94a3b8;
    --xnce-accent: #16a34a;
    --xnce-accent-dim: rgba(22,163,74,0.08);
    --xnce-accent-secondary: #ea580c;
    --xnce-accent-secondary-dim: rgba(234,88,12,0.08);
    --xnce-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --xnce-shadow-md: 0 4px 14px rgba(0,0,0,0.08);
    --xnce-shadow-lg: 0 10px 40px rgba(0,0,0,0.10);
    --xnce-shadow-glow: 0 0 16px rgba(22,163,74,0.10);
    /* Light template needs a dark title — slate-900 for high contrast on white bg */
    --xnce-title-color: #0f172a;
}
.xnce-mh-tpl-light .xnce-mh-header { background: linear-gradient(135deg, #f5f7fa, #ffffff); border-bottom-color: #e2e8f0; }

/* ==================== TEMPLATE: MIDNIGHT ==================== */
.xnce-mh-tpl-midnight {
    --xnce-bg-primary: #0f0f14;
    --xnce-bg-secondary: #16161e;
    --xnce-bg-card: #1c1c26;
    --xnce-bg-card-hover: #24242f;
    --xnce-bg-input: #121218;
    --xnce-border: #2a2a38;
    --xnce-border-light: #38384a;
    --xnce-accent: #a78bfa;
    --xnce-accent-dim: rgba(167,139,250,0.10);
    --xnce-accent-secondary: #f472b6;
    --xnce-accent-secondary-dim: rgba(244,114,182,0.10);
    --xnce-shadow-glow: 0 0 24px rgba(167,139,250,0.12);
}

/* ==================== RESET & CONTAINER ==================== */
.xnce-mh-container {
    font-family: var(--xnce-font);
    color: var(--xnce-text-primary);
    background: var(--xnce-bg-primary);
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0;
    line-height: 1.6;
    font-size: var(--xnce-font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* overflow-x: clip keeps horizontal overflow hidden without creating a scroll
       context (unlike overflow: hidden), so position: sticky keeps working. */
    overflow-x: clip;
    overflow-y: visible;
}
.xnce-mh-container *, .xnce-mh-container *::before, .xnce-mh-container *::after { box-sizing: border-box; }

/* Force full width — override WP theme containers */
.xnce-mh-fullwidth {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
}

/* Inner max-width wrapper (configurable via admin settings) */
.xnce-mh-inner {
    max-width: var(--xnce-page-max-width, 1600px);
    margin: 0 auto;
    padding: var(--xnce-page-padding-y, 0px) var(--xnce-page-padding-x, 40px);
}

/* ==================== LOADING ==================== */
.xnce-mh-loading-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 300px; transition: opacity 0.6s ease;
}
.xnce-mh-loading-screen.xnce-mh-hidden { opacity: 0; pointer-events: none; position: absolute; }
.xnce-mh-pulse-loader { position: relative; width: 44px; height: 44px; }
.xnce-mh-pulse-ring {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px solid var(--xnce-accent); opacity: 0;
    animation: xnce-pulse-ring 1.5s ease-out infinite;
}
.xnce-mh-pulse-dot {
    position: absolute; inset: 16px; border-radius: 50%;
    background: var(--xnce-accent); animation: xnce-pulse-dot 1.5s ease-in-out infinite;
}
@keyframes xnce-pulse-ring { 0% { transform: scale(0.5); opacity: 1; } 100% { transform: scale(2); opacity: 0; } }
@keyframes xnce-pulse-dot { 0%,100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* ==================== HEADER ==================== */
.xnce-mh-header {
    background: var(--xnce-gradient-header);
    border-bottom: 1px solid var(--xnce-border);
    padding: 12px 0 10px;
    position: relative; overflow: hidden;
}
.xnce-mh-header::before {
    content: ''; position: absolute; top: -60%; right: -5%;
    width: 500px; height: 500px;
    background: radial-gradient(circle, color-mix(in srgb, var(--xnce-accent) 5%, transparent) 0%, transparent 70%);
    pointer-events: none;
}
.xnce-mh-header-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; text-align: var(--xnce-header-align);
}
/* ---- Title ----
   High-specificity selectors + !important guard against outer theme CSS
   (many WP themes set a default color on h1/h2). Both colors are driven by
   CSS custom properties, so shortcode / admin settings can override them.

   Default palette ("scientific"):
     - "Market"   → near-white #f3f6fd (eases eye strain vs pure #fff)
     - "Holidays" → template accent (green / gold / etc. depending on template)
*/
.xnce-mh-container .xnce-mh-title {
    font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.5px;
    color: var(--xnce-title-color, #f3f6fd) !important;
}
.xnce-mh-container .xnce-mh-title span {
    color: var(--xnce-title-accent-color, var(--xnce-accent)) !important;
}

/* Server time */
.xnce-mh-server-time {
    display: flex; align-items: center; gap: 8px;
    margin-top: 8px; font-size: 13px; color: var(--xnce-text-secondary);
}
.xnce-mh-server-time svg { opacity: 0.6; flex-shrink: 0; }
.xnce-mh-tz-label {
    font-size: 12px; font-weight: 600; color: var(--xnce-accent);
    font-family: var(--xnce-font-mono);
    background: var(--xnce-accent-dim); padding: 4px 10px;
    border-radius: 4px; white-space: nowrap; min-width: fit-content;
}
.xnce-mh-clock {
    font-family: var(--xnce-font-mono); font-size: 14px; font-weight: 600;
    color: var(--xnce-accent); letter-spacing: 1px;
    background: var(--xnce-accent-dim); padding: 4px 12px;
    border-radius: 6px; white-space: nowrap;
}
.xnce-mh-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==================== TABS ==================== */
.xnce-mh-tabs {
    display: flex; gap: 2px;
    background: var(--xnce-bg-input); border-radius: var(--xnce-radius-md); padding: 3px;
}
.xnce-mh-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 20px; font-size: 13px; font-weight: 500;
    color: var(--xnce-text-secondary); background: transparent;
    border: none; border-radius: var(--xnce-radius-sm);
    cursor: pointer; transition: var(--xnce-transition); white-space: nowrap;
}
.xnce-mh-tab:hover { color: var(--xnce-text-primary); background: var(--xnce-bg-card); }
.xnce-mh-tab.xnce-mh-active {
    color: var(--xnce-accent); background: var(--xnce-bg-card); box-shadow: var(--xnce-shadow-sm);
}
.xnce-mh-tab svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ==================== CONTENT ==================== */
.xnce-mh-content { padding: 10px 0 20px; }
.xnce-mh-panel { display: none; animation: xnce-fade-in 0.45s ease; }
.xnce-mh-panel.xnce-mh-active { display: block; }
@keyframes xnce-fade-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== MONTH NAV ==================== */
.xnce-mh-month-nav {
    display: flex; align-items: center; justify-content: center;
    gap: 12px; margin-bottom: 8px;
}
.xnce-mh-nav-btn {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: 50%; color: var(--xnce-text-secondary); cursor: pointer;
    transition: var(--xnce-transition); font-size: 14px; line-height: 1;
}
.xnce-mh-nav-btn:hover { background: var(--xnce-accent); color: #fff; border-color: var(--xnce-accent); transform: scale(1.08); }
.xnce-mh-nav-label { font-size: 14px; font-weight: 600; color: var(--xnce-text-primary); min-width: 130px; text-align: center; }
.xnce-mh-today-btn {
    padding: 3px 12px; font-size: 11px; font-weight: 600;
    background: var(--xnce-accent-dim); border: 1px solid var(--xnce-accent);
    border-radius: 12px; color: var(--xnce-accent); cursor: pointer;
    transition: var(--xnce-transition); line-height: 1.4;
}
.xnce-mh-today-btn:hover { background: var(--xnce-accent); color: #fff; }

/* ==================== CALENDAR GRID (3 months — FXPro-inspired compact) ==================== */
.xnce-mh-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.xnce-mh-month-card {
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: 6px; overflow: hidden;
    transition: var(--xnce-transition);
    opacity: 0; transform: translateY(8px);
    animation: xnce-card-in 0.4s ease forwards;
    height: var(--xnce-cal-height);
}
.xnce-mh-month-card:nth-child(1) { animation-delay: 0.04s; }
.xnce-mh-month-card:nth-child(2) { animation-delay: 0.1s; }
.xnce-mh-month-card:nth-child(3) { animation-delay: 0.16s; }
@keyframes xnce-card-in { to { opacity: 1; transform: translateY(0); } }
.xnce-mh-month-card:hover { border-color: var(--xnce-border-light); box-shadow: var(--xnce-shadow-sm); }
.xnce-mh-month-card.xnce-mh-current-month { border-color: var(--xnce-accent); box-shadow: var(--xnce-shadow-glow); }

.xnce-mh-month-name {
    padding: 6px 10px; font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--xnce-border); display: flex;
    align-items: center; justify-content: center; gap: 6px;
    text-align: var(--xnce-cal-align);
    background: var(--xnce-bg-input);
}
.xnce-mh-holiday-count {
    font-size: 10px; font-weight: 600;
    color: var(--xnce-accent-secondary);
    background: var(--xnce-accent-secondary-dim);
    padding: 1px 7px; border-radius: 8px;
}
.xnce-mh-weekdays-row {
    display: grid; grid-template-columns: repeat(7, 1fr); padding: 2px var(--xnce-cal-padding) 0;
}
.xnce-mh-weekday-label {
    text-align: center; font-size: 9px; font-weight: 600;
    color: var(--xnce-text-muted); text-transform: uppercase; letter-spacing: 0.2px;
    padding: 2px 0;
}
.xnce-mh-days-grid {
    display: grid; grid-template-columns: repeat(7, 1fr); padding: 0 var(--xnce-cal-padding) 4px; gap: 1px 0;
    grid-template-rows: repeat(6, auto);
}
.xnce-mh-day {
    display: flex; align-items: center; justify-content: center;
    font-size: var(--xnce-cal-day-font); color: var(--xnce-text-secondary); border-radius: 50%;
    cursor: default; transition: var(--xnce-transition); position: relative;
    width: var(--xnce-cal-day-size); height: var(--xnce-cal-day-size); margin: 1px auto;
    line-height: 1;
}
.xnce-mh-day.xnce-mh-empty {
    opacity: 0;
    padding: 0 !important;
    width: var(--xnce-cal-day-size) !important;
    height: var(--xnce-cal-day-size) !important;
    min-width: 0 !important; min-height: 0 !important;
    pointer-events: none;
}
.xnce-mh-day.xnce-mh-today { color: var(--xnce-accent); font-weight: 700; background: var(--xnce-accent-dim); }
.xnce-mh-day.xnce-mh-holiday {
    color: #fff; font-weight: 600; cursor: pointer;
    background: var(--xnce-accent-secondary);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--xnce-accent-secondary) 35%, transparent);
    width: var(--xnce-holiday-dot-size); height: var(--xnce-holiday-dot-size);
}
.xnce-mh-day.xnce-mh-holiday.xnce-mh-full-close {
    background: var(--xnce-danger);
    box-shadow: 0 2px 10px rgba(239,68,68,0.35);
}
.xnce-mh-day.xnce-mh-holiday:hover { transform: scale(1.25); z-index: 2; }
.xnce-mh-day.xnce-mh-weekend { color: var(--xnce-text-muted); }

/* Tooltip — appended to body so uses explicit colors */
.xnce-mh-tooltip {
    position: fixed; background: #151d2c; border: 1px solid #2c3e5a;
    border-radius: 8px; padding: 10px 16px; font-size: 13px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.55); z-index: 10000; pointer-events: none;
    opacity: 0; transform: translateY(4px); transition: opacity 0.2s, transform 0.2s; max-width: 280px;
    color: #e8edf5; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.xnce-mh-tooltip.xnce-mh-visible { opacity: 1; transform: translateY(0); }
.xnce-mh-tooltip-title { font-weight: 600; margin-bottom: 3px; }
.xnce-mh-tooltip-meta { font-size: 11px; color: #8899aa; }
.xnce-mh-tooltip-badge { display: inline-block; font-size: 10px; padding: 1px 7px; border-radius: 8px; margin-top: 4px; font-weight: 600; }

/* ==================== HOLIDAY LIST ==================== */
.xnce-mh-list-section { margin-bottom: 28px; }
.xnce-mh-list-section-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: var(--xnce-text-muted);
    margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--xnce-border);
}
.xnce-mh-holiday-card {
    display: flex; align-items: center; gap: 18px; padding: 16px 22px;
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: var(--xnce-radius-md); margin-bottom: 10px; cursor: pointer;
    transition: var(--xnce-transition);
    opacity: 0; animation: xnce-list-in 0.4s ease forwards;
    text-align: var(--xnce-list-align);
}
.xnce-mh-holiday-card:hover {
    border-color: var(--xnce-accent); background: var(--xnce-bg-card-hover);
    box-shadow: var(--xnce-shadow-glow); transform: translateX(6px);
}
@keyframes xnce-list-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }

.xnce-mh-holiday-date-badge {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    width: 58px; height: 62px; background: var(--xnce-bg-input);
    border-radius: var(--xnce-radius-sm); flex-shrink: 0;
}
.xnce-mh-holiday-date-badge .xnce-mh-day-num { font-size: 22px; font-weight: 700; line-height: 1; }
.xnce-mh-holiday-date-badge .xnce-mh-month-label { font-size: 11px; text-transform: uppercase; color: var(--xnce-accent-secondary); font-weight: 600; }
.xnce-mh-holiday-info { flex: 1; min-width: 0; }
.xnce-mh-holiday-name { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.xnce-mh-holiday-meta { font-size: 12px; color: var(--xnce-text-secondary); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.xnce-mh-affected-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 999px;
    background: color-mix(in srgb, var(--xnce-accent) 12%, transparent);
    color: var(--xnce-accent);
    font-weight: 600; font-size: 11.5px;
    border: 1px solid color-mix(in srgb, var(--xnce-accent) 25%, transparent);
    letter-spacing: 0.2px;
}
.xnce-mh-affected-icon { flex-shrink: 0; opacity: 0.95; }
.xnce-mh-holiday-arrow { color: var(--xnce-text-muted); font-size: 20px; transition: var(--xnce-transition); }
.xnce-mh-holiday-card:hover .xnce-mh-holiday-arrow { color: var(--xnce-accent); transform: translateX(4px); }

/* ==================== MONTH GROUP (COLLAPSIBLE LIST) ==================== */
.xnce-mh-month-group { margin-bottom: 8px; }
.xnce-mh-month-group-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; cursor: pointer;
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: var(--xnce-radius-sm); font-size: 13px; font-weight: 600;
    color: var(--xnce-text-primary); transition: var(--xnce-transition);
    user-select: none;
}
.xnce-mh-month-group-header:hover { border-color: var(--xnce-accent); background: var(--xnce-bg-card-hover); }
.xnce-mh-month-group-header .xnce-mh-toggle-icon {
    transition: transform 0.3s ease; font-size: 14px; color: var(--xnce-text-muted);
}
.xnce-mh-month-group.xnce-mh-collapsed .xnce-mh-toggle-icon { transform: rotate(-90deg); }
.xnce-mh-month-group-body {
    max-height: 2000px; overflow: hidden; transition: max-height 0.4s ease;
    padding-top: 6px;
}
.xnce-mh-month-group.xnce-mh-collapsed .xnce-mh-month-group-body {
    max-height: 0; padding-top: 0;
}
.xnce-mh-month-group-count {
    font-size: 11px; font-weight: 600; color: var(--xnce-accent-secondary);
    background: var(--xnce-accent-secondary-dim); padding: 2px 8px; border-radius: 10px;
}

/* ==================== BADGES ==================== */
.xnce-mh-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.xnce-mh-badge-closed { background: var(--xnce-danger-dim); color: var(--xnce-danger); }
.xnce-mh-badge-modified,.xnce-mh-badge-late { background: var(--xnce-accent-secondary-dim); color: var(--xnce-accent-secondary); }
.xnce-mh-badge-early { background: var(--xnce-warn-dim); color: var(--xnce-warn); }
.xnce-mh-badge-normal { background: var(--xnce-accent-dim); color: var(--xnce-accent); }

/* ==================== WEEKDAY BADGE ==================== */
.xnce-mh-weekday-badge {
    font-size: 10px; color: var(--xnce-text-muted); font-weight: 500;
    margin-left: 4px;
}

/* ==================== TRADING HOURS ==================== */
.xnce-mh-trading-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.xnce-mh-select {
    appearance: none; background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: var(--xnce-radius-sm); padding: 10px 40px 10px 14px;
    color: var(--xnce-text-primary); font-size: 13px; cursor: pointer;
    transition: var(--xnce-transition); min-width: 180px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238899aa' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}
.xnce-mh-select:hover,.xnce-mh-select:focus { border-color: var(--xnce-accent); outline: none; }
.xnce-mh-category-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.xnce-mh-cat-btn {
    padding: 7px 16px; font-size: 12px; font-weight: 500;
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: 20px; color: var(--xnce-text-secondary); cursor: pointer;
    transition: var(--xnce-transition);
}
.xnce-mh-cat-btn:hover { border-color: var(--xnce-accent); color: var(--xnce-text-primary); }
.xnce-mh-cat-btn.xnce-mh-active { background: var(--xnce-accent); border-color: var(--xnce-accent); color: #fff; }

.xnce-mh-export-btns { display: flex; gap: 8px; }
.xnce-mh-btn {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 18px; font-size: 13px; font-weight: 500;
    border: 1px solid var(--xnce-border); border-radius: var(--xnce-radius-sm);
    cursor: pointer; transition: var(--xnce-transition);
    background: var(--xnce-bg-card); color: var(--xnce-text-secondary);
}
.xnce-mh-btn:hover { background: var(--xnce-bg-card-hover); color: var(--xnce-text-primary); border-color: var(--xnce-border-light); }
.xnce-mh-btn-primary { background: var(--xnce-gradient-accent); color: #fff; border-color: var(--xnce-accent); }
.xnce-mh-btn-primary:hover { filter: brightness(1.1); color: #fff; box-shadow: var(--xnce-shadow-glow); }
.xnce-mh-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* TABLE
   NOTE (v9): sticky <thead> requires that NO ancestor up to the scroll
   root has `overflow: hidden/auto/scroll`. We use `overflow-x: clip` on
   the wrappers instead — it clips horizontal overflow WITHOUT creating
   a new scroll context, so the thead stays sticky to the page scroll.
*/
.xnce-mh-container .xnce-mh-table-wrap {
    border-radius: var(--xnce-radius-md); border: 1px solid var(--xnce-border);
    overflow-x: clip; overflow-y: visible;
    position: relative;
    background: var(--xnce-bg-secondary) !important;
}
.xnce-mh-container .xnce-mh-table-scroll {
    overflow-x: clip; overflow-y: visible;
    background: var(--xnce-bg-secondary) !important;
}
@media (max-width: 720px) {
    /* On mobile, fall back to horizontal scroll — sticky thead still pins since
       vertical overflow stays visible. */
    .xnce-mh-table-scroll { overflow-x: auto; }
}
/* ---- TABLE ----
   Outer themes (WooCommerce, generic WP themes, etc.) frequently inject
   `background: #fff` and dark text on table/tr/td. All rules below use
   !important with high-specificity selectors to guarantee the plugin's
   dark surface + light text wins regardless of the host theme.
*/
.xnce-mh-container .xnce-mh-table {
    width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px;
    background: var(--xnce-bg-secondary) !important;
    color: var(--xnce-text-primary) !important;
}
.xnce-mh-container .xnce-mh-table thead th {
    background: var(--xnce-bg-card) !important;
    color: var(--xnce-text-secondary) !important;
    position: sticky;
    top: var(--xnce-sticky-offset, 0px);
    z-index: 20;
    box-shadow: inset 0 -2px 0 var(--xnce-border), 0 1px 0 var(--xnce-border);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.xnce-mh-container .xnce-mh-table thead th::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
    background: linear-gradient(90deg, transparent, var(--xnce-accent), transparent);
    opacity: 0; transition: opacity 0.25s ease;
}
.xnce-mh-container .xnce-mh-table thead.xnce-mh-thead-stuck th::after { opacity: 0.55; }
.xnce-mh-container .xnce-mh-table th {
    padding: 14px 18px; text-align: left; font-weight: 600; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--xnce-text-secondary) !important;
    border-bottom: 2px solid var(--xnce-border); white-space: nowrap;
}
.xnce-mh-container .xnce-mh-table td {
    padding: 12px 18px; border-bottom: 1px solid var(--xnce-border);
    transition: var(--xnce-transition);
    background: transparent !important;
    color: var(--xnce-text-primary) !important;
}
.xnce-mh-container .xnce-mh-table tbody tr {
    transition: var(--xnce-transition);
    background: var(--xnce-bg-secondary) !important;
}
.xnce-mh-container .xnce-mh-table tbody tr:nth-child(even) {
    background: var(--xnce-bg-primary) !important;
}
.xnce-mh-container .xnce-mh-table tbody tr:hover {
    background: var(--xnce-bg-card-hover) !important;
}
.xnce-mh-container .xnce-mh-table tbody tr:last-child td { border-bottom: none; }
.xnce-mh-container .xnce-mh-table tbody tr.xnce-mh-row-changed {
    background: var(--xnce-danger-dim) !important;
}
.xnce-mh-container .xnce-mh-table tbody tr.xnce-mh-row-changed:hover {
    background: color-mix(in srgb, var(--xnce-danger) 14%, transparent) !important;
}
.xnce-mh-cell-changed { color: var(--xnce-danger) !important; font-weight: 600; }
.xnce-mh-cell-symbol { font-weight: 600; font-family: var(--xnce-font-mono); letter-spacing: 0.3px; }
.xnce-mh-cell-name { font-size: 13px; word-break: break-word; }
.xnce-mh-cell-time { font-family: var(--xnce-font-mono); font-size: 13px; letter-spacing: 0.5px; }
.xnce-mh-container .xnce-mh-category-separator,
.xnce-mh-container .xnce-mh-category-separator:hover {
    background: var(--xnce-bg-input) !important;
}
.xnce-mh-container .xnce-mh-category-separator td {
    padding: 9px 18px; font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: 1px;
    color: var(--xnce-accent) !important;
    background: transparent !important;
    border-bottom-color: var(--xnce-border);
    text-align: center;
}

/* TABLE COLUMN WIDTHS */
.xnce-mh-table th:first-child, .xnce-mh-table td:first-child { width: 12%; }
.xnce-mh-table th:nth-child(2), .xnce-mh-table td:nth-child(2) { width: 16%; }
.xnce-mh-table th:nth-child(3), .xnce-mh-table td:nth-child(3) { width: 24%; }
.xnce-mh-table th:nth-child(4), .xnce-mh-table td:nth-child(4) { width: 30%; }
.xnce-mh-table th:nth-child(5), .xnce-mh-table td:nth-child(5) { width: 18%; }

/* ==================== MODAL ==================== */
.xnce-mh-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px); z-index: 99998;
    opacity: 0; transition: opacity 0.3s; display: none;
}
.xnce-mh-modal-overlay.xnce-mh-active { display: block; opacity: 1; }
.xnce-mh-modal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    background: var(--xnce-bg-secondary); border: 1px solid var(--xnce-border);
    border-radius: var(--xnce-radius-lg); box-shadow: var(--xnce-shadow-lg);
    width: 92%; max-width: 1000px; max-height: 82vh; overflow: auto;
    z-index: 99999; opacity: 0; transition: var(--xnce-transition); display: none;
}
.xnce-mh-modal.xnce-mh-active { display: block; opacity: 1; transform: translate(-50%, -50%) scale(1); }
.xnce-mh-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 28px; border-bottom: 1px solid var(--xnce-border);
}
.xnce-mh-modal-title { font-size: 18px; font-weight: 700; }
.xnce-mh-modal-close {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    background: var(--xnce-bg-input); border: 1px solid var(--xnce-border); border-radius: 50%;
    color: var(--xnce-text-secondary); cursor: pointer; font-size: 18px; transition: var(--xnce-transition);
}
.xnce-mh-modal-close:hover { background: var(--xnce-danger); color: #fff; border-color: var(--xnce-danger); }
.xnce-mh-modal-body { padding: 24px 28px; }

/* ==================== EMPTY (empty-state block; scoped to avoid hitting .xnce-mh-day.xnce-mh-empty cells) ==================== */
.xnce-mh-empty:not(.xnce-mh-day) { text-align: center; padding: 60px 20px; color: var(--xnce-text-muted); }
.xnce-mh-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.xnce-mh-empty-text { font-size: 15px; }

/* ==================== CALENDAR SCHEDULE (below calendar) ==================== */
.xnce-mh-cal-schedule {
    margin-top: 18px; padding-top: 16px;
    border-top: 1px solid var(--xnce-border);
}
.xnce-mh-cal-schedule-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--xnce-text-muted); margin-bottom: 12px;
}
.xnce-mh-cal-schedule-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 10px;
}
.xnce-mh-cal-hol-item {
    background: var(--xnce-bg-card); border: 1px solid var(--xnce-border);
    border-radius: var(--xnce-radius-sm); padding: 10px 14px;
    transition: var(--xnce-transition); cursor: pointer;
}
.xnce-mh-cal-hol-item:hover { border-color: var(--xnce-accent); background: var(--xnce-bg-card-hover); }
.xnce-mh-cal-hol-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 6px;
}
.xnce-mh-cal-hol-name { font-size: 13px; font-weight: 600; }
.xnce-mh-cal-hol-date { font-size: 11px; color: var(--xnce-text-secondary); font-family: var(--xnce-font-mono); }
.xnce-mh-cal-products {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.xnce-mh-cal-prod-tag {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 10px; padding: 2px 8px; border-radius: 10px;
    font-weight: 600; font-family: var(--xnce-font-mono);
}
.xnce-mh-cal-prod-tag.xnce-mh-tag-closed { background: var(--xnce-danger-dim); color: var(--xnce-danger); }
.xnce-mh-cal-prod-tag.xnce-mh-tag-early { background: var(--xnce-warn-dim); color: var(--xnce-warn); }
.xnce-mh-cal-prod-tag.xnce-mh-tag-late { background: var(--xnce-accent-secondary-dim); color: var(--xnce-accent-secondary); }
.xnce-mh-cal-prod-tag.xnce-mh-tag-modified { background: var(--xnce-info-dim); color: var(--xnce-info); }

/* ==================== STAGGER ANIMATION ==================== */
.xnce-mh-stagger { opacity: 0; transform: translateY(8px); animation: xnce-stagger-in 0.35s ease forwards; }
@keyframes xnce-stagger-in { to { opacity: 1; transform: translateY(0); } }

/* ==================== RESPONSIVE ==================== */
/* Optgroup styling for holiday select */
.xnce-mh-select optgroup { font-weight: 600; font-size: 12px; color: var(--xnce-text-muted); }

/* Multi-session line break in table cells */
.xnce-mh-cell-time br { margin-bottom: 2px; }

@media (max-width: 1024px) {
    .xnce-mh-calendar-grid { grid-template-columns: 1fr 1fr; }
    .xnce-mh-inner { padding: 0 24px; }
}
@media (max-width: 768px) {
    .xnce-mh-calendar-grid { grid-template-columns: 1fr; }
    .xnce-mh-inner { padding: 0 16px; }
    .xnce-mh-header { padding: 20px 0 16px; }
    .xnce-mh-header-top { flex-direction: column; align-items: flex-start; }
    .xnce-mh-title { font-size: 20px; }
    .xnce-mh-trading-header { flex-direction: column; align-items: flex-start; }
    .xnce-mh-table th, .xnce-mh-table td { padding: 10px 12px; }
    .xnce-mh-content { padding: 20px 0 32px; }
    .xnce-mh-cal-schedule-grid { grid-template-columns: 1fr; }
}

/* ==================== SCROLLBAR ==================== */
.xnce-mh-container ::-webkit-scrollbar { width: 5px; height: 5px; }
.xnce-mh-container ::-webkit-scrollbar-track { background: var(--xnce-bg-input); }
.xnce-mh-container ::-webkit-scrollbar-thumb { background: var(--xnce-border-light); border-radius: 3px; }
.xnce-mh-container ::-webkit-scrollbar-thumb:hover { background: var(--xnce-accent); }

/* ==================== v9: BUTTON STYLE VARIANTS ==================== */
/* Default style is already defined above. These blocks override for each variant. */

/* --- PILL: fully rounded, tabs/cats become oval --- */
.xnce-mh-container[data-btn-style="pill"] .xnce-mh-tab,
.xnce-mh-container[data-btn-style="pill"] .xnce-mh-cat-btn,
.xnce-mh-container[data-btn-style="pill"] .xnce-mh-btn,
.xnce-mh-container[data-btn-style="pill"] .xnce-mh-today-btn {
    border-radius: 999px;
}
.xnce-mh-container[data-btn-style="pill"] .xnce-mh-tabs { border-radius: 999px; padding: 4px; }

/* --- FLAT: square corners, no shadows --- */
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-tab,
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-cat-btn,
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-btn,
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-today-btn,
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-tabs { border-radius: 0; box-shadow: none; }
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-tab.xnce-mh-active { box-shadow: none; border-bottom: 2px solid var(--xnce-accent); }
.xnce-mh-container[data-btn-style="flat"] .xnce-mh-nav-btn { border-radius: 0; }

/* --- OUTLINE: transparent fill, accent border --- */
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-tab,
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-cat-btn,
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-btn {
    background: transparent;
    border: 1px solid var(--xnce-border);
    color: var(--xnce-text-secondary);
}
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-tabs { background: transparent; padding: 0; gap: 6px; }
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-tab.xnce-mh-active,
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-cat-btn.xnce-mh-active {
    background: transparent; border-color: var(--xnce-accent); color: var(--xnce-accent); box-shadow: none;
}
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-btn-primary {
    background: transparent; color: var(--xnce-accent); border-color: var(--xnce-accent);
}
.xnce-mh-container[data-btn-style="outline"] .xnce-mh-btn-primary:hover {
    background: var(--xnce-accent); color: #fff;
}

/* --- GRADIENT: active buttons get the accent gradient fill --- */
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-tab.xnce-mh-active,
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-cat-btn.xnce-mh-active {
    background: var(--xnce-gradient-accent); color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px -4px var(--xnce-accent);
}
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-btn-primary {
    background: var(--xnce-gradient-accent); color: #fff; border-color: transparent;
    box-shadow: 0 4px 14px -4px var(--xnce-accent);
}
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 6px 20px -4px var(--xnce-accent);
}
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-tab,
.xnce-mh-container[data-btn-style="gradient"] .xnce-mh-cat-btn { border-radius: 8px; }

/* --- MINIMAL: text-only, no fill, no border --- */
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-tab,
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-cat-btn,
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-btn {
    background: transparent; border: none; box-shadow: none; padding: 8px 10px;
}
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-tabs { background: transparent; padding: 0; gap: 4px; }
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-tab.xnce-mh-active,
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-cat-btn.xnce-mh-active {
    color: var(--xnce-accent); background: transparent; box-shadow: inset 0 -2px 0 var(--xnce-accent);
}
.xnce-mh-container[data-btn-style="minimal"] .xnce-mh-btn-primary {
    background: transparent; color: var(--xnce-accent); border: none;
    text-decoration: underline; text-underline-offset: 3px;
}

/* ==================== v9: TBD STATUS PILL ==================== */
.xnce-mh-status-tbd {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
    color: #64748b;
    background: rgba(148,163,184,0.12);
    border: 1px dashed rgba(148,163,184,0.45);
}
.xnce-mh-status-tbd::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; opacity: 0.55;
    animation: xnce-tbd-pulse 2s ease-in-out infinite;
}
@keyframes xnce-tbd-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.85; }
}
