/* ============================================================
   123TinyTools – Markdown to HTML  ·  md-to-html.css
   Version: 1.0.7
   Category: Converters (green #16A34A)
   All selectors scoped under .tia-mh-wrap
   Dark mode: body-class only — never @media(prefers-color-scheme)
   ============================================================ */

/* ── CSS VARIABLES ─────────────────────────────────────────── */
.tia-mh-wrap {
  --mh-accent:     var(--tia-mh-accent, #16A34A);
  --mh-accent-h:    var(--tia-mh-accent-h, #15803D);
  --mh-accent-rgb: var(--tia-mh-rgb, 22,163,74);
  --mh-accent-light:var(--tia-mh-accent-light, #DCFCE7);
  --mh-accent-50:   #F0FDF4;
  --mh-accent-border:var(--tia-mh-accent-border, #BBF7D0);
  --mh-accent-dark: var(--tia-mh-accent-dark, #14532D);
  --mh-accent-text: #14532D;

  --mh-blue:        #5B8DEF;
  --mh-blue-50:     #EFF4FF;
  --mh-blue-200:    #B8D0FF;

  --mh-text:        var(--tia-g-text, #1E293B);
  --mh-body:        var(--tia-g-body, #475569);
  --mh-muted:       var(--tia-g-muted, #64748B);
  --mh-surface:     var(--tia-mh-surface, var(--tia-g-surface, #FFFFFF));
  --mh-bg:          var(--tia-mh-bg, var(--tia-g-bg, #F8FAFD));
  --mh-surface-2:   #F1F5F9;
  --mh-border:      var(--tia-g-border, #E4EAF4);
  --mh-border-s:    var(--tia-g-border-s, #CBD5E1);
  --mh-slate-100:   var(--tia-g-slate-100, #F1F5F9);
  --mh-err-bg:      #FEE2E2;
  --mh-err-text:    #991B1B;
  --mh-err-border:  #FCA5A5;
  --mh-warn-bg:     #FEF3C7;
  --mh-warn-text:   #92400E;
  --mh-warn-border: #FCD34D;

  /* Syntax tokens (light) — HTML source highlighting */
  --mh-syn-tag:   #15803D;
  --mh-syn-attr:  #B45309;
  --mh-syn-str:   #1E293B;
  --mh-syn-punc:  #64748B;
  --mh-syn-comment:#94A3B8;

  --mh-sh-card: var(--tia-g-sh-card, 0 2px 20px rgba(0,0,0,.07), 0 1px 4px rgba(0,0,0,.04));
  --mh-r-sm:   var(--tia-g-r-sm, 6px);
  --mh-r-md:   var(--tia-g-r-md, 10px);
  --mh-r-lg:   var(--tia-g-r-lg, 12px);
  --mh-r-xl:   var(--tia-g-r-xl, 22px);
  --mh-r-pill: var(--tia-g-r-pill, 9999px);
  --mh-fh: var(--tia-g-font-h, 'Plus Jakarta Sans', system-ui, sans-serif);
  --mh-fb: var(--tia-g-font-b, 'Inter', system-ui, sans-serif);
  --mh-fm: var(--tia-g-font-m, 'JetBrains Mono', 'Fira Code', monospace);

  position: relative;
  font-family: var(--mh-fb);
  color: var(--mh-text);
  padding: 24px 0 64px;
  -webkit-font-smoothing: antialiased;
}

/* ── DARK MODE — token flip (7 selectors) ──────────────────── */
html[data-theme="dark"] .tia-mh-wrap,
.kt-dark-mode .tia-mh-wrap,
.dark-mode .tia-mh-wrap,
body[data-theme="dark"] .tia-mh-wrap,
.is-dark .tia-mh-wrap,
html.wp-dark-mode-active .tia-mh-wrap,
body.wp-dark-mode-active .tia-mh-wrap {
  --mh-text:        var(--tia-g-text, #F1F5F9);
  --mh-body:        var(--tia-g-body, #CBD5E1);
  --mh-muted:       var(--tia-g-muted, #94A3B8);
  --mh-surface:     var(--tia-mh-surface, var(--tia-g-surface, #1E293B));
  --mh-bg:          var(--tia-mh-bg, var(--tia-g-bg, #0F172A));
  --mh-surface-2:   #162032;
  --mh-border:      var(--tia-g-border, #334155);
  --mh-border-s:    var(--tia-g-border-s, #475569);
  --mh-slate-100:   var(--tia-g-slate-100, #334155);
  --mh-accent-text: #86EFAC;

  --mh-syn-tag:   #86EFAC;
  --mh-syn-attr:  #FCD34D;
  --mh-syn-str:   #E2E8F0;
  --mh-syn-punc:  #94A3B8;
  --mh-syn-comment:#94A3B8;
}

/* ── DROP-ANYWHERE OVERLAY ─────────────────────────────────── */
.tia-mh-drop-overlay {
  position: absolute; inset: 0; z-index: 50;
  display: none; align-items: center; justify-content: center;
  background: rgba(var(--mh-accent-rgb),.06);
  border: 2.5px dashed var(--mh-accent);
  border-radius: var(--mh-r-xl);
  backdrop-filter: blur(1px);
  pointer-events: none;
}
.tia-mh-drop-overlay--on { display: flex; }
.tia-mh-drop-overlay-inner {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--mh-accent); font-weight: 700; font-size: 15px;
}
.tia-mh-drop-overlay-inner svg { width: 40px; height: 40px; }

/* ── INTRO / HEADER ────────────────────────────────────────── */
.tia-mh-intro-content { margin-bottom: 24px; }
.tia-mh-header { margin-bottom: 20px; }
.tia-mh-h1 {
  font-family: var(--mh-fh);
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 800; letter-spacing: -.6px; line-height: 1.15;
  color: var(--mh-text); margin: 0 0 5px;
}
.tia-mh-tagline { font-size: 14px; color: var(--mh-muted); line-height: 1.55; margin: 0 0 10px; }
.tia-mh-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.tia-mh-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 500;
  color: var(--mh-accent-dark);
  background: var(--mh-accent-light);
  border: 1px solid var(--mh-accent-border);
  border-radius: var(--mh-r-pill); padding: 3px 10px; white-space: nowrap;
}
.tia-mh-badge svg { width: 11px; height: 11px; flex-shrink: 0; }

html[data-theme="dark"] .tia-mh-wrap .tia-mh-badge,
.kt-dark-mode .tia-mh-wrap .tia-mh-badge,
.dark-mode .tia-mh-wrap .tia-mh-badge,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-badge,
.is-dark .tia-mh-wrap .tia-mh-badge,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-badge,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-badge {
  background: rgba(var(--mh-accent-rgb),.15);
  color: #86EFAC;
  border-color: rgba(var(--mh-accent-rgb),.30);
}

/* ── PRIVACY NOTICE ────────────────────────────────────────── */
.tia-mh-privacy {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--mh-blue-50);
  border: 1px solid var(--mh-blue-200);
  border-radius: var(--mh-r-md);
  padding: 10px 14px; margin: 0 0 18px;
  font-size: 13px; color: var(--mh-body); line-height: 1.5;
}
.tia-mh-privacy svg { color: var(--mh-blue); flex-shrink: 0; margin-top: 1px; }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-privacy,
.kt-dark-mode .tia-mh-wrap .tia-mh-privacy,
.dark-mode .tia-mh-wrap .tia-mh-privacy,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-privacy,
.is-dark .tia-mh-wrap .tia-mh-privacy,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-privacy,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-privacy {
  background: rgba(91,141,239,.12);
  border-color: rgba(91,141,239,.30);
  color: #CBD5E1;
}

/* ── INPUT CARD ────────────────────────────────────────────── */
.tia-mh-input-card {
  background: var(--mh-surface); border-radius: var(--mh-r-xl);
  box-shadow: var(--mh-sh-card); overflow: hidden; margin-bottom: 14px;
}
.tia-mh-tabs {
  display: flex; background: var(--mh-surface-2);
  border-bottom: 1px solid var(--mh-border); overflow-x: auto; scrollbar-width: none;
}
.tia-mh-tabs::-webkit-scrollbar { display: none; }
.tia-mh-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 12px 18px; font-size: 13px; font-weight: 500;
  color: var(--mh-text); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  white-space: nowrap; cursor: pointer;
  font-family: var(--mh-fb); transition: background .15s;
}
.tia-mh-tab svg { width: 15px; height: 15px; }
.tia-mh-tab:hover { background: var(--mh-bg); }
.tia-mh-tab--active {
  color: var(--mh-text); border-bottom-color: var(--mh-accent);
  background: var(--mh-surface); font-weight: 600;
}

/* Paste pane */
.tia-mh-paste-pane { padding: 16px 18px; }
.tia-mh-textarea {
  width: 100%; min-height: 220px; resize: none;
  padding: 12px 14px; font-family: var(--mh-fm); font-size: 13px; line-height: 1.6;
  color: var(--mh-text); background: var(--mh-bg);
  border: 2px solid var(--mh-border-s); border-radius: var(--mh-r-md);
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-font-smoothing: antialiased; tab-size: 2;
}
.tia-mh-textarea:focus {
  border-color: var(--mh-accent);
  box-shadow: 0 0 0 3px rgba(var(--mh-accent-rgb),.14);
  background: var(--mh-surface);
}
.tia-mh-textarea::placeholder { color: var(--mh-muted); }

.tia-mh-paste-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; gap: 10px; flex-wrap: wrap;
}
.tia-mh-char-count { font-size: 12px; color: var(--mh-muted); font-family: var(--mh-fm); }
.tia-mh-paste-btns { display: flex; gap: 8px; align-items: center; }

/* Upload pane */
.tia-mh-upload-pane { padding: 16px 18px; }
.tia-mh-dropzone {
  border: 2px dashed var(--mh-accent-border); border-radius: var(--mh-r-lg);
  background: var(--mh-accent-light); padding: 36px 24px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tia-mh-dropzone--over, .tia-mh-dropzone:hover { border-color: var(--mh-accent); }
.tia-mh-dropzone-icon {
  width: 52px; height: 52px; margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--mh-accent-50); border-radius: var(--mh-r-lg); color: var(--mh-accent);
}
.tia-mh-dropzone-icon svg { width: 26px; height: 26px; }
.tia-mh-dropzone-title { font-size: 15px; font-weight: 600; color: var(--mh-text); margin: 0 0 4px; }
.tia-mh-dropzone-sub { font-size: 13px; color: var(--mh-body); margin: 0 0 8px; }
.tia-mh-browse { color: var(--mh-accent); font-weight: 600; text-decoration: underline; }
.tia-mh-file-note { font-size: 12px; color: var(--mh-muted); margin: 0; }
.tia-mh-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-dropzone,
.kt-dark-mode .tia-mh-wrap .tia-mh-dropzone,
.dark-mode .tia-mh-wrap .tia-mh-dropzone,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-dropzone,
.is-dark .tia-mh-wrap .tia-mh-dropzone,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-dropzone,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-dropzone {
  background: rgba(var(--mh-accent-rgb),.08); border-color: rgba(var(--mh-accent-rgb),.35);
}
html[data-theme="dark"] .tia-mh-wrap .tia-mh-dropzone-icon,
.kt-dark-mode .tia-mh-wrap .tia-mh-dropzone-icon,
.dark-mode .tia-mh-wrap .tia-mh-dropzone-icon,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-dropzone-icon,
.is-dark .tia-mh-wrap .tia-mh-dropzone-icon,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-dropzone-icon,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-dropzone-icon { background: rgba(var(--mh-accent-rgb),.16); }

/* ── TOOLBAR ───────────────────────────────────────────────── */
.tia-mh-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.tia-mh-tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tia-mh-tool-opts { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tia-mh-check {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--mh-body); cursor: pointer; user-select: none;
}
.tia-mh-check input { accent-color: var(--mh-accent); width: 15px; height: 15px; }

/* ── BUTTONS ───────────────────────────────────────────────── */
.tia-mh-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--mh-accent); color: #fff; border: none;
  border-radius: var(--mh-r-pill); padding: 11px 22px;
  font-family: var(--mh-fb); font-size: 14px; font-weight: 600;
  cursor: pointer; width: auto;
  box-shadow: 0 2px 12px rgba(var(--mh-accent-rgb),.4);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.tia-mh-btn-primary svg { width: 16px; height: 16px; }
.tia-mh-btn-primary:hover { background: var(--mh-accent-h); transform: translateY(-1px); box-shadow: 0 4px 18px rgba(var(--mh-accent-rgb),.5); }
.tia-mh-btn-primary:active { transform: translateY(0); }

.tia-mh-btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--mh-surface); color: var(--mh-body);
  border: 1.5px solid var(--mh-border); border-radius: var(--mh-r-pill);
  padding: 9px 18px; font-family: var(--mh-fb); font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.tia-mh-btn-secondary svg { width: 15px; height: 15px; }
.tia-mh-btn-secondary:hover { background: var(--mh-surface-2); border-color: var(--mh-border-s); }
.tia-mh-btn-secondary--sm { padding: 7px 14px; font-size: 13px; }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-btn-secondary:hover,
.kt-dark-mode .tia-mh-wrap .tia-mh-btn-secondary:hover,
.dark-mode .tia-mh-wrap .tia-mh-btn-secondary:hover,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-btn-secondary:hover,
.is-dark .tia-mh-wrap .tia-mh-btn-secondary:hover,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-btn-secondary:hover,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-btn-secondary:hover {
  background: var(--mh-surface-2); border-color: var(--mh-border-s);
}

.tia-mh-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--mh-body); border: none;
  border-radius: var(--mh-r-md); padding: 6px 8px;
  font-family: var(--mh-fb); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s;
}
.tia-mh-btn-ghost svg { width: 15px; height: 15px; }
.tia-mh-btn-ghost:hover { background: var(--mh-slate-100); }

.tia-mh-btn-icon {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--mh-bg); border: 1.5px solid var(--mh-border); border-radius: var(--mh-r-md);
  color: var(--mh-body); cursor: pointer; transition: background .15s, border-color .15s;
}
.tia-mh-btn-icon svg { width: 15px; height: 15px; }
.tia-mh-btn-icon:hover { background: var(--mh-slate-100); border-color: var(--mh-border-s); }

/* ── STATUS BAR ────────────────────────────────────────────── */
.tia-mh-status {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: var(--mh-r-md); padding: 11px 14px; margin-bottom: 14px;
  font-size: 13.5px; font-weight: 500;
}
.tia-mh-status__icon { width: 18px; height: 18px; flex-shrink: 0; }
.tia-mh-status__text { flex: 1; min-width: 180px; }
.tia-mh-status--idle    { background: var(--mh-surface-2); color: var(--mh-muted); border: 1px solid var(--mh-border); }
.tia-mh-status--success { background: var(--mh-accent-light); color: var(--mh-accent-dark); border: 1px solid var(--mh-accent-border); }
.tia-mh-status--error   { background: var(--mh-err-bg); color: var(--mh-err-text); border: 1px solid var(--mh-err-border); }
.tia-mh-status--warning { background: var(--mh-warn-bg); color: var(--mh-warn-text); border: 1px solid var(--mh-warn-border); }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-status--success,
.kt-dark-mode .tia-mh-wrap .tia-mh-status--success,
.dark-mode .tia-mh-wrap .tia-mh-status--success,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-status--success,
.is-dark .tia-mh-wrap .tia-mh-status--success,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-status--success,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-status--success {
  background: rgba(var(--mh-accent-rgb),.15); color: #86EFAC; border-color: rgba(var(--mh-accent-rgb),.30);
}

.tia-mh-status__pills { display: flex; gap: 6px; flex-wrap: wrap; }
.tia-mh-stat-pill {
  font-family: var(--mh-fm); font-size: 11.5px; font-weight: 600;
  background: rgba(var(--mh-accent-rgb),.10); color: var(--mh-accent-dark);
  border-radius: var(--mh-r-pill); padding: 2px 9px;
}
html[data-theme="dark"] .tia-mh-wrap .tia-mh-stat-pill,
.kt-dark-mode .tia-mh-wrap .tia-mh-stat-pill,
.dark-mode .tia-mh-wrap .tia-mh-stat-pill,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-stat-pill,
.is-dark .tia-mh-wrap .tia-mh-stat-pill,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-stat-pill,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-stat-pill {
  background: rgba(var(--mh-accent-rgb),.20); color: #86EFAC;
}

/* ── OUTPUT CARD ───────────────────────────────────────────── */
.tia-mh-output-card {
  background: var(--mh-surface); border-radius: var(--mh-r-xl);
  box-shadow: var(--mh-sh-card); overflow: hidden; margin-bottom: 24px;
}
.tia-mh-output-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--mh-bg); border-bottom: 1px solid var(--mh-border);
}
.tia-mh-view-toggle {
  display: inline-flex; background: var(--mh-surface-2);
  border: 1px solid var(--mh-border); border-radius: var(--mh-r-pill); padding: 3px;
}
.tia-mh-view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; font-family: var(--mh-fb); font-size: 12.5px; font-weight: 600;
  color: var(--mh-body); background: transparent; border: none;
  border-radius: var(--mh-r-pill); cursor: pointer; transition: background .15s;
}
.tia-mh-view-btn svg { width: 14px; height: 14px; }
.tia-mh-view-btn--active { background: var(--mh-surface); color: var(--mh-body); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.tia-mh-output-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Code (HTML source) view */
.tia-mh-code-view { max-height: 520px; overflow: auto; }
.tia-mh-code {
  margin: 0; padding: 16px 18px 16px 0;
  font-family: var(--mh-fm); font-size: 13px; line-height: 1.7;
  color: var(--mh-syn-str); background: var(--mh-surface-2);
  white-space: pre-wrap; word-break: break-word; tab-size: 2;
  counter-reset: mh-line;
}
.tia-mh-code code { font-family: inherit; }
.tia-mh-line { display: block; }
.tia-mh-line::before {
  counter-increment: mh-line;
  content: counter(mh-line);
  display: inline-block; width: 3em; margin-right: 14px; padding-right: 10px;
  text-align: right; color: var(--mh-muted); opacity: .55;
  border-right: 1px solid var(--mh-border);
  user-select: none; -webkit-user-select: none;
}
.tia-mh-tag     { color: var(--mh-syn-tag); font-weight: 600; }
.tia-mh-attr    { color: var(--mh-syn-attr); }
.tia-mh-astr    { color: var(--mh-syn-str); }
.tia-mh-comment { color: var(--mh-syn-comment); font-style: italic; }

/* Preview (rendered) view */
.tia-mh-preview-view {
  max-height: 560px; overflow: auto; padding: 22px 24px;
  background: var(--mh-surface); color: var(--mh-body);
  font-family: var(--mh-fb); font-size: 15px; line-height: 1.7;
}
.tia-mh-preview-view > *:first-child { margin-top: 0; }
.tia-mh-preview-view > *:last-child { margin-bottom: 0; }
.tia-mh-preview-view h1,
.tia-mh-preview-view h2,
.tia-mh-preview-view h3,
.tia-mh-preview-view h4 { font-family: var(--mh-fh); color: var(--mh-text); line-height: 1.25; margin: 22px 0 10px; }
.tia-mh-preview-view h1 { font-size: 26px; font-weight: 800; border-bottom: 1px solid var(--mh-border); padding-bottom: 8px; }
.tia-mh-preview-view h2 { font-size: 21px; font-weight: 700; border-bottom: 1px solid var(--mh-border); padding-bottom: 6px; }
.tia-mh-preview-view h3 { font-size: 17px; font-weight: 700; }
.tia-mh-preview-view p { margin: 0 0 14px; }
.tia-mh-preview-view a { color: var(--mh-accent); text-decoration: underline; }
.tia-mh-preview-view ul, .tia-mh-preview-view ol { padding-left: 24px; margin: 0 0 14px; }
.tia-mh-preview-view li { margin-bottom: 5px; }
.tia-mh-preview-view img { max-width: 100%; height: auto; border-radius: var(--mh-r-sm); }
.tia-mh-preview-view blockquote {
  margin: 0 0 14px; padding: 6px 16px; color: var(--mh-muted);
  border-left: 4px solid var(--mh-accent-border); background: var(--mh-surface-2); border-radius: 0 var(--mh-r-sm) var(--mh-r-sm) 0;
}
.tia-mh-preview-view code {
  font-family: var(--mh-fm); font-size: 13px; background: var(--mh-surface-2);
  padding: 2px 6px; border-radius: var(--mh-r-sm); color: var(--mh-accent-dark);
}
.tia-mh-preview-view pre {
  margin: 0 0 14px; padding: 14px 16px; overflow: auto;
  background: var(--mh-surface-2); border: 1px solid var(--mh-border); border-radius: var(--mh-r-md);
}
.tia-mh-preview-view pre code { background: none; padding: 0; color: var(--mh-text); }
.tia-mh-preview-view table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 14px; }
.tia-mh-preview-view th, .tia-mh-preview-view td { border: 1px solid var(--mh-border); padding: 8px 12px; text-align: left; }
.tia-mh-preview-view th { background: var(--mh-surface-2); font-weight: 700; color: var(--mh-text); }
.tia-mh-preview-view hr { border: none; border-top: 1px solid var(--mh-border); margin: 22px 0; }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-preview-view code,
.kt-dark-mode .tia-mh-wrap .tia-mh-preview-view code,
.dark-mode .tia-mh-wrap .tia-mh-preview-view code,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-preview-view code,
.is-dark .tia-mh-wrap .tia-mh-preview-view code,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-preview-view code,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-preview-view code { color: #86EFAC; }

/* ── SEO CONTENT ───────────────────────────────────────────── */
.tia-mh-seo-content { margin: 8px 0 32px; color: var(--mh-body); line-height: 1.7; font-size: 15px; }
.tia-mh-seo-content h2 { font-family: var(--mh-fh); font-size: 22px; font-weight: 800; color: var(--mh-text); margin: 28px 0 12px; letter-spacing: -.4px; }
.tia-mh-seo-content h3 { font-family: var(--mh-fh); font-size: 17px; font-weight: 700; color: var(--mh-text); margin: 22px 0 8px; }
.tia-mh-seo-content p, .tia-mh-seo-content li { font-size: 15px; }
.tia-mh-seo-content ul, .tia-mh-seo-content ol { padding-left: 22px; }
.tia-mh-seo-content li { margin-bottom: 6px; }
.tia-mh-seo-content code { font-family: var(--mh-fm); font-size: 13px; background: var(--mh-surface-2); padding: 2px 6px; border-radius: var(--mh-r-sm); color: var(--mh-accent-dark); }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-seo-content code,
.kt-dark-mode .tia-mh-wrap .tia-mh-seo-content code,
.dark-mode .tia-mh-wrap .tia-mh-seo-content code,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-seo-content code,
.is-dark .tia-mh-wrap .tia-mh-seo-content code,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-seo-content code,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-seo-content code { color: #86EFAC; }

/* ── FAQ ───────────────────────────────────────────────────── */
.tia-mh-faq-section { margin: 8px 0 32px; }
.tia-mh-faq-heading { font-family: var(--mh-fh); font-size: 20px; font-weight: 800; color: var(--mh-text); margin: 0 0 14px; letter-spacing: -.4px; }
.tia-mh-faq-item {
  background: var(--mh-surface); border: 1px solid var(--mh-border);
  border-radius: var(--mh-r-lg); overflow: hidden; margin-bottom: 8px;
}
.tia-mh-faq-q {
  padding: 14px 18px; font-size: 14px; font-weight: 600; color: var(--mh-text);
  cursor: pointer; list-style: none; position: relative; padding-right: 44px;
}
.tia-mh-faq-q::-webkit-details-marker { display: none; }
.tia-mh-faq-q::after {
  content: ''; position: absolute; right: 18px; top: 50%;
  width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--mh-muted); border-bottom: 2px solid var(--mh-muted);
  transform: rotate(45deg); transition: transform .2s;
}
.tia-mh-faq-item[open] .tia-mh-faq-q::after { transform: rotate(-135deg); margin-top: -2px; }
.tia-mh-faq-q:hover { background: var(--mh-accent-light); color: var(--mh-accent); }
.tia-mh-faq-a {
  padding: 14px 18px 18px; font-size: 14px; color: var(--mh-body); line-height: 1.7;
  background: var(--mh-bg); border-top: 1px solid var(--mh-border);
}
.tia-mh-faq-a code { font-family: var(--mh-fm); font-size: 13px; background: var(--mh-surface-2); padding: 2px 6px; border-radius: var(--mh-r-sm); }

html[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-q,
.kt-dark-mode .tia-mh-wrap .tia-mh-faq-q,
.dark-mode .tia-mh-wrap .tia-mh-faq-q,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-q,
.is-dark .tia-mh-wrap .tia-mh-faq-q,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-q,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-q { color: #F1F5F9 !important; }
html[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-a,
.kt-dark-mode .tia-mh-wrap .tia-mh-faq-a,
.dark-mode .tia-mh-wrap .tia-mh-faq-a,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-a,
.is-dark .tia-mh-wrap .tia-mh-faq-a,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-a,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-a {
  background: #0F172A; color: #CBD5E1; border-color: #334155;
}
html[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-q:hover,
.kt-dark-mode .tia-mh-wrap .tia-mh-faq-q:hover,
.dark-mode .tia-mh-wrap .tia-mh-faq-q:hover,
body[data-theme="dark"] .tia-mh-wrap .tia-mh-faq-q:hover,
.is-dark .tia-mh-wrap .tia-mh-faq-q:hover,
html.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-q:hover,
body.wp-dark-mode-active .tia-mh-wrap .tia-mh-faq-q:hover {
  background: rgba(var(--mh-accent-rgb),.20) !important; color: #86EFAC !important;
}

/* ── TOAST ─────────────────────────────────────────────────── */
.tia-mh-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 99999;
  background: #16A34A; color: #fff; font-size: 14px; font-weight: 600;
  padding: 11px 18px; border-radius: var(--mh-r-pill);
  box-shadow: 0 8px 28px rgba(var(--mh-accent-rgb),.4);
  transition: opacity .25s, transform .25s;
}
.tia-mh-toast svg { width: 17px; height: 17px; }
.tia-mh-toast--hidden { opacity: 0; transform: translateX(-50%) translateY(12px); pointer-events: none; }

/* ── ACCESS GATE MODAL ─────────────────────────────────────── */
.tia-mh-gate {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(15,23,42,.55); backdrop-filter: blur(4px); border-radius: var(--mh-r-xl);
}
.tia-mh-gate-box {
  width: 100%; max-width: 420px; background: var(--mh-surface);
  border-radius: var(--mh-r-xl); box-shadow: 0 20px 60px rgba(0,0,0,.3); padding: 28px 26px; text-align: center;
}
.tia-mh-gate-h { font-family: var(--mh-fh); font-size: 19px; font-weight: 800; color: var(--mh-text); margin: 0 0 8px; }
.tia-mh-gate-msg { font-size: 14px; color: var(--mh-body); margin: 0 0 18px; line-height: 1.6; }
.tia-mh-gate-form { margin: 16px 0; text-align: left; }
.tia-mh-gate-btn {
  display: inline-block; background: var(--mh-accent); color: #fff !important; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 11px 24px; border-radius: var(--mh-r-pill);
}
.tia-mh-gate-btn:hover { background: var(--mh-accent-h); }
.tia-mh-gate-dismiss {
  display: block; margin: 14px auto 0; background: none; border: none;
  color: var(--mh-muted); font-size: 13px; cursor: pointer; text-decoration: underline;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .tia-mh-header { text-align: center; }
  .tia-mh-tagline { text-align: center; }
  .tia-mh-badges { justify-content: center; }
  .tia-mh-toolbar { flex-direction: column; align-items: stretch; }
  .tia-mh-tool-actions { justify-content: center; }
  .tia-mh-tool-opts { justify-content: center; }
}
@media (max-width: 540px) {
  .tia-mh-wrap { overflow-x: hidden; padding: 16px 0 48px; }
  .tia-mh-input-card, .tia-mh-output-card { min-width: 0; overflow: hidden; }
  .tia-mh-output-head { flex-direction: column; align-items: stretch; }
  .tia-mh-output-actions { justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

/* ── ICON VISIBILITY — MANDATORY (see CONTEXT.md) ──────────────
   Explicit per-button stroke rules at two-class specificity beat the
   single-class catch-all AND survive theme color/stroke overrides such as
   `button{color:#fff!important}` or `button svg{stroke:none}`. */
/* Base — force a renderable stroke. Themes that zero `stroke-width` (or strip the
   SVG attribute) blank line-icons; setting it in CSS with !important prevents that.
   This is why the Clear icon was invisible. */
.tia-mh-wrap .tia-mh-btn-primary svg,
.tia-mh-wrap .tia-mh-btn-secondary svg,
.tia-mh-wrap .tia-mh-btn-ghost svg,
.tia-mh-wrap .tia-mh-btn-icon svg,
.tia-mh-wrap .tia-mh-tab svg,
.tia-mh-wrap .tia-mh-view-btn svg {
  fill: none !important; stroke-width: 2 !important;
  stroke-linecap: round; stroke-linejoin: round; display: block; overflow: visible;
}
/* Constant colour in EVERY state (rest = hover = active); active shown by bg only. */
.tia-mh-wrap .tia-mh-btn-primary svg   { stroke: #fff !important; }
.tia-mh-wrap .tia-mh-btn-secondary svg { stroke: var(--mh-body) !important; }
.tia-mh-wrap .tia-mh-btn-ghost svg     { stroke: var(--mh-body) !important; }
.tia-mh-wrap .tia-mh-btn-icon svg      { stroke: var(--mh-body) !important; }
.tia-mh-wrap .tia-mh-tab svg           { stroke: var(--mh-text) !important; }
.tia-mh-wrap .tia-mh-view-btn svg      { stroke: var(--mh-body) !important; }

/* Catch-all — !important + stroke-width so a theme can never blank an icon. */
.tia-mh-wrap button svg { stroke: currentColor !important; fill: none !important; stroke-width: 2 !important; }

/* ── TEXT COLOUR LOCK — labels NEVER recolor on hover/focus/active; beats any theme ── */
.tia-mh-wrap .tia-mh-tab,
.tia-mh-wrap .tia-mh-tab:hover,
.tia-mh-wrap .tia-mh-tab:focus,
.tia-mh-wrap .tia-mh-tab:active            { color: var(--mh-text) !important; }
.tia-mh-wrap .tia-mh-btn-secondary,
.tia-mh-wrap .tia-mh-btn-secondary:hover,
.tia-mh-wrap .tia-mh-btn-secondary:focus,
.tia-mh-wrap .tia-mh-btn-ghost,
.tia-mh-wrap .tia-mh-btn-ghost:hover,
.tia-mh-wrap .tia-mh-btn-ghost:focus,
.tia-mh-wrap .tia-mh-btn-icon,
.tia-mh-wrap .tia-mh-btn-icon:hover,
.tia-mh-wrap .tia-mh-view-btn,
.tia-mh-wrap .tia-mh-view-btn:hover,
.tia-mh-wrap .tia-mh-view-btn:active       { color: var(--mh-body) !important; }
.tia-mh-wrap .tia-mh-btn-primary,
.tia-mh-wrap .tia-mh-btn-primary:hover,
.tia-mh-wrap .tia-mh-btn-primary:focus     { color: #fff !important; }
