/* === GoodWeather · tools page styles ===
 * Header + tabs + tool panels. Keeps typography tight, no giant shadows,
 * no decorative gradient orbs. 8px and under radii.
 */

/* ---------- Header ---------- */
.tools-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.82);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
          backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid #eef2f7;
}
.tools-header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tools-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tools-brand-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: linear-gradient(135deg,#38bdf8,#0284c7);
  display: grid; place-items: center; font-size: 20px; color: #fff;
}
.tools-brand-name { font-weight: 600; color: #0c4a6e; font-size: 18px; line-height: 1.2; }
.tools-brand-tag { font-size: 11px; color: #64748b; margin-top: 2px; letter-spacing: 0.02em; }

/* Header weather widget (link to weather.html) */
.tools-header-right { display: flex; align-items: center; min-width: 0; }
.header-weather {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px;
  border-radius: 999px;
  background: rgba(14,165,233,0.08);
  border: 1px solid rgba(14,165,233,0.18);
  text-decoration: none; color: #0c4a6e;
  transition: background .15s ease, border-color .15s ease;
}
.header-weather:hover { background: rgba(14,165,233,0.14); border-color: rgba(14,165,233,0.32); }
.header-weather.loading { opacity: .7; }
.hw-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hw-emoji { font-size: 18px; line-height: 1; }
.hw-name { font-size: 13px; font-weight: 500; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-temp { display: flex; align-items: flex-start; }
.hw-temp-val { font-size: 18px; font-weight: 600; line-height: 1; }
.hw-temp-unit { font-size: 12px; line-height: 1; margin-left: 1px; margin-top: 2px; opacity: .8; }
.hw-temp-loading { width: 32px; }
.hw-meta { font-size: 12px; opacity: .8; }
.hw-hilo .hw-hi { color: #ef4444; margin-right: 1px; }
.hw-hilo .hw-sep { color: #94a3b8; margin: 0 2px; }
.hw-hilo .hw-lo { color: #0ea5e9; }
.hw-arrow { font-size: 16px; opacity: .4; margin-left: 4px; }

@media (max-width: 640px) {
  .tools-brand-tag { display: none; }
  .hw-name { display: none; }
  .hw-meta { display: none; }
}

/* ---------- Tabs ---------- */
.tools-tabs {
  background: #f8fafc; border-bottom: 1px solid #eef2f7;
}
.tools-tabs-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 20px;
  display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none;
}
.tools-tabs-inner::-webkit-scrollbar { display: none; }
.tools-tab {
  border: none; background: transparent;
  padding: 12px 18px;
  font-size: 14px; color: #475569;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color .15s ease, border-color .15s ease;
}
.tools-tab:hover { color: #0c4a6e; }
.tools-tab.active { color: #0369a1; border-bottom-color: #0ea5e9; font-weight: 500; }

/* ---------- Main ---------- */
.tools-main { max-width: 1280px; margin: 0 auto; padding: 20px; }
.tools-pane { animation: pane-fade .25s ease; }
@keyframes pane-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Tools pane (submenu + content) ---------- */
.tools-pane-tools {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 768px) {
  .tools-pane-tools { grid-template-columns: 1fr; }
  .tools-submenu { position: relative; top: 0; }
}
.tools-submenu {
  position: sticky; top: 96px;
  display: flex; flex-direction: column; gap: 2px;
  background: #fff; border: 1px solid #eef2f7; border-radius: 8px;
  padding: 8px;
  max-height: calc(100vh - 120px); overflow-y: auto;
}
@media (max-width: 768px) {
  .tools-submenu { flex-direction: row; overflow-x: auto; max-height: none; padding: 6px; }
}
.tools-submenu-title {
  padding: 8px 10px; font-size: 11px; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
}
@media (max-width: 768px) { .tools-submenu-title { display: none; } }
.tools-submenu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border: none; background: transparent;
  font-size: 13px; color: #475569; border-radius: 6px; cursor: pointer;
  text-align: left; white-space: nowrap;
}
.tools-submenu-item:hover { background: #f1f5f9; color: #0c4a6e; }
.tools-submenu-item.active { background: #e0f2fe; color: #0369a1; font-weight: 500; }
.tools-submenu-icon {
  display: inline-grid; place-items: center;
  width: 26px; height: 22px; border-radius: 5px;
  background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 600;
  font-family: ui-monospace, monospace; flex-shrink: 0;
}
.tools-submenu-item.active .tools-submenu-icon { background: #bae6fd; color: #0369a1; }
.tools-content { min-width: 0; }

/* ---------- Tool panels (shared) ---------- */
.tool-panel { display: flex; flex-direction: column; gap: 12px; }
.tool-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.tool-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tool-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #475569; cursor: pointer; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tool-row-end { grid-column: 1 / -1; display: flex; gap: 8px; }
.tool-seg { display: inline-flex; background: #f1f5f9; border-radius: 6px; padding: 2px; }
.tool-seg-btn {
  border: none; background: transparent;
  padding: 4px 10px; border-radius: 4px;
  font-size: 12px; color: #475569; cursor: pointer;
}
.tool-seg-btn:hover { color: #0c4a6e; }
.tool-seg-btn.active { background: #fff; color: #0369a1; box-shadow: 0 1px 2px rgba(15,23,42,0.06); }

.tool-input, .tool-input-narrow {
  height: 32px; padding: 0 10px; border-radius: 6px;
  border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; color: #1f2937;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tool-input:focus, .tool-input-narrow:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.tool-input-narrow { width: 130px; }
.tool-input-cell {
  height: 26px; padding: 0 8px; border-radius: 4px;
  border: 1px solid #e2e8f0; background: #fff;
  font-size: 12px; width: 100%; outline: none;
}
.tool-input-cell:focus { border-color: #38bdf8; box-shadow: 0 0 0 2px rgba(56,189,248,0.15); }
.tool-textarea {
  width: 100%; min-height: 220px; padding: 10px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 12.5px; line-height: 1.55; color: #1f2937;
  background: #fff; resize: vertical; outline: none;
}
.tool-textarea:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.tool-pane-meta { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.tool-error {
  margin-top: 6px; padding: 8px 12px; border-radius: 6px;
  background: #fef2f2; color: #b91c1c; font-size: 12.5px;
  border: 1px solid #fecaca;
}
.tool-error-loc { margin-top: 2px; color: #ef4444; font-size: 12px; }
.tool-empty { padding: 40px; text-align: center; color: #94a3b8; font-size: 13px; }

/* Split layout */
.tool-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 768px) { .tool-split { grid-template-columns: 1fr; } }
.tool-pane {
  display: flex; flex-direction: column; min-width: 0;
  background: #fff; border: 1px solid #eef2f7; border-radius: 8px;
  padding: 10px;
}
.tool-pane-header {
  font-size: 11px; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 6px;
}

/* Buttons */
.btn-primary, .btn-ghost, .btn-tiny {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; font-size: 12.5px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  font-family: inherit;
}
.btn-primary {
  background: #0ea5e9; color: #fff; border: 1px solid #0ea5e9;
  padding: 6px 14px; font-weight: 500;
}
.btn-primary:hover { background: #0284c7; border-color: #0284c7; }
.btn-primary:disabled { background: #bae6fd; border-color: #bae6fd; cursor: not-allowed; }
.btn-ghost {
  background: #fff; color: #475569; border: 1px solid #e2e8f0;
  padding: 5px 12px;
}
.btn-ghost:hover { background: #f1f5f9; color: #0c4a6e; }
.btn-ghost:disabled { color: #cbd5e1; cursor: not-allowed; }
.btn-ghost.btn-danger { color: #b91c1c; border-color: #fecaca; }
.btn-ghost.btn-danger:hover { background: #fef2f2; }
.btn-tiny {
  background: #f1f5f9; color: #475569; border: none;
  padding: 2px 8px; font-size: 11px;
}
.btn-tiny:hover { background: #e2e8f0; }
.btn-tiny.btn-danger { background: #fef2f2; color: #b91c1c; }
.btn-tiny.btn-danger:hover { background: #fee2e2; }

/* ---------- Tool cards (used in map tab / timestamp tab / color tab) ---------- */
.tool-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 768px) { .tool-grid-2 { grid-template-columns: 1fr; } }
.tool-card {
  background: #fff; border: 1px solid #eef2f7; border-radius: 8px;
  padding: 14px;
}
.tool-card-title {
  font-size: 14px; font-weight: 600; color: #0c4a6e; margin-bottom: 10px;
}
.tool-tip { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.tool-hint { font-size: 12px; color: #64748b; }
.tool-hint-block { margin-top: 8px; }
.tool-hint-block summary { font-size: 11px; color: #64748b; cursor: pointer; }
.tool-hint-list { padding-left: 16px; font-size: 12px; color: #475569; line-height: 1.7; }

/* Timestamp result list */
.tool-result-list { list-style: none; padding: 0; margin: 0; }
.tool-result-list li {
  display: grid; grid-template-columns: 110px 1fr 50px;
  align-items: center; gap: 8px; padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}
.tool-result-list li:last-child { border-bottom: none; }
.tool-result-key { font-size: 12px; color: #64748b; }
.tool-result-val {
  font-family: ui-monospace, monospace; font-size: 12.5px;
  color: #1f2937; word-break: break-all;
}

/* ---------- Color tool ---------- */
.tool-swatch {
  width: 38px; height: 38px; border-radius: 6px;
  border: 1px solid #e2e8f0; flex-shrink: 0;
}
.tool-contrast { font-size: 12px; color: #64748b; }
.tool-format-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px;
}
@media (max-width: 480px) { .tool-format-grid { grid-template-columns: 1fr; } }
.tool-format {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: #f8fafc;
  border: 1px solid #eef2f7; border-radius: 6px;
}
.tool-format-label {
  font-family: ui-monospace, monospace; font-size: 10.5px;
  color: #64748b; min-width: 38px;
}
.tool-format-val {
  font-family: ui-monospace, monospace; font-size: 12px;
  color: #1f2937; flex: 1; word-break: break-all;
}

/* ---------- Regex tool ---------- */
.tool-regex-literal {
  display: inline-grid; place-items: center;
  width: 18px; height: 32px; color: #94a3b8; font-family: ui-monospace, monospace;
}
.tool-highlight {
  margin-top: 6px; padding: 10px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 6px;
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-all;
  min-height: 60px; max-height: 240px; overflow-y: auto;
}
.mark-regex {
  background: #fef08a; border-radius: 2px; padding: 0 1px; color: #854d0e;
}
.tool-match-list { margin-top: 8px; }
.tool-match-list code {
  font-family: ui-monospace, monospace; font-size: 12px;
  background: #f1f5f9; padding: 1px 5px; border-radius: 3px;
}
.tool-group {
  margin-right: 4px;
}

/* ---------- URL parse table ---------- */
.tool-parse-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #1f2937;
  resize: vertical;
  outline: none;
  word-break: break-all;
  white-space: pre-wrap;
}
.tool-parse-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
/* Full-width variant used by the "Parse URL & Query" input. Spans the entire
 * tool card so long URLs can be entered without horizontal scrolling, and
 * allows vertical resize for very long inputs. */
.tool-parse-input-wide {
  display: block;
  width: 100%;
  flex: 0 0 auto;
  min-height: 120px;
  max-height: 360px;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}
.tool-row-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}
.tool-parse-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 12px;
  margin-top: 8px; padding: 8px 10px; background: #f8fafc;
  border-radius: 6px; font-size: 12.5px;
}
@media (max-width: 480px) { .tool-parse-grid { grid-template-columns: 1fr; } }
.tool-meta-key { display: inline-block; min-width: 70px; color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; margin-right: 8px; }
.tool-meta-val { color: #1f2937; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; }

/* ---------- Tables ---------- */
.tool-table-wrap { overflow-x: auto; border-radius: 6px; border: 1px solid #eef2f7; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.tool-table th {
  padding: 8px 10px; background: #f8fafc; color: #64748b;
  font-weight: 500; text-align: left;
  border-bottom: 1px solid #eef2f7;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap;
}
.tool-table td {
  padding: 6px 10px; border-bottom: 1px solid #f1f5f9;
  color: #1f2937; font-size: 12.5px;
  font-family: ui-monospace, monospace;
}
.tool-table tr:last-child td { border-bottom: none; }
.tool-table-batch td, .tool-table-batch th { white-space: nowrap; }

/* ---------- AI tab ---------- */
.ai-tab { display: flex; flex-direction: column; gap: 16px; }
.ai-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: #fff;
  border: 1px solid #eef2f7; border-radius: 8px;
}
.ai-cats { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-cat-btn {
  border: 1px solid #e2e8f0; background: #fff;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12px; color: #475569; cursor: pointer;
}
.ai-cat-btn:hover { background: #f1f5f9; color: #0c4a6e; }
.ai-cat-btn.active { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.ai-search-wrap { flex: 1; min-width: 220px; }
.ai-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ai-card {
  position: relative;
  display: grid; grid-template-columns: 44px 1fr;
  gap: 12px; padding: 14px;
  background: #fff; border: 1px solid #eef2f7; border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ai-card:hover { border-color: #bae6fd; box-shadow: 0 6px 16px -10px rgba(14,165,233,0.30); }
.ai-logo {
  width: 44px; height: 44px; border-radius: 8px;
  display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 18px;
  text-transform: uppercase;
  grid-row: 1 / 3;
}
.ai-body { min-width: 0; }
.ai-name { font-weight: 600; color: #0c4a6e; font-size: 14px; }
.ai-desc { font-size: 12px; color: #475569; margin-top: 4px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.ai-tags .chip { background: #f1f5f9; color: #475569; font-size: 11px; }
.ai-visit {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; color: #0369a1; text-decoration: none;
  padding: 2px 8px; border-radius: 999px; background: #e0f2fe;
}
.ai-visit:hover { background: #bae6fd; }

/* ---------- Map tab ---------- */
.map-tab { display: flex; flex-direction: column; gap: 16px; }
.tool-grid-form {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px; align-items: end;
}
@media (max-width: 768px) { .tool-grid-form { grid-template-columns: 1fr 1fr; } }
.tool-grid-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #475569; }
.tool-grid-form select {
  height: 32px; padding: 0 8px; border-radius: 6px;
  border: 1px solid #e2e8f0; background: #fff;
  font-size: 13px; color: #1f2937; outline: none;
}
.tool-grid-form select:focus { border-color: #38bdf8; box-shadow: 0 0 0 3px rgba(56,189,248,0.15); }
.tool-result-box {
  margin-top: 10px; padding: 10px 12px;
  background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 6px;
  font-size: 13px; color: #0c4a6e;
}
.tool-file-label {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.tool-err-mark { color: #b91c1c; font-size: 11px; }
.tool-ok-mark { color: #059669; font-size: 11px; font-weight: 500; }

/* ---------- Footer ---------- */
.tools-footer {
  text-align: center; padding: 24px 20px 40px;
  font-size: 11px; color: #94a3b8; border-top: 1px solid #eef2f7;
  margin-top: 32px;
}

/* ---------- JSON / JSON⇄XML "fill the screen" variants ---------- */
.tool-panel-fill { min-height: calc(100vh - 200px); }
.tool-split-fill { min-height: calc(100vh - 220px); }
.tool-pane-fill  { height: 100%; display: flex; flex-direction: column; min-width: 0; }
.tool-textarea-fill {
  flex: 1 1 auto;
  min-height: calc(100vh - 320px);
  height: calc(100vh - 320px);
  resize: none;
}
.tool-tree-fill {
  flex: 1 1 auto;
  min-height: calc(100vh - 320px);
  max-height: calc(100vh - 220px);
  overflow: auto;
  border: 1px solid #e2e8f0; border-radius: 6px;
  background: #fff; padding: 10px;
}
.tool-pane-meta-inline {
  font-weight: 400; color: #94a3b8; font-size: 11px;
  text-transform: none; letter-spacing: 0; margin-left: 8px;
}
.tool-fallback-pre {
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: 12.5px; line-height: 1.55; color: #1f2937;
  white-space: pre-wrap; word-break: break-all;
  margin: 0; padding: 10px;
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 6px;
}

/* ---------- Color tool (picker + sampler) ---------- */
.tool-color-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.tool-color-native {
  width: 56px; height: 38px; padding: 2px; border: 1px solid #e2e8f0;
  border-radius: 6px; background: #fff; cursor: pointer;
}
.tool-color-preview {
  width: 110px; height: 38px; border-radius: 6px;
  display: grid; place-items: center;
  border: 1px solid #e2e8f0; overflow: hidden;
}
.tool-color-preview-text {
  font-family: ui-monospace, monospace; font-size: 12px; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.tool-color-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-color-image-wrap { margin-top: 10px; }
.tool-color-image {
  display: block; max-width: 100%; max-height: 360px;
  border-radius: 6px; border: 1px solid #e2e8f0; cursor: crosshair;
}

/* ---------- Regex tool (simplified match tester) ---------- */
/* Pattern input: full-width, taller so long expressions stay readable.
 * Reuses .tool-textarea for the monospace / border / focus look, and
 * overrides min-height + horizontal scrolling here. */
.tool-input-pattern {
  min-height: 72px;
  height: auto;
  white-space: pre;
  overflow-x: auto;
  word-break: normal;
  resize: vertical;
}
/* Base chip used by preset row + the AI tags. */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e2e8f0; background: #fff; color: #475569;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; cursor: pointer; line-height: 1.4;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip:hover { background: #f1f5f9; color: #0c4a6e; }
.chip.active { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; font-weight: 500; }
.chip.chip-danger { color: #b91c1c; border-color: #fecaca; }
.chip.chip-danger:hover { background: #fef2f2; }
/* Inline variant for the highlighted match in the result table. */
.mark-regex-inline {
  background: #fef08a; border-radius: 3px; padding: 1px 4px; color: #854d0e;
  font-family: ui-monospace, monospace;
}
/* Password strength meter. */
.tool-strength { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 220px; }
.tool-strength-bar {
  position: relative; flex: 1; height: 8px;
  background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.tool-strength-fill {
  position: absolute; top: 0; left: 0; bottom: 0;
  border-radius: 4px; transition: width .25s ease, background-color .25s ease;
  background: #94a3b8;
}
.tool-strength-fill.lv0 { background: #ef4444; }
.tool-strength-fill.lv1 { background: #f97316; }
.tool-strength-fill.lv2 { background: #eab308; }
.tool-strength-fill.lv3 { background: #22c55e; }
.tool-strength-fill.lv4 { background: #0ea5e9; }
.tool-strength-label { font-size: 12px; color: #475569; min-width: 36px; }

/* ---------- Image tools (QR + compression) ---------- */
.image-tab { display: flex; flex-direction: column; gap: 16px; }
.qr-grid {
  display: grid; grid-template-columns: 1fr 280px; gap: 16px;
  align-items: start;
}
@media (max-width: 768px) { .qr-grid { grid-template-columns: 1fr; } }
.qr-preview {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px; background: #f8fafc;
  border: 1px solid #eef2f7; border-radius: 8px;
}
.qr-canvas {
  display: block; max-width: 100%; height: auto;
  background: #fff; border-radius: 4px;
  image-rendering: pixelated;
}
.qr-scan-img {
  display: block; max-width: 100%; max-height: 360px;
  border-radius: 6px; border: 1px solid #e2e8f0;
}
.compress-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  margin-top: 12px;
}
@media (max-width: 768px) { .compress-grid { grid-template-columns: 1fr; } }
.compress-preview {
  display: block; width: 100%; max-height: 320px;
  object-fit: contain;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border: 1px solid #e2e8f0; border-radius: 6px;
}
.compress-saving-good { color: #059669; font-weight: 500; }
.compress-saving-bad  { color: #b91c1c; font-weight: 500; }

/* ---------- Image compression tool (multi-file batch + side-by-side preview) ---------- */
.ic-file-list {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  border-bottom: 1px solid #eef2f7; margin-bottom: 12px;
}
.ic-file-chip {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 6px; min-width: 180px; max-width: 260px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px;
  cursor: pointer; flex-shrink: 0;
  transition: border-color .15s ease, background .15s ease;
}
.ic-file-chip:hover { border-color: #bae6fd; }
.ic-file-chip.active { border-color: #0ea5e9; background: #e0f2fe; }
.ic-file-chip.has-error { border-color: #fecaca; background: #fef2f2; }
.ic-file-thumb {
  width: 36px; height: 36px; object-fit: cover; border-radius: 4px;
  background: #fff; border: 1px solid #e2e8f0;
}
.ic-file-meta { min-width: 0; flex: 1; }
.ic-file-name {
  font-size: 12px; color: #1f2937;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ic-file-info {
  font-size: 11px; color: #64748b; font-family: ui-monospace, monospace;
}
.ic-file-busy { font-size: 12px; color: #0ea5e9; }
.ic-file-x {
  width: 20px; height: 20px; border: none; background: transparent;
  color: #94a3b8; font-size: 16px; line-height: 1; cursor: pointer;
  border-radius: 4px;
}
.ic-file-x:hover { background: #fee2e2; color: #b91c1c; }
.ic-main {
  display: grid; grid-template-columns: 280px 1fr; gap: 16px;
}
@media (max-width: 900px) { .ic-main { grid-template-columns: 1fr; } }
.ic-group { padding: 10px 0; border-top: 1px dashed #eef2f7; }
.ic-group:first-of-type { border-top: none; padding-top: 0; }
.ic-group-title {
  font-size: 11px; color: #64748b; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 6px; font-weight: 500;
}
.ic-preview {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 8px;
}
@media (max-width: 600px) { .ic-preview { grid-template-columns: 1fr; } }
.ic-preview-pane { display: flex; flex-direction: column; min-width: 0; }
.ic-preview-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 6px; flex-wrap: wrap;
}
.ic-preview-tag {
  font-size: 11px; color: #fff; background: #64748b;
  padding: 1px 6px; border-radius: 4px;
}
.ic-preview-tag-out { background: #0ea5e9; }
.ic-preview-meta {
  font-size: 11px; color: #475569; font-family: ui-monospace, monospace;
}
