/* =========================================================================
   Atlas - professional UI layer (Bootstrap 5.3 + Atlas brand tokens)
   Brand: green #006600 (primary), red #BD0000 (alerts / emphasis), black, white.
   Loaded AFTER Bootstrap and after the compiled atlas.css, so it restores Atlas typography
   and maps Bootstrap's primary/danger colours onto the brand.
   ========================================================================= */
:root {
    --bs-primary: #006600; --bs-primary-rgb: 0,102,0;
    --bs-danger: #BD0000;  --bs-danger-rgb: 189,0,0;
    --bs-success: #006600; --bs-success-rgb: 0,102,0;
    --bs-link-color: #006600; --bs-link-color-rgb: 0,102,0;
    --bs-link-hover-color: #004a00; --bs-link-hover-color-rgb: 0,74,0;
    --bs-body-color: #171717; --bs-body-bg: #f7f8f7;
    --bs-border-color: #e5e7eb; --bs-border-radius: .625rem; --bs-border-radius-lg: .875rem;
    --bs-body-font-size: .9rem;
    --ap-green: #006600; --ap-green-dark: #004a00; --ap-green-soft: #e8f3e8; --ap-red: #BD0000; --ap-red-soft: #fbeaea;
    --ap-ink: #171717; --ap-muted: #6b7280; --ap-line: #e5e7eb; --ap-card: #ffffff; --ap-soft: #f7f8f7;
    --ap-shadow: 0 1px 2px rgba(16,24,16,.05), 0 6px 20px rgba(16,24,16,.05);
    --ap-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body.atlas-body, body.ap-body {
    font-family: var(--ap-font); font-size: .9rem; line-height: 1.55; color: var(--ap-ink); background: var(--ap-soft);
    -webkit-font-smoothing: antialiased;
}
.atlas-main a:not(.btn):not(.atlas-nav-item):not(.nav-link):not(.dropdown-item) { color: var(--ap-green); text-decoration: none; }
.atlas-main a:not(.btn):not(.atlas-nav-item):not(.nav-link):not(.dropdown-item):hover { text-decoration: underline; }
.atlas-nav-item, .atlas-nav-item:hover { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--ap-ink); font-family: var(--ap-font); letter-spacing: -.01em; }

/* ---- buttons ---- */
.btn { font-weight: 600; border-radius: .6rem; padding: .5rem 1rem; font-size: .875rem; }
.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-primary { --bs-btn-bg: var(--ap-green); --bs-btn-border-color: var(--ap-green); --bs-btn-hover-bg: var(--ap-green-dark); --bs-btn-hover-border-color: var(--ap-green-dark);
    --bs-btn-active-bg: var(--ap-green-dark); --bs-btn-active-border-color: var(--ap-green-dark); --bs-btn-disabled-bg: var(--ap-green); --bs-btn-disabled-border-color: var(--ap-green); --bs-btn-focus-shadow-rgb: 0,102,0; }
.btn-danger { --bs-btn-bg: var(--ap-red); --bs-btn-border-color: var(--ap-red); --bs-btn-hover-bg: #8f0000; --bs-btn-hover-border-color: #8f0000; --bs-btn-active-bg: #8f0000; }
.btn-outline-primary { --bs-btn-color: var(--ap-green); --bs-btn-border-color: var(--ap-green); --bs-btn-hover-bg: var(--ap-green); --bs-btn-hover-border-color: var(--ap-green); --bs-btn-active-bg: var(--ap-green-dark); }
.btn-outline-dark { --bs-btn-color: #111; --bs-btn-border-color: #cfd4cf; --bs-btn-hover-bg: #111; --bs-btn-hover-border-color: #111; }
.btn-dark { --bs-btn-bg: #111; --bs-btn-border-color: #111; }
.form-control, .form-select { border-radius: .6rem; border-color: #d6dbd6; padding: .55rem .8rem; font-size: .9rem; }
.form-control:focus, .form-select:focus { border-color: var(--ap-green); box-shadow: 0 0 0 .2rem rgba(0,102,0,.14); }
.form-label { font-weight: 600; font-size: .8rem; color: #333; margin-bottom: .3rem; }
.form-text { font-size: .75rem; }
.form-check-input:checked { background-color: var(--ap-green); border-color: var(--ap-green); }
.badge { font-weight: 600; letter-spacing: .01em; }
.text-bg-primary { background-color: var(--ap-green) !important; }
.text-bg-danger { background-color: var(--ap-red) !important; }
.nav-tabs { border-bottom: 1px solid var(--ap-line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ap-muted); font-weight: 600; font-size: .85rem; padding: .65rem 1rem; border-radius: 0; }
.nav-tabs .nav-link:hover { color: var(--ap-ink); }
.nav-tabs .nav-link.active { color: var(--ap-green); border-bottom-color: var(--ap-green); background: transparent; }
.nav-pills .nav-link { color: var(--ap-muted); font-weight: 600; border-radius: .6rem; padding: .45rem .9rem; }
.nav-pills .nav-link.active { background: var(--ap-green); color: #fff; }
.alert { border-radius: .75rem; border: 0; padding: .85rem 1.1rem; }
.alert-success { background: var(--ap-green-soft); color: #0b4a0b; }
.alert-danger  { background: var(--ap-red-soft); color: #7a0000; }
.modal-content { border: 0; border-radius: 1rem; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.table { --bs-table-bg: transparent; font-size: .85rem; }

/* ---- page frame ---- */
.atlas-content { padding: 1.75rem 2rem 3rem; max-width: 1560px; }
@media (max-width: 767px) { .atlas-content { padding: 1.1rem 1rem 2.5rem; } }
.ap-pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: 0 0 1.5rem; }
.ap-eyebrow { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-green); margin-bottom: .25rem; }
.ap-pagehead h1 { font-size: 1.65rem; font-weight: 750; margin: 0 0 .25rem; }
.ap-pagehead p { margin: 0; color: var(--ap-muted); max-width: 70ch; }
.ap-pagehead .ap-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.ap-section { margin: 2rem 0 .85rem; display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.ap-section h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.ap-section small { color: var(--ap-muted); }

/* ---- cards ---- */
.ap-card { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: .9rem; box-shadow: var(--ap-shadow); height: auto; display: flex; flex-direction: column; }
.ap-card-head { padding: 1rem 1.25rem .6rem; display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.ap-card-head h3 { font-size: .95rem; font-weight: 700; margin: 0; }
.ap-card-head p  { margin: .15rem 0 0; font-size: .78rem; color: var(--ap-muted); }
.ap-card-body { padding: .5rem 1.25rem 1.25rem; flex: 1; }
.ap-card-body.flush { padding: 0; }
.ap-card-foot { padding: .7rem 1.25rem; border-top: 1px solid var(--ap-line); font-size: .76rem; color: var(--ap-muted); background: #fbfcfb; border-radius: 0 0 .9rem .9rem; }
.ap-chart { position: relative; width: 100%; }
.ap-chart canvas { max-width: 100%; }

/* ---- KPI tiles ---- */
.ap-kpi { background: var(--ap-card); border: 1px solid var(--ap-line); border-radius: .9rem; padding: 1.05rem 1.2rem; box-shadow: var(--ap-shadow); height: 100%; position: relative; overflow: hidden; }
.ap-kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ap-green); }
.ap-kpi.red::before { background: var(--ap-red); } .ap-kpi.dark::before { background: #111; } .ap-kpi.grey::before { background: #c4c9c4; }
.ap-kpi .lbl { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-muted); }
.ap-kpi .val { font-size: 1.75rem; font-weight: 780; line-height: 1.15; margin: .3rem 0 .1rem; letter-spacing: -.02em; }
.ap-kpi .sub { font-size: .76rem; color: var(--ap-muted); }
.ap-kpi .trend-up { color: var(--ap-green); font-weight: 700; } .ap-kpi .trend-down { color: var(--ap-red); font-weight: 700; }

/* ---- tables ---- */
.ap-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .84rem; }
.ap-table th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ap-muted); font-weight: 700; padding: .7rem 1rem; background: #fafbfa; border-bottom: 1px solid var(--ap-line); white-space: nowrap; position: sticky; top: 0; }
.ap-table td { padding: .7rem 1rem; border-bottom: 1px solid #f0f2f0; vertical-align: middle; }
.ap-table tr:last-child td { border-bottom: 0; }
.ap-table tbody tr:hover td { background: #fafcfa; }
.ap-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ap-scroll { overflow: auto; max-height: 560px; }

/* ---- small parts ---- */
.ap-pill { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 650; background: var(--ap-green-soft); color: #0b4a0b; white-space: nowrap; }
.ap-pill.red { background: var(--ap-red-soft); color: #7a0000; } .ap-pill.grey { background: #eef0ee; color: #4b5563; } .ap-pill.dark { background: #111; color: #fff; } .ap-pill.amber { background: #fff4d6; color: #6b4b00; }
.ap-bar { height: 8px; background: #edf0ed; border-radius: 99px; overflow: hidden; } .ap-bar > span { display: block; height: 100%; background: var(--ap-green); border-radius: 99px; }
.ap-bar.red > span { background: var(--ap-red); }
.ap-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ap-green); margin-right: .4rem; }
.ap-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .76rem; color: #444; margin-top: .75rem; } .ap-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: .35rem; vertical-align: -1px; }
.ap-empty { text-align: center; padding: 2.2rem 1.25rem; color: var(--ap-muted); } .ap-empty i { font-size: 2rem; color: #b8c2b8; display: block; margin-bottom: .6rem; }
.ap-empty strong { display: block; color: var(--ap-ink); margin-bottom: .25rem; }
.ap-note { border-left: 3px solid var(--ap-green); background: #f3f8f3; padding: .75rem 1rem; border-radius: 0 .6rem .6rem 0; font-size: .82rem; color: #1f3d1f; }
.ap-note.red { border-color: var(--ap-red); background: var(--ap-red-soft); color: #6a0000; }
.ap-kv { display: grid; grid-template-columns: 11rem 1fr; gap: .45rem 1rem; font-size: .84rem; } .ap-kv dt { color: var(--ap-muted); font-weight: 600; } .ap-kv dd { margin: 0; word-break: break-word; }
.ap-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; background: #f1f3f1; padding: .1rem .4rem; border-radius: .3rem; word-break: break-all; }
.ap-heat { display: grid; grid-template-columns: 3rem repeat(24, 1fr); gap: 2px; font-size: .62rem; color: var(--ap-muted); } .ap-heat div { aspect-ratio: 1.3; border-radius: 3px; background: #edf0ed; } .ap-heat .h { background: none; text-align: center; aspect-ratio: auto; }

/* ---- sidebar additions (collapsible groups, badges) ---- */
.atlas-nav-label.ap-toggle { cursor: pointer; display: flex; justify-content: space-between; user-select: none; }
.atlas-nav-label.ap-toggle::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: .6rem; opacity: .6; transition: transform .15s; }
.atlas-nav-label.ap-toggle.closed::after { transform: rotate(-90deg); }
.ap-group.closed { display: none; }
.ap-nav-badge { margin-left: auto; background: var(--ap-red); color: #fff; font-size: .65rem; padding: .05rem .45rem; border-radius: 99px; font-weight: 700; }
.atlas-nav-icon i { font-size: .95rem; }

/* ---- header: trial timer + user menu ---- */
.ap-trial { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .4rem; border-radius: 99px; background: #111; color: #fff; font-size: .78rem; font-weight: 600; }
.ap-trial .ring { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-variant-numeric: tabular-nums; background: conic-gradient(var(--ap-green) var(--deg, 360deg), #3a3a3a 0); position: relative; }
.ap-trial .ring::after { content: attr(data-s); position: absolute; inset: 3px; background: #111; border-radius: 50%; display: grid; place-items: center; }
.ap-trial.urgent { background: var(--ap-red); } .ap-trial.urgent .ring { background: conic-gradient(#fff var(--deg, 360deg), rgba(255,255,255,.25) 0); } .ap-trial.urgent .ring::after { background: var(--ap-red); }
.ap-user { display: inline-flex; align-items: center; gap: .55rem; }
.ap-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ap-green); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
body.ap-locked .atlas-content { filter: blur(6px); pointer-events: none; user-select: none; }

/* ---- gate / guest pages ---- */
.ap-auth { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, 5fr) 7fr; background: #fff; }
.ap-auth-side { background: radial-gradient(1200px 600px at -10% -10%, #0a7a0a 0%, #006600 40%, #003b00 100%); color: #fff; padding: 3rem 3rem 2.5rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.ap-auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.ap-auth-side h2 { color: #fff; font-size: 1.9rem; font-weight: 780; line-height: 1.2; margin: 2rem 0 1rem; }
.ap-auth-side .lead { color: rgba(255,255,255,.85); font-size: .98rem; }
.ap-auth-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; margin: 1.75rem 0; position: relative; z-index: 1; }
.ap-auth-stats div { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: .8rem; padding: .85rem 1rem; }
.ap-auth-stats strong { display: block; font-size: 1.35rem; font-weight: 780; } .ap-auth-stats span { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.ap-auth-perks { list-style: none; padding: 0; margin: 0; position: relative; z-index: 1; } .ap-auth-perks li { padding: .35rem 0 .35rem 1.6rem; position: relative; font-size: .88rem; color: rgba(255,255,255,.92); } .ap-auth-perks li::before { content: "\F26A"; font-family: "bootstrap-icons"; position: absolute; left: 0; top: .35rem; color: #9be29b; }
.ap-auth-main { padding: 3rem clamp(1.25rem, 5vw, 4.5rem); display: flex; align-items: center; justify-content: center; }
.ap-auth-box { width: 100%; max-width: 640px; } .ap-auth-box.narrow { max-width: 440px; }
.ap-auth-box h1 { font-size: 1.6rem; font-weight: 780; margin-bottom: .35rem; } .ap-auth-box > p.sub { color: var(--ap-muted); margin-bottom: 1.5rem; }
.ap-brand { display: flex; align-items: center; gap: .75rem; position: relative; z-index: 1; } .ap-brand .mark { width: 40px; height: 40px; border-radius: .7rem; background: #fff; color: var(--ap-green); display: grid; place-items: center; font-weight: 800; font-size: 1.2rem; } .ap-brand b { letter-spacing: .12em; display: block; } .ap-brand small { opacity: .8; }
.ap-fieldset { border: 1px solid var(--ap-line); border-radius: .9rem; padding: 1.1rem 1.2rem .4rem; margin-bottom: 1.1rem; background: #fcfdfc; } .ap-fieldset legend { float: none; width: auto; font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ap-green); padding: 0 .5rem; margin: 0 0 .75rem -.5rem; }
.ap-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem .75rem; }
@media (max-width: 991px) { .ap-auth { grid-template-columns: 1fr; } .ap-auth-side { padding: 2rem 1.5rem; } .ap-auth-side h2 { font-size: 1.4rem; margin-top: 1.25rem; } .ap-auth-stats { display: none; } }

/* ---- map ---- */
.ap-map { height: 640px; border-radius: .9rem; border: 1px solid var(--ap-line); overflow: hidden; background: #dfe9df; }
.ap-map-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.leaflet-container { font-family: var(--ap-font); }
.ap-map-legend { background: #fff; padding: .6rem .8rem; border-radius: .6rem; box-shadow: var(--ap-shadow); font-size: .75rem; line-height: 1.7; }
.ap-map-legend i { width: 12px; height: 12px; display: inline-block; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; }

/* ---- AI analyst ---- */
.ap-chat { display: flex; flex-direction: column; gap: 1rem; }
.ap-msg { max-width: 860px; } .ap-msg.q { align-self: flex-end; background: var(--ap-green); color: #fff; padding: .7rem 1rem; border-radius: 1rem 1rem .2rem 1rem; }
.ap-msg.a { background: #fff; border: 1px solid var(--ap-line); border-radius: 1rem 1rem 1rem .2rem; padding: 1rem 1.2rem; box-shadow: var(--ap-shadow); }
.ap-msg.a h4 { font-size: .98rem; font-weight: 700; } .ap-msg .src { font-size: .72rem; color: var(--ap-muted); margin-top: .6rem; border-top: 1px dashed var(--ap-line); padding-top: .5rem; }
.ap-chip { display: inline-block; padding: .4rem .85rem; border: 1px solid var(--ap-line); border-radius: 99px; background: #fff; font-size: .8rem; cursor: pointer; margin: 0 .4rem .5rem 0; } .ap-chip:hover { border-color: var(--ap-green); color: var(--ap-green); }
@media print { .atlas-sidebar, .atlas-header, .ap-actions, .no-print { display: none !important; } .atlas-main { margin: 0 !important; } .ap-card, .ap-kpi { box-shadow: none; break-inside: avoid; } }

/* ---- guest-preview bar pinned to the bottom ---- */
.ap-trialbar { position: fixed; left: var(--atlas-sidebar-width, 258px); right: 0; bottom: 0; z-index: 1030; background: #111; color: #fff; box-shadow: 0 -6px 24px rgba(0,0,0,.25); }
.ap-trialbar-inner { position: relative; display: flex; align-items: center; gap: 1rem; padding: .8rem 1.5rem .95rem; max-width: 1560px; }
.ap-trialbar .ring { flex: none; width: 46px; height: 46px; border-radius: 50%; position: relative; background: conic-gradient(#29b329 var(--deg, 360deg), #3a3a3a 0); }
.ap-trialbar .ring::after { content: attr(data-s); position: absolute; inset: 4px; background: #111; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ap-trialbar .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ap-trialbar .head { font-size: .95rem; letter-spacing: .01em; }
.ap-trialbar .how { font-size: .8rem; color: rgba(255,255,255,.78); }
.ap-trialbar .how b { color: #fff; }
.ap-trialbar .end { margin-left: auto; display: flex; gap: .5rem; flex: none; }
.ap-trialbar .progress-line { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #2a2a2a; }
.ap-trialbar .progress-line span { display: block; height: 100%; background: #29b329; transition: width .25s linear; }
.ap-trialbar.urgent { background: var(--ap-red); }
.ap-trialbar.urgent .ring { background: conic-gradient(#fff var(--deg, 360deg), rgba(255,255,255,.3) 0); } .ap-trialbar.urgent .ring::after { background: var(--ap-red); }
.ap-trialbar.urgent .progress-line { background: rgba(255,255,255,.3); } .ap-trialbar.urgent .progress-line span { background: #fff; }
.ap-trialbar.ended { background: #111; } .ap-trialbar.ended .end { display: flex !important; }
body.ap-has-trialbar .atlas-content { padding-bottom: 6.5rem; }
@media (max-width: 991px) { .ap-trialbar { left: 0; } .ap-trialbar-inner { padding: .65rem 1rem .85rem; gap: .75rem; } .ap-trialbar .how { display: none; } .ap-trialbar .ring { width: 40px; height: 40px; } }

/* ---- floating AI assistant ---- */
.ap-assist { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040; display: flex; flex-direction: column; align-items: flex-end; gap: .7rem; }
.ap-assist.with-trialbar { bottom: 6.4rem; }
.ap-assist-btn { position: relative; border: 0; background: linear-gradient(135deg, #0a8a0a, #004a00); color: #fff; height: 56px; min-width: 56px; padding: 0 1.15rem 0 1rem; border-radius: 99px; display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; font-size: .9rem; box-shadow: 0 10px 28px rgba(0,74,0,.45); cursor: pointer; transition: transform .15s; }
.ap-assist-btn:hover { transform: translateY(-2px); }
.ap-assist-btn i { font-size: 1.25rem; } .ap-assist-btn .close-i { display: none; }
.ap-assist.is-open .ap-assist-btn .open-i, .ap-assist.is-open .ap-assist-btn .tag { display: none; } .ap-assist.is-open .ap-assist-btn .close-i { display: inline; } .ap-assist.is-open .ap-assist-btn { padding: 0; width: 56px; justify-content: center; }
.ap-assist-btn .pulse { position: absolute; inset: 0; border-radius: 99px; border: 2px solid #29b329; animation: apPulse 2.4s ease-out infinite; pointer-events: none; } .ap-assist-btn .p2 { animation-delay: 1.2s; }
.ap-assist.is-open .pulse { display: none; }
@keyframes apPulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.45, 1.9); opacity: 0; } }
.ap-assist-hint { max-width: min(340px, 78vw); background: #fff; border: 1px solid var(--ap-line); border-radius: 1rem 1rem .2rem 1rem; box-shadow: var(--ap-shadow), 0 12px 30px rgba(0,0,0,.12); padding: .65rem .9rem; font-size: .82rem; cursor: pointer; opacity: 0; transform: translateY(8px) scale(.97); pointer-events: none; transition: all .25s; }
.ap-assist-hint.show { opacity: 1; transform: none; pointer-events: auto; }
.ap-assist-hint .lbl { display: block; font-size: .66rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ap-green); margin-bottom: .15rem; }
.ap-assist-hint .caret { display: inline-block; width: 2px; height: 1em; background: var(--ap-green); vertical-align: -2px; margin-left: 1px; animation: apBlink 1s steps(1) infinite; }
@keyframes apBlink { 50% { opacity: 0; } }
.ap-assist-panel { width: min(420px, calc(100vw - 2rem)); height: min(620px, calc(100vh - 11rem)); background: #fff; border-radius: 1.1rem; box-shadow: 0 24px 60px rgba(0,0,0,.28); display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--ap-line); }
.ap-assist-panel.open { display: flex; animation: apRise .22s ease-out; }
@keyframes apRise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.ap-assist-panel header { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; background: linear-gradient(135deg, #006600, #003b00); color: #fff; }
.ap-assist-panel header .av { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; font-size: 1.1rem; }
.ap-assist-panel header strong { display: block; font-size: .92rem; line-height: 1.2; } .ap-assist-panel header small { opacity: .8; font-size: .72rem; }
.ap-assist-panel .live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #5be05b; margin-right: .3rem; animation: apBlink 1.6s infinite; }
.ap-assist-log { flex: 1; overflow-y: auto; padding: 1rem; background: #f7f8f7; display: flex; flex-direction: column; gap: .8rem; }
.ap-assist-log .ap-msg { max-width: 100%; font-size: .84rem; } .ap-assist-log .ap-msg.a { padding: .8rem .9rem; } .ap-assist-log .ap-msg h4 { font-size: .9rem; }
.ap-assist-form { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--ap-line); background: #fff; }
.ap-chips { display: flex; flex-direction: column; align-items: flex-start; }
.ap-chips .ap-chip { text-align: left; margin: 0 0 .4rem; animation: apIn .35s both; }
.ap-in { animation: apIn .35s both; } @keyframes apIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ap-think { display: inline-flex; gap: 4px; vertical-align: middle; } .ap-think i { width: 7px; height: 7px; border-radius: 50%; background: var(--ap-green); animation: apDot 1s infinite; } .ap-think i:nth-child(2) { animation-delay: .15s; } .ap-think i:nth-child(3) { animation-delay: .3s; }
@keyframes apDot { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.ap-msg p { margin: 0 0 .55rem; }
@media (max-width: 575px) { .ap-assist { right: .75rem; bottom: .75rem; } .ap-assist.with-trialbar { bottom: 5rem; } .ap-assist-btn .tag { display: none; } .ap-assist-btn { padding: 0; width: 56px; justify-content: center; } .ap-assist-panel { height: min(560px, calc(100vh - 9rem)); } }
@media (prefers-reduced-motion: reduce) { .ap-assist *, .ap-in, .ap-chips .ap-chip { animation: none !important; } }

/* ---- Ask page: animated "how it works" ---- */
.ap-hero { background: radial-gradient(900px 400px at 0% 0%, #0a7a0a 0%, #006600 45%, #003b00 100%); color: #fff; border-radius: 1.1rem; padding: 2rem clamp(1.1rem, 3vw, 2.4rem); position: relative; overflow: hidden; }
.ap-hero h1 { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 780; } .ap-hero p { color: rgba(255,255,255,.86); max-width: 62ch; }
.ap-flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-top: 1.4rem; position: relative; }
.ap-step { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: .9rem; padding: .9rem 1rem; min-height: 170px; opacity: .45; transform: scale(.98); transition: all .4s; position: relative; }
.ap-step.on { opacity: 1; transform: none; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.5); box-shadow: 0 0 0 3px rgba(91,224,91,.25); }
.ap-step .n { width: 24px; height: 24px; border-radius: 50%; background: #fff; color: #006600; font-weight: 800; font-size: .75rem; display: grid; place-items: center; margin-bottom: .45rem; }
.ap-step h5 { color: #fff; font-size: .9rem; font-weight: 700; margin: 0 0 .3rem; } .ap-step .body { font-size: .78rem; color: rgba(255,255,255,.9); line-height: 1.5; }
.ap-step .typed { font-family: ui-monospace, Menlo, monospace; font-size: .76rem; background: rgba(0,0,0,.25); padding: .4rem .55rem; border-radius: .45rem; min-height: 3.2em; }
.ap-step .tag { display: inline-block; background: #fff; color: #004a00; border-radius: 99px; font-size: .68rem; font-weight: 700; padding: .1rem .5rem; margin: 0 .25rem .25rem 0; opacity: .35; transition: opacity .3s; } .ap-step .tag.hit { opacity: 1; background: #b9f5b9; }
.ap-step .scan { height: 6px; border-radius: 9px; background: rgba(255,255,255,.2); overflow: hidden; margin: .35rem 0; } .ap-step .scan span { display: block; height: 100%; width: 0; background: #7be37b; transition: width 1.1s ease; }
.ap-step .num { font-size: 1.5rem; font-weight: 800; }
.ap-flow-ctl { margin-top: .9rem; display: flex; gap: .6rem; align-items: center; font-size: .75rem; color: rgba(255,255,255,.75); }
.ap-ex-group h6 { font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ap-green); margin: 0 0 .6rem; }
.ap-ex { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--ap-line); border-radius: .75rem; padding: .7rem .9rem; margin-bottom: .5rem; cursor: pointer; transition: all .15s; }
.ap-ex:hover { border-color: var(--ap-green); box-shadow: 0 6px 18px rgba(0,102,0,.12); transform: translateY(-1px); }
.ap-ex b { display: block; font-size: .86rem; color: var(--ap-ink); font-weight: 650; } .ap-ex span { font-size: .75rem; color: var(--ap-muted); } .ap-ex i { color: var(--ap-green); margin-right: .35rem; }
.ap-askbox { position: sticky; bottom: 0; background: linear-gradient(to top, var(--ap-soft) 70%, transparent); padding: 1rem 0 .25rem; }
@media (max-width: 991px) { .ap-flow { grid-template-columns: 1fr 1fr; } } @media (max-width: 575px) { .ap-flow { grid-template-columns: 1fr; } .ap-step { min-height: 0; } }
@media (prefers-reduced-motion: reduce) { .ap-step { transition: none; } }

/* ---- long-form text, timeline, link cards ---- */
.ap-prose { font-size: .95rem; line-height: 1.7; max-width: 78ch; } .ap-prose h2, .ap-prose h3 { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .5rem; } .ap-prose h1 { font-size: 1.3rem; }
.ap-prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .86rem; } .ap-prose th, .ap-prose td { border: 1px solid var(--ap-line); padding: .45rem .7rem; } .ap-prose th { background: #f6f8f6; }
.ap-prose code { background: #f1f3f1; padding: .1rem .35rem; border-radius: .3rem; font-size: .82em; } .ap-prose li { margin-bottom: .35rem; }
.ap-timeline { padding: .5rem 1.25rem 1.25rem; position: relative; }
.ap-tl-item { display: flex; gap: .9rem; padding: .75rem 0; border-bottom: 1px solid #f0f2f0; } .ap-tl-item:last-child { border: 0; }
.ap-tl-item .ico { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--ap-green-soft); color: var(--ap-green); }
.ap-tl-item.amber .ico { background: #fff4d6; color: #6b4b00; } .ap-tl-item.dark .ico { background: #111; color: #fff; }
.ap-link-card { transition: transform .15s, box-shadow .15s; } .ap-link-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,102,0,.14); }

/* ---- country switcher ---- */
.ap-cl-h { font-size: .65rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; color: var(--ap-muted); padding: .6rem 1rem .25rem; background: #fafbfa; position: sticky; top: 0; }
.ap-country .dropdown-item { font-size: .84rem; padding: .4rem 1rem; } .ap-country .dropdown-item.active { background: var(--ap-green); }
.ap-kpi .val.long { font-size: 1.25rem; line-height: 1.3; margin: .45rem 0 .2rem; }
@media (max-width: 575px) { .ap-kpi { padding: .85rem .95rem; } .ap-kpi .val { font-size: 1.45rem; } .ap-kpi .val.long { font-size: 1.1rem; } .ap-hero .btn { flex: 1 1 auto; } }

/* ---- brand: green menu, logo converts to pure white on desktop, original on mobile ---- */
.atlas-sidebar { background: #006600; color: #fff; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.atlas-sidebar::-webkit-scrollbar { width: 6px; } .atlas-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 6px; }
.atlas-brand { display: flex; align-items: center; justify-content: flex-start; height: var(--atlas-header-height, 72px); padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.22); text-decoration: none; }
.atlas-logo { display: block; width: 100%; max-width: 218px; height: auto; max-height: 44px; object-fit: contain; object-position: left center; }
.atlas-nav-label { color: rgba(255,255,255,.62); }
.atlas-nav-item { color: rgba(255,255,255,.9); }
.atlas-nav-item:hover { background: rgba(255,255,255,.14); color: #fff; }
.atlas-nav-item.is-active { background: #fff; color: #006600; font-weight: 700; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.atlas-nav-item.is-active .atlas-nav-text { font-weight: 700; }
.atlas-nav-meta { color: rgba(255,255,255,.7); }
.ap-nav-badge { background: #fff; color: #BD0000; }
.atlas-nav-label.ap-toggle:hover { color: #fff; }
.ap-mobile-logo { display: none; }
.ap-mobile-logo img { display: block; height: 30px; width: auto; max-width: none; flex: none; aspect-ratio: 680 / 138; }
.ap-brand-logo { display: block; width: 100%; max-width: 250px; height: auto; }
.ap-brand { display: block; position: relative; z-index: 1; }
@media (max-width: 800px) {
    /* mobile: the logo appears in its original colours in the white top bar; the green drawer holds the menu only */
    .ap-mobile-logo { display: inline-flex; align-items: center; flex: 0 0 auto; margin-right: auto; }
    .atlas-brand { display: none; }
    .atlas-sidebar { padding-top: .75rem; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
}

/* ---- sidebar layout: logo on top, scrolling menu, black footer pinned to the bottom ---- */
.atlas-sidebar { display: flex; flex-direction: column; overflow: hidden; }
.atlas-sidebar .atlas-brand { flex: none; }
.atlas-sidebar .atlas-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.atlas-sidebar .atlas-nav::-webkit-scrollbar { width: 6px; } .atlas-sidebar .atlas-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 6px; }
.atlas-sidebar-foot { flex: none; background: #000; color: #fff; padding: 14px 20px 16px; font-size: 11.5px; line-height: 1.7; border-top: 1px solid rgba(255,255,255,.18); }
.atlas-sidebar-foot .yr { color: #fff; font-weight: 600; letter-spacing: .02em; }
.atlas-sidebar-foot a { display: block; color: #fff; text-decoration: none; }
.atlas-sidebar-foot a:hover, .atlas-sidebar-foot a:focus { color: #fff; text-decoration: underline; }

/* mobile drawer: sits above the preview bar and the assistant button; tap the dimmed area to close */
@media (max-width: 800px) {
    .atlas-sidebar { z-index: 1060; max-width: 86vw; }
    .ap-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1055; animation: apIn .2s both; }
}

/* mobile menu: a clear CLOSE button at the very top of the drawer */
.atlas-drawer-close { display: none; }
@media (max-width: 800px) {
    .atlas-drawer-close { display: flex; align-items: center; justify-content: center; gap: .6rem; flex: none; width: 100%; height: 60px; border: 0; border-bottom: 1px solid rgba(255,255,255,.28);
        background: #004a00; color: #fff; font: 700 .9rem/1 var(--ap-font); letter-spacing: .14em; cursor: pointer; }
    .atlas-drawer-close i { font-size: 1.15rem; }
    .atlas-drawer-close:active { background: #003b00; }
}
.atlas-sidebar-foot .pw { color: #fff; opacity: .75; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }

/* admin block of the menu: red ADMIN banner below the normal menu */
.atlas-admin-banner { display: flex; align-items: center; gap: .6rem; background: #bd0000; color: #fff; font-weight: 800; font-size: 12.5px; letter-spacing: .2em; padding: 11px 20px; margin: 18px -12px 8px; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.atlas-admin-banner i { font-size: 1rem; }

/* cards that size to their content instead of stretching to the neighbouring column */
.ap-card.fit { height: auto; }
.ap-map-side { position: sticky; top: 1rem; align-self: flex-start; max-height: calc(100vh - 2rem); overflow-y: auto; scrollbar-width: thin; }
.ap-layer-list { max-height: clamp(160px, calc(100vh - 430px), 520px); overflow: auto; margin-right: -.4rem; padding-right: .4rem; }
@media (max-width: 991px) { .ap-map-side { position: static; max-height: none; overflow: visible; } .ap-layer-list { max-height: 320px; } }
.ap-noimg-drag img { -webkit-user-drag: none; user-select: none; }

.ap-accordion .accordion-item { border: 1px solid var(--ap-line); border-radius: .75rem !important; margin-bottom: .6rem; overflow: hidden; background: #fff; }
.ap-accordion .accordion-button { font-size: .88rem; padding: .8rem 1rem; box-shadow: none; background: #fff; }
.ap-accordion .accordion-button:not(.collapsed) { background: var(--ap-green-soft); color: #0b4a0b; }
.ap-chip-next { font-size: .76rem; padding: .3rem .7rem; text-align: left; }

/* call-to-action button in card footers: green with white text */
.ap-card-foot.cta { padding: .85rem 1.25rem; background: #fff; }
.ap-cta { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%; background: #006600; color: #fff !important; font-weight: 700; font-size: .92rem; padding: .75rem 1.1rem; border-radius: .65rem; text-decoration: none !important; box-shadow: 0 4px 14px rgba(0,102,0,.28); transition: background .15s, transform .15s; }
.ap-cta:hover, .ap-cta:focus { background: #004a00; color: #fff !important; transform: translateY(-1px); }
.ap-cta i { transition: transform .15s; } .ap-cta:hover i { transform: translateX(3px); }
.atlas-sidebar-foot .lg { display: flex; gap: .5rem; margin-top: .55rem; padding-top: .55rem; border-top: 1px solid rgba(255,255,255,.18); font-size: 11px; }
.atlas-sidebar-foot .lg a { display: inline; } .atlas-sidebar-foot .lg span { opacity: .5; }

/* ---- data themes ---- */
.ap-chip{display:inline-flex;align-items:center;gap:.4rem;padding:.3rem .7rem;border:1px solid #cfd8cf;border-radius:999px;background:#fff;color:#1b2b1b;font-size:.82rem;text-decoration:none;line-height:1.2}
.ap-chip span{background:#eef3ee;border-radius:999px;padding:0 .45rem;font-size:.72rem;color:#355;font-weight:600}
.ap-chip:hover{border-color:#006600;color:#006600}
.ap-chip.on,.ap-chip.on:hover{background:#006600;border-color:#006600;color:#fff !important}
.ap-chip.on span{background:rgba(255,255,255,.2);color:#fff}
.ap-theme-ico{flex:none;width:2.4rem;height:2.4rem;border-radius:.6rem;background:#006600;color:#fff;display:flex;align-items:center;justify-content:center;font-size:1.15rem}

.ap-sw{display:inline-block;width:.7rem;height:.7rem;border-radius:3px;margin-right:.45rem;vertical-align:-1px;border:1px solid rgba(0,0,0,.25);flex:none}
.ap-chip .ap-sw{margin-right:0;border-color:rgba(255,255,255,.7)}

/* ---- desktop menu modes: full / icons only / hidden (set on <html> by the sidebar script) ---- */
.atlas-dock, .atlas-emblem { display: none; }
@media (min-width: 901px) {
    .atlas-main, .ap-trialbar { transition: margin-left .22s ease, left .22s ease; }
    .atlas-sidebar { transition: width .22s ease, transform .22s ease; }
    .atlas-dock { display: flex; gap: .4rem; flex: none; padding: .45rem .75rem; border-bottom: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.14); }
    .atlas-dock-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 6px; padding: .28rem .4rem; font-size: .72rem; letter-spacing: .04em; cursor: pointer; line-height: 1.2; }
    .atlas-dock-btn:hover, .atlas-dock-btn:focus-visible { background: rgba(255,255,255,.16); outline: none; }
    .atlas-dock-btn i { font-size: .85rem; }

    html.menu-icons { --atlas-sidebar-width: 64px; }
    html.menu-hidden { --atlas-sidebar-width: 0px; }
    html.menu-hidden .atlas-sidebar { transform: translateX(-100%); box-shadow: none; }
    html.menu-hidden .atlas-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 10px; border: 1px solid #cfd8cf; border-radius: 8px; background: #fff; color: #006600; font-size: 20px; cursor: pointer; }
    html.menu-hidden .atlas-menu-toggle:hover { background: #006600; color: #fff; }

    html.menu-icons .atlas-brand { justify-content: center; padding: 0; height: 64px; }
    html.menu-icons .atlas-logo { display: none; }
    html.menu-icons .atlas-emblem { display: block; width: 36px; height: 36px; }
    html.menu-icons .atlas-dock { flex-direction: column; padding: .4rem; }
    html.menu-icons .atlas-dock-btn span { display: none; }
    html.menu-icons .atlas-nav { padding-left: .5rem; padding-right: .5rem; }
    html.menu-icons .atlas-nav-label { font-size: 0; height: 1px; padding: 0; margin: 8px 6px; background: rgba(255,255,255,.28); }
    html.menu-icons .atlas-nav-label::after { display: none; }
    html.menu-icons .ap-group.closed { display: block; }
    html.menu-icons .atlas-nav-item { justify-content: center; padding: 0; position: relative; }
    html.menu-icons .atlas-nav-icon { margin: 0; width: auto; font-size: 1.1rem; }
    html.menu-icons .atlas-nav-text { display: none; }
    html.menu-icons .ap-nav-badge { position: absolute; top: 3px; right: 3px; margin: 0; font-size: .58rem; padding: 0 .3rem; }
    html.menu-icons .atlas-admin-banner { justify-content: center; padding: 9px 0; margin: 12px -8px 6px; }
    html.menu-icons .atlas-admin-banner span { display: none; }
    html.menu-icons .atlas-sidebar-foot { display: none; }
}
@media (max-width: 900px) { .atlas-dock { display: none !important; } }
.ap-chat .ap-msg { scroll-margin-top: calc(var(--atlas-header-height, 72px) + 14px); }

/* ---- Ask page: the conversation and the examples each scroll inside their own frame ---- */
.ap-ask-frame { display: flex; flex-direction: column; height: calc(100vh - var(--atlas-header-height, 72px) - 36px); min-height: 460px; scroll-margin-top: calc(var(--atlas-header-height, 72px) + 12px); }
.ap-ask-frame .ap-card-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ap-ask-frame #askLog { position: relative; flex: 1 1 auto; min-height: 0 !important; overflow-y: auto; overscroll-behavior: contain; padding: 0 .5rem .5rem 0; scrollbar-width: thin; }
.ap-ask-frame .ap-askbox { position: static; flex: none; background: transparent; padding: .75rem 0 .1rem; border-top: 1px solid var(--ap-line, #e5e7eb); margin-top: .25rem; }
@media (min-width: 1200px) {
    .ap-ask-side { position: sticky; top: calc(var(--atlas-header-height, 72px) + 14px); max-height: calc(100vh - var(--atlas-header-height, 72px) - 36px); overflow-y: auto; overscroll-behavior: contain; padding-right: .35rem; scrollbar-width: thin; }
}
@media (max-width: 1199px) {
    .ap-ask-frame { height: 78vh; }
    .ap-ask-side { max-height: 60vh; overflow-y: auto; margin-bottom: 1rem; }
}

.ap-zoom-layer { border: 1px solid #cfd8cf; background: #fff; color: #006600; border-radius: 6px; width: 1.55rem; height: 1.55rem; line-height: 1; padding: 0; margin-left: .25rem; cursor: pointer; }
.ap-zoom-layer:hover, .ap-zoom-layer:focus-visible { background: #006600; color: #fff; outline: none; }

/* ---- exports and PDF are for institutional administrators: locked controls, and nothing prints for everyone else ---- */
.ap-locked, .btn.disabled.ap-locked { cursor: not-allowed; opacity: .6; pointer-events: auto; }
.ap-locked .btn.disabled { cursor: not-allowed; }
@media print {
    body.no-export > * { display: none !important; }
    body.no-export::before { content: "Printing and saving as PDF are available to institutional administrators. Visit Institutional Access in Atlas to apply."; display: block; padding: 2rem; font: 600 16pt/1.5 sans-serif; color: #000; }
}

/* ---- aligned attribute lists (provenance page, popups, data table) ---- */
.ap-attrs { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: .84rem; }
.ap-attrs tr + tr th, .ap-attrs tr + tr td { border-top: 1px solid var(--ap-line, #eef1ee); }
.ap-attrs th { width: 36%; padding: .5rem .75rem; vertical-align: top; text-align: left; font-weight: 600; color: var(--ap-muted, #6b7280); word-break: break-word; background: rgba(0,0,0,.015); }
.ap-attrs td { padding: .5rem .75rem; vertical-align: top; word-break: break-word; overflow-wrap: anywhere; }
.ap-attrs .ap-code { font-size: .78rem; }
.ap-kvchips { display: flex; flex-wrap: wrap; gap: .3rem; }
.ap-kvchip { display: inline-flex; gap: .35rem; align-items: baseline; padding: .12rem .5rem; border: 1px solid #dfe6df; border-radius: 6px; background: #fff; font-size: .76rem; line-height: 1.35; white-space: nowrap; }
.ap-kvchip b { color: #006600; font-weight: 700; }
.ap-kvnest { display: grid; grid-template-columns: max-content 1fr; gap: .15rem .9rem; margin: 0; }
.ap-kvnest dt { color: var(--ap-muted, #6b7280); font-weight: 600; } .ap-kvnest dd { margin: 0; }
.ap-json { margin: 0; padding: .5rem .6rem; max-height: 14rem; overflow: auto; background: #f6f8f6; border-radius: 6px; font-size: .74rem; white-space: pre-wrap; word-break: break-word; }
.ap-pop { min-width: 230px; max-width: 320px; }
.ap-pop strong { display: block; line-height: 1.25; }
.ap-pop-sub { color: #6b7280; font-size: .76rem; margin-bottom: .35rem; }
.ap-pop table { width: 100%; border-collapse: collapse; font-size: .78rem; margin-bottom: .35rem; }
.ap-pop th { width: 38%; padding: .2rem .5rem .2rem 0; text-align: left; vertical-align: top; color: #6b7280; font-weight: 600; }
.ap-pop td { padding: .2rem 0; vertical-align: top; word-break: break-word; }
.ap-pop tr + tr th, .ap-pop tr + tr td { border-top: 1px solid #eef1ee; }
.ap-pop-link { font-size: .78rem; }
.ap-cell-json { color: #6b7280; cursor: help; border-bottom: 1px dotted #9aa0a6; }
.ap-cell-text { display: inline-block; max-width: 22rem; overflow-wrap: anywhere; }

/* ---- provenance page ---- */
.ap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem 1.25rem; padding-top: .9rem; border-top: 1px solid var(--ap-line, #e5e7eb); }
.ap-facts div { display: flex; flex-direction: column; gap: .1rem; min-width: 0; } .ap-facts span { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ap-muted, #6b7280); } .ap-facts b { font-weight: 600; word-break: break-word; }
.ap-section-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--ap-muted, #6b7280); }
.ap-trace { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; position: relative; }
.ap-trace-step { position: relative; background: #fff; border: 1px solid var(--ap-line, #e5e7eb); border-radius: .9rem; padding: 1rem 1rem .9rem; box-shadow: var(--ap-shadow, none); }
.ap-trace-step .n { position: absolute; top: -.7rem; left: 1rem; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #006600; color: #fff; font: 700 .78rem/1.5rem var(--ap-font, inherit); text-align: center; font-style: normal; }
.ap-trace-step:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -1rem; width: 1rem; border-top: 2px dashed #b7c8b7; }
.ap-trace-step h5 { font-size: .95rem; margin: .2rem 0 .6rem; }
.ap-trace-step dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .8rem; margin: 0; font-size: .82rem; }
.ap-trace-step dt { color: var(--ap-muted, #6b7280); font-weight: 600; } .ap-trace-step dd { margin: 0; min-width: 0; word-break: break-word; }
@media (max-width: 900px) { .ap-trace { grid-template-columns: 1fr; } .ap-trace-step:not(:last-child)::after { display: none; } }
.ap-attrs3 thead th { text-transform: uppercase; font-size: .68rem; letter-spacing: .1em; background: #f6f8f6; width: auto; }
.ap-attrs3 th:first-child { width: 28%; } .ap-attrs3 td { width: 36%; }
details > summary { list-style: none; } details > summary::-webkit-details-marker { display: none; }

/* ---- profile pictures ---- */
.ap-avatar { overflow: hidden; } .ap-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.ap-avatar-lg { flex: none; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: #006600; color: #fff; display: flex; align-items: center; justify-content: center; font: 700 2.6rem/1 var(--ap-font, inherit); border: 3px solid #fff; box-shadow: 0 0 0 1px #cfd8cf; }
.ap-avatar-lg img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- public marketing pages (About) ---- */
.ap-pub-top { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--ap-line, #e5e7eb); }
.ap-pub-top .in { max-width: 1240px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.ap-pub-top img { height: 34px; width: auto; } .ap-pub-top nav a:not(.btn) { color: #1b2b1b; text-decoration: none; } .ap-pub-top nav a:not(.btn):hover { color: #006600; }
.ap-nocopy, .ap-nocopy * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ap-nocopy input, .ap-nocopy textarea, .ap-nocopy select { -webkit-user-select: text; user-select: text; }
.ap-hero2 { background: radial-gradient(1200px 500px at 85% -10%, rgba(255,255,255,.14), transparent 60%), linear-gradient(135deg, #003d00 0%, #006600 55%, #0a7d1f 100%); color: #fff; padding: 4.5rem 1.25rem 3.5rem; }
.ap-hero2 .in { max-width: 1240px; margin: 0 auto; }
.ap-hero2 .kicker { letter-spacing: .18em; text-transform: uppercase; font-size: .74rem; color: #b9f0b9; font-weight: 700; }
.ap-hero2 h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; line-height: 1.08; margin: .6rem 0 1rem; max-width: 22ch; }
.ap-hero2 p.lead { font-size: 1.12rem; max-width: 62ch; color: #e9f7e9; line-height: 1.7; }
.ap-hero2 .btn-light { color: #006600; font-weight: 700; } .ap-hero2 .btn-outline-light { font-weight: 600; }
.ap-statband { max-width: 1240px; margin: -2.1rem auto 0; padding: 0 1.25rem; position: relative; z-index: 2; }
.ap-statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; }
.ap-stat { background: #fff; border: 1px solid var(--ap-line, #e5e7eb); border-radius: .9rem; padding: .95rem 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.ap-stat b { display: block; font-size: 1.65rem; font-weight: 800; color: #006600; line-height: 1.1; } .ap-stat span { font-size: .78rem; color: #55605a; }
.ap-pub-wrap { max-width: 1240px; margin: 0 auto; padding: 3rem 1.25rem 4rem; display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2.6rem; }
.ap-pub-toc { position: sticky; top: 5rem; align-self: start; font-size: .84rem; max-height: calc(100vh - 7rem); overflow: auto; }
.ap-pub-toc h6 { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ap-muted, #6b7280); }
.ap-pub-toc a { display: block; padding: .32rem .6rem; border-left: 2px solid var(--ap-line, #e5e7eb); color: #333; text-decoration: none; } .ap-pub-toc a:hover, .ap-pub-toc a.on { border-color: #006600; color: #006600; font-weight: 600; }
.ap-doc h2 { font-size: 1.7rem; font-weight: 800; margin: 3.2rem 0 .8rem; scroll-margin-top: 5rem; letter-spacing: -.01em; } .ap-doc h2:first-child { margin-top: 0; }
.ap-doc h3 { font-size: 1.08rem; font-weight: 750; margin: 1.6rem 0 .45rem; } .ap-doc p, .ap-doc li { font-size: 1rem; line-height: 1.8; color: #202a24; }
.ap-doc .lede { font-size: 1.12rem; color: #2b372f; }
.ap-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.ap-pcard { background: #fff; border: 1px solid var(--ap-line, #e5e7eb); border-radius: 1rem; padding: 1.15rem 1.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.ap-pcard .ico { width: 2.4rem; height: 2.4rem; border-radius: .65rem; background: #006600; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; margin-bottom: .6rem; }
.ap-pcard h3 { margin: 0 0 .35rem; font-size: 1.02rem; } .ap-pcard p { font-size: .92rem; line-height: 1.65; margin: 0 0 .5rem; } .ap-pcard ul { padding-left: 1.1rem; margin: 0; } .ap-pcard li { font-size: .88rem; line-height: 1.6; }
.ap-callout { background: #f0f7f0; border-left: 4px solid #006600; border-radius: 0 .8rem .8rem 0; padding: 1rem 1.25rem; margin: 1.4rem 0; }
.ap-callout.red { background: #fbf0f0; border-color: #bd0000; }
.ap-flow3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; counter-reset: st; margin: 1.2rem 0; }
.ap-flow3 > div { position: relative; background: #fff; border: 1px solid var(--ap-line, #e5e7eb); border-radius: 1rem; padding: 1.1rem 1.1rem 1rem 3rem; counter-increment: st; }
.ap-flow3 > div::before { content: counter(st); position: absolute; left: .9rem; top: 1rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: #bd0000; color: #fff; font-weight: 700; font-size: .85rem; text-align: center; line-height: 1.6rem; }
.ap-flow3 b { display: block; margin-bottom: .2rem; } .ap-flow3 span { font-size: .9rem; line-height: 1.6; color: #3a463e; }
.ap-doc table.ap-t { width: 100%; border-collapse: collapse; margin: 1.1rem 0; font-size: .92rem; } .ap-doc .ap-t th, .ap-doc .ap-t td { border: 1px solid var(--ap-line, #e5e7eb); padding: .6rem .75rem; vertical-align: top; } .ap-doc .ap-t th { background: #f4f8f4; text-align: left; }
.ap-faq details { border: 1px solid var(--ap-line, #e5e7eb); border-radius: .8rem; padding: .85rem 1.1rem; margin-bottom: .6rem; background: #fff; } .ap-faq summary { cursor: pointer; font-weight: 700; } .ap-faq details[open] summary { color: #006600; margin-bottom: .4rem; }
.ap-partner { background: linear-gradient(135deg, #f0f7f0, #fff); border: 1px solid #cfe3cf; border-radius: 1.2rem; padding: 1.6rem; }
@media (max-width: 960px) { .ap-pub-wrap { grid-template-columns: 1fr; } .ap-pub-toc { position: static; max-height: none; border-bottom: 1px solid var(--ap-line, #e5e7eb); padding-bottom: 1rem; } .ap-hero2 { padding-top: 3rem; } }
@media print { .ap-pub-top, .ap-pub-toc { display: none !important; } }
.ap-public .lg-foot { background: #000; color: #fff; padding: 1.8rem 1.25rem; font-size: .82rem; line-height: 1.9; }
.ap-public .lg-foot .in { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .5rem 3rem; justify-content: space-between; }
.ap-public .lg-foot a { color: #fff; text-decoration: none; display: block; } .ap-public .lg-foot a:hover { text-decoration: underline; }
.ap-hero2 h1, .ap-hero2 .lead { color: #fff !important; }

.ap-stack { display: grid; gap: .45rem; margin: 1.4rem 0; }
.ap-stack .r { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.2rem; padding: .85rem 1.2rem; border-radius: .8rem; color: #fff; }
.ap-stack .r b { min-width: 14rem; font-size: 1rem; } .ap-stack .r span { font-size: .9rem; opacity: .95; flex: 1 1 18rem; }
.ap-stack .r5 { background: #bd0000; margin: 0 0 0 0; } .ap-stack .r4 { background: #a1442a; margin: 0 1.2rem; } .ap-stack .r3 { background: #6b6f1d; margin: 0 2.4rem; } .ap-stack .r2 { background: #1c6a2a; margin: 0 3.6rem; } .ap-stack .r1 { background: #003d00; margin: 0 4.8rem; }
@media (max-width: 760px) { .ap-stack .r4, .ap-stack .r3, .ap-stack .r2, .ap-stack .r1 { margin-left: 0; margin-right: 0; } .ap-stack .r b { min-width: 0; } }

/* ---- checkboxes and radios: always visible, with a green border ---- */
.form-check-input, input[type="checkbox"], input[type="radio"] { border: 2px solid #006600 !important; background-color: #fff; }
.form-check-input { width: 1.15em; height: 1.15em; margin-top: .2em; }
.form-check-input:checked, input[type="checkbox"]:checked, input[type="radio"]:checked { background-color: #006600 !important; border-color: #006600 !important; }
.form-check-input:focus-visible, .form-check-input:focus { border-color: #006600; box-shadow: 0 0 0 .22rem rgba(0, 102, 0, .25); outline: none; }
.form-check-input:disabled { opacity: .5; }

/* every box ends where its content ends (no stretching to match a taller neighbour) */
.ap-card, .ap-card.h-100 { height: auto !important; align-self: flex-start; }
.row > [class*="col"] > .ap-card, .row > [class*="col"] > .ap-card + .ap-card { width: 100%; }
.ap-ask-frame { height: calc(100vh - var(--atlas-header-height, 72px) - 36px) !important; }
@media (max-width: 1199px) { .ap-ask-frame { height: 78vh !important; } }

/* Sign-in / register: on desktop the left panel is compact and fixed to the screen, and only the form side scrolls */
@media (min-width: 992px) {
  .ap-auth { height: 100vh; min-height: 0; overflow: hidden; grid-template-columns: minmax(320px, 4fr) 8fr; }
  .ap-auth-side { padding: 1.75rem 2rem 1.5rem; justify-content: space-between; overflow: hidden; }
  .ap-auth-side .ap-brand-logo { height: 34px; width: auto; }
  .ap-auth-side h2 { font-size: 1.45rem; margin: 1.1rem 0 .6rem; }
  .ap-auth-side .lead { font-size: .88rem; margin-bottom: 0; }
  .ap-auth-stats { grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 1rem 0; }
  .ap-auth-stats div { padding: .5rem .6rem; border-radius: .6rem; }
  .ap-auth-stats strong { font-size: 1rem; } .ap-auth-stats span { font-size: .6rem; letter-spacing: .05em; }
  .ap-auth-perks li { padding: .2rem 0 .2rem 1.4rem; font-size: .8rem; }
  .ap-auth-main { overflow-y: auto; align-items: flex-start; padding: 2rem clamp(1.25rem, 4vw, 3.5rem); scrollbar-gutter: stable; }
  .ap-auth-box { margin: auto; }
}
