/* Eclopidia Elements Lab — Periodic trends. Scoped to .trends-panel and to host cells carrying trend-* classes. */
.trends-panel { font: 14px/1.45 system-ui, sans-serif; color: #1b1f24; background: #fff; border: 1px solid #c9ced6; border-radius: 8px; padding: 12px 14px; width: 420px; max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
.trends-title { font-size: 1.1rem; margin: 0 0 8px; }
.trends-subtitle { font-size: .95rem; margin: 10px 0 4px; }
.trends-controls { display: grid; gap: 8px; }
.trends-control { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); align-items: center; gap: 6px; }
.trends-select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; font: inherit; padding: 4px 6px; min-height: 32px; border: 1px solid #6b7480; border-radius: 4px; background: #fff; color: inherit; }
.trends-select:focus-visible, .trends-panel :focus-visible { outline: 3px solid #1a5fb4; outline-offset: 2px; }
.trends-range, .trends-method { margin: 2px 0; }
.trends-method { color: #4a525c; font-size: .85rem; }
.trends-swatches { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; }
.trends-swatches li { display: flex; align-items: center; gap: 8px; }
.trends-swatch { display: inline-block; width: 18px; height: 14px; border: 1px solid #6b7480; border-radius: 2px; flex: none; background: var(--trend-color, transparent); }
.trends-dl { display: grid; grid-template-columns: minmax(0, 11em) minmax(0, 1fr); gap: 2px 10px; margin: 0; }
.trends-dl dt { font-weight: 600; } .trends-dl dd { margin: 0; }
.trends-live { margin: 10px 0 0; padding: 6px 8px; background: #f2f4f7; border-radius: 4px; font-size: .9rem; }
.trends-note { margin: 8px 0 0; font-size: .8rem; color: #4a525c; }

/* Bins and categories: colour is a visual ordering only. Text colours keep contrast. */
.trend-bin-0 { --trend-color: #fde725; --trend-ink: #1b1f24; }
.trend-bin-1 { --trend-color: #7ad151; --trend-ink: #1b1f24; }
.trend-bin-2 { --trend-color: #22a884; --trend-ink: #1b1f24; }
.trend-bin-3 { --trend-color: #2a788e; --trend-ink: #ffffff; }
.trend-bin-4 { --trend-color: #414487; --trend-ink: #ffffff; }
.trend-cat-0 { --trend-color: #a6cee3; } .trend-cat-1 { --trend-color: #fdbf6f; } .trend-cat-2 { --trend-color: #b2df8a; }
.trend-cat-3 { --trend-color: #cab2d6; } .trend-cat-4 { --trend-color: #fb9a99; } .trend-cat-5 { --trend-color: #ffff99; }
.trend-cat-6 { --trend-color: #d9d9d9; } .trend-cat-7 { --trend-color: #bc80bd; }
[class*="trend-cat-"] { --trend-ink: #1b1f24; }
/* Missing / malformed: UNSHADED (no fill), dashed outline so it is never read as zero. */
.trend-missing { --trend-color: transparent; --trend-ink: inherit; }
.trends-swatch.trend-missing { border-style: dashed; }
/* Host cells (applied by applyTrendToCells): */
.trend-shaded { background: var(--trend-color) !important; color: var(--trend-ink, inherit) !important; }
:not(.trends-swatch).trend-missing { outline: 1px dashed #6b7480; outline-offset: -3px; }
.ecl-elements-lab-host{height:100%;min-height:520px;min-width:0;container-type:inline-size;background:#faf8ef;color:#173f34}
.ecl-elements-lab-host>div:first-child{height:100%;min-height:0}
.ecl-elements-lab-host .ecl-elab{overflow-y:auto;overflow-x:hidden}
.ecl-elements-lab-host>div[role]{padding:1rem}
.ecl-elements-lab-host button,.ecl-elements-lab-host input,.ecl-elements-lab-host select,.ecl-elements-lab-host a{min-height:48px}
.ecl-elements-lab-host a{display:inline-flex;align-items:center}
/* Outrank the native block even when its stylesheet loads after the host. */
.ecl-elements-lab-host :focus-visible,.ecl-elements-lab-host .ecl-elab :is(button,input,select,a,[tabindex]):focus-visible{outline:3px solid #276b50;outline-offset:3px;box-shadow:0 0 0 3px #fffdf5}
.ecl-elements-lab-table{padding:1rem;min-width:0;color:#173f34;background:#fffdf5}
.ecl-elements-lab-table h2{font:600 1.3rem Georgia,serif}
.ecl-elements-lab-table p{line-height:1.5}
.ecl-elements-lab-table [role=group]{display:flex;gap:.5rem;flex-wrap:wrap}
.ecl-elements-lab-table [role=group]>button{padding:.5rem;border:1px solid #527466;border-radius:.6rem;background:#f7f6ec;color:#173f34}
.ecl-elements-lab-table [role=group]>button[aria-pressed=true]{background:#173f34;color:#fffdf5}
.ecl-elements-lab-table [data-element-selection-context=encyclopedia]{background:#fffdf5!important;color:#173f34!important;padding:0;overflow:visible}
.ecl-elements-lab-table [data-element-selection-context=encyclopedia] section{background:#fffdf5!important;border-color:#809486}
.ecl-elements-lab-table [data-element-selection-context=encyclopedia] input{width:100%;background:#fffdf5!important;color:#173f34!important;border:1px solid #527466}
.ecl-elements-lab-table .ecl-periodic-scroll{overflow:auto;max-width:100%}
.ecl-elements-lab-table [data-testid=periodic-shape]{min-width:930px}
.ecl-elements-lab-table [data-element-state]{min-width:48px;min-height:48px;background:#f1f3e6!important;color:#173f34!important;border:1px solid #809486;opacity:1}
.ecl-elements-lab-table [data-element-state] strong,.ecl-elements-lab-table [data-element-state] span{color:#173f34!important}
.ecl-elements-lab-table [data-element-state=selected]{outline:2px solid #276b50;outline-offset:-2px;background:#dcead5!important;transform:none}

.ecl-elements-lab-table__toggle{width:100%;min-height:48px;padding:10px;border:1px solid #527466;border-radius:9px;background:#173f34;color:#fffdf5;text-align:left;font-weight:600}

/* Mobile station strip: keep the experiment visible instead of a three-row toolbar.
   The native toolbar and every keyboard control remain present and scrollable. */
@container (max-width:760px){
 .ecl-elements-lab-host .ecl-elab__bar{flex-wrap:nowrap;overflow-x:auto;min-height:72px;flex-shrink:0;scrollbar-width:thin;gap:8px}
 .ecl-elements-lab-host .ecl-elab__bar button{flex:0 0 auto;white-space:nowrap;padding:0 12px;font-size:13px}
 .ecl-elements-lab-host .ecl-elab__bar .ecl-elab__title{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}

.ecl-elements-trends{height:auto;min-height:0;padding:16px;overflow:auto}
.ecl-elements-trends>header{margin-bottom:16px}
.ecl-elements-trends h2{font:600 1.6rem Georgia,serif;color:#173f34}
.ecl-elements-trends header p{max-width:70ch;line-height:1.6}
.ecl-elements-trends__grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,360px);gap:16px}
.ecl-elements-trends__grid>div,.ecl-elements-trends__grid>aside{min-width:0}
.ecl-elements-trends__grid>aside>button{width:100%;padding:10px;border:1px solid #527466;border-radius:9px;background:#173f34;color:#fffdf5;font-weight:600}
.ecl-elements-trends__grid>aside>button:disabled{opacity:.6}
@media(max-width:760px){
 .ecl-elements-trends__grid{display:flex;flex-direction:column}
 .ecl-elements-trends__grid>aside{order:-1}
}

.ecl-elements-trends__sources{padding:12px;border:1px solid #809486;border-radius:10px;background:#f1f3e6;font-size:.9rem;line-height:1.5;overflow-wrap:anywhere}
.ecl-elements-trends__sources a{color:#173f34;text-decoration:underline}
.ecl-elements-viewport{display:flex;flex-direction:column;flex:1;height:100%;overflow:auto;min-width:0;min-height:0;background:#faf8ef;color:#173f34}
.ecl-elements-viewport__switch{display:flex;gap:8px;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid #b8c6b3}
.ecl-elements-viewport__switch button,.ecl-elements-viewport__notice button{min-height:48px;padding:8px 14px;border:1px solid #527466;border-radius:10px;background:#fffdf5;color:#173f34;font-weight:600}
.ecl-elements-viewport__switch button[aria-pressed=true]{background:#173f34;color:#fffdf5}
.ecl-elements-viewport :focus-visible{outline:3px solid #276b50;outline-offset:3px}
.ecl-elements-viewport__lab{height:clamp(620px,calc(100dvh - 220px),1000px);min-height:620px;min-width:0}
.ecl-elements-viewport__earth{min-height:620px;min-width:0}
.ecl-elements-viewport__notice{padding:16px;line-height:1.6}
.ecl-elements-viewport__records{padding:16px;background:#faf8ef;color:#173f34}
@media(max-width:760px){.ecl-elements-viewport__lab{height:calc(100dvh - 190px);min-height:620px}.ecl-elements-viewport__switch>button{flex:1 1 140px}}

.ecl-elements-viewport__help{display:inline-flex;align-items:center;min-height:48px;padding:8px 14px;color:#173f34;text-decoration:underline}
.ecl-station-frame{position:static;display:flex;flex-direction:column;box-sizing:border-box;width:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;background:#faf8ef;color:#173f34;overflow:visible}
.ecl-station-frame__bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px;border-bottom:1px solid #b8c6b3;background:#f7f6ed;flex:none}
.ecl-station-frame__bar h2{margin:0 auto 0 0;font:600 18px/1.3 Georgia,serif}
.ecl-station-frame__bar button{min-width:48px;min-height:48px;padding:8px 12px;background:#fffdf5;color:#173f34;border:1px solid #527466;border-radius:9px}
.ecl-station-frame__bar span,.ecl-station-frame__bar p{font-size:12px;margin:0}
.ecl-station-frame__content{min-width:0;min-height:0;flex:1}
.ecl-station-frame[data-station-expanded=true]{position:fixed;inset:0;width:100dvw;height:100dvh;max-width:100dvw;max-height:100dvh;margin:0;overflow:hidden}
.ecl-station-frame::backdrop{background:rgba(5,20,15,.8)}
.ecl-station-frame[data-station-expanded=true] .ecl-elements-viewport__lab{height:100%;min-height:0}
.ecl-station-frame[data-station-expanded=true] .ecl-elements-lab-host,.ecl-station-frame[data-station-expanded=true] .ecl-elab{min-height:0}
@media(max-width:600px){.ecl-station-frame__bar h2{flex-basis:100%}.ecl-station-frame__bar span{flex-basis:100%}}

/* In an expanded phone station, keep the complete stage inside the remaining
   viewport. Scroll its records below it without moving the station toolbar. */
@media(max-width:760px){
 .ecl-station-frame[data-station-expanded=true] .ecl-elab{overflow:hidden}
 .ecl-station-frame[data-station-expanded=true] .ecl-elab__main{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto}
 .ecl-station-frame[data-station-expanded=true] .ecl-elab__stage{height:min(480px,100%);flex:none}
 .ecl-station-frame[data-station-expanded=true] .ecl-elab__panel{flex:none}
}
