:root {
    --wcm-ink: #17202a;
    --wcm-muted: #617080;
    --wcm-line: #dfe5ea;
    --wcm-soft: #f5f8fa;
    --wcm-accent: #1d5f46;
    --wcm-accent-dark: #134531;
    --wcm-card-radius: 16px;
    --wcm-shadow: 0 10px 30px rgba(20, 35, 50, 0.08);
}

* {
    box-sizing: border-box;
}

body.wcm-library-body,
body.wcm-tool-view-body {
    margin: 0;
    background: #fff;
    color: var(--wcm-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wcm-library-shell,
.wcm-tool-view-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.wcm-library-shell {
    padding: 56px 0 72px;
}

.wcm-library-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    padding-bottom: 28px;
}

.wcm-eyebrow {
    margin: 0 0 8px;
    color: var(--wcm-accent);
    font-weight: 750;
    font-size: 0.78rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.wcm-library-header h1,
.wcm-tool-view-header h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.45rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
}

.wcm-library-header p:not(.wcm-eyebrow),
.wcm-tool-view-copy p {
    max-width: 690px;
    margin: 14px 0 0;
    color: var(--wcm-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

.wcm-filter-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(3, minmax(140px, 0.7fr)) auto;
    gap: 14px;
    align-items: end;
    padding: 18px;
    border: 1px solid var(--wcm-line);
    border-radius: 14px;
    background: var(--wcm-soft);
}

.wcm-filter-panel label {
    display: grid;
    gap: 7px;
    color: #334252;
    font-size: 0.82rem;
    font-weight: 700;
}

.wcm-filter-panel input,
.wcm-filter-panel select {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid #cbd4dc;
    border-radius: 9px;
    background: #fff;
    color: var(--wcm-ink);
    font: inherit;
    font-weight: 500;
}

.wcm-filter-panel input:focus,
.wcm-filter-panel select:focus {
    outline: 3px solid rgba(29, 95, 70, 0.16);
    border-color: var(--wcm-accent);
}

.wcm-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid #c5cfd8;
    border-radius: 9px;
    background: #fff;
    color: #253341;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.wcm-secondary-button:hover {
    border-color: var(--wcm-accent);
    color: var(--wcm-accent);
}

.wcm-results-line {
    padding: 22px 2px 12px;
    color: var(--wcm-muted);
    font-size: 0.94rem;
}

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

.wcm-tool-card {
    min-width: 0;
    border: 1px solid var(--wcm-line);
    border-radius: var(--wcm-card-radius);
    background: #fff;
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.wcm-tool-card:hover {
    transform: translateY(-3px);
    border-color: #c9d5dd;
    box-shadow: var(--wcm-shadow);
}

.wcm-tool-card[hidden] {
    display: none;
}

.wcm-tool-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.wcm-tool-thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #eef5f1, #f8fafb);
    overflow: hidden;
}

.wcm-tool-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wcm-placeholder-icon {
    width: 62px;
    height: 62px;
    color: var(--wcm-accent);
}

.wcm-tool-card-content {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 22px;
}

.wcm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 27px;
}

.wcm-chip {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #e8f3ee;
    color: var(--wcm-accent-dark);
    font-size: 0.74rem;
    font-weight: 750;
}

.wcm-chip-muted {
    background: #eef1f4;
    color: #536170;
}

.wcm-tool-card h2 {
    margin: 17px 0 8px;
    font-size: 1.3rem;
    line-height: 1.24;
}

.wcm-tool-card p {
    margin: 0;
    color: var(--wcm-muted);
    line-height: 1.58;
}

.wcm-open-label {
    margin-top: auto;
    padding-top: 20px;
    color: var(--wcm-accent);
    font-weight: 750;
}

.wcm-no-results,
.wcm-no-package,
.wcm-simple-message {
    margin-top: 24px;
    padding: 46px 24px;
    border: 1px dashed #cbd4dc;
    border-radius: 14px;
    background: var(--wcm-soft);
    text-align: center;
}

.wcm-tool-view-shell {
    width: 100%;
    max-width: none;
}

.wcm-tool-view-header {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 22px;
}

.wcm-tool-view-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.wcm-back-link {
    color: var(--wcm-accent);
    font-weight: 750;
    text-decoration: none;
}

.wcm-tool-view-copy h1 {
    margin-top: 12px;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.wcm-tool-frame-wrap {
    width: 100%;
    min-height: 70vh;
    border-top: 1px solid var(--wcm-line);
    background: #fff;
}

.wcm-tool-frame {
    display: block;
    width: 100%;
    height: calc(100vh - 210px);
    min-height: 680px;
    border: 0;
    background: #fff;
}

.wcm-tool-notes {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 44px 0 72px;
    color: #334252;
    line-height: 1.75;
}

@media (max-width: 960px) {
    .wcm-filter-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 640px) {
    .wcm-library-shell {
        padding-top: 32px;
    }

    .wcm-filter-panel,
    .wcm-tools-grid {
        grid-template-columns: 1fr;
    }

    .wcm-tool-view-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .wcm-tool-frame {
        height: calc(100vh - 245px);
        min-height: 560px;
    }
}
