/* ============================================
   tools.css — Dev Tools panel: mini sidebar nav, text/JSON/SQL/base64/url/
   html tools, diff viewer, timestamp converter, color converter, JSON log
   viewer, UUID generator, regex tester, lorem ipsum generator.
   Part of the app.css split.
   ============================================ */

#toolsPanel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tools-wrap {
  display: flex;
  flex-direction: row;
  height: 100%;
  min-height: 0;
}

/* Mini sidebar nav */
.tools-nav {
  width: 164px;
  flex-shrink: 0;
  background: var(--bg-darkest);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 6px 0 10px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.tools-nav-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 14px 4px;
  opacity: 0.55;
}
.tools-nav-label:first-child { padding-top: 6px; }
.tool-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.tool-nav-item:hover  { color: var(--text-primary); background: var(--bg-hover); }
.tool-nav-item.active { color: var(--gold); background: rgba(186,154,66,0.08); border-left-color: var(--gold); }
.tool-nav-item i      { font-size: 0.9rem; flex-shrink: 0; }
/* Tool content area */
.tools-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Pane */
.tool-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.tool-pane.hidden { display: none; }

/* I/O area */
.tool-io-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 14px 16px 10px;
  gap: 10px;
  overflow: hidden;
}

/* Each column (in / out) */
.tool-col {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 6px;
}
.tool-col-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tool-col-acts {
  display: flex;
  gap: 4px;
}
.tool-col-acts button {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 0.72rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tool-col-acts button:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Textareas */
.tool-ta {
  flex: 1;
  resize: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 10px 12px;
  min-height: 0;
  transition: border-color 0.15s;
}
.tool-ta:focus         { outline: none; border-color: var(--gold); }
.tool-ta[readonly]     { background: var(--bg-darkest); color: var(--text-secondary); }

/* Middle control column */
.tool-mid {
  width: 160px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 22px;
}

/* Options card */
.tool-opts {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tool-opts-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.tool-chk, .tool-radio {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.tool-chk input,
.tool-radio input { accent-color: var(--gold); cursor: pointer; }
.tool-sub {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-left: 12px;
  border-left: 2px solid var(--border);
  margin-top: 2px;
}

/* Action buttons */
.tool-run-btn {
  width: 100%;
  padding: 8px 0;
  background: var(--gold);
  color: #1a1a1a;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.15s;
}
.tool-run-btn:hover { opacity: 0.88; }

.tool-swap-btn {
  width: 100%;
  padding: 7px 0;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s, color 0.15s;
}
.tool-swap-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

/* JSON error */
.tool-error {
  margin: 0 16px 4px;
  padding: 8px 12px;
  background: rgba(220,53,69,0.12);
  border: 1px solid rgba(220,53,69,0.35);
  border-radius: var(--radius-sm);
  color: #ff6b6b;
  font-size: 0.8rem;
  font-family: monospace;
  flex-shrink: 0;
}

/* History strip */
.tool-history-wrap {
  border-top: 1px solid var(--border);
  background: var(--bg-dark);
  flex-shrink: 0;
  max-height: 190px;
  display: flex;
  flex-direction: column;
}
.tool-history-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 16px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex-shrink: 0;
}
.tool-history-hdr button {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tool-history-hdr button:hover { background: var(--bg-hover); color: #ff6b6b; }
.tool-history-list {
  overflow-y: auto;
  padding: 4px 14px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  scrollbar-width: thin;
}
.tool-history-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  cursor: pointer;
  max-width: 260px;
  min-width: 130px;
  flex: 1 1 130px;
  transition: border-color 0.15s, background 0.15s;
}
.tool-history-item:hover { border-color: var(--gold); background: var(--bg-hover); }
.tool-history-item-preview {
  font-family: monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.tool-history-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.tool-history-item-time {
  font-size: 0.68rem;
  color: var(--text-muted);
}
.tool-history-item-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  font-size: 0.8rem;
  line-height: 1;
  transition: color 0.15s;
}
.tool-history-item-del:hover { color: #ff6b6b; }
.tool-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  margin: 0 14px 8px;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.tool-more-btn:hover { background: var(--bg-hover); color: var(--gold); }

/* Counter stats column */
.tool-stats-col {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 22px;
}
.tool-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.tool-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.tool-stat-val {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.tool-stat-lbl {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── Diff Viewer ──────────────────────────────────────────────────────────── */
.diff-wrap { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.diff-inputs { flex: 1; min-height: 0; display: flex; padding: 14px 16px 6px; gap: 10px; overflow: hidden; }
.diff-result-wrap { height: 200px; flex-shrink: 0; display: flex; flex-direction: column; padding: 0 16px 8px; gap: 6px; }
.diff-result-hdr { display: flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); flex-shrink: 0; padding: 4px 0; }
.diff-result-hdr > span:first-child { flex: 1; }
.diff-stats { display: flex; gap: 8px; font-size: 0.78rem; font-weight: 700; }
.diff-stat-add  { color: #56d364; }
.diff-stat-del  { color: #ff7b72; }
.diff-stat-same { color: var(--text-muted); }
.diff-result { flex: 1; overflow-y: auto; margin: 0; padding: 8px 12px; background: var(--bg-darkest); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 0.78rem; line-height: 1.55; scrollbar-width: thin; }
.diff-line { display: block; padding: 1px 4px; border-radius: 2px; white-space: pre-wrap; word-break: break-all; }
.diff-add  { background: rgba(86, 211, 100, 0.12); color: #6fdc8c; }
.diff-del  { background: rgba(255, 123, 114, 0.12); color: #ff7b72; }
.diff-same { color: var(--text-muted); }
.diff-info { color: var(--gold); font-style: italic; }

/* ─── Timestamp Tool ───────────────────────────────────────────────────────── */
.ts-input-row { display: flex; align-items: center; gap: 8px; padding: 14px 16px 10px; flex-shrink: 0; flex-wrap: wrap; }
.ts-text-input { flex: 1; min-width: 180px; height: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 0.82rem; padding: 0 12px; transition: border-color 0.15s; }
.ts-text-input:focus { outline: none; border-color: var(--gold); }
.ts-tz-select { height: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.8rem; padding: 0 10px; cursor: pointer; flex-shrink: 0; }
.ts-tz-select:focus { outline: none; border-color: var(--gold); }
.ts-results { flex: 1; overflow-y: auto; padding: 0 16px 12px; display: flex; flex-direction: column; gap: 5px; scrollbar-width: thin; }
.ts-result-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ts-result-lbl { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); min-width: 130px; flex-shrink: 0; }
.ts-result-val { flex: 1; font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace; font-size: 0.82rem; color: var(--text-primary); word-break: break-all; }
.ts-result-copy { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 2px 5px; font-size: 0.85rem; flex-shrink: 0; transition: color 0.15s; line-height: 1; }
.ts-result-copy:hover { color: var(--gold); }

/* ─── Color Converter ──────────────────────────────────────────────────────── */
.color-panel { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 0; gap: 12px; }
.color-converter { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; flex-shrink: 0; }
.color-preview-wrap { position: relative; width: 100px; height: 100px; flex-shrink: 0; border-radius: 14px; overflow: hidden; border: 2px solid var(--border); cursor: pointer; }
.color-preview { width: 100%; height: 100%; background: #3a7bf5; transition: background 0.08s; }
.color-picker-overlay { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.color-fields { flex: 1; display: flex; flex-direction: column; gap: 9px; min-width: 220px; justify-content: center; }
.color-field-group { display: flex; align-items: center; gap: 8px; }
.color-field-ctrl { display: flex; gap: 5px; flex: 1; align-items: center; }
.color-copy-btn { height: 31px; padding: 0 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.74rem; cursor: pointer; display: flex; align-items: center; gap: 4px; flex-shrink: 0; transition: all 0.15s; white-space: nowrap; }
.color-copy-btn:hover { border-color: var(--gold); color: var(--gold); }
.color-save-bar { display: flex; gap: 8px; align-items: center; flex-shrink: 0; padding-bottom: 4px; }
.color-label-input { flex: 1; height: 36px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-size: 0.85rem; padding: 0 12px; transition: border-color 0.15s; }
.color-label-input:focus { outline: none; border-color: var(--gold); }
.color-field-lbl { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); min-width: 34px; flex-shrink: 0; }
.color-hex-input { height: 33px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: 'Cascadia Code','Fira Code','Consolas',monospace; font-size: 0.84rem; padding: 0 10px; flex: 1; transition: border-color 0.15s; }
.color-hex-input:focus { outline: none; border-color: var(--gold); }
.color-num-input { width: 58px; height: 33px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: 'Cascadia Code','Fira Code','Consolas',monospace; font-size: 0.82rem; padding: 0 6px; text-align: center; transition: border-color 0.15s; }
.color-num-input:focus { outline: none; border-color: var(--gold); }
.color-history-grid { display: flex !important; flex-wrap: wrap !important; flex-direction: row !important; gap: 10px !important; padding: 4px 0 !important; align-items: flex-start !important; }
.color-swatch-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.color-swatch { width: 46px; height: 46px; border-radius: 9px; border: 2px solid var(--border); transition: transform 0.15s, border-color 0.15s; }
.color-swatch-item:hover .color-swatch { transform: scale(1.1); border-color: var(--gold); }
.color-swatch-label { font-family: 'Cascadia Code','Fira Code','Consolas',monospace; font-size: 0.6rem; color: var(--text-muted); max-width: 52px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.color-swatch-del { display: none; position: absolute; top: -5px; right: -5px; background: var(--bg-dark); border: 1px solid var(--border); border-radius: 50%; width: 16px; height: 16px; align-items: center; justify-content: center; font-size: 0.6rem; color: var(--text-muted); cursor: pointer; line-height: 1; padding: 0; }
.color-swatch-item:hover .color-swatch-del { display: flex; }

/* ─── JSON Log Viewer ──────────────────────────────────────────────────────── */
.log-top-section { flex-shrink: 0; padding: 14px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.log-input-ta { height: 88px; resize: none; min-height: 88px; max-height: 88px; }
.log-action-bar { display: flex; gap: 8px; }
.log-filter-row { flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px; flex-wrap: wrap; border-bottom: 1px solid var(--border); }
.log-stats-label { font-size: 0.74rem; color: var(--text-muted); flex: 1; text-align: right; min-width: 0; }
.log-entries { flex: 1; overflow-y: auto; padding: 6px 12px 16px; scrollbar-width: thin; }
.log-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.log-entry { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px; border-radius: var(--radius-sm); margin-bottom: 1px; font-size: 0.79rem; cursor: pointer; flex-wrap: wrap; border-left: 3px solid transparent; transition: background 0.1s; }
.log-entry:hover { background: var(--bg-card); }
.log-badge { font-size: 0.63rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 5px; border-radius: 3px; flex-shrink: 0; line-height: 1.6; }
.log-badge-trace  { background: rgba(150,150,150,.15); color: #a0a0a0; }
.log-badge-debug  { background: rgba(100,180,255,.14); color: #64b4ff; }
.log-badge-info   { background: rgba(86,211,100,.14);  color: #56d364; }
.log-badge-warn   { background: rgba(210,170,50,.16);  color: #d2aa32; }
.log-badge-error  { background: rgba(255,100,100,.16); color: #ff6b6b; }
.log-badge-fatal  { background: rgba(255,40,40,.22);   color: #ff3232; font-weight:900; }
.log-lvl-debug { border-left-color: #64b4ff; }
.log-lvl-info  { border-left-color: #56d364; }
.log-lvl-warn  { border-left-color: #d2aa32; }
.log-lvl-error { border-left-color: #ff6b6b; }
.log-lvl-fatal { border-left-color: #ff3232; }
.log-time { font-family: 'Cascadia Code','Fira Code','Consolas',monospace; font-size: 0.74rem; color: var(--text-muted); flex-shrink: 0; }
.log-ctx { font-size: 0.72rem; color: var(--gold); flex-shrink: 0; font-weight: 600; }
.log-reqid { font-size: 0.64rem; color: var(--text-muted); opacity: .65; background: var(--bg-darkest); padding: 1px 5px; border-radius: 3px; font-family: monospace; flex-shrink: 0; cursor: help; }
.log-msg { flex: 1; color: var(--text-primary); line-height: 1.4; white-space: pre-wrap; word-break: break-word; min-width: 0; }
.log-expand-btn { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 0.75rem; padding: 0 4px; vertical-align: middle; text-decoration: underline; }
.log-raw { flex-basis: 100%; width: 100%; margin-top: 6px; padding: 8px 12px; background: var(--bg-darkest); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.73rem; font-family: 'Cascadia Code','Fira Code','Consolas',monospace; white-space: pre-wrap; word-break: break-word; color: var(--text-secondary); overflow-x: auto; }
.log-stat-trace { color: #a0a0a0; } .log-stat-debug { color: #64b4ff; }
.log-stat-info  { color: #56d364; } .log-stat-warn  { color: #d2aa32; }
.log-stat-error { color: #ff6b6b; } .log-stat-fatal { color: #ff3232; }

/* --- Shared action buttons (Timestamp, Log Viewer, Color) ------------------- */
.ts-act-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 0.82rem; font-weight: 600; cursor: pointer; flex-shrink: 0; white-space: nowrap; transition: border-color 0.15s, color 0.15s, opacity 0.15s; }
.ts-act-btn:hover { border-color: var(--gold); color: var(--text-primary); }
.ts-act-btn--primary { background: var(--gold); border-color: transparent; color: #1a1a1a; font-weight: 700; }
.ts-act-btn--primary:hover { opacity: 0.88; border-color: transparent; color: #1a1a1a; }

/* ── UUID Tool ── */
.tool-simple-card {
  padding: 20px;
}
.tool-simple-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
}
.uuid-output-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}
.uuid-output {
  flex: 1;
  font-family: monospace;
  font-size: 0.95rem;
}
.uuid-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.uuid-count-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Regex Tool ── */
.regex-pattern-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}
.regex-slash {
  font-size: 1.2rem;
  font-weight: 300;
  opacity: 0.5;
}
.regex-results {
  margin-top: 12px;
}
.regex-match-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
}
.regex-match-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.regex-match-idx {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.78rem;
}
.regex-match-val {
  background: rgba(186,154,66,0.15);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}
.regex-match-pos {
  opacity: 0.5;
  font-size: 0.78rem;
}
.regex-groups {
  width: 100%;
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 2px;
}
.regex-no-match, .regex-error {
  font-size: 0.85rem;
  padding: 8px 12px;
  border-radius: 6px;
}
.regex-no-match { opacity: 0.5; }
.regex-error { color: var(--danger); background: rgba(224,90,82,0.1); }

/* ── Lorem Controls ── */
.lorem-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

/* ── MD → PDF Converter ── */
.mdpdf-wrap {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.mdpdf-editor-col {
  width: 30%;
  min-width: 250px;
  max-width: 420px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 0 10px 16px;
}
.mdpdf-ta {
  flex: 1;
  resize: none;
  min-height: 0;
}
.mdpdf-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  opacity: 0.7;
}
.mdpdf-preview-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 12px 10px;
}
.mdpdf-page-info {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
  opacity: 0.8;
}
.mdpdf-preview-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg-darkest);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 14px;
}
.mdpdf-paper {
  background: #fff;
  margin: 0 auto;
  width: 210mm;
  min-height: 120px;
  padding: 18mm;
  border-radius: 3px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.mdpdf-empty {
  color: #9ca3af;
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
  padding: 40px 10px;
}
.mdpdf-empty i {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 8px;
  opacity: 0.6;
}

/* Settings column */
.mdpdf-settings-col {
  width: 244px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--bg-darkest);
}
.mdpdf-settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
  scrollbar-width: thin;
}
.mdpdf-set-section { margin-bottom: 20px; }
.mdpdf-set-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
  margin-bottom: 8px;
}
.mdpdf-font-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.mdpdf-font-tabs button {
  flex: 1;
  padding: 4px 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.mdpdf-font-tabs button:hover { color: var(--text-primary); }
.mdpdf-font-tabs button.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(186, 154, 66, 0.08);
}
.mdpdf-font-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mdpdf-font-item {
  text-align: left;
  padding: 8px 11px;
  font-size: 0.92rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.mdpdf-font-item:hover { background: var(--bg-hover); }
.mdpdf-font-item.active {
  border-color: var(--gold);
  background: rgba(186, 154, 66, 0.08);
}
.mdpdf-font-item small {
  display: block;
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.04em;
  margin-top: 1px;
}
.mdpdf-swatch-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.mdpdf-swatch {
  display: flex;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid var(--border);
  padding: 0;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, transform 0.1s;
}
.mdpdf-swatch:hover { transform: scale(1.08); }
.mdpdf-swatch.active { border-color: var(--gold); }
.mdpdf-swatch span { flex: 1; }
.mdpdf-color-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mdpdf-color-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  font-size: 0.76rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.mdpdf-color-row input[type="color"] {
  width: 26px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: none;
  cursor: pointer;
}
.mdpdf-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.mdpdf-set-row select {
  width: 118px;
  padding: 4px 8px;
  font-size: 0.76rem;
}
.mdpdf-download-wrap {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
}
.mdpdf-download-btn {
  width: 100%;
  justify-content: center;
}
.mdpdf-docx-btn {
  margin-top: 8px;
}
.mdpdf-download-hint {
  font-size: 0.64rem;
  line-height: 1.45;
  color: var(--text-muted);
  opacity: 0.75;
  text-align: center;
  margin-top: 7px;
}
.mdpdf-spin {
  display: inline-block;
  animation: mdpdfSpin 0.9s linear infinite;
}
@keyframes mdpdfSpin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .mdpdf-wrap {
    flex-direction: column;
    overflow-y: auto;
  }
  .mdpdf-editor-col {
    width: auto;
    max-width: none;
    padding: 14px 16px 0;
  }
  .mdpdf-ta { min-height: 180px; }
  .mdpdf-preview-col {
    padding: 12px 16px 0;
    min-height: 340px;
  }
  .mdpdf-preview-scroll { min-height: 300px; }
  .mdpdf-settings-col {
    width: auto;
    border-left: none;
    border-top: 1px solid var(--border);
    margin-top: 12px;
  }
  .mdpdf-settings-scroll { overflow-y: visible; }
}

@media (max-width: 600px) {
  .lorem-controls { flex-direction: column; }
  .regex-pattern-row { flex-wrap: wrap; }
}
