/* LEGACY TOKEN ALIASES: tool.css and the per-tool style.css files were written against the old
   tokens.css names; map them onto the site tokens (home-critical.css). Names the two
   sets share (--text-secondary, --border-strong, --radius-*, --shadow-*, --font-display)
   already come from home-critical.css. Dark mode follows because the targets switch. */
:root {
  --bg: var(--bg-page);
  --bg-card: var(--bg-surface);
  --bg-soft: var(--bg-subtle);
  --text: var(--text-main);
  --text-tertiary: var(--text-muted);
  --primary: var(--brand-primary);
  --primary-hover: var(--brand-primary-hover);
  --primary-soft: var(--brand-primary-soft);
  --primary-border: var(--cat-img-border);
  --accent: var(--brand-primary);
  --success: var(--action-green);
  --success-soft: var(--action-green-soft);
  --danger: #DC2626;
  --danger-soft: #FEF2F2;
  --border: var(--border-light);
  --focus: var(--focus-ring);
  --font: var(--font-sans);
  --radius: var(--radius-lg);
  --card-padding: 1.5rem;
  --btn-py: .75rem;
  --btn-px: 1.25rem;
}
html[data-theme="dark"] {
  --danger: #F87171;
  --danger-soft: rgba(239,68,68,.16);
}
html[data-scale="large"] {
  --card-padding: 1.85rem;
  --btn-py: 1rem;
  --btn-px: 1.5rem;
}
.hidden { display: none !important; }

/* Shared result widgets several tools use (were in app.css) */
.error-message { display: none; margin-top: 6px; color: var(--danger); font-size: .85rem; }
.help-text { margin-top: 6px; color: var(--text-tertiary); font-size: .85rem; }
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.stat-item { padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); text-align: center; }
.stat-value { color: var(--primary); font-size: 1.15rem; font-weight: 800; }
.stat-label { margin-top: 4px; color: var(--text-tertiary); font-size: .8rem; }
.insights-box { margin-top: 14px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
.insights-box h4 { margin-bottom: 4px; font-size: .95rem; }
.insights-box p { color: var(--text-secondary); font-size: .88rem; }

/* Toasts (window.showToast in js/site.js) */
.toast-container { position: fixed; right: 24px; bottom: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 340px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-lg); color: var(--text); font-size: .9rem; font-weight: 500; pointer-events: auto; animation: toastIn .3s ease both; }
.toast.toast-out { animation: toastOut .25s ease both; }
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* Related tools under the workspace (v2 cards from home-v2.css) */
.related-tools { margin: 0 0 32px; }
.related-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 18px; }
.related-head .section-title { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
.related-head a { color: var(--brand-primary); font-weight: 700; font-size: .92rem; text-decoration: none; }
.related-head a:hover { text-decoration: underline; }
.related-tools .tools-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* TOOL-VARIABLES: --t-* aliases used by the per-tool stylesheets */
:root {
  --t-accent: var(--primary);
  --t-accent-light: var(--primary-soft);
  --t-green: var(--success);
  --t-green-light: var(--success-soft);
  --t-red: var(--danger);
  --t-red-light: var(--danger-soft);
  --t-amber: #d97706;
  --t-amber-light: rgba(245,158,11,0.12);
  --t-bg: var(--bg-card);
  --t-bg-card: var(--bg-card);
  --t-border: var(--border);
  --t-border-glass: var(--border);
  --t-radius: var(--radius);
  --t-radius-sm: var(--radius-sm);
  --t-radius-lg: var(--radius-lg);
  --t-font: var(--font);
  --t-mono: 'SF Mono','Fira Code','Cascadia Code','Consolas',monospace;
}

/* ═══════════════════════════════════════════
   TOOL-BASE: shared framework CSS for all tools.
   Solid design tokens only (home-critical.css via the aliases above), no glass, no gradients.
   ═══════════════════════════════════════════ */

/* ── Status Strip ── */
.tool-error-bar,
.tool-processing-bar,
.tool-success-bar {
  display: none;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1rem;
  border-radius: var(--t-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
}
.tool-error-bar.show,
.tool-processing-bar.show,
.tool-success-bar.show {
  display: flex;
  margin-bottom: 1rem;
  animation: toolSlideIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
@keyframes toolSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tool-bar-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}
.tool-bar-dismiss {
  margin-left: auto;
  margin-inline-start: auto;
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-soft);
  color: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}
.tool-bar-dismiss:hover { opacity: 1; background: var(--border); }
.tool-error-bar {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
}
.tool-processing-bar {
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--text);
}
/* Template step 3: green check badge instead of the emoji */
.tool-success-bar {
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  font-weight: 700;
}
.tool-success-bar .tool-bar-icon {
  font-size: 0;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--success);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-success-bar .tool-bar-icon::before {
  content: "\2713";
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

/* ── Spinner ── */
.tool-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: toolSpin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes toolSpin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════
   WORKSPACE: single column, 2 columns once a file is loaded
   ═══════════════════════════════════════════ */
.tool-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: start;
}
.tool-workspace.split-mode {
  grid-template-columns: 1fr 1fr;
}

/* ── Upload Column ── */
.tool-upload-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Dropzone ── */
.tool-dropzone {
  position: relative;
  border: 3px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .25s,background .25s;
  background: var(--bg-soft);
  outline: none;
  overflow: hidden;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}
.tool-dropzone:hover,
.tool-dropzone:focus-visible,
.tool-dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.tool-dropzone.has-file, .tool-dropzone.has-files {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-soft);
  padding: 1.5rem;
  min-height: auto;
}
.tool-dropzone.has-file .tool-drop-btn, .tool-dropzone.has-files .tool-drop-btn { display: none; }
.tool-dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.tool-drop-icon-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.4rem;
}
.tool-dropzone.has-file .tool-drop-icon-wrap, .tool-dropzone.has-files .tool-drop-icon-wrap {
  background: var(--bg-card);
  border-color: var(--success);
}
.tool-drop-icon {
  font-size: 2.2rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.16,1,0.3,1);
}
.tool-dropzone:hover .tool-drop-icon,
.tool-dropzone.dragover .tool-drop-icon {
  transform: translateY(-4px);
}
.tool-drop-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  opacity: 0;
  transition: opacity 0.35s;
}
.tool-dropzone:hover .tool-drop-ring,
.tool-dropzone:focus-visible .tool-drop-ring { opacity: 0.6; }
.tool-dropzone.dragover .tool-drop-ring {
  opacity: 1;
  border-top-color: var(--success);
  border-right-color: var(--success);
}
.tool-drop-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  margin: 0;
}
.tool-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: var(--btn-py) calc(var(--btn-px) * 1.6);
  min-height: 48px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  transition: background .2s;
}
.tool-dropzone:hover .tool-drop-btn, .tool-dropzone:focus-visible .tool-drop-btn { background: var(--primary-hover); }
html.comfort-mode .tool-drop-btn { min-height: 54px; }
.tool-drop-sub {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  margin: 0;
}
.tool-file-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ── File Badge ── */
.tool-file-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
  animation: toolSlideIn 0.3s cubic-bezier(0.16,1,0.3,1);
}
.tool-file-badge:hover {
  border-color: var(--primary);
}
.tool-file-badge-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.tool-file-badge-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
}
.tool-file-badge-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tool-file-badge-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tool-file-badge-meta {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  font-family: var(--t-mono, monospace);
}
.tool-file-badge-clear {
  width: 30px; height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color .2s,color .2s,background .2s;
  flex-shrink: 0;
}
.tool-file-badge-clear:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

/* ── Config Column ── */
.tool-config-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: toolSlideIn 0.35s cubic-bezier(0.16,1,0.3,1);
}

/* ── Action Buttons ── */
.tool-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: var(--btn-py) var(--btn-px);
  min-height: 44px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--t-font, var(--font));
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .2s,color .2s,background .2s,transform .2s;
  white-space: nowrap;
}
.tool-action-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.tool-action-btn:active:not(:disabled) { transform: translateY(0); }
.tool-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.tool-action-btn.primary {
  width: 100%;
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-size: 1.05rem;
  min-height: 52px;
  box-shadow: var(--shadow-md);
}
.tool-action-btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
}
.tool-action-btn.primary:active:not(:disabled) { transform: translateY(0); }
.tool-action-btn.secondary {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--border-strong);
  color: var(--text);
}
.tool-action-btn.secondary:hover:not(:disabled) {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
html.comfort-mode .tool-action-btn, html.comfort-mode .tool-action-btn.primary { min-height: 54px; }
/* Template step 3: large green download CTA */
.tool-action-btn.download-btn {
  width: 100%;
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  min-height: 58px;
  box-shadow: var(--shadow-md);
}
.tool-action-btn.download-btn:hover:not(:disabled) {
  color: #fff;
  background: var(--success);
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.tool-action-btn.download-all {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  border-radius: var(--radius-lg);
  font-family: var(--font-display);
  font-weight: 800;
}
html.comfort-mode .tool-action-btn.download-all, html.comfort-mode .tool-action-btn.download-btn { min-height: 58px; }
.tool-action-btn.download-all:hover:not(:disabled) {
  color: #fff;
  background: var(--success);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .tool-workspace.split-mode { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
  .tool-config-col { padding: 1rem; }
  .tool-dropzone { padding: 1.75rem 1.25rem; }
}

@media (max-width: 768px) {
  .tool-workspace,
  .tool-workspace.split-mode { grid-template-columns: 1fr; gap: 0.8rem; }
  .tool-dropzone { padding: 2rem 1rem; min-height: 220px; }
  .tool-drop-icon { font-size: 2.2rem; }
  .tool-drop-icon-wrap { width: 60px; height: 60px; }
  .tool-drop-title { font-size: 1.1rem; }
  .tool-drop-sub { font-size: 0.85rem; }
  .tool-config-col { padding: 1.2rem 1rem; gap: 0.75rem; }
  .tool-action-btn { padding: 0.65rem 1.2rem; font-size: 0.8rem; }
  .tool-action-btn.primary { padding: 0.75rem 1.2rem; font-size: 0.88rem; }
  .tool-action-btn.download-all,
  .tool-action-btn.download-btn { padding: 0.65rem 1.4rem; font-size: 0.95rem; }
  .tool-file-badge { padding: 0.6rem 0.8rem; }
  .tool-file-badge-icon { font-size: 1.3rem; }
  .tool-file-badge-name { font-size: 0.78rem; }
  .tool-file-badge-meta { font-size: 0.67rem; }
  .tool-error-bar,
  .tool-processing-bar,
  .tool-success-bar { font-size: 0.82rem; padding: 0.6rem 0.9rem; flex-wrap: wrap; }
  .tool-bar-dismiss { width: 24px; height: 24px; font-size: 0.65rem; }
  .tool-spinner { width: 18px; height: 18px; }
}

@media (max-width: 480px) {
  .tool-dropzone { padding: 1.75rem 0.85rem; min-height: 210px; }
  .tool-drop-icon { font-size: 1.8rem; }
  .tool-drop-icon-wrap { width: 48px; height: 48px; }
  .tool-drop-title { font-size: 1rem; }
  .tool-drop-sub { font-size: 0.8rem; }
  .tool-config-col { padding: 1rem 0.85rem; gap: 0.65rem; }
  .tool-action-btn { padding: 0.6rem 1rem; font-size: 0.76rem; }
  .tool-action-btn.primary { padding: 0.7rem 1rem; font-size: 0.82rem; }
  .tool-action-btn.download-all,
  .tool-action-btn.download-btn { padding: 0.6rem 1.2rem; font-size: 0.9rem; }
  .tool-file-badge { padding: 0.55rem 0.7rem; }
  .tool-file-badge-icon { font-size: 1.1rem; }
  .tool-file-badge-name { font-size: 0.74rem; }
  .tool-file-badge-meta { font-size: 0.63rem; }
  .tool-file-badge-clear { width: 28px; height: 28px; font-size: 0.8rem; }
  .tool-error-bar,
  .tool-processing-bar,
  .tool-success-bar { font-size: 0.78rem; padding: 0.5rem 0.75rem; gap: 0.45rem; }
  .tool-bar-icon { font-size: 1rem; }
  .tool-bar-dismiss { width: 22px; height: 22px; font-size: 0.6rem; }
  .tool-spinner { width: 16px; height: 16px; }
}

/* Fieldsets default to min-width:min-content and push the page wider on phones. */
main fieldset{min-width:0}

/* Individual tool workspace matching the reference template. */

/* Breadcrumb, back link and quick switcher */
.workspace-nav { border-bottom: 1px solid var(--border); background: var(--bg-card); }
.workspace-nav-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; width: 100%; max-width: 1024px; min-height: 64px; margin-inline: auto; padding: 8px 16px; }
.workspace-nav .breadcrumb-nav { min-width: 0; max-width: 100%; padding: 0; }

/* Main workspace frame */
.workspace-container { width: 100%; max-width: 896px; margin-inline: auto; padding-inline: 16px; }
main .tool-section { padding: 28px 0 0; }
/* Centered tool header (icon tile, badges, H1, lead), compact sizing */
.tool-title-header { --hub-color: var(--primary); display: block; margin: 0 0 22px; text-align: left; }
.tool-title-header .hub-title-row { display: flex; align-items: center; gap: .85rem; margin: 0 0 .5rem; }
.tool-title-header .cat-icon-box { flex: none; width: 2.75rem; height: 2.75rem; box-shadow: var(--shadow-sm); }
.tool-title-header .cat-icon-box .svg-icon { width: 1.3rem; height: 1.3rem; }
.tool-badges { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-bottom: 8px; }
.tool-hub-badge,.tool-free-badge { padding: 1px 9px; border: 1px solid color-mix(in srgb,var(--hub-color) 30%,var(--bg-card)); border-radius: 999px; background: color-mix(in srgb,var(--hub-color) 10%,var(--bg-card)); color: var(--hub-color); font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.tool-free-badge { border-color: #A7F3D0; background: var(--success-soft); color: var(--success); letter-spacing: 0; text-transform: none; }
[data-theme="dark"] .tool-free-badge { border-color: #065F46; }
.tool-title-header h1 { color: var(--text); font-family: var(--font-display); font-size: clamp(1.75rem,3.5vw,2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; }
.tool-title-header > p { max-width: 46rem; margin-top: 6px; color: var(--text-secondary); font-size: 1rem; line-height: 1.55; }
main .tool-section .tool-status-strip { margin-bottom: 12px; }
.workspace-bottom { padding-bottom: 0; }

/* Main interactive card */
main .workspace-card { margin: 0 0 48px; padding: var(--card-padding); border: 2px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: 0 18px 35px -22px rgba(15,23,42,.25),var(--shadow-sm); }
main .workspace-card.tool-workspace { margin-bottom: 48px; }
main .tool-card > :is(.calc-card,.cp-card,.kb-card,.wct-card,.qrr-card,.br-main-card,.ic-main-card,.pwd-main-card) { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* Visual three-step progress */
.tool-steps { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; max-width: 100%; margin: 0 auto 32px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow-sm); list-style: none; }
.tool-step { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 10px; border: 2px solid transparent; border-radius: 12px; background: var(--bg-soft); color: var(--text-tertiary); transition: background .2s,border-color .2s,color .2s; }
.tool-step-num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: var(--border); color: var(--text-secondary); font-family: var(--font-display); font-size: .85rem; font-weight: 800; }
.tool-step-text { display: flex; flex-direction: column; min-width: 0; }
.tool-step-kicker { font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tool-step-label { overflow: hidden; font-size: .82rem; font-weight: 800; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.tool-step[data-state="active"] { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.tool-step[data-state="active"] .tool-step-num { background: #2563EB; color: #FFFFFF; }
.tool-step[data-state="active"] .tool-step-kicker { color: var(--primary); }
.tool-step[data-state="done"] { border-color: var(--success); background: var(--success-soft); color: var(--text); }
.tool-step[data-state="done"] .tool-step-num { background: #059669; color: #FFFFFF; font-size: 0; }
.tool-step[data-state="done"] .tool-step-num::before { content: "✓"; font-size: 1rem; }
.tool-step[data-state="done"] .tool-step-kicker { color: var(--success); }

/* Long guide and FAQ */
main .tool-extra-content { display: grid; gap: 22px; max-width: none; margin: 0; padding: 0; content-visibility: visible; }
main .tool-intro { margin: 0; padding: 30px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-sm); }
main .tool-intro h2 { margin: 28px 0 9px; color: var(--text); font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; line-height: 1.3; }
main .tool-intro h2:first-child { margin-top: 0; }
main .tool-intro h3 { margin: 21px 0 7px; color: var(--text); font-size: 1.08rem; font-weight: 800; }
main .tool-intro h4 { margin: 16px 0 6px; color: var(--text); font-size: .95rem; }
main .tool-intro p,main .tool-intro li { color: var(--text-secondary); font-size: 1rem; line-height: 1.75; }
main .tool-intro p { margin: 0 0 14px; }
main .tool-intro ul,main .tool-intro ol { margin: 0 0 12px; padding-left: 22px; }
main .tool-intro li { margin-bottom: 4px; }
main .tool-intro a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
main .tool-intro table { width: 100%; margin: 10px 0 14px; border-collapse: collapse; font-size: .9rem; }
main .tool-intro th,main .tool-intro td { padding: 9px 10px; border: 1px solid var(--border); color: var(--text-secondary); text-align: left; }
main .tool-intro th { background: var(--bg-soft); color: var(--text); font-weight: 800; }
main .tool-intro code { padding: 2px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-soft); color: var(--primary); font-family: ui-monospace,Consolas,monospace; font-size: .85rem; word-break: break-word; }
main .tool-intro pre { margin: 10px 0 14px; padding: 13px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); }
main .tool-intro pre code { padding: 0; border: 0; background: none; }
main .tool-faq { max-width: none; margin: 0; padding: 26px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-sm); }
main .tool-faq .faq-item { background: var(--bg-soft); box-shadow: none; }
main .tool-faq > h2 { margin-bottom: 15px; color: var(--text); font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; }
main .tool-faq .faq-item { margin-bottom: 11px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); box-shadow: var(--shadow-sm); }
main .tool-faq .faq-item[open] { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
main .tool-faq .faq-item summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 15px 18px; color: var(--text); font-family: var(--font-display); font-size: 1rem; font-weight: 800; cursor: pointer; list-style: none; }
main .tool-faq .faq-item summary::-webkit-details-marker { display: none; }
main .tool-faq .faq-item summary:hover { color: var(--primary); }
main .tool-faq .faq-indicator { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--bg-soft); color: var(--text-tertiary); font-size: 0; }
main .tool-faq .faq-indicator::before { content: "+"; font-size: 1.3rem; font-weight: 600; }
main .tool-faq .faq-item[open] .faq-indicator { background: var(--primary-soft); color: var(--primary); }
main .tool-faq .faq-item[open] .faq-indicator::before { content: "−"; }
main .tool-faq .faq-item[open] summary { margin-bottom: 12px; border-bottom: 1px solid var(--border); }
main .tool-faq .faq-answer { padding: 0 18px 17px; color: var(--text-secondary); font-size: .96rem; line-height: 1.7; }

/* Shared calculator fields used by several tools */
main .tool-section .calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
main .tool-section .input-group { margin-bottom: 14px; }
main .tool-section .input-group label { display: block; margin-bottom: 7px; color: var(--text); font-size: .93rem; font-weight: 700; }
main .tool-section .input-group input,main .tool-section .input-group select { width: 100%; padding: 12px 15px; border: 1.5px solid var(--border-strong); border-radius: 12px; background: var(--bg-card); color: var(--text); font-size: 1rem; }
main .tool-section .input-group input:focus,main .tool-section .input-group select:focus { border-color: var(--primary); outline: 0; box-shadow: 0 0 0 3px var(--primary-soft); }
main .tool-section .results-box { display: none; }
main .tool-section .results-box.show { display: block; }
main .tool-section .btn-convert { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px; border: 0; border-radius: 14px; background: #2563EB; box-shadow: var(--shadow-sm); color: #FFFFFF; font-weight: 800; cursor: pointer; }
main .tool-section .btn-convert:hover:not(:disabled) { background: #1D4ED8; }
main .tool-section .btn-convert:disabled { cursor: not-allowed; opacity: .5; }
main .tool-card > :last-child { margin-bottom: 0; }

@media (min-width: 640px) {
    .workspace-container,.workspace-nav-inner { padding-inline: 24px; }
}
@media (min-width: 1024px) {
    .workspace-container,.workspace-nav-inner { padding-inline: 32px; }
}
@media (max-width: 760px) {
    .workspace-nav-inner { padding-block: 10px; }
    main .tool-section .calc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    main .tool-section { padding-top: 20px; }
    .tool-title-header { margin-bottom: 18px; }
    .tool-title-header .cat-icon-box { width: 2.5rem; height: 2.5rem; }
    .tool-title-header > p { font-size: .95rem; }
    main .workspace-card,main .workspace-card.tool-workspace { margin-bottom: 40px; padding: 16px; border-radius: 19px; }
    .tool-steps { gap: 5px; padding: 9px; }
    .tool-step { align-items: center; flex-direction: column; gap: 5px; padding: 8px 4px; text-align: center; }
    .tool-step-text { align-items: center; }
    .tool-step-label { font-size: .68rem; white-space: normal; }
    main .tool-intro { padding: 22px 18px; border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .tool-step,.tool-step-num { transition: none; }
}
@media (max-width: 640px) {
    .toast-container { right: 16px; left: 16px; bottom: 16px; }
    .toast { max-width: none; }
}
