/* Bolha Motors' atelier (#274, parts 5 and 5b): the «Ателье» button while your car is in the bay, and the screen (bolha-atelier.js)
   as a game garage: a thin bar on top, the category rail on the left, the tiles of one category along the bottom, the stats and the
   white work order on the right; the car is the picture between them. On a phone a bottom sheet (rail as tabs, tiles, order) with
   the car seen above it (bolha.js shifts the camera off the sheet). Tokens: graphite panels, steel tiles, chalk text, gold choice;
   the plate's red and blue only on the order. */
#atelier-open{position:fixed;left:50%;bottom:128px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:10px 16px;border:1px solid #ffb54799;border-radius:10px;background:#1d2128e6;color:#ffb547;font:800 15px system-ui;box-shadow:0 6px 18px #0005;z-index:15;cursor:pointer}
#atelier-open[hidden]{display:none}#atelier-open svg{width:20px;height:20px}
@media(pointer:coarse),(max-width:600px){#atelier-open{bottom:209px}}
.atelier{--graph:#15181dd9;--steel:#2a3038;--chalk:#e9ecef;--dim:#98a2ad;--gold:#e8b04a;--red:#c4262e;--blue:#1b2d68;position:fixed;inset:0;pointer-events:none;color:var(--chalk);font:14px/1.35 system-ui;z-index:60}
.atelier>*{pointer-events:auto}
.atelier[hidden],.atelier [hidden]{display:none!important}
/* While it is open the car is the picture: the HUD over it (the game's title over the atelier's own brand, profile, chat, speed board, pedals, stick, action, help, phone) goes. */
body.atelier-open :is(#brand,#bolha-profile,#bolha-public-chat,#drive-hud,#drive-pad,#stick,#action,#help,#phone-unfold){display:none!important}
.atelier button{font:inherit;color:inherit;cursor:pointer}
.atelier :focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.bar-top{position:absolute;left:0;right:0;top:0;height:56px;display:flex;align-items:center;gap:16px;padding:0 16px;background:linear-gradient(#15181df2,#15181d00);pointer-events:none}
.bar-top>*{pointer-events:auto}
.brand{display:flex;align-items:baseline;gap:8px;font:600 15px Oswald,system-ui;letter-spacing:.2em}
.brand .script{font:400 28px "Kaushan Script",cursive;letter-spacing:0;color:var(--gold)}
.balance{margin-left:auto;font:500 16px Oswald,system-ui;letter-spacing:.04em}
.atelier-close{width:36px;height:36px;border:0;border-radius:8px;background:#15181d99;color:var(--dim);font:22px/1 system-ui}
.atelier-close:hover{color:#fff;background:var(--steel)}
.rail{position:absolute;left:16px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:4px;padding:6px;background:var(--graph);border-radius:12px;width:132px}
.catb{position:relative;display:grid;grid-template-columns:22px 1fr;gap:4px 8px;align-items:center;text-align:left;padding:8px 10px;border:1px solid transparent;border-radius:8px;background:none;line-height:1.15}
.catb svg{width:20px;height:20px;grid-row:span 2;stroke:currentColor;fill:none;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.catb span{font-size:13px}
.catb kbd{position:absolute;right:8px;top:6px;font:500 10px Oswald,system-ui;color:var(--dim)}
.catb i{position:absolute;right:8px;bottom:8px;width:7px;height:7px;border-radius:50%;background:var(--gold)}
.catb:hover{background:#ffffff0f}
.catb.on{background:var(--steel);border-color:var(--gold);color:var(--gold)}
.strip{position:absolute;bottom:16px;left:164px;right:356px;width:max-content;max-width:calc(100vw - 520px);margin:0 auto;padding:12px;background:var(--graph);border-radius:14px}
.cat{display:flex;gap:16px;align-items:center}
.cat .rows{display:flex;flex-direction:column;gap:8px;min-width:0}
.line{display:grid;grid-template-columns:78px 1fr;gap:10px;align-items:center;padding:2px 4px;border-left:2px solid transparent}
.line.cur{border-left-color:var(--gold)}
.lname{font-size:12px;color:var(--dim)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:104px;padding:9px 12px;border:1px solid #ffffff14;background:var(--steel);border-radius:10px;font-size:14px;text-align:left}
.chip small{font:500 12px Oswald,system-ui;letter-spacing:.03em;color:var(--dim)}
.chip:hover{background:#343b45}
.chip.on{border-color:var(--gold);box-shadow:0 0 0 1px var(--gold) inset}
.chip.on small{color:var(--gold)}
.chip.dice{flex-direction:row;min-width:0;align-items:center}
.cat[data-title="Мотор и ходовая"] .chip{min-width:84px;padding:5px 10px}
.swatches{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sw{width:30px;height:30px;border-radius:50%;border:2px solid #0000;outline:1px solid #ffffff33;padding:0}
.sw.factory{outline:1px dashed #ffffffaa}
.sw.on{border-color:#fff;box-shadow:0 0 0 2px var(--gold)}
.atelier input[type=color]{width:34px;height:30px;border:0;background:none;padding:0;cursor:pointer}
.atelier input[type=text]{background:#0e1115;border:1px solid #ffffff22;color:var(--chalk);border-radius:8px;padding:7px 10px;font:600 16px Oswald,sans-serif;letter-spacing:.12em;width:150px}
.atelier .plate-field{text-transform:uppercase}
.atelier .row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chip-note{color:var(--gold);font-size:12px}
.atelier-plate{width:150px;flex:none;filter:drop-shadow(0 4px 10px #0008)}
.side{position:absolute;right:16px;top:64px;bottom:16px;width:324px;display:flex;flex-direction:column;gap:12px}
.stats{background:var(--graph);border-radius:12px;padding:12px 14px}
.stats h2{margin:0 0 6px;font:500 14px Oswald,system-ui;letter-spacing:.06em}
.bar{display:grid;grid-template-columns:112px 1fr 56px;gap:8px;align-items:center;font-size:12px;color:var(--dim);margin:5px 0}
.bar i{display:block;height:6px;background:var(--steel);border-radius:3px;position:relative;overflow:hidden}
.bar i b{position:absolute;inset:0 auto 0 0;background:#6fa8dc;border-radius:3px}
.bar i b.up{background:linear-gradient(90deg,#6fa8dc 0 var(--base),var(--gold) var(--base))}
.bar span{text-align:right;color:var(--chalk)}
.slip{flex:1;min-height:0;display:flex;flex-direction:column;background:#fbfbf8;color:#16181c;border-radius:6px;box-shadow:0 8px 24px #0006;padding:0 14px 12px;overflow:hidden}
.slip-head{margin:0 -14px 8px;padding:9px 14px;background:var(--red);color:#fff;display:flex;justify-content:space-between;align-items:baseline}
.slip-head b{font:600 17px Oswald,system-ui;letter-spacing:.08em}.slip-head span{font-size:12px;opacity:.9}
.slip-lines{list-style:none;margin:0;padding:0;overflow:auto;flex:1;min-height:40px}
.slip-lines li{display:grid;grid-template-columns:1fr auto auto;gap:0 8px;align-items:baseline;padding:6px 0;border-bottom:1px dashed #0002}
.slip-lines .ln{font-weight:600}
.slip-lines small{grid-column:1;grid-row:2;color:#5b636c}
.slip-lines b{grid-row:1/3;grid-column:2;font:500 16px Oswald,system-ui;color:var(--blue);align-self:center}
.slip-lines .undo{grid-row:1/3;grid-column:3;width:24px;height:24px;border:0;border-radius:50%;background:#0000000f;color:#5b636c;font-size:16px;line-height:1;align-self:center}
.slip-lines .undo:hover{background:var(--red);color:#fff}
.slip-lines .empty{display:block;color:#7a828a;border:0}
.slip-total{display:flex;justify-content:space-between;align-items:baseline;padding:10px 0 8px;font:500 15px Oswald,system-ui;letter-spacing:.04em}
.slip-total b{font-size:24px;color:var(--blue)}
.buy{border:0;border-radius:9px;padding:11px 16px;background:var(--gold);color:#1b1408;font:600 15px system-ui}
.buy:disabled{opacity:.45;cursor:default}
.atelier-hint{color:var(--red);font-size:12px;margin-top:6px}.atelier-hint:empty{display:none}
.reset{margin-top:8px;border:0;background:none;color:#5b636c;text-decoration:underline;font-size:13px}.reset:disabled{opacity:.4;cursor:default}
@media(max-width:1180px){.strip{right:340px;max-width:calc(100vw - 500px)}}
@media(max-width:767px){.atelier{inset:auto 0 0 0;max-height:55dvh;overflow:auto;pointer-events:auto;background:#15181df2;border-radius:16px 16px 0 0;box-shadow:0 -12px 40px #0006;padding:8px 12px 12px;display:flex;flex-direction:column;gap:10px}
 .bar-top,.rail,.strip,.side{position:static;transform:none;width:auto;max-width:none;margin:0;background:none;padding:0}
 .bar-top{height:auto;background:none;gap:8px}.brand .script{font-size:22px}.balance{font-size:13px}
 .rail{flex-direction:row;overflow-x:auto;gap:6px;flex:none}.catb{flex:none;grid-template-columns:auto;grid-template-rows:auto auto;justify-items:center;padding:6px 8px;width:auto}.catb svg{grid-row:auto}.catb span{font-size:11px;white-space:nowrap}.catb kbd{display:none}
 .cat{flex-direction:column;align-items:stretch;gap:8px}.atelier-plate{width:120px}.line{grid-template-columns:1fr}.chip{min-width:88px;padding:7px 10px}
 .side{display:block}.stats{display:none}.slip{box-shadow:none;margin-top:6px}.slip-lines{max-height:120px}}
