.cg-garage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: min(100%, 300px);
  padding: 1px 1px 5px;
  color: #fff2d8;
}
.cg-main {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, 1fr);
  gap: clamp(10px, 2vw, 24px);
}
.cg-garage .cg-preview {
  align-self: stretch;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #766075;
  border-radius: 13px;
  background: #2b273d;
}
.cg-poster { position: relative; display: grid; flex: 1 1 auto; min-height: 125px; overflow: hidden; }
.cg-poster canvas { display: block; position: absolute; width:100%; height:100%; object-fit: fill; }
.cg-pins { position: absolute; inset: 0; pointer-events: none; }
.cg-garage button.cg-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: grid;
  width: 29px;
  min-height: 29px;
  height: 29px;
  padding: 0;
  place-items: center;
  border: 1px solid #ffedcf;
  border-radius: 50%;
  background: #292740f5;
  box-shadow: 0 2px 5px #30283d77;
  color: #ffeed0;
  font: 800 15px/1 Arial, sans-serif;
}
.cg-garage .cg-pin::after { position: absolute; inset: -5px; border-radius: 50%; content:''; }
.cg-garage .cg-pin[aria-pressed=true] { border-color: #d5ffe2; background: #83e0c9; color: #23283b; }
.cg-garage .cg-pin:active { transform: translate(-50%, -50%); }
.cg-preview figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 9px 13px; border-top: 1px solid #776378;
}
.cg-preview h2 { font-size: clamp(18px, 2.4vw, 29px); font-weight: 850; line-height: 1.05; letter-spacing: -.04em; }
.cg-route-state { flex: 0 0 auto; font-size: 11px; color: #ccbdc8; }
.cg-info { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cg-budget { display: flex; gap: 10px; align-items:center; justify-content:space-between; font-size: 12px; font-variant-numeric: tabular-nums; }
.cg-budget b { color: #ffd197; }.cg-budget span { color: #aee3cc; }
.cg-branches, .cg-detail-actions, .cg-ride-actions { display:flex; align-items:stretch; gap:5px; }
.cg-garage button.cg-branch,.cg-garage button.cg-vehicle,.cg-garage .cg-detail-actions button,.cg-garage .cg-ride-actions button {
  padding: 5px 8px; min-height: 33px; border-radius: 7px; font-weight: 730; font-size: 12px;
}
.cg-garage button.cg-branch { flex: 1 1 0; padding-inline: 4px; color: #e4d2db; }
.cg-garage .cg-branch[aria-pressed=true],.cg-garage .cg-vehicle[aria-pressed=true] {
  color: #a1f5d7; border-color: #83d8bf; background: #293c43;
}
.cg-detail,.cg-trip { display: flex; flex-direction:column; gap:7px; border:1px solid #51465d; border-radius:10px; padding:10px 12px; background: #2a263d; }
.cg-detail { flex: 1 1 auto; }
.cg-part-head { display:flex; justify-content:space-between; align-items:baseline; gap:6px; }
.cg-part-head h3,.cg-trip h3 { margin:0; font-family:inherit; font-size:clamp(15px,1.9vw,23px); line-height:1.1; font-weight:800; letter-spacing:-.025em; color:#fff2da; }
.cg-part-head span,.cg-change,.cg-installed,.cg-trip p { color:#cebfce; font-size:12px; }
.cg-part-head span { white-space:nowrap; font-size:10px; }
.cg-change { flex:1 1 auto; }
.cg-garage .cg-detail-actions .cg-primary { background:#a2e4d0; color:#202a39; border-color:#a2e4d0; }
.cg-installed { padding-block:5px; color:#9ee1c4; }
.cg-garage .cg-go { background:#e99b8f; border-color: #e99b8f; color:#2b2336; }
.cg-garage .cg-recharge { color:#e3ced6; }
.cg-garage button:disabled { opacity:.48; }
.cg-fleet {
  display:flex;flex-wrap:wrap;gap:5px;align-items:stretch;
}
.cg-garage button.cg-vehicle {
  display:flex; flex-direction:column; gap:1px; align-items:center; justify-content:center;
  width:clamp(78px,12vw,128px); min-width:0; min-height:53px; padding:3px 2px 6px; line-height:1;
}
.cg-vehicle canvas { display:block; width:100%; max-width:105px; height:35px; object-fit:contain; }
.cg-vehicle span { font-size:clamp(10px,1.2vw,13px); }
.cg-note { color:#c0b4c5; font-size:11px; }
.cg-trip { flex:1 1 auto; justify-content:center; }
.cg-trip-kicker { color:#a1dfca; font-size:11px; }
.cg-trip-stats { display:flex; gap: 6px; }
.cg-trip-stats > div { flex:1 1 0; padding:5px 7px; background:#383146; border-radius:5px; }
.cg-trip-stats small,.cg-trip-stats b { display:block; }.cg-trip-stats small {font-size:10px;color:#cfbfcd;}.cg-trip-stats b{font-size:18px;}
.cg-progress { height:4px; width:100%; border-radius:4px; background:#4c3f58; overflow:hidden; }
.cg-progress i { display:block; background: #8de2c5; height:100%; transform-origin:left; animation:cg-drive 1.9s linear both; }
@keyframes cg-drive { from { transform:scaleX(0); } to { transform:scaleX(1); } }
.cg-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media (min-height:600px) {
  .cg-garage { gap:15px; }.cg-main { min-height:265px; }.cg-info{gap:11px;}
  .cg-poster { min-height:188px; }.cg-garage .cg-vehicle{min-height:72px;}
  .cg-vehicle canvas{height:43px;}.cg-detail,.cg-trip{padding:15px;}
  .cg-garage .cg-detail-actions button,.cg-garage .cg-ride-actions button,.cg-garage button.cg-branch{min-height:40px;}
}
@media (max-height:440px) and (orientation:landscape) {
  .cg-garage{gap:6px;}.cg-main{gap:9px;}.cg-info{gap:4px;}
  .cg-detail,.cg-trip{gap:4px;padding:7px 9px;}.cg-preview figcaption{padding:6px 10px;}
  .cg-garage button.cg-branch,.cg-garage .cg-detail-actions button,.cg-garage .cg-ride-actions button {min-height:31px;}
  .cg-garage button.cg-vehicle{min-height:45px;padding:1px 2px 4px;}.cg-vehicle canvas{height:28px;}
}
@media (max-width:680px) {
  .cg-poster{min-height:119px;}.cg-main{grid-template-columns:minmax(0,.92fr) minmax(0,1fr);}
  .cg-part-head{align-items:flex-start;}.cg-part-head h3{font-size:14px;}.cg-route-state{display:none;}
  .cg-note,.cg-budget,.cg-change,.cg-ride-actions button{font-size:10px;}
}
@media (orientation:portrait) and (max-width:650px) {
  .cg-main{grid-template-columns:1fr;}.cg-poster{min-height:150px;}
}
@media (prefers-reduced-motion:reduce) { .cg-progress i {animation-duration:.17s;} }

.cg-garage button { background:#353045; border:1px solid #756076; color:#fff1d8; }
.cg-garage button:focus-visible {outline:2px solid #ffe49e;outline-offset:-2px;}
.cg-garage :is(figure,h2,p) {margin:0;}
.cg-garage .cg-ride-actions {flex-wrap:wrap;}
.cg-empty {min-height:min(100%,325px);display:flex;flex:1;align-items:flex-end;border:1px solid #74606e;border-radius:14px;overflow:hidden;background:linear-gradient(90deg,#18182bdf 0%,#211b3066 58%,#201d2b11),url("assets/chapter-workshop.webp") center 52%/cover;}
.cg-empty > div {max-width:430px;padding:clamp(18px,4vw,50px);text-shadow:0 2px 9px #171321;}
.cg-empty h2 {font:850 clamp(24px,3.8vw,45px)/1.04 var(--display);letter-spacing:-.04em;color:#fff3dc;}
.cg-empty p {font-size:clamp(13px,1.45vw,18px);margin-top:8px;line-height:1.45;color:#f3dfd1;}
