#tool-root .mzt {
  --mzt-accent: var(--grass);
  --mzt-ink: var(--site-fg);
  max-width: 980px;
  color: var(--mzt-ink);
}

#tool-root .mzt-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(250px, .78fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 20px 54px -38px rgba(0, 0, 0, .7);
}

#tool-root .mzt-main { padding: clamp(20px, 4vw, 38px); }
#tool-root .mzt-summary {
  padding: clamp(20px, 3vw, 32px);
  background:
    linear-gradient(145deg, rgba(16, 185, 129, .08), transparent 58%),
    var(--surface-2);
  border-inline-start: 1px solid var(--line);
}

#tool-root .mzt-heading { margin-bottom: 22px; }
#tool-root .mzt-kicker {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--mzt-accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
}
#tool-root .mzt-heading h2 { margin: 0 0 7px; font-size: clamp(21px, 3vw, 30px); line-height: 1.2; }
#tool-root .mzt-heading p { margin: 0; color: var(--fg-muted); }

#tool-root .mzt-drop {
  min-height: 218px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 25px;
  text-align: center;
  cursor: pointer;
  border: 1px dashed var(--line-strong);
  border-radius: 5px;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    repeating-linear-gradient(135deg, transparent 0 9px, rgba(16, 185, 129, .04) 9px 10px);
  transition: border-color 140ms, transform 140ms, background-color 140ms;
}
#tool-root .mzt-drop:hover,
#tool-root .mzt-drop:focus-within,
#tool-root .mzt-drop.is-dragging {
  border-color: var(--mzt-accent);
  background-color: rgba(16, 185, 129, .05);
  transform: translateY(-1px);
}
#tool-root .mzt-drop input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
#tool-root .mzt-drop strong { margin-top: 10px; font-size: 16px; }
#tool-root .mzt-drop > span:not(.mzt-cube):not(.mzt-browse) { color: var(--fg-muted); font-size: 13px; }
#tool-root .mzt-browse {
  margin-top: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--mzt-ink);
  font-size: 13px;
  font-weight: 700;
}

#tool-root .mzt-cube { position: relative; inline-size: 46px; block-size: 46px; transform: rotate(30deg) skewY(-15deg) scale(.84); }
#tool-root .mzt-cube i { position: absolute; inset: 0; display: block; border: 2px solid var(--mzt-accent); background: rgba(16, 185, 129, .1); }
#tool-root .mzt-cube i:nth-child(2) { transform: translate(23px, 13px) skewY(30deg) scaleX(.86); opacity: .65; }
#tool-root .mzt-cube i:nth-child(3) { transform: translate(-23px, 13px) skewY(30deg) scaleX(.86); opacity: .38; }

#tool-root .mzt-selected {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
}
#tool-root .mzt-selected[hidden] { display: none; }
#tool-root .mzt-file-icon {
  display: grid;
  place-items: center;
  inline-size: 40px;
  block-size: 44px;
  flex: 0 0 auto;
  background: var(--grass-deep);
  border: 1px solid var(--line-strong);
  color: var(--grass-bright);
  font: 800 17px var(--font-mono);
}
#tool-root .mzt-file-copy { min-width: 0; flex: 1; display: grid; }
#tool-root .mzt-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tool-root .mzt-file-copy small { color: var(--fg-muted); }

#tool-root .mzt-target { margin: 18px 0; padding: 0; border: 0; }
#tool-root .mzt-target legend { margin-bottom: 9px; font-size: 12px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; }
#tool-root .mzt-target { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
#tool-root .mzt-target legend { grid-column: 1 / -1; }
#tool-root .mzt-target label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  cursor: pointer;
}
#tool-root .mzt-target label:has(input:checked) { border-color: var(--mzt-accent); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .16); }
#tool-root .mzt-target input { margin-top: 4px; }
#tool-root .mzt-target span { display: grid; gap: 2px; }
#tool-root .mzt-target small { color: var(--fg-muted); font-size: 12px; line-height: 1.35; }

#tool-root .mzt-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#tool-root .mzt-actions button,
#tool-root .mzt-actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  text-decoration: none;
  font: 700 14px var(--font-ui);
  cursor: pointer;
}
#tool-root .mzt-actions .mzt-primary,
#tool-root .mzt-download { color: #04120c; background: var(--mzt-accent); border-color: var(--mzt-accent); }
#tool-root .mzt-actions button:disabled { cursor: not-allowed; opacity: .45; }
#tool-root .mzt-actions [hidden] { display: none; }

#tool-root .mzt-progress { height: 6px; margin-top: 14px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
#tool-root .mzt-progress[hidden] { display: none; }
#tool-root .mzt-progress i { display: block; width: 0; height: 100%; background: var(--mzt-accent); transition: width 140ms linear; }
#tool-root .mzt-status { min-height: 23px; margin: 9px 0 0; color: var(--fg-muted); font-size: 13px; }
#tool-root .mzt-status.is-error { color: var(--redstone); }
#tool-root .mzt-status.is-success { color: var(--grass-bright); }

#tool-root .mzt-summary-empty { min-height: 100%; display: grid; align-content: center; gap: 16px; }
#tool-root .mzt-summary-empty > span { color: var(--mzt-accent); font-size: 30px; }
#tool-root .mzt-summary-empty p { margin: 0; color: var(--fg-muted); font-size: 13px; line-height: 1.65; }
#tool-root .mzt-summary dl { display: grid; gap: 0; margin: 0; }
#tool-root .mzt-summary dl[hidden] { display: none; }
#tool-root .mzt-summary dl > div { padding: 13px 0; border-bottom: 1px solid var(--line); }
#tool-root .mzt-summary dt { color: var(--fg-muted); font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
#tool-root .mzt-summary dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 700; }

#tool-root .mzt-failures { margin-top: 15px; padding: 13px; border: 1px solid rgba(239, 68, 68, .32); border-radius: 4px; background: rgba(239, 68, 68, .06); }
#tool-root .mzt-failures[hidden] { display: none; }
#tool-root .mzt-failures h3 { margin: 0 0 8px; font-size: 14px; }
#tool-root .mzt-failures ul { margin: 0; padding-inline-start: 20px; color: var(--fg-muted); font-size: 12px; }
#tool-root .mzt-failures code { direction: ltr; unicode-bidi: isolate; }

#tool-root .mzt-explain { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
#tool-root .mzt-explain article {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}
#tool-root .mzt-explain article > span { color: var(--mzt-accent); font: 800 12px var(--font-mono); }
#tool-root .mzt-explain h2 { margin: 0 0 7px; font-size: 15px; }
#tool-root .mzt-explain p { margin: 0; color: var(--fg-muted); font-size: 13px; line-height: 1.6; }
#tool-root .mzt-explain .mzt-loader-note { margin-top: 9px; color: var(--mzt-ink); font-weight: 650; }

[dir="rtl"] #tool-root .mzt { direction: rtl; }
[dir="rtl"] #tool-root .mzt-summary { border-inline-start: 1px solid var(--line); }
[dir="rtl"] #tool-root .mzt-kicker {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] #tool-root .mzt-file-copy,
[dir="rtl"] #tool-root .mzt-summary dd { unicode-bidi: plaintext; }

@media (max-width: 760px) {
  #tool-root .mzt-workbench { grid-template-columns: 1fr; }
  #tool-root .mzt-summary { border-inline-start: 0; border-top: 1px solid var(--line); }
  #tool-root .mzt-summary-empty { min-height: 120px; }
  #tool-root .mzt-summary dl { grid-template-columns: 1fr 1fr; column-gap: 18px; }
  #tool-root .mzt-explain { grid-template-columns: 1fr; }
}

@media (max-width: 470px) {
  #tool-root .mzt-main { padding: 17px; }
  #tool-root .mzt-drop { min-height: 190px; padding: 18px 12px; }
  #tool-root .mzt-target { grid-template-columns: 1fr; }
  #tool-root .mzt-summary dl { grid-template-columns: 1fr; }
  #tool-root .mzt-actions > * { width: 100%; }
}
