:root {
    --erd-white: #ffffff;
    --erd-surface: #f8fafc;
    --erd-surface-2: #f1f5f9;
    --erd-border: #e2e8f0;
    --erd-border-strong: #cbd5e1;
    --erd-text: #0f172a;
    --erd-muted: #64748b;
    --erd-subtle: #94a3b8;
    --erd-primary: #2563eb;
    --erd-primary-dark: #1d4ed8;
    --erd-primary-soft: #eff6ff;
    --erd-green: #059669;
    --erd-green-soft: #ecfdf5;
    --erd-amber: #d97706;
    --erd-amber-soft: #fffbeb;
    --erd-red: #dc2626;
    --erd-red-soft: #fef2f2;
    --erd-shadow: 0 16px 45px rgba(15, 23, 42, 0.07);
    --erd-radius: 18px;
}

.erd-directory,
.erd-detail-shell {
    color: var(--erd-text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.erd-directory *,
.erd-detail-shell * {
    box-sizing: border-box;
}

.erd-directory {
    max-width: 1240px;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 24px;
    padding: clamp(20px, 4vw, 44px);
    margin: 28px auto;
}

.erd-directory-hero {
    max-width: 800px;
    margin: 0 auto 32px;
    text-align: center;
}

.erd-kicker,
.erd-rank-pill,
.erd-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .02em;
}

.erd-kicker {
    color: var(--erd-primary-dark);
    background: var(--erd-primary-soft);
    border: 1px solid #dbeafe;
    padding: 7px 12px;
    margin-bottom: 14px;
}

.erd-directory-hero h2 {
    color: var(--erd-text);
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
    margin: 0 0 14px;
    letter-spacing: -.04em;
}

.erd-directory-hero p,
.erd-card-summary,
.erd-card-heading p,
.erd-detail-summary,
.erd-rich-text,
.erd-verdict {
    color: var(--erd-muted);
}

.erd-directory-hero p {
    font-size: 16px;
    line-height: 1.75;
    margin: 0;
}

.erd-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.erd-card {
    min-width: 0;
    background: var(--erd-white);
    border: 1px solid var(--erd-border);
    border-radius: var(--erd-radius);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.erd-card:hover {
    transform: translateY(-3px);
    border-color: #93c5fd;
    box-shadow: var(--erd-shadow);
}

.erd-card-link {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 20px;
}

.erd-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 25px;
    margin-bottom: 18px;
}

.erd-rank-pill {
    color: var(--erd-primary-dark);
    background: var(--erd-primary-soft);
    border: 1px solid #bfdbfe;
    padding: 6px 10px;
}

.erd-card-audited,
.erd-audit-line {
    color: var(--erd-subtle);
    font-size: 11px;
}

.erd-card-heading {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.erd-card-heading h3 {
    color: var(--erd-text);
    font-size: 20px;
    line-height: 1.2;
    margin: 0 0 5px;
    letter-spacing: -.02em;
}

.erd-card-heading p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.erd-card-logo,
.erd-detail-logo,
.erd-alternative-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--erd-logo-bg, #eff6ff);
    color: var(--erd-logo-color, #1d4ed8);
    border: 1px solid var(--erd-border);
}

.erd-card-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
}

.erd-card-logo img,
.erd-detail-logo img,
.erd-alternative-logo img {
    width: 76%;
    height: 76%;
    object-fit: contain;
}

.erd-card-logo b,
.erd-detail-logo b,
.erd-alternative-logo b {
    font-size: 17px;
    font-weight: 900;
}

.erd-logo-fallback,
.erd-alternative-logo-fallback {
    display: inline-flex;
}

.erd-card-logo img + .erd-logo-fallback,
.erd-detail-logo img + .erd-logo-fallback,
.erd-alternative-logo img + .erd-alternative-logo-fallback {
    display: none;
}

.erd-badge {
    color: var(--erd-green);
    background: var(--erd-green-soft);
    border: 1px solid #a7f3d0;
    padding: 6px 10px;
    margin: 18px 0 0;
}

.erd-card-summary {
    display: -webkit-box;
    overflow: hidden;
    min-height: 44px;
    margin: 14px 0 18px;
    font-size: 13px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.erd-card-stats,
.erd-detail-stats,
.erd-fact-grid {
    display: grid;
    margin: 0;
}

.erd-card-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--erd-border);
}

.erd-card-stats div,
.erd-detail-stats div {
    min-width: 0;
}

.erd-card-stats dt,
.erd-detail-stats dt,
.erd-fact-grid dt {
    color: var(--erd-subtle);
    font-size: 11px;
    line-height: 1.35;
}

.erd-card-stats dd {
    overflow: hidden;
    max-width: 100%;
    color: var(--erd-text);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    margin: 4px 0 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow-wrap: anywhere;
    white-space: normal;
}

.erd-card-volume {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    margin-top: 14px;
    border-top: 1px solid var(--erd-border);
    color: var(--erd-muted);
    font-size: 12px;
}

.erd-card-volume strong {
    color: var(--erd-text);
    text-align: right;
    font-size: 12px;
}

.erd-card-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--erd-primary-dark) !important;
    background: var(--erd-primary-soft);
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 10px 12px;
    margin-top: auto;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
}

.erd-card-button:hover {
    background: #dbeafe;
}

.erd-empty {
    color: var(--erd-muted);
    background: var(--erd-white);
    border: 1px dashed var(--erd-border-strong);
    border-radius: 14px;
    padding: 24px;
    text-align: center;
}

.erd-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}

.erd-page-link a,
.erd-page-link span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    color: var(--erd-muted);
    background: var(--erd-white);
    border: 1px solid var(--erd-border);
    border-radius: 9px;
    padding: 0 11px;
    text-decoration: none !important;
}

.erd-page-link a:hover,
.erd-page-link .current {
    color: var(--erd-white);
    background: var(--erd-primary);
    border-color: var(--erd-primary);
}

.erd-detail-shell {
    background: #f8fafc;
    padding: 30px 18px 80px;
}

.erd-detail-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

.erd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--erd-muted) !important;
    margin: 0 0 16px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
}

.erd-back-link::before {
    content: "←";
    color: var(--erd-primary);
    font-size: 17px;
}

.erd-back-link:hover {
    color: var(--erd-primary-dark) !important;
}

.erd-detail-hero,
.erd-detail-shell .erd-panel,
.erd-detail-shell .erd-section,
.erd-source-note {
    background: var(--erd-white);
    border: 1px solid var(--erd-border);
    border-radius: 22px;
    box-shadow: 0 8px 26px rgba(15, 23, 42, .04);
}

.erd-detail-hero {
    padding: clamp(22px, 4vw, 40px);
    margin-bottom: 18px;
}

.erd-detail-topline {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.erd-detail-logo {
    width: 94px;
    height: 94px;
    border-radius: 22px;
}

.erd-detail-logo b {
    font-size: 24px;
}

.erd-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.erd-detail-badges .erd-badge {
    margin: 0;
}

.erd-detail-eyebrow {
    color: var(--erd-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    margin: 2px 0 8px;
    text-transform: uppercase;
}

.erd-detail-heading h1 {
    color: var(--erd-text);
    font-size: clamp(34px, 6vw, 62px);
    line-height: 1;
    letter-spacing: -.055em;
    margin: 0 0 10px;
}

.erd-detail-tagline {
    color: var(--erd-text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    margin: 0 0 7px;
}

.erd-detail-summary {
    max-width: 760px;
    font-size: 15px;
    line-height: 1.75;
    margin: 0;
}

.erd-website-button {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: fit-content;
    color: var(--erd-white) !important;
    background: var(--erd-primary);
    border-radius: 10px;
    padding: 11px 15px;
    margin-top: 18px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none !important;
    transition: background 160ms ease, transform 160ms ease;
}

.erd-website-button:hover {
    background: var(--erd-primary-dark);
    transform: translateY(-1px);
}

.erd-detail-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    border-top: 1px solid var(--erd-border);
    margin-top: 28px;
    padding-top: 20px;
}

.erd-detail-stats div {
    padding: 14px;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 13px;
}

.erd-detail-stats dd {
    color: var(--erd-text);
    font-size: 23px;
    font-weight: 900;
    line-height: 1.25;
    margin: 6px 0 0;
}

.erd-audit-line {
    margin: 16px 0 0;
}

.erd-detail-toc {
    padding: 20px;
    margin: 0 0 18px;
}

.erd-detail-toc h2 {
    color: var(--erd-text);
    font-size: 14px;
    margin: 0 0 12px;
}

.erd-detail-toc div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.erd-detail-toc a {
    color: var(--erd-muted) !important;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}

.erd-detail-toc a:hover {
    color: var(--erd-primary-dark) !important;
    background: var(--erd-primary-soft);
    border-color: #bfdbfe;
}

.erd-detail-shell .erd-section {
    padding: clamp(20px, 3vw, 30px);
    margin: 0 0 18px;
}

.erd-detail-shell .erd-section > h2,
.erd-detail-shell .erd-article-panel > h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--erd-text);
    font-size: clamp(21px, 3vw, 28px);
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: -.03em;
}

.erd-detail-shell .erd-section > h2::before,
.erd-detail-shell .erd-article-panel > h2::before {
    content: "";
    width: 5px;
    height: 25px;
    background: var(--erd-primary);
    border-radius: 999px;
}

.erd-fact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
}

.erd-fact-grid > div {
    min-width: 0;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 11px;
    padding: 13px 14px;
}

.erd-fact-grid dd {
    color: var(--erd-text);
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    overflow-wrap: anywhere;
}

.erd-fact-grid dt {
    margin: 0 0 6px;
}

.erd-fact-grid dd {
    padding: 0;
}

.erd-feature-chips,
.erd-check-list,
.erd-note-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.erd-feature-chips li {
    color: var(--erd-primary-dark);
    background: var(--erd-primary-soft);
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.45;
}

.erd-detail-subsection {
    border-top: 1px solid var(--erd-border);
    margin-top: 22px;
    padding-top: 20px;
}

.erd-detail-subsection h3 {
    color: var(--erd-text);
    font-size: 15px;
    margin: 0 0 12px;
}

.erd-fee-table {
    overflow: hidden;
    border: 1px solid var(--erd-border);
    border-radius: 14px;
}

.erd-fee-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.erd-fee-table th,
.erd-fee-table td {
    border-bottom: 1px solid var(--erd-border);
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
}

.erd-fee-table tr:last-child td {
    border-bottom: 0;
}

.erd-fee-table th {
    color: var(--erd-text);
    background: var(--erd-surface);
    font-size: 12px;
}

.erd-fee-table td {
    color: var(--erd-muted);
    font-size: 13px;
    line-height: 1.55;
}

.erd-fee-table td:last-child {
    color: var(--erd-text);
    font-weight: 700;
    text-align: right;
}

.erd-pros-cons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.erd-pros-cons > div {
    min-width: 0;
    padding: 18px;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 14px;
}

.erd-pros-cons h3 {
    color: var(--erd-text);
    font-size: 16px;
    margin: 0 0 12px;
}

.erd-check-list,
.erd-note-list {
    display: grid;
}

.erd-check-list li,
.erd-note-list li {
    color: var(--erd-muted);
    background: var(--erd-white);
    border: 1px solid var(--erd-border);
    border-radius: 10px;
    padding: 11px 12px 11px 14px;
    font-size: 13px;
    line-height: 1.55;
}

.erd-check-list li {
    border-left: 3px solid #10b981;
}

.erd-note-list li {
    border-left: 3px solid #f87171;
}

.erd-faq-list {
    display: grid;
    gap: 9px;
}

.erd-faq-item {
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 12px;
}

.erd-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    color: var(--erd-text);
    padding: 15px 16px;
    font-size: 14px;
    font-weight: 800;
    list-style: none;
}

.erd-faq-item summary::-webkit-details-marker {
    display: none;
}

.erd-faq-item summary span {
    color: var(--erd-primary);
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.erd-faq-item[open] summary span {
    transform: rotate(45deg);
}

.erd-faq-answer {
    color: var(--erd-muted);
    border-top: 1px solid var(--erd-border);
    padding: 14px 16px 16px;
    font-size: 13px;
    line-height: 1.75;
}

.erd-alternative-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.erd-alternative-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    color: var(--erd-text) !important;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 14px;
    padding: 14px;
    text-decoration: none !important;
    transition: border-color 160ms ease, transform 160ms ease;
}

.erd-alternative-card:hover {
    border-color: #93c5fd;
    transform: translateY(-2px);
}

.erd-alternative-logo {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: var(--erd-white);
}

.erd-alternative-main {
    display: grid;
    align-content: center;
    gap: 5px;
    min-width: 0;
}

.erd-alternative-main strong {
    overflow: hidden;
    color: var(--erd-text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.erd-alternative-main em {
    width: fit-content;
    color: var(--erd-primary-dark);
    background: var(--erd-primary-soft);
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 3px 7px;
    font-size: 11px;
    font-style: normal;
}

.erd-alternative-summary,
.erd-alternative-score {
    grid-column: 1 / -1;
    color: var(--erd-muted);
    font-size: 12px;
    line-height: 1.55;
}

.erd-rich-text {
    max-width: 850px;
    font-size: 15px;
    line-height: 1.85;
}

.erd-rich-text h2,
.erd-rich-text h3 {
    color: var(--erd-text);
    line-height: 1.3;
    margin-top: 1.7em;
}

.erd-rich-text p,
.erd-rich-text li {
    color: var(--erd-muted);
}

.erd-verdict-panel {
    border-left: 4px solid var(--erd-primary) !important;
}

.erd-verdict {
    line-height: 1.75;
    margin: 0;
}

.erd-website-panel {
    padding-bottom: 24px !important;
}

.erd-contact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.erd-contact-link {
    display: grid;
    grid-template-columns: minmax(90px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--erd-text) !important;
    background: var(--erd-surface);
    border: 1px solid var(--erd-border);
    border-radius: 12px;
    padding: 14px 15px;
    text-decoration: none !important;
    transition: border-color 160ms ease, background 160ms ease;
}

.erd-contact-link:hover {
    background: var(--erd-primary-soft);
    border-color: #93c5fd;
}

.erd-contact-label {
    color: var(--erd-subtle);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.erd-contact-link code {
    min-width: 0;
    color: var(--erd-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.erd-contact-arrow {
    color: var(--erd-primary);
    font-size: 13px;
    font-weight: 800;
}

.erd-source-note {
    color: var(--erd-muted);
    padding: 18px 20px;
    margin-top: 18px;
    font-size: 12px;
    line-height: 1.65;
}

.erd-source-note strong {
    color: var(--erd-text);
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.erd-source-note p {
    margin: 4px 0;
}

.erd-source-note a {
    color: var(--erd-primary-dark) !important;
    font-weight: 800;
    text-decoration: none !important;
}

@media (max-width: 980px) {
    .erd-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erd-fact-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .erd-directory {
        border-radius: 16px;
        padding: 16px;
        margin: 16px 0;
    }

    .erd-grid,
    .erd-pros-cons,
    .erd-alternative-grid,
    .erd-fact-grid {
        grid-template-columns: 1fr;
    }

    .erd-contact-grid {
        grid-template-columns: 1fr;
    }

    .erd-card-link {
        padding: 17px;
    }

    .erd-detail-shell {
        padding: 18px 12px 56px;
    }

    .erd-detail-topline {
        grid-template-columns: 1fr;
    }

    .erd-detail-logo {
        width: 76px;
        height: 76px;
    }

    .erd-detail-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .erd-detail-shell .erd-section,
    .erd-detail-hero,
    .erd-source-note {
        border-radius: 16px;
    }

    .erd-fee-table {
        overflow-x: auto;
    }

    .erd-fee-table table {
        min-width: 520px;
    }
}

@media (max-width: 420px) {
    .erd-detail-stats {
        grid-template-columns: 1fr;
    }

    .erd-card-topline {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .erd-directory *,
    .erd-detail-shell * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
