:root {
  --atlas-ink: #02394a;
  --atlas-teal: #01abaa;
  --atlas-action: #017b7a;
  --atlas-yellow: #fedc3d;
  --atlas-muted: #52666e;
  --atlas-border: #dbe5e6;
  --bs-body-font-family: "Montserrat", sans-serif;
  --bs-body-color: var(--atlas-ink);
  --bs-link-color: var(--atlas-action);
  --bs-link-hover-color: var(--atlas-ink);
}
body { background: #f5f7f7; color: var(--atlas-ink); font-family: "Montserrat", sans-serif; font-size: .875rem; }
h1,h2,h3,h4,h5,h6,.kpi-value { font-family: "Urbanist", sans-serif; font-weight: 700; }
.atlas-container { max-width: 1600px; padding-left: 2rem; padding-right: 2rem; }
.atlas-header { background: white; border-bottom: 1px solid var(--atlas-border); }
.atlas-header .atlas-container { gap: 1rem; flex-wrap: wrap; }
.atlas-brand { margin: 0; padding: 0; }
.atlas-logo { display: block; position: relative; width: 220px; height: 64px; overflow: hidden; }
.atlas-logo img { position: absolute; width: 250px; height: auto; max-width: none; left: -19px; top: -56px; }
.atlas-account { min-width: 0; max-width: 100%; font-size: .8rem; }
.atlas-account-name { overflow-wrap: anywhere; min-width: 0; }
.atlas-account form { flex-shrink: 0; }
.atlas-heading { padding: 1rem 0 .25rem; }
.atlas-heading h1 { font-size: clamp(2rem, 3vw, 2.8rem); letter-spacing: -.045em; margin-bottom: .75rem; }
.atlas-heading h1 span { color: var(--atlas-action); }
.atlas-eyebrow { text-transform: uppercase; font-weight: 600; font-size: .72rem; letter-spacing: .14em; color: var(--atlas-muted); }
.card { border: 1px solid var(--atlas-border); border-radius: .875rem; box-shadow: 0 4px 18px #02394a04; }
.card-body { padding: 1.4rem; }
.text-secondary,.form-text { color: var(--atlas-muted) !important; }
.form-label { font-weight: 600; font-size: .8rem; }
.kpi-card { border-top: 3px solid var(--atlas-teal); }
.kpi-label { font-family: "Montserrat", sans-serif; font-size: .78rem; color: var(--atlas-muted); font-weight: 600; min-height: 1.5em; }
.kpi-value { font-size: clamp(1.8rem, 2.2vw, 2.3rem); margin: .6rem 0 .75rem; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-value span { font-size: 1rem; color: var(--atlas-muted); }
.kpi-trend { font-size: .78rem; font-weight: 600; margin: 0 0 .35rem; color: var(--atlas-ink); }
.kpi-trend span { font-weight: 400; }
.kpi-previous,.kpi-period { font-size: .72rem; color: var(--atlas-muted); margin: 0 0 .25rem; font-variant-numeric: tabular-nums; }
.chart-container { position: relative; height: 310px; }
.filter-field { min-width: 0; }
/* Native controls only: never apply box styles to Choices' inline search input. */
.filter-field > input,.filter-field > select,.login-panel input:not([type=hidden]) {
  display: block; width: 100%; min-height: 46px; padding: .65rem .85rem;
  border: 1px solid #bacbce; border-radius: .5rem; background-color: white; color: var(--atlas-ink); font: inherit;
}
.filter-field > select[multiple]:not([hidden]) { min-height: 130px; }
.choices { margin-bottom: 0; font-size: .875rem; }
.choices__inner { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; min-height: 46px; padding: .4rem .6rem !important; border: 1px solid #bacbce; border-radius: .5rem; background: white; }
.choices__list--multiple { display: contents; }
.choices__list--multiple .choices__item { display: inline-flex; align-items: center; gap: .25rem; max-width: 100%; margin: 0; padding: .3rem .5rem; border-radius: .3rem; background: #e0f3f2; color: var(--atlas-ink); border: 1px solid #99cfcc; overflow-wrap: anywhere; }
.choices__list--multiple .choices__item .choices__button { flex-shrink: 0; opacity: 1; color: var(--atlas-ink); background-image: none; font-size: 1rem; text-indent: 0; border-left-color: #99cfcc; width: 1.25rem; margin: 0; padding: 0 0 0 .25rem; }
.choices__input { flex: 1 1 9rem; width: auto !important; min-width: 9rem; max-width: 100%; margin: 0; padding: .25rem 0; border: 0; border-radius: 0; background: transparent; font: inherit; line-height: 1.5; color: var(--atlas-ink); }
.choices__input::placeholder { color: var(--atlas-muted); opacity: 1; }
.is-focused .choices__inner,.is-open .choices__inner { border-color: var(--atlas-action); }
.choices__list--dropdown,.choices__list[aria-expanded] { border-color: #bacbce; z-index: 20; }
.choices__list--dropdown .choices__item--selectable.is-highlighted { background: #e0f3f2; }
:focus-visible { outline: 3px solid var(--atlas-action); outline-offset: 3px; }
.form-control:focus,.form-select:focus,.login-panel input:focus { border-color: var(--atlas-action); box-shadow: 0 0 0 3px #01abaa25; }
.btn { font-size: .85rem; font-weight: 600; border-radius: .5rem; padding: .6rem .95rem; }
.btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--atlas-action); --bs-btn-border-color: var(--atlas-action); --bs-btn-hover-bg: var(--atlas-ink); --bs-btn-hover-border-color: var(--atlas-ink); --bs-btn-active-bg: var(--atlas-ink); --bs-btn-active-border-color: var(--atlas-ink); --bs-btn-disabled-bg: var(--atlas-action); --bs-btn-disabled-border-color: var(--atlas-action); }
.btn-outline-secondary { --bs-btn-color: var(--atlas-ink); --bs-btn-border-color: #a5b9bd; --bs-btn-hover-color: var(--atlas-ink); --bs-btn-hover-bg: var(--atlas-yellow); --bs-btn-hover-border-color: var(--atlas-yellow); }
.worklog-comment { white-space: normal; overflow-wrap: anywhere; max-width: 650px; }
.login-panel { max-width: 440px; }
.skip-link { position: absolute; z-index: 100; padding: 1rem; background: white; }
details summary { cursor: pointer; color: var(--atlas-action); font-weight: 500; }
th { color: var(--atlas-muted) !important; font-size: .8rem; }
@media (max-width: 576px) {
  .atlas-container { padding-left: 1rem; padding-right: 1rem; }
  .atlas-header .atlas-container { justify-content: center; }
  .atlas-account { width: 100%; justify-content: space-between; }
  .atlas-logo { width: 190px; height: 55px; }
  .atlas-logo img { width: 215px; left: -16px; top: -48px; }
  .card-body { padding: 1.1rem; }
  .chart-container { height: 260px; }
  .choices__input { min-width: 7rem; flex-basis: 7rem; }
}

.atlas-navigation { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 1rem; border-bottom: 1px solid #d9e5e8; }
.atlas-navigation a { color: #02394a; text-decoration: none; font-weight: 600; }
.atlas-navigation a:hover, .atlas-navigation a:focus { color: #017b7a; text-decoration: underline; }
.nav-secondary { display: flex; gap: 1rem; margin-left: auto; font-size: .85rem; }
.insight-card { text-decoration: none; color: #02394a; border-left: 4px solid #01abaa; }
.insight-card:hover { border-color: #017b7a; }
@media(max-width: 767px) { .atlas-navigation { gap: .8rem; } .nav-secondary { margin-left: 0; flex-wrap: wrap; } }

/* Native help disclosure works with keyboard, touch and without JavaScript. */
.atlas-help { border-left: 3px solid var(--atlas-teal, #01abaa); padding: .5rem .75rem; background: #f6f9fa; font-size: .85rem; }
.atlas-help summary { cursor: pointer; font-weight: 600; }
.atlas-help summary:focus-visible { outline: 3px solid #02394a; outline-offset: 3px; }
.atlas-context { background: #f6f9fa; border-radius: .5rem; padding: .85rem; }
[hidden] { display: none !important; }


/* The actual editable form sticks; help and result context remain in document flow. */
.sticky-filter-controls { position: sticky; top: 0; z-index: 30; background: white; box-shadow: 0 3px 10px #02394a12; }
.compact-filters .card-body { padding: .6rem .75rem; }
.compact-filters .form-label { margin-bottom: .2rem; font-size: .7rem; }
.filter-editor > summary { font-size: .85rem; }
.filter-control-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem .65rem; }
.compact-filters .filter-field > input,.compact-filters .filter-field > select { min-height: 40px; padding: .35rem .5rem; font-size: .75rem; }
.compact-filters .filter-field > select[multiple]:not([hidden]) { height: 40px; min-height: 40px; }
.compact-filters .choices { font-size: .75rem; }
.compact-filters .choices__inner { flex-wrap: nowrap; min-height: 40px; height: 40px; padding: .25rem .4rem !important; }
.compact-filters .choices__list--multiple { display: flex; flex: 0 1 auto; max-width: 60%; gap: .2rem; overflow-x: auto; scrollbar-width: thin; }
.compact-filters .choices__list--multiple .choices__item { flex-shrink: 0; white-space: nowrap; padding: .2rem .3rem; font-size: .7rem; }
.compact-filters .choices__input { padding: .15rem 0; font-size: .75rem; min-width: 4rem; flex-basis: 4rem; }
.compact-filters .btn { min-height: 40px; padding: .35rem .65rem; font-size: .75rem; }
.filter-selection-count { font-weight: 400; font-size: .65rem; color: var(--atlas-muted); }
.filter-guidance { font-size: .75rem; }
.filter-dirty { color: #805000; font-size: .7rem; font-weight: 600; }
@media (max-width: 1199px) { .filter-control-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .filter-control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-control-panel { max-height: 28vh; overflow-y: auto; overscroll-behavior: contain; padding: .15rem .2rem .3rem; }
  .compact-filters .filter-field > select[multiple]:not([hidden]) { height: 72px; min-height: 72px; }
  .compact-filters .filter-field > input { min-width: 0; }
  .sticky-filter-controls .card-body { padding: .4rem .5rem; }
  .filter-actions { gap: .35rem !important; }
  .filter-dirty { flex-basis: 100%; font-size: .65rem; }
}

/* Actions occupy spare cells in the final toolbar row, not a separate row. */
@media (min-width: 768px) {
  #dashboard-filters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .4rem .65rem; }
  .filter-control-panel,.filter-control-grid { display: contents; }
  .filter-actions { grid-column: span 2; align-self: end; margin-top: 0 !important; }
  [data-filter-errors] { grid-column: 1 / -1; }
}
@media (min-width: 768px) and (max-width: 1199px) { #dashboard-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* Selected names remain removable when opening the searchable selector. */
.compact-filters .choices__list--multiple { display: none; }
.compact-filters .choices.is-open .choices__inner { flex-wrap: wrap; height: auto; }
.compact-filters .choices.is-open .choices__list--multiple { display: flex; flex-wrap: wrap; flex-basis: 100%; max-width: 100%; max-height: 72px; overflow-y: auto; overflow-x: hidden; }
.compact-filters .choices.is-open .choices__list--multiple .choices__item { max-width: 100%; white-space: normal; }
@media (max-width: 767px) {
  .filter-field > input,.filter-field > select { min-width: 0; max-width: 100%; }
  .filter-dirty { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Anchor visually-hidden table hints to the horizontal scroll container. */
.table-responsive { position: relative; }

.dedication-chart { height: 260px; max-width: 360px; margin: 12px auto 20px; }
.dedication-empty { min-height: 180px; display: grid; place-items: center; text-align: center; }
.dedication-legend li + li { border-top: 1px solid #d6e2e5; }
.dedication-legend a { display: flex; align-items: center; gap: 10px; padding: 12px 0; color: #003e52; text-decoration: none; }
.dedication-legend a:hover { text-decoration: underline; }
.dedication-legend strong { margin-left: auto; white-space: nowrap; font-size: .875rem; }
.dedication-swatch { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 12px; }
.dedication-external { background: #017b7a; }
.dedication-internal { background: #003e52; }
.dedication-unclassified { background: #b35b36; }
@media (max-width: 575px) { .dedication-legend a { flex-wrap: wrap; } .dedication-legend strong { flex-basis: 100%; margin-left: 22px; } .dedication-chart { height: 220px; } }
.visibility-switch { display: flex; align-items: center; gap: .4rem; position: relative; }
.visibility-help summary { cursor: pointer; font-size: .8rem; list-style: none; }
.visibility-help p { position: absolute; z-index: 1100; right: 0; top: 100%; width: min(350px, 85vw); background: white; border: 1px solid #c9dade; padding: 1rem; border-radius: .5rem; box-shadow: 0 3px 12px #002c3c20; }
@media (max-width: 767px) { .atlas-account { flex-wrap: wrap; gap: .5rem !important; } .visibility-switch { order: 3; width: 100%; } .visibility-help p { left: 0; right: auto; } }
/* Previous results remain readable but clearly pending until an atomic refresh. */
#atlas-results[aria-busy="true"] { opacity: .45; pointer-events: none; }
.atlas-filter-status { font-size: .85rem; margin-top: .5rem; }
.atlas-filter-status[data-loading="true"]::before { content: ""; display: inline-block; width: .8rem; height: .8rem; border: 2px solid #017b7a; border-right-color: transparent; border-radius: 50%; margin-right: .5rem; animation: atlas-refresh-spin .8s linear infinite; }
@keyframes atlas-refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .atlas-filter-status[data-loading="true"]::before { animation: none; } }
