:root{
  --g:#143b2b;
  --g2:#2b6548;
  --g3:#0d2b20;
  --cream:#f6f1e5;
  --paper:rgba(252,250,244,.96);
  --paper-solid:#fcfaf4;
  --ink:#203027;
  --muted:#68766d;
  --rust:#a95f3a;
  --line:rgba(20,59,43,.16);
  --line-strong:rgba(20,59,43,.24);
  --radius:20px;
  --radius-sm:14px;
  --shell:min(1360px,calc(100% - 48px));
  --shadow:0 18px 48px rgba(21,43,31,.12);
  --shadow-soft:0 10px 28px rgba(21,43,31,.08);
}
*{box-sizing:border-box}
html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  scroll-behavior:smooth;
  overflow-x:hidden;
  background:#e8ede4;
}
body{
  margin:0;
  min-width:0;
  min-height:100vh;
  overflow-x:clip;
  overscroll-behavior-x:none;
  color:var(--ink);
  background:#e8ede4;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  -webkit-tap-highlight-color:transparent;
}
img,svg,video,canvas{display:block;max-width:100%}
button,input,select,textarea{font:inherit}
a,button{-webkit-touch-callout:none}
.bg{
  position:fixed;
  inset:0;
  z-index:-2;
  pointer-events:none;
  background:
    linear-gradient(180deg,rgba(248,244,233,.84),rgba(235,241,232,.90)),
    url('/assets/reptirealm-background.webp') center 18%/cover no-repeat;
}
.bg::after{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 50% 10%,rgba(255,255,255,.28),transparent 42%);
}
.shell{width:var(--shell);max-width:100%;margin-inline:auto;min-width:0}
header{
  position:sticky;
  top:0;
  z-index:80;
  padding-top:env(safe-area-inset-top);
  background:rgba(250,248,241,.94);
  border-bottom:1px solid var(--line);
  box-shadow:0 6px 24px rgba(20,59,43,.05);
  backdrop-filter:blur(18px) saturate(125%);
  -webkit-backdrop-filter:blur(18px) saturate(125%);
}
.nav{
  min-height:74px;
  display:flex;
  align-items:center;
  gap:24px;
}
.brand{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0;
  color:var(--g);
  text-decoration:none;
}
.brand img{width:62px;height:48px;object-fit:contain;flex:0 0 auto}
.brand span{display:flex;flex-direction:column;min-width:0}
.brand b{font:700 24px/1 Georgia,serif;letter-spacing:-.01em;white-space:nowrap}
.brand small{margin-top:5px;color:#718278;letter-spacing:.18em;text-transform:uppercase;font-size:9px;white-space:nowrap}
.desktop{margin-left:auto;display:flex;align-items:center;gap:2px}
.desktop a,.adminnav a{
  color:var(--g);
  text-decoration:none;
  font-size:13px;
  font-weight:850;
}
.desktop a{padding:10px 11px;border-radius:999px}
.desktop a:hover,.desktop a:focus-visible{background:rgba(20,59,43,.07)}
.right{display:flex;align-items:center;gap:9px}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 17px;
  border:1px solid var(--g);
  border-radius:12px;
  background:var(--g);
  color:#fff;
  text-decoration:none;
  font-weight:850;
  font-size:14px;
  line-height:1.2;
  cursor:pointer;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease;
}
.btn:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(20,59,43,.13)}
.btn:focus-visible,.menu:focus-visible,.dhead button:focus-visible,a:focus-visible{outline:3px solid rgba(43,101,72,.22);outline-offset:2px}
.btn.secondary{background:rgba(255,255,255,.38);color:var(--g)}
.btn.small{min-height:40px;padding:8px 14px;font-size:12px}
.menu{
  display:none;
  width:44px;
  height:44px;
  flex:0 0 44px;
  border:1px solid var(--line-strong);
  background:rgba(255,255,255,.84);
  border-radius:12px;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  cursor:pointer;
}
.menu i{display:block;width:19px;height:2px;border-radius:2px;background:var(--g)}
.drawer[hidden]{display:none!important}
.drawer{position:fixed;inset:0;z-index:300}
.shade{position:absolute;inset:0;border:0;background:rgba(5,24,16,.58);backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px)}
.drawer aside{
  position:absolute;
  right:0;
  top:0;
  width:min(410px,92vw);
  height:100dvh;
  overflow:auto;
  overscroll-behavior:contain;
  background:#fbf8ef;
  padding:max(18px,env(safe-area-inset-top)) 18px max(20px,env(safe-area-inset-bottom));
  box-shadow:-24px 0 60px rgba(0,0,0,.22);
}
.dhead{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:5px 4px 16px;border-bottom:1px solid var(--line)}
.dhead strong{font:700 20px Georgia,serif;color:var(--g)}
.dhead button{width:44px;height:44px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--g);font-size:26px;cursor:pointer}
.drawer aside>a{display:flex;flex-direction:column;gap:4px;padding:16px 8px;border-bottom:1px solid var(--line);color:var(--g);text-decoration:none}
.drawer aside>a b{font-size:15px}.drawer aside>a span{font-size:12px;color:var(--muted)}
body.open{overflow:hidden}
.space{padding:38px 0 54px}
.panel{
  min-width:0;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.hero{
  display:grid;
  grid-template-columns:minmax(0,1.08fr) minmax(390px,.92fr);
  gap:24px;
  align-items:stretch;
  padding:34px 0 26px;
}
.hero-copy{
  padding:clamp(30px,4vw,56px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.hero-art{
  min-height:0;
  aspect-ratio:4/4.6;
  padding:20px;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  background:
    linear-gradient(180deg,rgba(15,55,37,.02) 22%,rgba(11,43,29,.70) 100%),
    url('/assets/reptirealm-background.webp') center/cover no-repeat;
}
.encounter{
  width:min(100%,520px);
  margin-left:auto;
  padding:20px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:16px;
  color:#fff;
  background:rgba(10,42,28,.88);
  box-shadow:0 16px 40px rgba(0,0,0,.14);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
}
.encounter p:last-child{margin-bottom:0}
.eyebrow{margin:0 0 10px;color:var(--g2);font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.2em}
h1{
  margin:0 0 18px;
  max-width:15ch;
  color:var(--g);
  font:700 clamp(42px,4.8vw,72px)/.98 Georgia,serif;
  letter-spacing:-.035em;
}
h1 em{color:var(--rust);font-weight:500}
h2{margin:0 0 10px;color:var(--g);font:700 clamp(28px,3vw,42px)/1.05 Georgia,serif;letter-spacing:-.02em}
h3{margin:0 0 7px;color:var(--g);font-size:19px}
p{line-height:1.62;overflow-wrap:anywhere}
.lead{max-width:62ch;color:#5d6c63;font-size:clamp(16px,1.35vw,19px)}
.actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:22px}
.status{
  margin:18px 0 0;
  color:var(--muted);
}
.bot-state{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  max-width:100%;
  min-height:36px;
  padding:7px 11px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.62);
  font-size:13px;
  font-weight:750;
}
.bot-state small{font-weight:650;color:var(--muted);white-space:nowrap}
.status-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;background:#b5aea4;box-shadow:0 0 0 4px rgba(181,174,164,.12)}
.bot-state.online{color:#1e653b;background:rgba(224,245,229,.82);border-color:rgba(32,125,69,.22)}
.bot-state.online .status-dot{background:#36b566;box-shadow:0 0 0 4px rgba(54,181,102,.14)}
.bot-state.stale{color:#8a6331;background:rgba(251,242,219,.88);border-color:rgba(174,126,50,.22)}
.bot-state.stale .status-dot{background:#daa347;box-shadow:0 0 0 4px rgba(218,163,71,.14)}
.stats{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
  margin:0 0 28px;
}
.stat{padding:19px 20px}
.stat span{display:block;color:var(--muted);font-size:12px;font-weight:800}
.stat strong{display:block;margin-top:4px;color:var(--g);font:700 34px Georgia,serif}
.section{padding:18px 0 42px}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
  min-width:0;
  margin-bottom:17px;
}
.section-head>div{min-width:0}
.section-head p{margin:0;color:var(--muted)}
.dashboard-head{align-items:flex-end}
.grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:17px;
}
.card{overflow:hidden;min-width:0}
.media{aspect-ratio:4/3;background:#dce5d9;overflow:hidden}
.media img{width:100%;height:100%;object-fit:cover}
.body{padding:18px}
.chip{display:inline-flex;padding:5px 9px;border-radius:999px;background:rgba(20,59,43,.08);color:var(--g);font-size:11px;font-weight:850;margin:0 4px 5px 0}
.artist{font-size:13px;font-weight:800;color:var(--rust)}
.link{color:var(--g);font-weight:850;text-decoration:none;white-space:nowrap}
.link:hover{text-decoration:underline}
.narrow{max-width:860px;margin-inline:auto;padding:28px}
.activity-panel{padding:26px}
.activity-title{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.activity-title h2{margin:0}
.activity-title .status{margin:0}
.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field.full{grid-column:1/-1}
.field label{font-size:12px;font-weight:850;color:var(--g)}
input,select,textarea{
  width:100%;
  min-width:0;
  min-height:46px;
  border:1px solid #bec9bf;
  border-radius:11px;
  background:#fff;
  padding:11px 12px;
  color:var(--ink);
  font-size:16px;
}
textarea{min-height:120px;resize:vertical}
input:focus,select:focus,textarea:focus{outline:3px solid rgba(43,101,72,.14);border-color:var(--g2)}
.check{display:flex!important;flex-direction:row!important;align-items:center;gap:9px}
.check input{width:18px;min-height:auto}
.flash{margin-top:14px;padding:13px 15px;border:1px solid #a9c7a7;border-radius:12px;background:#e5efe1;color:#2d5235;font-weight:750}
.flash.bad{background:#f3e1dc;border-color:#d9a99d;color:#813b32}
.adminnav{
  display:flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  gap:3px;
  margin:0 0 20px;
  padding:6px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scrollbar-width:none;
  white-space:nowrap;
  background:rgba(250,248,241,.94);
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:var(--shadow-soft);
}
.adminnav::-webkit-scrollbar{display:none}
.adminnav a{flex:0 0 auto;padding:9px 12px;border-radius:10px}
.adminnav a:hover,.adminnav a.active{background:rgba(20,59,43,.09)}
.tablewrap{width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:12px}
.table{width:100%;border-collapse:collapse;min-width:660px}
.table th,.table td{padding:11px 12px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.table th{text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-size:10px}
.list{display:grid;gap:8px}
.listitem{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:12px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.68);
}
.listitem>div{min-width:0}.listitem small{color:var(--muted);overflow-wrap:anywhere}
.power{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.power div{padding:13px;text-align:center;border-radius:11px;background:rgba(20,59,43,.07)}
.power b{display:block;font-size:22px;color:var(--g)}
.speciespick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:400px;overflow:auto}
.pick{display:flex;gap:9px;align-items:center;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;min-width:0}
.pick input{width:18px;min-height:auto;flex:0 0 auto}
.pick span{min-width:0;overflow-wrap:anywhere}
.empty{padding:28px;text-align:center;color:var(--muted)}
footer{
  margin:0;
  padding:0 0 calc(20px + env(safe-area-inset-bottom));
  background:transparent;
  border:0;
}
.foot{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:13px;
  min-height:72px;
  margin-top:12px;
  padding:15px 18px;
  color:#637168;
  font-size:12px;
  background:rgba(250,248,241,.84);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow:var(--shadow-soft);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.foot img{width:48px;height:36px;object-fit:contain}
.foot p{margin:0}.foot span{white-space:nowrap}
@media (min-width:1500px){
  :root{--shell:min(1420px,calc(100% - 64px))}
  .hero{grid-template-columns:minmax(0,1.12fr) minmax(430px,.88fr);gap:28px}
}
@media (max-width:1120px){
  :root{--shell:min(100% - 36px,1040px)}
  .desktop{display:none}
  .menu{display:flex}
  .right{margin-left:auto}
  .hero{grid-template-columns:minmax(0,1fr) minmax(330px,.8fr)}
  h1{font-size:clamp(40px,5.7vw,64px)}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:900px){
  :root{--shell:calc(100% - 30px)}
  .hero{grid-template-columns:1fr;gap:16px;padding-top:22px}
  .hero-copy{padding:32px}
  .hero-art{aspect-ratio:16/9;min-height:330px}
  .encounter{width:min(100%,520px)}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:680px){
  :root{--shell:calc(100% - 22px);--radius:17px}
  header{box-shadow:0 4px 18px rgba(20,59,43,.06)}
  .nav{min-height:64px;gap:10px}
  .brand img{width:50px;height:39px}
  .brand b{font-size:19px}
  .brand small{font-size:7px}
  .right>.btn{display:none}
  .hero{padding:14px 0 20px}
  .hero-copy{padding:24px 19px}
  .hero-art{aspect-ratio:auto;min-height:300px;padding:12px}
  .encounter{padding:16px}
  h1{max-width:12ch;font-size:clamp(36px,12vw,52px)}
  h2{font-size:clamp(27px,8vw,36px)}
  .lead{font-size:16px}
  .actions{display:grid;grid-template-columns:1fr;margin-top:18px}
  .actions .btn{width:100%}
  .bot-state{width:100%;justify-content:flex-start;border-radius:12px;flex-wrap:wrap}
  .bot-state small{margin-left:auto}
  .stats{gap:10px;margin-bottom:22px}
  .stat{padding:16px}
  .stat strong{font-size:29px}
  .section{padding:14px 0 32px}
  .section-head{align-items:flex-start;flex-direction:column;gap:8px}
  .dashboard-head{align-items:stretch}
  .dashboard-head form,.dashboard-head .btn{width:100%}
  .grid{grid-template-columns:1fr}
  .narrow{max-width:none;padding:20px}
  .activity-panel{padding:20px}
  .activity-title{align-items:flex-start;flex-direction:column}
  .activity-title .bot-state{width:100%}
  .formgrid{grid-template-columns:1fr}
  .field.full{grid-column:auto}
  .adminnav{
    width:100%;
    border-radius:12px;
    padding:5px;
  }
  .adminnav a{padding:9px 11px}
  .power{grid-template-columns:repeat(2,minmax(0,1fr))}
  .speciespick{grid-template-columns:1fr;max-height:none}
  .listitem{flex-direction:column;gap:5px}
  .foot{
    grid-template-columns:auto 1fr;
    gap:10px;
    margin-top:4px;
    padding:14px;
  }
  .foot img{width:42px;height:32px}
  .foot span{grid-column:1/-1;white-space:normal;padding-left:52px}
  .drawer aside{width:100%;max-width:none}
}
@media (max-width:420px){
  :root{--shell:calc(100% - 16px)}
  .brand span{display:none}
  .hero-copy{padding:22px 16px}
  .hero-art{min-height:280px}
  .stats{grid-template-columns:1fr 1fr}
  .stat span{font-size:11px}
  .stat strong{font-size:27px}
  .foot p{font-size:11px}
  .foot span{padding-left:0}
}
@supports (-webkit-touch-callout:none){
  body{min-height:-webkit-fill-available}
  .drawer aside{min-height:-webkit-fill-available}
}

/* v5.0 artwork + artist profile improvements */
.media,
.artwork-media{
  display:grid;
  place-items:center;
  aspect-ratio:4/3;
  min-height:220px;
  padding:14px;
  background:linear-gradient(180deg,#dfe8dc,#e9eee6);
}
.media img,
.artwork-media img{
  display:block;
  width:100%;
  height:100%;
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  object-position:center;
}
.social-links{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  margin:10px 0 4px;
}
.social-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:6px 10px;
  border:1px solid rgba(20,59,43,.16);
  border-radius:999px;
  background:rgba(20,59,43,.07);
  color:var(--g);
  font-size:11px;
  font-weight:850;
  text-decoration:none;
  line-height:1;
}
.social-btn:hover{background:var(--g);color:#fff;text-decoration:none}
.subsection-title{
  display:flex;
  flex-direction:column;
  gap:3px;
  margin-top:4px;
  padding-top:15px;
  border-top:1px solid var(--line);
}
.subsection-title span{font-weight:900;color:var(--g);font-size:15px}
.subsection-title small,.field small{color:var(--muted);font-size:11px;line-height:1.45}
.compact-lead{max-width:760px;margin-bottom:16px}
.collector-link{font-weight:900}
@media(max-width:680px){
  .media,.artwork-media{min-height:200px;padding:10px}
  .social-links{gap:6px}
  .social-btn{min-height:34px;padding:7px 10px}
}

/* bot refresh controls (introduced in v5.5, retained in v5.7) */
.refresh-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:18px}
.refresh-grid>div{padding:18px;border:1px solid var(--line);border-radius:16px;background:rgba(255,255,255,.32)}
.refresh-grid p{margin:0 0 10px}
.muted{color:var(--muted);font-size:14px}
.btn:disabled{opacity:.55;cursor:not-allowed;transform:none;box-shadow:none}
@media(max-width:760px){.refresh-grid{grid-template-columns:1fr}}


/* v5.6+ currency + Black Market; v5.7 infection warning uses existing muted/panel styles */
.market-editor{max-width:100%;padding:20px}.market-table select,.market-table input{min-width:180px;width:100%}.market-price{font-weight:800;font-size:1.08rem;color:var(--accent,#b68a3a)}.market-grid .card .body{display:flex;flex-direction:column;align-items:flex-start}.market-grid .chip+.chip{margin-left:6px}@media(max-width:720px){.market-table th:first-child,.market-table td:first-child{width:52px}.market-table select,.market-table input{min-width:150px}.market-editor{padding:14px}}
