@font-face{font-family:Golos;src:url('/fonts/golos-text-400-normal-cyrillic.woff2')}@font-face{font-family:Golos;src:url('/fonts/golos-text-600-normal-cyrillic.woff2');font-weight:600}
.scales-shell{color-scheme:dark;--surface:#171d28;--mint:#97f1cc;font:16px Golos,system-ui,sans-serif;background:#0d111a;color:#eff4fb;max-width:1320px;margin:auto;padding:0 clamp(16px,4vw,48px) 72px;background:radial-gradient(ellipse at 50% 0,#233944 0,#0d111a 38rem);border-radius:20px}
.scales-shell{
.hero{text-align:center;padding:clamp(42px,8vw,96px) 0 44px}.hero p{margin:0;color:var(--mint)}h1{font:600 clamp(2.8rem,8vw,6rem)/1.05 Golos,system-ui;letter-spacing:-.05em;max-width:64rem;margin:10px auto 0}#status:empty{display:none}#status{color:#ffb6a6}
#slots{display:grid;grid-auto-flow:dense;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:20px;overflow:hidden}
article{min-width:0;display:flex;flex-direction:column;align-items:flex-start;background:var(--surface);padding:20px;transition:background .32s,box-shadow .32s}article:hover{background:#202b38;box-shadow:none}
article h2{font-size:1rem;font-weight:600;line-height:1.35;margin:12px 0 14px;overflow-wrap:anywhere}.slot-icon{color:var(--mint);display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:#233a38}svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
article strong{font:600 clamp(1.35rem,2.2vw,2rem)/1.12 Golos,system-ui;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}article p{color:var(--muted);font-size:.83rem;line-height:1.45;min-height:2.5em;margin:10px 0 16px}
.actions{margin-top:auto;display:flex;flex-wrap:wrap;gap:6px}button,input{font:inherit;color:inherit}button{display:inline-flex;align-items:center;gap:7px;border:1px solid #46546a;border-radius:9px;background:#252f40;padding:8px 10px;cursor:pointer;transition:background .2s,transform .2s}button:hover{background:#36465b;transform:translateY(-2px)}button:active{transform:scale(.97)}button:disabled{opacity:.5;cursor:default}button svg{width:15px;height:15px}:focus-visible{outline:2px solid var(--mint);outline-offset:3px}
.mismatch,.mismatch:hover{background:#3b242b;box-shadow:inset 0 2px #ff8e88}.mismatch p,.mismatch .slot-icon{color:#ffaba5}.mismatch .slot-icon{background:#543039}
#history,dialog{border:1px solid var(--line);background:var(--surface);border-radius:18px;padding:clamp(16px,3vw,28px)}#history{margin-top:40px}#history h2{margin-top:0}#period{display:flex;align-items:end;gap:10px;flex-wrap:wrap}#period label{display:grid;gap:5px}input{background:#111824;border:1px solid #46546a;border-radius:8px;padding:8px;max-width:100%}canvas{display:block;width:100%;max-width:900px;background:#101722;border-radius:12px}dialog{color:inherit;width:min(92vw,500px);max-height:90dvh}dialog label{display:grid;gap:5px;margin:10px 0}dialog label:has([type=checkbox]){display:flex}dialog::backdrop{background:#080b11bf}#events{color:var(--muted);line-height:1.65}
@media(max-width:950px){#slots{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:490px){#slots{grid-template-columns:minmax(0,1fr)}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}}

.scale-illustration{width:100%;height:86px;display:block;color:var(--mint);margin:0 0 10px;background:#111925;border-radius:12px}
.scale-illustration .case{fill:#263849;stroke:#687b8e}.scale-illustration .pan{fill:#445e6c;stroke:#9db6c3}.scale-illustration .dial{fill:#101923;stroke:#8ea6b6}.scale-illustration .ticks{stroke:#8ea6b6}.scale-illustration .needle{stroke:currentColor;stroke-width:2.5}.mismatch .scale-illustration{color:#ffaba5}
}

@media (prefers-reduced-motion:no-preference){
  .ico-scales.tap path:nth-child(1){animation:scales-case .62s ease-out;transform-origin:50% 80%}
  .ico-scales.tap path:nth-child(3){animation:scales-needle .72s ease-out;transform-box:view-box;transform-origin:50% 66.6667%}
}
@keyframes scales-case{30%{transform:scale(1.08,.88)}65%{transform:scale(.97,1.05)}}
@keyframes scales-needle{30%{transform:rotate(34deg)}56%{transform:rotate(-18deg)}80%{transform:rotate(6deg)}}

.scales-shell .weight-delta {
  min-height: 1.4em;
  margin-top: 5px;
  color: #97f1cc;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.scales-shell .weight-changed {
  outline: 2px solid #97f1cc;
  outline-offset: -3px;
}
.scales-shell .weight-changed.mismatch {
  outline-color: #ffaba5;
}
.scales-shell .mismatch .weight-delta {
  color: #ffaba5;
}
@media (prefers-reduced-motion: no-preference) {
  .scales-shell .weight-changed {
    animation: scale-reading-pulse .8s ease-out;
  }
}
@keyframes scale-reading-pulse {
  25% { filter: brightness(1.4); }
}

.scales-shell {
  --surface:var(--card);
  --mint:var(--good);
  color:var(--fg);
  color-scheme:inherit;
  font-family:var(--sans);
  background:transparent;
  & .hero {padding:40px 0 28px;text-align:left}
  & .hero p {color:var(--muted);font-family:var(--mono);font-size:.8rem}
  & h1 {margin:5px 0 0;font-family:var(--serif);font-style:italic;font-size:clamp(2.7rem,6vw,4.5rem)}
  & article {background:var(--bg)}
  & article:hover {background:var(--card)}
  & article strong {font-family:var(--mono)}
  & .slot-icon {background:var(--card);color:var(--fg)}
  & .scale-illustration {background:var(--card);color:var(--good)}
  & .scale-illustration .case,& .scale-illustration .pan {fill:var(--faint);stroke:var(--soft)}
  & .scale-illustration .dial {fill:var(--bg);stroke:var(--soft)}
  & .scale-illustration .ticks,& .scale-illustration .platform path {stroke:var(--soft)}
  & button,& input {background:var(--bg);border-color:var(--line);color:var(--fg)}
  & button:hover {background:var(--card)}
  & .mismatch,& .mismatch:hover {background:var(--alert-soft);box-shadow:inset 0 2px var(--alert)}
  & .mismatch p,& .mismatch .slot-icon,& .mismatch .scale-illustration,& .mismatch .weight-delta {color:var(--alert)}
  & .mismatch .slot-icon {background:var(--alert-soft)}
  & .weight-delta {color:var(--good)}
  & .weight-changed {outline-color:var(--good)}
  & .weight-changed.mismatch {outline-color:var(--alert)}
  & dialog {background:var(--bg)}
  & dialog::backdrop {background:var(--shade)}
  & #status {color:var(--alert)}
  & #history {background:var(--card)}
  & .weight-tools {display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px}
  & .weight-plot {position:relative}
  & canvas {width:100%;height:280px;max-width:none;background:var(--bg);border:1px solid var(--line);cursor:grab;touch-action:pan-y}
  & canvas:active {cursor:grabbing}
  & #weight-tooltip {position:absolute;top:10px;pointer-events:none;background:var(--bg);color:var(--fg);border:1px solid var(--line);border-radius:8px;padding:5px 8px;font:12px var(--mono)}
}

.scales-shell #slots article { position: relative; }
.scales-shell #slots .weight-changed { outline: none; }
.scales-shell #slots .weight-changed::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid var(--good);
  border-radius: 15px;
  pointer-events: none;
}
.scales-shell #slots .weight-changed.mismatch::after {
  border-color: var(--alert);
}

.scales-shell #slots strong {display:grid;overflow:hidden;min-height:1.12em}
.scales-shell #slots strong > span {grid-area:1 / 1}
.scales-shell #slots .weight-characters {display:flex; flex-wrap:wrap; white-space:pre}
.scales-shell #slots .weight-character {display:inline-grid; overflow:hidden; white-space:pre}
.scales-shell #slots .weight-character > span {grid-area:1 / 1}
.scales-shell #slots .weight-changed.weight-loss::after {border-color:#e69330}
.scales-shell #slots .weight-loss .weight-delta {color:#b36a14}
:root[data-theme="dark"] .scales-shell #slots .weight-loss .weight-delta {color:#ffb765}
.scales-shell dialog#history {margin:auto;width:min(1180px,calc(100% - 28px));max-height:90dvh;padding:clamp(16px,3vw,32px);background:var(--bg);box-shadow:0 24px 90px #0005}
.scales-shell #history::backdrop {backdrop-filter:blur(6px)}
.scales-shell .weight-head {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}
.scales-shell .weight-head h2 {margin:0;font:italic 600 clamp(26px,4vw,44px) var(--serif)}
.scales-shell #weight-close {font-size:24px;line-height:1}
.scales-shell #history .weight-live {display:flex;align-items:center;align-self:center;gap:7px}
.scales-shell #history canvas {background:var(--card)}
.scales-shell #slots strong {display:flex;gap:.4em;align-items:baseline;max-width:100%}
.scales-shell #slots .weight-number {min-width:0}
.scales-shell .weight-guide {display:flex;align-items:center;flex-wrap:wrap;gap:10px 20px;margin:12px 0;color:var(--muted);font-size:.8rem}
.scales-shell #weight-step {width:7em;margin-left:4px}
.scales-shell .weight-key::before {content:'';display:inline-block;width:15px;height:2px;background:var(--good);margin:0 6px 3px 0}
.scales-shell .weight-band::before {height:8px;margin-bottom:0;background:color-mix(in oklab,var(--good) 20%,transparent)}
