/* Armor Trim tool: every rule scoped under #tool, colours from the site tokens only. */
#tool .atg{font-family:var(--fb);color:var(--ink);display:grid;gap:14px}
#tool .atg *{box-sizing:border-box}
#tool .atg [hidden]{display:none !important}
#tool .atg-layout{display:grid;gap:14px;grid-template-columns:minmax(0,1fr)}
#tool .atg-side{display:grid;gap:14px;align-content:start;min-width:0}
@media (min-width:720px){
  #tool .atg-layout{grid-template-columns:minmax(0,300px) minmax(0,1fr)}
  #tool .atg-stage{position:sticky;top:12px;align-self:start}
}
#tool .atg-card{border:1px solid var(--line);border-radius:16px;background:var(--card);padding:14px;min-width:0}
#tool .atg-card h2{font:700 17px/1.2 var(--fh);margin:16px 0 8px;color:var(--ink)}
#tool .atg-card h2:first-child{margin-top:0}
#tool .atg-card h3{font:700 15px/1.25 var(--fh);margin:14px 0 8px;color:var(--ink)}
#tool .atg-hint{color:var(--soft);font-size:14px;line-height:1.45;margin:8px 0 0}
#tool .atg-note{font-size:14.5px;line-height:1.5;margin:0 0 4px;background:var(--soft-bg);border-left:3px solid var(--go);padding:8px 12px;border-radius:8px}

/* buttons */
#tool button{font:inherit;color:inherit}
#tool button.go{border:0;cursor:pointer;color:#fff}
#tool button.go:disabled{opacity:.5;cursor:default}
#tool .atg-btn,#tool .atg-vbtn,#tool .atg-chip,#tool .atg-tabs button{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:0 12px;
  border:1px solid var(--line);border-radius:10px;background:var(--soft-bg);color:var(--ink);
  font:600 14px var(--fb);cursor:pointer;user-select:none;-webkit-user-select:none}
#tool .atg-btn:hover,#tool .atg-vbtn:hover,#tool .atg-chip:hover,#tool .atg-opt:hover:not(:disabled),#tool .atg-tabs button:hover{border-color:var(--go)}
#tool button[aria-pressed=true]{background:var(--chip);border-color:var(--go)}
#tool button:focus-visible,#tool .atg-file:focus-within,#tool input:focus-visible{outline:2px solid var(--go);outline-offset:2px}

/* stage */
#tool .atg-view{position:relative;aspect-ratio:5/6;max-height:62vh;width:100%;border-radius:12px;background:var(--soft-bg);overflow:hidden;display:flex;align-items:center;justify-content:center}
#tool .atg-canvas{display:block;width:100%;height:100%;touch-action:pan-y;cursor:grab}
#tool .atg-canvas:active{cursor:grabbing}
#tool .atg-loading{color:var(--soft);font-size:14px;text-align:center;padding:0 18px;margin:0}
#tool .atg-viewbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr)) 36px 36px;gap:5px;margin:10px 0 0}
#tool .atg-vbtn{min-height:36px;padding:0 4px;font-size:13.5px;white-space:nowrap}
#tool .atg-sq{padding:0;font-size:18px}
#tool .atg-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:10px 0 0}
#tool .atg-actions .go{grid-column:1/-1}
#tool .atg-die{font-size:20px;line-height:1}
#tool .atg-msg{min-height:20px;margin:8px 0 0;font-size:14px;color:var(--soft)}

/* piece tabs */
#tool .atg-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
#tool .atg-tabs button{flex-direction:column;gap:2px;min-height:54px;padding:4px 2px;font:700 13px var(--fh)}
#tool .atg-tabs button[aria-pressed=true]{background:var(--go);border-color:var(--go);color:#fff}
#tool .atg-all{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:6px;border:2px solid currentColor;font:700 12px var(--fh)}

/* option grids */
#tool .atg-ic{width:32px;height:32px;image-rendering:pixelated;image-rendering:crisp-edges;flex:none}
#tool .atg-tabs .atg-ic{width:24px;height:24px}
#tool .atg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:6px}
#tool .atg-opt{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:64px;padding:6px 2px;
  border:1px solid var(--line);border-radius:10px;background:var(--card);cursor:pointer;font:600 12.5px/1.15 var(--fb);color:var(--ink);text-align:center}
#tool .atg-opt span{overflow-wrap:anywhere}
#tool .atg-opt:disabled{opacity:.45;cursor:default}
#tool .atg-none{width:28px;height:28px;border-radius:50%;border:2px dashed var(--soft);display:block}

/* leather colour */
#tool .atg-dyebox{margin:12px 0 0;padding:10px 12px;border-radius:12px;background:var(--soft-bg)}
#tool .atg-dyebox h3{margin:0 0 8px}
#tool .atg-dyes{display:grid;grid-template-columns:repeat(auto-fill,minmax(30px,1fr));gap:6px}
#tool .atg-dye{height:30px;border-radius:8px;border:2px solid var(--line);background:var(--sw);cursor:pointer;padding:0}
#tool .atg-dye[aria-pressed=true]{border-color:var(--ink);box-shadow:0 0 0 2px var(--card) inset;background:var(--sw)}
#tool .atg-custom{display:inline-flex;align-items:center;gap:8px;margin:10px 0 0;font-size:14px;font-weight:600}
#tool input[type=color]{width:44px;height:34px;padding:2px;border:1px solid var(--line);border-radius:9px;background:var(--card);cursor:pointer}

/* skin */
#tool .atg-skins{display:flex;flex-wrap:wrap;gap:7px}
#tool .atg-chip{border-radius:99px;padding:0 13px 0 6px;min-height:40px}
#tool .atg-face{width:26px;height:26px;border-radius:5px;image-rendering:pixelated;image-rendering:crisp-edges}
#tool .atg-file{position:relative;overflow:hidden;padding:0 13px}
#tool .atg-file input{position:absolute;inset:0;opacity:0;cursor:pointer;font-size:0;width:100%}

/* Bedrock recipe */
#tool .atg-steps{list-style:none;margin:0;padding:0;display:grid;gap:8px}
#tool .atg-step{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:8px;border:1px solid var(--line);border-radius:12px}
#tool .atg-step p{margin:0;font-size:14.5px;line-height:1.4;flex:1 1 180px;min-width:0}
#tool .atg-slots3{display:flex;align-items:center;gap:3px;flex:none}
#tool .atg-slot{width:40px;height:40px;display:flex;align-items:center;justify-content:center;border-radius:6px;background:var(--soft-bg);border:1px solid var(--line)}
#tool .atg-slot.atg-empty{opacity:.5}
#tool .atg-plus{color:var(--soft);font-weight:700}
#tool .atg-need,#tool .atg-where,#tool .atg-notes{list-style:none;margin:0;padding:0;display:grid;gap:6px}
#tool .atg-need li{display:flex;align-items:center;gap:8px;font-size:14.5px}
#tool .atg-need .atg-ic{width:24px;height:24px}
#tool .atg-where li{padding:8px 10px;border-radius:12px;background:var(--soft-bg)}
#tool .atg-where-head{display:flex;align-items:center;gap:8px}
#tool .atg-where-head .atg-ic{width:24px;height:24px}
#tool .atg-where p{margin:4px 0 0;font-size:14px;line-height:1.45}
#tool .atg-copy .atg-ic{width:18px;height:18px;vertical-align:-4px}
#tool .atg-copy{color:var(--soft)}
#tool .atg-notes li{font-size:14px;line-height:1.5;padding-left:12px;border-left:3px solid var(--line)}
#tool .atg-offscreen{position:fixed;left:-9999px;top:0;opacity:0}
