/* ============================================================
   Mabuy Tools — shared shell theme
   Layered ON TOP of ../../system/css/style.css so every tool
   shares the exact same "Aurora Canopy" theme as the dashboard
   (light + dark via html[data-theme], keys: localStorage.hes_theme)
   ============================================================ */

.tool-topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
  background: var(--surface);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1.5px solid var(--border);
  box-shadow: var(--shadow-xs);
}
body.embedded .tool-topbar { display: none; }

.tool-topbar .brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
}
.tool-topbar .brand-icon {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: var(--primary-grad); box-shadow: var(--shadow-sm); flex-shrink: 0;
}
.tool-topbar .brand-icon svg { width: 22px; height: 22px; }
.tool-topbar .brand-text { line-height: 1.15; }
.tool-topbar .brand-title { font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.tool-topbar .brand-sub { font-size: 10.5px; color: var(--text-faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.tool-topbar .tool-name {
  font-weight: 800; font-size: 14.5px; padding: 6px 12px;
  background: var(--surface-alt-solid); border: 1.5px solid var(--border); border-radius: 999px;
  color: var(--text); white-space: nowrap;
}
.tool-topbar .spacer { flex: 1; }
.tool-topbar .btn { text-decoration: none; }

/* theme pill button (mirrors dashboard's .theme-pill) */
.tool-theme-btn { border: none; cursor: pointer; font-family: inherit; }

.tool-main { max-width: 1200px; margin: 0 auto; padding: 26px 24px 80px; }
body.embedded .tool-main { padding-top: 18px; }

.eyebrow {
  color: var(--brass-dark); font-weight: 800; font-size: 11.5px;
  letter-spacing: 0.12em; text-transform: uppercase;
}
.tool-h2 { font-size: 24px; margin: 8px 0 6px; color: var(--text); letter-spacing: -0.02em; }
.tool-lead { color: var(--text-muted); max-width: 640px; font-size: 13.5px; line-height: 1.6; margin: 0; }

.panel {
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--glass-edge);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
}
.panel-pad { padding: 20px; }

.tool-grid { display: grid; gap: 18px; margin-top: 22px; }
.tool-grid.cols-2 { grid-template-columns: 1.15fr 0.85fr; }
.tool-grid.cols-even { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .tool-grid.cols-2, .tool-grid.cols-even { grid-template-columns: 1fr; } }

/* -------- shared field styling (tools re-use dashboard .field) -------- */
.tool-field label,
.field label { display: block; font-weight: 700; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.tool-input, .tool-select, .tool-textarea {
  width: 100%; padding: 9px 12px; font-size: 13.5px; font-family: inherit;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface-alt-solid); color: var(--text); transition: border .15s, box-shadow .15s;
}
.tool-input:focus, .tool-select:focus, .tool-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(18,179,129,0.18);
}

/* -------- dropzone -------- */
.tool-drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-alt); cursor: pointer; text-align: center;
  padding: 30px 20px; transition: all .18s ease;
}
.tool-drop:hover { border-color: var(--primary); background: var(--surface-hover); }
.tool-drop.drag { border-color: var(--primary); background: var(--primary-light); transform: scale(1.005); }
.tool-drop .dz-icon {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: var(--brass-grad); color: #211705; box-shadow: var(--shadow-glow);
}
.tool-drop .dz-title { font-weight: 700; font-size: 15px; color: var(--text); }
.tool-drop .dz-sub { color: var(--text-muted); font-size: 12.5px; margin-top: 4px; }
.dz-formats { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fmt {
  font-size: 10.5px; font-weight: 800; padding: 4px 8px; border-radius: 7px;
  background: var(--surface-alt-solid); color: var(--text-muted); border: 1px solid var(--border);
}
.fmt.ppt { background: var(--red-light); color: var(--red); border-color: var(--border); }
.fmt.word { background: var(--purple-light); color: var(--purple); border-color: var(--border); }
.fmt.excel { background: var(--green-light); color: var(--green); border-color: var(--border); }
.fmt.pdf { background: var(--brass-light); color: var(--brass-dark); border-color: var(--border); }
.fmt.img { background: var(--accent-light); color: var(--accent); border-color: var(--border); }

/* -------- progress -------- */
.tool-progress { height: 6px; background: var(--surface-alt-solid); border-radius: 999px; overflow: hidden; }
.tool-progress i { display: block; height: 100%; width: 0%; background: var(--primary-grad); border-radius: 999px; transition: width .25s; }
.status-line { font-size: 12.5px; color: var(--text-muted); font-weight: 600; min-height: 17px; }
.status-line.ok { color: var(--primary-dark); }
.status-line.err { color: var(--red); }

/* common small pieces */
.pill-live {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--primary-light); color: var(--primary-dark); font-size: 11px; font-weight: 800;
}
.pill-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: toolpulse 1.5s infinite; }
@keyframes toolpulse { 0% {opacity:1;} 50% {opacity:.35;} 100% {opacity:1;} }

.badge-good { background: var(--green-light); color: var(--green); }
.badge-neutral { background: var(--surface-alt-solid); color: var(--text-muted); }
.badge-bad { background: var(--amber-light); color: var(--amber); }
.badge-err { background: var(--red-light); color: var(--red); }
.tbadge { font-weight: 800; font-size: 11.5px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }

.mono-box {
  background: var(--surface-alt-solid); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.6;
  color: var(--text); padding: 14px; overflow-x: auto;
}

.hint-box {
  background: var(--accent-light); border: 1px solid var(--border-strong); color: var(--text);
  padding: 11px 13px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55;
}

.tool-footer-note {
  text-align: center; color: var(--text-faint); font-size: 11.5px; padding: 24px;
}

/* ---- iframe fix: background-attachment:fixed breaks inside iframes ---- */
html, body {
  background-attachment: scroll !important;
  background-size: cover !important;
  min-height: 100vh;
}
