/* ============================================================
   MacLeod Pro Tools — v4.4 unified tool shell
   Extends the v4 design system (assets/css/tokens.css + components.css + app.css).
   One shared stylesheet for the shell, toolbar, settings panel,
   guide and directory extras — no per-tool CSS.
   ============================================================ */

/* ---------- Shell header band ---------- */
.tool-shell-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff, var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 12px 18px; margin: 0 0 12px;
  box-shadow: var(--shadow);
}
.tool-shell-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tool-shell-mark {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  font-size: 22px; border-radius: 12px;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold));
  color: var(--ink-on-gold); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 10px rgba(43,52,64,.22);
}
.tool-shell-titles { display: flex; flex-direction: column; min-width: 0; }
.tool-shell-name { font: 700 20px/1.15 var(--font-d); color: var(--text); letter-spacing: .2px; }
.tool-shell-purpose { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.tool-shell-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.tool-shell-crumb a { color: var(--gold); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.tool-shell-crumb a:hover { text-decoration: underline; }

/* in window mode the shell band compresses to fit the window frame */
.ms-win .tool-shell-head { padding: 8px 12px; margin-bottom: 8px; border-radius: var(--r); }
.ms-win .tool-shell-mark { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
.ms-win .tool-shell-name { font-size: 16px; }
.ms-win .tool-shell-purpose { display: none; }

/* ---------- Toolbar ---------- */
.tool-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 8px 10px; margin: 0 0 12px;
  position: sticky; top: 8px; z-index: 30;
  box-shadow: 0 6px 18px rgba(43,52,64,.10);
}
.tool-toolbar-spacer { flex: 1; }
.tool-toolbar .btn[aria-expanded="true"] { border-color: var(--gold); color: var(--gold); }

/* ---------- Settings / guide panel ---------- */
.tool-panel {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 0 0 16px; margin: 0 0 14px;
  overflow: hidden; box-shadow: var(--shadow);
}
.tool-panel-tabs {
  display: flex; gap: 6px; align-items: center;
  background: var(--bg-2); border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}
.tool-tab {
  background: transparent; border: 1px solid transparent; color: var(--muted);
  font: 600 13.5px var(--font); padding: 7px 12px; border-radius: 8px; cursor: pointer;
}
.tool-tab:hover { color: var(--text); }
.tool-tab.is-on { background: var(--panel); border-color: var(--line); color: var(--gold); }
.tool-tab-close { margin-left: auto; }
.tool-tabpane { padding: 16px 18px 0; }

.tool-settings-form { display: grid; gap: 12px; max-width: 560px; }
.tool-set-row { display: grid; gap: 4px; }
.tool-set-label { font-weight: 600; font-size: 14px; }
.tool-set-row select, .tool-set-row input {
  background: var(--field-bg); border: 1.5px solid var(--field-line); color: var(--text);
  border-radius: var(--field-radius); padding: var(--field-pad); font: 400 var(--field-fs) var(--font); max-width: 320px;
}
.tool-set-row select:focus, .tool-set-row input:focus { outline: none; border-color: var(--gold); box-shadow: var(--field-ring); }
.tool-set-hint { color: var(--muted); font-size: 12.5px; }
.tool-set-actions { display: flex; align-items: center; gap: 10px; }
.tool-set-msg { color: var(--ok); font-size: 13px; font-weight: 600; }
.tool-set-note { font-size: 12.5px; margin: 2px 0 0; }

/* ---------- Guide / README typography ---------- */
.tool-guide { max-width: 68ch; }
.tool-guide h4 {
  font: 700 16px var(--font-d); color: var(--gold); margin: 18px 0 6px;
  letter-spacing: .2px;
}
.tool-guide h4:first-child { margin-top: 0; }
.tool-guide p { margin: 0 0 10px; color: var(--text); }
.tool-guide ol, .tool-guide ul { margin: 0 0 12px; padding-left: 22px; }
.tool-guide li { margin-bottom: 5px; }
.tool-guide code {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: 13px; color: var(--gold-deep);
}
.tool-guide strong { color: var(--text); }

/* ---------- Directory extras ---------- */
.tool-card-links { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.tool-card-links a { font-size: 13px; font-weight: 600; }
.tool-forecast {
  margin-top: 10px; padding: 8px 10px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.tool-forecast strong { color: var(--gold); }
.tool-forecast.warn { border-color: #d9b45c; color: #7a5b00; }

/* ---------- Security tool result actions ---------- */
.sec-actions { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.sec-batch-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .tool-shell-purpose { white-space: normal; }
  .tool-toolbar { position: static; }
  .tool-tabpane { padding: 14px 12px 0; }
}
