/* iPhone-sized layouts; long references scroll within their own table. */
html{-webkit-text-size-adjust:100%;scroll-padding-top:120px}body{overflow-wrap:anywhere}main,.grid>*,.split>*,.row>*,header>*{min-width:0}input,select,textarea{max-width:100%}button{touch-action:manipulation}.tablewrap{max-width:100%;min-width:0;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}.tablewrap:focus-visible{outline:2px solid var(--green);outline-offset:3px}dialog{overscroll-behavior:contain}dialog a,.pre,.fieldsource{overflow-wrap:anywhere}.species-editor-section{margin:18px 0;padding:4px 16px 14px;border:1px solid var(--line);border-radius:12px}.species-editor-section>summary{font-size:16px}.species-editor-section label{font-size:14px}.species-editor-section textarea{min-height:90px;resize:vertical}.editable-missing textarea{border-style:dashed;border-color:#b29a6a;background:#fffdf7}.field-origin{display:block;font-size:12px;font-weight:400;margin-top:5px}.species-form-footer{position:sticky;bottom:-28px;padding:14px 0;background:#fff;z-index:2;border-top:1px solid var(--line)}.species-registration-help{margin:12px 0;padding:14px;background:#f4f6ef;border-radius:10px}.species-registration-help p{margin:4px 0}.species-editor-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.species-editor-header h2{margin:0}.species-editor-header button{flex:none}.form-error{color:#9c372e}.searchresult b{white-space:normal}
@media(max-width:600px){
 html{scroll-padding-top:118px}body{font-size:15px}aside{position:sticky;top:0;z-index:10;padding:calc(10px + env(safe-area-inset-top,0px)) 12px 8px}aside .brand{font-size:20px;margin:0;gap:8px}.brand-eye{width:30px;height:30px}nav{gap:5px;margin:9px -2px 0;padding:0 0 3px;scrollbar-width:thin;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}nav button{flex:none;min-height:44px;padding:10px 12px;font-size:14px}main{width:100%;padding:18px max(12px,env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}header{flex-wrap:wrap;gap:10px}h1{font-size:26px;line-height:1.15;margin:7px 0}h2{font-size:20px}h3{font-size:17px}.grid,.split{grid-template-columns:minmax(0,1fr);gap:12px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:18px 0}.card{padding:16px;border-radius:12px;margin-bottom:12px}.stats .card{padding:13px;margin:0}.stat b{font-size:26px;margin-top:8px}.stat small{font-size:12px}.banner{padding:16px;margin:18px 0}.row{flex-wrap:wrap;align-items:flex-start;gap:10px}.row>.actions{width:100%}.actions{gap:8px}.actions button{flex:1 1 130px;white-space:normal}.actions .tag{flex:0 1 auto}button{min-height:44px;max-width:100%}.tag{white-space:normal;line-height:1.4}.reference-picker,.group-guide,.sciencepanel{padding:13px}.reviewnote{padding:10px 12px;margin:16px 0}input,select,textarea{font-size:16px;min-height:44px}label{font-size:14px}select{width:100%}textarea{min-height:94px}dialog{width:calc(100% - 16px);max-width:560px;max-height:calc(100vh - 24px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 16px);padding:18px 14px;border-radius:14px;margin:auto}dialog h2{font-size:22px}dialog h3{margin-top:24px}dialog table{font-size:13px}.compare th,.compare td{min-width:140px;padding:10px}.mobile-keyvalue{display:block;width:100%}.mobile-keyvalue tbody{display:block}.mobile-keyvalue tr{display:grid;grid-template-columns:minmax(0,1fr);padding:12px 0;border-bottom:1px solid var(--line)}.mobile-keyvalue th,.mobile-keyvalue td{display:block;width:100%;min-width:0;max-width:none;border:0;padding:4px 2px;white-space:normal}.mobile-keyvalue th{font-size:12px;color:#61725e;font-weight:600}.mobile-keyvalue td{font-size:14px}.mobile-keyvalue tr:last-child{border-bottom:0}.tablewrap:not(.keyvalue-wrap){border:1px solid var(--line);border-radius:8px}.tablewrap:not(.keyvalue-wrap) table{min-width:100%}.species-editor-section{padding:3px 12px 12px;margin:14px 0}.species-form-footer{bottom:-18px;padding:12px 0 calc(8px + env(safe-area-inset-bottom,0px));gap:8px}.species-form-footer button{flex:1 1 130px}.species-editor-header{gap:8px}.species-editor-header button{padding:9px 12px}.kpirow{gap:8px;font-size:12px}.kpirow>span{width:112px;flex:none}.meter{min-width:20px}.eyebrow{letter-spacing:1.4px}.weightbar{overflow-x:auto}.fieldsource p{font-size:12px}summary{min-height:44px;line-height:1.5}
}
@media(max-width:360px){main{padding-left:10px;padding-right:10px}.stat b{font-size:23px}.actions button{flex-basis:100%}.species-editor-header h2{font-size:20px}}
