/* Layout: конструктор (превью слева, слои справа) → каталог готовых схем → порядок покраски */
:root{
  color-scheme: light;
  --bg:#f6f7f5;
  --surface:#ffffff;
  --ink:#16201f;
  --muted:#5d6968;
  --line:#d9dedc;
  --accent:#0e5f5b;
  --accent-soft:#e2efed;
  --tray:#dfe4e2;
  --tray-ink:#16201f;
  --display:"Unbounded","Golos Text",system-ui,sans-serif;
  --body:"Golos Text",system-ui,-apple-system,"Segoe UI",sans-serif;
}
body[data-tray="dark"]{ --tray:#23282a; --tray-ink:#eef1f0; }
body[data-tray="uv"]{ --tray:#1c1238; --tray-ink:#e9e4ff; }
body[data-tray="night"]{ --tray:#0a0c0d; --tray-ink:#dfe5e3; }
[hidden]{display:none !important}
body{
  margin:0;
  background:var(--bg); color:var(--ink);
  font-family:var(--body); font-size:15px; line-height:1.5;
  padding-block:28px 56px;
  padding-left:max(16px, env(safe-area-inset-left, 0px));
  padding-right:max(16px, env(safe-area-inset-right, 0px));
}
.wrap{max-width:1080px; margin:0 auto; display:flex; flex-direction:column; gap:40px}
h1{font-family:var(--display); font-weight:700; font-size:clamp(24px,4vw,34px); line-height:1.15; margin:0; text-wrap:balance}
h1 small{display:block; font-family:var(--body); font-weight:500; font-size:14px; color:var(--muted); letter-spacing:.08em; text-transform:uppercase; margin-bottom:8px}
h2{font-family:var(--display); font-weight:500; font-size:18px; margin:0; text-wrap:balance}
p{margin:0}
.lead{max-width:65ch; color:var(--muted); margin-top:12px}
section{display:flex; flex-direction:column; gap:16px}
.sechead{display:flex; flex-wrap:wrap; gap:8px 16px; align-items:baseline; justify-content:space-between}
.sechead p{color:var(--muted); font-size:14px}

/* конструктор */
.builder{display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); gap:20px; align-items:start}
.stage{background:var(--tray); border-radius:14px; padding:20px 16px 14px; display:flex; flex-direction:column; gap:12px; position:sticky; top:16px}
.stage .pair{display:flex; justify-content:center; gap:8%}
.stage figure{margin:0; flex:0 1 150px; display:flex; flex-direction:column; align-items:center; gap:6px}
.stage figcaption{font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--tray-ink); opacity:.7}
.stage svg, .card svg{width:100%; height:auto; display:block; filter:drop-shadow(0 3px 3px rgba(0,0,0,.28))}
.recipe{background:var(--surface); border-radius:10px; padding:10px 12px; font-size:13.5px; color:var(--ink)}
.recipe b{font-weight:600}
.stagebar{display:flex; flex-wrap:wrap; gap:8px}
.controls{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px; display:flex; flex-direction:column; gap:18px; min-width:0}
.group{display:flex; flex-direction:column; gap:8px}
.label{font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); font-weight:500}
.label span{color:var(--ink); text-transform:none; letter-spacing:0; font-size:13.5px; margin-left:6px}
.row{display:flex; flex-wrap:wrap; gap:6px}
.sw{width:30px; height:30px; border-radius:50%; border:1px solid rgba(0,0,0,.22); padding:0; cursor:pointer; position:relative}
.sw[aria-pressed="true"]{outline:2px solid var(--accent); outline-offset:2px}
.sw.none{background:var(--surface); overflow:hidden}
.sw.none::after{content:""; position:absolute; inset:13px -4px; background:var(--muted); transform:rotate(-45deg); height:2px}
.seg{font:inherit; font-size:13.5px; padding:6px 11px; border-radius:8px; border:1px solid var(--line); background:var(--surface); color:var(--ink); cursor:pointer}
.seg[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:#fff}
.btn{font:inherit; font-size:13.5px; font-weight:500; padding:8px 12px; border-radius:8px; border:1px solid var(--accent); background:var(--surface); color:var(--accent); cursor:pointer}
.btn.primary{background:var(--accent); color:#fff}
button:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
.status{font-size:13px; color:var(--muted); min-height:1.3em}
.brow{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.bname{flex:0 0 92px; font-size:13px; color:var(--muted)}
.mdesc{font-size:13.5px; color:var(--ink); background:var(--accent-soft); border-radius:8px; padding:8px 10px; margin-top:4px}
.mdesc b{font-weight:600}

/* каталог */
.grid{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px}
.card{font:inherit; text-align:left; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:0; cursor:pointer; display:flex; flex-direction:column; overflow:hidden; min-width:0}
.card:hover{border-color:var(--accent)}
.card .pic{background:var(--tray); padding:14px 22%}
.card .txt{padding:10px 12px 12px; display:flex; flex-direction:column; gap:4px}
.card .name{font-weight:600; font-size:14.5px}
.card .rec{font-size:12.5px; color:var(--muted)}
.catalog{display:flex; flex-direction:column; gap:32px}
.grp{display:flex; flex-direction:column; gap:10px}
.grp h3{font-family:var(--body); font-weight:600; font-size:17px; margin:0}
.gdesc{max-width:75ch; color:var(--muted); font-size:14px; margin-bottom:4px}
a{color:var(--accent)}
.card .when{font-size:12.5px; color:var(--accent)}

/* покраска */
.steps{margin:0; padding-left:1.3em; max-width:70ch; display:flex; flex-direction:column; gap:6px}
.note{max-width:70ch; color:var(--muted); font-size:14px}

@media (max-width:860px){
  .builder{grid-template-columns:minmax(0,1fr)}
  .stage{position:static}
  .grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media (max-width:560px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stage figure{flex-basis:120px}
}

/* сайт: шапка, вход, коробка */
.topbar{background:var(--surface); border-bottom:1px solid var(--line); margin:-28px calc(-1 * max(16px, env(safe-area-inset-right, 0px))) 28px calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding:10px 16px}
.topbar-in{max-width:1080px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.brand{font-family:var(--display); font-weight:700; font-size:16px; color:var(--ink); text-decoration:none}
.auth{display:flex; align-items:center; gap:8px; font-size:14px; flex-wrap:wrap}
.auth .who{color:var(--muted)}
.dlg{border:1px solid var(--line); border-radius:14px; padding:20px; width:min(360px, calc(100vw - 32px)); background:var(--surface); color:var(--ink)}
.dlg::backdrop{background:rgba(22,32,31,.45)}
.dlg form{display:flex; flex-direction:column; gap:12px}
.dlg label{display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted)}
.dlg input{font:inherit; font-size:15px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--surface)}
.dlg input:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.dlg-bar{display:flex; gap:8px}
.dlg-err{color:#b3261e; font-size:13.5px; min-height:1.2em}
.linkbtn{font:inherit; font-size:13.5px; background:none; border:0; padding:0; color:var(--accent); cursor:pointer; text-align:left; text-decoration:underline}
.boxcard{cursor:default}
.boxcard .acts{display:flex; flex-wrap:wrap; gap:6px; margin-top:6px}
.boxcard .acts .btn{padding:5px 9px; font-size:12.5px}
.btn.danger{border-color:#b3261e; color:#b3261e}
.empty{grid-column:1 / -1; background:var(--surface); border:1px dashed var(--line); border-radius:12px; padding:18px; color:var(--muted); display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between}

/* подбор под условия и лист покраски */
.pickbox{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:16px 18px; display:flex; flex-direction:column; gap:12px}
.pickrow{display:flex; flex-wrap:wrap; gap:6px; align-items:center}
.pickrow .bname{flex:0 0 130px}
.grid5{grid-template-columns:repeat(5,minmax(0,1fr))}
.card .num{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums}
.hint{font-size:14px; color:var(--muted); align-self:center}
.pickline{display:flex; align-items:center; gap:6px; font-size:12.5px; color:var(--muted); margin-top:4px}
.sheet{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:18px 20px; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,2fr); gap:24px}
.sheet h3{font-family:var(--body); font-size:15px; font-weight:600; margin:0 0 8px}
.sheet ul, .sheet ol{margin:0; padding-left:1.2em; display:flex; flex-direction:column; gap:6px; font-size:14px}
.sheet .sub{color:var(--muted); font-size:13px}
.sheet .dot{display:inline-block; width:11px; height:11px; border-radius:50%; border:1px solid rgba(0,0,0,.25); margin-right:6px; vertical-align:-1px}
@media (max-width:860px){ .grid5{grid-template-columns:repeat(3,minmax(0,1fr))} .sheet{grid-template-columns:minmax(0,1fr)} }
@media (max-width:560px){ .grid5{grid-template-columns:repeat(2,minmax(0,1fr))} .pickrow .bname{flex-basis:100%} }

/* общая коробка и отметки улова */
.dlg-sub{font-size:14px; color:var(--muted)}
.dlg select{font:inherit; font-size:15px; padding:7px 8px; border:1px solid var(--line); border-radius:8px; color:var(--ink); background:var(--surface)}
.dlg-cond{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px}
.catch-list{list-style:none; margin:4px 0 0; padding:0; display:flex; flex-direction:column; gap:6px; font-size:13px; max-height:180px; overflow:auto}
.catch-list li{display:flex; gap:8px; justify-content:space-between; align-items:baseline; border-top:1px solid var(--line); padding-top:6px}
.catch-list .sub{color:var(--muted)}
.caught{font-size:12.5px; font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums}
#dlg-catch{width:min(440px, calc(100vw - 32px))}

/* ——— сайт из разделов: шапка, навигация, полоса контекста, страницы */
body{padding:0}
.wrap{padding:28px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); box-sizing:content-box}
.page{display:flex; flex-direction:column; gap:40px}
.topbar{margin:0; padding:0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background:var(--surface); border-bottom:1px solid var(--line)}
.topbar-in{min-height:56px; gap:8px 24px}
.nav{display:flex; gap:2px; flex:1 1 auto; overflow-x:auto; scrollbar-width:none}
.nav::-webkit-scrollbar{display:none}
.nav a{font-size:14.5px; font-weight:500; color:var(--muted); text-decoration:none; padding:8px 10px; border-radius:8px; white-space:nowrap}
.nav a:hover{color:var(--ink); background:var(--bg)}
.nav a[aria-current="page"]{color:var(--accent); background:var(--accent-soft)}
.ctxbar{background:var(--bg); border-bottom:1px solid var(--line); padding:8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px))}
.ctxbar-in{max-width:1080px; margin:0 auto; display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; justify-content:space-between}
.ctx-model{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted)}
.ctx-model select{font:inherit; font-size:14px; font-weight:500; color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:6px 8px; max-width:60vw}
.ctxbar .seg{padding:5px 9px; font-size:13px}
.ptitle{font-size:clamp(22px,3.2vw,28px)}
.page h2{font-size:17px}
a.btn{text-decoration:none; display:inline-flex; align-items:center}
.btn.big{font-size:15px; padding:11px 16px}
a.card{text-decoration:none}
a.name{color:var(--ink); text-decoration:none}
a.name:hover{color:var(--accent); text-decoration:underline}
.sechead > a{font-size:14px}
.hero{display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:24px; align-items:center; flex-direction:unset}
.hero-text{display:flex; flex-direction:column; gap:16px}
.hero .lead{margin-top:0}
.hero-pic{background:var(--tray); border-radius:16px; padding:20px 12%; display:flex; gap:8%; justify-content:center}
.hero-pic svg{flex:1 1 0; min-width:0; height:auto; filter:drop-shadow(0 3px 3px rgba(0,0,0,.28))}
.tiles{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px}
.tile{background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:14px 16px; text-decoration:none; color:var(--ink); display:flex; flex-direction:column; gap:4px}
.tile:hover{border-color:var(--accent)}
.tile b{font-weight:600; font-size:15px}
.tile span{font-size:13px; color:var(--muted)}
.recent{list-style:none; margin:0; padding:0; background:var(--surface); border:1px solid var(--line); border-radius:12px}
.recent li{display:flex; flex-wrap:wrap; gap:4px 16px; padding:10px 14px; font-size:14px; border-top:1px solid var(--line); align-items:baseline}
.recent li:first-child{border-top:0}
.recent li > a{font-weight:600; color:var(--ink); text-decoration:none; flex:0 0 200px}
.recent li > a:hover{color:var(--accent)}
.recent li > span:not(.sub){flex:1 1 240px; min-width:0}
.recent .sub{color:var(--muted)}
.chips{display:flex; flex-wrap:wrap; gap:6px}
.mgrid{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px}
.mcard{background:var(--surface); border:1px solid var(--line); border-radius:12px; overflow:hidden; display:grid; grid-template-columns:120px minmax(0,1fr)}
.mcard.cur{border-color:var(--accent)}
.mcard .pic{background:var(--tray); padding:14px 12px; display:flex; align-items:center}
.mcard .pic svg{width:100%; height:auto; filter:drop-shadow(0 3px 3px rgba(0,0,0,.28))}
.mtxt{padding:12px 14px; display:flex; flex-direction:column; gap:4px; min-width:0}
.mtxt .name{font-weight:600; font-size:16px}
.mtxt .when{font-size:12.5px; color:var(--muted)}
.mtxt .rec{font-size:12.5px; color:var(--muted)}
.mtxt .rec b{color:var(--ink); font-weight:600}
.mtxt .acts{margin-top:6px}
.scheme{display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); gap:24px; align-items:start}
.scheme .stage{position:static}
.scheme .stage svg{width:100%; height:auto; display:block; filter:drop-shadow(0 3px 3px rgba(0,0,0,.28))}
.scheme-info{display:flex; flex-direction:column; gap:14px; min-width:0}
.scheme-info .when{color:var(--muted); font-size:14px}
.scheme-info .recipe{border:1px solid var(--line)}
.stage .mdesc{margin-top:0}
@media (max-width:860px){
  .hero, .scheme{grid-template-columns:minmax(0,1fr)}
  .tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mgrid{grid-template-columns:minmax(0,1fr)}
  .topbar-in{padding-block:8px}
  .nav{order:3; flex-basis:100%}
}


/* ——— визуальный язык v3: строгий технический каталог */
:root{
  --bg:#f5f6f6; --surface:#ffffff; --ink:#10191b; --muted:#5b676a; --line:#d9dfe0;
  --accent:#0f4c52; --accent-soft:#e6eeef; --lemon:#dfe81a;
  --tray:#e9edee; --tray-ink:#10191b; --grid:rgba(16,25,27,.055);
  --display:"Inter Tight","Golos Text",system-ui,sans-serif;
  --mono:"JetBrains Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --ease:cubic-bezier(.2,.7,.2,1);
}
body[data-tray="dark"]{ --tray:#1b2325; --tray-ink:#eef2f2; --grid:rgba(255,255,255,.05); }
body[data-tray="uv"]{ --tray:#1a1233; --tray-ink:#e9e4ff; --grid:rgba(190,170,255,.07); }
body[data-tray="night"]{ --tray:#0a0c0d; --tray-ink:#dfe5e3; --grid:rgba(255,255,255,.03); }
body{background:var(--bg)}
/* подложка под блёснами: ровный тон с чертёжной сеткой */
.stage, .card .pic, .mcard .pic, .hero-pic{
  background-color:var(--tray);
  background-image:linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size:16px 16px;
}

/* шапка */
.topbar{position:sticky; top:0; z-index:20; background:rgba(255,255,255,.9); backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px)}
.brand{font-family:var(--display); font-weight:700; font-size:17px; letter-spacing:-.01em; text-transform:uppercase}
.nav a{border-radius:0; padding:18px 10px 16px; border-bottom:2px solid transparent; transition:color .2s, border-color .2s}
.nav a:hover{background:none; color:var(--ink)}
.nav a[aria-current="page"]{color:var(--ink); background:none; border-bottom-color:var(--lemon)}
.topbar-in{min-height:0}
.ctxbar{background:var(--bg)}
.ctx-model, .label, figcaption, .card .num, .when, .mtxt .when, h1 small, .bname{font-family:var(--mono)}
.ctx-model{font-size:12px; text-transform:uppercase; letter-spacing:.06em}
.ctx-model select{font-family:var(--body); text-transform:none; letter-spacing:0; border-radius:6px}

/* кнопки и переключатели */
.btn, .seg{transition:background .18s, border-color .18s, color .18s, transform .12s var(--ease)}
.btn{border:1px solid var(--ink); color:var(--ink); border-radius:6px; font-weight:500}
.btn:hover{background:var(--ink); color:#fff}
.btn:active, .seg:active{transform:scale(.98)}
.btn.primary{background:var(--ink); border-color:var(--ink); color:#fff}
.btn.primary:hover{background:var(--accent); border-color:var(--accent)}
.btn.danger{border-color:#a3271f; color:#a3271f}
.btn.danger:hover{background:#a3271f; color:#fff}
.btn.big{padding:12px 18px; font-size:15px}
.seg{border-radius:6px}
.seg:hover{border-color:var(--ink)}
.seg[aria-pressed="true"]{background:var(--ink); border-color:var(--ink); color:#fff}
#play[aria-pressed="true"]{background:var(--ink); color:#fff}
.sw[aria-pressed="true"]{outline-color:var(--ink)}
button:focus-visible, a:focus-visible, select:focus-visible{outline:2px solid var(--ink); outline-offset:2px}

/* типографика */
h1, h2, .ptitle{font-family:var(--display)}
h1{font-weight:700}
h1.display{font-size:clamp(34px,5vw,56px); line-height:1.04; letter-spacing:-.025em}
h1.display small{font-size:12px; letter-spacing:.12em; margin-bottom:16px; color:var(--muted); font-weight:500}
mark{background:none; color:inherit; box-shadow:inset 0 -.14em 0 var(--lemon)}
.ptitle{font-size:clamp(26px,3.4vw,34px); letter-spacing:-.02em}
h2, .page h2{font-weight:600; font-size:19px; letter-spacing:-.01em}
.grp h3{font-family:var(--display); font-size:18px}
.lead{font-size:16px; line-height:1.55}
.label{font-size:11px; letter-spacing:.08em}
.label span{font-family:var(--body)}
figcaption{font-size:11px; letter-spacing:.1em}
.card .when, .mtxt .when{font-size:11.5px; letter-spacing:.02em; color:var(--muted)}
.card .num{font-size:11px; letter-spacing:.06em; text-transform:uppercase}

/* главная */
.hero{background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:0; overflow:hidden; gap:0; align-items:stretch}
.hero-text{padding:clamp(24px,4vw,48px); justify-content:center}
.hero-pic{border-radius:0; border-left:1px solid var(--line); padding:32px 9%; gap:7%; perspective:1100px; align-items:center}
.swim{flex:1 1 0; min-width:0}
.flip{position:relative; transform-style:preserve-3d; aspect-ratio:100/240}
.flip .face{position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden}
.flip .face.back{transform:rotateY(180deg)}
.flip svg{width:100%; height:100%; display:block; filter:drop-shadow(0 4px 5px rgba(16,25,27,.25))}
.swim .flip{animation:roll 12s var(--ease) infinite}
.swim.s1 .flip{animation-delay:-4s} .swim.s2 .flip{animation-delay:-8s}
.tile{border-radius:8px; transition:border-color .18s}
.tile:hover{border-color:var(--ink)}
.tile b{font-family:var(--display); font-size:16px}
.recent{border-radius:8px}
.recent li > a{font-weight:500}

/* карточки и панели */
.card, .mcard{border-radius:8px; border:1px solid var(--line); box-shadow:none; transition:border-color .18s, transform .2s var(--ease)}
.card:hover, .mcard:hover{border-color:var(--ink); transform:translateY(-2px)}
.boxcard:hover{transform:none; border-color:var(--line)}
.mcard.cur{border-color:var(--ink)}
.card .name, .mtxt .name{font-family:var(--display); font-weight:600}
.caught{font-family:var(--mono); font-size:11.5px; font-weight:500; display:inline-flex; align-items:center; gap:6px; align-self:flex-start}
.caught::before{content:""; width:7px; height:7px; background:var(--lemon); border:1px solid var(--ink); border-radius:50%}
.controls, .pickbox, .sheet{border-radius:10px; border:1px solid var(--line); box-shadow:none}
.stage{border-radius:10px; border:1px solid var(--line)}
.recipe, .mdesc, .empty{border-radius:6px}
.mdesc{background:var(--surface); border:1px solid var(--line)}
.dlg{border-radius:10px}
.dlg input, .dlg select{border-radius:6px}

/* конструктор: анимация игры */
.playbox{perspective:900px; padding:4px 0 10px}
.playbox .flip{width:min(44%,170px); margin:0 auto; animation:spin 2.2s linear infinite}

/* движение: только мягкое появление */
.page:not([hidden]){animation:pageIn .3s var(--ease)}
.grid > *, .mgrid > *{animation:cardIn .35s var(--ease) both}
.grid > :nth-child(2), .mgrid > :nth-child(2){animation-delay:30ms}
.grid > :nth-child(3), .mgrid > :nth-child(3){animation-delay:60ms}
.grid > :nth-child(4), .mgrid > :nth-child(4){animation-delay:90ms}
.grid > :nth-child(5), .mgrid > :nth-child(5){animation-delay:120ms}
.grid > :nth-child(6), .mgrid > :nth-child(6){animation-delay:150ms}
.grid > :nth-child(7), .mgrid > :nth-child(7){animation-delay:180ms}
.grid > :nth-child(8), .mgrid > :nth-child(8){animation-delay:210ms}
.grid > :nth-child(9), .mgrid > :nth-child(9){animation-delay:240ms}
.grid > :nth-child(10), .mgrid > :nth-child(10){animation-delay:270ms}
.grid > :nth-child(11), .mgrid > :nth-child(11){animation-delay:300ms}
.grid > :nth-child(12), .mgrid > :nth-child(12){animation-delay:330ms}

#sheet-sec:not([hidden]){animation:pageIn .3s var(--ease)}
dialog[open]{animation:pageIn .2s var(--ease)}
@keyframes pageIn{from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:none}}
@keyframes cardIn{from{opacity:0} to{opacity:1}}
@keyframes roll{0%,42%{transform:rotateY(0)} 50%,92%{transform:rotateY(180deg)} 100%{transform:rotateY(360deg)}}
@keyframes spin{from{transform:rotateY(0)} to{transform:rotateY(360deg)}}
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{animation:none !important; transition:none !important}
}
@media (max-width:860px){
  .hero-pic{border-left:0; border-top:1px solid var(--line)}
  .nav a{padding:10px 10px 8px}
}

/* ——— элементы управления: свой вид вместо системного */
select, .dlg select, .ctx-model select{
  -webkit-appearance:none; appearance:none;
  font-family:var(--body); font-size:14px; font-weight:500; line-height:1.3; color:var(--ink);
  background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2310191b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  border:1px solid var(--line); border-radius:6px;
  padding:8px 32px 8px 11px; box-shadow:none; cursor:pointer;
  transition:border-color .18s;
}
.dlg select, .ctx-model select{padding:8px 32px 8px 11px; border-radius:6px}
.dlg select{font-size:15px; font-weight:400}
select:hover{border-color:var(--ink)}
select:focus-visible, .dlg input:focus-visible{outline:2px solid var(--ink); outline-offset:1px}
.dlg input{transition:border-color .18s}
.dlg input:hover{border-color:var(--ink)}

input[type="checkbox"]{
  -webkit-appearance:none; appearance:none; flex:none;
  width:16px; height:16px; margin:0; padding:0;
  border:1px solid #9aa5a6; border-radius:4px; background:var(--surface);
  display:inline-grid; place-content:center; cursor:pointer;
  transition:background .15s, border-color .15s;
}
.dlg input[type="checkbox"]{padding:0; border-radius:4px}
input[type="checkbox"]::after{
  content:""; width:9px; height:5px; margin-top:-2px;
  border-left:1.6px solid #fff; border-bottom:1.6px solid #fff;
  transform:rotate(-45deg) scale(0); transition:transform .12s var(--ease);
}
input[type="checkbox"]:hover{border-color:var(--ink)}
input[type="checkbox"]:checked{background:var(--ink); border-color:var(--ink)}
input[type="checkbox"]:checked::after{transform:rotate(-45deg) scale(1)}
input[type="checkbox"]:focus-visible{outline:2px solid var(--ink); outline-offset:2px}
.pickline{gap:8px; cursor:pointer; color:var(--ink); margin-top:6px}
.dlg input[type="date"]{font-family:var(--body); padding-top:6.5px; padding-bottom:6.5px}

/* ——— блесна в воде: полоса настроек */
.waterbar{margin-top:8px; padding-top:8px; border-top:1px solid var(--line); align-items:flex-start}
.waterctl{display:flex; flex-wrap:wrap; gap:8px 24px}
.waterctl .pickrow .bname{flex:0 0 auto; font-size:11px; text-transform:uppercase; letter-spacing:.06em; margin-right:4px}
.waternote{flex:1 1 260px; max-width:46ch; font-size:12.5px; color:var(--muted)}
body[data-tray="water"]{--grid:rgba(255,255,255,.06)}

/* ——— статистика уловов и список водоёмов */
.stats{display:flex; flex-direction:column; gap:20px}
.stats h2{margin-top:12px}
.kpis{display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px}
.kpi{background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:14px 16px; display:flex; flex-direction:column; gap:2px}
.kpi b{font-family:var(--display); font-weight:600; font-size:30px; line-height:1.1; letter-spacing:-.02em}
.kpi span{font-size:13px; color:var(--muted)}
.statgrid{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-items:start}
.statbox{background:var(--surface); border:1px solid var(--line); border-radius:8px; padding:14px 16px; display:flex; flex-direction:column; gap:10px; min-width:0}
.statbox h3{font-family:var(--display); font-weight:600; font-size:15px; margin:0}
.statbox .sub{font-size:12.5px; color:var(--muted)}
.bars{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px}
.bars li{display:grid; grid-template-columns:minmax(0,150px) minmax(40px,1fr) 28px; gap:2px 10px; align-items:center; font-size:13.5px}
.bars .bl{overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.bars .dot{display:inline-block; width:10px; height:10px; border-radius:50%; border:1px solid rgba(0,0,0,.25); margin-right:6px; vertical-align:-1px}
.bars .bt{height:8px; background:var(--bg); border-radius:4px; overflow:hidden}
.bars .bt i{display:block; height:100%; min-width:0; background:var(--ink); border-radius:0 4px 4px 0; transition:width .3s var(--ease)}
.bars li:hover .bt i{background:var(--accent)}
.bars .bn{font-family:var(--mono); font-size:12.5px; text-align:right; font-variant-numeric:tabular-nums}
.bars .bs{grid-column:2 / -1; font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.bars .bs:empty{display:none}
.places li{align-items:center}
.places .pname{flex:0 0 220px; font-weight:500}
.places .sub{flex:1 1 120px}
.places .pacts{display:flex; gap:14px; align-items:center}
.places .pedit, .placeadd input{font:inherit; font-size:15px; padding:8px 10px; border:1px solid var(--line); border-radius:6px; color:var(--ink); background:var(--surface); flex:1 1 220px; min-width:0}
.places .pedit:focus-visible, .placeadd input:focus-visible{outline:2px solid var(--ink); outline-offset:1px}
.placeadd{display:flex; flex-wrap:wrap; gap:8px; max-width:520px}
@media (max-width:860px){ .statgrid{grid-template-columns:minmax(0,1fr)} .kpis{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:560px){ .bars li{grid-template-columns:minmax(0,110px) minmax(30px,1fr) 24px} .places .pname{flex-basis:100%} }
.statgrid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.statgrid.three .bars li{grid-template-columns:minmax(0,110px) minmax(30px,1fr) 24px}
@media (max-width:860px){ .statgrid.three{grid-template-columns:minmax(0,1fr)} }
.statgrid.three .bars .bl{white-space:normal; line-height:1.25}

/* конструктор: подсказка у светонакопителя */
.ghint{font-size:12.5px; color:var(--muted); max-width:60ch}
