:root {
  color-scheme: dark;
  --bg:#0a1418; --panel:#112026; --panel-soft:#15262c; --well:#0e1b20; --line:#293a40;
  --text:#edf4f1; --sub:#b5c4c5; --muted:#9aafb1; --mint:#8ae4c9; --mintDeep:#153c35;
  --coral:#ff9d83; --warn:#ffca8b; --warning-bg:#302b23; --shadow:rgba(0,0,0,.24);
  --font:Inter,"Aptos",-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --mono:"SFMono-Regular",Consolas,"Liberation Mono",monospace;
  --max:1536px; --edge:clamp(20px,4.9vw,78px);
  font-family:var(--font); background:var(--bg); color:var(--text); font-size:100%;
}
:root[data-theme="light"] {
  color-scheme:light; --bg:#f0f6f4; --panel:#fff; --panel-soft:#e4efed; --well:#f5f9f8;
  --line:#bdcfcc; --text:#172e32; --sub:#405b5d; --muted:#526a6d;
  --mint:#176957; --mintDeep:#d4ede3; --coral:#a44129; --warn:#83531e; --warning-bg:#fff0d9; --shadow:rgba(20,55,52,.1);
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-padding-top:94px}
body{margin:0;min-width:280px;line-height:1.5;background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
body:has(dialog[open]),body.immersive-open{overflow:hidden}
button,input,select,textarea{font:inherit}
button,a,select,input,summary{touch-action:manipulation}
button{cursor:pointer;color:inherit;background:none;border:0;font-weight:600}
a{color:inherit}
button:disabled{cursor:default}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible,textarea:focus-visible{outline:2px solid var(--mint);outline-offset:3px}
[hidden]{display:none!important}
h1,h2,h3,h4,p{margin:0}
.icon{width:1.1rem;height:1.1rem;flex:none;display:inline-block;vertical-align:middle}
.skip{position:fixed;left:10px;top:-100px;z-index:100;padding:12px 18px;background:var(--mint);color:var(--bg);border-radius:8px}
.skip:focus{top:10px}
.site-header{position:sticky;top:0;z-index:30;background:var(--bg);border-bottom:1px solid var(--line)}
.header-inner,.page,.footer-inner{width:min(100%,var(--max));margin:0 auto;padding-inline:var(--edge)}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:25px;min-height:76px}
.brand{display:inline-flex;align-items:center;gap:9px;text-decoration:none;flex-shrink:0}
.brand img{width:44px;height:44px}
.wordmark{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.wordmark strong{font-size:1.53rem;font-weight:710;line-height:1;letter-spacing:-1.05px}
.wordmark>span{color:var(--muted);font:600 .69rem/1.1 var(--mono);text-transform:uppercase;letter-spacing:1.1px}
.main-nav{display:flex;align-self:stretch;gap:clamp(18px,2.8vw,44px);margin-left:2vw}
.main-nav a{display:inline-flex;align-items:center;gap:8px;border-bottom:2px solid transparent;padding-top:2px;color:var(--sub);text-decoration:none;font-size:.89rem;font-weight:600;white-space:nowrap}
.main-nav a:hover,.main-nav a.current{color:var(--mint)}
.main-nav a.current{border-bottom-color:var(--mint)}
.main-nav .icon{width:1.05rem;height:1.05rem}
.header-actions{display:flex;align-items:center;gap:14px}
.icon-button,.secondary-button,.primary-button,.tank-button,.text-button,.camera-button,.reset-reef,.feed-button{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.icon-button{width:39px;height:39px;border-radius:8px;color:var(--sub);border:1px solid var(--line);background:var(--well)}
.icon-button:hover,.secondary-button:hover{border-color:var(--mint);color:var(--mint)}
.theme-button{background:transparent;border-color:transparent}
.tank-button{background:var(--mintDeep);color:var(--mint);border:1px solid color-mix(in srgb,var(--mint) 42%,var(--line));padding:8px 12px 8px 13px;border-radius:8px;font-size:.86rem;min-height:38px;gap:9px;white-space:nowrap}
.tank-button:hover{background:color-mix(in srgb,var(--mint) 15%,var(--mintDeep))}
.count{min-width:20px;height:20px;padding:1px 5px;border-radius:5px;display:inline-grid;place-items:center;background:color-mix(in srgb,var(--mint) 18%,var(--mintDeep));font:650 .76rem/1 var(--mono)}
.reef-section{padding-top:24px;scroll-margin-top:0}
.reef-panel{--current-period:4.3s;--sway-angle:3deg;overflow:hidden;border:1px solid var(--line);border-radius:17px;background:var(--panel);position:relative}
.reef-panel[data-flow="Low"]{--current-period:7s;--sway-angle:1.8deg}
.reef-panel[data-flow="High"]{--current-period:2.6s;--sway-angle:5.8deg}
.stage{height:clamp(345px,28.8vw,430px);isolation:isolate;position:relative;overflow:hidden;background:#0b3448;color:#f5fffc}
.reef-world,.reef-photo,.spectral-wash,.stage-scrim,.occupants,.water-motion,.hotspots{position:absolute;inset:0;width:100%;height:100%}
.reef-world,.stage-scrim,.water-motion,.hotspots,.occupants{pointer-events:none}
.reef-world{z-index:0;overflow:hidden;background:#0b3448}
.reef-photo{object-fit:cover;object-position:50% 48%;transition:filter .8s ease;filter:saturate(1.12) brightness(.88);display:block}
.spectral-wash{transition:background-color .75s,opacity .75s;background:transparent;mix-blend-mode:color}
.reef-panel[data-spectrum="actinic"] .reef-photo{filter:saturate(1.75) hue-rotate(27deg) brightness(.73) contrast(1.23)}
.reef-panel[data-spectrum="actinic"] .spectral-wash{background:#3544c5;opacity:.48}
.reef-panel[data-spectrum="sunset"] .reef-photo{filter:sepia(.48) saturate(1.45) hue-rotate(335deg) brightness(.86)}
.reef-panel[data-spectrum="sunset"] .spectral-wash{background:#ff926c;opacity:.26}
.reef-panel[data-spectrum="moonlight"] .reef-photo{filter:grayscale(.44) saturate(.78) hue-rotate(12deg) brightness(.37) contrast(1.2)}
.reef-panel[data-spectrum="moonlight"] .spectral-wash{background:#507cb8;opacity:.43}
.occupants{z-index:1}
.water-motion{z-index:2}
.stage-scrim{z-index:3;background:radial-gradient(ellipse at 10% 0%,rgba(0,13,24,.77),rgba(0,15,24,.26) 34%,transparent 59%),linear-gradient(0deg,rgba(0,15,23,.64),transparent 19%),linear-gradient(180deg,rgba(0,14,23,.22),transparent 33%)}
.stage-heading{position:absolute;z-index:4;left:clamp(20px,2.6vw,42px);top:clamp(20px,2vw,33px);pointer-events:none}
.live-label,.eyebrow,.console-label,.cat-badge,.micro-label{font-family:var(--mono);font-weight:650;text-transform:uppercase}
.live-label{display:inline-flex;align-items:center;gap:8px;padding:5px 9px;background:rgba(8,33,37,.73);border:1px solid rgba(170,230,214,.31);color:#a3efd6;border-radius:5px;letter-spacing:1.5px;font-size:.69rem;line-height:1.1}
.signal{width:7px;height:7px;border-radius:50%;background:#8cf0cb;box-shadow:0 0 9px #84e7c69c}
.motion-off .signal{background:#b7c7c4;box-shadow:none}
.stage-heading h1{font-size:clamp(2.65rem,4.1vw,4.05rem);letter-spacing:-.06em;line-height:1.04;font-weight:650;margin:10px 0 6px;color:#fafdf9;text-shadow:0 2px 15px #02192445}
.stage-heading h1 em{font-weight:400;font-family:Georgia,"Times New Roman",serif;font-style:italic;letter-spacing:-.055em}
.stage-heading p{font-size:clamp(.88rem,1.13vw,1.05rem);color:#dfedeb;line-height:1.45;text-shadow:0 1px 4px #0006}
.viewport-tools{display:flex;gap:7px;position:absolute;right:19px;top:18px;z-index:6}
.camera-button,.reset-reef,.zone-readout{color:#edf7f6;border:1px solid #c2e4e53d;background:rgba(4,24,32,.7);backdrop-filter:blur(8px)}
.camera-button{width:34px;height:34px;padding:0;border-radius:7px}
.camera-button .icon{width:1rem;height:1rem}
.camera-button:hover,.reset-reef:hover{background:#143c44;border-color:#9ce5d8}
.hotspots{z-index:5}
.zone-pin{position:absolute;display:inline-flex;align-items:center;gap:7px;padding:5px 4px;transform:translate(-14px,-50%);pointer-events:auto;min-height:42px;color:#fff;text-align:left;isolation:isolate}
.pin-index{position:relative;display:grid;place-items:center;height:28px;width:28px;flex:none;font:650 .85rem/1 var(--mono);border:1.5px solid #bcf2de;border-radius:50%;color:#edfff7;background:#194b46eb;box-shadow:0 0 0 4px #9ff0d337,0 2px 8px #03151ba6}
.pin-text{display:flex;align-items:flex-start;flex-direction:column;gap:1px;background:rgba(5,23,31,.8);backdrop-filter:blur(7px);border:1px solid #dbf4ef39;border-radius:5px;padding:5px 9px;white-space:nowrap;box-shadow:0 2px 8px #00151c30}
.pin-text strong{font-size:.79rem;line-height:1.15;font-weight:640}
.pin-text small{font-family:var(--mono);font-size:.65rem;letter-spacing:.01em;color:#c0d8d6;line-height:1.25}
.zone-pin:hover .pin-index,.zone-pin[aria-pressed="true"] .pin-index{background:#92e6cb;color:#0b2b27;border-color:#c7ffed;box-shadow:0 0 0 5px #9ff0d35c}
.zone-pin[aria-pressed="true"] .pin-text{border-color:#92e6cb;color:#a9f4dd}
.stage-foot{position:absolute;z-index:6;left:17px;right:17px;bottom:13px;display:flex;align-items:center;justify-content:space-between;gap:8px;pointer-events:none}
.zone-readout,.reset-reef{display:inline-flex;align-items:center;gap:6px;border-radius:6px;padding:4px 9px;font-size:.76rem;line-height:1.45}
.zone-readout{background:#061b24a1;border-color:transparent;color:#d7e9e9}
.zone-readout .icon,.reset-reef .icon{width:.89rem;height:.89rem}
.reset-reef{pointer-events:auto}
.console{display:flex;align-items:center;gap:clamp(16px,2.3vw,36px);padding:14px clamp(16px,2vw,30px) 16px;background:var(--panel);border-top:1px solid var(--line)}
.console-label{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:.67rem;letter-spacing:1.5px;line-height:1;margin-bottom:8px}
.console-label .icon{width:.88rem;height:.88rem}
.spectrum-control{flex:1;min-width:0}
.spectrum-options{display:flex;gap:7px;align-items:center}
.spectrum-choice,.flow-options button{border-radius:6px;min-height:34px;border:1px solid var(--line);color:var(--sub);font-size:.82rem;white-space:nowrap;font-weight:560;line-height:1.2}
.spectrum-choice{display:inline-flex;align-items:center;justify-content:center;gap:7px;background:var(--well);padding:7px clamp(8px,.9vw,15px)}
.spectrum-choice .icon{width:1rem;height:1rem}
.spectrum-choice[data-spectrum="daylight"] .icon{color:#efbf75}
.spectrum-choice[data-spectrum="actinic"] .icon{color:#aba4f7}
.spectrum-choice[data-spectrum="sunset"] .icon{color:#efa188}
.spectrum-choice[data-spectrum="moonlight"] .icon{color:#a0c1d9}
.spectrum-choice small{font-family:var(--mono);font-size:.74rem;opacity:.84}
.spectrum-choice.chosen,.spectrum-choice:hover{background:var(--mintDeep);color:var(--mint);border-color:color-mix(in srgb,var(--mint) 65%,var(--line))}
.spectrum-choice.chosen .icon{color:var(--mint)}
.flow-control{border-left:1px solid var(--line);padding-left:clamp(16px,2.3vw,36px)}
.flow-options{display:inline-flex;padding:3px;background:var(--well);border:1px solid var(--line);border-radius:7px}
.flow-options button{border:0;background:transparent;min-height:26px;padding:3px 12px;font-size:.78rem}
.flow-options button.chosen{background:var(--panel-soft);color:var(--mint);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--mint) 28%,var(--line))}
.flow-options button:hover{color:var(--mint)}
.feed-control{align-self:stretch;display:flex;align-items:center;border-left:1px solid var(--line);padding-left:clamp(16px,2vw,30px)}
.feed-button,.primary-button{border-radius:7px;min-height:39px;padding:8px 15px;font-size:.86rem;font-weight:680}
.feed-button{background:#f49c82;color:#211d19;box-shadow:inset 0 1px 0 #ffd5c773}
.feed-button:hover{background:#ffaf96}
.feed-button:active{transform:translateY(1px)}
.feed-button .icon{width:1.22rem;height:1.22rem}
.feed-button:disabled{background:#d28f77}
.reef-panel.immersive,.reef-panel:fullscreen{background:var(--bg);display:flex;flex-direction:column;border:0;border-radius:0;width:100%;height:100%;max-height:none}
.reef-panel.immersive{position:fixed;inset:0;z-index:45;height:100dvh}
.reef-panel.immersive .stage,.reef-panel:fullscreen .stage{flex:1;height:auto}
.reef-panel.immersive .console,.reef-panel:fullscreen .console{flex:none}
.directory-section{padding-top:34px}
.directory-heading,.chem-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px}
.eyebrow{display:flex;align-items:center;gap:8px;color:var(--mint);letter-spacing:1.8px;font-size:.68rem;line-height:1.3}
.eyebrow>span{display:block;width:19px;height:1px;background:var(--mint)}
.section-titles h2,.drawer-head h2{margin-top:5px;font-size:clamp(1.9rem,2.65vw,2.75rem);line-height:1.12;letter-spacing:-.05em;font-weight:650}
.directory-tools{align-items:center;display:flex;gap:9px}
.search-box,.secondary-button,.filter-panel select,.param-field input,.view-switch button,.profile-tabs button{border:1px solid var(--line);border-radius:7px;background:var(--well);color:var(--text)}
.search-box{display:flex;gap:8px;align-items:center;padding:0 12px;color:var(--muted);height:39px;min-width:0}
.search-box:focus-within{border-color:var(--mint);outline:1px solid var(--mint)}
.search-box input{min-width:0;width:clamp(135px,13.7vw,230px);height:100%;border:0;outline:none;background:transparent;color:var(--text);font-size:.86rem}
.search-box input:focus-visible{outline:none}
input::placeholder{color:var(--muted);opacity:1}
.secondary-button{padding:8px 12px;min-height:39px;font-size:.86rem;font-weight:570;color:var(--sub)}
.filters-button[aria-expanded="true"]{color:var(--mint);border-color:var(--mint)}
.filters-button>span{border-radius:4px;background:var(--mintDeep);color:var(--mint);padding:1px 5px;font:600 .72rem var(--mono)}
.filter-panel{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:15px 18px;margin-top:18px}
.filter-panel select:disabled{opacity:.55;cursor:not-allowed}
.filter-panel label,.param-field label,.drawer-bottom label{display:block;font-size:.82rem;font-weight:600;color:var(--sub)}
.filter-panel select{display:block;width:100%;margin-top:5px;appearance:none;min-height:38px;padding:6px 32px 6px 10px;font-size:.88rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23869fa4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 10px center}
.categories{display:flex;gap:8px;margin:20px 0 17px;overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--line) transparent;padding:2px 1px 3px}
.category{flex:none;display:inline-flex;align-items:center;gap:7px;padding:7px 12px;min-height:33px;border:1px solid var(--line);border-radius:100px;color:var(--sub);background:transparent;font-size:.82rem;line-height:1.15;font-weight:570}
.category:hover{border-color:var(--mint);color:var(--mint)}
.category.chosen{background:var(--mint);color:var(--bg);border-color:var(--mint)}
.category .icon{width:.86rem;height:.86rem}
.category small{font:600 .68rem/1 var(--mono);background:var(--mintDeep);color:var(--mint);border-radius:8px;padding:3px 5px}
.category.chosen small{background:color-mix(in srgb,var(--bg) 16%,var(--mint));color:inherit}
.filter-context{margin:-4px 0 14px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:.81rem;color:var(--sub)}
.filter-context button,.text-button,.chem-reference a,.source-links a,.small-action{color:var(--mint);font-weight:600}
.filter-context button,.text-button,.small-action{font-size:.82rem;padding:4px 0}
.species-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:clamp(12px,1.35vw,22px)}
.species-card{min-width:0;display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel);box-shadow:0 5px 18px #00000010;transition:border-color .2s,transform .2s}
.species-card:hover{border-color:color-mix(in srgb,var(--mint) 43%,var(--line));transform:translateY(-2px)}
.card-visual{position:relative;aspect-ratio:1.77;background:#102c33;isolation:isolate;border-bottom:1px solid var(--line);overflow:hidden}
.card-image-button{display:block;height:100%;width:100%;padding:0}
.card-image-button img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .45s ease}
.card-image-button::after{content:"";position:absolute;inset:0;background:linear-gradient(180deg,#00131d60,transparent 35%,transparent 83%,#07181c40);pointer-events:none}
.species-card:hover .card-image-button img{transform:scale(1.035)}
.cat-badge{position:absolute;left:10px;top:10px;max-width:calc(100% - 58px);color:#edf5f2;background:#081a1edb;border:1px solid #dfefe930;font-size:.61rem;letter-spacing:.85px;line-height:1.2;padding:5px 7px;border-radius:4px;font-weight:650;pointer-events:none}
.card-bookmark{position:absolute;right:9px;top:8px;background:#071a20bf;color:#eefbf8;border:1px solid #d4efeb4a;border-radius:50%;width:30px;height:30px;display:grid;place-items:center}
.card-bookmark .icon{width:.93rem;height:.93rem}
.card-bookmark:hover,.card-bookmark[aria-pressed="true"]{color:#a2efd5;background:#11463d}
.card-body{padding:15px 16px 10px;flex:1}
.field-card-summary{margin-top:9px;color:var(--sub);line-height:1.45;font-size:.875rem}
.card-name{display:block;text-align:left;line-height:1.2;font-size:clamp(1.01rem,1.35vw,1.26rem);font-weight:660;letter-spacing:-.035em;padding:0}
.card-name:hover,.small-action:hover{color:var(--mint);text-decoration:underline;text-underline-offset:3px}
.latin{color:var(--muted);font-size:.79rem;font-style:italic;margin-top:3px;line-height:1.4}
.card-traits{display:flex;align-items:center;flex-wrap:wrap;gap:5px 10px;margin-top:10px;font-size:.75rem;color:var(--sub)}
.difficulty,.chem-badge{display:inline-flex;align-items:center;gap:5px;line-height:1.2}
.diff-dot{height:6px;width:6px;border-radius:50%;background:var(--mint)}
.difficulty.intermediate .diff-dot{background:#e8bd78}
.difficulty.expert .diff-dot{background:#f09485}
.chem-badge .icon{width:.8rem;height:.8rem}
.chem-badge.good{color:var(--mint)}
.chem-badge.review,.chem-badge.incomplete{color:var(--warn)}
.card-stats{display:flex;gap:7px 12px;flex-wrap:wrap;margin-top:10px;font-size:.75rem;line-height:1.35;color:var(--sub)}
.card-stats span{display:inline-flex;align-items:center;gap:3px}
.card-stats .icon{color:var(--muted);width:.8rem;height:.8rem}
.card-actions{padding:9px 15px;display:flex;align-items:center;justify-content:space-between;gap:5px;border-top:1px solid var(--line)}
.place-action{display:inline-flex;align-items:center;gap:5px;background:none;padding:4px 0;color:var(--mint);font-size:.8rem}
.place-action .icon{width:.9rem;height:.9rem}
.card-actions .small-action{color:var(--muted);font-weight:530}
.results-footer{display:flex;align-items:center;justify-content:space-between;margin:17px 1px 0;gap:12px;font-size:.82rem;color:var(--muted)}
.results-footer strong{color:var(--text)}
.empty-state,.tank-empty{text-align:center;padding:36px 16px}
.empty-state{background:var(--panel);border:1px solid var(--line);border-radius:14px}
.empty-state p,.tank-empty p,.drawer-head p{color:var(--muted);font-size:.9rem;margin:5px 0 14px}
.empty-icon{display:inline-grid;place-items:center;width:45px;height:45px;border-radius:50%;background:var(--mintDeep);color:var(--mint);margin-bottom:12px}
.empty-icon .icon{width:1.35rem;height:1.35rem}
.chem-section{margin:40px 0 50px;padding:clamp(18px,2.3vw,34px);border:1px solid var(--line);background:var(--panel);border-radius:15px}
.chem-heading{align-items:center}
.chem-heading h2{font-size:clamp(1.6rem,2.1vw,2.16rem)}
.chem-intro{color:var(--sub);font-size:.95rem;margin:12px 0 20px}
.param-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:11px}
.param-field{background:var(--well);border:1px solid var(--line);border-radius:9px;padding:11px}
.param-field label{white-space:nowrap}
.field-input{display:flex;align-items:center;border-bottom:1px solid var(--line);margin-top:5px}
.param-field input{color:var(--text);font:650 1.23rem/1.5 var(--font);width:100%;border:0;border-radius:2px;min-width:0;padding:0}
.param-field input[aria-invalid="true"]{outline:1px solid var(--warn)}
.field-unit,.field-target{font-family:var(--mono);font-size:.72rem;color:var(--muted)}
.field-target{display:block;margin-top:7px;line-height:1.4}
.chem-status,.compat-status,.tank-alert{display:flex;align-items:flex-start;gap:10px;border:1px solid color-mix(in srgb,var(--mint) 27%,var(--line));background:var(--mintDeep);color:var(--mint);border-radius:9px;padding:12px 14px}
.chem-status{margin-top:16px}
.chem-status .icon,.compat-status .icon,.tank-alert .icon{margin-top:2px}
.chem-status strong,.compat-status strong{font-size:.9rem}
.chem-status p,.compat-status p{color:var(--sub);font-size:.84rem;margin-top:3px}
.chem-status.review,.compat-status.review,.tank-alert{color:var(--warn);background:var(--warning-bg);border-color:color-mix(in srgb,var(--warn) 28%,var(--line))}
.chem-reference{margin-top:15px;color:var(--muted);font-size:.83rem}
.chem-reference summary{cursor:pointer;color:var(--sub);font-weight:580;width:fit-content}
.chem-reference p,.chem-reference a{display:block;margin-top:8px}
.site-footer{border-top:1px solid var(--line);color:var(--muted);font-size:.77rem}
.footer-inner{display:flex;align-items:center;justify-content:space-between;gap:22px;padding-block:21px}
.footer-inner>div,.footer-inner p{display:flex;align-items:center;gap:7px}
.footer-inner strong{font-size:.84rem;color:var(--sub)}
.footer-inner .icon{width:.9rem;height:.9rem}
dialog{border:1px solid var(--line);color:var(--text);background:var(--panel);padding:0;box-shadow:0 20px 80px #0007}
dialog::backdrop{background:rgba(2,10,14,.76);backdrop-filter:blur(5px)}
.profile-dialog{width:min(940px,calc(100vw - 32px));border-radius:18px;max-height:min(88dvh,900px);overflow:auto;overscroll-behavior:contain}
.profile-head,.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);padding:20px 24px}
.profile-head h2{font-size:clamp(1.55rem,2.4vw,2.2rem);line-height:1.12;letter-spacing:-.045em;margin:8px 0 3px}
.profile-head .latin{font-size:.92rem}
.tags{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.tag{padding:3px 7px;border:1px solid var(--line);border-radius:5px;font-size:.72rem;line-height:1.35;color:var(--sub);background:var(--well);font-weight:600}
.tag:first-child{color:var(--mint);background:var(--mintDeep)}
.tag.caution{color:var(--warn)}
.profile-body{display:grid;grid-template-columns:.9fr 1.1fr;gap:22px;padding:22px 24px}
.profile-left,.profile-right{min-width:0}
.field-intro{color:var(--text);line-height:1.5;margin:0 0 16px;font-size:1rem}
.field-figure{min-width:0;margin:0}
.field-figure img{display:block;width:100%;height:auto;border:1px solid var(--line);border-radius:12px}
.field-figure figcaption{margin-top:9px;color:var(--muted);font-size:.82rem;line-height:1.5;overflow-wrap:anywhere}
.field-figure details{margin-top:5px}
.field-figure summary{cursor:pointer;color:var(--sub)}
.field-figure details[open] summary{margin-bottom:4px}
.field-figure a{color:var(--mint);text-underline-offset:2px}
.specimen-view{position:relative;aspect-ratio:1.15;overflow:hidden;border:1px solid var(--line);border-radius:12px;isolation:isolate;background:radial-gradient(ellipse at 45% 25%,#184551,#071820 78%)}
.specimen-view>img{width:100%;height:100%;object-fit:cover;transition:filter .55s}
.specimen-view.actinic>img{filter:hue-rotate(24deg) saturate(1.9) brightness(.78) contrast(1.13)}
.specimen-view.actinic:after{content:"";position:absolute;inset:0;pointer-events:none;background:#2c38cd40;mix-blend-mode:color;z-index:1}
.specimen-tools{position:absolute;top:10px;left:10px;right:10px;display:flex;align-items:center;justify-content:space-between;gap:6px;z-index:3}
.specimen-tools button,.specimen-view figcaption{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:5px 8px;background:#071922d9;border:1px solid #d4ece054;border-radius:5px;font-size:.71rem;color:white}
.specimen-tools button[aria-pressed="true"]{color:#c1f2e4;border-color:#9ee9d0}
.specimen-tools .icon{width:.85rem;height:.85rem}
.specimen-view{margin:0}
.specimen-view figcaption{position:absolute;bottom:9px;left:10px;z-index:2;padding:3px 7px;background:#0a171dba;font-size:.65rem;color:#e3efeb}
.clearance-model{position:absolute;inset:15% 7% 9%;display:grid;place-items:center}
.clearance-model::before{content:"";position:absolute;width:75%;height:77%;border:1px dashed #ffb592a6;border-radius:50%;background:#a2867d0b}
.clearance-model .reef-specimen-art{width:72%;height:72%;position:relative;filter:drop-shadow(0 3px 9px #01080c);--current-period:4s;--sway-angle:3deg}
.clearance-model>span{position:absolute;bottom:0;font:500 .74rem var(--mono);color:#f5b59e}
.specimen-view.actinic .reef-specimen-art{filter:saturate(2) brightness(1.25) drop-shadow(0 0 7px var(--specimen-glow,#73dece))}
.gauges,.water-targets,.care-note{margin-top:14px;border:1px solid var(--line);background:var(--well);border-radius:10px;padding:13px}
.gauge+.gauge{margin-top:12px}
.gauge-label,.placement-line{display:flex;align-items:center;justify-content:space-between;gap:7px;font-size:.78rem;color:var(--muted)}
.gauge-label strong,.placement-line strong{font-size:.77rem;color:var(--sub);text-align:right}
.gauge-track{height:4px;background:var(--line);border-radius:4px;overflow:hidden;margin-top:5px}
.gauge-track span{display:block;height:100%;background:var(--mint);border-radius:4px}
.gauge:first-child .gauge-track span{background:#e5b878}
.placement-line{margin-top:13px;padding-top:10px;border-top:1px solid var(--line)}
.profile-body h3{font-size:.96rem;letter-spacing:-.015em;font-weight:680;margin-bottom:5px}
.profile-body section>p,.care-note p{font-size:.87rem;line-height:1.55;color:var(--sub)}
.profile-right>section{margin:0 0 15px}
.profile-right>section:last-child{margin-bottom:0}
.water-targets{margin:0}
.chem-target-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 7px;margin:12px 0 0}
.chem-target-grid dt{font-size:.71rem;color:var(--muted)}
.chem-target-grid dd{font-size:.77rem;font-weight:620;color:var(--text);margin:1px 0 0}
.compat-status{margin-top:10px;padding:9px;font-size:.78rem}
.compat-status strong{font-size:.79rem}
.compat-status p{font-size:.76rem}
.care-note{background:var(--warning-bg);border-color:color-mix(in srgb,var(--warn) 26%,var(--line))}
.care-note h3{display:flex;align-items:center;gap:7px;color:var(--warn)}
.source-links{display:flex;flex-direction:column;gap:5px;font-size:.78rem;margin-top:8px}
.profile-actions{position:sticky;bottom:0;z-index:4;border-top:1px solid var(--line);background:var(--panel);padding:12px 24px;display:flex;align-items:center;gap:9px}
.primary-button{background:var(--mint);color:var(--bg);border:1px solid transparent}
.primary-button:hover{filter:brightness(1.08)}
.profile-actions .text-button{margin-left:auto}
.tank-dialog{position:fixed;inset:0 0 0 auto;margin:0;max-width:min(430px,100%);width:430px;max-height:100%;height:100dvh;border-width:0 0 0 1px}
.tank-dialog[open]{display:flex;flex-direction:column}
.drawer-head{padding:23px 21px 16px}
.drawer-head h2{font-size:1.85rem}
.drawer-head p{margin:5px 0 0}
.drawer-body{overflow:auto;flex:1;padding:16px 20px;overscroll-behavior:contain}
.tank-alert{font-size:.82rem;line-height:1.5;margin:0 0 9px}
.tank-item{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.tank-item img{width:56px;height:53px;object-fit:cover;border-radius:6px}
.tank-item>div{flex:1;min-width:0}
.tank-item strong{display:block;font-size:.92rem}
.tank-item p{font-size:.75rem;color:var(--muted)}
.tank-item .chem-badge{font-size:.72rem}
.tank-item button{border-color:transparent;background:none}
.drawer-bottom{padding:14px 20px;border-top:1px solid var(--line);background:var(--well)}
.drawer-actions{display:flex;align-items:center;justify-content:space-between;gap:10px}
.drawer-actions .text-button{color:var(--coral)}
.drawer-actions button:disabled{opacity:.45}
.drawer-bottom textarea{width:100%;min-height:100px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:5px;margin:6px 0;font-size:.82rem}
.toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:80;max-width:min(90vw,550px);width:max-content;padding:10px 17px;border-radius:9px;color:#d8f4e8;background:#132e2c;border:1px solid #76c7b0;box-shadow:0 6px 26px #0006;font-size:.85rem;text-align:center}
.no-script{padding:20px;text-align:center}
.zone-pin{left:var(--x);top:var(--y)}
.occupant{position:absolute;left:var(--x);top:var(--y);width:var(--size,6.7%);transform:translate(-50%,-71%);display:grid;place-items:center;padding:0;border:0;pointer-events:auto;cursor:pointer;line-height:0;min-width:28px}
.occupant .figure{display:block;width:100%;transform-origin:center 82%;transition:scale .7s ease}
.occupant .reef-specimen-art{display:block;width:100%;height:auto;overflow:visible;filter:drop-shadow(0 2px 1.5px #071c22a3);transition:filter .8s}
.occupant[data-featured="true"]{opacity:.92}
.occupant.swimmer .figure{animation:swim-route calc(var(--current-period) * 3.2) ease-in-out infinite}
.reef-specimen-art .fin,.reef-specimen-art .whisker,.reef-specimen-art .tentacle{transform-box:fill-box;transform-origin:bottom center;animation:specimen-sway var(--current-period,4.5s) ease-in-out infinite}
.reef-specimen-art .fin{transform-origin:left center;animation-duration:calc(var(--current-period,4s)*.42)}
.reef-specimen-art .polyp,.reef-specimen-art .xenia-pulse{transform-box:fill-box;transform-origin:center;animation:polyp-opening calc(var(--current-period,4s)*1.25) ease-in-out infinite}
.reef-specimen-art .xenia-pulse{animation-duration:2.5s}
.reef-panel[data-spectrum="actinic"] .occupant .reef-specimen-art{filter:hue-rotate(9deg) saturate(1.65) brightness(1.06) drop-shadow(0 0 3.5px var(--glow))}
.reef-panel[data-spectrum="sunset"] .occupant .reef-specimen-art{filter:sepia(.34) saturate(1.35) drop-shadow(0 2px 1px #1d1a20a6)}
.reef-panel[data-spectrum="moonlight"] .occupant .reef-specimen-art{filter:saturate(.85) brightness(.72) drop-shadow(0 0 2px var(--glow))}
.reef-panel.feeding .occupant:not(.swimmer) .figure{scale:1.13}
.reef-panel.feeding .occupant.swimmer .figure{animation-name:fish-feed;animation-duration:4.1s}
.occupant.custom:after{content:"";position:absolute;width:14px;height:5px;bottom:0;border-radius:50%;box-shadow:0 0 0 1px #b9ffe6;opacity:.8}
.occupant:focus-visible{outline-color:#cbffe8;outline-offset:1px;border-radius:50%}
.reef-panel.motion-off *,.profile-dialog.still .reef-specimen-art *{animation-play-state:paused!important}
@keyframes specimen-sway{0%,100%{transform:rotate(calc(var(--sway-angle,3deg)*-1))}52%{transform:rotate(var(--sway-angle,3deg))}}
@keyframes polyp-opening{0%,100%{transform:scale(.985)}55%{transform:scale(1.033)}}
@keyframes swim-route{0%,100%{transform:translate(0,0) rotate(-2deg)}28%{transform:translate(-13%,6%) rotate(3deg)}70%{transform:translate(12%,-7%) rotate(-3deg)}}
@keyframes fish-feed{0%,100%{transform:translate(0,0)}45%{transform:translate(45%,-19%) rotate(-8deg)}70%{transform:translate(38%,-13%) rotate(4deg)}}
@media(min-width:1550px){.stage{height:450px}}
@media(max-width:1120px){
 .header-inner{gap:15px}.main-nav{gap:21px;margin:0}
 .console{gap:17px;padding-inline:17px}.flow-control,.feed-control{padding-left:15px}
 .spectrum-options{gap:5px}.spectrum-choice{padding-inline:8px}.flow-options button{padding-inline:10px}
 .param-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:920px){
 :root{--edge:24px}
 .header-inner{min-height:68px}.main-nav{gap:15px}.main-nav a{gap:5px;font-size:.81rem}.header-actions{gap:5px}
 .stage{height:350px}.console{display:grid;grid-template-columns:1fr auto;gap:12px 14px}
 .spectrum-control{grid-column:1 / -1;display:flex;align-items:center;gap:12px}
 .spectrum-control .console-label{margin:0;flex:none}
 .flow-control{border:0;padding:0;display:flex;align-items:center;gap:12px}.flow-control .console-label{margin:0}
 .feed-control{align-self:center;border:0;padding:0}.feed-button{min-height:34px;padding:6px 13px}
 .species-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .card-body{padding-inline:13px}.card-actions{padding-inline:13px}
}
@media(max-width:720px){
 :root{--edge:17px}html{scroll-padding-top:109px}
 .header-inner{display:grid;grid-template-columns:1fr auto;gap:0 8px;min-height:0;align-items:center}
 .brand{margin:9px 0 6px;gap:5px;width:fit-content}.brand img{width:34px;height:37px}
 .wordmark strong{font-size:1.3rem}.wordmark>span{font-size:.61rem;letter-spacing:.6px}
 .header-actions{grid-row:1;grid-column:2}.theme-button{width:32px;height:32px}
 .tank-button{padding:6px 8px;min-height:34px;font-size:.77rem;gap:6px}
 .main-nav{grid-row:2;grid-column:1/-1;justify-content:space-between;gap:1px}.main-nav a{min-height:36px;font-size:.8rem;gap:6px;padding-inline:4px}
 .main-nav .icon{width:.92rem;height:.92rem}
 .reef-section{padding-top:15px}.reef-panel{border-radius:13px}
 .stage-heading{left:17px;top:19px}.stage-heading h1{font-size:2.65rem}
 .viewport-tools{right:11px;top:12px;gap:5px}.camera-button{height:30px;width:30px}
 .stage-foot{left:9px;right:9px;bottom:9px}.stage-heading p{font-size:.83rem}
 .zone-pin{gap:5px}.pin-index{width:24px;height:24px;font-size:.77rem;box-shadow:0 0 0 3px #9ff0d337}
 .pin-text{padding:4px 6px}.pin-text strong{font-size:.72rem}.pin-text small{font-size:.61rem}
 .console{padding:12px;gap:10px 7px}.spectrum-control{display:block}.spectrum-control .console-label{margin-bottom:7px}
 .spectrum-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
 .spectrum-choice{padding:6px 5px;font-size:.77rem;gap:4px;min-height:33px}
 .spectrum-choice .icon{width:.91rem;height:.91rem}.spectrum-choice small{font-size:.67rem}
 .console-label{font-size:.63rem;letter-spacing:1.1px}.console-label .icon{width:.78rem;height:.78rem}
 .directory-section{padding-top:26px}.directory-heading{flex-wrap:wrap;gap:14px}.directory-tools{flex:1 0 100%}
 .search-box{flex:1}.search-box input{width:100%}
 .section-titles h2{font-size:1.9rem}.categories{margin:14px 0 12px}
 .species-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .filter-panel{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:12px;margin-top:10px}
 .chem-heading{flex-wrap:wrap;gap:12px}.chem-section{margin:28px 0 34px}
 .profile-body{grid-template-columns:1fr;gap:15px;padding:15px 17px}.specimen-view{aspect-ratio:1.65}
 .profile-head,.profile-actions{padding:15px 17px}.profile-actions{padding-block:11px}
 .profile-left{display:grid;grid-template-columns:1.15fr .85fr;gap:10px;align-items:center}.profile-left .specimen-view{aspect-ratio:1}
 .gauges{margin:0;padding:9px}.gauge-label,.placement-line{display:block}.gauge-label strong,.placement-line strong{display:block;text-align:left}
 .chem-target-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 .footer-inner{flex-wrap:wrap;gap:8px}
}
@media(max-width:540px){
 :root{--edge:13px}
 .stage{height:clamp(345px,95vw,440px)}
 .stage-scrim{background:linear-gradient(180deg,#00161dbd,transparent 44%,transparent 82%,#03171e94)}
 .stage-heading h1{font-size:clamp(2.12rem,8.7vw,2.8rem);margin:9px 0 5px}
 .stage-heading p{max-width:245px;font-size:.8rem}
 .live-label{font-size:.59rem;letter-spacing:1.15px}
 .zone-pin,.occupant{left:var(--mx,var(--x));top:var(--my,var(--y))}
 .zone-pin{transform:translate(-12px,-50%)}
 .zone-pin[data-index="2"],.zone-pin[data-index="5"]{flex-direction:row-reverse;transform:translate(calc(-100% + 14px),-50%)}
 .zone-pin[data-index="2"] .pin-text,.zone-pin[data-index="5"] .pin-text{align-items:flex-end}
 .occupant{width:var(--mobile-size,13%);transform:translate(-50%,-65%)}
 .spectrum-choice{flex-direction:column;gap:3px;min-height:42px;font-size:.69rem;padding:4px 1px}
 .spectrum-choice small{font-size:.59rem}
 .spectrum-options{gap:4px}.flow-control{gap:5px}.flow-options button{padding-inline:8px;font-size:.71rem;min-height:24px}
 .console{padding:10px}.feed-button{font-size:.76rem;min-height:32px;padding-inline:10px}
 .flow-control .console-label{font-size:.57rem;letter-spacing:.7px}.flow-control .console-label .icon{display:none}
 .category{font-size:.76rem;padding:7px 10px}.directory-section{padding-top:23px}
 .species-grid{gap:10px}.card-visual{aspect-ratio:1.37}.card-name{font-size:.99rem}.card-body{padding:10px}
 .cat-badge{font-size:.53rem;letter-spacing:.5px;top:7px;left:6px;max-width:calc(100% - 41px);padding:4px}
 .card-bookmark{width:26px;height:26px;top:6px;right:6px}
 .latin,.card-traits,.card-stats{font-size:.71rem}.card-stats{gap:5px;margin-top:7px}
 .card-traits{gap:6px;margin-top:7px}
 .card-actions{padding:7px 10px}.place-action{font-size:.75rem}.card-actions .small-action{display:none}
 .param-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .results-footer{font-size:.76rem}.results-footer .secondary-button{font-size:.77rem;gap:4px}
 .profile-dialog{width:calc(100% - 14px);max-height:94dvh;border-radius:13px}
 .profile-left{display:block}.profile-left .specimen-view{aspect-ratio:1.55}.gauges{margin-top:9px}
 .gauge-label,.placement-line{display:flex}.placement-line{font-size:.72rem}
 .profile-actions{flex-wrap:wrap;gap:6px}.profile-actions .primary-button,.profile-actions .secondary-button{min-height:34px;padding:6px 8px;font-size:.73rem}
 .profile-actions .text-button{display:none}.chem-target-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .footer-inner p{align-items:flex-start;font-size:.71rem}
}
@media(max-width:340px){.wordmark>span{font-size:.53rem}.brand img{width:29px}.theme-button{display:none}.species-grid{grid-template-columns:1fr}.card-visual{aspect-ratio:1.8}.stage-heading p{max-width:225px}.main-nav a{font-size:.72rem}}

.plan-section,.resource-section{margin:3rem 0;padding:clamp(1rem,3vw,2.25rem);background:var(--panel);border:1px solid var(--line);border-radius:15px}
.plan-section h2,.resource-section h2{margin:.35rem 0;font-size:clamp(1.6rem,4vw,2.4rem)}
.plan-section p,.resource-section p{color:var(--sub);max-width:76ch}
.plan-section a,.resource-section a{color:var(--mint);text-underline-offset:.2em}
.plan-inputs,.habitat-pair,.resource-groups{display:grid;gap:1rem}
.plan-inputs{grid-template-columns:repeat(3,minmax(0,1fr))}
.plan-section label{display:grid;gap:.3rem;font-weight:600}
.plan-section select,.plan-section input{width:100%;min-width:0;min-height:44px;padding:.55rem .7rem;border:1px solid var(--line);border-radius:7px;background:var(--well);color:var(--text)}
.habitat-pair,.resource-groups{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:1rem}
.habitat-card,.resource-group,.local-shop{padding:1rem;background:var(--well);border:1px solid var(--line);border-radius:10px}
.habitat-card{display:grid;grid-template-columns:auto 1fr;gap:.4rem .9rem;align-items:center}
.habitat-card img{width:76px;height:64px;border-radius:6px;object-fit:cover}
.habitat-card h3,.resource-group h3{margin:0}.habitat-card i{color:var(--sub)}
.habitat-card dl,.habitat-card p,.habitat-card button{grid-column:1/-1;margin:0}.habitat-card dl>div{display:grid;grid-template-columns:6.6rem 1fr;gap:.4rem;border-bottom:1px solid var(--line);padding:.36rem 0}.habitat-card dd{margin:0}.habitat-card dt{color:var(--muted)}
.habitat-card p{color:var(--mint);padding:.5rem 0}.pair-finding{border-left:3px solid var(--mint);padding-left:1rem;margin:1rem 0}.pair-finding h3,.local-shop h3{margin-bottom:0}
.zone-candidates{display:flex;flex-wrap:wrap;gap:.5rem}.plan-section>.chem-reference{margin:1rem 0}.plan-section .chem-reference p a{display:inline}
.local-shop{border-left:4px solid var(--mint)}.resource-group summary{cursor:pointer;font-weight:650}.resource-groups{align-items:start}.resource-group ul{list-style:none;padding:0;margin:.5rem 0}.resource-group li{padding:.55rem 0;border-top:1px solid var(--line)}.resource-group li span{display:block;color:var(--sub)}
@media(max-width:720px){.plan-inputs,.habitat-pair,.resource-groups{grid-template-columns:1fr}.main-nav{overflow-x:auto}}
@media(max-height:510px) and (orientation:landscape){.site-header{position:relative}html{scroll-padding-top:10px}.reef-panel.immersive .stage-heading{top:10px}.reef-panel.immersive .stage-heading h1{font-size:1.9rem}.reef-panel.immersive .stage-heading p{display:none}.reef-panel.immersive .console{padding:6px 12px;gap:5px}.reef-panel.immersive .console-label{margin-bottom:3px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{transition-duration:.01ms!important}.species-card:hover,.species-card:hover img{transform:none}}

.zone-readout{pointer-events:auto;text-decoration:none}
.zone-readout:hover{color:#fff;background:#123d43;border-color:#a2dfce}
.reef-dialog[open]{inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;background:var(--bg)}
.reef-dialog .reef-panel.immersive{position:relative;inset:auto}
.reef-dialog .viewport-tools{top:max(12px,env(safe-area-inset-top))}
.reef-dialog .console{padding-bottom:max(12px,env(safe-area-inset-bottom))}
.occupant .figure,.occupant .fin,.occupant .polyp,.occupant .tentacle{animation-delay:var(--phase,0s)}
.field-result{display:block;margin-top:4px;color:var(--mint);font-size:.78rem;font-weight:600}
.param-field:not([data-status="in"]) .field-result,.reading-result:not(.in){color:var(--warn)}
.chem-target-grid dd.reading-result{font-size:.75rem;font-weight:500;line-height:1.4}
.chem-target-grid dd.reading-result.in{color:var(--mint)}
.profile-body p.target-legend{color:var(--muted);font-size:.81rem}
.specimen-tools button{min-height:34px}
.tank-item-name{display:block;padding:0;text-align:left;color:var(--text);font-size:.94rem;line-height:1.35}
.tank-item-name:hover{text-decoration:underline;text-underline-offset:3px}
.tank-alert p{margin:3px 0 0;color:var(--sub)}
.drawer-head .icon-button,.profile-head .icon-button{flex:none}
.card-image-button:focus-visible{outline-offset:-4px}
.card-name:focus-visible,.place-action:focus-visible{border-radius:2px}
.field-input input{font-variant-numeric:tabular-nums}
.chem-target-grid{row-gap:13px}
.clearance-model>span{bottom:2%;max-width:96%;text-align:center;padding:2px 5px;border-radius:3px;background:#0c2025db}
.clearance-model::before{background:#ffb68b0e;box-shadow:0 0 26px #ffb68218 inset}
.profile-actions button[aria-pressed="true"]{border-color:var(--mint);color:var(--mint)}
@media(min-width:721px){
 .pin-text small{font-size:.73rem}
 .cat-badge{font-size:.67rem}
 .card-traits,.card-stats,.latin{font-size:.81rem}
 .profile-body section>p,.care-note p{font-size:.94rem}
}
@media(max-width:540px){
 .profile-head h2{overflow-wrap:anywhere}
 .zone-pin{min-height:44px}
 .tank-alert,.profile-body section>p,.care-note p{font-size:.9rem}
 .cat-badge{font-size:.63rem}
 .latin,.card-traits,.card-stats,.place-action{font-size:.78rem}
 .category{font-size:.82rem}
 .flow-control .console-label,.spectrum-choice small{font-size:.68rem}
 .spectrum-choice{font-size:.74rem}
 .field-input input,.search-box input{font-size:1rem}
 .card-bookmark{width:32px;height:32px}
 .profile-actions .primary-button,.profile-actions .secondary-button{min-height:38px;font-size:.8rem}
}
@media(max-width:540px){
 .header-inner{grid-template-columns:minmax(0,1fr) auto}
 .stage{height:clamp(400px,102vw,480px)}
 .stage-heading{top:15px;right:12px}
 .stage-heading h1{font-size:clamp(1.65rem,8.35vw,2.8rem)}
 .stage-heading p{max-width:none}
 .spectrum-choice{white-space:normal;text-align:center}
 .feed-button,.flow-control .console-label{white-space:nowrap}
 .spectrum-choice small{white-space:nowrap}
}
@media(max-width:420px){
 .spectrum-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .spectrum-choice{flex-direction:row;min-height:37px;font-size:.8rem;gap:6px}
 .spectrum-choice small{font-size:.7rem}
 .spectrum-choice .icon{width:.94rem;height:.94rem}
}
@media(max-width:360px){
 .header-inner{column-gap:4px}
 .brand{gap:3px}
 .brand img{width:28px;height:30px}
 .wordmark strong{font-size:1.14rem}
 .wordmark>span{font-size:.53rem;letter-spacing:.1px}
 .header-actions .theme-button{display:inline-flex;width:29px;height:32px}
 .tank-button{padding-inline:6px;gap:4px}
 .tank-button>.icon{display:none}
 .main-nav .icon{display:none}
 .main-nav a{font-size:.78rem}
 .wordmark>span{white-space:nowrap}
 .flow-control{display:grid;justify-content:start;gap:4px}
 .spectrum-choice{font-size:.74rem;gap:4px}
 .feed-button{min-height:36px}
 .stage-heading h1{letter-spacing:-.055em}
}

.atlas-browser{margin:1.3rem 0}
.atlas-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:.6rem;margin-bottom:.7rem}
.atlas-heading h3{font-size:1.15rem}
.atlas-heading label{display:flex;gap:.6rem;align-items:center;color:var(--sub);font-size:.9rem}
.atlas-heading select{max-width:100%;padding:.45rem;border:1px solid var(--line);border-radius:6px;background:var(--well);color:var(--text)}
.atlas-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.65rem}
.atlas-tile{position:relative;isolation:isolate;min-width:0;aspect-ratio:2.35;overflow:hidden;border-radius:10px;border:1px solid var(--line);color:white;background:#10262a;text-align:left}
.atlas-tile img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2}
.atlas-tile::after{content:"";position:absolute;inset:0;background:linear-gradient(transparent 30%,#061315eb);z-index:-1}
.atlas-tile span{position:absolute;bottom:.6rem;left:.7rem;font-weight:700;font-size:clamp(.9rem,1.5vw,1.2rem)}
.atlas-tile[aria-pressed=true]{outline:3px solid var(--mint);outline-offset:-3px}
.species-link{margin-right:auto;color:var(--mint);font-size:.9rem}
@media(max-width:680px){.atlas-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}.atlas-heading label{flex-wrap:wrap}}

.field-compare{margin:0 clamp(1rem,3vw,1.5rem) 1.25rem;border:1px solid var(--line);border-radius:10px;padding:.8rem 1rem;background:var(--well)}
.field-compare summary{cursor:pointer;color:var(--mint);font-weight:650}
.field-compare label{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:1rem 0;font-size:.9rem;color:var(--sub)}
.field-compare select{max-width:100%;padding:.4rem;background:var(--panel);border:1px solid var(--line);color:var(--text);border-radius:6px}
.compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.compare-grid img{width:100%;height:auto;aspect-ratio:1.62;object-fit:cover;border-radius:7px}
.compare-grid h4{line-height:1.25;margin:.5rem 0 .15rem}
.compare-grid p{font-size:.875rem;color:var(--sub);margin:0 0 .5rem}

/* N-SOC family bar and 404 page (Dec 2, 2026). The bar keeps the house colours in both themes:
   #3DDC97 (Oddly Tidal Connections) on #0B0F1A is about 10.8:1. */
.family-bar{background:#0B0F1A;border-bottom:1px solid #232937;font-size:.8rem}
.family-inner{width:min(100%,var(--max));margin:0 auto;padding-inline:var(--edge);display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}
.family-bar a{display:inline-flex;align-items:center;gap:7px;min-height:44px;color:#3DDC97;font-weight:650;text-decoration:none}
.family-bar a:hover{text-decoration:underline}
.family-bar a:focus-visible{outline-color:#3DDC97}
.family-inner>span{color:#C9CDD4}
.footer-inner a{color:var(--mint);display:inline-flex;align-items:center;min-height:44px}
.lost{min-height:60vh;display:grid;place-content:center;justify-items:start;gap:16px;padding-block:48px}
.lost h1{font-size:clamp(1.8rem,5vw,2.8rem);letter-spacing:-.03em;line-height:1.1}
.lost p{color:var(--sub);max-width:46ch}
.lost-links{display:flex;flex-wrap:wrap;gap:12px;list-style:none;margin:0;padding:0}
.lost-links a{display:inline-flex;align-items:center;min-height:44px;padding:8px 16px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--mint);font-weight:650;text-decoration:none}
.lost-links a:hover{border-color:var(--mint)}
@media(max-width:420px){.family-inner>span{display:none}}


/* Local review of the photo atlas and habitat inspector. */
.page { padding-bottom: 1.5rem; }
.reef-section { padding-top: clamp(1.15rem, 2.5vw, 2.4rem); }
.stage { height: clamp(365px, 34vw, 510px); }
.stage-scrim { background: linear-gradient(105deg, #02131cd9, #041b2450 36%, transparent 61%), linear-gradient(0deg, #031721a8, transparent 25%); }
.stage-heading { left: clamp(22px, 3.4vw, 58px); top: clamp(24px, 3.2vw, 51px); }
.stage-heading h1 { font-size: clamp(3rem, 5vw, 5.1rem); font-weight: 620; line-height: .99; margin: .9rem 0 .85rem; }
.stage-heading h1 em { display: block; color: #c3f0e6; }
.stage-heading p { max-width: 24ch; font-size: 1rem; }
.live-label { color: #e4fffa; }
.stage-foot { left: clamp(16px, 2.7vw, 42px); right: clamp(16px, 2.5vw, 40px); }
.zone-readout, .reset-reef, .camera-button { min-height: 42px; }
.camera-button { width: 42px; }
.zone-pin { min-height: 44px; }
.pin-index { width: 30px; height: 30px; background: #123e3fe8; border-color: #b6efe2; }
.pin-text { background: #071f28dc; }
.pin-text strong { font-size: .84rem; }
.pin-text small { font-size: .75rem; }
.reef-reading { display: flex; align-items: center; gap: .85rem; border-top: 1px solid var(--line); background: var(--well); padding: .85rem clamp(1rem, 2vw, 1.9rem); }
.reading-icon { display: grid; place-items: center; color: var(--mint); background: var(--mintDeep); width: 35px; height: 35px; flex: none; border-radius: 50%; }
.observation { flex: 1; min-width: 0; }
.observation strong { font-size: .925rem; }
.observation p, .scene-source p, .photo-credit p { color: var(--sub); font-size: .9rem; line-height: 1.5; }
.observation-profile { color: var(--mint); min-height: 44px; }
.placed-strip { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: .8rem clamp(1rem, 2vw, 1.9rem); border-top: 1px solid var(--line); }
.placed-strip > strong { color: var(--muted); font-size: .85rem; }
#placedResidents { display: flex; flex-wrap: wrap; gap: .4rem; }
.placed-resident { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.placed-resident button { display: flex; align-items: center; gap: .48rem; min-height: 44px; padding: 0 .6rem; font-size: .875rem; }
.placed-resident button[aria-pressed=true] { color: var(--mint); background: var(--mintDeep); }
.placed-resident [data-unplace] { border-left: 1px solid var(--line); min-width: 36px; justify-content: center; }
.placed-resident img { object-fit: cover; width: 29px; height: 29px; border-radius: 50%; }
.placed-resident button:focus-visible { outline-offset: -3px; }
.reef-panel.immersive { overflow-y: auto; }
.reef-panel.immersive .stage { min-height: 250px; }
.reef-panel.immersive .reef-reading { flex: none; }
.scene-source { margin-top: .25rem; color: var(--muted); font-size: .85rem; }
.scene-source summary, .wild-shortcuts summary, .photo-credit summary { cursor: pointer; width: fit-content; min-height: 40px; align-content: center; font-weight: 600; }
.scene-source p { max-width: 86ch; margin-bottom: .35rem; }
.scene-source a, .photo-credit a, .tank-place { color: var(--mint); text-underline-offset: .18em; }
.backdrop-choice { display: flex; width: fit-content; align-items: center; gap: .75rem; margin: .25rem 0 .7rem; font-size: .9rem; color: var(--text); }
.backdrop-choice select, .atlas-heading select, .plan-inputs select, #planZone, .field-compare select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23869fa4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 32px; }
.backdrop-choice select { color: var(--text); background-color: var(--well); border: 1px solid var(--line); border-radius: 6px; padding-left: .6rem; min-height: 40px; max-width: 100%; }
.directory-section { padding-top: clamp(1.5rem, 3.6vw, 3.2rem); }
.atlas-heading h3 { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.atlas-heading h3 small { color: var(--muted); font: 500 .8rem var(--mono); }
.atlas-tiles { gap: clamp(.6rem, 1.2vw, 1rem); }
.atlas-tile { aspect-ratio: 2.4; border-radius: 10px; background: #0c2529; }
.atlas-tile::after { background: linear-gradient(0deg, #021319e8, #02131954 56%, #0213190a); }
.atlas-tile span { left: .95rem; bottom: .65rem; font-size: clamp(1rem, 1.6vw, 1.35rem); text-shadow: 0 1px 6px #071517; }
.atlas-tile small { display: block; font: 600 .75rem var(--mono); color: #d2e9e6; margin-bottom: .14rem; }
.atlas-tile img { transition: transform .3s ease; }
@media (prefers-reduced-motion: no-preference) { .atlas-tile:hover img { transform: scale(1.035); } }
.wild-shortcuts { color: var(--muted); font-size: .875rem; margin-top: .25rem; }
.wild-shortcuts .atlas-tiles { margin-bottom: .7rem; }
.tank-place { font-size: .85rem; padding: 0; min-height: 36px; text-decoration: underline; }
.photo-credit { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.photo-credit p { margin-bottom: .5rem; }
.plan-section > h2, .resource-section > h2 { letter-spacing: -.04em; }
.habitat-card { align-content: start; }
@media (min-width: 721px) {
  .main-nav a { font-size: .94rem; }
  .spectrum-choice { min-height: 40px; }
  .flow-options button { min-height: 32px; }
  .filter-panel { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (min-width: 721px) and (max-width: 1030px) {
  html { scroll-padding-top: 115px; }
  .header-inner { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 0 1rem; }
  .brand { width: fit-content; margin-block: .55rem .2rem; }
  .header-actions { grid-row: 1; grid-column: 2; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; margin: 0; }
  .main-nav a { min-height: 44px; }
}
@media (max-width: 720px) {
  .stage { height: clamp(355px, 74vw, 480px); }
  .stage-heading { top: 20px; left: 16px; }
  .stage-heading h1 { font-size: clamp(2.1rem, 7.5vw, 3rem); margin: .55rem 0 .45rem; }
  .stage-heading h1 em { display: inline; }
  .stage-heading p { font-size: .9rem; max-width: 26ch; }
  .stage-scrim { background: linear-gradient(180deg, #031822e8, #03182242 32%, transparent 51%), linear-gradient(0deg, #031721ad, transparent 24%); }
  .reef-reading { gap: .6rem; flex-wrap: wrap; }
  .observation p { font-size: .875rem; }
  .reading-icon { width: 28px; height: 28px; }
  .viewport-tools { gap: .25rem; }
  .main-nav a { min-height: 44px; }
  .atlas-tile { aspect-ratio: 1.95; }
  .atlas-heading { align-items: flex-start; }
  .atlas-heading h3 { gap: .3rem .6rem; }
  .scene-source summary, .wild-shortcuts summary, .photo-credit summary { min-height: 44px; }
  .filter-panel label, .filter-panel select { font-size: .9rem; }
  .filter-panel select { min-height: 44px; }
  .camera-button { width: 40px; height: 40px; }
  .pin-text strong { font-size: .78rem; }
  .pin-text small { font-size: .7rem; }
}
@media (max-width: 540px) {
  .main-nav { gap: 2px; }
  .main-nav .icon { display: none; }
  .main-nav a { font-size: clamp(.76rem, 3.5vw, .9rem); padding-inline: 2px; }
  .stage { height: clamp(395px, 98vw, 475px); }
  .viewport-tools { top: 11px; right: 8px; bottom: auto; transform: none; }
  .stage-foot { left: 9px; right: 9px; }
  .stage-heading h1 { font-size: clamp(2.05rem, 8vw, 2.85rem); }
  .pin-index { width: 25px; height: 25px; }
  .pin-text { padding: .22rem .34rem; }
  .atlas-tile span { left: .6rem; bottom: .55rem; }
  .atlas-tile small { font-size: .74rem; }
  .observation-profile { font-size: .85rem; padding: 0 .25rem; }
  .spectrum-choice { min-height: 42px; }
  .placed-strip { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 405px) {
  .main-nav a { padding-inline: 1px; }
  .stage-foot { bottom: 9px; }
  .camera-button { min-height: 38px; width: 35px; }
  .stage-heading { top: 17px; }
  .stage-heading h1 { margin-top: 1.1rem; }
  .zone-readout,.reset-reef { min-height: 40px; }
  .atlas-heading label { justify-content: space-between; width: 100%; }
  .atlas-heading select { min-width: 0; max-width: 63%; }
}
@media (max-width: 360px) {
  .stage-heading h1 { font-size: clamp(1.55rem, 8.1vw, 1.85rem); }
  .stage-heading p { max-width: none; font-size: .85rem; }
}

@media (max-width: 440px) {
  html { scroll-padding-top: 156px; }
  .main-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .4rem; }
  .main-nav a { justify-content: center; white-space: normal; min-height: 44px; }
}
