.ezm-directory {
    --ezm-bg: #090d18;
    --ezm-panel: #121827;
    --ezm-border: rgba(148, 163, 184, 0.2);
    --ezm-text: #f8fafc;
    --ezm-muted: #94a3b8;
    --ezm-accent: #7c3aed;
    position: relative;
    left: 50%;
    width: min(calc(100vw - 32px), 1760px);
    max-width: none;
    min-height: min(820px, 100dvh);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 16px;
    color: var(--ezm-text);
    background: var(--ezm-bg);
    border: 1px solid var(--ezm-border);
    border-radius: 22px;
    box-sizing: border-box;
    color-scheme: dark;
}

.ezm-directory[data-theme="midnight"] {
    --ezm-bg: #050816;
    --ezm-panel: #0c1630;
    --ezm-border: rgba(96, 165, 250, 0.25);
    --ezm-text: #eff6ff;
    --ezm-muted: #93c5fd;
    --ezm-accent: #2563eb;
}

.ezm-directory[data-theme="light"] {
    --ezm-bg: #f8fafc;
    --ezm-panel: #ffffff;
    --ezm-border: rgba(15, 23, 42, 0.16);
    --ezm-text: #0f172a;
    --ezm-muted: #475569;
    --ezm-accent: #6d28d9;
    color-scheme: light;
}

.ezm-command-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    background: var(--ezm-panel);
    border: 1px solid var(--ezm-border);
    border-radius: 14px;
}

.ezm-command-bar > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
}

.ezm-brand-lockup { align-items: center !important; gap: 10px !important; }
.ezm-brand-lockup > div { display: flex; align-items: baseline; gap: 8px; }
.ezm-brand-mark, .ezm-tool-icon { display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--ezm-accent), #2563eb); box-shadow: 0 8px 18px rgba(37, 99, 235, .2); font-weight: 800; }
.ezm-brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 11px; letter-spacing: -.04em; }

.ezm-command-bar span,
.ezm-category {
    color: var(--ezm-muted);
    font-size: 12px;
}

.ezm-command-bar input {
    width: min(360px, 44vw);
    padding: 10px 12px;
    color: var(--ezm-text);
    background: #080b13;
    border: 1px solid var(--ezm-border);
    border-radius: 10px;
}
.ezm-search-control { display: block; }

.ezm-theme-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ezm-muted);
    font-size: 12px;
}

.ezm-theme-control select {
    min-height: 38px;
    padding: 6px 28px 6px 10px;
    color: var(--ezm-text);
    background: var(--ezm-panel);
    border: 1px solid var(--ezm-border);
    border-radius: 10px;
}

.ezm-credits {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: var(--ezm-text);
    text-decoration: none;
    background: #080b13;
    border: 1px solid var(--ezm-border);
    border-radius: 10px;
}

.ezm-credits span { font-size: 10px; letter-spacing: 0.12em; }
.ezm-credits strong { color: #c4b5fd; }

.ezm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.ezm-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 148px;
    padding: 14px;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    background: var(--ezm-panel);
    border: 1px solid var(--ezm-border);
    border-radius: 14px;
}

.ez-tools-managed-home,
.ez-tools-managed-home #page,
.ez-tools-managed-home #content,
.ez-tools-managed-home .site,
.ez-tools-managed-home .site-content,
.ez-tools-managed-home .elementor,
.ez-tools-managed-home .elementor-location-single {
    min-height: 100dvh;
    background: #090d18;
}

.ezm-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, .55); box-shadow: 0 16px 36px rgba(0,0,0,.2); }
.ezm-card[hidden] { display: none !important; }
.ezm-card-top { display: flex; align-items: center; gap: 8px; }
.ezm-tool-icon { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; font-size: 10px; }
.ezm-card h3 { margin: 0; color: var(--ezm-text); font-size: 17px; }
.ezm-title-link { color: inherit; text-decoration: none; }
.ezm-title-link:hover { color: #c4b5fd; text-decoration: underline; text-underline-offset: 3px; }
.ezm-tool-view { min-height: min(820px, 100dvh); padding: 20px; color: var(--ezm-text); background: var(--ezm-bg); border: 1px solid var(--ezm-border); border-radius: 22px; box-sizing: border-box; }
.ezm-back-link { display: inline-block; margin-bottom: 24px; color: #c4b5fd; font-weight: 700; text-decoration: none; }
.ezm-tool-view-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.ezm-tool-view-heading h1 { margin: 4px 0 0; color: var(--ezm-text); font-size: clamp(28px, 4vw, 44px); }
.ezm-tool-view-body { color: var(--ezm-text); }
.ezm-description { margin: 0; color: var(--ezm-muted); font-size: 12px; line-height: 1.4; }
.ezm-open-link { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: #ddd6fe; font-weight: 700; text-decoration: none; }
.ezm-open-link:hover { color: #fff; }
.ezm-directory-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 18px 4px 4px; }
.ezm-directory-intro h1 { margin: 4px 0 6px; color: var(--ezm-text); font-size: clamp(28px, 4vw, 46px); letter-spacing: -.04em; line-height: 1.05; }
.ezm-directory-intro p { max-width: 650px; margin: 0; color: var(--ezm-muted); line-height: 1.6; }
.ezm-eyebrow { color: #c4b5fd !important; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.ezm-result-summary { display: flex; flex-direction: column; align-items: end; min-width: 120px; color: var(--ezm-muted); }
.ezm-result-summary strong { color: var(--ezm-text); font-size: 30px; line-height: 1; }
.ezm-result-summary span { font-size: 12px; margin-top: 5px; white-space: nowrap; }
.ezm-category-nav { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 0 2px; }
.ezm-category-nav button { padding: 8px 12px; color: var(--ezm-muted); background: transparent; border: 1px solid var(--ezm-border); border-radius: 999px; cursor: pointer; font: inherit; font-size: 12px; }
.ezm-category-nav button:hover, .ezm-category-nav button.is-active { color: #fff; background: var(--ezm-accent); border-color: var(--ezm-accent); }
.ezm-footer { margin-top: auto; padding: 18px 0 4px; text-align: center; color: var(--ezm-muted); }
.ezm-empty { text-align: center; color: var(--ezm-muted); }

@media (max-width: 640px) {
    .ezm-directory { width: calc(100vw - 16px); padding: 10px; border-radius: 14px; }
    .ezm-command-bar { align-items: stretch; flex-direction: column; }
    .ezm-command-bar input { width: 100%; box-sizing: border-box; }
    .ezm-directory-intro { align-items: start; flex-direction: column; }
    .ezm-result-summary { align-items: start; }
    .ezm-grid { grid-template-columns: 1fr; }
}
