/* Andrews provisional data portal. Served from www/ by Shiny. */
body { font-size: 15px; }
.portal-banner { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 8px 16px;
                 background: #FFF8EC; border-bottom: 1px solid #EED9B3; color: #1F2421; font-size: .95rem; }
.portal-banner strong { color: #8A4B00; }
.portal-banner .muted { color: #5C635E; }
.portal-banner .warn { color: #B42318; font-weight: 600; }
.portal-banner.error { background: #FEF1F0; border-color: #F0A9A3; color: #B42318; }

.gallery-section { margin: 4px 0 22px; }
.gallery-section h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 10px; display: flex; gap: 10px;
                      align-items: baseline; }
.gallery-section h3 .count { color: #5C635E; font-weight: 400; font-size: .95rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.ds-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
           background: #fff; border: 1px solid #DADDD8; border-radius: 8px; padding: 10px 12px;
           transition: box-shadow .12s, border-color .12s; }
.ds-card:hover, .ds-card:focus-visible { border-color: #2A78D6; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.ds-card:focus-visible { outline: 2px solid #2A78D6; outline-offset: 2px; }
.ds-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ds-card-id { font-family: Consolas, monospace; font-size: .85rem; color: #3E4A44; }
.ds-card-id .muted, .muted { color: #5C635E; }
.ds-card-title { color: #3E4A44; font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2;
                 -webkit-box-orient: vertical; overflow: hidden; }
.ds-card-foot { display: flex; flex-wrap: wrap; gap: 2px 12px; color: #5C635E; font-size: .82rem;
                border-top: 1px solid #ECEEEA; padding-top: 6px; margin-top: 2px; }
.pill { font-size: .8rem; padding: 1px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.pill.ok { color: #1E6B3A; border-color: #9CCBAA; background: #EEF8F1; }
.pill.stale { color: #8A4B00; border-color: #E6BE85; background: #FFF6E8; }
.pill.error { color: #B42318; border-color: #F0A9A3; background: #FEF1F0; }
.summary { color: #3E4A44; font-size: .9rem; line-height: 1.5; }

.data-panel { border: 1px solid #DADDD8; border-radius: 6px; padding: 6px 10px; }
.data-panel > summary { font-weight: 600; }
.explore-meta { font-size: .9rem; color: #3E4A44; }
.var-detail { margin-top: 4px; }
.var-detail > summary { font-family: Consolas, monospace; font-size: .85rem; }
.var-detail pre, .explore-meta pre { font-size: .78rem; white-space: pre-wrap; word-break: break-all;
                                     background: #F6F7F5; padding: 6px 8px; border-radius: 4px; margin: 2px 0 0; }
.flag-key { list-style: none; padding: 0; margin: 4px 0 0; color: #3E4A44; }
.flag-code { display: inline-block; min-width: 1.6em; font-family: Consolas, monospace; font-weight: 700; }
.code-block { font-size: .82rem; background: #F6F7F5; border: 1px solid #E3E5E1; border-radius: 4px;
              padding: 10px 12px; white-space: pre; overflow-x: auto; max-height: 40vh; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 14px; font-size: .9rem; }
.facts .fact { display: contents; }
.facts .k { color: #5C635E; }
.facts code { white-space: normal; word-break: break-all; }
.table-scroll { max-height: 62vh; overflow: auto; }
.portal-table { font-size: .85rem; }
.portal-table th { position: sticky; top: 0; background: #fff; }
.portal-table code { white-space: pre-wrap; word-break: break-all; font-size: .78rem; }
.portal-table tr.flag-step td { background: #FFF6E8; }
.doc-section { border-bottom: 1px solid #ECEEEA; padding: 6px 0; }
.doc-section > summary { font-weight: 600; }
.doc-section .count { color: #5C635E; font-weight: 400; margin-left: 8px; }
.doc-table { font-size: .85rem; }
.doc-table td:first-child { white-space: nowrap; color: #5C635E; width: 1%; }

.param-chips { margin: -6px 0 10px; }
.param-chips > div { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.param-chip { font-size: .78rem; padding: 1px 8px; border-radius: 999px; border: 1px solid #C9CEC9; background: #fff;
              color: #1F2421; font-family: Consolas, monospace; cursor: pointer; }
.param-chip .n { color: #5C635E; margin-left: 4px; font-family: inherit; }
.param-chip:hover, .param-chip:focus-visible { border-color: #2A78D6; }
.param-chip.active { background: #EEF4FB; border-color: #2A78D6; }
.chart-note { padding: 6px 2px 0; }
.ov-toolbar { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-bottom: 4px; }
.ov-toolbar .form-group, .ov-toolbar .shiny-input-container { margin-bottom: 0; }
.var-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.var-card { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; gap: 2px;
            background: #fff; border: 1px solid #DADDD8; border-radius: 8px; padding: 8px 10px; min-width: 0; }
.var-card:hover, .var-card:focus-visible { border-color: #2A78D6; box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.var-card:focus-visible { outline: 2px solid #2A78D6; outline-offset: 2px; }
.var-card-head { display: flex; justify-content: space-between; gap: 8px; }
.var-card-head .name { font-family: Consolas, monospace; font-size: .82rem; font-weight: 600; overflow: hidden;
                       text-overflow: ellipsis; white-space: nowrap; }
.var-card-head .units { color: #5C635E; font-size: .8rem; white-space: nowrap; }
.var-card-desc { color: #3E4A44; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.var-card .spark { width: 100%; height: 56px; display: block; margin: 2px 0; }
.var-card-foot { display: flex; flex-wrap: wrap; gap: 0 10px; color: #5C635E; font-size: .78rem; }
.var-card-foot .flagged { color: #8A4B00; }
.flag-tick { display: inline-block; width: 10px; height: 4px; background: #A15C00; margin: 0 4px 2px 6px; }

.bslib-sidebar-layout .selectize-control.single .selectize-input { padding-right: 2rem; }
.bslib-sidebar-layout .selectize-control.single .selectize-input > .item {
  display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- Compare: Chosen tray, Find variables (chips, checklist) ---- */
.cmp-chosen-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.cmp-tray { display: flex; flex-wrap: wrap; gap: 4px; }
.cmp-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; font-size: .8rem; padding: 2px 4px 2px 8px;
            border-radius: 999px; background: #EEF4FB; border: 1px solid #C9DCF1; color: #1F2421; }
.cmp-chip-x { border: 0; background: none; padding: 0 4px; line-height: 1; font-size: 1rem; color: #5C635E; cursor: pointer; }
.cmp-chip-x:hover, .cmp-chip-x:focus-visible { color: #B42318; }
.cmp-find legend { float: none; width: auto; }
.cmp-find .shiny-input-container { margin-bottom: 6px; }
.chip-label { font-size: .8rem; font-weight: 600; margin: 2px 0; }
.chip-label .text-muted { font-weight: 400; margin-left: 4px; }
/* Checkbox groups shown as toggle chips: the box is hidden, the label is the button. */
#cmp_station .shiny-options-group, #cmp_param .shiny-options-group, #cmp_measure .shiny-options-group { display: flex; flex-wrap: wrap; gap: 4px;
  max-height: 132px; overflow-y: auto; }
#cmp_station .checkbox-inline, #cmp_param .checkbox-inline, #cmp_measure .checkbox-inline,
#cmp_station .form-check, #cmp_param .form-check, #cmp_measure .form-check {
  margin: 0; padding: 0; }
#cmp_station input[type=checkbox], #cmp_param input[type=checkbox], #cmp_measure input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
#cmp_station .shiny-options-group label, #cmp_param .shiny-options-group label,
#cmp_measure .shiny-options-group label { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; font-size: .8rem;
  border: 1px solid #C9CEC9; border-radius: 999px; background: #fff; cursor: pointer; user-select: none; margin: 0; }
#cmp_station .shiny-options-group label:hover, #cmp_param .shiny-options-group label:hover,
#cmp_measure .shiny-options-group label:hover { border-color: #2A78D6; }
#cmp_station label:has(input:checked), #cmp_param label:has(input:checked), #cmp_measure label:has(input:checked) { background: #2A78D6; border-color: #2A78D6; color: #fff; }
#cmp_station label:has(input:focus-visible), #cmp_param label:has(input:focus-visible),
#cmp_measure label:has(input:focus-visible) { outline: 2px solid #2A78D6; outline-offset: 2px; }
.chip-n { font-size: .7rem; opacity: .75; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #9AA19C; }
.chip-dot.met { background: #1BAF7A; }
.chip-dot.gauging { background: #2A78D6; }
.chip-dot.refstand { background: #8A6D00; }
label:has(input:checked) .chip-dot { box-shadow: 0 0 0 1.5px #fff; }
.cmp-list-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin: 2px 0 4px; }
.cmp-list-head .text-muted { margin-right: auto; }
.cmp-list { max-height: 300px; overflow-y: auto; border: 1px solid #E3E5E1; border-radius: 4px; background: #fff; }
.cmp-row { display: flex; gap: 6px; align-items: center; padding: 3px 8px; margin: 0; font-size: .8rem; cursor: pointer;
           border-bottom: 1px solid #F0F1EE; white-space: nowrap; }
.cmp-row:hover { background: #F4F7FB; }
.cmp-row.on { background: #EEF4FB; }
.cmp-row input:disabled + .st, .cmp-row:has(input:disabled) { color: #9AA19C; cursor: not-allowed; }
.cmp-row .st { font-weight: 600; min-width: 4.2em; }
.cmp-row .col { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .75rem; }
.cmp-row .desc { color: #5C635E; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#cmp_station > .control-label, #cmp_param > .control-label, #cmp_measure > .control-label { display: none; }

.portal-update { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 8px 16px;
                 background: #EEF4FB; border-bottom: 1px solid #C9DCF1; color: #1F2421; }
.portal-update strong { color: #1C5CAB; }
.cmp-row.cmp-all { position: sticky; top: 0; z-index: 1; background: #F6F7F5; font-weight: 600; border-bottom: 1px solid #DADDD8; }
.cmp-row.cmp-all:hover { background: #EEF1EC; }

/* "Live version" link in share copies (rshared/R/live_link.R). */
.live-link { font-weight: 600; white-space: nowrap; }
