/*
 * Plew visual theme for ExportGuard.
 * Rollback: remove the plew-theme.css link from Pages/Index.cshtml and
 * Pages/Shared/_Layout.cshtml. No functional selector is changed by this file.
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@400;500;600;700;800&display=swap');

:root {
    --plew-ink: #151713;
    --plew-paper: #f3f0e8;
    --plew-paper-deep: #e6e0d3;
    --plew-lime: #c7f36a;
    --plew-line: #d5d1c7;
    --plew-muted: #676960;
    --plew-white: #ffffff;
    --plew-shadow: 0 18px 50px rgba(21, 23, 19, 0.09);
    --navy: var(--plew-ink);
    --navy-2: #252721;
    --teal: var(--plew-lime);
    --teal-2: #739b27;
    --cyan: var(--plew-lime);
    --ink: var(--plew-ink);
    --muted: var(--plew-muted);
    --line: var(--plew-line);
    --soft: var(--plew-paper);
    --shadow: var(--plew-shadow);
    --radius: 4px;
}

html { scroll-behavior: smooth; }

body {
    color: var(--plew-ink);
    background: var(--plew-paper);
    font-family: 'Manrope', Inter, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Shared public navigation */
.navbar.navbar-dark.bg-dark {
    min-height: 76px;
    padding-block: 0;
    color: var(--plew-ink);
    background: rgba(243, 240, 232, 0.96) !important;
    border-bottom: 1px solid var(--plew-line);
    box-shadow: none !important;
    backdrop-filter: blur(16px);
}

.navbar-dark .navbar-brand,
.navbar-dark .navbar-nav .nav-link {
    color: var(--plew-ink);
}

.navbar-dark .navbar-brand {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.navbar-dark .navbar-brand .text-info { color: var(--plew-muted) !important; }
.navbar-dark .navbar-nav .nav-link { font-size: 0.82rem; font-weight: 700; }
.navbar-dark .navbar-nav .nav-link:hover { color: var(--plew-muted) !important; }

.navbar-dark .navbar-toggler {
    border-color: var(--plew-line);
    filter: invert(1);
}

.navbar .btn-info,
.navbar .btn-primary {
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-color: var(--plew-lime);
    border-radius: 999px;
    box-shadow: none;
}

/* Homepage hero */
.hero {
    min-height: 730px;
    display: grid;
    align-items: center;
    padding: 132px 0 72px;
    color: var(--plew-ink);
    background:
        radial-gradient(circle at 78% 43%, rgba(199, 243, 106, 0.92) 0 5.2%, transparent 5.5%),
        repeating-radial-gradient(circle at 78% 43%, transparent 0 66px, rgba(21, 23, 19, 0.08) 67px 68px),
        var(--plew-paper);
}

.hero::after {
    inset: 0;
    height: auto;
    border-radius: 0;
    background: linear-gradient(90deg, transparent 49.8%, rgba(21, 23, 19, 0.025) 50%);
    background-size: 72px 72px;
    filter: none;
    pointer-events: none;
}

.hero-grid { grid-template-columns: 1.12fr 0.88fr; gap: 6vw; }

.eyebrow {
    padding: 0;
    color: var(--plew-muted);
    background: transparent;
    border: 0;
    border-radius: 0;
    font: 500 0.7rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.eyebrow span { background: var(--plew-lime); box-shadow: none; }

.hero h1 {
    max-width: 760px;
    color: var(--plew-ink);
    font-size: clamp(3.4rem, 6.1vw, 6rem);
    font-weight: 750;
    line-height: 0.98;
    letter-spacing: -0.065em;
}

.hero .lead { max-width: 680px; color: var(--plew-muted); font-size: 1.08rem; line-height: 1.7; }
.hero .domain { color: var(--plew-muted); }
.hero .domain strong { color: var(--plew-ink); }

.btn { border-radius: 999px; box-shadow: none; }
.btn-primary { color: var(--plew-white); background: var(--plew-ink); border-color: var(--plew-ink); box-shadow: none; }
.btn-primary:hover { color: var(--plew-white); background: #2b2e27; border-color: #2b2e27; }
.btn-secondary { color: var(--plew-ink); background: transparent; border-color: var(--plew-ink); }
.btn-secondary:hover { color: var(--plew-white); background: var(--plew-ink); border-color: var(--plew-ink); }

.hero-card {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    backdrop-filter: none;
    transform: rotate(1.5deg);
}

.dashboard {
    color: var(--plew-ink);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--plew-line);
    border-radius: 13px;
    box-shadow: 0 24px 60px rgba(38, 35, 28, 0.16);
}

.metric { background: var(--plew-white); border-color: var(--plew-line); border-radius: 4px; }
.metric b { color: var(--plew-ink); }
.flow-row { background: #eeebe4; border-radius: 4px; }
.dot { background: var(--plew-lime); }

/* Homepage sections */
section { padding-block: 110px; }
.section-head { margin-bottom: 52px; }
.kicker {
    color: var(--plew-muted);
    font: 500 0.7rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.13em;
}

h2 { color: var(--plew-ink); font-weight: 750; letter-spacing: -0.055em; }
.section-head p { color: var(--plew-muted); line-height: 1.7; }

.cards { gap: 0; }
.card {
    padding: 28px;
    background: transparent;
    border-color: var(--plew-line);
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

.card:hover { background: var(--plew-white); transform: translateY(-4px); }
.icon { color: var(--plew-ink); background: var(--plew-lime); border-radius: 50%; }
.card h3, .risk-box h3, .module h3 { color: var(--plew-ink); }

.risk { background: #ece8df; }
.risk-box { background: var(--plew-white); border-color: var(--plew-line); border-radius: 4px; box-shadow: none; }
.risk-box.alert { background: #f7eee3; border-color: #decbb5; }
.risk-box.safe { background: #edf5dc; border-color: #cfdda9; }

.modules { gap: 1px; background: var(--plew-line); }
.module,
.module:nth-child(2),
.module:nth-child(3) {
    min-height: 300px;
    padding: 30px;
    color: var(--plew-ink);
    background: var(--plew-white);
    border: 0;
    border-radius: 0;
}

.module small,
.module:nth-child(3) small { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.module p,
.module ul,
.module:nth-child(3) p,
.module:nth-child(3) ul { color: var(--plew-muted); }

.pricing { color: var(--plew-white); background: var(--plew-ink); }
.pricing h2 { color: var(--plew-white); }
.pricing .section-head p, .pricing .note { color: #a7aa9e; }
.price-card { border-color: #3b3e38; border-radius: 4px; }
.price-card.featured { color: var(--plew-ink); background: var(--plew-lime); border-color: var(--plew-lime); box-shadow: none; }

.contact-card,
.form {
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.form input,
.form textarea,
.form select,
.form-control,
.form-select { border-color: var(--plew-line); border-radius: 4px; }

footer { color: var(--plew-ink); background: var(--plew-lime); }
.footer-inner strong { color: var(--plew-ink); }
.mini { color: var(--plew-muted); }

/* Shared authenticated layout: visual shell only */
.eg-topbar {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-bottom-color: #34372f;
    box-shadow: none;
}

.eg-topbar-brand { letter-spacing: -0.04em; }
.eg-topbar-link { border-radius: 4px; }
.eg-topbar-link:hover { color: var(--plew-ink); background: var(--plew-lime); }
.eg-user-menu, .eg-credit-balance { border-radius: 999px; }
.eg-user-dropdown, .eg-topbar-dropdown { border-color: var(--plew-line); border-radius: 4px; box-shadow: var(--plew-shadow); }

/* Login and access pages */
body:has(form[action*="Login"]) {
    min-height: 100vh;
    background:
        radial-gradient(circle at 82% 22%, rgba(199, 243, 106, 0.7) 0 5%, transparent 5.3%),
        repeating-radial-gradient(circle at 82% 22%, transparent 0 72px, rgba(21, 23, 19, 0.055) 73px 74px),
        var(--plew-paper);
}

body:has(form[action*="Login"]) .client-area-header {
    padding: 8.5rem 0 3.5rem !important;
    color: var(--plew-ink) !important;
    background: transparent !important;
}

body:has(form[action*="Login"]) .client-area-header .container { max-width: 760px; }

body:has(form[action*="Login"]) .client-area-header .badge {
    padding: 0;
    color: var(--plew-muted) !important;
    background: transparent !important;
    border-radius: 0;
    font: 500 0.7rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

body:has(form[action*="Login"]) .client-area-header .badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    background: var(--plew-lime);
    border-radius: 50%;
}

body:has(form[action*="Login"]) .client-area-header h1 {
    color: var(--plew-ink);
    font-size: clamp(2.5rem, 5vw, 4.7rem);
    font-weight: 750;
    letter-spacing: -0.06em;
}

body:has(form[action*="Login"]) .client-area-header .lead { color: var(--plew-muted) !important; }
body:has(form[action*="Login"]) main.bg-light { padding-top: 0 !important; background: transparent !important; }

body:has(form[action*="Login"]) .eg-panel {
    max-width: 580px !important;
    padding: 2.25rem;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--plew-line);
    border-radius: 4px;
    box-shadow: var(--plew-shadow);
}

body:has(form[action*="Login"]) .form-label {
    color: var(--plew-ink);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

body:has(form[action*="Login"]) .form-control {
    min-height: 50px;
    padding-inline: 0.95rem;
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

body:has(form[action*="Login"]) .form-control:focus {
    border-color: var(--plew-ink);
    box-shadow: 0 0 0 3px rgba(199, 243, 106, 0.45);
}

body:has(form[action*="Login"]) .form-check-input:checked {
    background-color: var(--plew-ink);
    border-color: var(--plew-ink);
}

body:has(form[action*="Login"]) .btn-info {
    min-height: 50px;
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
    border-radius: 999px;
}

body:has(form[action*="Login"]) .btn-info:hover { background: #2b2e27; border-color: #2b2e27; }

/* Authenticated application shell */
.eg-topbar {
    position: sticky;
    top: 0;
    z-index: 1040;
    min-height: 72px;
}

.eg-topbar-container { padding-inline: clamp(1rem, 3vw, 3rem); }
.eg-topbar-inner { min-height: 72px; }

.eg-topbar-primary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 72px;
}

.eg-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--plew-white);
    font-size: 1.15rem;
    font-weight: 800;
}

.eg-topbar-brand::before {
    content: 'p';
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-radius: 50% 50% 50% 10px;
    font-size: 1.15rem;
    font-weight: 800;
}

.eg-topbar-nav { gap: 0.2rem; }

.eg-topbar-link {
    padding: 0.55rem 0.68rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
    font-weight: 650;
}

.eg-topbar-section-label {
    color: var(--plew-lime);
    font: 500 0.62rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.eg-topbar-separator { background: rgba(255, 255, 255, 0.16); }

.eg-topbar-user-label {
    margin-right: 0.25rem;
    color: rgba(255, 255, 255, 0.48);
}

.eg-topbar-admin-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 48px;
    margin-inline: calc(clamp(1rem, 3vw, 3rem) * -1);
    padding: 0.35rem clamp(1rem, 3vw, 3rem);
    background: #292c25;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.eg-topbar-admin-label {
    flex: 0 0 auto;
    min-width: 9.25rem;
    color: var(--plew-ink);
    background: var(--plew-lime);
    border: 0;
    border-radius: 999px;
    text-align: center;
}

.eg-topbar-admin-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    min-width: 0;
}

.eg-topbar-admin-nav .eg-topbar-link { color: rgba(255, 255, 255, 0.78); }
.eg-topbar-admin-nav .eg-topbar-link:hover,
.eg-topbar-admin-nav .eg-topbar-link:focus { color: var(--plew-ink); background: var(--plew-lime); }

.eg-user-menu,
.eg-credit-balance,
.eg-company-selector .form-select {
    border-color: rgba(255, 255, 255, 0.18);
    background-color: rgba(255, 255, 255, 0.07);
}

.eg-user-menu:hover,
.eg-credit-balance:hover { border-color: var(--plew-lime); }

.eg-topbar-dropdown .dropdown-item,
.eg-user-dropdown .dropdown-item { border-radius: 3px; }

.eg-topbar-dropdown .dropdown-item:hover,
.eg-user-dropdown .dropdown-item:hover {
    color: var(--plew-ink);
    background: var(--plew-lime);
}

.eg-app-footer {
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-top: 1px solid rgba(21, 23, 19, 0.16);
}

.eg-app-footer-inner {
    min-height: 76px;
    padding-inline: clamp(1rem, 3vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.eg-app-footer-brand,
.eg-app-footer-meta { display: flex; align-items: center; gap: 0.75rem; }
.eg-app-footer-brand { font-size: 0.78rem; }

.eg-app-footer-mark {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--plew-lime);
    background: var(--plew-ink);
    border-radius: 50% 50% 50% 9px;
    font-weight: 800;
}

.eg-app-footer-meta { color: rgba(21, 23, 19, 0.68); font-size: 0.72rem; }
.eg-app-footer-meta a { color: var(--plew-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

/* CSS-only footer: removing this theme restores the original layout exactly. */
body:has(.eg-topbar)::after {
    content: 'ExportGuard · SaaS by Plew     —     Paperless everywhere.';
    min-height: 76px;
    padding: 1.2rem clamp(1rem, 3vw, 3rem);
    display: flex;
    align-items: center;
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-top: 1px solid rgba(21, 23, 19, 0.16);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: pre-wrap;
}

@media (max-width: 920px) {
    .hero { min-height: auto; padding-top: 120px; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-card { transform: none; }
    .eg-app-footer-inner,
    .eg-app-footer-meta { align-items: flex-start; flex-direction: column; }
    .eg-app-footer-inner { justify-content: center; padding-block: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card, .btn { transition: none; }
}

/* Client dashboard and document workspace.
 * These selectors intentionally target client-only components, leaving the
 * administration area available for a separate final styling pass.
 */
body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) {
    background: var(--plew-paper);
}

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header {
    padding-block: 5.2rem 3.8rem !important;
    color: var(--plew-ink) !important;
    background:
        radial-gradient(circle at 84% 42%, rgba(199, 243, 106, 0.78) 0 4%, transparent 4.3%),
        repeating-radial-gradient(circle at 84% 42%, transparent 0 64px, rgba(21, 23, 19, 0.05) 65px 66px),
        #e8e4db !important;
}

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header .badge {
    padding: 0;
    color: var(--plew-muted) !important;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    font: 500 0.66rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header .badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    background: var(--plew-lime);
    border-radius: 50%;
}

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header h1 {
    color: var(--plew-ink);
    font-size: clamp(2.35rem, 4.8vw, 4.5rem);
    font-weight: 750;
    letter-spacing: -0.06em;
}

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header .lead,
body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) .client-area-header .text-white-50 { color: var(--plew-muted) !important; }

body:is(
    :has(main .eg-stat-card),
    :has(main .eg-document-toolbar),
    :has(main .eg-mrn-grid),
    :has(main .eg-document-card),
    :has(main .eg-missing-ivisto-card)
) main.bg-light { background: var(--plew-paper) !important; }

/* Dashboard panels and metrics */
.eg-panel,
.eg-stat-card,
.eg-mini-card {
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-panel { background: rgba(255, 255, 255, 0.9); }
.eg-stat-card, .eg-mini-card { background: var(--plew-white); }

.eg-stat-link:hover .eg-stat-card,
.eg-stat-link:hover .eg-mini-card {
    transform: translateY(-3px);
    border-color: #b8b4aa;
    box-shadow: var(--plew-shadow);
}

.eg-stat-label,
.eg-mini-label {
    color: var(--plew-muted);
    font: 500 0.68rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.09em;
}

.eg-stat-value,
.eg-mini-value { color: var(--plew-ink); font-weight: 750; letter-spacing: -0.055em; }
.eg-stat-note { color: var(--plew-muted); }

.eg-stat-neutral { background: linear-gradient(180deg, #fff 0%, #f6f3ec 100%); border-color: var(--plew-line); }
.eg-stat-ok, .eg-stat-success { background: linear-gradient(180deg, #fff 0%, #eff7df 100%); border-color: #cad9a7; }
.eg-stat-attention, .eg-stat-warning, .eg-stat-conservation-risk { background: linear-gradient(180deg, #fff 0%, #fbf1d7 100%); border-color: #ddc88d; }
.eg-stat-action, .eg-stat-danger, .eg-stat-critical { background: linear-gradient(180deg, #fff 0%, #f9e7e3 100%); border-color: #deb7af; }

.eg-stat-critical,
.eg-stat-conservation-risk { box-shadow: none; }

.eg-stat-critical::before,
.eg-stat-conservation-risk::before { width: 0.28rem; }

/* Dashboard charts */
.eg-chart-header h2 { color: var(--plew-ink); letter-spacing: -0.03em; }
.eg-chart-legend,
.eg-chart-month,
.eg-chart-value,
.eg-declarant-rate-note { color: var(--plew-muted); }
.eg-chart-empty { color: var(--plew-muted); border-color: var(--plew-line); border-radius: 4px; }
.eg-chart-bars,
.eg-declarant-bar-track,
.eg-declarant-rate-track { background: transparent; }
.eg-declarant-bar-track,
.eg-declarant-rate-track { background: #e4e0d7; }
.eg-declarant-label,
.eg-declarant-rate-heading span { color: var(--plew-ink); }
.eg-declarant-identity small,
.eg-declarant-rate-vat { color: var(--plew-muted); }

.eg-dot.total, .eg-chart-bar.total { background: var(--plew-ink); }
.eg-dot.complete, .eg-chart-bar.complete { background: #719d28; }
.eg-dot.conserved, .eg-chart-bar.conserved { background: #70829a; }
.eg-dot.pending, .eg-chart-bar.pending { background: #d7a92e; }

/* Client filters and toolbars */
.eg-document-toolbar,
.eg-filter-guidance,
.eg-bulk-actions,
.eg-pagination-bar {
    color: var(--plew-ink);
    background: #ebe7de;
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-filter-guidance-title,
.eg-filter-label,
.eg-page-size-label { color: var(--plew-ink); }
.eg-filter-guidance-text,
.eg-filter-help,
.eg-pagination-summary { color: var(--plew-muted); }

.eg-view-toggle {
    padding: 3px;
    background: #dfdbd2;
    border: 1px solid var(--plew-line);
    border-radius: 999px;
}

.eg-view-toggle-item { border: 0; border-radius: 999px; }
.eg-view-toggle-item.active,
.eg-view-toggle-item[aria-current='true'] { color: var(--plew-white); background: var(--plew-ink); }

.form-control,
.form-select,
.input-group-text {
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--plew-ink);
    box-shadow: 0 0 0 3px rgba(199, 243, 106, 0.42);
}

/* Document cards */
.eg-document-card,
.eg-missing-ivisto-card,
.eg-reference-panel,
.eg-reference-editor,
.eg-conservation-panel,
.eg-conservation-package {
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-document-card { transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease; }
.eg-document-card:hover { transform: translateY(-2px); border-color: #b8b4aa; box-shadow: var(--plew-shadow); }
.eg-card-label,
.eg-conservation-label,
.eg-reference-label { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-mrn-code,
.eg-grid-mrn,
.eg-grid-lrn { color: var(--plew-ink); }
.eg-reference-chip { color: var(--plew-ink); background: #eeebe4; border-color: var(--plew-line); border-radius: 999px; }
.eg-reference-chip.conservation { background: #eef6dd; border-color: #ccdaa9; }

/* MRN and document tables */
.eg-mrn-grid-wrap,
.table-responsive {
    overflow: hidden;
    background: var(--plew-white);
    border: 1px solid var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-mrn-grid,
.eg-mrn-table,
.table { --bs-table-bg: transparent; --bs-table-hover-bg: rgba(199, 243, 106, 0.12); margin-bottom: 0; }

.eg-mrn-grid thead,
.eg-mrn-table thead,
.table thead { background: #e8e4db; }

.eg-mrn-grid th,
.eg-mrn-table th,
.table th {
    padding-block: 0.9rem;
    color: var(--plew-muted);
    border-bottom-color: var(--plew-line);
    font: 500 0.66rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.eg-mrn-grid td,
.eg-mrn-table td,
.table td { color: var(--plew-ink); border-color: #e5e1d8; }

.eg-grid-status,
.eg-grid-pill,
.eg-doc-badge,
.eg-doc-badge-sm,
.badge { border-radius: 999px; font-weight: 750; }

.eg-grid-status.ok { color: #456b13; background: #edf6dc; border-color: #c8d8a4; }
.eg-grid-status.wait { color: #76570d; background: #fcf1d4; border-color: #dec78a; }
.eg-grid-status.danger { color: #8e3028; background: #f9e7e3; border-color: #dfb8b0; }
.eg-grid-status.muted { color: var(--plew-muted); background: #eeebe4; border-color: var(--plew-line); }

.page-link {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
}

.page-item.active .page-link {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
}

/* Client actions and modal surfaces */
.eg-grid-action,
.eg-fixed-action,
.eg-copy-button,
.eg-bulk-submit { border-radius: 999px; }

.btn-info,
.btn-dark,
.btn-primary {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
}

.btn-info:hover,
.btn-dark:hover,
.btn-primary:hover { color: var(--plew-ink); background: var(--plew-lime); border-color: var(--plew-lime); }

.modal-content,
.eg-grid-popover,
.eg-json-drawer {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: var(--plew-shadow);
}

.modal-header,
.modal-footer { border-color: var(--plew-line); }
.eg-json-box,
.eg-api-code-block { color: var(--plew-ink); background: #eeebe4; border-color: var(--plew-line); border-radius: 4px; }

@media (max-width: 767.98px) {
    body:is(
        :has(main .eg-stat-card),
        :has(main .eg-document-toolbar),
        :has(main .eg-mrn-grid),
        :has(main .eg-document-card),
        :has(main .eg-missing-ivisto-card)
    ) .client-area-header { padding-block: 3.6rem 2.8rem !important; }

    .eg-panel { padding: 1.25rem; }
    .eg-document-toolbar,
    .eg-pagination-bar { align-items: stretch; }
}

/* Administration area */
.eg-admin-page-header {
    padding-block: 5.2rem 3.8rem !important;
    color: var(--plew-ink) !important;
    background:
        radial-gradient(circle at 84% 42%, rgba(199, 243, 106, 0.9) 0 4.2%, transparent 4.5%),
        repeating-radial-gradient(circle at 84% 42%, transparent 0 64px, rgba(21, 23, 19, 0.055) 65px 66px),
        #e3e7dd !important;
}

.eg-admin-page-header .badge {
    padding: 0;
    color: var(--plew-muted) !important;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eg-admin-page-header .badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.55rem;
    background: var(--plew-lime);
    border: 1px solid var(--plew-ink);
    border-radius: 50%;
}

.eg-admin-page-header h1 {
    color: var(--plew-ink);
    font-size: clamp(2.35rem, 4.8vw, 4.5rem);
    font-weight: 750;
    letter-spacing: -0.06em;
}

.eg-admin-page-header .lead,
.eg-admin-page-header .text-white-50 { color: var(--plew-muted) !important; }

body:has(.eg-admin-page-header) main.bg-light { background: var(--plew-paper) !important; }

.eg-business-plan-hero,
.eg-api-key-panel,
.eg-api-roadmap,
.eg-reminder-rule-panel,
.eg-pricing-summary,
.eg-company-checklist,
.eg-dev-task-form,
.eg-bulk-upload-form,
.eg-upload-summary {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-business-plan-hero {
    background:
        radial-gradient(circle at 88% 28%, rgba(199, 243, 106, 0.78) 0 5%, transparent 5.3%),
        repeating-radial-gradient(circle at 88% 28%, transparent 0 58px, rgba(21, 23, 19, 0.045) 59px 60px),
        #e8e4db;
}

.eg-business-plan-hero h1,
.eg-business-plan-hero h2,
.eg-pricing-summary h2,
.eg-api-key-panel h2,
.eg-reminder-rule-panel h2 { color: var(--plew-ink); letter-spacing: -0.045em; }

.eg-business-plan-note,
.eg-template-help,
.eg-upload-limits { color: var(--plew-muted); }

.eg-metric-card {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-metric-card-blue { background: linear-gradient(180deg, #fff 0%, #edf1f2 100%); border-color: #cbd3d5; }
.eg-metric-card-green { background: linear-gradient(180deg, #fff 0%, #eef6dd 100%); border-color: #cad8a6; }
.eg-metric-card-amber { background: linear-gradient(180deg, #fff 0%, #fbf1d7 100%); border-color: #ddc88d; }

.eg-company-list-item,
.eg-completed-task,
.eg-pricing-tier {
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
}

.eg-company-list-item:hover { background: #f0ede6; border-color: #bbb7ae; }
.eg-pricing-tier-active { background: #eef6dd; border-color: #9eb86b; box-shadow: inset 4px 0 0 #719d28; }
.eg-pricing-tier strong,
.eg-pricing-tier-price strong { color: var(--plew-ink); }
.eg-pricing-tier p { color: var(--plew-muted); }

.eg-automation-switch .form-check-input:checked,
.form-switch .form-check-input:checked { background-color: var(--plew-ink); border-color: var(--plew-ink); }

.eg-template-token-list code,
.font-monospace,
.eg-json-box { font-family: 'DM Mono', ui-monospace, monospace !important; }

.eg-business-plan-table,
.eg-dev-task-table {
    --bs-table-bg: transparent;
    --bs-table-hover-bg: rgba(199, 243, 106, 0.12);
}

.eg-business-plan-table thead,
.eg-dev-task-table thead { background: #e8e4db; }

.eg-business-plan-table th,
.eg-dev-task-table th {
    color: var(--plew-muted);
    border-color: var(--plew-line);
    font: 500 0.66rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.eg-reminder-rule-panel.warning { background: #fbf1d7; border-color: #ddc88d; }
.eg-api-code-block,
.eg-json-box { color: var(--plew-ink); background: #eeebe4; border-color: var(--plew-line); border-radius: 4px; }

/* Full assistant page */
body:has(main .eg-assistant-shell) { background: var(--plew-paper); }

body:has(main .eg-assistant-shell) .client-area-header {
    padding-block: 5rem 3.8rem !important;
    color: var(--plew-ink) !important;
    background:
        radial-gradient(circle at 83% 42%, rgba(199, 243, 106, 0.82) 0 4.4%, transparent 4.7%),
        repeating-radial-gradient(circle at 83% 42%, transparent 0 62px, rgba(21, 23, 19, 0.05) 63px 64px),
        #e8e4db !important;
}

body:has(main .eg-assistant-shell) .client-area-header .badge {
    padding: 0;
    color: var(--plew-muted) !important;
    background: transparent !important;
    border: 0;
    font: 500 0.66rem 'DM Mono', ui-monospace, monospace;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body:has(main .eg-assistant-shell) .client-area-header .badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    background: var(--plew-lime);
    border-radius: 50%;
}

body:has(main .eg-assistant-shell) .client-area-header h1 {
    color: var(--plew-ink);
    font-size: clamp(2.5rem, 5vw, 4.6rem);
    font-weight: 750;
    letter-spacing: -0.06em;
}

body:has(main .eg-assistant-shell) .client-area-header .lead,
body:has(main .eg-assistant-shell) .client-area-header .text-white-50 { color: var(--plew-muted) !important; }
body:has(main .eg-assistant-shell) main.bg-light { background: var(--plew-paper) !important; }

.eg-assistant-hero-note {
    color: var(--plew-ink);
    background: rgba(255, 255, 255, 0.7);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-assistant-hero-note span { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-assistant-hero-note strong { color: var(--plew-ink); }

.eg-assistant-shell {
    grid-template-columns: minmax(0, 1fr) minmax(250px, 0.32fr);
    gap: 1px;
    overflow: hidden;
    background: var(--plew-line);
    border: 1px solid var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

.eg-assistant-chat,
.eg-assistant-side {
    background: var(--plew-white);
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.eg-assistant-avatar {
    color: var(--plew-lime);
    background: var(--plew-ink);
    border-radius: 50% 50% 50% 9px;
}

.eg-assistant-bubble {
    color: var(--plew-ink);
    background: #eeebe4;
    border-color: var(--plew-line);
    border-radius: 4px 16px 16px 16px;
    box-shadow: none;
}

.eg-assistant-message.user .eg-assistant-bubble {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
    border-radius: 16px 4px 16px 16px;
}

.eg-assistant-name { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-assistant-message.user .eg-assistant-name { color: var(--plew-lime); }
.eg-assistant-history-empty { color: var(--plew-muted); }

.eg-assistant-reference,
.eg-assistant-example {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
}

.eg-assistant-reference span { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }

.eg-assistant-compose {
    background: #e8e4db;
    border-top-color: var(--plew-line);
}

.eg-assistant-input-wrap textarea {
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
}

.eg-assistant-mic {
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-color: var(--plew-lime);
    border-radius: 50%;
}

.eg-assistant-mic:hover,
.eg-assistant-mic:focus { color: var(--plew-white); background: var(--plew-ink); border-color: var(--plew-ink); }
.eg-assistant-mic.listening { background: #f4d4cc; border-color: #c97969; }

.eg-assistant-side { background: #f3f0e8; }
.eg-assistant-side-section + .eg-assistant-side-section { border-top-color: var(--plew-line); }
.eg-assistant-suggestion {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
}

.eg-assistant-suggestion:hover { color: var(--plew-ink); background: var(--plew-lime); border-color: var(--plew-lime); }
.eg-assistant-table-wrap { border-color: var(--plew-line); border-radius: 4px; }

/* Ambient assistant iframe content. The page links this theme after its local
 * stylesheet, so removing that one link restores the original widget exactly.
 */
.eg-ambient {
    --eg-ink: var(--plew-ink);
    --eg-muted: var(--plew-muted);
    --eg-line: var(--plew-line);
    --eg-panel: var(--plew-white);
    --eg-soft: var(--plew-paper);
    --eg-dark: var(--plew-ink);
    --eg-cyan: var(--plew-lime);
    font-family: 'Manrope', Inter, ui-sans-serif, system-ui, sans-serif;
}

.eg-ambient .eg-toggle {
    min-height: 2.85rem;
    padding: 0.4rem 0.9rem 0.4rem 0.4rem;
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    box-shadow: 0 14px 32px rgba(21, 23, 19, 0.2);
}

.eg-ambient .eg-toggle-mark {
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-radius: 50% 50% 50% 8px;
}

.eg-ambient .eg-panel {
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: var(--plew-shadow);
}

.eg-ambient .eg-head {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-bottom-color: #35382f;
}

.eg-ambient .eg-kicker { color: var(--plew-lime); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-ambient .eg-head strong { color: var(--plew-white); }
.eg-ambient .eg-close { color: var(--plew-white); background: transparent; border-color: rgba(255, 255, 255, 0.22); border-radius: 50%; }
.eg-ambient .eg-body { background: var(--plew-paper); }

.eg-ambient .eg-message,
.eg-ambient .eg-answer,
.eg-ambient .eg-history-item.assistant {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px 13px 13px 13px;
}

.eg-ambient .eg-history-item.user {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
    border-radius: 13px 4px 13px 13px;
}

.eg-ambient .eg-chips span,
.eg-ambient .eg-history-actions a,
.eg-ambient .eg-actions a {
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-color: var(--plew-lime);
    border-radius: 999px;
}

.eg-ambient .eg-form { background: #e8e4db; border-top-color: var(--plew-line); }
.eg-ambient .eg-input { border-color: var(--plew-line); border-radius: 4px; box-shadow: none; }
.eg-ambient .eg-input:focus { border-color: var(--plew-ink); outline: 3px solid rgba(199, 243, 106, 0.4); }
.eg-ambient .eg-submit {
    color: var(--plew-white);
    background: var(--plew-ink);
    border-color: var(--plew-ink);
    border-radius: 999px;
}

.eg-ambient .eg-submit:hover { color: var(--plew-ink); background: var(--plew-lime); border-color: var(--plew-lime); }

@media (max-width: 991.98px) {
    .eg-assistant-shell { grid-template-columns: 1fr; }
}

/* Secondary pages and shared document components
   Keep every rule in this optional file so removing its link restores the legacy UI. */
/* User pages that do not contain the dashboard/document selectors used above. */
body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header {
    padding-block: 5.2rem 3.8rem !important;
    color: var(--plew-ink) !important;
    background:
        radial-gradient(circle at 84% 42%, rgba(199, 243, 106, 0.78) 0 4%, transparent 4.3%),
        repeating-radial-gradient(circle at 84% 42%, transparent 0 68px, rgba(21, 23, 19, 0.05) 69px 70px),
        #e8e4db !important;
}

body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header .badge {
    padding: 0;
    color: var(--plew-muted) !important;
    background: transparent !important;
    border: 0;
    border-radius: 0;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.76rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header .badge::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 0.55rem;
    background: var(--plew-lime);
    border-radius: 50%;
}

body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header h1 {
    color: var(--plew-ink);
    font-size: clamp(2.35rem, 4.8vw, 4.5rem);
    font-weight: 750;
    letter-spacing: -0.06em;
}

body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header .lead,
body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) .client-area-header .text-white-50 {
    color: var(--plew-muted) !important;
}

body:is(
    :has(main .eg-bulk-upload-form),
    :has(main .eg-api-method),
    :has(main .eg-release-item)
) main.bg-light {
    background: var(--plew-paper) !important;
}

.eg-release-item,
.eg-declarant-summary,
.eg-email-body,
.eg-reference-block,
.eg-conservation-block,
.eg-conservation-panel,
.eg-reference-panel,
.eg-reference-editor,
.eg-grid-popover-body,
.eg-assistant-history,
.eg-assistant-thread {
    color: var(--plew-ink);
    background: var(--plew-white);
    border-color: var(--plew-line);
    border-radius: 4px;
    box-shadow: none;
}

/* Upload documenti */
.eg-bulk-upload-form {
    display: grid;
    gap: 1.45rem;
}

.eg-bulk-upload-form > div:not(.eg-upload-limits),
.eg-upload-form,
.eg-reference-form {
    padding: 1rem;
    background: var(--plew-paper);
    border: 1px solid var(--plew-line);
    border-radius: 4px;
}

.eg-upload-limits,
.eg-upload-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
}

.eg-upload-label { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-upload-form .form-control,
.eg-bulk-upload-form .form-control { background-color: var(--plew-white); }

/* Release notes */
.eg-release-item {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.25fr) 1fr;
    gap: 2rem;
    padding: 2rem 0;
    border-width: 0 0 1px;
    border-style: solid;
}

.eg-release-item:first-child { padding-top: 0; }
.eg-release-item:last-child { padding-bottom: 0; border-bottom: 0; }
.eg-release-item h2 { color: var(--plew-ink); letter-spacing: -0.025em; }
.eg-release-item li { margin-bottom: 0.35rem; color: var(--plew-muted); }
.eg-release-date {
    align-self: start;
    width: fit-content;
    padding: 0.4rem 0.65rem;
    color: var(--plew-ink);
    background: var(--plew-lime);
    border-radius: 999px;
    font-family: 'DM Mono', ui-monospace, monospace;
    font-size: 0.76rem;
    font-weight: 700;
}

/* Dashboard charts */
.eg-chart-list,
.eg-declarant-chart-list,
.eg-declarant-rate-list { display: grid; gap: 0.9rem; }

.eg-chart-row,
.eg-declarant-chart-row,
.eg-declarant-rate-row {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--plew-line);
}

.eg-chart-row:last-child,
.eg-declarant-chart-row:last-child,
.eg-declarant-rate-row:last-child { border-bottom: 0; }

.eg-chart-bars,
.eg-declarant-bar-track,
.eg-declarant-rate-track { overflow: hidden; background: #e8e4db; border-radius: 999px; }
.eg-chart-bar,
.eg-declarant-bar,
.eg-declarant-rate-track span { background: var(--plew-ink); border-radius: 999px; }
.eg-chart-bar.complete,
.eg-chart-bar.conserved { background: var(--plew-lime); }
.eg-declarant-value { color: var(--plew-ink); font-family: 'DM Mono', ui-monospace, monospace; }

/* Solleciti and communications */
.eg-declarant-summary { padding: 1.25rem; border: 1px solid var(--plew-line); }
.eg-declarant-summary-label,
.eg-declarant-summary-meta,
.eg-declarant-api-note { color: var(--plew-muted); }
.eg-declarant-summary-name { color: var(--plew-ink); letter-spacing: -0.025em; }
.eg-declarant-recap-list { margin: 0; }
.eg-declarant-recap-list > div { padding: 0.75rem 0; border-bottom: 1px solid var(--plew-line); }
.eg-declarant-recap-list > div:last-child { border-bottom: 0; }
.eg-declarant-recap-list dt { color: var(--plew-muted); }
.eg-declarant-recap-list dd { color: var(--plew-ink); }
.eg-declarant-api-note { padding: 1rem; background: var(--plew-paper); border-left: 3px solid var(--plew-lime); }
.eg-email-body { padding: 1rem; border: 1px solid var(--plew-line); white-space: pre-wrap; }

/* Document cards, grids and statuses */
.eg-document-card-item { border-color: var(--plew-line); border-radius: 4px; box-shadow: none; }
.eg-document-card-item:hover { border-color: var(--plew-ink); box-shadow: none; }
.eg-mrn-cell,
.eg-status-cell,
.eg-doc-column,
.eg-status-column { color: var(--plew-ink); }
.eg-grid-sub,
.eg-note-field { color: var(--plew-muted); }
.eg-mrn-select,
.eg-select-all { accent-color: var(--plew-ink); }
.eg-mrn-actions-row,
.eg-card-actions,
.eg-grid-actions,
.eg-table-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.eg-upload-form { display: flex; gap: 0.65rem; align-items: end; }
.eg-inline-error,
.eg-inline-warning { padding: 0.65rem 0.8rem; border-radius: 4px; }
.eg-inline-error { color: #7f1d1d; background: #fee2e2; border: 1px solid #fecaca; }
.eg-inline-warning { color: #713f12; background: #fef3c7; border: 1px solid #fde68a; }
.eg-reminder-status { color: var(--plew-muted); }
.eg-reminder-dot { background: var(--plew-line); }
.eg-reminder-status.sent .eg-reminder-dot { background: var(--plew-lime); }
.eg-doc-inline { background: var(--plew-paper); border-color: var(--plew-line); border-radius: 4px; }
.eg-count-badge,
.eg-selection-count,
.eg-filter-mode { color: var(--plew-ink); background: var(--plew-lime); border-color: var(--plew-lime); border-radius: 999px; }
.eg-filter-mode.archive { background: #e8e4db; border-color: var(--plew-line); }
.eg-split-grid { border-color: var(--plew-line); }

.eg-grid-popover-body { border: 1px solid var(--plew-line); box-shadow: var(--plew-shadow); }
.eg-grid-popover-title,
.eg-grid-popover-section-title { color: var(--plew-ink); }
.eg-grid-popover-section + .eg-grid-popover-section { border-top-color: var(--plew-line); }
.eg-copy-row { background: var(--plew-paper); border-color: var(--plew-line); border-radius: 4px; }
.eg-copy-row code { color: var(--plew-ink); }
.eg-grid-action-excel { color: var(--plew-ink) !important; background: var(--plew-lime) !important; border-color: var(--plew-lime) !important; }
.eg-page-size-form { color: var(--plew-muted); }

/* References and conservation partials */
.eg-reference-block,
.eg-conservation-block { padding: 1rem; border: 1px solid var(--plew-line); }
.eg-reference-list,
.eg-reference-edit-list { display: grid; gap: 0.65rem; }
.eg-reference-form-row,
.eg-reference-edit-row,
.eg-conservation-grid { display: grid; gap: 0.75rem; }
.eg-reference-edit-row { padding: 0.85rem; background: var(--plew-paper); border: 1px solid var(--plew-line); border-radius: 4px; }
.eg-reference-edit-form,
.eg-reference-delete-form { display: flex; gap: 0.5rem; align-items: center; }
.eg-conservation-document,
.eg-conservation-subfield { padding: 0.8rem; background: var(--plew-paper); border: 1px solid var(--plew-line); border-radius: 4px; }
.eg-conservation-sublabel,
.eg-conservation-label { color: var(--plew-muted); font-family: 'DM Mono', ui-monospace, monospace; }
.eg-conservation-value { color: var(--plew-ink); }

/* API, assistant residues and administration details */
.eg-api-method { overflow: hidden; border-color: var(--plew-line); border-radius: 4px; box-shadow: none; }
.eg-api-method-head { color: var(--plew-ink); background: var(--plew-paper); border-bottom-color: var(--plew-line); }
.eg-assistant-page-container { max-width: 1440px; }
.eg-assistant-thread { border: 1px solid var(--plew-line); }
.eg-assistant-history { border: 1px solid var(--plew-line); }
.eg-assistant-actions,
.eg-assistant-action-row,
.eg-assistant-reference-grid { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.eg-assistant-table { border-color: var(--plew-line); }
.eg-assistant-mic-icon { color: currentColor; }
.eg-history,
.eg-history-empty { color: var(--plew-muted); }
.eg-template-textarea { font-family: 'DM Mono', ui-monospace, monospace; background: var(--plew-paper); }
.eg-pricing-tier-list,
.eg-completed-task-list { display: grid; gap: 0.75rem; }
.eg-completed-task-list { color: var(--plew-muted); }

@media (max-width: 767.98px) {
    body:is(
        :has(main .eg-bulk-upload-form),
        :has(main .eg-api-method),
        :has(main .eg-release-item)
    ) .client-area-header { padding-block: 3.6rem 2.8rem !important; }

    .eg-release-item { grid-template-columns: 1fr; gap: 0.9rem; }
    .eg-upload-form,
    .eg-reference-edit-form,
    .eg-reference-delete-form { align-items: stretch; flex-direction: column; }
    .eg-reference-form-row,
    .eg-conservation-grid { grid-template-columns: 1fr !important; }

    .eg-admin-page-header { padding-block: 3.6rem 2.8rem !important; }
}

@media (max-width: 1199.98px) {
    .eg-topbar-primary-row { align-items: stretch; flex-direction: column; padding-block: 0.75rem; }
    .eg-topbar-actions { justify-content: space-between; flex-wrap: wrap; }
    .eg-topbar-admin-row { align-items: flex-start; flex-direction: column; gap: 0.35rem; padding-block: 0.6rem; }
    .eg-topbar-admin-nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.15rem; scrollbar-width: thin; }
}

@media (max-width: 767.98px) {
    .eg-topbar-user-label { display: none; }
    .eg-topbar-admin-label { min-width: auto; }
}
